diff options
author | frosch <frosch@openttd.org> | 2012-05-28 13:34:46 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-05-28 13:34:46 +0000 |
commit | f9df5f65c7e3708196627b0bc29bdf4cf938fa44 (patch) | |
tree | 2b27f9b6f4cf615bdacbebcf2ea3796dec523402 /src | |
parent | 09bdd4c773c14cddd00a952fcc5c94593023064c (diff) | |
download | openttd-f9df5f65c7e3708196627b0bc29bdf4cf938fa44.tar.xz |
(svn r24298) -Feature: Display default values for adv. settings in the settings description.
Diffstat (limited to 'src')
-rw-r--r-- | src/lang/english.txt | 1 | ||||
-rw-r--r-- | src/settings_gui.cpp | 13 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt index 47cbf4e7d..d4302e4ac 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1104,6 +1104,7 @@ STR_WARNING_DIFFICULTY_TO_CUSTOM :{WHITE}This act # Advanced settings window STR_CONFIG_SETTING_CAPTION :{WHITE}Advanced Settings STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT :(no explanation available) +STR_CONFIG_SETTING_DEFAULT_VALUE :{LTBLUE}Default value: {ORANGE}{STRING1} STR_CONFIG_SETTING_OFF :Off STR_CONFIG_SETTING_ON :On diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 095825361..0dd5a439b 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1738,7 +1738,8 @@ struct GameSettingsWindow : Window { break; case WID_GS_HELP_TEXT: - size->height = max(size->height, _settings_main_page.GetMaxHelpHeight(size->width)); + size->height = FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL + + max(size->height, _settings_main_page.GetMaxHelpHeight(size->width)); break; default: @@ -1756,7 +1757,15 @@ struct GameSettingsWindow : Window { case WID_GS_HELP_TEXT: if (this->last_clicked != NULL) { - DrawStringMultiLine(r.left, r.right, r.top, r.bottom, this->last_clicked->GetHelpText(), TC_WHITE); + const SettingDesc *sd = this->last_clicked->d.entry.setting; + int32 default_value = ReadValue(&sd->desc.def, sd->save.conv); + this->last_clicked->SetValueDParams(0, default_value); + + int y = r.top; + DrawString(r.left, r.right, y, STR_CONFIG_SETTING_DEFAULT_VALUE); + y += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; + + DrawStringMultiLine(r.left, r.right, y, r.bottom, this->last_clicked->GetHelpText(), TC_WHITE); } break; |