Mercurial > hg > openttd
changeset 15325:84cad5d4ab8d draft
(svn r19966) -Codechange: Use InvalidateData() in saveload GUI when appropiate.
author | frosch <frosch@openttd.org> |
---|---|
date | Sat, 12 Jun 2010 14:52:42 +0000 |
parents | 9d6b32ed8cfc |
children | 716524e36e40 |
files | src/fios_gui.cpp |
diffstat | 1 files changed, 5 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -200,7 +200,7 @@ } SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, HT_NONE, WC_MAIN_WINDOW, 0); - BuildFileList(); + this->OnInvalidateData(0); ResetObjectToPlace(); @@ -327,8 +327,7 @@ case SLWW_HOME_BUTTON: // OpenTTD 'button', jumps to OpenTTD directory FiosBrowseTo(&o_dir); - this->SetDirty(); - BuildFileList(); + this->InvalidateData(); break; case SLWW_DRIVES_DIRECTORIES_LIST: { // Click the listbox @@ -362,9 +361,8 @@ this->SetWidgetDirty(SLWW_SAVE_OSK_TITLE); } } else { - /* Changed directory, need repaint. */ - this->SetDirty(); - BuildFileList(); + /* Changed directory, need refresh. */ + this->InvalidateData(); } break; } @@ -421,13 +419,12 @@ if (!FiosDelete(this->text.buf)) { ShowErrorMessage(STR_ERROR_UNABLE_TO_DELETE_FILE, INVALID_STRING_ID, WL_ERROR); } else { - BuildFileList(); + this->InvalidateData(); /* Reset file name to current date on successful delete */ if (_saveload_mode == SLD_SAVE_GAME) GenerateFileName(); } UpdateTextBufferSize(&this->text); - this->SetDirty(); } else if (this->IsWidgetLowered(SLWW_SAVE_GAME)) { // Save button clicked _switch_mode = SM_SAVE; FiosMakeSavegameName(_file_to_saveload.name, this->text.buf, sizeof(_file_to_saveload.name));