mirror of https://github.com/OpenTTD/OpenTTD
(svn r2438) - Feature: New display option, 'transparent station signs', makes station signs transparent instead of using a solid bar to draw text on (peter1138)
parent
89bd0b50b6
commit
6533db736c
|
@ -768,6 +768,8 @@ STR_02D1_FULL_DETAIL :{CHECKMARK}{SET
|
|||
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
|
||||
|
|
|
@ -184,6 +184,7 @@ static void MenuClickSettings(int index)
|
|||
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 @@ static void ToolbarOptionsClick(Window *w)
|
|||
{
|
||||
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 @@ static void ToolbarOptionsClick(Window *w)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
15
openttd.h
15
openttd.h
|
@ -125,13 +125,14 @@ enum {
|
|||
|
||||
/* 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 */
|
||||
|
|
|
@ -1155,13 +1155,16 @@ static void ViewportDrawStrings(DrawPixelInfo *dpi, StringSpriteToDraw *ss)
|
|||
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));
|
||||
|
|
Loading…
Reference in New Issue