1 (* Copyright (C) Doom 2D: Forever Developers
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 {$INCLUDE ../shared/a_modes.inc}
20 procedure g_Menu_Init();
21 procedure g_Menu_Free();
22 procedure g_Menu_Reset();
23 procedure LoadStdFont(cfgres
, texture
: string; var FontID
: DWORD
);
24 procedure LoadFont(txtres
, fntres
: string; var FontID
: DWORD
);
25 procedure g_Menu_AskLanguage();
27 procedure g_Menu_Show_SaveMenu();
28 procedure g_Menu_Show_LoadMenu(standalone
: Boolean=false);
29 procedure g_Menu_Show_GameSetGame();
30 procedure g_Menu_Show_OptionsVideo();
31 procedure g_Menu_Show_OptionsSound();
32 procedure g_Menu_Show_EndGameMenu();
33 procedure g_Menu_Show_QuitGameMenu();
37 gMenuSmallFont
: DWORD
;
40 TempScale
: Integer = -1;
41 TempResScale
: Integer = -1;
46 {$INCLUDE ../nogl/noGLuses.inc}
47 g_gui
, g_textures
, e_graphics
, g_main
, g_window
, g_game
, g_map
,
48 g_basic
, g_console
, g_sound
, g_gfx
, g_player
, g_options
, g_weapons
,
49 e_log
, SysUtils
, CONFIG
, g_playermodel
, DateUtils
,
50 MAPDEF
, Math
, g_saveload
,
51 e_texture
, g_language
, e_res
,
52 g_net
, g_netmsg
, g_netmaster
, g_items
, e_input
, g_touch
,
53 utils
, wadreader
, g_system
;
56 type TYNCallback
= procedure (yes
:Boolean);
58 procedure YNKeyDownProc (win
: TGUIWindow
; Key
: Byte);
60 if win
.UserData
= nil then exit
;
62 IK_Y
, IK_SPACE
: TYNCallback(win
.UserData
)(true);
63 IK_N
: TYNCallback(win
.UserData
)(false);
67 procedure YesButtonCB (ctl
: TGUITextButton
);
69 if ctl
.UserData
= nil then exit
;
70 TYNCallback(ctl
.UserData
)(true);
73 procedure NoButtonCB (ctl
: TGUITextButton
);
75 if ctl
.UserData
= nil then exit
;
76 TYNCallback(ctl
.UserData
)(false);
79 function CreateYNMenu (WinName
, Text: String; MaxLen
: Word; FontID
: DWORD
; ActionProc
: TYNCallback
): TGUIWindow
;
83 //if length(Text) = 0 then exit;
84 Result
:= TGUIWindow
.Create(WinName
);
87 //OnKeyDownEx := @YNKeyDownProc;
88 //UserData := @ActionProc;
89 menu
:= TGUIMenu(Result
.AddChild(TGUIMenu
.Create(gMenuSmallFont
, gMenuSmallFont
, '')));
92 Name
:= '__temp_yes_no_menu:'+WinName
;
94 AddText(Text, MaxLen
);
95 with AddButton(nil, _lc
[I_MENU_YES
]) do begin ProcEx
:= @YesButtonCB
; UserData
:= @ActionProc
; end;
96 with AddButton(nil, _lc
[I_MENU_NO
]) do begin ProcEx
:= @NoButtonCB
; UserData
:= @ActionProc
; end;
98 DefControl
:= '__temp_yes_no_menu:'+WinName
;
104 procedure ProcChangeColor(Sender
: TGUIControl
); forward;
105 procedure ProcSelectModel(Sender
: TGUIControl
); forward;
107 procedure ProcApplyOptions();
113 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
115 if TGUISwitch(menu
.GetControl('swBPP')).ItemIndex
= 0 then
121 gVSync
:= TGUISwitch(menu
.GetControl('swVSync')).ItemIndex
= 0;
122 if (ovs
<> gVSync
) then
123 sys_EnableVSync(gVSync
);
125 gTextureFilter
:= TGUISwitch(menu
.GetControl('swTextureFilter')).ItemIndex
= 0;
126 glNPOTOverride
:= not (TGUISwitch(menu
.GetControl('swLegacyNPOT')).ItemIndex
= 0);
127 gLerpActors
:= TGUISwitch(menu
.GetControl('swInterp')).ItemIndex
= 0;
129 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
131 g_Sound_SetupAllVolumes(
132 Min(TGUIScroll(menu
.GetControl('scSoundLevel')).Value
*16, 255),
133 Min(TGUIScroll(menu
.GetControl('scMusicLevel')).Value
*16, 255)
136 gMaxSimSounds
:= Max(Min(TGUIScroll(menu
.GetControl('scMaxSimSounds')).Value
*4+2, 66), 2);
137 gMuteWhenInactive
:= TGUISwitch(menu
.GetControl('swInactiveSounds')).ItemIndex
= 1;
138 gAnnouncer
:= TGUISwitch(menu
.GetControl('swAnnouncer')).ItemIndex
;
139 gSoundEffectsDF
:= TGUISwitch(menu
.GetControl('swSoundEffects')).ItemIndex
= 1;
140 gUseChatSounds
:= TGUISwitch(menu
.GetControl('swChatSpeech')).ItemIndex
= 0;
142 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
144 g_GFX_SetMax(TGUIScroll(menu
.GetControl('scParticlesCount')).Value
*1000);
145 g_Shells_SetMax(TGUIScroll(menu
.GetControl('scShellsMax')).Value
*30);
146 g_Gibs_SetMax(TGUIScroll(menu
.GetControl('scGibsMax')).Value
*25);
147 g_Corpses_SetMax(TGUIScroll(menu
.GetControl('scCorpsesMax')).Value
*5);
149 case TGUISwitch(menu
.GetControl('swGibsCount')).ItemIndex
of
154 else gGibsCount
:= 48;
157 gBloodCount
:= TGUISwitch(menu
.GetControl('swBloodCount')).ItemIndex
;
158 gFlash
:= TGUISwitch(menu
.GetControl('swScreenFlash')).ItemIndex
;
159 gAdvBlood
:= TGUISwitch(menu
.GetControl('swBloodType')).ItemIndex
= 1;
160 gAdvCorpses
:= TGUISwitch(menu
.GetControl('swCorpseType')).ItemIndex
= 1;
161 gAdvGibs
:= TGUISwitch(menu
.GetControl('swGibsType')).ItemIndex
= 1;
162 gDrawBackGround
:= TGUISwitch(menu
.GetControl('swBackGround')).ItemIndex
= 0;
163 gShowMessages
:= TGUISwitch(menu
.GetControl('swMessages')).ItemIndex
= 0;
164 gRevertPlayers
:= TGUISwitch(menu
.GetControl('swRevertPlayers')).ItemIndex
= 0;
165 gChatBubble
:= TGUISwitch(menu
.GetControl('swChatBubble')).ItemIndex
;
166 gPlayerIndicator
:= TGUISwitch(menu
.GetControl('swPlayerIndicator')).ItemIndex
;
167 gPlayerIndicatorStyle
:= TGUISwitch(menu
.GetControl('swPlayerIndicatorStyle')).ItemIndex
;
168 if TGUIScroll(menu
.GetControl('scScaleFactor')).Value
<> TempScale
then
170 TempScale
:= TGUIScroll(menu
.GetControl('scScaleFactor')).Value
;
171 g_dbg_scale
:= TempScale
+ 1;
173 gWeaponAutoswitch
:= TGUISwitch(menu
.GetControl('swWeaponAutoswitch')).ItemIndex
= 0;
176 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
180 g_Console_BindKey(g_Console_FindBind(1, 'screenshot'), '');
181 g_Console_BindKey(g_Console_FindBind(1, '+p1_scores', '-p1_scores'), '');
182 g_Console_BindKey(g_Console_FindBind(1, 'togglechat'), '');
183 g_Console_BindKey(g_Console_FindBind(1, 'toggleteamchat'), '');
184 g_Console_BindKey(TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_SCREENSHOT
])).Key
, 'screenshot');
185 g_Console_BindKey(TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_STAT
])).Key
, '+p1_scores', '-p1_scores');
186 g_Console_BindKey(TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_CHAT
])).Key
, 'togglechat');
187 g_Console_BindKey(TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_TEAMCHAT
])).Key
, 'toggleteamchat');
190 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1Menu').GetControl('mOptionsControlsP1Menu'));
193 g_Console_BindKey(g_Console_FindBind(1, '+p1_moveright', '-p1_moveright'), '');
194 g_Console_BindKey(g_Console_FindBind(1, '+p1_moveleft', '-p1_moveleft'), '');
195 g_Console_BindKey(g_Console_FindBind(1, '+p1_lookup', '-p1_lookup'), '');
196 g_Console_BindKey(g_Console_FindBind(1, '+p1_lookdown', '-p1_lookdown'), '');
197 g_Console_BindKey(g_Console_FindBind(1, '+p1_attack', '-p1_attack'), '');
198 g_Console_BindKey(g_Console_FindBind(1, '+p1_jump', '-p1_jump'), '');
199 g_Console_BindKey(g_Console_FindBind(1, '+p1_activate', '-p1_activate'), '');
200 g_Console_BindKey(g_Console_FindBind(1, '+p1_strafe', '-p1_strafe'), '');
201 g_Console_BindKey(g_Console_FindBind(1, 'p1_dropflag', ''), '');
202 g_Console_BindKey(g_Console_FindBind(1, 'p1_weapnext', ''), '');
203 g_Console_BindKey(g_Console_FindBind(1, 'p1_weapprev', ''), '');
204 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key0
, '+p1_moveright', '-p1_moveright');
205 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key0
, '+p1_moveleft', '-p1_moveleft');
206 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key0
, '+p1_lookup', '-p1_lookup');
207 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key0
, '+p1_lookdown', '-p1_lookdown');
208 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key0
, '+p1_attack', '-p1_attack');
209 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key0
, '+p1_jump', '-p1_jump');
210 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key0
, '+p1_activate', '-p1_activate');
211 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key0
, '+p1_strafe', '-p1_strafe');
212 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DROPFLAG
])).Key0
, 'p1_dropflag', '');
213 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key0
, 'p1_weapnext', '', True);
214 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key0
, 'p1_weapprev', '', True);
216 g_Console_BindKey(g_Console_FindBind(2, '+p1_moveright', '-p1_moveright'), '');
217 g_Console_BindKey(g_Console_FindBind(2, '+p1_moveleft', '-p1_moveleft'), '');
218 g_Console_BindKey(g_Console_FindBind(2, '+p1_lookup', '-p1_lookup'), '');
219 g_Console_BindKey(g_Console_FindBind(2, '+p1_lookdown', '-p1_lookdown'), '');
220 g_Console_BindKey(g_Console_FindBind(2, '+p1_attack', '-p1_attack'), '');
221 g_Console_BindKey(g_Console_FindBind(2, '+p1_jump', '-p1_jump'), '');
222 g_Console_BindKey(g_Console_FindBind(2, '+p1_activate', '-p1_activate'), '');
223 g_Console_BindKey(g_Console_FindBind(2, '+p1_strafe', '-p1_strafe'), '');
224 g_Console_BindKey(g_Console_FindBind(2, 'p1_dropflag', ''), '');
225 g_Console_BindKey(g_Console_FindBind(2, 'p1_weapnext', ''), '');
226 g_Console_BindKey(g_Console_FindBind(2, 'p1_weapprev', ''), '');
227 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key1
, '+p1_moveright', '-p1_moveright');
228 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key1
, '+p1_moveleft', '-p1_moveleft');
229 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key1
, '+p1_lookup', '-p1_lookup');
230 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key1
, '+p1_lookdown', '-p1_lookdown');
231 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key1
, '+p1_attack', '-p1_attack');
232 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key1
, '+p1_jump', '-p1_jump');
233 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key1
, '+p1_activate', '-p1_activate');
234 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key1
, '+p1_strafe', '-p1_strafe');
235 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DROPFLAG
])).Key1
, 'p1_dropflag', '');
236 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key1
, 'p1_weapnext', '', True);
237 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key1
, 'p1_weapprev', '', True);
240 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1MenuWeapons').GetControl('mOptionsControlsP1MenuWeapons'));
243 for i
:= WP_FIRST
to WP_LAST
do
245 g_Console_BindKey(g_Console_FindBind(1, 'p1_weapon ' + IntToStr(i
+ 1)), '');
246 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key0
, 'p1_weapon ' + IntToStr(i
+ 1));
247 g_Console_BindKey(g_Console_FindBind(2, 'p1_weapon ' + IntToStr(i
+ 1)), '');
248 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key1
, 'p1_weapon ' + IntToStr(i
+ 1));
252 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2Menu').GetControl('mOptionsControlsP2Menu'));
255 g_Console_BindKey(g_Console_FindBind(1, '+p2_moveright', '-p2_moveright'), '');
256 g_Console_BindKey(g_Console_FindBind(1, '+p2_moveleft', '-p2_moveleft'), '');
257 g_Console_BindKey(g_Console_FindBind(1, '+p2_lookup', '-p2_lookup'), '');
258 g_Console_BindKey(g_Console_FindBind(1, '+p2_lookdown', '-p2_lookdown'), '');
259 g_Console_BindKey(g_Console_FindBind(1, '+p2_attack', '-p2_attack'), '');
260 g_Console_BindKey(g_Console_FindBind(1, '+p2_jump', '-p2_jump'), '');
261 g_Console_BindKey(g_Console_FindBind(1, '+p2_activate', '-p2_activate'), '');
262 g_Console_BindKey(g_Console_FindBind(1, '+p2_strafe', '-p2_strafe'), '');
263 g_Console_BindKey(g_Console_FindBind(1, 'p2_dropflag', ''), '');
264 g_Console_BindKey(g_Console_FindBind(1, 'p2_weapnext', ''), '');
265 g_Console_BindKey(g_Console_FindBind(1, 'p2_weapprev', ''), '');
266 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key0
, '+p2_moveright', '-p2_moveright');
267 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key0
, '+p2_moveleft', '-p2_moveleft');
268 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key0
, '+p2_lookup', '-p2_lookup');
269 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key0
, '+p2_lookdown', '-p2_lookdown');
270 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key0
, '+p2_attack', '-p2_attack');
271 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key0
, '+p2_jump', '-p2_jump');
272 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key0
, '+p2_activate', '-p2_activate');
273 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key0
, '+p2_strafe', '-p2_strafe');
274 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DROPFLAG
])).Key0
, 'p2_dropflag', '');
275 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key0
, 'p2_weapnext', '', True);
276 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key0
, 'p2_weapprev', '', True);
278 g_Console_BindKey(g_Console_FindBind(2, '+p2_moveright', '-p2_moveright'), '');
279 g_Console_BindKey(g_Console_FindBind(2, '+p2_moveleft', '-p2_moveleft'), '');
280 g_Console_BindKey(g_Console_FindBind(2, '+p2_lookup', '-p2_lookup'), '');
281 g_Console_BindKey(g_Console_FindBind(2, '+p2_lookdown', '-p2_lookdown'), '');
282 g_Console_BindKey(g_Console_FindBind(2, '+p2_attack', '-p2_attack'), '');
283 g_Console_BindKey(g_Console_FindBind(2, '+p2_jump', '-p2_jump'), '');
284 g_Console_BindKey(g_Console_FindBind(2, '+p2_activate', '-p2_activate'), '');
285 g_Console_BindKey(g_Console_FindBind(2, '+p2_strafe', '-p2_strafe'), '');
286 g_Console_BindKey(g_Console_FindBind(2, 'p2_dropflag', ''), '');
287 g_Console_BindKey(g_Console_FindBind(2, 'p2_weapnext', ''), '');
288 g_Console_BindKey(g_Console_FindBind(2, 'p2_weapprev', ''), '');
289 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key1
, '+p2_moveright', '-p2_moveright');
290 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key1
, '+p2_moveleft', '-p2_moveleft');
291 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key1
, '+p2_lookup', '-p2_lookup');
292 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key1
, '+p2_lookdown', '-p2_lookdown');
293 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key1
, '+p2_attack', '-p2_attack');
294 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key1
, '+p2_jump', '-p2_jump');
295 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key1
, '+p2_activate', '-p2_activate');
296 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key1
, '+p2_strafe', '-p2_strafe');
297 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DROPFLAG
])).Key1
, 'p2_dropflag', '');
298 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key1
, 'p2_weapnext', '', True);
299 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key1
, 'p2_weapprev', '', True);
302 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2MenuWeapons').GetControl('mOptionsControlsP2MenuWeapons'));
305 for i
:= WP_FIRST
to WP_LAST
do
307 g_Console_BindKey(g_Console_FindBind(1, 'p2_weapon ' + IntToStr(i
+ 1)), '');
308 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key0
, 'p2_weapon ' + IntToStr(i
+ 1));
309 g_Console_BindKey(g_Console_FindBind(2, 'p2_weapon ' + IntToStr(i
+ 1)), '');
310 g_Console_BindKey(TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key1
, 'p2_weapon ' + IntToStr(i
+ 1));
314 if e_HasJoysticks
then
316 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsJoystickMenu').GetControl('mOptionsControlsJoystickMenu'));
319 for i
:= 0 to e_MaxJoys
- 1 do
320 if e_JoystickAvailable
[i
] then
321 e_JoystickDeadzones
[i
] := TGUIScroll(menu
.GetControl('scDeadzone' + IntToStr(i
))).Value
*(32767 div 20)
325 if g_touch_enabled
then
327 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsTouchMenu').GetControl('mOptionsControlsTouchMenu'));
328 g_touch_alt
:= TGUISwitch(menu
.GetControl('swTouchAlt')).ItemIndex
= 1;
329 g_touch_size
:= TGUIScroll(menu
.GetControl('scTouchSize')).Value
/ 10 + 0.5;
330 g_touch_fire
:= TGUISwitch(menu
.GetControl('swTouchFire')).ItemIndex
= 1;
331 g_touch_offset
:= TGUIScroll(menu
.GetControl('scTouchOffset')).Value
* 5;
334 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
336 gPlayer1Settings
.Name
:= b_Text_Unformat(TGUIEdit(menu
.GetControl('edP1Name')).Text);
337 gPlayer1Settings
.Team
:= IfThen(TGUISwitch(menu
.GetControl('swP1Team')).ItemIndex
= 0,
338 TEAM_RED
, TEAM_BLUE
);
340 with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mvP1Model')) do
342 gPlayer1Settings
.Model
:= Model
.Name
;
343 gPlayer1Settings
.Color
:= Model
.Color
;
346 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
348 gPlayer2Settings
.Name
:= b_Text_Unformat(TGUIEdit(menu
.GetControl('edP2Name')).Text);
349 gPlayer2Settings
.Team
:= IfThen(TGUISwitch(menu
.GetControl('swP2Team')).ItemIndex
= 0,
350 TEAM_RED
, TEAM_BLUE
);
351 with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mvP2Model')) do
353 gPlayer2Settings
.Model
:= Model
.Name
;
354 gPlayer2Settings
.Color
:= Model
.Color
;
357 if gPlayer1Settings
.Name
= '' then gPlayer1Settings
.Name
:= GenPlayerName(1);
358 if gPlayer2Settings
.Name
= '' then gPlayer2Settings
.Name
:= GenPlayerName(2);
360 if g_Game_IsServer
then
362 if gPlayer1
<> nil then
364 gPlayer1
.SetModel(gPlayer1Settings
.Model
);
365 gPlayer1
.Name
:= gPlayer1Settings
.Name
;
366 if not (gGameSettings
.GameMode
in [GM_TDM
, GM_CTF
]) then
367 gPlayer1
.SetColor(gPlayer1Settings
.Color
)
369 if gPlayer1
.Team
<> gPlayer1Settings
.Team
then
372 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
375 if gPlayer2
<> nil then
377 gPlayer2
.SetModel(gPlayer2Settings
.Model
);
378 gPlayer2
.Name
:= gPlayer2Settings
.Name
;
379 if (gGameSettings
.GameMode
<> GM_TDM
) and (gGameSettings
.GameMode
<> GM_CTF
) then
380 gPlayer2
.SetColor(gPlayer2Settings
.Color
)
382 if gPlayer2
.Team
<> gPlayer2Settings
.Team
then
387 if g_Game_IsClient
then MC_SEND_PlayerSettings
;
389 g_Console_WriteGameConfig
;
392 procedure ReadOptions();
397 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
399 with TGUISwitch(menu
.GetControl('swBPP')) do
405 with TGUISwitch(menu
.GetControl('swTextureFilter')) do
406 if gTextureFilter
then ItemIndex
:= 0 else ItemIndex
:= 1;
408 with TGUISwitch(menu
.GetControl('swVSync')) do
409 if gVSync
then ItemIndex
:= 0 else ItemIndex
:= 1;
411 with TGUISwitch(menu
.GetControl('swLegacyNPOT')) do
412 if not glNPOTOverride
then ItemIndex
:= 0 else ItemIndex
:= 1;
414 with TGUISwitch(menu
.GetControl('swInterp')) do
415 if gLerpActors
then ItemIndex
:= 0 else ItemIndex
:= 1;
417 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
419 TGUIScroll(menu
.GetControl('scSoundLevel')).Value
:= Round(gSoundLevel
/16);
420 TGUIScroll(menu
.GetControl('scMusicLevel')).Value
:= Round(gMusicLevel
/16);
421 TGUIScroll(menu
.GetControl('scMaxSimSounds')).Value
:= Round((gMaxSimSounds
-2)/4);
423 with TGUISwitch(menu
.GetControl('swInactiveSounds')) do
424 if gMuteWhenInactive
then
429 TGUISwitch(menu
.GetControl('swAnnouncer')).ItemIndex
:= gAnnouncer
;
431 with TGUISwitch(menu
.GetControl('swSoundEffects')) do
432 if gSoundEffectsDF
then
437 with TGUISwitch(menu
.GetControl('swChatSpeech')) do
438 if gUseChatSounds
then
443 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1Menu').GetControl('mOptionsControlsP1Menu'));
446 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key0
:= g_Console_FindBind(1, '+p1_moveright', '-p1_moveright');
447 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key0
:= g_Console_FindBind(1, '+p1_moveleft', '-p1_moveleft');
448 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key0
:= g_Console_FindBind(1, '+p1_lookup', '-p1_lookup');
449 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key0
:= g_Console_FindBind(1, '+p1_lookdown', '-p1_lookdown');
450 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key0
:= g_Console_FindBind(1, '+p1_attack', '-p1_attack');
451 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key0
:= g_Console_FindBind(1, '+p1_jump', '-p1_jump');
452 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key0
:= g_Console_FindBind(1, '+p1_activate', '-p1_activate');
453 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key0
:= g_Console_FindBind(1, '+p1_strafe', '-p1_strafe');
454 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DROPFLAG
])).Key0
:= g_Console_FindBind(1, 'p1_dropflag', '');
455 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key0
:= g_Console_FindBind(1, 'p1_weapnext', '');
456 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key0
:= g_Console_FindBind(1, 'p1_weapprev', '');
458 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key1
:= g_Console_FindBind(2, '+p1_moveright', '-p1_moveright');
459 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key1
:= g_Console_FindBind(2, '+p1_moveleft', '-p1_moveleft');
460 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key1
:= g_Console_FindBind(2, '+p1_lookup', '-p1_lookup');
461 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key1
:= g_Console_FindBind(2, '+p1_lookdown', '-p1_lookdown');
462 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key1
:= g_Console_FindBind(2, '+p1_attack', '-p1_attack');
463 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key1
:= g_Console_FindBind(2, '+p1_jump', '-p1_jump');
464 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key1
:= g_Console_FindBind(2, '+p1_activate', '-p1_activate');
465 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key1
:= g_Console_FindBind(2, '+p1_strafe', '-p1_strafe');
466 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DROPFLAG
])).Key1
:= g_Console_FindBind(2, 'p1_dropflag', '');
467 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key1
:= g_Console_FindBind(2, 'p1_weapnext', '');
468 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key1
:= g_Console_FindBind(2, 'p1_weapprev', '');
471 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1MenuWeapons').GetControl('mOptionsControlsP1MenuWeapons'));
474 for i
:= WP_FIRST
to WP_LAST
do
476 TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key0
:= g_Console_FindBind(1, 'p1_weapon ' + IntToStr(i
+ 1));
477 TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key1
:= g_Console_FindBind(2, 'p1_weapon ' + IntToStr(i
+ 1));
481 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2Menu').GetControl('mOptionsControlsP2Menu'));
484 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key0
:= g_Console_FindBind(1, '+p2_moveright', '-p2_moveright');
485 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key0
:= g_Console_FindBind(1, '+p2_moveleft', '-p2_moveleft');
486 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key0
:= g_Console_FindBind(1, '+p2_lookup', '-p2_lookup');
487 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key0
:= g_Console_FindBind(1, '+p2_lookdown', '-p2_lookdown');
488 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key0
:= g_Console_FindBind(1, '+p2_attack', '-p2_attack');
489 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key0
:= g_Console_FindBind(1, '+p2_jump', '-p2_jump');
490 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key0
:= g_Console_FindBind(1, '+p2_activate', '-p2_activate');
491 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key0
:= g_Console_FindBind(1, '+p2_strafe', '-p2_strafe');
492 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DROPFLAG
])).Key0
:= g_Console_FindBind(1, 'p2_dropflag', '');
493 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key0
:= g_Console_FindBind(1, 'p2_weapnext', '');
494 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key0
:= g_Console_FindBind(1, 'p2_weapprev', '');
496 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key1
:= g_Console_FindBind(2, '+p2_moveright', '-p2_moveright');
497 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key1
:= g_Console_FindBind(2, '+p2_moveleft', '-p2_moveleft');
498 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key1
:= g_Console_FindBind(2, '+p2_lookup', '-p2_lookup');
499 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key1
:= g_Console_FindBind(2, '+p2_lookdown', '-p2_lookdown');
500 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key1
:= g_Console_FindBind(2, '+p2_attack', '-p2_attack');
501 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key1
:= g_Console_FindBind(2, '+p2_jump', '-p2_jump');
502 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key1
:= g_Console_FindBind(2, '+p2_activate', '-p2_activate');
503 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key1
:= g_Console_FindBind(2, '+p2_strafe', '-p2_strafe');
504 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DROPFLAG
])).Key1
:= g_Console_FindBind(2, 'p2_dropflag', '');
505 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key1
:= g_Console_FindBind(2, 'p2_weapnext', '');
506 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key1
:= g_Console_FindBind(2, 'p2_weapprev', '');
509 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2MenuWeapons').GetControl('mOptionsControlsP2MenuWeapons'));
512 for i
:= WP_FIRST
to WP_LAST
do
514 TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key0
:= g_Console_FindBind(1, 'p2_weapon ' + IntToStr(i
+ 1));
515 TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key1
:= g_Console_FindBind(2, 'p2_weapon ' + IntToStr(i
+ 1));
519 if e_HasJoysticks
then
521 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsJoystickMenu').GetControl('mOptionsControlsJoystickMenu'));
524 for i
:= 0 to e_MaxJoys
- 1 do
525 if e_JoystickAvailable
[i
] then
526 TGUIScroll(menu
.GetControl('scDeadzone' + IntToStr(i
))).Value
:= e_JoystickDeadzones
[i
] div (32767 div 20)
530 if g_touch_enabled
then
532 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsTouchMenu').GetControl('mOptionsControlsTouchMenu'));
533 with TGUISwitch(menu
.GetControl('swTouchAlt')) do
534 if g_touch_alt
then ItemIndex
:= 1 else ItemIndex
:= 0;
535 TGUIScroll(menu
.GetControl('scTouchSize')).Value
:= Round((g_touch_size
- 0.5) * 10);
536 with TGUISwitch(menu
.GetControl('swTouchFire')) do
537 if g_touch_fire
then ItemIndex
:= 1 else ItemIndex
:= 0;
538 TGUIScroll(menu
.GetControl('scTouchOffset')).Value
:= Round(g_touch_offset
/ 5);
541 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
544 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_SCREENSHOT
])).Key
:= g_Console_FindBind(1, 'screenshot');
545 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_STAT
])).Key
:= g_Console_FindBind(1, '+p1_scores', '-p1_scores');
546 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_CHAT
])).Key
:= g_Console_FindBind(1, 'togglechat');
547 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_TEAMCHAT
])).Key
:= g_Console_FindBind(1, 'toggleteamchat');
550 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
552 TGUIScroll(menu
.GetControl('scParticlesCount')).Value
:= g_GFX_GetMax() div 1000;
553 TGUIScroll(menu
.GetControl('scShellsMax')).Value
:= g_Shells_GetMax() div 30;
554 TGUIScroll(menu
.GetControl('scGibsMax')).Value
:= g_Gibs_GetMax() div 25;
555 TGUIScroll(menu
.GetControl('scCorpsesMax')).Value
:= g_Corpses_GetMax() div 5;
556 TGUISwitch(menu
.GetControl('swBloodCount')).ItemIndex
:= gBloodCount
;
558 with TGUISwitch(menu
.GetControl('swScreenFlash')) do
561 with TGUISwitch(menu
.GetControl('swBloodType')) do
562 if gAdvBlood
then ItemIndex
:= 1 else ItemIndex
:= 0;
564 with TGUISwitch(menu
.GetControl('swCorpseType')) do
565 if gAdvCorpses
then ItemIndex
:= 1 else ItemIndex
:= 0;
567 with TGUISwitch(menu
.GetControl('swGibsType')) do
568 if gAdvGibs
then ItemIndex
:= 1 else ItemIndex
:= 0;
570 with TGUISwitch(menu
.GetControl('swGibsCount')) do
579 with TGUISwitch(menu
.GetControl('swBackGround')) do
580 if gDrawBackGround
then ItemIndex
:= 0 else ItemIndex
:= 1;
582 with TGUISwitch(menu
.GetControl('swMessages')) do
583 if gShowMessages
then ItemIndex
:= 0 else ItemIndex
:= 1;
585 with TGUISwitch(menu
.GetControl('swRevertPlayers')) do
586 if gRevertPlayers
then ItemIndex
:= 0 else ItemIndex
:= 1;
588 with TGUISwitch(menu
.GetControl('swChatBubble')) do
589 ItemIndex
:= gChatBubble
;
591 with TGUISwitch(menu
.GetControl('swPlayerIndicator')) do
592 ItemIndex
:= gPlayerIndicator
;
594 with TGUISwitch(menu
.GetControl('swPlayerIndicatorStyle')) do
595 ItemIndex
:= gPlayerIndicatorStyle
;
597 TempScale
:= Round(g_dbg_scale
- 1);
598 TGUIScroll(menu
.GetControl('scScaleFactor')).Value
:= TempScale
;
600 with TGUISwitch(menu
.GetControl('swWeaponAutoswitch')) do
601 if gWeaponAutoswitch
then ItemIndex
:= 0 else ItemIndex
:= 1;
603 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
605 TGUIListBox(menu
.GetControl('lsP1Model')).SelectItem(gPlayer1Settings
.Model
);
606 TGUIEdit(menu
.GetControl('edP1Name')).Text := gPlayer1Settings
.Name
;
608 TGUISwitch(menu
.GetControl('swP1Team')).ItemIndex
:=
609 IfThen(gPlayer1Settings
.Team
= TEAM_BLUE
, 1, 0);
611 TGUIScroll(menu
.GetControl('scP1Red')).Value
:= Round(gPlayer1Settings
.Color
.R
/16);
612 TGUIScroll(menu
.GetControl('scP1Green')).Value
:= Round(gPlayer1Settings
.Color
.G
/16);
613 TGUIScroll(menu
.GetControl('scP1Blue')).Value
:= Round(gPlayer1Settings
.Color
.B
/16);
615 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
617 TGUIListBox(menu
.GetControl('lsP2Model')).SelectItem(gPlayer2Settings
.Model
);
618 TGUIEdit(menu
.GetControl('edP2Name')).Text := gPlayer2Settings
.Name
;
620 TGUISwitch(menu
.GetControl('swP2Team')).ItemIndex
:=
621 IfThen(gPlayer2Settings
.Team
= TEAM_BLUE
, 1, 0);
623 TGUIScroll(menu
.GetControl('scP2Red')).Value
:= Round(gPlayer2Settings
.Color
.R
/16);
624 TGUIScroll(menu
.GetControl('scP2Green')).Value
:= Round(gPlayer2Settings
.Color
.G
/16);
625 TGUIScroll(menu
.GetControl('scP2Blue')).Value
:= Round(gPlayer2Settings
.Color
.B
/16);
627 ProcSelectModel(nil);
630 procedure ProcSwitchMonstersCustom(Sender
: TGUIControl
);
632 // don't turn off monsters in DM
634 with TGUIMenu(g_ActiveWindow.GetControl('mCustomGameMenu')) do
635 if TGUISwitch(GetControl('swGameMode')).GetText <> _lc[I_MENU_GAME_TYPE_CTF] then
636 TGUISwitch(GetControl('swMonsters')).ItemIndex := 0
638 TGUISwitch(GetControl('swMonsters')).ItemIndex := 1;
641 if TGUISwitch(GetControl('swGameMode')).GetText = _lc[I_MENU_GAME_TYPE_COOP] then
642 TGUISwitch(GetControl('swMonsters')).ItemIndex := 0
643 else if TGUISwitch(GetControl('swGameMode')).GetText = _lc[I_MENU_GAME_TYPE_CTF] then
644 TGUISwitch(GetControl('swMonsters')).ItemIndex := 1;
648 procedure ProcSwitchMonstersNet(Sender
: TGUIControl
);
650 // don't turn off monsters in DM
652 with TGUIMenu(g_ActiveWindow.GetControl('mNetServerMenu')) do
653 if TGUISwitch(GetControl('swGameMode')).GetText <> _lc[I_MENU_GAME_TYPE_CTF] then
654 TGUISwitch(GetControl('swMonsters')).ItemIndex := 0
656 TGUISwitch(GetControl('swMonsters')).ItemIndex := 1;
659 if TGUISwitch(GetControl('swGameMode')).GetText = _lc[I_MENU_GAME_TYPE_COOP] then
660 TGUISwitch(GetControl('swMonsters')).ItemIndex := 0
661 else if TGUISwitch(GetControl('swGameMode')).GetText = _lc[I_MENU_GAME_TYPE_CTF] then
662 TGUISwitch(GetControl('swMonsters')).ItemIndex := 1;
666 function LatchGameOptions(const MenuName
: string): Byte;
672 with TGUIMenu(g_ActiveWindow
.GetControl(MenuName
)) do
674 Map
:= TGUILabel(GetControl('lbMap')).Text;
677 if not isWadPath(Map
) then
680 Result
:= TGUISwitch(GetControl('swGameMode')).ItemIndex
+1;
681 gsGameMode
:= TGUISwitch(GetControl('swGameMode')).GetText
;
682 gsTimeLimit
:= StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
683 gsGoalLimit
:= StrToIntDef(TGUIEdit(GetControl('edGoalLimit')).Text, 0);
684 gsMaxLives
:= StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
685 gsItemRespawnTime
:= StrToIntDef(TGUIEdit(GetControl('edItemRespawnTime')).Text, 0);
686 gsPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
;
690 if TGUISwitch(GetControl('swTeamDamage')).ItemIndex
= 0 then
691 gsGameFlags
:= gsGameFlags
or GAME_OPTION_TEAMDAMAGE
;
692 if TGUISwitch(GetControl('swDeathmatchKeys')).ItemIndex
= 0 then
693 gsGameFlags
:= gsGameFlags
or GAME_OPTION_DMKEYS
;
694 if TGUISwitch(GetControl('swEnableExits')).ItemIndex
= 0 then
695 gsGameFlags
:= gsGameFlags
or GAME_OPTION_ALLOWEXIT
;
696 if TGUISwitch(GetControl('swWeaponStay')).ItemIndex
= 0 then
697 gsGameFlags
:= gsGameFlags
or GAME_OPTION_WEAPONSTAY
;
698 if TGUISwitch(GetControl('swMonsters')).ItemIndex
= 0 then
699 gsGameFlags
:= gsGameFlags
or GAME_OPTION_MONSTERS
;
701 case TGUISwitch(GetControl('swTeamHit')).ItemIndex
of
702 1: gsGameFlags
:= gsGameFlags
or GAME_OPTION_TEAMHITTRACE
;
703 2: gsGameFlags
:= gsGameFlags
or GAME_OPTION_TEAMHITPROJECTILE
;
704 0: gsGameFlags
:= gsGameFlags
or GAME_OPTION_TEAMHITTRACE
or GAME_OPTION_TEAMHITPROJECTILE
;
707 case TGUISwitch(GetControl('swBotsVS')).ItemIndex
of
708 1: gsGameFlags
:= gsGameFlags
or GAME_OPTION_BOTVSMONSTER
;
709 2: gsGameFlags
:= gsGameFlags
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
710 else gsGameFlags
:= gsGameFlags
or GAME_OPTION_BOTVSPLAYER
;
713 case TGUISwitch(GetControl('swFlagDrop')).ItemIndex
of
714 0: gsGameFlags
:= gsGameFlags
or GAME_OPTION_ALLOWDROPFLAG
or GAME_OPTION_THROWFLAG
;
715 1: gsGameFlags
:= gsGameFlags
or GAME_OPTION_ALLOWDROPFLAG
;
716 else gsGameFlags
:= gsGameFlags
and not (GAME_OPTION_ALLOWDROPFLAG
or GAME_OPTION_THROWFLAG
);
719 // TODO: get this crap out of here
720 gGameSettings
.ItemRespawnTime
:= gsItemRespawnTime
;
721 gGameSettings
.WarmupTime
:= gsWarmupTime
;
722 gGameSettings
.SpawnInvul
:= gsSpawnInvul
;
726 procedure ProcStartCustomGame();
730 GameMode
:= LatchGameOptions('mCustomGameMenu');
731 if GameMode
= GM_NONE
then Exit
;
733 g_Console_WriteGameConfig
;
734 g_Game_StartCustom(gsMap
, GameMode
, gsTimeLimit
, gsGoalLimit
,
735 gsMaxLives
, gsGameFlags
, gsPlayers
);
739 procedure ProcStartNetGame();
743 GameMode
:= LatchGameOptions('mNetServerMenu');
744 if GameMode
= GM_NONE
then Exit
;
746 with TGUIMenu(g_ActiveWindow
.GetControl('mNetServerMenu')) do
748 NetPort
:= StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
749 NetServerName
:= TGUIEdit(GetControl('edSrvName')).Text;
750 NetMaxClients
:= Max(1, StrToIntDef(TGUIEdit(GetControl('edMaxPlayers')).Text, 1));
751 NetMaxClients
:= Min(NET_MAXCLIENTS
, NetMaxClients
);
752 NetPassword
:= TGUIEdit(GetControl('edSrvPassword')).Text;
753 NetUseMaster
:= TGUISwitch(GetControl('swUseMaster')).ItemIndex
= 0;
756 g_Console_WriteGameConfig
;
757 g_Game_StartServer(gsMap
, GameMode
, gsTimeLimit
, gsGoalLimit
, gsMaxLives
,
758 gsGameFlags
, gsPlayers
, 0, NetPort
);
761 procedure ProcConnectNetGame();
765 with TGUIMenu(g_ActiveWindow
.GetControl('mNetClientMenu')) do
767 NetClientIP
:= TGUIEdit(GetControl('edIP')).Text;
768 NetClientPort
:= StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
769 PW
:= TGUIEdit(GetControl('edPW')).Text;
772 g_Console_WriteGameConfig
;
773 g_Game_StartClient(NetClientIP
, NetClientPort
, PW
);
776 procedure ProcEnterPassword();
780 with TGUIMenu(g_ActiveWindow
.GetControl('mClientPasswordMenu')) do
782 NetClientIP
:= PromptIP
;
783 NetClientPort
:= PromptPort
;
784 PW
:= TGUIEdit(GetControl('edPW')).Text;
787 g_Console_WriteGameConfig
;
788 g_Game_StartClient(NetClientIP
, NetClientPort
, PW
);
791 procedure ProcServerlist();
793 if not NetInitDone
then
795 if (not g_Net_Init()) then
797 g_Console_Add('NET: ERROR: Failed to init ENet!');
804 g_Net_Slist_Set(NetMasterList
);
806 gState
:= STATE_SLIST
;
807 g_ActiveWindow
:= nil;
809 slWaitStr
:= _lc
[I_NET_SLIST_WAIT
];
814 slReturnPressed
:= True;
815 if g_Net_Slist_Fetch(slCurrent
) then
817 if slCurrent
= nil then
818 slWaitStr
:= _lc
[I_NET_SLIST_NOSERVERS
];
821 slWaitStr
:= _lc
[I_NET_SLIST_ERROR
];
822 g_Serverlist_GenerateTable(slCurrent
, slTable
);
825 procedure ProcStartCampaign();
831 with TGUIMenu(g_ActiveWindow
.GetControl('mCampaignMenu')) do
833 WAD
:= TGUIFileListBox(GetControl('lsWAD')).SelectedItem();
834 TwoPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
= 1;
836 WAD
:= e_FindWadRel(MegawadDirs
, WAD
);
842 g_Game_StartSingle(WAD
+ ':\MAP01', TwoPlayers
, n
);
845 procedure ProcSelectMap(Sender
: TGUIControl
);
849 wad
, map
, res
: String;
851 win
:= g_GUI_GetWindow('SelectMapMenu');
852 with TGUIMenu(win
.GetControl('mSelectMapMenu')) do
854 wad
:= TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem();
855 map
:= TGUIListBox(GetControl('lsMapRes')).SelectedItem();
857 if (wad
= '') or (map
= '') then
858 begin // Ýòî íå êàðòà
859 TGUILabel(GetControl('lbMapName')).Text := '';
860 TGUILabel(GetControl('lbMapAuthor')).Text := '';
861 TGUILabel(GetControl('lbMapSize')).Text := '';
862 TGUIMemo(GetControl('meMapDescription')).SetText('');
863 TGUIMapPreview(win
.GetControl('mpMapPreview')).ClearMap();
864 TGUILabel(win
.GetControl('lbMapScale')).Text := '';
870 a
:= g_Map_GetMapInfo(res
);
872 TGUILabel(GetControl('lbMapName')).Text := a
.Name
;
873 TGUILabel(GetControl('lbMapAuthor')).Text := a
.Author
;
874 TGUILabel(GetControl('lbMapSize')).Text := Format('%dx%d', [a
.Width
, a
.Height
]);
875 TGUIMemo(GetControl('meMapDescription')).SetText(a
.Description
);
876 TGUIMapPreview(win
.GetControl('mpMapPreview')).SetMap(res
);
877 TGUILabel(win
.GetControl('lbMapScale')).Text :=
878 TGUIMapPreview(win
.GetControl('mpMapPreview')).GetScaleStr
;
883 procedure ProcSelectWAD(Sender
: TGUIControl
);
888 with TGUIMenu(g_GUI_GetWindow('SelectMapMenu').GetControl('mSelectMapMenu')) do
890 wad
:= TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem();
892 with TGUIListBox(GetControl('lsMapRes')) do
898 list
:= g_Map_GetMapsList(wad
);
912 procedure ProcSelectCampaignWAD(Sender
: TGUIControl
);
918 win
:= g_GUI_GetWindow('CampaignMenu');
919 with TGUIMenu(win
.GetControl('mCampaignMenu')) do
921 wad
:= TGUIFileListBox(GetControl('lsWAD')).SelectedItem();
925 TGUILabel(GetControl('lbWADName')).Text := '';
926 TGUILabel(GetControl('lbWADAuthor')).Text := '';
927 TGUIMemo(GetControl('meWADDescription')).SetText('');
930 a
:= g_Game_GetMegaWADInfo(wad
);
932 TGUILabel(GetControl('lbWADName')).Text := a
.Name
;
933 TGUILabel(GetControl('lbWADAuthor')).Text := a
.Author
;
934 TGUIMemo(GetControl('meWADDescription')).SetText(a
.Description
);
936 TGUIImage(win
.GetControl('mpWADImage')).ClearImage();
940 fn
:= g_ExtractWadName(a
.pic
);
942 TGUIImage(win
.GetControl('mpWADImage')).SetImage(wad
+a
.pic
)
944 TGUIImage(win
.GetControl('mpWADImage')).SetImage(a
.pic
);
949 procedure ProcChangeColor(Sender
: TGUIControl
);
953 window
:= g_GUI_GetWindow('OptionsPlayersP1Menu');
954 with TGUIMenu(window
.GetControl('mOptionsPlayersP1Menu')) do
955 TGUIModelView(window
.GetControl('mvP1Model')).SetColor(
956 Min(TGUIScroll(GetControl('scP1Red')).Value
*16, 255),
957 Min(TGUIScroll(GetControl('scP1Green')).Value
*16, 255),
958 Min(TGUIScroll(GetControl('scP1Blue')).Value
*16, 255));
960 window
:= g_GUI_GetWindow('OptionsPlayersP2Menu');
961 with TGUIMenu(window
.GetControl('mOptionsPlayersP2Menu')) do
962 TGUIModelView(window
.GetControl('mvP2Model')).SetColor(
963 Min(TGUIScroll(GetControl('scP2Red')).Value
*16, 255),
964 Min(TGUIScroll(GetControl('scP2Green')).Value
*16, 255),
965 Min(TGUIScroll(GetControl('scP2Blue')).Value
*16, 255));
968 procedure ProcSelectModel(Sender
: TGUIControl
);
973 window
:= g_GUI_GetWindow('OptionsPlayersP1Menu');
974 a
:= TGUIListBox(TGUIMenu(window
.GetControl('mOptionsPlayersP1Menu')).GetControl('lsP1Model')).SelectedItem
;
975 if a
<> '' then TGUIModelView(window
.GetControl('mvP1Model')).SetModel(a
);
977 window
:= g_GUI_GetWindow('OptionsPlayersP2Menu');
978 a
:= TGUIListBox(TGUIMenu(window
.GetControl('mOptionsPlayersP2Menu')).GetControl('lsP2Model')).SelectedItem
;
979 if a
<> '' then TGUIModelView(window
.GetControl('mvP2Model')).SetModel(a
);
981 ProcChangeColor(nil);
984 procedure LoadStdFont(cfgres
, texture
: string; var FontID
: DWORD
);
996 wad
:= TWADFile
.Create
;
997 if wad
.ReadFile(GameWAD
) then
998 wad
.GetResource('FONTS/'+cfgres
, cfgdata
, cfglen
);
1003 g_Texture_CreateWADEx('FONT_STD', GameWAD
+':FONTS\'+texture
);
1005 config
:= TConfig
.CreateMem(cfgdata
, cfglen
);
1006 cwdt
:= Min(Max(config
.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
1007 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
1008 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
1010 if g_Texture_Get('FONT_STD', ID
) then
1011 e_TextureFontBuild(ID
, FontID
, cwdt
, chgt
, spc
);
1016 if cfglen
<> 0 then FreeMem(cfgdata
);
1019 procedure LoadFont(txtres
, fntres
: string; var FontID
: DWORD
);
1025 cfgdata
, fntdata
: Pointer;
1026 cfglen
, fntlen
: Integer;
1034 wad
:= TWADFile
.Create
;
1035 if wad
.ReadFile(GameWAD
) then
1037 wad
.GetResource('FONTS/'+txtres
, cfgdata
, cfglen
);
1038 wad
.GetResource('FONTS/'+fntres
, fntdata
, fntlen
);
1044 config
:= TConfig
.CreateMem(cfgdata
, cfglen
);
1045 cwdt
:= Min(Max(config
.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
1046 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
1048 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
1049 FontID
:= e_CharFont_Create(spc
);
1051 for a
:= 0 to 255 do
1053 chrwidth
:= config
.ReadInt(IntToStr(a
), 'Width', 0);
1054 if chrwidth
= 0 then Continue
;
1056 if e_CreateTextureMemEx(fntdata
, fntlen
, CharID
, cwdt
*(a
mod 16), chgt
*(a
div 16),
1058 e_CharFont_AddChar(FontID
, CharID
, Chr(a
), chrwidth
);
1064 if cfglen
<> 0 then FreeMem(cfgdata
);
1065 if fntlen
<> 0 then FreeMem(fntdata
);
1068 procedure MenuLoadData();
1070 e_WriteLog('Loading menu data...', TMsgType
.Notify
);
1072 g_Texture_CreateWADEx('MAINMENU_LOGO', GameWAD
+':TEXTURES\MAINLOGO');
1073 g_Texture_CreateWADEx('MAINMENU_MARKER1', GameWAD
+':TEXTURES\MARKER1');
1074 g_Texture_CreateWADEx('MAINMENU_MARKER2', GameWAD
+':TEXTURES\MARKER2');
1075 g_Texture_CreateWADEx('SCROLL_LEFT', GameWAD
+':TEXTURES\SLEFT');
1076 g_Texture_CreateWADEx('SCROLL_RIGHT', GameWAD
+':TEXTURES\SRIGHT');
1077 g_Texture_CreateWADEx('SCROLL_MIDDLE', GameWAD
+':TEXTURES\SMIDDLE');
1078 g_Texture_CreateWADEx('SCROLL_MARKER', GameWAD
+':TEXTURES\SMARKER');
1079 g_Texture_CreateWADEx('EDIT_LEFT', GameWAD
+':TEXTURES\ELEFT');
1080 g_Texture_CreateWADEx('EDIT_RIGHT', GameWAD
+':TEXTURES\ERIGHT');
1081 g_Texture_CreateWADEx('EDIT_MIDDLE', GameWAD
+':TEXTURES\EMIDDLE');
1082 g_Texture_CreateWADEx('BOX1', GameWAD
+':TEXTURES\BOX1');
1083 g_Texture_CreateWADEx('BOX2', GameWAD
+':TEXTURES\BOX2');
1084 g_Texture_CreateWADEx('BOX3', GameWAD
+':TEXTURES\BOX3');
1085 g_Texture_CreateWADEx('BOX4', GameWAD
+':TEXTURES\BOX4');
1086 g_Texture_CreateWADEx('BOX5', GameWAD
+':TEXTURES\BOX5');
1087 g_Texture_CreateWADEx('BOX6', GameWAD
+':TEXTURES\BOX6');
1088 g_Texture_CreateWADEx('BOX7', GameWAD
+':TEXTURES\BOX7');
1089 g_Texture_CreateWADEx('BOX8', GameWAD
+':TEXTURES\BOX8');
1090 g_Texture_CreateWADEx('BOX9', GameWAD
+':TEXTURES\BOX9');
1091 g_Texture_CreateWADEx('BSCROLL_UP_A', GameWAD
+':TEXTURES\SCROLLUPA');
1092 g_Texture_CreateWADEx('BSCROLL_UP_U', GameWAD
+':TEXTURES\SCROLLUPU');
1093 g_Texture_CreateWADEx('BSCROLL_DOWN_A', GameWAD
+':TEXTURES\SCROLLDOWNA');
1094 g_Texture_CreateWADEx('BSCROLL_DOWN_U', GameWAD
+':TEXTURES\SCROLLDOWNU');
1095 g_Texture_CreateWADEx('BSCROLL_MIDDLE', GameWAD
+':TEXTURES\SCROLLMIDDLE');
1096 g_Texture_CreateWADEx('NOPIC', GameWAD
+':TEXTURES\NOPIC');
1098 g_Sound_CreateWADEx('MENU_SELECT', GameWAD
+':SOUNDS\MENUSELECT');
1099 g_Sound_CreateWADEx('MENU_OPEN', GameWAD
+':SOUNDS\MENUOPEN');
1100 g_Sound_CreateWADEx('MENU_CLOSE', GameWAD
+':SOUNDS\MENUCLOSE');
1101 g_Sound_CreateWADEx('MENU_CHANGE', GameWAD
+':SOUNDS\MENUCHANGE');
1102 g_Sound_CreateWADEx('SCROLL_ADD', GameWAD
+':SOUNDS\SCROLLADD');
1103 g_Sound_CreateWADEx('SCROLL_SUB', GameWAD
+':SOUNDS\SCROLLSUB');
1104 g_Sound_CreateWADEx('SOUND_PLAYER_FALL', GameWAD
+':SOUNDS\FALL');
1107 procedure MenuFreeData();
1109 e_CharFont_Remove(gMenuFont
);
1110 e_CharFont_Remove(gMenuSmallFont
);
1112 g_Texture_Delete('MAINMENU_LOGO');
1113 g_Texture_Delete('MAINMENU_MARKER1');
1114 g_Texture_Delete('MAINMENU_MARKER2');
1115 g_Texture_Delete('SCROLL_LEFT');
1116 g_Texture_Delete('SCROLL_RIGHT');
1117 g_Texture_Delete('SCROLL_MIDDLE');
1118 g_Texture_Delete('SCROLL_MARKER');
1119 g_Texture_Delete('EDIT_LEFT');
1120 g_Texture_Delete('EDIT_RIGHT');
1121 g_Texture_Delete('EDIT_MIDDLE');
1122 g_Texture_Delete('BOX1');
1123 g_Texture_Delete('BOX2');
1124 g_Texture_Delete('BOX3');
1125 g_Texture_Delete('BOX4');
1126 g_Texture_Delete('BOX5');
1127 g_Texture_Delete('BOX6');
1128 g_Texture_Delete('BOX7');
1129 g_Texture_Delete('BOX8');
1130 g_Texture_Delete('BOX9');
1131 g_Texture_Delete('BSCROLL_UP_A');
1132 g_Texture_Delete('BSCROLL_UP_U');
1133 g_Texture_Delete('BSCROLL_DOWN_A');
1134 g_Texture_Delete('BSCROLL_DOWN_U');
1135 g_Texture_Delete('BSCROLL_MIDDLE');
1136 g_Texture_Delete('NOPIC');
1138 g_Sound_Delete('MENU_SELECT');
1139 g_Sound_Delete('MENU_OPEN');
1140 g_Sound_Delete('MENU_CLOSE');
1141 g_Sound_Delete('MENU_CHANGE');
1142 g_Sound_Delete('SCROLL_ADD');
1143 g_Sound_Delete('SCROLL_SUB');
1144 g_Sound_Delete('SOUND_PLAYER_FALL');
1147 procedure ProcAuthorsMenu();
1149 gMusic
.SetByName('MUSIC_INTERMUS');
1153 procedure ProcExitMenuKeyDown (yes
: Boolean);
1156 snd
: TPlayableSound
;
1161 g_Game_StopAllSounds(True);
1162 case (Random(18)) of
1163 0: s
:= 'SOUND_MONSTER_PAIN';
1164 1: s
:= 'SOUND_MONSTER_DIE_3';
1165 2: s
:= 'SOUND_MONSTER_SLOP';
1166 3: s
:= 'SOUND_MONSTER_DEMON_DIE';
1167 4: s
:= 'SOUND_MONSTER_IMP_DIE_2';
1168 5: s
:= 'SOUND_MONSTER_MAN_DIE';
1169 6: s
:= 'SOUND_MONSTER_BSP_DIE';
1170 7: s
:= 'SOUND_MONSTER_VILE_DIE';
1171 8: s
:= 'SOUND_MONSTER_SKEL_DIE';
1172 9: s
:= 'SOUND_MONSTER_MANCUB_ALERT';
1173 10: s
:= 'SOUND_MONSTER_PAIN_PAIN';
1174 11: s
:= 'SOUND_MONSTER_BARON_DIE';
1175 12: s
:= 'SOUND_MONSTER_CACO_DIE';
1176 13: s
:= 'SOUND_MONSTER_CYBER_DIE';
1177 14: s
:= 'SOUND_MONSTER_KNIGHT_ALERT';
1178 15: s
:= 'SOUND_MONSTER_SPIDER_ALERT';
1179 else s
:= 'SOUND_PLAYER_FALL';
1181 snd
:= TPlayableSound
.Create();
1182 res
:= snd
.SetByName(s
);
1183 if not res
then res
:= snd
.SetByName('SOUND_PLAYER_FALL');
1187 while snd
.IsPlaying() do begin end;
1195 procedure ProcLoadMenu();
1202 TGUIEdit(TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a
))).Text := g_GetSaveName(a
, valid
);
1203 TGUIEdit(TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a
))).Invalid
:= not valid
;
1204 //TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a)).Enabled := valid;
1208 procedure ProcSaveMenu();
1216 name
:= g_GetSaveName(a
, valid
);
1217 TGUIEdit(TGUIMenu(g_GUI_GetWindow('SaveMenu').GetControl('mmSaveMenu')).GetControl('edSlot'+IntToStr(a
))).Text := name
;
1218 TGUIEdit(TGUIMenu(g_GUI_GetWindow('SaveMenu').GetControl('mmSaveMenu')).GetControl('edSlot'+IntToStr(a
))).Invalid
:= (name
<> '') and (not valid
);
1222 procedure ProcSaveGame(Sender
: TGUIControl
);
1226 if g_Game_IsNet
then Exit
;
1227 if g_Game_IsTestMap
then Exit
;
1228 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
1229 g_Game_PauseAllSounds(True);
1230 g_SaveGame(a
, TGUIEdit(Sender
).Text);
1232 g_ActiveWindow
:= nil;
1233 g_Game_Pause(False);
1236 procedure ProcLoadGame(Sender
: TGUIControl
);
1240 if g_Game_IsNet
then Exit
;
1241 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
1242 if g_LoadGame(a
) then
1244 g_Game_PauseAllSounds(False)
1246 else // Íå çàãðóçèëîñü - âîçâðàò â ìåíþ
1248 g_Console_Add(_lc
[I_MSG_BAD_SAVE_VERSION
], true);
1249 g_GUI_GetWindow('LoadMenu').SetActive(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu'));
1250 //g_ActiveWindow := nil;
1254 procedure ProcSinglePlayer (n
: Integer);
1255 var wad
, map
: AnsiString;
1258 wad
:= g_ExtractWadName(gDefaultMegawadStart
);
1259 map
:= g_ExtractFilePathName(gDefaultMegawadStart
);
1260 if e_FindResource(AllMapDirs
, wad
) then
1262 wad
:= ExpandFileName(wad
);
1263 g_Game_StartSingle(wad
+ ':\' + map
, n
> 1, n
)
1267 procedure ProcSingle1Player
;
1272 procedure ProcSingle2Players
;
1277 procedure ProcSelectMapMenu();
1280 wad_lb
: TGUIFileListBox
;
1281 map_lb
: TGUIListBox
;
1284 menu
:= TGUIMenu(g_GUI_GetWindow('SelectMapMenu').GetControl('mSelectMapMenu'));
1285 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsMapWAD'));
1286 map_lb
:= TGUIListBox(menu
.GetControl('lsMapRes'));
1288 if wad_lb
.SelectedItem() <> '' then
1289 map
:= map_lb
.SelectedItem()
1293 wad_lb
.UpdateFileList();
1296 if wad_lb
.SelectedItem() <> '' then
1299 map_lb
.SelectItem(map
);
1301 if map_lb
.SelectedItem() <> '' then
1305 g_GUI_ShowWindow('SelectMapMenu');
1308 procedure ProcSelectCampaignMenu();
1311 wad_lb
: TGUIFileListBox
;
1313 menu
:= TGUIMenu(g_GUI_GetWindow('CampaignMenu').GetControl('mCampaignMenu'));
1314 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsWAD'));
1316 wad_lb
.UpdateFileList();
1318 if wad_lb
.SelectedItem() <> '' then
1319 ProcSelectCampaignWAD(nil);
1322 procedure ProcSetMap();
1324 wad
, map
, res
: String;
1326 with TGUIMenu(g_ActiveWindow
.GetControl('mSelectMapMenu')) do
1328 wad
:= TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem();
1329 map
:= TGUIListBox(GetControl('lsMapRes')).SelectedItem();
1332 if (wad
= '') or (map
= '') then
1335 wad
:= e_FindWadRel(MapDirs
, WAD
);
1337 res
:= wad
+':\'+map
;
1339 TGUILabel(TGUIMenu(g_GUI_GetWindow('CustomGameMenu').GetControl('mCustomGameMenu')).GetControl('lbMap')).Text := res
;
1340 TGUILabel(TGUIMenu(g_GUI_GetWindow('NetServerMenu').GetControl('mNetServerMenu')).GetControl('lbMap')).Text := res
;
1343 procedure ProcChangeSoundSettings(Sender
: TGUIControl
);
1347 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
1349 g_Sound_SetupAllVolumes(
1350 Min(TGUIScroll(menu
.GetControl('scSoundLevel')).Value
*16, 255),
1351 Min(TGUIScroll(menu
.GetControl('scMusicLevel')).Value
*16, 255)
1355 procedure ProcChangeGameSettings(Sender
: TGUIControl
);
1359 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
1360 if TGUIScroll(menu
.GetControl('scScaleFactor')).Value
<> TempScale
then
1362 TempScale
:= TGUIScroll(menu
.GetControl('scScaleFactor')).Value
;
1363 g_dbg_scale
:= TempScale
+ 1;
1367 procedure ProcChangeTouchSettings(Sender
: TGUIControl
);
1371 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsTouchMenu').GetControl('mOptionsControlsTouchMenu'));
1372 g_touch_alt
:= TGUISwitch(menu
.GetControl('swTouchAlt')).ItemIndex
= 1;
1373 g_touch_size
:= TGUIScroll(menu
.GetControl('scTouchSize')).Value
/ 10 + 0.5;
1374 g_touch_offset
:= TGUIScroll(menu
.GetControl('scTouchOffset')).Value
* 5;
1377 procedure ProcOptionsPlayersMIMenu();
1382 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1384 a
:= TGUIListBox(TGUIMenu(g_ActiveWindow
.GetControl('mOptionsPlayers'+s
+'Menu')).GetControl('ls'+s
+'Model')).SelectedItem
;
1386 if a
= '' then Exit
;
1388 b
:= g_PlayerModel_GetInfo(a
);
1390 with TGUIMenu(g_GUI_GetWindow('OptionsPlayersMIMenu').GetControl('mOptionsPlayersMIMenu')) do
1392 TGUILabel(GetControl('lbName')).Text := b
.Name
;
1393 TGUILabel(GetControl('lbAuthor')).Text := b
.Author
;
1394 TGUIMemo(GetControl('meComment')).SetText(b
.Description
);
1396 if b
.HaveWeapon
then
1397 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_YES
]
1399 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_NO
];
1402 g_GUI_ShowWindow('OptionsPlayersMIMenu');
1405 procedure ProcOptionsPlayersAnim();
1409 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1414 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1417 Model
.GetCurrentAnimation
.Loop
:= True;
1418 Model
.GetCurrentAnimationMask
.Loop
:= True;
1422 procedure ProcOptionsPlayersWeap();
1426 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1431 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1435 procedure ProcOptionsPlayersRot();
1439 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1440 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')).Model
do
1442 if Direction
= TDirection
.D_LEFT
then Direction
:= TDirection
.D_RIGHT
else Direction
:= TDirection
.D_LEFT
;
1446 procedure ProcDefaultMenuKeyDown (yes
: Boolean);
1450 g_Options_SetDefault();
1456 procedure ProcSavedMenuKeyDown (yes
: Boolean);
1458 if yes
then ReadOptions();
1462 procedure ProcAuthorsClose();
1464 gMusic
.SetByName('MUSIC_MENU');
1466 gState
:= STATE_MENU
;
1469 procedure ProcGMClose();
1471 g_Game_InGameMenu(False);
1474 procedure ProcGMShow();
1479 if (gGameSettings
.GameType
= GT_SINGLE
) and
1480 ((gPlayer1
= nil) or (not gPlayer1
.alive
)) and
1481 ((gPlayer2
= nil) or (not gPlayer2
.alive
)) then
1482 Enabled
:= False; // Îäèí èç èãðîêîâ ïîãèá â ñèíãëå
1484 Enabled
:= False; // Çàïðåòèòü ñîõðàíåíèå â èíòåðìèññèè (íå ðåàëèçîâàíî)
1485 if g_Game_IsTestMap
then
1486 Enabled
:= False; // Åñëè èãðàåì íà òåñòîâîé èëè âðåìåííîé êàðòå
1487 TGUIMainMenu(g_ActiveWindow
.GetControl(
1488 g_ActiveWindow
.DefControl
)).EnableButton('save', Enabled
);
1491 procedure ProcChangePlayers();
1493 TeamGame
, Spectator
, AddTwo
: Boolean;
1494 P1Team
{, P2Team}: Byte;
1495 bP2
: TGUITextButton
;
1497 TeamGame
:= gGameSettings
.GameMode
in [GM_TDM
, GM_CTF
];
1498 Spectator
:= (gPlayer1
= nil) and (gPlayer2
= nil);
1499 AddTwo
:= gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
];
1500 P1Team
:= TEAM_NONE
;
1501 if gPlayer1
<> nil then P1Team
:= gPlayer1
.Team
;
1503 //P2Team := TEAM_NONE;
1504 //if gPlayer2 <> nil then P2Team := gPlayer2.Team;
1506 TGUIMainMenu(g_ActiveWindow
.GetControl(
1507 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinRed', TeamGame
and (P1Team
<> TEAM_RED
));
1508 TGUIMainMenu(g_ActiveWindow
.GetControl(
1509 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinBlue', TeamGame
and (P1Team
<> TEAM_BLUE
));
1510 TGUIMainMenu(g_ActiveWindow
.GetControl(
1511 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinGame', Spectator
and not TeamGame
);
1513 bP2
:= TGUIMainMenu(g_ActiveWindow
.GetControl(
1514 g_ActiveWindow
.DefControl
)).GetButton('tmPlayer2');
1515 bP2
.Enabled
:= AddTwo
and not Spectator
;
1517 bP2
.Color
:= MAINMENU_ITEMS_COLOR
1519 bP2
.Color
:= MAINMENU_UNACTIVEITEMS_COLOR
;
1520 if gPlayer2
= nil then
1521 bP2
.Caption
:= _lc
[I_MENU_ADD_PLAYER_2
]
1523 bP2
.Caption
:= _lc
[I_MENU_REM_PLAYER_2
];
1525 TGUIMainMenu(g_ActiveWindow
.GetControl(
1526 g_ActiveWindow
.DefControl
)).EnableButton('tmSpectate', not Spectator
);
1529 procedure ProcJoinRed();
1531 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1533 if g_Game_IsServer
then
1535 if gPlayer1
= nil then
1536 g_Game_AddPlayer(TEAM_RED
)
1539 if gPlayer1
.Team
<> TEAM_RED
then
1541 gPlayer1
.SwitchTeam
;
1542 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1545 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1550 gPlayer1Settings
.Team
:= TEAM_RED
;
1551 MC_SEND_PlayerSettings
;
1552 if gPlayer1
= nil then
1553 g_Game_AddPlayer(TEAM_RED
);
1555 g_ActiveWindow
:= nil;
1556 g_Game_Pause(False);
1559 procedure ProcJoinBlue();
1561 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1563 if g_Game_IsServer
then
1565 if gPlayer1
= nil then
1566 g_Game_AddPlayer(TEAM_BLUE
)
1569 if gPlayer1
.Team
<> TEAM_BLUE
then
1571 gPlayer1
.SwitchTeam
;
1572 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1575 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1580 gPlayer1Settings
.Team
:= TEAM_BLUE
;
1581 MC_SEND_PlayerSettings
;
1582 if gPlayer1
= nil then
1583 g_Game_AddPlayer(TEAM_BLUE
);
1585 g_ActiveWindow
:= nil;
1586 g_Game_Pause(False);
1589 procedure ProcJoinGame();
1591 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1593 if gPlayer1
= nil then
1595 g_ActiveWindow
:= nil;
1596 g_Game_Pause(False);
1599 procedure ProcSwitchP2();
1601 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
]) then
1603 if gPlayer1
= nil then
1605 if gPlayer2
= nil then
1608 g_Game_RemovePlayer();
1609 g_ActiveWindow
:= nil;
1610 g_Game_Pause(False);
1613 procedure ProcSpectate();
1615 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1618 g_ActiveWindow
:= nil;
1619 g_Game_Pause(False);
1622 procedure ProcRestartMenuKeyDown (yes
: Boolean);
1624 if yes
then g_Game_Restart() else g_GUI_HideWindow
;
1627 procedure ProcEndMenuKeyDown (yes
: Boolean);
1629 if yes
then gExit
:= EXIT_SIMPLE
else g_GUI_HideWindow
;
1632 procedure ProcSetRussianLanguage
;
1634 if gLanguage
<> LANGUAGE_RUSSIAN
then
1636 gLanguage
:= LANGUAGE_RUSSIAN
;
1637 gLanguageChange
:= True;
1638 gAskLanguage
:= False;
1643 procedure ProcSetEnglishLanguage
;
1645 if gLanguage
<> LANGUAGE_ENGLISH
then
1647 gLanguage
:= LANGUAGE_ENGLISH
;
1648 gLanguageChange
:= True;
1649 gAskLanguage
:= False;
1654 procedure ReadGameSettings();
1658 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1660 with gGameSettings
do
1662 with TGUISwitch(menu
.GetControl('swTeamDamage')) do
1663 if LongBool(Options
and GAME_OPTION_TEAMDAMAGE
) then
1667 with TGUISwitch(menu
.GetControl('swTeamHit')) do
1668 if (Options
and (GAME_OPTION_TEAMHITTRACE
or GAME_OPTION_TEAMHITPROJECTILE
)) = (GAME_OPTION_TEAMHITTRACE
or GAME_OPTION_TEAMHITPROJECTILE
) then
1670 else if LongBool(Options
and GAME_OPTION_TEAMHITTRACE
) then
1672 else if LongBool(Options
and GAME_OPTION_TEAMHITPROJECTILE
) then
1676 with TGUISwitch(menu
.GetControl('swDeathmatchKeys')) do
1677 if LongBool(Options
and GAME_OPTION_DMKEYS
) then
1681 with TGUISwitch(menu
.GetControl('swFlagDrop')) do
1682 if LongBool(Options
and GAME_OPTION_ALLOWDROPFLAG
) and LongBool(Options
and GAME_OPTION_THROWFLAG
) then
1684 else if LongBool(Options
and GAME_OPTION_ALLOWDROPFLAG
) then
1689 TGUIEdit(menu
.GetControl('edTimeLimit')).Text := IntToStr(TimeLimit
);
1690 TGUIEdit(menu
.GetControl('edGoalLimit')).Text := IntToStr(GoalLimit
);
1691 TGUIEdit(menu
.GetControl('edMaxLives')).Text := IntToStr(MaxLives
);
1693 with TGUISwitch(menu
.GetControl('swBotsVS')) do
1694 if LongBool(Options
and GAME_OPTION_BOTVSPLAYER
) and
1695 LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1698 if LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1703 if GameType
in [GT_CUSTOM
, GT_SERVER
] then
1705 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1706 TGUISwitch(menu
.GetControl('swTeamHit')).Enabled
:= True;
1707 if (GameMode
in [GM_DM
, GM_TDM
, GM_CTF
]) then
1709 TGUISwitch(menu
.GetControl('swDeathmatchKeys')).Enabled
:= True;
1710 TGUILabel(menu
.GetControlsText('swDeathmatchKeys')).Color
:= MENU_ITEMSTEXT_COLOR
;
1714 TGUISwitch(menu
.GetControl('swDeathmatchKeys')).Enabled
:= False;
1715 TGUILabel(menu
.GetControlsText('swDeathmatchKeys')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1717 TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
:= True;
1718 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1719 TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
:= True;
1720 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1721 TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
:= True;
1722 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_ITEMSTEXT_COLOR
;
1723 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1724 TGUISwitch(menu
.GetControl('swFlagDrop')).Enabled
:= True;
1728 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1729 TGUISwitch(menu
.GetControl('swTeamHit')).Enabled
:= True;
1730 TGUISwitch(menu
.GetControl('swDeathmatchKeys')).Enabled
:= False;
1731 TGUILabel(menu
.GetControlsText('swDeathmatchKeys')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1732 with TGUIEdit(menu
.GetControl('edTimeLimit')) do
1737 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1738 with TGUIEdit(menu
.GetControl('edGoalLimit')) do
1743 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1744 with TGUIEdit(menu
.GetControl('edMaxLives')) do
1749 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1750 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1751 TGUISwitch(menu
.GetControl('swFlagDrop')).Enabled
:= False;
1756 procedure ProcApplyGameSet();
1760 stat
: TPlayerStatArray
;
1762 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1764 if not g_Game_IsServer
then Exit
;
1766 with gGameSettings
do
1768 if TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
then
1770 if TGUISwitch(menu
.GetControl('swTeamDamage')).ItemIndex
= 0 then
1771 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
1773 Options
:= Options
and (not GAME_OPTION_TEAMDAMAGE
);
1776 if TGUISwitch(menu
.GetControl('swTeamHit')).Enabled
then
1778 Options
:= Options
and not (GAME_OPTION_TEAMHITTRACE
or GAME_OPTION_TEAMHITPROJECTILE
);
1779 case TGUISwitch(menu
.GetControl('swTeamHit')).ItemIndex
of
1780 1: Options
:= Options
or GAME_OPTION_TEAMHITTRACE
;
1781 2: Options
:= Options
or GAME_OPTION_TEAMHITPROJECTILE
;
1782 0: Options
:= Options
or GAME_OPTION_TEAMHITTRACE
or GAME_OPTION_TEAMHITPROJECTILE
;
1786 if TGUISwitch(menu
.GetControl('swDeathmatchKeys')).Enabled
then
1788 if TGUISwitch(menu
.GetControl('swDeathmatchKeys')).ItemIndex
= 0 then
1789 Options
:= Options
or GAME_OPTION_DMKEYS
1791 Options
:= Options
and (not GAME_OPTION_DMKEYS
);
1794 if TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
then
1796 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edTimeLimit')).Text, TimeLimit
);
1802 b
:= (gTime
- gGameStartTime
) div 1000 + 10; // 10 ñåêóíä íà ñìåíó
1804 TimeLimit
:= Max(n
, b
);
1808 if TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
then
1810 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edGoalLimit')).Text, GoalLimit
);
1817 if GameMode
= GM_DM
then
1819 stat
:= g_Player_GetStats();
1821 for a
:= 0 to High(stat
) do
1822 if stat
[a
].Frags
> b
then
1826 b
:= Max(gTeamStat
[TEAM_RED
].Goals
, gTeamStat
[TEAM_BLUE
].Goals
);
1828 GoalLimit
:= Max(n
, b
);
1832 if TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
then
1834 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edMaxLives')).Text, GoalLimit
);
1835 if n
< 0 then n
:= 0;
1836 if n
> 255 then n
:= 255;
1842 stat
:= g_Player_GetStats();
1844 for a
:= 0 to High(stat
) do
1845 if stat
[a
].Lives
> b
then
1848 MaxLives
:= Max(n
, b
);
1852 if TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
then
1854 case TGUISwitch(menu
.GetControl('swBotsVS')).ItemIndex
of
1857 Options
:= Options
and (not GAME_OPTION_BOTVSPLAYER
);
1858 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1862 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1863 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1867 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1868 Options
:= Options
and (not GAME_OPTION_BOTVSMONSTER
);
1873 if TGUISwitch(menu
.GetControl('swFlagDrop')).Enabled
then
1875 case TGUISwitch(menu
.GetControl('swFlagDrop')).ItemIndex
of
1876 0: Options
:= Options
or GAME_OPTION_ALLOWDROPFLAG
or GAME_OPTION_THROWFLAG
;
1877 1: Options
:= Options
or GAME_OPTION_ALLOWDROPFLAG
;
1878 else Options
:= Options
and not (GAME_OPTION_ALLOWDROPFLAG
or GAME_OPTION_THROWFLAG
);
1882 // don't forget to latch this shit
1883 gsGameFlags
:= Options
;
1884 gsMaxLives
:= MaxLives
;
1885 gsGoalLimit
:= GoalLimit
;
1886 gsTimeLimit
:= TimeLimit
;
1889 if g_Game_IsNet
then MH_SEND_GameSettings
;
1892 procedure ProcVideoOptionsRes();
1897 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1899 TGUILabel(menu
.GetControl('lbCurrentRes')).Text :=
1900 IntToStr(gWinSizeX
) +
1901 ' x ' + IntToStr(gWinSizeY
) +
1902 ', ' + IntToStr(gBPP
) + ' bpp';
1904 with TGUIListBox(menu
.GetControl('lsResolution')) do
1906 list
:= sys_GetDisplayModes(gBPP
);
1910 ItemIndex
:= Length(list
)
1918 with TGUISwitch(menu
.GetControl('swFullScreen')) do
1924 TempResScale
:= Round(r_pixel_scale
- 1);
1925 with TGUISwitch(menu
.GetControl('swResFactor')) do
1926 ItemIndex
:= Min(TempResScale
, gRC_Width
div 640 - 1);
1929 procedure ProcApplyVideoOptions();
1932 Fullscreen
: Boolean;
1933 SWidth
, SHeight
: Integer;
1934 ScaleChanged
: Boolean;
1937 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1939 str
:= TGUIListBox(menu
.GetControl('lsResolution')).SelectedItem
;
1941 SScanf(str
, '%dx%d', [@SWidth
, @SHeight
])
1944 SWidth
:= gWinSizeX
;
1945 SHeight
:= gWinSizeY
;
1946 TempResScale
:= Min(TempResScale
, SWidth
div 640 - 1);
1949 Fullscreen
:= TGUISwitch(menu
.GetControl('swFullScreen')).ItemIndex
= 0;
1951 ScaleChanged
:= False;
1952 if TGUISwitch(menu
.GetControl('swResFactor')).ItemIndex
<> TempResScale
then
1954 TempResScale
:= Min(TGUISwitch(menu
.GetControl('swResFactor')).ItemIndex
, SWidth
div 640 - 1);
1955 r_pixel_scale
:= TempResScale
+ 1;
1956 ScaleChanged
:= True;
1959 if (SWidth
<> gWinSizeX
) or
1960 (SHeight
<> gWinSizeY
) or
1961 (Fullscreen
<> gFullscreen
) or
1964 gResolutionChange
:= True;
1965 gRC_Width
:= SWidth
;
1966 gRC_Height
:= SHeight
;
1967 gRC_FullScreen
:= Fullscreen
;
1968 gRC_Maximized
:= gWinMaximized
;
1971 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1975 procedure ProcSetFirstRussianLanguage
;
1977 gLanguage
:= LANGUAGE_RUSSIAN
;
1978 gLanguageChange
:= True;
1979 gAskLanguage
:= False;
1982 procedure ProcSetFirstEnglishLanguage
;
1984 gLanguage
:= LANGUAGE_ENGLISH
;
1985 gLanguageChange
:= True;
1986 gAskLanguage
:= False;
1989 procedure ProcRecallAddress();
1991 with TGUIMenu(g_GUI_GetWindow('NetClientMenu').GetControl('mNetClientMenu')) do
1993 TGUIEdit(GetControl('edIP')).Text := NetClientIP
;
1994 TGUIEdit(GetControl('edPort')).Text := IntToStr(NetClientPort
);
1998 procedure CreateFirstLanguageMenu();
2002 Menu
:= TGUIWindow
.Create('FirstLanguageMenu');
2004 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, '', ' '))) do
2006 Name
:= 'mmFirstLanguageMenu';
2007 AddButton(@ProcSetFirstRussianLanguage
, 'Ðóññêèé', '');
2008 AddButton(@ProcSetFirstEnglishLanguage
, 'English', '');
2011 Menu
.DefControl
:= 'mmFirstLanguageMenu';
2012 Menu
.MainWindow
:= True;
2013 g_GUI_AddWindow(Menu
);
2016 procedure g_Menu_AskLanguage();
2018 CreateFirstLanguageMenu();
2019 g_GUI_ShowWindow('FirstLanguageMenu');
2022 procedure CreatePlayerOptionsMenu(s
: String);
2027 Menu
:= TGUIWindow
.Create('OptionsPlayers'+s
+'Menu');
2029 a
:= _lc
[I_MENU_PLAYER_1
]
2031 a
:= _lc
[I_MENU_PLAYER_2
];
2032 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, a
))) do
2034 Name
:= 'mOptionsPlayers'+s
+'Menu';
2035 with AddEdit(_lc
[I_MENU_PLAYER_NAME
]) do
2037 Name
:= 'ed'+s
+'Name';
2041 with AddSwitch(_lc
[I_MENU_PLAYER_TEAM
]) do
2043 Name
:= 'sw'+s
+'Team';
2044 AddItem(_lc
[I_MENU_PLAYER_TEAM_RED
]);
2045 AddItem(_lc
[I_MENU_PLAYER_TEAM_BLUE
]);
2047 with AddList(_lc
[I_MENU_PLAYER_MODEL
], 12, 6) do
2049 Name
:= 'ls'+s
+'Model';
2051 Items
:= g_PlayerModel_GetNames();
2052 OnChange
:= ProcSelectModel
;
2054 with AddScroll(_lc
[I_MENU_PLAYER_RED
]) do
2056 Name
:= 'sc'+s
+'Red';
2058 OnChange
:= ProcChangeColor
;
2060 with AddScroll(_lc
[I_MENU_PLAYER_GREEN
]) do
2062 Name
:= 'sc'+s
+'Green';
2064 OnChange
:= ProcChangeColor
;
2066 with AddScroll(_lc
[I_MENU_PLAYER_BLUE
]) do
2068 Name
:= 'sc'+s
+'Blue';
2070 OnChange
:= ProcChangeColor
;
2073 AddButton(@ProcOptionsPlayersMIMenu
, _lc
[I_MENU_MODEL_INFO
]);
2074 AddButton(@ProcOptionsPlayersAnim
, _lc
[I_MENU_MODEL_ANIMATION
]);
2075 AddButton(@ProcOptionsPlayersWeap
, _lc
[I_MENU_MODEL_CHANGE_WEAPON
]);
2076 AddButton(@ProcOptionsPlayersRot
, _lc
[I_MENU_MODEL_ROTATE
]);
2078 with TGUIModelView(Menu
.AddChild(TGUIModelView
.Create
)) do
2080 Name
:= 'mv'+s
+'Model';
2081 X
:= GetControl('ls'+s
+'Model').X
+TGUIListBox(GetControl('ls'+s
+'Model')).GetWidth
+16;
2082 Y
:= GetControl('ls'+s
+'Model').Y
;
2085 Menu
.DefControl
:= 'mOptionsPlayers'+s
+'Menu';
2086 g_GUI_AddWindow(Menu
);
2089 procedure CreateAllMenus();
2093 a
, cx
, _y
, i
: Integer;
2096 Menu
:= TGUIWindow
.Create('MainMenu');
2097 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, 'MAINMENU_LOGO', _lc
[I_MENU_MAIN_MENU
]))) do
2099 Name
:= 'mmMainMenu';
2100 AddButton(nil, _lc
[I_MENU_NEW_GAME
], 'NewGameMenu');
2101 AddButton(nil, _lc
[I_MENU_MULTIPLAYER
], 'NetGameMenu');
2102 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
2103 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
2104 AddButton(@ProcAuthorsMenu
, _lc
[I_MENU_AUTHORS
], 'AuthorsMenu');
2105 AddButton(nil, _lc
[I_MENU_EXIT
], 'ExitMenu');
2107 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(Format(_lc
[I_VERSION
], [GAME_VERSION
]), gMenuSmallFont
))) do
2109 Color
:= _RGB(255, 255, 255);
2110 X
:= gScreenWidth
-GetWidth
-8;
2111 Y
:= gScreenHeight
-GetHeight
-8;
2113 Menu
.DefControl
:= 'mmMainMenu';
2114 Menu
.MainWindow
:= True;
2115 g_GUI_AddWindow(Menu
);
2117 Menu
:= TGUIWindow
.Create('NewGameMenu');
2118 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, '', _lc
[I_MENU_NEW_GAME
]))) do
2120 Name
:= 'mmNewGameMenu';
2121 AddButton(@ProcSingle1Player
, _lc
[I_MENU_1_PLAYER
]);
2122 AddButton(@ProcSingle2Players
, _lc
[I_MENU_2_PLAYERS
]);
2123 AddButton(nil, _lc
[I_MENU_CUSTOM_GAME
], 'CustomGameMenu');
2124 AddButton(@ProcSelectCampaignMenu
, _lc
[I_MENU_CAMPAIGN
], 'CampaignMenu');
2126 Menu
.DefControl
:= 'mmNewGameMenu';
2127 g_GUI_AddWindow(Menu
);
2129 Menu
:= TGUIWindow
.Create('NetGameMenu');
2130 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, '', _lc
[I_MENU_MULTIPLAYER
]))) do
2132 Name
:= 'mmNetGameMenu';
2133 AddButton(@ProcRecallAddress
, _lc
[I_MENU_START_CLIENT
], 'NetClientMenu');
2134 AddButton(nil, _lc
[I_MENU_START_SERVER
], 'NetServerMenu');
2136 Menu
.DefControl
:= 'mmNetGameMenu';
2137 g_GUI_AddWindow(Menu
);
2139 Menu
:= TGUIWindow
.Create('NetServerMenu');
2140 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_START_SERVER
]))) do
2142 Name
:= 'mNetServerMenu';
2143 with AddEdit(_lc
[I_NET_SERVER_NAME
]) do
2145 Name
:= 'edSrvName';
2146 OnlyDigits
:= False;
2149 Text := NetServerName
;
2151 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
2153 Name
:= 'edSrvPassword';
2154 OnlyDigits
:= False;
2157 Text := NetPassword
;
2159 with AddEdit(_lc
[I_NET_PORT
]) do
2165 Text := IntToStr(NetPort
);
2167 with AddEdit(_lc
[I_NET_MAX_CLIENTS
]) do
2169 Name
:= 'edMaxPlayers';
2173 Text := IntToStr(NetMaxClients
);
2175 with AddSwitch(_lc
[I_NET_USE_MASTER
]) do
2177 Name
:= 'swUseMaster';
2178 AddItem(_lc
[I_MENU_YES
]);
2179 AddItem(_lc
[I_MENU_NO
]);
2180 if NetUseMaster
then
2186 with AddLabel(_lc
[I_MENU_MAP
]) do
2191 OnClick
:= @ProcSelectMapMenu
;
2193 with AddSwitch(_lc
[I_MENU_GAME_TYPE
]) do
2195 Name
:= 'swGameMode';
2196 AddItem(_lc
[I_MENU_GAME_TYPE_DM
]);
2197 AddItem(_lc
[I_MENU_GAME_TYPE_TDM
]);
2198 AddItem(_lc
[I_MENU_GAME_TYPE_CTF
]);
2199 AddItem(_lc
[I_MENU_GAME_TYPE_COOP
]);
2200 case g_Game_TextToMode(gsGameMode
) of
2202 GM_DM
: ItemIndex
:= 0;
2203 GM_TDM
: ItemIndex
:= 1;
2204 GM_CTF
: ItemIndex
:= 2;
2206 GM_COOP
: ItemIndex
:= 3;
2208 OnChange
:= ProcSwitchMonstersCustom
;
2210 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
2212 Name
:= 'edTimeLimit';
2216 if gsTimeLimit
> 0 then
2217 Text := IntToStr(gsTimeLimit
);
2219 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
2221 Name
:= 'edGoalLimit';
2225 if gsGoalLimit
> 0 then
2226 Text := IntToStr(gsGoalLimit
);
2228 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
2230 Name
:= 'edMaxLives';
2234 if gsMaxLives
> 0 then
2235 Text := IntToStr(gsMaxLives
);
2237 with AddEdit(_lc
[I_MENU_ITEM_RESPAWN_TIME
]) do
2239 Name
:= 'edItemRespawnTime';
2243 if gsItemRespawnTime
> 0 then
2244 Text := IntToStr(gsItemRespawnTime
);
2246 with AddSwitch(_lc
[I_MENU_PLAYERS
]) do
2248 Name
:= 'swPlayers';
2249 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2250 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2251 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2252 ItemIndex
:= gsPlayers
;
2254 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
2256 Name
:= 'swTeamDamage';
2257 AddItem(_lc
[I_MENU_YES
]);
2258 AddItem(_lc
[I_MENU_NO
]);
2259 if LongBool(gsGameFlags
and GAME_OPTION_TEAMDAMAGE
) then
2264 with AddSwitch(_lc
[I_MENU_TEAM_HIT
]) do
2266 Name
:= 'swTeamHit';
2267 AddItem(_lc
[I_MENU_TEAM_HIT_BOTH
]);
2268 AddItem(_lc
[I_MENU_TEAM_HIT_TRACE
]);
2269 AddItem(_lc
[I_MENU_TEAM_HIT_PROJECTILE
]);
2270 AddItem(_lc
[I_MENU_TEAM_HIT_NOTHING
]);
2271 if (gsGameFlags
and (GAME_OPTION_TEAMHITTRACE
or GAME_OPTION_TEAMHITPROJECTILE
)) = (GAME_OPTION_TEAMHITTRACE
or GAME_OPTION_TEAMHITPROJECTILE
) then
2273 else if LongBool(gsGameFlags
and GAME_OPTION_TEAMHITTRACE
) then
2275 else if LongBool(gsGameFlags
and GAME_OPTION_TEAMHITPROJECTILE
) then
2280 with AddSwitch(_lc
[I_MENU_DEATHMATCH_KEYS
]) do
2282 Name
:= 'swDeathmatchKeys';
2283 AddItem(_lc
[I_MENU_YES
]);
2284 AddItem(_lc
[I_MENU_NO
]);
2285 if LongBool(gsGameFlags
and GAME_OPTION_DMKEYS
) then
2290 with AddSwitch(_lc
[I_MENU_ENABLE_EXITS
]) do
2292 Name
:= 'swEnableExits';
2293 AddItem(_lc
[I_MENU_YES
]);
2294 AddItem(_lc
[I_MENU_NO
]);
2295 if LongBool(gsGameFlags
and GAME_OPTION_ALLOWEXIT
) then
2300 with AddSwitch(_lc
[I_MENU_WEAPONS_STAY
]) do
2302 Name
:= 'swWeaponStay';
2303 AddItem(_lc
[I_MENU_YES
]);
2304 AddItem(_lc
[I_MENU_NO
]);
2305 if LongBool(gsGameFlags
and GAME_OPTION_WEAPONSTAY
) then
2310 with AddSwitch(_lc
[I_MENU_ENABLE_MONSTERS
]) do
2312 Name
:= 'swMonsters';
2313 AddItem(_lc
[I_MENU_YES
]);
2314 AddItem(_lc
[I_MENU_NO
]);
2315 if LongBool(gsGameFlags
and GAME_OPTION_MONSTERS
) then
2320 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
2323 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
2324 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
2325 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
2327 if not LongBool(gsGameFlags
and GAME_OPTION_BOTVSMONSTER
) then
2329 if not LongBool(gsGameFlags
and GAME_OPTION_BOTVSPLAYER
) then
2332 with AddSwitch(_lc
[I_MENU_FLAG_DROP
]) do
2334 Name
:= 'swFlagDrop';
2335 AddItem(_lc
[I_MENU_FLAG_THROW
]);
2336 AddItem(_lc
[I_MENU_YES
]);
2337 AddItem(_lc
[I_MENU_NO
]);
2338 if (gsGameFlags
and (GAME_OPTION_ALLOWDROPFLAG
or GAME_OPTION_THROWFLAG
)) = (GAME_OPTION_ALLOWDROPFLAG
or GAME_OPTION_THROWFLAG
) then
2340 else if LongBool(gsGameFlags
and GAME_OPTION_ALLOWDROPFLAG
) then
2346 AddButton(@ProcStartNetGame
, _lc
[I_MENU_START_GAME
]);
2350 Menu
.DefControl
:= 'mNetServerMenu';
2351 g_GUI_AddWindow(Menu
);
2353 Menu
:= TGUIWindow
.Create('NetClientMenu');
2354 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_START_CLIENT
]))) do
2356 Name
:= 'mNetClientMenu';
2358 AddButton(@ProcServerlist
, _lc
[I_NET_SLIST
]);
2361 with AddEdit(_lc
[I_NET_ADDRESS
]) do
2367 Text := 'localhost';
2369 with AddEdit(_lc
[I_NET_PORT
]) do
2377 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
2380 OnlyDigits
:= False;
2387 AddButton(@ProcConnectNetGame
, _lc
[I_MENU_CLIENT_CONNECT
]);
2391 Menu
.DefControl
:= 'mNetClientMenu';
2392 g_GUI_AddWindow(Menu
);
2394 Menu
:= TGUIWindow
.Create('LoadMenu');
2395 Menu
.OnShow
:= ProcLoadMenu
;
2396 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_LOAD_GAME
]))) do
2398 Name
:= 'mmLoadMenu';
2403 Name
:= 'edSlot'+IntToStr(a
);
2406 OnEnter
:= ProcLoadGame
;
2409 Menu
.DefControl
:= 'mmLoadMenu';
2410 g_GUI_AddWindow(Menu
);
2412 Menu
:= TGUIWindow
.Create('SaveMenu');
2413 Menu
.OnShow
:= ProcSaveMenu
;
2414 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SAVE_GAME
]))) do
2416 Name
:= 'mmSaveMenu';
2421 Name
:= 'edSlot'+IntToStr(a
);
2424 OnChange
:= ProcSaveGame
;
2427 Menu
.DefControl
:= 'mmSaveMenu';
2428 g_GUI_AddWindow(Menu
);
2430 Menu
:= TGUIWindow
.Create('CustomGameMenu');
2431 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CUSTOM_GAME
]))) do
2433 Name
:= 'mCustomGameMenu';
2434 with AddLabel(_lc
[I_MENU_MAP
]) do
2439 OnClick
:= @ProcSelectMapMenu
;
2441 with AddSwitch(_lc
[I_MENU_GAME_TYPE
]) do
2443 Name
:= 'swGameMode';
2444 AddItem(_lc
[I_MENU_GAME_TYPE_DM
]);
2445 AddItem(_lc
[I_MENU_GAME_TYPE_TDM
]);
2446 AddItem(_lc
[I_MENU_GAME_TYPE_CTF
]);
2447 AddItem(_lc
[I_MENU_GAME_TYPE_COOP
]);
2448 case g_Game_TextToMode(gsGameMode
) of
2450 GM_DM
: ItemIndex
:= 0;
2451 GM_TDM
: ItemIndex
:= 1;
2452 GM_CTF
: ItemIndex
:= 2;
2454 GM_COOP
: ItemIndex
:= 3;
2456 OnChange
:= ProcSwitchMonstersCustom
;
2458 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
2460 Name
:= 'edTimeLimit';
2464 if gsTimeLimit
> 0 then
2465 Text := IntToStr(gsTimeLimit
);
2467 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
2469 Name
:= 'edGoalLimit';
2473 if gsGoalLimit
> 0 then
2474 Text := IntToStr(gsGoalLimit
);
2476 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
2478 Name
:= 'edMaxLives';
2482 if gsMaxLives
> 0 then
2483 Text := IntToStr(gsMaxLives
);
2485 with AddEdit(_lc
[I_MENU_ITEM_RESPAWN_TIME
]) do
2487 Name
:= 'edItemRespawnTime';
2491 if gsItemRespawnTime
> 0 then
2492 Text := IntToStr(gsItemRespawnTime
);
2494 with AddSwitch(_lc
[I_MENU_PLAYERS
]) do
2496 Name
:= 'swPlayers';
2497 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2498 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2499 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2500 ItemIndex
:= gsPlayers
;
2502 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
2504 Name
:= 'swTeamDamage';
2505 AddItem(_lc
[I_MENU_YES
]);
2506 AddItem(_lc
[I_MENU_NO
]);
2507 if LongBool(gsGameFlags
and GAME_OPTION_TEAMDAMAGE
) then
2512 with AddSwitch(_lc
[I_MENU_TEAM_HIT
]) do
2514 Name
:= 'swTeamHit';
2515 AddItem(_lc
[I_MENU_TEAM_HIT_BOTH
]);
2516 AddItem(_lc
[I_MENU_TEAM_HIT_TRACE
]);
2517 AddItem(_lc
[I_MENU_TEAM_HIT_PROJECTILE
]);
2518 AddItem(_lc
[I_MENU_TEAM_HIT_NOTHING
]);
2519 if (gsGameFlags
and (GAME_OPTION_TEAMHITTRACE
or GAME_OPTION_TEAMHITPROJECTILE
)) = (GAME_OPTION_TEAMHITTRACE
or GAME_OPTION_TEAMHITPROJECTILE
) then
2521 else if LongBool(gsGameFlags
and GAME_OPTION_TEAMHITTRACE
) then
2523 else if LongBool(gsGameFlags
and GAME_OPTION_TEAMHITPROJECTILE
) then
2528 with AddSwitch(_lc
[I_MENU_DEATHMATCH_KEYS
]) do
2530 Name
:= 'swDeathmatchKeys';
2531 AddItem(_lc
[I_MENU_YES
]);
2532 AddItem(_lc
[I_MENU_NO
]);
2533 if LongBool(gsGameFlags
and GAME_OPTION_DMKEYS
) then
2538 with AddSwitch(_lc
[I_MENU_ENABLE_EXITS
]) do
2540 Name
:= 'swEnableExits';
2541 AddItem(_lc
[I_MENU_YES
]);
2542 AddItem(_lc
[I_MENU_NO
]);
2543 if LongBool(gsGameFlags
and GAME_OPTION_ALLOWEXIT
) then
2548 with AddSwitch(_lc
[I_MENU_WEAPONS_STAY
]) do
2550 Name
:= 'swWeaponStay';
2551 AddItem(_lc
[I_MENU_YES
]);
2552 AddItem(_lc
[I_MENU_NO
]);
2553 if LongBool(gsGameFlags
and GAME_OPTION_WEAPONSTAY
) then
2558 with AddSwitch(_lc
[I_MENU_ENABLE_MONSTERS
]) do
2560 Name
:= 'swMonsters';
2561 AddItem(_lc
[I_MENU_YES
]);
2562 AddItem(_lc
[I_MENU_NO
]);
2563 if LongBool(gsGameFlags
and GAME_OPTION_MONSTERS
) then
2568 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
2571 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
2572 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
2573 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
2575 if not LongBool(gsGameFlags
and GAME_OPTION_BOTVSMONSTER
) then
2577 if not LongBool(gsGameFlags
and GAME_OPTION_BOTVSPLAYER
) then
2580 with AddSwitch(_lc
[I_MENU_FLAG_DROP
]) do
2582 Name
:= 'swFlagDrop';
2583 AddItem(_lc
[I_MENU_FLAG_THROW
]);
2584 AddItem(_lc
[I_MENU_YES
]);
2585 AddItem(_lc
[I_MENU_NO
]);
2586 if (gsGameFlags
and (GAME_OPTION_ALLOWDROPFLAG
or GAME_OPTION_THROWFLAG
)) = (GAME_OPTION_ALLOWDROPFLAG
or GAME_OPTION_THROWFLAG
) then
2588 else if LongBool(gsGameFlags
and GAME_OPTION_ALLOWDROPFLAG
) then
2594 AddButton(@ProcStartCustomGame
, _lc
[I_MENU_START_GAME
]);
2598 Menu
.DefControl
:= 'mCustomGameMenu';
2599 g_GUI_AddWindow(Menu
);
2601 Menu
:= TGUIWindow
.Create('CampaignMenu');
2602 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CAMPAIGN
]))) do
2604 Name
:= 'mCampaignMenu';
2613 with AddFileList('', 15, 4) do
2616 OnChange
:= ProcSelectCampaignWAD
;
2620 FileMask
:= '*.wad|*.pk3|*.zip|*.dfz';
2621 SetBase(MegawadDirs
);
2624 with AddLabel(_lc
[I_MENU_MAP_NAME
]) do
2626 Name
:= 'lbWADName';
2630 with AddLabel(_lc
[I_MENU_MAP_AUTHOR
]) do
2632 Name
:= 'lbWADAuthor';
2636 AddLine(_lc
[I_MENU_MAP_DESCRIPTION
]);
2637 with AddMemo('', 15, 3) do
2639 Name
:= 'meWADDescription';
2640 Color
:= MENU_ITEMSCTRL_COLOR
;
2642 with AddSwitch(_lc
[I_MENU_PLAYERS
]) do
2644 Name
:= 'swPlayers';
2645 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2646 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2649 AddButton(@ProcStartCampaign
, _lc
[I_MENU_START_GAME
]);
2653 with TGUIImage(Menu
.AddChild(TGUIImage
.Create
)) do
2655 Name
:= 'mpWADImage';
2656 DefaultRes
:= 'NOPIC';
2657 X
:= GetControl('lsWAD').X
+4;
2658 Y
:= GetControl('lsWAD').Y
-128-MENU_VSPACE
;
2661 Menu
.DefControl
:= 'mCampaignMenu';
2662 g_GUI_AddWindow(Menu
);
2664 Menu
:= TGUIWindow
.Create('SelectMapMenu');
2665 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SELECT_MAP
]))) do
2667 Name
:= 'mSelectMapMenu';
2668 with AddFileList(_lc
[I_MENU_MAP_WAD
], 12, 4) do
2671 OnChange
:= ProcSelectWAD
;
2675 FileMask
:= '*.wad|*.pk3|*.zip|*.dfz';
2678 with AddList(_lc
[I_MENU_MAP_RESOURCE
], 12, 4) do
2682 OnChange
:= ProcSelectMap
;
2685 with AddLabel(_lc
[I_MENU_MAP_NAME
]) do
2687 Name
:= 'lbMapName';
2691 with AddLabel(_lc
[I_MENU_MAP_AUTHOR
]) do
2693 Name
:= 'lbMapAuthor';
2697 with AddLabel(_lc
[I_MENU_MAP_SIZE
]) do
2699 Name
:= 'lbMapSize';
2703 with AddMemo(_lc
[I_MENU_MAP_DESCRIPTION
], 12, 4) do
2705 Name
:= 'meMapDescription';
2710 with TGUIMapPreview(Menu
.AddChild(TGUIMapPreview
.Create
)) do
2712 Name
:= 'mpMapPreview';
2713 X
:= GetControl('lsMapWAD').X
+TGUIListBox(GetControl('lsMapWAD')).GetWidth()+2;
2714 Y
:= GetControl('lsMapWAD').Y
;
2716 with TGUILabel(Menu
.AddChild(TGUILabel
.Create('', gMenuSmallFont
))) do
2718 Name
:= 'lbMapScale';
2721 Color
:= MENU_ITEMSCTRL_COLOR
;
2722 X
:= GetControl('lsMapWAD').X
+
2723 TGUIListBox(GetControl('lsMapWAD')).GetWidth() +
2724 2 + MAPPREVIEW_WIDTH
*4;
2725 Y
:= GetControl('lsMapWAD').Y
+ MAPPREVIEW_HEIGHT
*16 + 16;
2728 Menu
.OnClose
:= ProcSetMap
;
2729 Menu
.DefControl
:= 'mSelectMapMenu';
2730 g_GUI_AddWindow(Menu
);
2732 Menu
:= TGUIWindow
.Create('OptionsMenu');
2733 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, '', _lc
[I_MENU_OPTIONS
]))) do
2735 Name
:= 'mmOptionsMenu';
2736 AddButton(nil, _lc
[I_MENU_VIDEO_OPTIONS
], 'OptionsVideoMenu');
2737 AddButton(nil, _lc
[I_MENU_SOUND_OPTIONS
], 'OptionsSoundMenu');
2738 AddButton(nil, _lc
[I_MENU_GAME_OPTIONS
], 'OptionsGameMenu');
2739 AddButton(nil, _lc
[I_MENU_CONTROLS_OPTIONS
], 'OptionsControlsMenu');
2740 AddButton(nil, _lc
[I_MENU_PLAYER_OPTIONS
], 'OptionsPlayersMenu');
2741 AddButton(nil, _lc
[I_MENU_LANGUAGE_OPTIONS
], 'OptionsLanguageMenu');
2743 AddButton(nil, _lc
[I_MENU_SAVED_OPTIONS
], 'SavedOptionsMenu').Color
:= _RGB(255, 0, 0);
2744 AddButton(nil, _lc
[I_MENU_DEFAULT_OPTIONS
], 'DefaultOptionsMenu').Color
:= _RGB(255, 0, 0);
2746 Menu
.OnClose
:= ProcApplyOptions
;
2747 Menu
.DefControl
:= 'mmOptionsMenu';
2748 g_GUI_AddWindow(Menu
);
2750 Menu
:= CreateYNMenu('SavedOptionsMenu', _lc
[I_MENU_LOAD_SAVED_PROMT
], Round(gScreenWidth
*0.6),
2751 gMenuSmallFont
, @ProcSavedMenuKeyDown
);
2752 g_GUI_AddWindow(Menu
);
2754 Menu
:= TGUIWindow
.Create('OptionsVideoMenu');
2755 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_VIDEO_OPTIONS
]))) do
2757 Name
:= 'mOptionsVideoMenu';
2758 AddButton(@ProcVideoOptionsRes
, _lc
[I_MENU_VIDEO_RESOLUTION
], 'OptionsVideoResMenu');
2759 with AddSwitch(_lc
[I_MENU_VIDEO_BPP
]) do
2765 with AddSwitch(_lc
[I_MENU_VIDEO_VSYNC
]) do
2768 AddItem(_lc
[I_MENU_YES
]);
2769 AddItem(_lc
[I_MENU_NO
]);
2771 with AddSwitch(_lc
[I_MENU_VIDEO_FILTER_SKY
]) do
2773 Name
:= 'swTextureFilter';
2774 AddItem(_lc
[I_MENU_YES
]);
2775 AddItem(_lc
[I_MENU_NO
]);
2777 with AddSwitch(_lc
[I_MENU_VIDEO_INTERPOLATION
]) do
2780 AddItem(_lc
[I_MENU_YES
]);
2781 AddItem(_lc
[I_MENU_NO
]);
2783 with AddSwitch(_lc
[I_MENU_VIDEO_LEGACY_COMPATIBLE
]) do
2785 Name
:= 'swLegacyNPOT';
2786 AddItem(_lc
[I_MENU_NO
]);
2787 AddItem(_lc
[I_MENU_YES
]);
2790 AddText(_lc
[I_MENU_VIDEO_NEED_RESTART
], Round(gScreenWidth
*0.6));
2793 Menu
.DefControl
:= 'mOptionsVideoMenu';
2794 g_GUI_AddWindow(Menu
);
2796 Menu
:= TGUIWindow
.Create('OptionsVideoResMenu');
2797 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_RESOLUTION_SELECT
]))) do
2799 Name
:= 'mOptionsVideoResMenu';
2800 with AddLabel(_lc
[I_MENU_RESOLUTION_CURRENT
]) do
2802 Name
:= 'lbCurrentRes';
2806 with AddList(_lc
[I_MENU_RESOLUTION_LIST
], 12, 6) do
2808 Name
:= 'lsResolution';
2811 with AddSwitch(_lc
[I_MENU_RESOLUTION_FULLSCREEN
]) do
2813 Name
:= 'swFullScreen';
2814 AddItem(_lc
[I_MENU_YES
]);
2815 AddItem(_lc
[I_MENU_NO
]);
2817 with AddSwitch(_lc
[I_MENU_GAME_SCALE_FACTOR
]) do
2819 Name
:= 'swResFactor';
2821 for i
:= 2 to gRC_Width
div 640 do
2822 AddItem(IntToStr(i
) + 'x');
2825 AddButton(@ProcApplyVideoOptions
, _lc
[I_MENU_RESOLUTION_APPLY
]);
2828 Menu
.DefControl
:= 'mOptionsVideoResMenu';
2829 g_GUI_AddWindow(Menu
);
2831 Menu
:= TGUIWindow
.Create('OptionsSoundMenu');
2832 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SOUND_OPTIONS
]))) do
2834 Name
:= 'mOptionsSoundMenu';
2835 with AddScroll(_lc
[I_MENU_SOUND_MUSIC_LEVEL
]) do
2837 Name
:= 'scMusicLevel';
2839 OnChange
:= ProcChangeSoundSettings
;
2841 with AddScroll(_lc
[I_MENU_SOUND_SOUND_LEVEL
]) do
2843 Name
:= 'scSoundLevel';
2845 OnChange
:= ProcChangeSoundSettings
;
2847 with AddScroll(_lc
[I_MENU_SOUND_MAX_SIM_SOUNDS
]) do
2849 Name
:= 'scMaxSimSounds';
2852 with AddSwitch (_lc
[I_MENU_SOUND_ANNOUNCE
]) do
2854 Name
:= 'swAnnouncer';
2855 AddItem(_lc
[I_MENU_ANNOUNCE_NONE
]);
2856 AddItem(_lc
[I_MENU_ANNOUNCE_ME
]);
2857 AddItem(_lc
[I_MENU_ANNOUNCE_MEPLUS
]);
2858 AddItem(_lc
[I_MENU_ANNOUNCE_ALL
]);
2860 // Ïåðåêëþ÷àòåëü çâóêîâûõ ýôôåêòîâ (DF / Doom 2)
2861 with AddSwitch (_lc
[I_MENU_SOUND_COMPAT
]) do
2863 Name
:= 'swSoundEffects';
2864 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2865 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2867 // Ïåðåêëþ÷àòåëü çâóêîâ ÷àòà
2868 with AddSwitch (_lc
[I_MENU_SOUND_CHAT
]) do
2870 Name
:= 'swChatSpeech';
2871 AddItem(_lc
[I_MENU_YES
]);
2872 AddItem(_lc
[I_MENU_NO
]);
2874 with AddSwitch(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS
]) do
2876 Name
:= 'swInactiveSounds';
2877 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_ON
]);
2878 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_OFF
]);
2882 Menu
.DefControl
:= 'mOptionsSoundMenu';
2883 g_GUI_AddWindow(Menu
);
2885 Menu
:= TGUIWindow
.Create('OptionsGameMenu');
2886 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_GAME_OPTIONS
]))) do
2888 Name
:= 'mOptionsGameMenu';
2889 with AddScroll(_lc
[I_MENU_GAME_PARTICLES_COUNT
]) do
2891 Name
:= 'scParticlesCount';
2894 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_COUNT
]) do
2896 Name
:= 'swBloodCount';
2897 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2898 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2899 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2900 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2901 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2903 with AddScroll(_lc
[I_MENU_GAME_MAX_SHELLS
]) do
2905 Name
:= 'scShellsMax';
2908 with AddScroll(_lc
[I_MENU_GAME_GIBS_COUNT
]) do
2910 Name
:= 'scGibsMax';
2913 with AddScroll(_lc
[I_MENU_GAME_MAX_CORPSES
]) do
2915 Name
:= 'scCorpsesMax';
2918 with AddSwitch(_lc
[I_MENU_GAME_MAX_GIBS
]) do
2920 Name
:= 'swGibsCount';
2921 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2922 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2923 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2924 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2925 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2927 with AddSwitch(_lc
[I_MENU_GAME_CORPSE_TYPE
]) do
2929 Name
:= 'swCorpseType';
2930 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_SIMPLE
]);
2931 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_ADV
]);
2933 with AddSwitch(_lc
[I_MENU_GAME_GIBS_TYPE
]) do
2935 Name
:= 'swGibsType';
2936 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_SIMPLE
]);
2937 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_ADV
]);
2939 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_TYPE
]) do
2941 Name
:= 'swBloodType';
2942 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_SIMPLE
]);
2943 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_ADV
]);
2945 with AddSwitch(_lc
[I_MENU_GAME_SCREEN_FLASH
]) do
2947 Name
:= 'swScreenFlash';
2948 AddItem(_lc
[I_MENU_NO
]);
2949 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2950 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2952 with AddSwitch(_lc
[I_MENU_GAME_BACKGROUND
]) do
2954 Name
:= 'swBackground';
2955 AddItem(_lc
[I_MENU_YES
]);
2956 AddItem(_lc
[I_MENU_NO
]);
2958 with AddSwitch(_lc
[I_MENU_GAME_MESSAGES
]) do
2960 Name
:= 'swMessages';
2961 AddItem(_lc
[I_MENU_YES
]);
2962 AddItem(_lc
[I_MENU_NO
]);
2964 with AddSwitch(_lc
[I_MENU_GAME_REVERT_PLAYERS
]) do
2966 Name
:= 'swRevertPlayers';
2967 AddItem(_lc
[I_MENU_YES
]);
2968 AddItem(_lc
[I_MENU_NO
]);
2970 with AddSwitch(_lc
[I_MENU_GAME_CHAT_BUBBLE
]) do
2972 Name
:= 'swChatBubble';
2973 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_NONE
]);
2974 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_SIMPLE
]);
2975 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_ADV
]);
2976 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_COLOR
]);
2977 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_TEXTURE
]);
2979 with AddSwitch(_lc
[I_MENU_GAME_PLAYER_INDICATOR
]) do
2981 Name
:= 'swPlayerIndicator';
2982 AddItem(_lc
[I_MENU_GAME_INDICATOR_NONE
]);
2983 AddItem(_lc
[I_MENU_GAME_INDICATOR_OWN
]);
2984 AddItem(_lc
[I_MENU_GAME_INDICATOR_ALL
]);
2986 with AddSwitch(_lc
[I_MENU_GAME_INDICATOR_STYLE
]) do
2988 Name
:= 'swPlayerIndicatorStyle';
2989 AddItem(_lc
[I_MENU_GAME_INDICATOR_ARROW
]);
2990 AddItem(_lc
[I_MENU_GAME_INDICATOR_NAME
]);
2992 with AddScroll(_lc
[I_MENU_GAME_SCALE_FACTOR
]) do
2994 Name
:= 'scScaleFactor';
2996 OnChange
:= ProcChangeGameSettings
;
2998 with AddSwitch(_lc
[I_MENU_GAME_WEAPON_AUTOSWITCH
]) do
3000 Name
:= 'swWeaponAutoswitch';
3001 AddItem(_lc
[I_MENU_YES
]);
3002 AddItem(_lc
[I_MENU_NO
]);
3006 Menu
.DefControl
:= 'mOptionsGameMenu';
3007 g_GUI_AddWindow(Menu
);
3009 Menu
:= TGUIWindow
.Create('OptionsControlsMenu');
3010 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROLS_OPTIONS
]))) do
3012 Name
:= 'mOptionsControlsMenu';
3013 AddLine(_lc
[I_MENU_CONTROL_GLOBAL
]);
3014 AddKeyRead(_lc
[I_MENU_CONTROL_SCREENSHOT
]).Name
:= _lc
[I_MENU_CONTROL_SCREENSHOT
];
3015 AddKeyRead(_lc
[I_MENU_CONTROL_STAT
]).Name
:= _lc
[I_MENU_CONTROL_STAT
];
3016 AddKeyRead(_lc
[I_MENU_CONTROL_CHAT
]).Name
:= _lc
[I_MENU_CONTROL_CHAT
];
3017 AddKeyRead(_lc
[I_MENU_CONTROL_TEAMCHAT
]).Name
:= _lc
[I_MENU_CONTROL_TEAMCHAT
];
3019 AddButton(nil, _lc
[I_MENU_PLAYER_1_KBD
], 'OptionsControlsP1Menu');
3020 {AddButton(nil, _lc[I_MENU_PLAYER_1_ALT], 'OptionsControlsP1MenuAlt');}
3021 AddButton(nil, _lc
[I_MENU_PLAYER_1_WEAPONS
], 'OptionsControlsP1MenuWeapons');
3022 AddButton(nil, _lc
[I_MENU_PLAYER_2_KBD
], 'OptionsControlsP2Menu');
3023 {AddButton(nil, _lc[I_MENU_PLAYER_2_ALT], 'OptionsControlsP2MenuAlt');}
3024 AddButton(nil, _lc
[I_MENU_PLAYER_2_WEAPONS
], 'OptionsControlsP2MenuWeapons');
3025 if e_HasJoysticks
then
3028 AddButton(nil, _lc
[I_MENU_CONTROL_JOYSTICKS
], 'OptionsControlsJoystickMenu');
3030 if g_touch_enabled
then
3033 AddButton(nil, _lc
[I_MENU_CONTROL_TOUCH
], 'OptionsControlsTouchMenu');
3036 Menu
.DefControl
:= 'mOptionsControlsMenu';
3037 g_GUI_AddWindow(Menu
);
3039 Menu
:= TGUIWindow
.Create('OptionsControlsP1Menu');
3040 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_1_KBD
]))) do
3042 Name
:= 'mOptionsControlsP1Menu';
3043 AddKeyRead2(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
3044 AddKeyRead2(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
3045 AddKeyRead2(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
3046 AddKeyRead2(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
3047 AddKeyRead2(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
3048 AddKeyRead2(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
3049 AddKeyRead2(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
3050 AddKeyRead2(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
3051 AddKeyRead2(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
3052 AddKeyRead2(_lc
[I_MENU_CONTROL_STRAFE
]).Name
:= _lc
[I_MENU_CONTROL_STRAFE
];
3053 AddKeyRead2(_lc
[I_MENU_CONTROL_DROPFLAG
]).Name
:= _lc
[I_MENU_CONTROL_DROPFLAG
];
3055 Menu
.DefControl
:= 'mOptionsControlsP1Menu';
3056 g_GUI_AddWindow(Menu
);
3058 Menu
:= TGUIWindow
.Create('OptionsControlsP1MenuWeapons');
3059 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_1_WEAPONS
]))) do
3061 Name
:= 'mOptionsControlsP1MenuWeapons';
3062 for i
:= WP_FIRST
to WP_LAST
do
3063 AddKeyRead2(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)]).Name
:=
3064 _lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)];
3066 Menu
.DefControl
:= 'mOptionsControlsP1MenuWeapons';
3067 g_GUI_AddWindow(Menu
);
3069 Menu
:= TGUIWindow
.Create('OptionsControlsP2Menu');
3070 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_2_KBD
]))) do
3072 Name
:= 'mOptionsControlsP2Menu';
3073 AddKeyRead2(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
3074 AddKeyRead2(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
3075 AddKeyRead2(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
3076 AddKeyRead2(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
3077 AddKeyRead2(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
3078 AddKeyRead2(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
3079 AddKeyRead2(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
3080 AddKeyRead2(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
3081 AddKeyRead2(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
3082 AddKeyRead2(_lc
[I_MENU_CONTROL_STRAFE
]).Name
:= _lc
[I_MENU_CONTROL_STRAFE
];
3083 AddKeyRead2(_lc
[I_MENU_CONTROL_DROPFLAG
]).Name
:= _lc
[I_MENU_CONTROL_DROPFLAG
];
3085 Menu
.DefControl
:= 'mOptionsControlsP2Menu';
3086 g_GUI_AddWindow(Menu
);
3088 Menu
:= TGUIWindow
.Create('OptionsControlsP2MenuWeapons');
3089 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_2_WEAPONS
]))) do
3091 Name
:= 'mOptionsControlsP2MenuWeapons';
3092 for i
:= WP_FIRST
to WP_LAST
do
3093 AddKeyRead2(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)]).Name
:=
3094 _lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)];
3096 Menu
.DefControl
:= 'mOptionsControlsP2MenuWeapons';
3097 g_GUI_AddWindow(Menu
);
3099 Menu
:= TGUIWindow
.Create('OptionsControlsJoystickMenu');
3100 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROL_JOYSTICKS
]))) do
3102 Name
:= 'mOptionsControlsJoystickMenu';
3103 for i
:= 0 to e_MaxJoys
- 1 do
3104 with AddScroll(Format(_lc
[I_MENU_CONTROL_DEADZONE
], [i
+ 1])) do
3106 Name
:= 'scDeadzone' + IntToStr(i
);
3110 Menu
.DefControl
:= 'mOptionsControlsJoystickMenu';
3111 g_GUI_AddWindow(Menu
);
3113 Menu
:= TGUIWindow
.Create('OptionsControlsTouchMenu');
3114 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROL_TOUCH
]))) do
3116 Name
:= 'mOptionsControlsTouchMenu';
3117 with AddSwitch(_lc
[I_MENU_CONTROL_TOUCH_ALT
]) do
3119 Name
:= 'swTouchAlt';
3120 AddItem(_lc
[I_MENU_NO
]);
3121 AddItem(_lc
[I_MENU_YES
]);
3122 OnChange
:= ProcChangeTouchSettings
;
3124 with AddScroll(_lc
[I_MENU_CONTROL_TOUCH_SIZE
]) do
3126 Name
:= 'scTouchSize';
3128 OnChange
:= ProcChangeTouchSettings
;
3130 with AddSwitch(_lc
[I_MENU_CONTROL_TOUCH_FIRE
]) do
3132 Name
:= 'swTouchFire';
3133 AddItem(_lc
[I_MENU_NO
]);
3134 AddItem(_lc
[I_MENU_YES
]);
3136 with AddScroll(_lc
[I_MENU_CONTROL_TOUCH_OFFSET
]) do
3138 Name
:= 'scTouchOffset';
3140 OnChange
:= ProcChangeTouchSettings
;
3143 Menu
.DefControl
:= 'mOptionsControlsTouchMenu';
3144 g_GUI_AddWindow(Menu
);
3146 Menu
:= TGUIWindow
.Create('OptionsPlayersMenu');
3147 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_OPTIONS
]))) do
3149 Name
:= 'mOptionsPlayersMenu';
3150 AddButton(nil, _lc
[I_MENU_PLAYER_1
], 'OptionsPlayersP1Menu');
3151 AddButton(nil, _lc
[I_MENU_PLAYER_2
], 'OptionsPlayersP2Menu');
3153 Menu
.DefControl
:= 'mOptionsPlayersMenu';
3154 g_GUI_AddWindow(Menu
);
3156 CreatePlayerOptionsMenu('P1');
3157 CreatePlayerOptionsMenu('P2');
3159 Menu
:= TGUIWindow
.Create('OptionsPlayersMIMenu');
3160 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_MODEL_INFO
]))) do
3162 Name
:= 'mOptionsPlayersMIMenu';
3163 with AddLabel(_lc
[I_MENU_MODEL_NAME
]) do
3168 with AddLabel(_lc
[I_MENU_MODEL_AUTHOR
]) do
3173 with AddMemo(_lc
[I_MENU_MODEL_COMMENT
], 14, 6) do
3175 Name
:= 'meComment';
3178 AddLine(_lc
[I_MENU_MODEL_OPTIONS
]);
3179 with AddLabel(_lc
[I_MENU_MODEL_WEAPON
]) do
3182 FixedLength
:= Max(Length(_lc
[I_MENU_YES
]), Length(_lc
[I_MENU_NO
]));
3186 Menu
.DefControl
:= 'mOptionsPlayersMIMenu';
3187 g_GUI_AddWindow(Menu
);
3189 Menu
:= TGUIWindow
.Create('OptionsLanguageMenu');
3190 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_LANGUAGE_OPTIONS
]))) do
3192 Name
:= 'mOptionsLanguageMenu';
3193 AddButton(@ProcSetRussianLanguage
, _lc
[I_MENU_LANGUAGE_RUSSIAN
]);
3194 AddButton(@ProcSetEnglishLanguage
, _lc
[I_MENU_LANGUAGE_ENGLISH
]);
3197 Menu
.DefControl
:= 'mOptionsLanguageMenu';
3198 g_GUI_AddWindow(Menu
);
3200 Menu
:= CreateYNMenu('DefaultOptionsMenu', _lc
[I_MENU_SET_DEFAULT_PROMT
], Round(gScreenWidth
*0.6),
3201 gMenuSmallFont
, @ProcDefaultMenuKeyDown
);
3202 g_GUI_AddWindow(Menu
);
3204 Menu
:= TGUIWindow
.Create('AuthorsMenu');
3205 Menu
.BackTexture
:= 'INTER';
3206 Menu
.OnClose
:= ProcAuthorsClose
;
3210 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_1
], gMenuFont
))) do
3212 Color
:= _RGB(255, 0, 0);
3213 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
3215 _y
:= _y
+GetHeight();
3217 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(Format(_lc
[I_CREDITS_CAP_2
], [GAME_VERSION
, NET_PROTOCOL_VER
]), gMenuSmallFont
))) do
3219 Color
:= _RGB(255, 0, 0);
3220 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
3222 _y
:= _y
+GetHeight()+32;
3224 // ×òî äåëàë: Êòî äåëàë
3225 cx
:= gScreenWidth
div 2 - 320 + 64;
3226 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1
], gMenuSmallFont
))) do
3228 Color
:= _RGB(255, 0, 0);
3233 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1_1
], gMenuSmallFont
))) do
3235 Color
:= _RGB(255, 255, 255);
3240 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2
], gMenuSmallFont
))) do
3242 Color
:= _RGB(255, 0, 0);
3247 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2_1
], gMenuSmallFont
))) do
3249 Color
:= _RGB(255, 255, 255);
3254 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2_2
], gMenuSmallFont
))) do
3256 Color
:= _RGB(255, 255, 255);
3261 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3
], gMenuSmallFont
))) do
3263 Color
:= _RGB(255, 0, 0);
3268 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3_1
], gMenuSmallFont
))) do
3270 Color
:= _RGB(255, 255, 255);
3275 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4
], gMenuSmallFont
))) do
3277 Color
:= _RGB(255, 0, 0);
3282 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4_1
], gMenuSmallFont
))) do
3284 Color
:= _RGB(255, 255, 255);
3287 _y
:= gScreenHeight
- 128;
3290 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_3
], gMenuSmallFont
))) do
3292 Color
:= _RGB(255, 0, 0);
3297 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_1
], gMenuSmallFont
))) do
3299 Color
:= _RGB(255, 255, 255);
3302 _y
:= _y
+GetHeight();
3304 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_2
], gMenuSmallFont
))) do
3306 Color
:= _RGB(255, 255, 255);
3309 _y
:= _y
+GetHeight();
3311 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_3
], gMenuSmallFont
))) do
3313 Color
:= _RGB(255, 255, 255);
3316 _y
:= gScreenHeight
- 32;
3318 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_4
], gMenuSmallFont
))) do
3320 Color
:= _RGB(255, 0, 0);
3321 X
:= gScreenWidth
div 2 - GetWidth() div 2;
3324 g_GUI_AddWindow(Menu
);
3326 Menu
:= CreateYNMenu('ExitMenu', _lc
[I_MENU_EXIT_PROMT
], Round(gScreenWidth
*0.6),
3327 gMenuSmallFont
, @ProcExitMenuKeyDown
);
3328 g_GUI_AddWindow(Menu
);
3330 Menu
:= TGUIWindow
.Create('GameSingleMenu');
3331 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, '', _lc
[I_MENU_MAIN_MENU
]))) do
3333 Name
:= 'mmGameSingleMenu';
3334 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
3335 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
3336 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
3337 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3338 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
3339 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3341 Menu
.DefControl
:= 'mmGameSingleMenu';
3342 Menu
.MainWindow
:= True;
3343 Menu
.OnClose
:= ProcGMClose
;
3344 Menu
.OnShow
:= ProcGMShow
;
3345 g_GUI_AddWindow(Menu
);
3347 Menu
:= CreateYNMenu('EndGameMenu', _lc
[I_MENU_END_GAME_PROMT
], Round(gScreenWidth
*0.6),
3348 gMenuSmallFont
, @ProcEndMenuKeyDown
);
3349 g_GUI_AddWindow(Menu
);
3351 Menu
:= CreateYNMenu('RestartGameMenu', _lc
[I_MENU_RESTART_GAME_PROMT
], Round(gScreenWidth
*0.6),
3352 gMenuSmallFont
, @ProcRestartMenuKeyDown
);
3353 g_GUI_AddWindow(Menu
);
3355 Menu
:= TGUIWindow
.Create('GameCustomMenu');
3356 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, '', _lc
[I_MENU_MAIN_MENU
]))) do
3358 Name
:= 'mmGameCustomMenu';
3359 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
3360 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
3361 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
3362 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
3363 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3364 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
3365 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3367 Menu
.DefControl
:= 'mmGameCustomMenu';
3368 Menu
.MainWindow
:= True;
3369 Menu
.OnClose
:= ProcGMClose
;
3370 Menu
.OnShow
:= ProcGMShow
;
3371 g_GUI_AddWindow(Menu
);
3373 Menu
:= TGUIWindow
.Create('GameServerMenu');
3374 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, '', _lc
[I_MENU_MAIN_MENU
]))) do
3376 Name
:= 'mmGameServerMenu';
3377 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
3378 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
3379 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3380 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
3381 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3383 Menu
.DefControl
:= 'mmGameServerMenu';
3384 Menu
.MainWindow
:= True;
3385 Menu
.OnClose
:= ProcGMClose
;
3386 Menu
.OnShow
:= ProcGMShow
;
3387 g_GUI_AddWindow(Menu
);
3389 Menu
:= TGUIWindow
.Create('GameClientMenu');
3390 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, '', _lc
[I_MENU_MAIN_MENU
]))) do
3392 Name
:= 'mmGameClientMenu';
3393 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
3394 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3395 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3397 Menu
.DefControl
:= 'mmGameClientMenu';
3398 Menu
.MainWindow
:= True;
3399 Menu
.OnClose
:= ProcGMClose
;
3400 Menu
.OnShow
:= ProcGMShow
;
3401 g_GUI_AddWindow(Menu
);
3403 Menu
:= TGUIWindow
.Create('ClientPasswordMenu');
3404 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuSmallFont
, gMenuSmallFont
, _lc
[I_MENU_ENTERPASSWORD
]))) do
3406 Name
:= 'mClientPasswordMenu';
3407 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
3415 AddButton(@ProcEnterPassword
, _lc
[I_MENU_START_GAME
]);
3418 Menu
.DefControl
:= 'mClientPasswordMenu';
3419 g_GUI_AddWindow(Menu
);
3421 Menu
:= TGUIWindow
.Create('GameSetGameMenu');
3422 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SET_GAME
]))) do
3424 Name
:= 'mGameSetGameMenu';
3425 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
3427 Name
:= 'swTeamDamage';
3428 AddItem(_lc
[I_MENU_YES
]);
3429 AddItem(_lc
[I_MENU_NO
]);
3432 with AddSwitch(_lc
[I_MENU_TEAM_HIT
]) do
3434 Name
:= 'swTeamHit';
3435 AddItem(_lc
[I_MENU_TEAM_HIT_BOTH
]);
3436 AddItem(_lc
[I_MENU_TEAM_HIT_TRACE
]);
3437 AddItem(_lc
[I_MENU_TEAM_HIT_PROJECTILE
]);
3438 AddItem(_lc
[I_MENU_TEAM_HIT_NOTHING
]);
3441 with AddSwitch(_lc
[I_MENU_DEATHMATCH_KEYS
]) do
3443 Name
:= 'swDeathmatchKeys';
3444 AddItem(_lc
[I_MENU_YES
]);
3445 AddItem(_lc
[I_MENU_NO
]);
3448 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
3450 Name
:= 'edTimeLimit';
3455 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
3457 Name
:= 'edGoalLimit';
3462 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
3464 Name
:= 'edMaxLives';
3469 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
3472 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
3473 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
3474 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
3477 with AddSwitch(_lc
[I_MENU_FLAG_DROP
]) do
3479 Name
:= 'swFlagDrop';
3480 AddItem(_lc
[I_MENU_FLAG_THROW
]);
3481 AddItem(_lc
[I_MENU_YES
]);
3482 AddItem(_lc
[I_MENU_NO
]);
3488 Menu
.DefControl
:= 'mGameSetGameMenu';
3489 Menu
.OnClose
:= ProcApplyGameSet
;
3490 g_GUI_AddWindow(Menu
);
3492 Menu
:= TGUIWindow
.Create('TeamMenu');
3493 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, '', _lc
[I_MENU_CHANGE_PLAYERS
]))) do
3495 Name
:= 'mmTeamMenu';
3496 AddButton(@ProcJoinRed
, _lc
[I_MENU_JOIN_RED
], '').Name
:= 'tmJoinRed';
3497 AddButton(@ProcJoinBlue
, _lc
[I_MENU_JOIN_BLUE
], '').Name
:= 'tmJoinBlue';
3498 AddButton(@ProcJoinGame
, _lc
[I_MENU_JOIN_GAME
], '').Name
:= 'tmJoinGame';
3499 AddButton(@ProcSwitchP2
, _lc
[I_MENU_ADD_PLAYER_2
], '').Name
:= 'tmPlayer2';
3500 AddButton(@ProcSpectate
, _lc
[I_MENU_SPECTATE
], '').Name
:= 'tmSpectate';
3502 Menu
.DefControl
:= 'mmTeamMenu';
3503 Menu
.OnShow
:= ProcChangePlayers
;
3504 g_GUI_AddWindow(Menu
);
3507 procedure g_Menu_Show_SaveMenu();
3509 if g_Game_IsTestMap
then
3511 if gGameSettings
.GameType
= GT_SINGLE
then
3512 g_GUI_ShowWindow('GameSingleMenu')
3515 if g_Game_IsClient
then
3518 if g_Game_IsNet
then
3521 g_GUI_ShowWindow('GameCustomMenu');
3523 g_GUI_ShowWindow('SaveMenu');
3524 g_Sound_PlayEx('MENU_OPEN');
3527 procedure g_Menu_Show_LoadMenu (standalone
: Boolean=false);
3529 if (g_ActiveWindow
<> nil) and (g_ActiveWindow
.name
= 'LoadMenu') then exit
; // nothing to do
3530 if gGameSettings
.GameType
= GT_SINGLE
then
3532 if not standalone
then g_GUI_ShowWindow('GameSingleMenu')
3536 if g_Game_IsClient
then exit
;
3537 if g_Game_IsNet
then exit
;
3538 if not standalone
then g_GUI_ShowWindow('GameCustomMenu');
3540 g_GUI_ShowWindow('LoadMenu');
3541 g_Sound_PlayEx('MENU_OPEN');
3544 procedure g_Menu_Show_GameSetGame();
3546 if gGameSettings
.GameType
= GT_SINGLE
then
3547 g_GUI_ShowWindow('GameSingleMenu')
3550 if g_Game_IsClient
then
3553 if g_Game_IsNet
then
3554 g_GUI_ShowWindow('GameServerMenu')
3556 g_GUI_ShowWindow('GameCustomMenu');
3559 g_GUI_ShowWindow('GameSetGameMenu');
3560 g_Sound_PlayEx('MENU_OPEN');
3563 procedure g_Menu_Show_OptionsVideo();
3565 if gGameSettings
.GameType
= GT_SINGLE
then
3566 g_GUI_ShowWindow('GameSingleMenu')
3569 if g_Game_IsClient
then
3570 g_GUI_ShowWindow('GameClientMenu')
3572 if g_Game_IsNet
then
3573 g_GUI_ShowWindow('GameServerMenu')
3575 g_GUI_ShowWindow('GameCustomMenu');
3578 g_GUI_ShowWindow('OptionsMenu');
3579 g_GUI_ShowWindow('OptionsVideoMenu');
3580 g_Sound_PlayEx('MENU_OPEN');
3583 procedure g_Menu_Show_OptionsSound();
3585 if gGameSettings
.GameType
= GT_SINGLE
then
3586 g_GUI_ShowWindow('GameSingleMenu')
3589 if g_Game_IsClient
then
3590 g_GUI_ShowWindow('GameClientMenu')
3592 if g_Game_IsNet
then
3593 g_GUI_ShowWindow('GameServerMenu')
3595 g_GUI_ShowWindow('GameCustomMenu');
3598 g_GUI_ShowWindow('OptionsMenu');
3599 g_GUI_ShowWindow('OptionsSoundMenu');
3600 g_Sound_PlayEx('MENU_OPEN');
3603 procedure g_Menu_Show_EndGameMenu();
3605 g_GUI_ShowWindow('EndGameMenu');
3606 g_Sound_PlayEx('MENU_OPEN');
3609 procedure g_Menu_Show_QuitGameMenu();
3611 g_GUI_ShowWindow('ExitMenu');
3612 g_Sound_PlayEx('MENU_OPEN');
3615 procedure g_Menu_Init();
3622 procedure g_Menu_Free();
3626 e_WriteLog('Releasing menu data...', TMsgType
.Notify
);
3631 procedure g_Menu_Reset();
3635 g_GUI_SaveMenuPos();
3636 ex
:= g_GUI_Destroy();
3640 e_WriteLog('Recreating menu...', TMsgType
.Notify
);
3645 g_Game_SetDebugMode();
3647 g_GUI_LoadMenuPos();