35 #include "table/strings.h"
41 static bool _fios_path_changed;
42 static bool _savegame_sort_dirty;
55 this->map_size_x = this->map_size_y = 256;
56 this->current_date = 0;
57 memset(&this->settings, 0,
sizeof(this->settings));
97 SetDataTip(STR_INTRO_ONLINE_CONTENT, STR_INTRO_TOOLTIP_ONLINE_CONTENT),
139 SetDataTip(STR_INTRO_ONLINE_CONTENT, STR_INTRO_TOOLTIP_ONLINE_CONTENT),
141 SetDataTip(STR_SAVELOAD_LOAD_BUTTON, STR_SAVELOAD_LOAD_HEIGHTMAP_TOOLTIP),
171 NWidget(
WWT_EDITBOX, COLOUR_GREY,
WID_SL_SAVE_OSK_TITLE),
SetPadding(3, 2, 2, 2),
SetFill(1, 0),
SetResize(1, 0),
172 SetDataTip(STR_SAVELOAD_OSKTITLE, STR_SAVELOAD_EDITBOX_TOOLTIP),
215 for (
const FiosItem *item = file_list.
Begin(); item != file_list.
End(); item++) {
216 switch (item->type) {
217 case FIOS_TYPE_DIR: sort_start++;
break;
218 case FIOS_TYPE_PARENT: sort_start++;
break;
219 case FIOS_TYPE_DRIVE: sort_end++;
break;
224 uint s_amount = file_list.
Length() - sort_start - sort_end;
253 switch (this->abstract_filetype) {
277 switch (this->abstract_filetype) {
279 caption_string = (this->fop ==
SLO_SAVE) ? STR_SAVELOAD_SAVE_CAPTION : STR_SAVELOAD_LOAD_CAPTION;
283 caption_string = (this->fop ==
SLO_SAVE) ? STR_SAVELOAD_SAVE_SCENARIO : STR_SAVELOAD_LOAD_SCENARIO;
287 caption_string = (this->fop ==
SLO_SAVE) ? STR_SAVELOAD_SAVE_HEIGHTMAP : STR_SAVELOAD_LOAD_HEIGHTMAP;
293 this->GetWidget<NWidgetCore>(
WID_SL_CAPTION)->widget_data = caption_string;
302 if (_game_mode != GM_MENU && !
_networking && _game_mode != GM_EDITOR) {
312 o_dir.type = FIOS_TYPE_DIRECT;
313 switch (this->abstract_filetype) {
337 if (!
_networking && _game_mode != GM_EDITOR && _game_mode != GM_MENU) {
353 static const char *path = NULL;
354 static StringID str = STR_ERROR_UNABLE_TO_READ_DRIVE;
355 static uint64 tot = 0;
357 if (_fios_path_changed) {
359 _fios_path_changed =
false;
362 if (str != STR_ERROR_UNABLE_TO_READ_DRIVE)
SetDParam(0, tot);
372 for (uint pos = this->vscroll->GetPosition(); pos < this->
fios_items.
Length(); pos++) {
395 if (y > y_max)
break;
404 y, r.bottom - WD_FRAMERECT_BOTTOM, _load_check_data.
error, TC_RED);
407 SetDParam(0, _load_check_data.map_size_x);
408 SetDParam(1, _load_check_data.map_size_y);
411 if (y > y_max)
break;
415 if (landscape < NUM_LANDSCAPE) {
416 SetDParam(0, STR_CHEAT_SWITCH_CLIMATE_TEMPERATE_LANDSCAPE + landscape);
422 if (y > y_max)
break;
430 if (y > y_max)
break;
435 SetDParam(0, _load_check_data.current_date);
443 if (y > y_max)
break;
451 if (y > y_max)
break;
456 if (y > y_max)
break;
463 if (c.
name != NULL) {
472 if (y > y_max)
break;
496 d.height += padding.height;
505 if (_savegame_sort_dirty) {
506 _savegame_sort_dirty =
false;
518 _savegame_sort_order = (_savegame_sort_order == SORT_BY_NAME) ?
519 SORT_BY_NAME | SORT_DESCENDING : SORT_BY_NAME;
520 _savegame_sort_dirty =
true;
525 _savegame_sort_order = (_savegame_sort_order == SORT_BY_DATE) ?
526 SORT_BY_DATE | SORT_DESCENDING : SORT_BY_DATE;
527 _savegame_sort_dirty =
true;
565 #if defined(ENABLE_NETWORK)
573 if (y == INT_MAX)
return;
579 if (click_count == 1) {
582 _load_check_data.
Clear();
596 }
else if (!_load_check_data.
HasErrors()) {
623 #if defined(ENABLE_NETWORK)
625 switch (this->abstract_filetype) {
626 default: NOT_REACHED();
646 if (keycode == WKC_ESC) {
697 _load_check_data.
Clear();
698 if (!gui_scope)
break;
700 _fios_path_changed =
true;
704 _load_check_data.
Clear();
708 if (!gui_scope)
break;
712 switch (this->abstract_filetype) {
743 _nested_load_dialog_widgets,
lengthof(_nested_load_dialog_widgets)
751 _nested_load_heightmap_dialog_widgets,
lengthof(_nested_load_heightmap_dialog_widgets)
759 _nested_save_dialog_widgets,
lengthof(_nested_save_dialog_widgets)