src/transparency_gui.cpp
branchnoai
changeset 9723 eee46cb39750
parent 9722 ebf0ece7d8f6
child 9724 b39bc69bb2f2
equal deleted inserted replaced
9722:ebf0ece7d8f6 9723:eee46cb39750
     2 
     2 
     3 #include "stdafx.h"
     3 #include "stdafx.h"
     4 #include "openttd.h"
     4 #include "openttd.h"
     5 #include "table/sprites.h"
     5 #include "table/sprites.h"
     6 #include "table/strings.h"
     6 #include "table/strings.h"
     7 #include "functions.h"
       
     8 #include "window.h"
       
     9 #include "gui.h"
     7 #include "gui.h"
    10 #include "viewport.h"
     8 #include "window_gui.h"
    11 #include "gfx.h"
       
    12 #include "sound.h"
       
    13 #include "variables.h"
     9 #include "variables.h"
    14 #include "transparency.h"
    10 #include "transparency.h"
       
    11 #include "sound_func.h"
    15 
    12 
    16 TransparencyOptionBits _transparency_opt;
    13 TransparencyOptionBits _transparency_opt;
    17 
    14 
    18 enum TransparencyToolbarWidgets{
    15 enum TransparencyToolbarWidgets{
    19 	/* Widgets not toggled when pressing the X key */
    16 	/* Widgets not toggled when pressing the X key */
    35 	switch (e->event) {
    32 	switch (e->event) {
    36 		case WE_PAINT:
    33 		case WE_PAINT:
    37 			/* must be sure that the widgets show the transparency variable changes
    34 			/* must be sure that the widgets show the transparency variable changes
    38 			 * also when we use shortcuts */
    35 			 * also when we use shortcuts */
    39 			for (uint i = TTW_WIDGET_SIGNS; i < TTW_WIDGET_END; i++) {
    36 			for (uint i = TTW_WIDGET_SIGNS; i < TTW_WIDGET_END; i++) {
    40 				SetWindowWidgetLoweredState(w, i, IsTransparencySet((TransparencyOption)(i - TTW_WIDGET_SIGNS)));
    37 				w->SetWidgetLoweredState(i, IsTransparencySet((TransparencyOption)(i - TTW_WIDGET_SIGNS)));
    41 			}
    38 			}
    42 			DrawWindowWidgets(w);
    39 			DrawWindowWidgets(w);
    43 			break;
    40 			break;
    44 
    41 
    45 		case WE_CLICK:
    42 		case WE_CLICK: