From 6bca4c041a243de1750f660aec7b386bdfce335e Mon Sep 17 00:00:00 2001 From: darkvater Date: Mon, 28 Mar 2005 13:30:51 +0000 Subject: (svn r2100) - Fix: [1024703]: Infinite access for A:\ (win32). Patch [1171208]. Only requery drive(s) if the user changes a directory, also surpress the OS error box that pops up on some windows machines. Tron + glx (and me) --- misc_gui.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'misc_gui.c') diff --git a/misc_gui.c b/misc_gui.c index acfc5e83c..0860246f8 100644 --- a/misc_gui.c +++ b/misc_gui.c @@ -20,6 +20,7 @@ #include "hal.h" // for file list +static bool _fios_path_changed; static bool _savegame_sort_dirty; bool _query_string_active; @@ -1126,25 +1127,30 @@ static const Widget _save_dialog_scen_widgets[] = { void BuildFileList(void) { + _fios_path_changed = true; FiosFreeSavegameList(); - if(_saveload_mode==SLD_NEW_GAME || _saveload_mode==SLD_LOAD_SCENARIO || _saveload_mode==SLD_SAVE_SCENARIO) + if (_saveload_mode == SLD_NEW_GAME || _saveload_mode == SLD_LOAD_SCENARIO || _saveload_mode == SLD_SAVE_SCENARIO) { _fios_list = FiosGetScenarioList(&_fios_num, _saveload_mode); - else + } else _fios_list = FiosGetSavegameList(&_fios_num, _saveload_mode); } static void DrawFiosTexts(void) { - const char *path; - StringID str; + static const char *path = NULL; + static StringID str = STR_4006_UNABLE_TO_READ_DRIVE; + static uint32 tot = 0; - str = FiosGetDescText(&path); - if (str != 0) - DrawString(2, 37, str, 0); + if (_fios_path_changed) { + str = FiosGetDescText(&path, &tot); + _fios_path_changed = false; + } + + if (str != STR_4006_UNABLE_TO_READ_DRIVE) SetDParam(0, tot); + DrawString(2, 37, str, 0); DoDrawString(path, 2, 27, 16); } - static void MakeSortedSaveGameList(void) { /* Directories are always above the files (FIOS_TYPE_DIR) -- cgit v1.2.3-54-g00ecf