# HG changeset patch # User hackykid # Date 1118746745 0 # Node ID 443977c9c77e66d51a126cd35389a0da510da602 # Parent a3e4a07e2450a0d9463356e3507a58218766146d (svn r2438) - Feature: New display option, 'transparent station signs', makes station signs transparent instead of using a solid bar to draw text on (peter1138) diff --git a/lang/english.txt b/lang/english.txt --- a/lang/english.txt +++ b/lang/english.txt @@ -768,6 +768,8 @@ STR_02D2_FULL_DETAIL :{SETX 12}Full detail STR_02D3_TRANSPARENT_BUILDINGS :{CHECKMARK}{SETX 12}Transparent buildings STR_02D4_TRANSPARENT_BUILDINGS :{SETX 12}Transparent buildings +STR_TRANSPARENT_SIGNS_C :{CHECKMARK}{SETX 12}Transparent station signs +STR_TRANSPARENT_SIGNS :{SETX 12}Transparent station signs ############ range ends here ############ range for menu starts diff --git a/main_gui.c b/main_gui.c --- a/main_gui.c +++ b/main_gui.c @@ -184,6 +184,7 @@ case 9: _display_opt ^= DO_FULL_ANIMATION; MarkWholeScreenDirty(); return; case 10: _display_opt ^= DO_FULL_DETAIL; MarkWholeScreenDirty(); return; case 11: _display_opt ^= DO_TRANS_BUILDINGS; MarkWholeScreenDirty(); return; + case 12: _display_opt ^= DO_TRANS_SIGNS; MarkWholeScreenDirty(); return; } } @@ -985,7 +986,7 @@ { uint16 x; - w = PopupMainToolbMenu(w, 43, 2, STR_02C3_GAME_OPTIONS, 12); + w = PopupMainToolbMenu(w, 43, 2, STR_02C3_GAME_OPTIONS, 13); x = (uint16)-1; if (_display_opt & DO_SHOW_TOWN_NAMES) x &= ~(1<<5); @@ -995,6 +996,7 @@ if (_display_opt & DO_FULL_ANIMATION) x &= ~(1<<9); if (_display_opt & DO_FULL_DETAIL) x &= ~(1<<10); if (_display_opt & DO_TRANS_BUILDINGS) x &= ~(1<<11); + if (_display_opt & DO_TRANS_SIGNS) x &= ~(1<<12); WP(w,menu_d).checked_items = x; } diff --git a/openttd.h b/openttd.h --- a/openttd.h +++ b/openttd.h @@ -125,13 +125,14 @@ /* Display Options */ enum { - DO_SHOW_TOWN_NAMES = 1, - DO_SHOW_STATION_NAMES = 2, - DO_SHOW_SIGNS = 4, - DO_FULL_ANIMATION = 8, - DO_TRANS_BUILDINGS = 0x10, - DO_FULL_DETAIL = 0x20, - DO_WAYPOINTS = 0x40, + DO_SHOW_TOWN_NAMES = 1 << 0, + DO_SHOW_STATION_NAMES = 1 << 1, + DO_SHOW_SIGNS = 1 << 2, + DO_FULL_ANIMATION = 1 << 3, + DO_TRANS_BUILDINGS = 1 << 4, + DO_FULL_DETAIL = 1 << 5, + DO_WAYPOINTS = 1 << 6, + DO_TRANS_SIGNS = 1 << 7, }; /* Landscape types */ diff --git a/viewport.c b/viewport.c --- a/viewport.c +++ b/viewport.c @@ -1155,13 +1155,16 @@ w -= 3; } - DrawFrameRect(x,y, x+w, bottom, ss->color, (_display_opt & DO_TRANS_BUILDINGS) ? 0x9 : 0); + /* Draw the rectangle if 'tranparent station signs' is off, or if we are drawing a general text sign (STR_2806) */ + if(!(_display_opt & DO_TRANS_SIGNS) || ss->string == STR_2806) + DrawFrameRect(x,y, x+w, bottom, ss->color, (_display_opt & DO_TRANS_BUILDINGS) ? 0x9 : 0); } SetDParam(0, ss->params[0]); SetDParam(1, ss->params[1]); SetDParam(2, ss->params[2]); - if (_display_opt & DO_TRANS_BUILDINGS && ss->width != 0) { + /* if we didnt draw a rectangle, or if transparant building is on, draw the text in the color the rectangle would have */ + if (((_display_opt & DO_TRANS_BUILDINGS) || (_display_opt & DO_TRANS_SIGNS && ss->string != STR_2806)) && ss->width != 0) { /* Real colors need the IS_PALETTE_COLOR flag, otherwise colors from _string_colormap are assumed. */ DrawString(ss->x >> zoom, (ss->y >> zoom) - (ss->width&0x8000?2:0), ss->string, (_color_list[ss->color].window_color_bgb | IS_PALETTE_COLOR));