3 {$INCLUDE ../shared/a_modes.inc}
8 LCLIntf
, LCLType
, LMessages
, Messages
, SysUtils
, Variants
, Classes
,
9 Graphics
, Controls
, Forms
, Dialogs
, StdCtrls
, ExtCtrls
,
16 TMapTestForm
= class (TForm
)
27 cbTwoPlayers
: TCheckBox
;
28 cbTeamDamage
: TCheckBox
;
29 cbAllowExit
: TCheckBox
;
30 cbWeaponStay
: TCheckBox
;
31 cbMonstersDM
: TCheckBox
;
47 FindD2dDialog
: TOpenDialog
;
49 procedure bOKClick(Sender
: TObject
);
50 procedure bCancelClick(Sender
: TObject
);
51 procedure FormActivate(Sender
: TObject
);
52 procedure FormCreate(Sender
: TObject
);
53 procedure bChooseD2dClick(Sender
: TObject
);
56 { Private declarations }
58 { Public declarations }
62 MapTestForm
: TMapTestForm
;
71 procedure TMapTestForm
.bOKClick(Sender
: TObject
);
78 config
:= TConfig
.CreateFile(EditorDir
+'Editor.cfg');
86 if rbCOOP
.Checked
then
90 config
.WriteStr('TestRun', 'GameMode', s
);
94 if (not TryStrToInt(s
, n
)) then
96 config
.WriteStr('TestRun', 'LimTime', s
);
100 if (not TryStrToInt(s
, n
)) then
102 config
.WriteStr('TestRun', 'LimScore', s
);
105 config
.WriteBool('TestRun', 'TwoPlayers', cbTwoPlayers
.Checked
);
106 TestOptionsTwoPlayers
:= cbTwoPlayers
.Checked
;
107 config
.WriteBool('TestRun', 'TeamDamage', cbTeamDamage
.Checked
);
108 TestOptionsTeamDamage
:= cbTeamDamage
.Checked
;
109 config
.WriteBool('TestRun', 'AllowExit', cbAllowExit
.Checked
);
110 TestOptionsAllowExit
:= cbAllowExit
.Checked
;
111 config
.WriteBool('TestRun', 'WeaponStay', cbWeaponStay
.Checked
);
112 TestOptionsWeaponStay
:= cbWeaponStay
.Checked
;
113 config
.WriteBool('TestRun', 'MonstersDM', cbMonstersDM
.Checked
);
114 TestOptionsMonstersDM
:= cbMonstersDM
.Checked
;
116 config
.WriteBool('TestRun', 'MapOnce', cbMapOnce
.Checked
);
117 TestMapOnce
:= cbMapOnce
.Checked
;
119 config
.WriteStr('TestRun', 'Exe', edD2dExe
.Text);
120 TestD2dExe
:= edD2dExe
.Text;
121 config
.WriteStr('TestRun', 'Args', edD2DArgs
.Text);
122 TestD2DArgs
:= edD2DArgs
.Text;
124 config
.SaveFile(EditorDir
+'Editor.cfg');
129 procedure TMapTestForm
.bCancelClick(Sender
: TObject
);
134 procedure TMapTestForm
.FormActivate(Sender
: TObject
);
136 if TestGameMode
= 'TDM' then
137 rbTDM
.Checked
:= True
139 if TestGameMode
= 'CTF' then
140 rbCTF
.Checked
:= True
142 if TestGameMode
= 'COOP' then
143 rbCOOP
.Checked
:= True
145 rbDM
.Checked
:= True;
147 edTime
.Text := TestLimTime
;
148 edScore
.Text := TestLimScore
;
149 cbTwoPlayers
.Checked
:= TestOptionsTwoPlayers
;
150 cbTeamDamage
.Checked
:= TestOptionsTeamDamage
;
151 cbAllowExit
.Checked
:= TestOptionsAllowExit
;
152 cbWeaponStay
.Checked
:= TestOptionsWeaponStay
;
153 cbMonstersDM
.Checked
:= TestOptionsMonstersDM
;
154 cbMapOnce
.Checked
:= TestMapOnce
;
155 edD2dExe
.Text := TestD2dExe
;
156 edD2DArgs
.Text := TestD2DArgs
;
159 procedure TMapTestForm
.FormCreate(Sender
: TObject
);
164 config
:= TConfig
.CreateFile(EditorDir
+'Editor.cfg');
166 TestGameMode
:= config
.ReadStr('TestRun', 'GameMode', 'DM');
167 TestLimTime
:= config
.ReadStr('TestRun', 'LimTime', '0');
168 TestLimScore
:= config
.ReadStr('TestRun', 'LimScore', '0');
169 TestOptionsTwoPlayers
:= config
.ReadBool('TestRun', 'TwoPlayers', False);
170 TestOptionsTeamDamage
:= config
.ReadBool('TestRun', 'TeamDamage', False);
171 TestOptionsAllowExit
:= config
.ReadBool('TestRun', 'AllowExit', True);
172 TestOptionsWeaponStay
:= config
.ReadBool('TestRun', 'WeaponStay', False);
173 TestOptionsMonstersDM
:= config
.ReadBool('TestRun', 'MonstersDM', False);
174 TestMapOnce
:= config
.ReadBool('TestRun', 'MapOnce', False);
175 TestD2dExe
:= config
.ReadStr('TestRun', 'Exe', EditorDir
+'Doom2DF.exe');
176 TestD2DArgs
:= config
.ReadStr('TestRun', 'Args', '');
180 FindD2dDialog
.InitialDir
:= TestD2dExe
;
183 procedure TMapTestForm
.bChooseD2dClick(Sender
: TObject
);
185 if FindD2dDialog
.Execute
then
187 edD2dExe
.Text := FindD2dDialog
.FileName
;