index 470da17acbf478c2ca206869204cc607b0b3a779..6f819eda6e51a273031ff8a2c03f8636e3e7db75 100644 (file)
--- a/src/editor/f_maptest.pas
+++ b/src/editor/f_maptest.pas
unit f_maptest;
-{$MODE Delphi}
+{$INCLUDE ../shared/a_modes.inc}
interface
ComCtrls;
type
+
+ { TMapTestForm }
+
TMapTestForm = class (TForm)
bOK: TButton;
bCancel: TButton;
GroupBox1: TGroupBox;
+ LabelArgs: TLabel;
// Режим игры:
rbDM: TRadioButton;
rbTDM: TRadioButton;
// Путь:
LabelPath: TLabel;
edD2dexe: TEdit;
+ edD2DArgs: TEdit;
bChooseD2d: TButton;
FindD2dDialog: TOpenDialog;
implementation
uses
- f_main, CONFIG;
+ f_main, g_options, CONFIG;
{$R *.lfm}
n: Integer;
begin
- config := TConfig.CreateFile(EditorDir+'/Editor.cfg');
+ config := TConfig.CreateFile(CfgFileName);
if rbTDM.Checked then
s := 'TDM'
config.WriteStr('TestRun', 'Exe', edD2dExe.Text);
TestD2dExe := edD2dExe.Text;
+ config.WriteStr('TestRun', 'Args', edD2DArgs.Text);
+ TestD2DArgs := edD2DArgs.Text;
- config.SaveFile(EditorDir+'/Editor.cfg');
+ config.SaveFile(CfgFileName);
config.Free();
Close();
end;
cbMonstersDM.Checked := TestOptionsMonstersDM;
cbMapOnce.Checked := TestMapOnce;
edD2dExe.Text := TestD2dExe;
+ edD2DArgs.Text := TestD2DArgs;
end;
procedure TMapTestForm.FormCreate(Sender: TObject);
config: TConfig;
begin
- config := TConfig.CreateFile(EditorDir+'/Editor.cfg');
+ config := TConfig.CreateFile(CfgFileName);
TestGameMode := config.ReadStr('TestRun', 'GameMode', 'DM');
TestLimTime := config.ReadStr('TestRun', 'LimTime', '0');
TestOptionsWeaponStay := config.ReadBool('TestRun', 'WeaponStay', False);
TestOptionsMonstersDM := config.ReadBool('TestRun', 'MonstersDM', False);
TestMapOnce := config.ReadBool('TestRun', 'MapOnce', False);
- TestD2dExe := config.ReadStr('TestRun', 'Exe', EditorDir+'Doom2DF.exe');
+ TestD2dExe := config.ReadStr('TestRun', 'Exe', GameExeFile);
+ TestD2DArgs := config.ReadStr('TestRun', 'Args', '');
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);