1
0
Fork 0

Compare commits

...

5 Commits

2 changed files with 7 additions and 2 deletions

View File

@ -184,7 +184,7 @@ public:
/** /**
* Bridge offset * Bridge offset
*/ */
SpriteID bridge_offset; uint8_t bridge_offset;
/** /**
* Original railtype number to use when drawing non-newgrf railtypes, or when drawing stations. * Original railtype number to use when drawing non-newgrf railtypes, or when drawing stations.

View File

@ -418,6 +418,7 @@ struct GameOptionsWindow : Window {
GameSettings *opt = nullptr; GameSettings *opt = nullptr;
bool reload = false; bool reload = false;
int gui_scale = 0; int gui_scale = 0;
static inline int previous_gui_scale = 0; ///< Previous GUI scale.
static inline WidgetID active_tab = WID_GO_TAB_GENERAL; static inline WidgetID active_tab = WID_GO_TAB_GENERAL;
GameOptionsWindow(WindowDesc &desc) : Window(desc), filter_editbox(50), gui_scale(_gui_scale) GameOptionsWindow(WindowDesc &desc) : Window(desc), filter_editbox(50), gui_scale(_gui_scale)
@ -1065,9 +1066,13 @@ struct GameOptionsWindow : Window {
case WID_GO_GUI_SCALE_AUTO: case WID_GO_GUI_SCALE_AUTO:
{ {
if (_gui_scale_cfg == -1) { if (_gui_scale_cfg == -1) {
_gui_scale_cfg = _gui_scale; _gui_scale_cfg = previous_gui_scale; // Store the previous GUI scale value
this->SetWidgetLoweredState(WID_GO_GUI_SCALE_AUTO, false); this->SetWidgetLoweredState(WID_GO_GUI_SCALE_AUTO, false);
if (AdjustGUIZoom(false))
ReInitAllWindows(true);
this->gui_scale = _gui_scale;
} else { } else {
previous_gui_scale = _gui_scale; // Set the previous GUI scale value as the current one
_gui_scale_cfg = -1; _gui_scale_cfg = -1;
this->SetWidgetLoweredState(WID_GO_GUI_SCALE_AUTO, true); this->SetWidgetLoweredState(WID_GO_GUI_SCALE_AUTO, true);
if (AdjustGUIZoom(false)) ReInitAllWindows(true); if (AdjustGUIZoom(false)) ReInitAllWindows(true);