From e3583b4cd17ffdd4a0ccb3a2c78e1911b567935f Mon Sep 17 00:00:00 2001 From: alberth Date: Sun, 9 Feb 2014 13:04:50 +0000 Subject: [PATCH] (svn r26320) -Add: Label for both the filter category and filter type in the advanced settings window. --- src/lang/english.txt | 3 ++- src/script/api/game/game_window.hpp.sq | 3 ++- src/script/api/script_window.hpp | 3 ++- src/settings_gui.cpp | 15 +++++++++++---- src/widgets/settings_widget.h | 3 ++- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/lang/english.txt b/src/lang/english.txt index 52fa8c2281..86c3186593 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1070,7 +1070,8 @@ STR_CONFIG_SETTING_TYPE_GAME_INGAME :Game setting (s STR_CONFIG_SETTING_TYPE_COMPANY_MENU :Company setting (stored in saves; affects only new games) STR_CONFIG_SETTING_TYPE_COMPANY_INGAME :Company setting (stored in save; affects only current company) -STR_CONFIG_SETTING_RESTRICT_LABEL :{BLACK}Show: +STR_CONFIG_SETTING_RESTRICT_CATEGORY :{BLACK}Category: +STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}Type: STR_CONFIG_SETTING_RESTRICT_DROPDOWN_HELPTEXT :{BLACK}Restricts the list below showing only changed settings STR_CONFIG_SETTING_RESTRICT_BASIC :Basic settings STR_CONFIG_SETTING_RESTRICT_ADVANCED :Advanced settings diff --git a/src/script/api/game/game_window.hpp.sq b/src/script/api/game/game_window.hpp.sq index f693825b5f..0439a3a97d 100644 --- a/src/script/api/game/game_window.hpp.sq +++ b/src/script/api/game/game_window.hpp.sq @@ -1009,7 +1009,8 @@ void SQGSWindow_Register(Squirrel *engine) SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GS_HELP_TEXT, "WID_GS_HELP_TEXT"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GS_EXPAND_ALL, "WID_GS_EXPAND_ALL"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GS_COLLAPSE_ALL, "WID_GS_COLLAPSE_ALL"); - SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GS_RESTRICT_LABEL, "WID_GS_RESTRICT_LABEL"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GS_RESTRICT_CATEGORY, "WID_GS_RESTRICT_CATEGORY"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GS_RESTRICT_TYPE, "WID_GS_RESTRICT_TYPE"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GS_RESTRICT_DROPDOWN, "WID_GS_RESTRICT_DROPDOWN"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GS_TYPE_DROPDOWN, "WID_GS_TYPE_DROPDOWN"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_CC_RATE_DOWN, "WID_CC_RATE_DOWN"); diff --git a/src/script/api/script_window.hpp b/src/script/api/script_window.hpp index 7177064f2f..d7f3879afd 100644 --- a/src/script/api/script_window.hpp +++ b/src/script/api/script_window.hpp @@ -2126,7 +2126,8 @@ public: WID_GS_HELP_TEXT = ::WID_GS_HELP_TEXT, ///< Information area to display help text of the selected option. WID_GS_EXPAND_ALL = ::WID_GS_EXPAND_ALL, ///< Expand all button. WID_GS_COLLAPSE_ALL = ::WID_GS_COLLAPSE_ALL, ///< Collapse all button. - WID_GS_RESTRICT_LABEL = ::WID_GS_RESTRICT_LABEL, ///< Label upfront to drop down box to restrict the list of settings to show + WID_GS_RESTRICT_CATEGORY = ::WID_GS_RESTRICT_CATEGORY, ///< Label upfront to the category drop-down box to restrict the list of settings to show + WID_GS_RESTRICT_TYPE = ::WID_GS_RESTRICT_TYPE, ///< Label upfront to the type drop-down box to restrict the list of settings to show WID_GS_RESTRICT_DROPDOWN = ::WID_GS_RESTRICT_DROPDOWN, ///< The drop down box to restrict the list of settings WID_GS_TYPE_DROPDOWN = ::WID_GS_TYPE_DROPDOWN, ///< The drop down box to choose client/game/company/all settings }; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index a103a05ca8..045bdc1c53 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1792,6 +1792,11 @@ struct GameSettingsWindow : Window { break; } + case WID_GS_RESTRICT_CATEGORY: + case WID_GS_RESTRICT_TYPE: + size->width = max(GetStringBoundingBox(STR_CONFIG_SETTING_RESTRICT_CATEGORY).width, GetStringBoundingBox(STR_CONFIG_SETTING_RESTRICT_TYPE).width); + break; + default: break; } @@ -2225,11 +2230,13 @@ static const NWidgetPart _nested_settings_selection_widgets[] = { NWidget(WWT_DEFSIZEBOX, COLOUR_MAUVE), EndContainer(), NWidget(WWT_PANEL, COLOUR_MAUVE), - NWidget(NWID_HORIZONTAL), SetPadding(WD_TEXTPANEL_TOP, 0, WD_TEXTPANEL_BOTTOM, 0), - SetPIP(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_RIGHT), - NWidget(WWT_TEXT, COLOUR_MAUVE, WID_GS_RESTRICT_LABEL), SetDataTip(STR_CONFIG_SETTING_RESTRICT_LABEL, STR_NULL), - NWidget(NWID_VERTICAL), SetPIP(0, WD_PAR_VSEP_NORMAL, 0), + NWidget(NWID_VERTICAL), SetPIP(0, WD_PAR_VSEP_NORMAL, 0), SetPadding(WD_TEXTPANEL_TOP, 0, WD_TEXTPANEL_BOTTOM, 0), + NWidget(NWID_HORIZONTAL), SetPIP(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_RIGHT), + NWidget(WWT_TEXT, COLOUR_MAUVE, WID_GS_RESTRICT_CATEGORY), SetDataTip(STR_CONFIG_SETTING_RESTRICT_CATEGORY, STR_NULL), NWidget(WWT_DROPDOWN, COLOUR_MAUVE, WID_GS_RESTRICT_DROPDOWN), SetMinimalSize(100, 12), SetDataTip(STR_BLACK_STRING, STR_CONFIG_SETTING_RESTRICT_DROPDOWN_HELPTEXT), SetFill(1, 0), SetResize(1, 0), + EndContainer(), + NWidget(NWID_HORIZONTAL), SetPIP(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_RIGHT), + NWidget(WWT_TEXT, COLOUR_MAUVE, WID_GS_RESTRICT_TYPE), SetDataTip(STR_CONFIG_SETTING_RESTRICT_TYPE, STR_NULL), NWidget(WWT_DROPDOWN, COLOUR_MAUVE, WID_GS_TYPE_DROPDOWN), SetMinimalSize(100, 12), SetDataTip(STR_BLACK_STRING, STR_CONFIG_SETTING_TYPE_DROPDOWN_HELPTEXT), SetFill(1, 0), SetResize(1, 0), EndContainer(), EndContainer(), diff --git a/src/widgets/settings_widget.h b/src/widgets/settings_widget.h index 2e155e5176..6f045a2a25 100644 --- a/src/widgets/settings_widget.h +++ b/src/widgets/settings_widget.h @@ -45,7 +45,8 @@ enum GameSettingsWidgets { WID_GS_HELP_TEXT, ///< Information area to display help text of the selected option. WID_GS_EXPAND_ALL, ///< Expand all button. WID_GS_COLLAPSE_ALL, ///< Collapse all button. - WID_GS_RESTRICT_LABEL, ///< Label upfront to drop down box to restrict the list of settings to show + WID_GS_RESTRICT_CATEGORY, ///< Label upfront to the category drop-down box to restrict the list of settings to show + WID_GS_RESTRICT_TYPE, ///< Label upfront to the type drop-down box to restrict the list of settings to show WID_GS_RESTRICT_DROPDOWN, ///< The drop down box to restrict the list of settings WID_GS_TYPE_DROPDOWN, ///< The drop down box to choose client/game/company/all settings };