From 78890b1e0b8fae82e29e68e3aa0ea77bf5b6e86d Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Tue, 23 May 2023 22:14:04 +0300 Subject: [PATCH] gui: fix test executable selection on osx --- src/editor/f_maptest.pas | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/editor/f_maptest.pas b/src/editor/f_maptest.pas index de82a63..6f819ed 100644 --- a/src/editor/f_maptest.pas +++ b/src/editor/f_maptest.pas @@ -177,7 +177,22 @@ begin config.Free(); - FindD2dDialog.InitialDir := TestD2dExe; + {$IF DEFINED(DARWIN)} + if LowerCase(ExtractFileExt(TestD2dExe)) = '.app' then + FindD2dDialog.InitialDir := ExtractFileDir(TestD2dExe) + else + FindD2dDialog.InitialDir := TestD2dExe; + FindD2dDialog.DefaultExt := '.app'; + FindD2dDialog.Filter := 'Doom 2D Forever.app|*.app|Doom 2D Forever (Unix Executable)|Doom2DF;*'; + {$ELSEIF DEFINED(WINDOWS)} + FindD2dDialog.InitialDir := TestD2dExe; + FindD2dDialog.DefaultExt := '.exe'; + FindD2dDialog.Filter := 'Doom2DF.exe|Doom2DF.exe;*.exe'; + {$ELSE} + FindD2dDialog.InitialDir := TestD2dExe; + FindD2dDialog.DefaultExt := ''; + FindD2dDialog.Filter := 'Doom2DF|Doom2DF;*'; + {$ENDIF} end; procedure TMapTestForm.bChooseD2dClick(Sender: TObject); -- 2.29.2