Index: src/elrail.cpp =================================================================== --- src/elrail.cpp (revision 10403) +++ src/elrail.cpp (working copy) @@ -272,7 +272,7 @@ SpriteID img = pylons_normal[temp]; SpriteID pal = PAL_NONE; - if (HASBIT(_transparent_opt, TO_BUILDINGS)) { + if (HASBIT(_transparent_opt, TO_CATENARY)) { SETBIT(img, PALETTE_MODIFIER_TRANSPARENT); pal = PALETTE_TO_TRANSPARENT; } @@ -286,7 +286,7 @@ } /* Don't draw a wire under a low bridge */ - if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile) && !HASBIT(_transparent_opt, TO_BUILDINGS)) { + if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile) && !HASBIT(_transparent_opt, TO_CATENARY)) { uint height = GetBridgeHeight(GetNorthernBridgeEnd(ti->tile)); if (height <= GetTileMaxZ(ti->tile) + TILE_HEIGHT) return; @@ -317,7 +317,7 @@ SpriteID img = sss->image; SpriteID pal = PAL_NONE; - if (HASBIT(_transparent_opt, TO_BUILDINGS)) { + if (HASBIT(_transparent_opt, TO_CATENARY)) { SETBIT(img, PALETTE_MODIFIER_TRANSPARENT); pal = PALETTE_TO_TRANSPARENT; } @@ -356,7 +356,7 @@ SpriteID img = sss->image; SpriteID pal = PAL_NONE; - if (HASBIT(_transparent_opt, TO_BUILDINGS)) { + if (HASBIT(_transparent_opt, TO_CATENARY)) { SETBIT(img, PALETTE_MODIFIER_TRANSPARENT); pal = PALETTE_TO_TRANSPARENT; } @@ -370,11 +370,11 @@ if (num % 2) { if (axis == AXIS_X) { img = pylons_bridge[0 + HASBIT(tlg, 0)]; - if (HASBIT(_transparent_opt, TO_BUILDINGS)) SETBIT(img, PALETTE_MODIFIER_TRANSPARENT); + if (HASBIT(_transparent_opt, TO_CATENARY)) SETBIT(img, PALETTE_MODIFIER_TRANSPARENT); AddSortableSpriteToDraw(img, pal, ti->x, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, height); } else { img = pylons_bridge[2 + HASBIT(tlg, 1)]; - if (HASBIT(_transparent_opt, TO_BUILDINGS)) SETBIT(img, PALETTE_MODIFIER_TRANSPARENT); + if (HASBIT(_transparent_opt, TO_CATENARY)) SETBIT(img, PALETTE_MODIFIER_TRANSPARENT); AddSortableSpriteToDraw(img, pal, ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y, 1, 1, 10, height); } } @@ -383,11 +383,11 @@ if (DistanceMax(ti->tile, start) == length) { if (axis == AXIS_X) { img = pylons_bridge[0 + HASBIT(tlg, 0)]; - if (HASBIT(_transparent_opt, TO_BUILDINGS)) SETBIT(img, PALETTE_MODIFIER_TRANSPARENT); + if (HASBIT(_transparent_opt, TO_CATENARY)) SETBIT(img, PALETTE_MODIFIER_TRANSPARENT); AddSortableSpriteToDraw(img, pal, ti->x + 16, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, height); } else { img = pylons_bridge[2 + HASBIT(tlg, 1)]; - if (HASBIT(_transparent_opt, TO_BUILDINGS)) SETBIT(img, PALETTE_MODIFIER_TRANSPARENT); + if (HASBIT(_transparent_opt, TO_CATENARY)) SETBIT(img, PALETTE_MODIFIER_TRANSPARENT); AddSortableSpriteToDraw(img, pal, ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y + 16, 1, 1, 10, height); } } @@ -412,7 +412,7 @@ SpriteID img = sss->image; SpriteID pal = PAL_NONE; - if (HASBIT(_transparent_opt, TO_BUILDINGS)) { + if (HASBIT(_transparent_opt, TO_CATENARY)) { SETBIT(img, PALETTE_MODIFIER_TRANSPARENT); pal = PALETTE_TO_TRANSPARENT; } Index: src/lang/english.txt =================================================================== --- src/lang/english.txt (revision 10403) +++ src/lang/english.txt (working copy) @@ -3308,6 +3308,7 @@ STR_TRANSPARENT_BRIDGES_DESC :{BLACK}Toggle transparency for bridges STR_TRANSPARENT_STRUCTURES_DESC :{BLACK}Toggle transparency for structures like lighthouses and antennas, maybe in future for eyecandy STR_TRANSPARENT_LOADING_DESC :{BLACK}Toggle transparency for loading indicators +STR_TRANSPARENT_CATENARY :{BLACK}Toggle transparency for catenary STR_PERCENT_UP_SMALL :{TINYFONT}{WHITE}{NUM}%{UPARROW} STR_PERCENT_UP :{WHITE}{NUM}%{UPARROW} Index: src/main_gui.cpp =================================================================== --- src/main_gui.cpp (revision 10403) +++ src/main_gui.cpp (working copy) @@ -156,7 +156,7 @@ /** Toggle all transparency options, except for signs */ static void ToggleTransparency() { - static byte trans_opt = ~0; + static uint trans_opt = ~0; if (GB(_transparent_opt, 1, 7) == 0) { SB(_transparent_opt, 1, 7, GB(trans_opt, 1, 7)); @@ -2534,3 +2534,4 @@ + Index: src/openttd.h =================================================================== --- src/openttd.h (revision 10403) +++ src/openttd.h (working copy) @@ -194,6 +194,7 @@ TO_BRIDGES, TO_STRUCTURES, TO_LOADING, + TO_CATENARY, }; /* Landscape types */ Index: src/transparency_gui.cpp =================================================================== --- src/transparency_gui.cpp (revision 10403) +++ src/transparency_gui.cpp (working copy) @@ -24,6 +24,7 @@ TTW_WIDGET_BRIDGES, ///< Make bridges transparent TTW_WIDGET_STRUCTURES, ///< Make unmovable structures transparent TTW_WIDGET_LOADING, ///< Make loading indicators transperent + TTW_WIDGET_CATENARY, TTW_WIDGET_END, ///< End of toggle buttons }; @@ -31,7 +32,7 @@ * when clicking on a widget, and play a sound * @param widget been clicked. */ -static void Transparent_Click(byte widget) +static void Transparent_Click(uint widget) { TOGGLEBIT(_transparent_opt, widget); SndPlayFx(SND_15_BEEP); @@ -60,8 +61,8 @@ static const Widget _transparency_widgets[] = { { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, -{ WWT_CAPTION, RESIZE_NONE, 7, 11, 184, 0, 13, STR_TRANSPARENCY_TOOLB, STR_018C_WINDOW_TITLE_DRAG_THIS}, -{WWT_STICKYBOX, RESIZE_NONE, 7, 185, 196, 0, 13, STR_NULL, STR_STICKY_BUTTON}, +{ WWT_CAPTION, RESIZE_NONE, 7, 11, 206, 0, 13, STR_TRANSPARENCY_TOOLB, STR_018C_WINDOW_TITLE_DRAG_THIS}, +{WWT_STICKYBOX, RESIZE_NONE, 7, 207, 218, 0, 13, STR_NULL, STR_STICKY_BUTTON}, /* transparency widgets: * transparent signs, trees, houses, industries, player's buildings, bridges, unmovable structures and loading indicators */ @@ -73,12 +74,13 @@ { WWT_IMGBTN, RESIZE_NONE, 7, 110, 152, 14, 35, SPR_IMG_BRIDGE, STR_TRANSPARENT_BRIDGES_DESC}, { WWT_IMGBTN, RESIZE_NONE, 7, 153, 174, 14, 35, SPR_IMG_TRANSMITTER, STR_TRANSPARENT_STRUCTURES_DESC}, { WWT_IMGBTN, RESIZE_NONE, 7, 175, 196, 14, 35, SPR_IMG_TRAINLIST, STR_TRANSPARENT_LOADING_DESC}, +{ WWT_IMGBTN, RESIZE_NONE, 7, 197, 218, 14, 35, SPR_BUILD_NS_ELRAIL, STR_TRANSPARENT_CATENARY}, { WIDGETS_END}, }; static const WindowDesc _transparency_desc = { - WDP_ALIGN_TBR, 58+36, 197, 36, + WDP_ALIGN_TBR, 58+36, 219, 36, WC_TRANSPARENCY_TOOLBAR, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, _transparency_widgets, Index: src/variables.h =================================================================== --- src/variables.h (revision 10403) +++ src/variables.h (working copy) @@ -284,7 +284,7 @@ VARDEF int _autosave_ctr; VARDEF byte _display_opt; -VARDEF byte _transparent_opt; +VARDEF uint _transparent_opt; VARDEF int _caret_timer; VARDEF uint32 _news_display_opt; VARDEF bool _news_ticker_sound;