From: Ketmar Dark Date: Fri, 8 Apr 2016 02:54:19 +0000 (+0300) Subject: proper GUI fix for file listers X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=abbb757bb6c74afebda0bec06fa91a9f0e7bec91;p=d2df-sdl.git proper GUI fix for file listers --- diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas index 2f9bc08..899b354 100644 --- a/src/game/g_gui.pas +++ b/src/game/g_gui.pas @@ -2844,13 +2844,14 @@ procedure TGUIFileListBox.OpenDir(path: String); var SR: TSearchRec; i: Integer; + sm, sc: string; begin Clear(); path := IncludeTrailingPathDelimiter(path); path := ExpandFileName(path); -// Êàòàëîãè: + // Êàòàëîãè: if FDirs then begin if FindFirst(path+'*', faDirectory, SR) = 0 then @@ -2867,20 +2868,15 @@ begin FindClose(SR); end; -// Ôàéëû: - if FindFirst(path+FFileMask, faAnyFile, SR) = 0 then - repeat - AddItem(SR.Name); - until FindNext(SR) <> 0; - FindClose(SR); - - //FIXME: HACK! - if FFileMask = '*.wad' then + // Ôàéëû: + sm := FFileMask; + while sm <> '' do begin - if FindFirst(path+'*.pk3', faAnyFile, SR) = 0 then - repeat - AddItem(SR.Name); - until FindNext(SR) <> 0; + i := Pos('|', sm); + if i = 0 then i := length(sm); + sc := Copy(sm, 1, i-1); + Delete(sm, 1, i);; + if FindFirst(path+sc, faAnyFile, SR) = 0 then repeat AddItem(SR.Name); until FindNext(SR) <> 0; FindClose(SR); end; diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas index 89d264f..f2abfb7 100644 --- a/src/game/g_menu.pas +++ b/src/game/g_menu.pas @@ -2180,7 +2180,7 @@ begin Sort := True; Dirs := True; - FileMask := '*.wad'; + FileMask := '*.wad|*.pk3|*.zip'; SetBase(MapsDir+'megawads/'); end; @@ -2235,7 +2235,7 @@ begin Sort := True; Dirs := True; - FileMask := '*.wad'; + FileMask := '*.wad|*.pk3|*.zip'; SetBase(MapsDir); end; with AddList(_lc[I_MENU_MAP_RESOURCE], 12, 4) do diff --git a/src/shared/WADEDITOR.pas b/src/shared/WADEDITOR.pas index 54706cf..c9af0bd 100644 --- a/src/shared/WADEDITOR.pas +++ b/src/shared/WADEDITOR.pas @@ -238,7 +238,7 @@ begin begin rfn := Copy(rfn, 1, length(rfn)-4); if FileExists(rfn+'.pk3') then rfn := rfn+'.pk3' - //else if FileExists(rfn+'.zip') then rfn := rfn+'.zip' + else if FileExists(rfn+'.zip') then rfn := rfn+'.zip' else rfn := FileName; {.$IFDEF SFS_DWFAD_DEBUG} if gSFSDebug then