mirror of https://github.com/OpenTTD/OpenTTD
(svn r4002) - Fix: Use the title of a savegame in the saveload dialog-editbox. This gets rid of the '.sav' appended to each game as well as properly showing UTF-8 saves when this is implemented. Also don't change the text if the save has failed.
parent
7656bf8075
commit
010d715039
11
misc_gui.c
11
misc_gui.c
|
@ -1359,13 +1359,14 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e)
|
||||||
if (HASBIT(w->click_state, 11)) { /* Delete button clicked */
|
if (HASBIT(w->click_state, 11)) { /* Delete button clicked */
|
||||||
if (!FiosDelete(WP(w,querystr_d).text.buf)) {
|
if (!FiosDelete(WP(w,querystr_d).text.buf)) {
|
||||||
ShowErrorMessage(INVALID_STRING_ID, STR_4008_UNABLE_TO_DELETE_FILE, 0, 0);
|
ShowErrorMessage(INVALID_STRING_ID, STR_4008_UNABLE_TO_DELETE_FILE, 0, 0);
|
||||||
|
} else {
|
||||||
|
BuildFileList();
|
||||||
|
/* Reset file name to current date on successfull delete */
|
||||||
|
if (_saveload_mode == SLD_SAVE_GAME) GenerateFileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateTextBufferSize(&WP(w, querystr_d).text);
|
||||||
SetWindowDirty(w);
|
SetWindowDirty(w);
|
||||||
BuildFileList();
|
|
||||||
if (_saveload_mode == SLD_SAVE_GAME) {
|
|
||||||
GenerateFileName(); /* Reset file name to current date */
|
|
||||||
UpdateTextBufferSize(&WP(w, querystr_d).text);
|
|
||||||
}
|
|
||||||
} else if (HASBIT(w->click_state, 12)) { /* Save button clicked */
|
} else if (HASBIT(w->click_state, 12)) { /* Save button clicked */
|
||||||
_switch_mode = SM_SAVE;
|
_switch_mode = SM_SAVE;
|
||||||
FiosMakeSavegameName(_file_to_saveload.name, WP(w,querystr_d).text.buf, sizeof(_file_to_saveload.name));
|
FiosMakeSavegameName(_file_to_saveload.name, WP(w,querystr_d).text.buf, sizeof(_file_to_saveload.name));
|
||||||
|
|
Loading…
Reference in New Issue