mirror of https://github.com/OpenRCT2/OpenRCT2.git
Show sc6/sv6/sc4/sv4 in "load landscape" file dialog
This commit is contained in:
parent
7e0dfc9e0c
commit
64bbd78bb7
19
src/editor.c
19
src/editor.c
|
@ -258,17 +258,18 @@ bool editor_load_landscape(const utf8 *path)
|
|||
{
|
||||
window_close_construction_windows();
|
||||
|
||||
char *extension = strrchr(path, '.');
|
||||
if (extension != NULL) {
|
||||
if (_stricmp(extension, ".sv4") == 0) {
|
||||
return editor_load_landscape_from_sv4(path);
|
||||
} else if (_stricmp(extension, ".sc4") == 0) {
|
||||
uint32 extension = get_file_extension_type(path);
|
||||
switch (extension) {
|
||||
case FILE_EXTENSION_SC6:
|
||||
case FILE_EXTENSION_SV6:
|
||||
return editor_read_s6(path);
|
||||
case FILE_EXTENSION_SC4:
|
||||
return editor_load_landscape_from_sc4(path);
|
||||
}
|
||||
case FILE_EXTENSION_SV4:
|
||||
return editor_load_landscape_from_sv4(path);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Load SC6 / SV6
|
||||
return editor_read_s6(path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -193,7 +193,7 @@ rct_window *window_loadsave_open(int type, char *defaultName)
|
|||
case LOADSAVETYPE_LANDSCAPE:
|
||||
w->widgets[WIDX_TITLE].text = isSave ? STR_FILE_DIALOG_TITLE_SAVE_LANDSCAPE : STR_FILE_DIALOG_TITLE_LOAD_LANDSCAPE;
|
||||
if (window_loadsave_get_dir(gConfigGeneral.last_save_landscape_directory, path, "landscape", sizeof(path))) {
|
||||
window_loadsave_populate_list(w, isSave, path, ".sc6");
|
||||
window_loadsave_populate_list(w, isSave, path, ".sc6;.sv6;.sc4;.sv4");
|
||||
success = true;
|
||||
}
|
||||
break;
|
||||
|
@ -256,7 +256,7 @@ static bool browse(bool isSave, char *path, size_t pathSize)
|
|||
case LOADSAVETYPE_LANDSCAPE:
|
||||
title = isSave ? STR_FILE_DIALOG_TITLE_SAVE_LANDSCAPE : STR_FILE_DIALOG_TITLE_LOAD_LANDSCAPE;
|
||||
desc.filters[0].name = language_get_string(STR_OPENRCT2_LANDSCAPE_FILE);
|
||||
desc.filters[0].pattern = isSave ? "*.sc6" : "*.sc4;*.sv4;*.sc6;*.sv6";
|
||||
desc.filters[0].pattern = isSave ? "*.sc6" : "*.sc6;*.sv6;*.sc4;*.sv4";
|
||||
break;
|
||||
case LOADSAVETYPE_SCENARIO:
|
||||
title = STR_FILE_DIALOG_TITLE_SAVE_SCENARIO;
|
||||
|
|
Loading…
Reference in New Issue