(svn r12103) -Feature(tte): separate catenary transparency settings from building transparency settings

This commit is contained in:
smatz
2008-02-10 15:53:26 +00:00
parent 4e839aacf6
commit 8a768652c8
7 changed files with 27 additions and 23 deletions

View File

@@ -22,6 +22,7 @@ enum TransparencyToolbarWidgets{
TTW_WIDGET_BUILDINGS, ///< Make player buildings and structures transparent
TTW_WIDGET_BRIDGES, ///< Make bridges transparent
TTW_WIDGET_STRUCTURES, ///< Make unmovable structures transparent
TTW_WIDGET_CATENARY, ///< Make catenary transparent
TTW_WIDGET_LOADING, ///< Make loading indicators transperent
TTW_WIDGET_END, ///< End of toggle buttons
};
@@ -43,7 +44,7 @@ static void TransparencyToolbWndProc(Window *w, WindowEvent *e)
break;
case WE_CLICK:
if (e->we.click.widget >= TTW_WIDGET_SIGNS) {
if (e->we.click.widget >= TTW_WIDGET_SIGNS && e->we.click.widget < TTW_WIDGET_END) {
if (_ctrl_pressed) {
/* toggle the bit of the transparencies lock variable */
ToggleTransparencyLock((TransparencyOption)(e->we.click.widget - TTW_WIDGET_SIGNS));
@@ -61,8 +62,8 @@ static void TransparencyToolbWndProc(Window *w, WindowEvent *e)
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,13 +74,14 @@ static const Widget _transparency_widgets[] = {
{ WWT_IMGBTN, RESIZE_NONE, 7, 88, 109, 14, 35, SPR_IMG_COMPANY_LIST, STR_TRANSPARENT_BUILDINGS_DESC},
{ 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, 175, 196, 14, 35, SPR_BUILD_X_ELRAIL, STR_TRANSPARENT_CATENARY_DESC},
{ WWT_IMGBTN, RESIZE_NONE, 7, 197, 218, 14, 35, SPR_IMG_TRAINLIST, STR_TRANSPARENT_LOADING_DESC},
{ WIDGETS_END},
};
static const WindowDesc _transparency_desc = {
WDP_ALIGN_TBR, 58+36, 197, 36, 197, 36,
WDP_ALIGN_TBR, 58+36, 219, 36, 219, 36,
WC_TRANSPARENCY_TOOLBAR, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
_transparency_widgets,