1357 break; |
1357 break; |
1358 case WE_TIMEOUT: |
1358 case WE_TIMEOUT: |
1359 if (HASBIT(w->click_state, 11)) { /* Delete button clicked */ |
1359 if (HASBIT(w->click_state, 11)) { /* Delete button clicked */ |
1360 if (!FiosDelete(WP(w,querystr_d).text.buf)) { |
1360 if (!FiosDelete(WP(w,querystr_d).text.buf)) { |
1361 ShowErrorMessage(INVALID_STRING_ID, STR_4008_UNABLE_TO_DELETE_FILE, 0, 0); |
1361 ShowErrorMessage(INVALID_STRING_ID, STR_4008_UNABLE_TO_DELETE_FILE, 0, 0); |
|
1362 } else { |
|
1363 BuildFileList(); |
|
1364 /* Reset file name to current date on successfull delete */ |
|
1365 if (_saveload_mode == SLD_SAVE_GAME) GenerateFileName(); |
1362 } |
1366 } |
|
1367 |
|
1368 UpdateTextBufferSize(&WP(w, querystr_d).text); |
1363 SetWindowDirty(w); |
1369 SetWindowDirty(w); |
1364 BuildFileList(); |
|
1365 if (_saveload_mode == SLD_SAVE_GAME) { |
|
1366 GenerateFileName(); /* Reset file name to current date */ |
|
1367 UpdateTextBufferSize(&WP(w, querystr_d).text); |
|
1368 } |
|
1369 } else if (HASBIT(w->click_state, 12)) { /* Save button clicked */ |
1370 } else if (HASBIT(w->click_state, 12)) { /* Save button clicked */ |
1370 _switch_mode = SM_SAVE; |
1371 _switch_mode = SM_SAVE; |
1371 FiosMakeSavegameName(_file_to_saveload.name, WP(w,querystr_d).text.buf, sizeof(_file_to_saveload.name)); |
1372 FiosMakeSavegameName(_file_to_saveload.name, WP(w,querystr_d).text.buf, sizeof(_file_to_saveload.name)); |
1372 |
1373 |
1373 /* In the editor set up the vehicle engines correctly (date might have changed) */ |
1374 /* In the editor set up the vehicle engines correctly (date might have changed) */ |