summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2014-03-25 21:47:07 +0000
committerplanetmaker <planetmaker@openttd.org>2014-03-25 21:47:07 +0000
commit7316b5672cc5450056f7fefa21795c5900bbdc20 (patch)
tree5fa17adc015e6dc72dfbe3a33dee362bd71842ad
parent0d2bf4d50bb09c20c3b9ce28a260dd971b676b5c (diff)
downloadopenttd-7316b5672cc5450056f7fefa21795c5900bbdc20.tar.xz
(svn r26428) -Add [FS#5953]: Load button for heightmap list
-rw-r--r--src/fios_gui.cpp24
-rw-r--r--src/lang/english.txt1
2 files changed, 18 insertions, 7 deletions
diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp
index 9551bb843..9fce85ae9 100644
--- a/src/fios_gui.cpp
+++ b/src/fios_gui.cpp
@@ -133,9 +133,11 @@ static const NWidgetPart _nested_load_heightmap_dialog_widgets[] = {
SetDataTip(0x0, STR_SAVELOAD_LIST_TOOLTIP), SetResize(1, 10), SetScrollbar(WID_SL_SCROLLBAR), EndContainer(),
NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_SL_SCROLLBAR),
EndContainer(),
- NWidget(NWID_HORIZONTAL),
- NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SL_CONTENT_DOWNLOAD), SetResize(1, 0),
+ NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SL_CONTENT_DOWNLOAD), SetResize(1, 0), SetFill(1, 0),
SetDataTip(STR_INTRO_ONLINE_CONTENT, STR_INTRO_TOOLTIP_ONLINE_CONTENT),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SL_LOAD_BUTTON), SetResize(1, 0), SetFill(1, 0),
+ SetDataTip(STR_SAVELOAD_LOAD_BUTTON, STR_SAVELOAD_LOAD_HEIGHTMAP_TOOLTIP),
NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(),
EndContainer(),
@@ -521,16 +523,21 @@ public:
break;
case WID_SL_LOAD_BUTTON:
- if (this->selected != NULL && !_load_check_data.HasErrors() && (_load_check_data.grf_compatibility != GLC_NOT_FOUND || _settings_client.gui.UserIsAllowedToChangeNewGRFs())) {
- _switch_mode = (_game_mode == GM_EDITOR) ? SM_LOAD_SCENARIO : SM_LOAD_GAME;
-
+ if (this->selected != NULL && !_load_check_data.HasErrors()) {
const char *name = FiosBrowseTo(this->selected);
SetFiosType(this->selected->type);
strecpy(_file_to_saveload.name, name, lastof(_file_to_saveload.name));
strecpy(_file_to_saveload.title, this->selected->title, lastof(_file_to_saveload.title));
- ClearErrorMessages();
- delete this;
+
+ if (_saveload_mode == SLD_LOAD_HEIGHTMAP) {
+ delete this;
+ ShowHeightmapLoad();
+ } else if (_load_check_data.grf_compatibility != GLC_NOT_FOUND || _settings_client.gui.UserIsAllowedToChangeNewGRFs()) {
+ _switch_mode = (_game_mode == GM_EDITOR) ? SM_LOAD_SCENARIO : SM_LOAD_GAME;
+ ClearErrorMessages();
+ delete this;
+ }
}
break;
@@ -679,6 +686,9 @@ public:
case 1:
/* Selection changes */
if (!gui_scope) break;
+ if (_saveload_mode == SLD_LOAD_HEIGHTMAP) {
+ this->SetWidgetDisabledState(WID_SL_LOAD_BUTTON, this->selected == NULL || _load_check_data.HasErrors());
+ }
if (_saveload_mode == SLD_LOAD_GAME || _saveload_mode == SLD_LOAD_SCENARIO) {
this->SetWidgetDisabledState(WID_SL_LOAD_BUTTON,
this->selected == NULL || _load_check_data.HasErrors() || !(_load_check_data.grf_compatibility != GLC_NOT_FOUND || _settings_client.gui.UserIsAllowedToChangeNewGRFs()));
diff --git a/src/lang/english.txt b/src/lang/english.txt
index f1ef46ccf..198515a34 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -2668,6 +2668,7 @@ STR_SAVELOAD_SAVE_BUTTON :{BLACK}Save
STR_SAVELOAD_SAVE_TOOLTIP :{BLACK}Save the current game, using the selected name
STR_SAVELOAD_LOAD_BUTTON :{BLACK}Load
STR_SAVELOAD_LOAD_TOOLTIP :{BLACK}Load the selected game
+STR_SAVELOAD_LOAD_HEIGHTMAP_TOOLTIP :{BLACK}Load the selected heightmap
STR_SAVELOAD_DETAIL_CAPTION :{BLACK}Game Details
STR_SAVELOAD_DETAIL_NOT_AVAILABLE :{BLACK}No information available
STR_SAVELOAD_DETAIL_COMPANY_INDEX :{SILVER}{COMMA}: {WHITE}{STRING1}