From e465c8db4d0b011cbceaa7fcfd84596167bf9424 Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Tue, 3 Jun 2014 20:27:10 +0300 Subject: [PATCH] Added vertical toolbar option to game settings --- src/settings_gui.cpp | 16 +++++++++++++++- src/widgets/settings_widget.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 07b51d6afe..bf03f98dbf 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -454,6 +454,13 @@ struct GameOptionsWindow : Window { this->SetDirty(); break; + case WID_GO_VERTICAL_TOOLBAR: + _settings_client.gui.vertical_toolbar = !_settings_client.gui.vertical_toolbar; + this->SetWidgetLoweredState(WID_GO_VERTICAL_TOOLBAR, _settings_client.gui.vertical_toolbar); + this->SetDirty(); + ReconstructUserInterface(); + break; + default: { int selected; DropDownList *list = this->BuildDropDownList(widget, &selected); @@ -572,6 +579,7 @@ struct GameOptionsWindow : Window { { if (!gui_scope) return; this->SetWidgetLoweredState(WID_GO_FULLSCREEN_BUTTON, _fullscreen); + this->SetWidgetLoweredState(WID_GO_VERTICAL_TOOLBAR, _settings_client.gui.vertical_toolbar); bool missing_files = BaseGraphics::GetUsedSet()->GetNumMissing() == 0; this->GetWidget(WID_GO_BASE_GRF_STATUS)->SetDataTip(missing_files ? STR_EMPTY : STR_GAME_OPTIONS_BASE_GRF_STATUS, STR_NULL); @@ -626,6 +634,12 @@ static const NWidgetPart _nested_game_options_widgets[] = { NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_CONFIG_SETTING_FONT_SIZE, STR_NULL), NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_TEXT_SIZE_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_JUST_INT, STR_CONFIG_SETTING_FONT_SIZE_TOOLTIP), SetFill(1, 0), EndContainer(), + NWidget(WWT_FRAME, COLOUR_GREY), + NWidget(NWID_HORIZONTAL), + NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetFill(1, 0), SetDataTip(STR_CONFIG_SETTING_VERTICAL_TOOLBAR, STR_NULL), + NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_GO_VERTICAL_TOOLBAR), SetMinimalSize(21, 9), SetDataTip(STR_EMPTY, STR_CONFIG_SETTING_VERTICAL_TOOLBAR_HELPTEXT), + EndContainer(), + EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(0, 0), SetFill(0, 1), EndContainer(), @@ -1526,7 +1540,7 @@ static SettingEntry _settings_ui[] = { SettingEntry(&_settings_ui_interaction_page, STR_CONFIG_SETTING_INTERACTION), SettingEntry(&_settings_ui_sound_page, STR_CONFIG_SETTING_SOUND), SettingEntry(&_settings_ui_news_page, STR_CONFIG_SETTING_NEWS), - SettingEntry("gui.touchscreen_mode"), + SettingEntry("gui.vertical_toolbar"), SettingEntry("gui.show_finances"), SettingEntry("gui.errmsg_duration"), SettingEntry("gui.hover_delay"), diff --git a/src/widgets/settings_widget.h b/src/widgets/settings_widget.h index 1bb18185a2..6e7575eda8 100644 --- a/src/widgets/settings_widget.h +++ b/src/widgets/settings_widget.h @@ -26,6 +26,7 @@ enum GameOptionsWidgets { WID_GO_SCREENSHOT_DROPDOWN, ///< Select the screenshot type... please use PNG!. WID_GO_BUTTON_SIZE_DROPDOWN, ///< Size of in-game UI elements, such as buttons. WID_GO_TEXT_SIZE_DROPDOWN, ///< Size of medium font, sizes of other fonts are derived from it. + WID_GO_VERTICAL_TOOLBAR, ///< Enable vertical toolbar. WID_GO_BASE_GRF_DROPDOWN, ///< Use to select a base GRF. WID_GO_BASE_GRF_STATUS, ///< Info about missing files etc. WID_GO_BASE_GRF_TEXTFILE, ///< Open base GRF readme, changelog (+1) or license (+2).