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, either version 3 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 {$INCLUDE ../shared/a_modes.inc}
21 procedure g_Menu_Init();
22 procedure g_Menu_Free();
23 procedure g_Menu_Reset();
24 procedure LoadStdFont(cfgres
, texture
: string; var FontID
: DWORD
);
25 procedure LoadFont(txtres
, fntres
: string; var FontID
: DWORD
);
26 procedure g_Menu_AskLanguage();
28 procedure g_Menu_Show_SaveMenu();
29 procedure g_Menu_Show_LoadMenu(standalone
: Boolean=false);
30 procedure g_Menu_Show_GameSetGame();
31 procedure g_Menu_Show_OptionsVideo();
32 procedure g_Menu_Show_OptionsSound();
33 procedure g_Menu_Show_EndGameMenu();
34 procedure g_Menu_Show_QuitGameMenu();
38 gMenuSmallFont
: DWORD
;
45 {$INCLUDE ../nogl/noGLuses.inc}
46 g_gui
, g_textures
, e_graphics
, g_main
, g_window
, g_game
, g_map
,
47 g_basic
, g_console
, g_sound
, g_gfx
, g_player
, g_options
, g_weapons
,
48 e_log
, SysUtils
, CONFIG
, g_playermodel
, DateUtils
, sdl2
,
49 MAPDEF
, Math
, g_saveload
,
50 e_texture
, g_language
,
51 g_net
, g_netmsg
, g_netmaster
, g_items
, e_input
, g_touch
,
55 type TYNCallback
= procedure (yes
:Boolean);
57 procedure YNKeyDownProc (win
: TGUIWindow
; Key
: Byte);
59 if win
.UserData
= nil then exit
;
61 IK_Y
, IK_SPACE
: TYNCallback(win
.UserData
)(true);
62 IK_N
: TYNCallback(win
.UserData
)(false);
66 procedure YesButtonCB (ctl
: TGUITextButton
);
68 if ctl
.UserData
= nil then exit
;
69 TYNCallback(ctl
.UserData
)(true);
72 procedure NoButtonCB (ctl
: TGUITextButton
);
74 if ctl
.UserData
= nil then exit
;
75 TYNCallback(ctl
.UserData
)(false);
78 function CreateYNMenu (WinName
, Text: String; MaxLen
: Word; FontID
: DWORD
; ActionProc
: TYNCallback
): TGUIWindow
;
82 //if length(Text) = 0 then exit;
83 Result
:= TGUIWindow
.Create(WinName
);
86 //OnKeyDownEx := @YNKeyDownProc;
87 //UserData := @ActionProc;
88 menu
:= TGUIMenu(Result
.AddChild(TGUIMenu
.Create(gMenuSmallFont
, gMenuSmallFont
, '')));
91 Name
:= '__temp_yes_no_menu:'+WinName
;
93 AddText(Text, MaxLen
);
94 with AddButton(nil, _lc
[I_MENU_YES
]) do begin ProcEx
:= @YesButtonCB
; UserData
:= @ActionProc
; end;
95 with AddButton(nil, _lc
[I_MENU_NO
]) do begin ProcEx
:= @NoButtonCB
; UserData
:= @ActionProc
; end;
97 DefControl
:= '__temp_yes_no_menu:'+WinName
;
103 procedure ProcChangeColor(Sender
: TGUIControl
); forward;
104 procedure ProcSelectModel(Sender
: TGUIControl
); forward;
106 procedure ProcApplyOptions();
112 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
114 case TGUISwitch(menu
.GetControl('swBPP')).ItemIndex
of
124 gVSync
:= TGUISwitch(menu
.GetControl('swVSync')).ItemIndex
= 0;
125 if (ovs
<> gVSync
) then g_SetVSync(gVSync
);
127 gTextureFilter
:= TGUISwitch(menu
.GetControl('swTextureFilter')).ItemIndex
= 0;
128 glLegacyNPOT
:= not (TGUISwitch(menu
.GetControl('swLegacyNPOT')).ItemIndex
= 0);
130 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
132 g_Sound_SetupAllVolumes(
133 Min(TGUIScroll(menu
.GetControl('scSoundLevel')).Value
*16, 255),
134 Min(TGUIScroll(menu
.GetControl('scMusicLevel')).Value
*16, 255)
137 gMaxSimSounds
:= Max(Min(TGUIScroll(menu
.GetControl('scMaxSimSounds')).Value
*4+2, 66), 2);
138 gMuteWhenInactive
:= TGUISwitch(menu
.GetControl('swInactiveSounds')).ItemIndex
= 1;
139 gAnnouncer
:= TGUISwitch(menu
.GetControl('swAnnouncer')).ItemIndex
;
140 gSoundEffectsDF
:= TGUISwitch(menu
.GetControl('swSoundEffects')).ItemIndex
= 1;
141 gUseChatSounds
:= TGUISwitch(menu
.GetControl('swChatSpeech')).ItemIndex
= 0;
143 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
145 g_GFX_SetMax(TGUIScroll(menu
.GetControl('scParticlesCount')).Value
*1000);
146 g_Shells_SetMax(TGUIScroll(menu
.GetControl('scShellsMax')).Value
*30);
147 g_Gibs_SetMax(TGUIScroll(menu
.GetControl('scGibsMax')).Value
*25);
148 g_Corpses_SetMax(TGUIScroll(menu
.GetControl('scCorpsesMax')).Value
*5);
150 case TGUISwitch(menu
.GetControl('swGibsCount')).ItemIndex
of
155 else gGibsCount
:= 48;
158 gBloodCount
:= TGUISwitch(menu
.GetControl('swBloodCount')).ItemIndex
;
159 gFlash
:= TGUISwitch(menu
.GetControl('swScreenFlash')).ItemIndex
;
160 gAdvBlood
:= TGUISwitch(menu
.GetControl('swBloodType')).ItemIndex
= 1;
161 gAdvCorpses
:= TGUISwitch(menu
.GetControl('swCorpseType')).ItemIndex
= 1;
162 gAdvGibs
:= TGUISwitch(menu
.GetControl('swGibsType')).ItemIndex
= 1;
163 gDrawBackGround
:= TGUISwitch(menu
.GetControl('swBackGround')).ItemIndex
= 0;
164 gShowMessages
:= TGUISwitch(menu
.GetControl('swMessages')).ItemIndex
= 0;
165 gRevertPlayers
:= TGUISwitch(menu
.GetControl('swRevertPlayers')).ItemIndex
= 0;
166 gChatBubble
:= TGUISwitch(menu
.GetControl('swChatBubble')).ItemIndex
;
167 gPlayerIndicator
:= TGUISwitch(menu
.GetControl('swPlayerIndicator')).ItemIndex
= 0;
168 g_dbg_scale
:= TGUIScroll(menu
.GetControl('scScaleFactor')).Value
+ 1;
170 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
172 with menu
, gGameControls
.GameControls
do
174 TakeScreenshot
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_SCREENSHOT
])).Key
;
175 Stat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_STAT
])).Key
;
176 Chat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_CHAT
])).Key
;
177 TeamChat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_TEAMCHAT
])).Key
;
180 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1Menu').GetControl('mOptionsControlsP1Menu'));
181 with menu
, gGameControls
.P1Control
do
183 KeyRight
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key0
;
184 KeyLeft
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key0
;
185 KeyUp
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key0
;
186 KeyDown
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key0
;
187 KeyFire
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key0
;
188 KeyJump
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key0
;
189 KeyNextWeapon
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key0
;
190 KeyPrevWeapon
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key0
;
191 KeyOpen
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key0
;
192 KeyStrafe
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key0
;
194 KeyRight2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key1
;
195 KeyLeft2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key1
;
196 KeyUp2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key1
;
197 KeyDown2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key1
;
198 KeyFire2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key1
;
199 KeyJump2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key1
;
200 KeyNextWeapon2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key1
;
201 KeyPrevWeapon2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key1
;
202 KeyOpen2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key1
;
203 KeyStrafe2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key1
;
206 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1MenuWeapons').GetControl('mOptionsControlsP1MenuWeapons'));
207 with menu
, gGameControls
.P1Control
do
209 for i
:= WP_FIRST
to WP_LAST
do
211 KeyWeapon
[i
] := TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key0
;
212 KeyWeapon2
[i
] := TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key1
;
216 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2Menu').GetControl('mOptionsControlsP2Menu'));
217 with menu
, gGameControls
.P2Control
do
219 KeyRight
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key0
;
220 KeyLeft
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key0
;
221 KeyUp
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key0
;
222 KeyDown
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key0
;
223 KeyFire
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key0
;
224 KeyJump
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key0
;
225 KeyNextWeapon
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key0
;
226 KeyPrevWeapon
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key0
;
227 KeyOpen
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key0
;
228 KeyStrafe
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key0
;
230 KeyRight2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key1
;
231 KeyLeft2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key1
;
232 KeyUp2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key1
;
233 KeyDown2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key1
;
234 KeyFire2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key1
;
235 KeyJump2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key1
;
236 KeyNextWeapon2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key1
;
237 KeyPrevWeapon2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key1
;
238 KeyOpen2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key1
;
239 KeyStrafe2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key1
;
242 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2MenuWeapons').GetControl('mOptionsControlsP2MenuWeapons'));
243 with menu
, gGameControls
.P2Control
do
245 for i
:= WP_FIRST
to WP_LAST
do
247 KeyWeapon
[i
] := TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key0
;
248 KeyWeapon2
[i
] := TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key1
;
252 if e_JoysticksAvailable
> 0 then
254 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsJoystickMenu').GetControl('mOptionsControlsJoystickMenu'));
257 for i
:= 0 to e_JoysticksAvailable
-1 do
258 e_JoystickDeadzones
[i
] := TGUIScroll(menu
.GetControl('scDeadzone' + IntToStr(i
))).Value
*(32767 div 20);
262 if g_touch_enabled
then
264 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsTouchMenu').GetControl('mOptionsControlsTouchMenu'));
265 g_touch_alt
:= TGUISwitch(menu
.GetControl('swTouchAlt')).ItemIndex
= 1;
266 g_touch_size
:= TGUIScroll(menu
.GetControl('scTouchSize')).Value
/ 10 + 0.5;
267 g_touch_fire
:= TGUISwitch(menu
.GetControl('swTouchFire')).ItemIndex
= 1;
268 g_touch_offset
:= TGUIScroll(menu
.GetControl('scTouchOffset')).Value
* 5;
271 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
273 gPlayer1Settings
.Name
:= b_Text_Unformat(TGUIEdit(menu
.GetControl('edP1Name')).Text);
274 gPlayer1Settings
.Team
:= IfThen(TGUISwitch(menu
.GetControl('swP1Team')).ItemIndex
= 0,
275 TEAM_RED
, TEAM_BLUE
);
277 with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mvP1Model')) do
279 gPlayer1Settings
.Model
:= Model
.Name
;
280 gPlayer1Settings
.Color
:= Model
.Color
;
283 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
285 gPlayer2Settings
.Name
:= b_Text_Unformat(TGUIEdit(menu
.GetControl('edP2Name')).Text);
286 gPlayer2Settings
.Team
:= IfThen(TGUISwitch(menu
.GetControl('swP2Team')).ItemIndex
= 0,
287 TEAM_RED
, TEAM_BLUE
);
288 with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mvP2Model')) do
290 gPlayer2Settings
.Model
:= Model
.Name
;
291 gPlayer2Settings
.Color
:= Model
.Color
;
294 if gPlayer1Settings
.Name
= '' then gPlayer1Settings
.Name
:= GenPlayerName(1);
295 if gPlayer2Settings
.Name
= '' then gPlayer2Settings
.Name
:= GenPlayerName(2);
297 if g_Game_IsServer
then
299 if gPlayer1
<> nil then
301 gPlayer1
.SetModel(gPlayer1Settings
.Model
);
302 gPlayer1
.Name
:= gPlayer1Settings
.Name
;
303 if not (gGameSettings
.GameMode
in [GM_TDM
, GM_CTF
]) then
304 gPlayer1
.SetColor(gPlayer1Settings
.Color
)
306 if gPlayer1
.Team
<> gPlayer1Settings
.Team
then
309 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
312 if gPlayer2
<> nil then
314 gPlayer2
.SetModel(gPlayer2Settings
.Model
);
315 gPlayer2
.Name
:= gPlayer2Settings
.Name
;
316 if (gGameSettings
.GameMode
<> GM_TDM
) and (gGameSettings
.GameMode
<> GM_CTF
) then
317 gPlayer2
.SetColor(gPlayer2Settings
.Color
)
319 if gPlayer2
.Team
<> gPlayer2Settings
.Team
then
324 if g_Game_IsClient
then MC_SEND_PlayerSettings
;
326 g_Options_Write(GameDir
+'/'+CONFIG_FILENAME
);
329 procedure ReadOptions();
334 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
336 with TGUISwitch(menu
.GetControl('swBPP')) do
346 with TGUISwitch(menu
.GetControl('swTextureFilter')) do
347 if gTextureFilter
then ItemIndex
:= 0 else ItemIndex
:= 1;
349 with TGUISwitch(menu
.GetControl('swVSync')) do
350 if gVSync
then ItemIndex
:= 0 else ItemIndex
:= 1;
352 with TGUISwitch(menu
.GetControl('swLegacyNPOT')) do
353 if not glLegacyNPOT
then ItemIndex
:= 0 else ItemIndex
:= 1;
355 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
357 TGUIScroll(menu
.GetControl('scSoundLevel')).Value
:= Round(gSoundLevel
/16);
358 TGUIScroll(menu
.GetControl('scMusicLevel')).Value
:= Round(gMusicLevel
/16);
359 TGUIScroll(menu
.GetControl('scMaxSimSounds')).Value
:= Round((gMaxSimSounds
-2)/4);
361 with TGUISwitch(menu
.GetControl('swInactiveSounds')) do
362 if gMuteWhenInactive
then
367 TGUISwitch(menu
.GetControl('swAnnouncer')).ItemIndex
:= gAnnouncer
;
369 with TGUISwitch(menu
.GetControl('swSoundEffects')) do
370 if gSoundEffectsDF
then
375 with TGUISwitch(menu
.GetControl('swChatSpeech')) do
376 if gUseChatSounds
then
381 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1Menu').GetControl('mOptionsControlsP1Menu'));
382 with menu
, gGameControls
.P1Control
do
384 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key0
:= KeyRight
;
385 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key0
:= KeyLeft
;
386 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key0
:= KeyUp
;
387 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key0
:= KeyDown
;
388 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key0
:= KeyFire
;
389 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key0
:= KeyJump
;
390 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key0
:= KeyNextWeapon
;
391 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key0
:= KeyPrevWeapon
;
392 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key0
:= KeyOpen
;
393 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key0
:= KeyStrafe
;
395 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key1
:= KeyRight2
;
396 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key1
:= KeyLeft2
;
397 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key1
:= KeyUp2
;
398 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key1
:= KeyDown2
;
399 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key1
:= KeyFire2
;
400 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key1
:= KeyJump2
;
401 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key1
:= KeyNextWeapon2
;
402 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key1
:= KeyPrevWeapon2
;
403 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key1
:= KeyOpen2
;
404 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key1
:= KeyStrafe2
;
407 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1MenuWeapons').GetControl('mOptionsControlsP1MenuWeapons'));
408 with menu
, gGameControls
.P1Control
do
410 for i
:= WP_FIRST
to WP_LAST
do
412 TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key0
:= KeyWeapon
[i
];
413 TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key1
:= KeyWeapon2
[i
];
417 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2Menu').GetControl('mOptionsControlsP2Menu'));
418 with menu
, gGameControls
.P2Control
do
420 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key0
:= KeyRight
;
421 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key0
:= KeyLeft
;
422 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key0
:= KeyUp
;
423 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key0
:= KeyDown
;
424 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key0
:= KeyFire
;
425 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key0
:= KeyJump
;
426 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key0
:= KeyNextWeapon
;
427 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key0
:= KeyPrevWeapon
;
428 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key0
:= KeyOpen
;
429 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key0
:= KeyStrafe
;
431 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key1
:= KeyRight2
;
432 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key1
:= KeyLeft2
;
433 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key1
:= KeyUp2
;
434 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key1
:= KeyDown2
;
435 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key1
:= KeyFire2
;
436 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key1
:= KeyJump2
;
437 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key1
:= KeyNextWeapon2
;
438 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key1
:= KeyPrevWeapon2
;
439 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key1
:= KeyOpen2
;
440 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key1
:= KeyStrafe2
;
443 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2MenuWeapons').GetControl('mOptionsControlsP2MenuWeapons'));
444 with menu
, gGameControls
.P2Control
do
446 for i
:= WP_FIRST
to WP_LAST
do
448 TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key0
:= KeyWeapon
[i
];
449 TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key1
:= KeyWeapon2
[i
];
453 if e_JoysticksAvailable
> 0 then
455 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsJoystickMenu').GetControl('mOptionsControlsJoystickMenu'));
458 for i
:= 0 to e_JoysticksAvailable
-1 do
459 TGUIScroll(menu
.GetControl('scDeadzone' + IntToStr(i
))).Value
:= e_JoystickDeadzones
[i
] div (32767 div 20);
463 if g_touch_enabled
then
465 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsTouchMenu').GetControl('mOptionsControlsTouchMenu'));
466 with TGUISwitch(menu
.GetControl('swTouchAlt')) do
467 if g_touch_alt
then ItemIndex
:= 1 else ItemIndex
:= 0;
468 TGUIScroll(menu
.GetControl('scTouchSize')).Value
:= Round((g_touch_size
- 0.5) * 10);
469 with TGUISwitch(menu
.GetControl('swTouchFire')) do
470 if g_touch_fire
then ItemIndex
:= 1 else ItemIndex
:= 0;
471 TGUIScroll(menu
.GetControl('scTouchOffset')).Value
:= Round(g_touch_offset
/ 5);
474 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
475 with menu
, gGameControls
.GameControls
do
477 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_SCREENSHOT
])).Key
:= TakeScreenshot
;
478 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_STAT
])).Key
:= Stat
;
479 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_CHAT
])).Key
:= Chat
;
480 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_TEAMCHAT
])).Key
:= TeamChat
;
483 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
485 TGUIScroll(menu
.GetControl('scParticlesCount')).Value
:= g_GFX_GetMax() div 1000;
486 TGUIScroll(menu
.GetControl('scShellsMax')).Value
:= g_Shells_GetMax() div 30;
487 TGUIScroll(menu
.GetControl('scGibsMax')).Value
:= g_Gibs_GetMax() div 25;
488 TGUIScroll(menu
.GetControl('scCorpsesMax')).Value
:= g_Corpses_GetMax() div 5;
489 TGUISwitch(menu
.GetControl('swBloodCount')).ItemIndex
:= gBloodCount
;
491 with TGUISwitch(menu
.GetControl('swScreenFlash')) do
494 with TGUISwitch(menu
.GetControl('swBloodType')) do
495 if gAdvBlood
then ItemIndex
:= 1 else ItemIndex
:= 0;
497 with TGUISwitch(menu
.GetControl('swCorpseType')) do
498 if gAdvCorpses
then ItemIndex
:= 1 else ItemIndex
:= 0;
500 with TGUISwitch(menu
.GetControl('swGibsType')) do
501 if gAdvGibs
then ItemIndex
:= 1 else ItemIndex
:= 0;
503 with TGUISwitch(menu
.GetControl('swGibsCount')) do
512 with TGUISwitch(menu
.GetControl('swBackGround')) do
513 if gDrawBackGround
then ItemIndex
:= 0 else ItemIndex
:= 1;
515 with TGUISwitch(menu
.GetControl('swMessages')) do
516 if gShowMessages
then ItemIndex
:= 0 else ItemIndex
:= 1;
518 with TGUISwitch(menu
.GetControl('swRevertPlayers')) do
519 if gRevertPlayers
then ItemIndex
:= 0 else ItemIndex
:= 1;
521 with TGUISwitch(menu
.GetControl('swChatBubble')) do
522 ItemIndex
:= gChatBubble
;
524 with TGUISwitch(menu
.GetControl('swPlayerIndicator')) do
525 if gPlayerIndicator
then ItemIndex
:= 0 else ItemIndex
:= 1;
527 TGUIScroll(menu
.GetControl('scScaleFactor')).Value
:= Round(g_dbg_scale
- 1);
529 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
531 TGUIListBox(menu
.GetControl('lsP1Model')).SelectItem(gPlayer1Settings
.Model
);
532 TGUIEdit(menu
.GetControl('edP1Name')).Text := gPlayer1Settings
.Name
;
534 TGUISwitch(menu
.GetControl('swP1Team')).ItemIndex
:=
535 IfThen(gPlayer1Settings
.Team
= TEAM_BLUE
, 1, 0);
537 TGUIScroll(menu
.GetControl('scP1Red')).Value
:= Round(gPlayer1Settings
.Color
.R
/16);
538 TGUIScroll(menu
.GetControl('scP1Green')).Value
:= Round(gPlayer1Settings
.Color
.G
/16);
539 TGUIScroll(menu
.GetControl('scP1Blue')).Value
:= Round(gPlayer1Settings
.Color
.B
/16);
541 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
543 TGUIListBox(menu
.GetControl('lsP2Model')).SelectItem(gPlayer2Settings
.Model
);
544 TGUIEdit(menu
.GetControl('edP2Name')).Text := gPlayer2Settings
.Name
;
546 TGUISwitch(menu
.GetControl('swP2Team')).ItemIndex
:=
547 IfThen(gPlayer2Settings
.Team
= TEAM_BLUE
, 1, 0);
549 TGUIScroll(menu
.GetControl('scP2Red')).Value
:= Round(gPlayer2Settings
.Color
.R
/16);
550 TGUIScroll(menu
.GetControl('scP2Green')).Value
:= Round(gPlayer2Settings
.Color
.G
/16);
551 TGUIScroll(menu
.GetControl('scP2Blue')).Value
:= Round(gPlayer2Settings
.Color
.B
/16);
553 ProcSelectModel(nil);
556 procedure ProcSwitchMonstersCustom(Sender
: TGUIControl
);
558 // don't turn off monsters in DM
560 with TGUIMenu(g_ActiveWindow.GetControl('mCustomGameMenu')) do
561 if TGUISwitch(GetControl('swGameMode')).GetText <> _lc[I_MENU_GAME_TYPE_CTF] then
562 TGUISwitch(GetControl('swMonsters')).ItemIndex := 0
564 TGUISwitch(GetControl('swMonsters')).ItemIndex := 1;
567 if TGUISwitch(GetControl('swGameMode')).GetText = _lc[I_MENU_GAME_TYPE_COOP] then
568 TGUISwitch(GetControl('swMonsters')).ItemIndex := 0
569 else if TGUISwitch(GetControl('swGameMode')).GetText = _lc[I_MENU_GAME_TYPE_CTF] then
570 TGUISwitch(GetControl('swMonsters')).ItemIndex := 1;
574 procedure ProcSwitchMonstersNet(Sender
: TGUIControl
);
576 // don't turn off monsters in DM
578 with TGUIMenu(g_ActiveWindow.GetControl('mNetServerMenu')) do
579 if TGUISwitch(GetControl('swGameMode')).GetText <> _lc[I_MENU_GAME_TYPE_CTF] then
580 TGUISwitch(GetControl('swMonsters')).ItemIndex := 0
582 TGUISwitch(GetControl('swMonsters')).ItemIndex := 1;
585 if TGUISwitch(GetControl('swGameMode')).GetText = _lc[I_MENU_GAME_TYPE_COOP] then
586 TGUISwitch(GetControl('swMonsters')).ItemIndex := 0
587 else if TGUISwitch(GetControl('swGameMode')).GetText = _lc[I_MENU_GAME_TYPE_CTF] then
588 TGUISwitch(GetControl('swMonsters')).ItemIndex := 1;
592 procedure ProcStartCustomGame();
598 with TGUIMenu(g_ActiveWindow
.GetControl('mCustomGameMenu')) do
600 Map
:= TGUILabel(GetControl('lbMap')).Text;
603 if not isWadPath(Map
) then
606 GameMode
:= TGUISwitch(GetControl('swGameMode')).ItemIndex
+1;
607 gcGameMode
:= TGUISwitch(GetControl('swGameMode')).GetText
;
608 gcTimeLimit
:= StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
609 gcGoalLimit
:= StrToIntDef(TGUIEdit(GetControl('edGoalLimit')).Text, 0);
610 gcMaxLives
:= StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
612 gcTeamDamage
:= TGUISwitch(GetControl('swTeamDamage')).ItemIndex
= 0;
613 gcAllowExit
:= TGUISwitch(GetControl('swEnableExits')).ItemIndex
= 0;
614 gcWeaponStay
:= TGUISwitch(GetControl('swWeaponStay')).ItemIndex
= 0;
615 gcMonsters
:= TGUISwitch(GetControl('swMonsters')).ItemIndex
= 0;
618 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
620 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
622 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
624 Options
:= Options
or GAME_OPTION_MONSTERS
;
625 gcPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
;
627 case TGUISwitch(GetControl('swBotsVS')).ItemIndex
of
629 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
630 gcBotsVS
:= 'Monsters';
633 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
634 gcBotsVS
:= 'Everybody';
637 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
638 gcBotsVS
:= 'Players';
645 g_Options_Write_Gameplay_Custom(GameDir
+'/'+CONFIG_FILENAME
);
647 g_Game_StartCustom(Map
, GameMode
, gcTimeLimit
, gcGoalLimit
,
648 gcMaxLives
, Options
, gcPlayers
);
652 procedure ProcStartNetGame();
658 with TGUIMenu(g_ActiveWindow
.GetControl('mNetServerMenu')) do
660 Map
:= TGUILabel(GetControl('lbMap')).Text;
663 if not isWadPath(Map
) then
666 GameMode
:= TGUISwitch(GetControl('swGameMode')).ItemIndex
+1;
667 gnGameMode
:= TGUISwitch(GetControl('swGameMode')).GetText
;
668 gnTimeLimit
:= StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
669 gnGoalLimit
:= StrToIntDef(TGUIEdit(GetControl('edGoalLimit')).Text, 0);
670 gnMaxLives
:= StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
671 NetPort
:= StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
673 gnTeamDamage
:= TGUISwitch(GetControl('swTeamDamage')).ItemIndex
= 0;
674 gnAllowExit
:= TGUISwitch(GetControl('swEnableExits')).ItemIndex
= 0;
675 gnWeaponStay
:= TGUISwitch(GetControl('swWeaponStay')).ItemIndex
= 0;
676 gnMonsters
:= TGUISwitch(GetControl('swMonsters')).ItemIndex
= 0;
679 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
681 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
683 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
685 Options
:= Options
or GAME_OPTION_MONSTERS
;
686 gnPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
;
688 case TGUISwitch(GetControl('swBotsVS')).ItemIndex
of
690 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
691 gnBotsVS
:= 'Monsters';
694 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
695 gnBotsVS
:= 'Everybody';
698 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
699 gnBotsVS
:= 'Players';
704 NetServerName
:= TGUIEdit(GetControl('edSrvName')).Text;
705 NetMaxClients
:= Max(1, StrToIntDef(TGUIEdit(GetControl('edMaxPlayers')).Text, 1));
706 NetMaxClients
:= Min(NET_MAXCLIENTS
, NetMaxClients
);
707 NetPassword
:= TGUIEdit(GetControl('edSrvPassword')).Text;
708 NetUseMaster
:= TGUISwitch(GetControl('swUseMaster')).ItemIndex
= 0;
711 g_Options_Write_Net_Server(GameDir
+'/'+CONFIG_FILENAME
);
712 g_Options_Write_Gameplay_Net(GameDir
+'/'+CONFIG_FILENAME
);
714 g_Game_StartServer(Map
, GameMode
, gnTimeLimit
, gnGoalLimit
, gnMaxLives
,
715 Options
, gnPlayers
, 0, NetPort
);
718 procedure ProcConnectNetGame();
722 with TGUIMenu(g_ActiveWindow
.GetControl('mNetClientMenu')) do
724 NetClientIP
:= TGUIEdit(GetControl('edIP')).Text;
725 NetClientPort
:= StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
726 PW
:= TGUIEdit(GetControl('edPW')).Text;
729 g_Options_Write_Net_Client(GameDir
+'/'+CONFIG_FILENAME
);
730 g_Game_StartClient(NetClientIP
, NetClientPort
, PW
);
733 procedure ProcEnterPassword();
737 with TGUIMenu(g_ActiveWindow
.GetControl('mClientPasswordMenu')) do
739 NetClientIP
:= PromptIP
;
740 NetClientPort
:= PromptPort
;
741 PW
:= TGUIEdit(GetControl('edPW')).Text;
744 g_Options_Write_Net_Client(GameDir
+'/'+CONFIG_FILENAME
);
745 g_Game_StartClient(NetClientIP
, NetClientPort
, PW
);
748 procedure ProcServerlist();
750 if not NetInitDone
then
752 if (not g_Net_Init()) then
754 g_Console_Add('NET: ERROR: Failed to init ENet!');
761 g_Net_Slist_Set(NetSlistIP
, NetSlistPort
);
763 gState
:= STATE_SLIST
;
764 g_ActiveWindow
:= nil;
766 slWaitStr
:= _lc
[I_NET_SLIST_WAIT
];
771 slReturnPressed
:= True;
772 if g_Net_Slist_Fetch(slCurrent
) then
774 if slCurrent
= nil then
775 slWaitStr
:= _lc
[I_NET_SLIST_NOSERVERS
];
778 slWaitStr
:= _lc
[I_NET_SLIST_ERROR
];
779 g_Serverlist_GenerateTable(slCurrent
, slTable
);
782 procedure ProcStartCampaign();
788 with TGUIMenu(g_ActiveWindow
.GetControl('mCampaignMenu')) do
790 WAD
:= ExtractRelativePath(MapsDir
, TGUIFileListBox(GetControl('lsWAD')).SelectedItem());
791 TwoPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
= 1;
798 g_Game_StartSingle(WAD
+ ':\MAP01', TwoPlayers
, n
);
801 procedure ProcSelectMap(Sender
: TGUIControl
);
805 wad
, map
, res
: String;
807 win
:= g_GUI_GetWindow('SelectMapMenu');
808 with TGUIMenu(win
.GetControl('mSelectMapMenu')) do
810 wad
:= TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem();
811 map
:= TGUIListBox(GetControl('lsMapRes')).SelectedItem();
813 if (wad
= '') or (map
= '') then
814 begin // Ýòî íå êàðòà
815 TGUILabel(GetControl('lbMapName')).Text := '';
816 TGUILabel(GetControl('lbMapAuthor')).Text := '';
817 TGUILabel(GetControl('lbMapSize')).Text := '';
818 TGUIMemo(GetControl('meMapDescription')).SetText('');
819 TGUIMapPreview(win
.GetControl('mpMapPreview')).ClearMap();
820 TGUILabel(win
.GetControl('lbMapScale')).Text := '';
826 a
:= g_Map_GetMapInfo(res
);
828 TGUILabel(GetControl('lbMapName')).Text := a
.Name
;
829 TGUILabel(GetControl('lbMapAuthor')).Text := a
.Author
;
830 TGUILabel(GetControl('lbMapSize')).Text := Format('%dx%d', [a
.Width
, a
.Height
]);
831 TGUIMemo(GetControl('meMapDescription')).SetText(a
.Description
);
832 TGUIMapPreview(win
.GetControl('mpMapPreview')).SetMap(res
);
833 TGUILabel(win
.GetControl('lbMapScale')).Text :=
834 TGUIMapPreview(win
.GetControl('mpMapPreview')).GetScaleStr
;
839 procedure ProcSelectWAD(Sender
: TGUIControl
);
844 with TGUIMenu(g_GUI_GetWindow('SelectMapMenu').GetControl('mSelectMapMenu')) do
846 wad
:= TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem();
848 with TGUIListBox(GetControl('lsMapRes')) do
854 list
:= g_Map_GetMapsList(wad
);
868 procedure ProcSelectCampaignWAD(Sender
: TGUIControl
);
874 win
:= g_GUI_GetWindow('CampaignMenu');
875 with TGUIMenu(win
.GetControl('mCampaignMenu')) do
877 wad
:= TGUIFileListBox(GetControl('lsWAD')).SelectedItem();
881 TGUILabel(GetControl('lbWADName')).Text := '';
882 TGUILabel(GetControl('lbWADAuthor')).Text := '';
883 TGUIMemo(GetControl('meWADDescription')).SetText('');
886 a
:= g_Game_GetMegaWADInfo(wad
);
888 TGUILabel(GetControl('lbWADName')).Text := a
.Name
;
889 TGUILabel(GetControl('lbWADAuthor')).Text := a
.Author
;
890 TGUIMemo(GetControl('meWADDescription')).SetText(a
.Description
);
892 TGUIImage(win
.GetControl('mpWADImage')).ClearImage();
896 fn
:= g_ExtractWadName(a
.pic
);
898 TGUIImage(win
.GetControl('mpWADImage')).SetImage(wad
+a
.pic
)
900 TGUIImage(win
.GetControl('mpWADImage')).SetImage(a
.pic
);
905 procedure ProcChangeColor(Sender
: TGUIControl
);
909 window
:= g_GUI_GetWindow('OptionsPlayersP1Menu');
910 with TGUIMenu(window
.GetControl('mOptionsPlayersP1Menu')) do
911 TGUIModelView(window
.GetControl('mvP1Model')).SetColor(
912 Min(TGUIScroll(GetControl('scP1Red')).Value
*16, 255),
913 Min(TGUIScroll(GetControl('scP1Green')).Value
*16, 255),
914 Min(TGUIScroll(GetControl('scP1Blue')).Value
*16, 255));
916 window
:= g_GUI_GetWindow('OptionsPlayersP2Menu');
917 with TGUIMenu(window
.GetControl('mOptionsPlayersP2Menu')) do
918 TGUIModelView(window
.GetControl('mvP2Model')).SetColor(
919 Min(TGUIScroll(GetControl('scP2Red')).Value
*16, 255),
920 Min(TGUIScroll(GetControl('scP2Green')).Value
*16, 255),
921 Min(TGUIScroll(GetControl('scP2Blue')).Value
*16, 255));
924 procedure ProcSelectModel(Sender
: TGUIControl
);
929 window
:= g_GUI_GetWindow('OptionsPlayersP1Menu');
930 a
:= TGUIListBox(TGUIMenu(window
.GetControl('mOptionsPlayersP1Menu')).GetControl('lsP1Model')).SelectedItem
;
931 if a
<> '' then TGUIModelView(window
.GetControl('mvP1Model')).SetModel(a
);
933 window
:= g_GUI_GetWindow('OptionsPlayersP2Menu');
934 a
:= TGUIListBox(TGUIMenu(window
.GetControl('mOptionsPlayersP2Menu')).GetControl('lsP2Model')).SelectedItem
;
935 if a
<> '' then TGUIModelView(window
.GetControl('mvP2Model')).SetModel(a
);
937 ProcChangeColor(nil);
940 procedure LoadStdFont(cfgres
, texture
: string; var FontID
: DWORD
);
952 wad
:= TWADFile
.Create
;
953 if wad
.ReadFile(GameWAD
) then
954 wad
.GetResource('FONTS/'+cfgres
, cfgdata
, cfglen
);
959 g_Texture_CreateWADEx('FONT_STD', GameWAD
+':FONTS\'+texture
);
961 config
:= TConfig
.CreateMem(cfgdata
, cfglen
);
962 cwdt
:= Min(Max(config
.ReadInt('FontMap', 'CharWidth', 1), 1), 255);
963 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 1), 1), 255);
964 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
966 e_LogWritefln('LoadStdFont cwdt=%s chgt=%s spc=%s', [cwdt
, chgt
, spc
]);
968 if g_Texture_Get('FONT_STD', ID
) then
969 e_TextureFontBuild(ID
, FontID
, cwdt
, chgt
, spc
);
974 if cfglen
<> 0 then FreeMem(cfgdata
);
977 procedure LoadFont(txtres
, fntres
: string; var FontID
: DWORD
);
983 cfgdata
, fntdata
: Pointer;
984 cfglen
, fntlen
: Integer;
992 wad
:= TWADFile
.Create
;
993 if wad
.ReadFile(GameWAD
) then
995 wad
.GetResource('FONTS/'+txtres
, cfgdata
, cfglen
);
996 wad
.GetResource('FONTS/'+fntres
, fntdata
, fntlen
);
1002 config
:= TConfig
.CreateMem(cfgdata
, cfglen
);
1003 cwdt
:= Min(Max(config
.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
1004 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
1006 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
1007 FontID
:= e_CharFont_Create(spc
);
1009 for a
:= 0 to 255 do
1011 chrwidth
:= config
.ReadInt(IntToStr(a
), 'Width', 0);
1012 if chrwidth
= 0 then Continue
;
1014 if e_CreateTextureMemEx(fntdata
, fntlen
, CharID
, cwdt
*(a
mod 16), chgt
*(a
div 16),
1016 e_CharFont_AddChar(FontID
, CharID
, Chr(a
), chrwidth
);
1022 if cfglen
<> 0 then FreeMem(cfgdata
);
1023 if fntlen
<> 0 then FreeMem(fntdata
);
1026 procedure MenuLoadData();
1028 e_WriteLog('Loading menu data...', TMsgType
.Notify
);
1030 g_Texture_CreateWADEx('MAINMENU_MARKER1', GameWAD
+':TEXTURES\MARKER1');
1031 g_Texture_CreateWADEx('MAINMENU_MARKER2', GameWAD
+':TEXTURES\MARKER2');
1032 g_Texture_CreateWADEx('SCROLL_LEFT', GameWAD
+':TEXTURES\SLEFT');
1033 g_Texture_CreateWADEx('SCROLL_RIGHT', GameWAD
+':TEXTURES\SRIGHT');
1034 g_Texture_CreateWADEx('SCROLL_MIDDLE', GameWAD
+':TEXTURES\SMIDDLE');
1035 g_Texture_CreateWADEx('SCROLL_MARKER', GameWAD
+':TEXTURES\SMARKER');
1036 g_Texture_CreateWADEx('EDIT_LEFT', GameWAD
+':TEXTURES\ELEFT');
1037 g_Texture_CreateWADEx('EDIT_RIGHT', GameWAD
+':TEXTURES\ERIGHT');
1038 g_Texture_CreateWADEx('EDIT_MIDDLE', GameWAD
+':TEXTURES\EMIDDLE');
1039 g_Texture_CreateWADEx('BOX1', GameWAD
+':TEXTURES\BOX1');
1040 g_Texture_CreateWADEx('BOX2', GameWAD
+':TEXTURES\BOX2');
1041 g_Texture_CreateWADEx('BOX3', GameWAD
+':TEXTURES\BOX3');
1042 g_Texture_CreateWADEx('BOX4', GameWAD
+':TEXTURES\BOX4');
1043 g_Texture_CreateWADEx('BOX5', GameWAD
+':TEXTURES\BOX5');
1044 g_Texture_CreateWADEx('BOX6', GameWAD
+':TEXTURES\BOX6');
1045 g_Texture_CreateWADEx('BOX7', GameWAD
+':TEXTURES\BOX7');
1046 g_Texture_CreateWADEx('BOX8', GameWAD
+':TEXTURES\BOX8');
1047 g_Texture_CreateWADEx('BOX9', GameWAD
+':TEXTURES\BOX9');
1048 g_Texture_CreateWADEx('BSCROLL_UP_A', GameWAD
+':TEXTURES\SCROLLUPA');
1049 g_Texture_CreateWADEx('BSCROLL_UP_U', GameWAD
+':TEXTURES\SCROLLUPU');
1050 g_Texture_CreateWADEx('BSCROLL_DOWN_A', GameWAD
+':TEXTURES\SCROLLDOWNA');
1051 g_Texture_CreateWADEx('BSCROLL_DOWN_U', GameWAD
+':TEXTURES\SCROLLDOWNU');
1052 g_Texture_CreateWADEx('BSCROLL_MIDDLE', GameWAD
+':TEXTURES\SCROLLMIDDLE');
1053 g_Texture_CreateWADEx('NOPIC', GameWAD
+':TEXTURES\NOPIC');
1055 g_Sound_CreateWADEx('MENU_SELECT', GameWAD
+':SOUNDS\MENUSELECT');
1056 g_Sound_CreateWADEx('MENU_OPEN', GameWAD
+':SOUNDS\MENUOPEN');
1057 g_Sound_CreateWADEx('MENU_CLOSE', GameWAD
+':SOUNDS\MENUCLOSE');
1058 g_Sound_CreateWADEx('MENU_CHANGE', GameWAD
+':SOUNDS\MENUCHANGE');
1059 g_Sound_CreateWADEx('SCROLL_ADD', GameWAD
+':SOUNDS\SCROLLADD');
1060 g_Sound_CreateWADEx('SCROLL_SUB', GameWAD
+':SOUNDS\SCROLLSUB');
1061 g_Sound_CreateWADEx('SOUND_PLAYER_FALL', GameWAD
+':SOUNDS\FALL');
1064 procedure MenuFreeData();
1066 e_CharFont_Remove(gMenuFont
);
1067 e_CharFont_Remove(gMenuSmallFont
);
1069 g_Texture_Delete('MAINMENU_MARKER1');
1070 g_Texture_Delete('MAINMENU_MARKER2');
1071 g_Texture_Delete('SCROLL_LEFT');
1072 g_Texture_Delete('SCROLL_RIGHT');
1073 g_Texture_Delete('SCROLL_MIDDLE');
1074 g_Texture_Delete('SCROLL_MARKER');
1075 g_Texture_Delete('EDIT_LEFT');
1076 g_Texture_Delete('EDIT_RIGHT');
1077 g_Texture_Delete('EDIT_MIDDLE');
1078 g_Texture_Delete('BOX1');
1079 g_Texture_Delete('BOX2');
1080 g_Texture_Delete('BOX3');
1081 g_Texture_Delete('BOX4');
1082 g_Texture_Delete('BOX5');
1083 g_Texture_Delete('BOX6');
1084 g_Texture_Delete('BOX7');
1085 g_Texture_Delete('BOX8');
1086 g_Texture_Delete('BOX9');
1087 g_Texture_Delete('BSCROLL_UP_A');
1088 g_Texture_Delete('BSCROLL_UP_U');
1089 g_Texture_Delete('BSCROLL_DOWN_A');
1090 g_Texture_Delete('BSCROLL_DOWN_U');
1091 g_Texture_Delete('BSCROLL_MIDDLE');
1092 g_Texture_Delete('NOPIC');
1094 g_Sound_Delete('MENU_SELECT');
1095 g_Sound_Delete('MENU_OPEN');
1096 g_Sound_Delete('MENU_CLOSE');
1097 g_Sound_Delete('MENU_CHANGE');
1098 g_Sound_Delete('SCROLL_ADD');
1099 g_Sound_Delete('SCROLL_SUB');
1100 g_Sound_Delete('SOUND_PLAYER_FALL');
1103 procedure ProcAuthorsMenu();
1105 gMusic
.SetByName('MUSIC_INTERMUS');
1109 procedure ProcExitMenuKeyDown (yes
: Boolean);
1112 snd
: TPlayableSound
;
1117 g_Game_StopAllSounds(True);
1118 case (Random(18)) of
1119 0: s
:= 'SOUND_MONSTER_PAIN';
1120 1: s
:= 'SOUND_MONSTER_DIE_3';
1121 2: s
:= 'SOUND_MONSTER_SLOP';
1122 3: s
:= 'SOUND_MONSTER_DEMON_DIE';
1123 4: s
:= 'SOUND_MONSTER_IMP_DIE_2';
1124 5: s
:= 'SOUND_MONSTER_MAN_DIE';
1125 6: s
:= 'SOUND_MONSTER_BSP_DIE';
1126 7: s
:= 'SOUND_MONSTER_VILE_DIE';
1127 8: s
:= 'SOUND_MONSTER_SKEL_DIE';
1128 9: s
:= 'SOUND_MONSTER_MANCUB_ALERT';
1129 10: s
:= 'SOUND_MONSTER_PAIN_PAIN';
1130 11: s
:= 'SOUND_MONSTER_BARON_DIE';
1131 12: s
:= 'SOUND_MONSTER_CACO_DIE';
1132 13: s
:= 'SOUND_MONSTER_CYBER_DIE';
1133 14: s
:= 'SOUND_MONSTER_KNIGHT_ALERT';
1134 15: s
:= 'SOUND_MONSTER_SPIDER_ALERT';
1135 else s
:= 'SOUND_PLAYER_FALL';
1137 snd
:= TPlayableSound
.Create();
1138 res
:= snd
.SetByName(s
);
1139 if not res
then res
:= snd
.SetByName('SOUND_PLAYER_FALL');
1143 while snd
.IsPlaying() do begin end;
1151 procedure ProcLoadMenu();
1158 TGUIEdit(TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a
))).Text := g_GetSaveName(a
, valid
);
1159 TGUIEdit(TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a
))).Invalid
:= not valid
;
1160 //TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a)).Enabled := valid;
1164 procedure ProcSaveMenu();
1172 name
:= g_GetSaveName(a
, valid
);
1173 TGUIEdit(TGUIMenu(g_GUI_GetWindow('SaveMenu').GetControl('mmSaveMenu')).GetControl('edSlot'+IntToStr(a
))).Text := name
;
1174 TGUIEdit(TGUIMenu(g_GUI_GetWindow('SaveMenu').GetControl('mmSaveMenu')).GetControl('edSlot'+IntToStr(a
))).Invalid
:= (name
<> '') and (not valid
);
1178 procedure ProcSaveGame(Sender
: TGUIControl
);
1182 if g_Game_IsNet
then Exit
;
1183 if g_Game_IsTestMap
then Exit
;
1184 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
1185 g_Game_PauseAllSounds(True);
1186 g_SaveGame(a
, TGUIEdit(Sender
).Text);
1188 g_ActiveWindow
:= nil;
1189 g_Game_Pause(False);
1192 procedure ProcLoadGame(Sender
: TGUIControl
);
1196 if g_Game_IsNet
then Exit
;
1197 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
1198 if g_LoadGame(a
) then
1200 g_Game_PauseAllSounds(False)
1202 else // Íå çàãðóçèëîñü - âîçâðàò â ìåíþ
1204 g_Console_Add(_lc
[I_MSG_BAD_SAVE_VERSION
], true);
1205 g_GUI_GetWindow('LoadMenu').SetActive(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu'));
1206 //g_ActiveWindow := nil;
1210 procedure ProcSingle1Player();
1212 g_Game_StartSingle(gDefaultMegawadStart
, False, 1);
1215 procedure ProcSingle2Players();
1217 g_Game_StartSingle(gDefaultMegawadStart
, True, 2);
1220 procedure ProcSelectMapMenu();
1223 wad_lb
: TGUIFileListBox
;
1224 map_lb
: TGUIListBox
;
1227 menu
:= TGUIMenu(g_GUI_GetWindow('SelectMapMenu').GetControl('mSelectMapMenu'));
1228 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsMapWAD'));
1229 map_lb
:= TGUIListBox(menu
.GetControl('lsMapRes'));
1231 if wad_lb
.SelectedItem() <> '' then
1232 map
:= map_lb
.SelectedItem()
1236 wad_lb
.UpdateFileList();
1239 if wad_lb
.SelectedItem() <> '' then
1242 map_lb
.SelectItem(map
);
1244 if map_lb
.SelectedItem() <> '' then
1248 g_GUI_ShowWindow('SelectMapMenu');
1251 procedure ProcSelectCampaignMenu();
1254 wad_lb
: TGUIFileListBox
;
1256 menu
:= TGUIMenu(g_GUI_GetWindow('CampaignMenu').GetControl('mCampaignMenu'));
1257 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsWAD'));
1259 wad_lb
.UpdateFileList();
1261 if wad_lb
.SelectedItem() <> '' then
1262 ProcSelectCampaignWAD(nil);
1265 procedure ProcSetMap();
1267 wad
, map
, res
: String;
1269 with TGUIMenu(g_ActiveWindow
.GetControl('mSelectMapMenu')) do
1271 wad
:= ExtractRelativePath(MapsDir
, TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem());
1272 map
:= TGUIListBox(GetControl('lsMapRes')).SelectedItem();
1275 if (wad
= '') or (map
= '') then
1278 res
:= wad
+':\'+map
;
1280 TGUILabel(TGUIMenu(g_GUI_GetWindow('CustomGameMenu').GetControl('mCustomGameMenu')).GetControl('lbMap')).Text := res
;
1281 TGUILabel(TGUIMenu(g_GUI_GetWindow('NetServerMenu').GetControl('mNetServerMenu')).GetControl('lbMap')).Text := res
;
1284 procedure ProcChangeSoundSettings(Sender
: TGUIControl
);
1288 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
1290 g_Sound_SetupAllVolumes(
1291 Min(TGUIScroll(menu
.GetControl('scSoundLevel')).Value
*16, 255),
1292 Min(TGUIScroll(menu
.GetControl('scMusicLevel')).Value
*16, 255)
1296 procedure ProcChangeGameSettings(Sender
: TGUIControl
);
1300 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
1301 g_dbg_scale
:= TGUIScroll(menu
.GetControl('scScaleFactor')).Value
+ 1;
1304 procedure ProcChangeTouchSettings(Sender
: TGUIControl
);
1308 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsTouchMenu').GetControl('mOptionsControlsTouchMenu'));
1309 g_touch_alt
:= TGUISwitch(menu
.GetControl('swTouchAlt')).ItemIndex
= 1;
1310 g_touch_size
:= TGUIScroll(menu
.GetControl('scTouchSize')).Value
/ 10 + 0.5;
1311 g_touch_offset
:= TGUIScroll(menu
.GetControl('scTouchOffset')).Value
* 5;
1314 procedure ProcOptionsPlayersMIMenu();
1319 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1321 a
:= TGUIListBox(TGUIMenu(g_ActiveWindow
.GetControl('mOptionsPlayers'+s
+'Menu')).GetControl('ls'+s
+'Model')).SelectedItem
;
1323 if a
= '' then Exit
;
1325 b
:= g_PlayerModel_GetInfo(a
);
1327 with TGUIMenu(g_GUI_GetWindow('OptionsPlayersMIMenu').GetControl('mOptionsPlayersMIMenu')) do
1329 TGUILabel(GetControl('lbName')).Text := b
.Name
;
1330 TGUILabel(GetControl('lbAuthor')).Text := b
.Author
;
1331 TGUIMemo(GetControl('meComment')).SetText(b
.Description
);
1333 if b
.HaveWeapon
then
1334 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_YES
]
1336 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_NO
];
1339 g_GUI_ShowWindow('OptionsPlayersMIMenu');
1342 procedure ProcOptionsPlayersAnim();
1346 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1351 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1354 Model
.GetCurrentAnimation
.Loop
:= True;
1355 Model
.GetCurrentAnimationMask
.Loop
:= True;
1359 procedure ProcOptionsPlayersWeap();
1363 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1368 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1372 procedure ProcOptionsPlayersRot();
1376 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1377 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')).Model
do
1379 if Direction
= TDirection
.D_LEFT
then Direction
:= TDirection
.D_RIGHT
else Direction
:= TDirection
.D_LEFT
;
1383 procedure ProcDefaultMenuKeyDown (yes
: Boolean);
1387 g_Options_SetDefault();
1393 procedure ProcSavedMenuKeyDown (yes
: Boolean);
1395 if yes
then ReadOptions();
1399 procedure ProcAuthorsClose();
1401 gMusic
.SetByName('MUSIC_MENU');
1403 gState
:= STATE_MENU
;
1406 procedure ProcGMClose();
1408 g_Game_InGameMenu(False);
1411 procedure ProcGMShow();
1416 if (gGameSettings
.GameType
= GT_SINGLE
) and
1417 ((gPlayer1
= nil) or (not gPlayer1
.alive
)) and
1418 ((gPlayer2
= nil) or (not gPlayer2
.alive
)) then
1419 Enabled
:= False; // Îäèí èç èãðîêîâ ïîãèá â ñèíãëå
1421 Enabled
:= False; // Çàïðåòèòü ñîõðàíåíèå â èíòåðìèññèè (íå ðåàëèçîâàíî)
1422 if g_Game_IsTestMap
then
1423 Enabled
:= False; // Åñëè èãðàåì íà òåñòîâîé èëè âðåìåííîé êàðòå
1424 TGUIMainMenu(g_ActiveWindow
.GetControl(
1425 g_ActiveWindow
.DefControl
)).EnableButton('save', Enabled
);
1428 procedure ProcChangePlayers();
1430 TeamGame
, Spectator
, AddTwo
: Boolean;
1431 P1Team
{, P2Team}: Byte;
1432 bP2
: TGUITextButton
;
1434 TeamGame
:= gGameSettings
.GameMode
in [GM_TDM
, GM_CTF
];
1435 Spectator
:= (gPlayer1
= nil) and (gPlayer2
= nil);
1436 AddTwo
:= gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
];
1437 P1Team
:= TEAM_NONE
;
1438 if gPlayer1
<> nil then P1Team
:= gPlayer1
.Team
;
1440 //P2Team := TEAM_NONE;
1441 //if gPlayer2 <> nil then P2Team := gPlayer2.Team;
1443 TGUIMainMenu(g_ActiveWindow
.GetControl(
1444 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinRed', TeamGame
and (P1Team
<> TEAM_RED
));
1445 TGUIMainMenu(g_ActiveWindow
.GetControl(
1446 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinBlue', TeamGame
and (P1Team
<> TEAM_BLUE
));
1447 TGUIMainMenu(g_ActiveWindow
.GetControl(
1448 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinGame', Spectator
and not TeamGame
);
1450 bP2
:= TGUIMainMenu(g_ActiveWindow
.GetControl(
1451 g_ActiveWindow
.DefControl
)).GetButton('tmPlayer2');
1452 bP2
.Enabled
:= AddTwo
and not Spectator
;
1454 bP2
.Color
:= MAINMENU_ITEMS_COLOR
1456 bP2
.Color
:= MAINMENU_UNACTIVEITEMS_COLOR
;
1457 if gPlayer2
= nil then
1458 bP2
.Caption
:= _lc
[I_MENU_ADD_PLAYER_2
]
1460 bP2
.Caption
:= _lc
[I_MENU_REM_PLAYER_2
];
1462 TGUIMainMenu(g_ActiveWindow
.GetControl(
1463 g_ActiveWindow
.DefControl
)).EnableButton('tmSpectate', not Spectator
);
1466 procedure ProcJoinRed();
1468 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1470 if g_Game_IsServer
then
1472 if gPlayer1
= nil then
1473 g_Game_AddPlayer(TEAM_RED
)
1476 if gPlayer1
.Team
<> TEAM_RED
then
1478 gPlayer1
.SwitchTeam
;
1479 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1482 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1487 gPlayer1Settings
.Team
:= TEAM_RED
;
1488 MC_SEND_PlayerSettings
;
1489 if gPlayer1
= nil then
1490 g_Game_AddPlayer(TEAM_RED
);
1492 g_ActiveWindow
:= nil;
1493 g_Game_Pause(False);
1496 procedure ProcJoinBlue();
1498 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1500 if g_Game_IsServer
then
1502 if gPlayer1
= nil then
1503 g_Game_AddPlayer(TEAM_BLUE
)
1506 if gPlayer1
.Team
<> TEAM_BLUE
then
1508 gPlayer1
.SwitchTeam
;
1509 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1512 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1517 gPlayer1Settings
.Team
:= TEAM_BLUE
;
1518 MC_SEND_PlayerSettings
;
1519 if gPlayer1
= nil then
1520 g_Game_AddPlayer(TEAM_BLUE
);
1522 g_ActiveWindow
:= nil;
1523 g_Game_Pause(False);
1526 procedure ProcJoinGame();
1528 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1530 if gPlayer1
= nil then
1532 g_ActiveWindow
:= nil;
1533 g_Game_Pause(False);
1536 procedure ProcSwitchP2();
1538 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
]) then
1540 if gPlayer1
= nil then
1542 if gPlayer2
= nil then
1545 g_Game_RemovePlayer();
1546 g_ActiveWindow
:= nil;
1547 g_Game_Pause(False);
1550 procedure ProcSpectate();
1552 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1555 g_ActiveWindow
:= nil;
1556 g_Game_Pause(False);
1559 procedure ProcRestartMenuKeyDown (yes
: Boolean);
1561 if yes
then g_Game_Restart() else g_GUI_HideWindow
;
1564 procedure ProcEndMenuKeyDown (yes
: Boolean);
1566 if yes
then gExit
:= EXIT_SIMPLE
else g_GUI_HideWindow
;
1569 procedure ProcSetRussianLanguage();
1571 if gLanguage
<> LANGUAGE_RUSSIAN
then
1573 gLanguage
:= LANGUAGE_RUSSIAN
;
1574 gLanguageChange
:= True;
1575 gAskLanguage
:= False;
1577 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1579 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1584 procedure ProcSetEnglishLanguage();
1586 if gLanguage
<> LANGUAGE_ENGLISH
then
1588 gLanguage
:= LANGUAGE_ENGLISH
;
1589 gLanguageChange
:= True;
1590 gAskLanguage
:= False;
1592 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1594 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1599 procedure ReadGameSettings();
1603 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1605 with gGameSettings
do
1607 with TGUISwitch(menu
.GetControl('swTeamDamage')) do
1608 if LongBool(Options
and GAME_OPTION_TEAMDAMAGE
) then
1613 TGUIEdit(menu
.GetControl('edTimeLimit')).Text := IntToStr(TimeLimit
);
1614 TGUIEdit(menu
.GetControl('edGoalLimit')).Text := IntToStr(GoalLimit
);
1615 TGUIEdit(menu
.GetControl('edMaxLives')).Text := IntToStr(MaxLives
);
1617 with TGUISwitch(menu
.GetControl('swBotsVS')) do
1618 if LongBool(Options
and GAME_OPTION_BOTVSPLAYER
) and
1619 LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1622 if LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1627 if GameType
in [GT_CUSTOM
, GT_SERVER
] then
1629 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1630 TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
:= True;
1631 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1632 TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
:= True;
1633 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1634 TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
:= True;
1635 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_ITEMSTEXT_COLOR
;
1636 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1640 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1641 with TGUIEdit(menu
.GetControl('edTimeLimit')) do
1646 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1647 with TGUIEdit(menu
.GetControl('edGoalLimit')) do
1652 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1653 with TGUIEdit(menu
.GetControl('edMaxLives')) do
1658 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1659 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1664 procedure ProcApplyGameSet();
1668 stat
: TPlayerStatArray
;
1670 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1672 if not g_Game_IsServer
then Exit
;
1674 with gGameSettings
do
1676 if TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
then
1678 if TGUISwitch(menu
.GetControl('swTeamDamage')).ItemIndex
= 0 then
1679 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
1681 Options
:= Options
and (not GAME_OPTION_TEAMDAMAGE
);
1684 if TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
then
1686 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edTimeLimit')).Text, TimeLimit
);
1692 b
:= (gTime
- gGameStartTime
) div 1000 + 10; // 10 ñåêóíä íà ñìåíó
1694 TimeLimit
:= Max(n
, b
);
1698 if TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
then
1700 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edGoalLimit')).Text, GoalLimit
);
1707 if GameMode
= GM_DM
then
1709 stat
:= g_Player_GetStats();
1711 for a
:= 0 to High(stat
) do
1712 if stat
[a
].Frags
> b
then
1716 b
:= Max(gTeamStat
[TEAM_RED
].Goals
, gTeamStat
[TEAM_BLUE
].Goals
);
1718 GoalLimit
:= Max(n
, b
);
1722 if TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
then
1724 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edMaxLives')).Text, GoalLimit
);
1725 if n
< 0 then n
:= 0;
1726 if n
> 255 then n
:= 255;
1732 stat
:= g_Player_GetStats();
1734 for a
:= 0 to High(stat
) do
1735 if stat
[a
].Lives
> b
then
1738 MaxLives
:= Max(n
, b
);
1742 if TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
then
1744 case TGUISwitch(menu
.GetControl('swBotsVS')).ItemIndex
of
1747 Options
:= Options
and (not GAME_OPTION_BOTVSPLAYER
);
1748 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1752 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1753 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1757 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1758 Options
:= Options
and (not GAME_OPTION_BOTVSMONSTER
);
1764 if g_Game_IsNet
then MH_SEND_GameSettings
;
1767 procedure ProcVideoOptionsRes();
1773 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1775 TGUILabel(menu
.GetControl('lbCurrentRes')).Text :=
1776 IntToStr(gScreenWidth
) +
1777 ' x ' + IntToStr(gScreenHeight
) +
1778 ', ' + IntToStr(gBPP
) + ' bpp';
1780 with TGUIListBox(menu
.GetControl('lsResolution')) do
1782 list
:= GetDisplayModes(gBPP
, SR
);
1793 with TGUISwitch(menu
.GetControl('swFullScreen')) do
1800 procedure ProcApplyVideoOptions();
1803 Fullscreen
: Boolean;
1804 SWidth
, SHeight
: Integer;
1807 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1809 str
:= TGUIListBox(menu
.GetControl('lsResolution')).SelectedItem
;
1810 SScanf(str
, '%dx%d', [@SWidth
, @SHeight
]);
1812 Fullscreen
:= TGUISwitch(menu
.GetControl('swFullScreen')).ItemIndex
= 0;
1814 if (SWidth
<> gScreenWidth
) or
1815 (SHeight
<> gScreenHeight
) or
1816 (Fullscreen
<> gFullscreen
) then
1818 gResolutionChange
:= True;
1819 gRC_Width
:= SWidth
;
1820 gRC_Height
:= SHeight
;
1821 gRC_FullScreen
:= Fullscreen
;
1822 gRC_Maximized
:= gWinMaximized
;
1825 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1829 procedure ProcSetFirstRussianLanguage();
1831 gLanguage
:= LANGUAGE_RUSSIAN
;
1832 gLanguageChange
:= True;
1833 gAskLanguage
:= False;
1835 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1838 procedure ProcSetFirstEnglishLanguage();
1840 gLanguage
:= LANGUAGE_ENGLISH
;
1841 gLanguageChange
:= True;
1842 gAskLanguage
:= False;
1844 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1847 procedure ProcRecallAddress();
1849 with TGUIMenu(g_GUI_GetWindow('NetClientMenu').GetControl('mNetClientMenu')) do
1851 TGUIEdit(GetControl('edIP')).Text := NetClientIP
;
1852 TGUIEdit(GetControl('edPort')).Text := IntToStr(NetClientPort
);
1856 procedure CreateFirstLanguageMenu();
1860 Menu
:= TGUIWindow
.Create('FirstLanguageMenu');
1862 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, ' '))) do
1864 Name
:= 'mmFirstLanguageMenu';
1865 AddButton(@ProcSetFirstRussianLanguage
, 'Ðóññêèé', '');
1866 AddButton(@ProcSetFirstEnglishLanguage
, 'English', '');
1869 Menu
.DefControl
:= 'mmFirstLanguageMenu';
1870 Menu
.MainWindow
:= True;
1871 g_GUI_AddWindow(Menu
);
1874 procedure g_Menu_AskLanguage();
1876 CreateFirstLanguageMenu();
1877 g_GUI_ShowWindow('FirstLanguageMenu');
1880 procedure CreatePlayerOptionsMenu(s
: String);
1885 Menu
:= TGUIWindow
.Create('OptionsPlayers'+s
+'Menu');
1887 a
:= _lc
[I_MENU_PLAYER_1
]
1889 a
:= _lc
[I_MENU_PLAYER_2
];
1890 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, a
))) do
1892 Name
:= 'mOptionsPlayers'+s
+'Menu';
1893 with AddEdit(_lc
[I_MENU_PLAYER_NAME
]) do
1895 Name
:= 'ed'+s
+'Name';
1899 with AddSwitch(_lc
[I_MENU_PLAYER_TEAM
]) do
1901 Name
:= 'sw'+s
+'Team';
1902 AddItem(_lc
[I_MENU_PLAYER_TEAM_RED
]);
1903 AddItem(_lc
[I_MENU_PLAYER_TEAM_BLUE
]);
1905 with AddList(_lc
[I_MENU_PLAYER_MODEL
], 12, 6) do
1907 Name
:= 'ls'+s
+'Model';
1909 Items
:= g_PlayerModel_GetNames();
1910 OnChange
:= ProcSelectModel
;
1912 with AddScroll(_lc
[I_MENU_PLAYER_RED
]) do
1914 Name
:= 'sc'+s
+'Red';
1916 OnChange
:= ProcChangeColor
;
1918 with AddScroll(_lc
[I_MENU_PLAYER_GREEN
]) do
1920 Name
:= 'sc'+s
+'Green';
1922 OnChange
:= ProcChangeColor
;
1924 with AddScroll(_lc
[I_MENU_PLAYER_BLUE
]) do
1926 Name
:= 'sc'+s
+'Blue';
1928 OnChange
:= ProcChangeColor
;
1931 AddButton(@ProcOptionsPlayersMIMenu
, _lc
[I_MENU_MODEL_INFO
]);
1932 AddButton(@ProcOptionsPlayersAnim
, _lc
[I_MENU_MODEL_ANIMATION
]);
1933 AddButton(@ProcOptionsPlayersWeap
, _lc
[I_MENU_MODEL_CHANGE_WEAPON
]);
1934 AddButton(@ProcOptionsPlayersRot
, _lc
[I_MENU_MODEL_ROTATE
]);
1936 with TGUIModelView(Menu
.AddChild(TGUIModelView
.Create
)) do
1938 Name
:= 'mv'+s
+'Model';
1939 X
:= GetControl('ls'+s
+'Model').X
+TGUIListBox(GetControl('ls'+s
+'Model')).GetWidth
+16;
1940 Y
:= GetControl('ls'+s
+'Model').Y
;
1943 Menu
.DefControl
:= 'mOptionsPlayers'+s
+'Menu';
1944 g_GUI_AddWindow(Menu
);
1947 procedure CreateAllMenus();
1951 a
, cx
, _y
, i
: Integer;
1954 Menu
:= TGUIWindow
.Create('MainMenu');
1955 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
1957 Name
:= 'mmMainMenu';
1958 AddButton(nil, _lc
[I_MENU_NEW_GAME
], 'NewGameMenu');
1959 AddButton(nil, _lc
[I_MENU_MULTIPLAYER
], 'NetGameMenu');
1960 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
1961 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
1962 AddButton(@ProcAuthorsMenu
, _lc
[I_MENU_AUTHORS
], 'AuthorsMenu');
1963 AddButton(nil, _lc
[I_MENU_EXIT
], 'ExitMenu');
1965 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(Format(_lc
[I_VERSION
], [GAME_VERSION
]), gMenuSmallFont
))) do
1967 Color
:= _RGB(255, 255, 255);
1968 X
:= gScreenWidth
-GetWidth
-8;
1969 Y
:= gScreenHeight
-GetHeight
-8;
1971 Menu
.DefControl
:= 'mmMainMenu';
1972 Menu
.MainWindow
:= True;
1973 g_GUI_AddWindow(Menu
);
1975 Menu
:= TGUIWindow
.Create('NewGameMenu');
1976 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_NEW_GAME
]))) do
1978 Name
:= 'mmNewGameMenu';
1979 AddButton(@ProcSingle1Player
, _lc
[I_MENU_1_PLAYER
]);
1980 AddButton(@ProcSingle2Players
, _lc
[I_MENU_2_PLAYERS
]);
1981 AddButton(nil, _lc
[I_MENU_CUSTOM_GAME
], 'CustomGameMenu');
1982 AddButton(@ProcSelectCampaignMenu
, _lc
[I_MENU_CAMPAIGN
], 'CampaignMenu');
1984 Menu
.DefControl
:= 'mmNewGameMenu';
1985 g_GUI_AddWindow(Menu
);
1987 Menu
:= TGUIWindow
.Create('NetGameMenu');
1988 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MULTIPLAYER
]))) do
1990 Name
:= 'mmNetGameMenu';
1991 AddButton(@ProcRecallAddress
, _lc
[I_MENU_START_CLIENT
], 'NetClientMenu');
1992 AddButton(nil, _lc
[I_MENU_START_SERVER
], 'NetServerMenu');
1994 Menu
.DefControl
:= 'mmNetGameMenu';
1995 g_GUI_AddWindow(Menu
);
1997 Menu
:= TGUIWindow
.Create('NetServerMenu');
1998 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_START_SERVER
]))) do
2000 Name
:= 'mNetServerMenu';
2001 with AddEdit(_lc
[I_NET_SERVER_NAME
]) do
2003 Name
:= 'edSrvName';
2004 OnlyDigits
:= False;
2007 Text := NetServerName
;
2009 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
2011 Name
:= 'edSrvPassword';
2012 OnlyDigits
:= False;
2015 Text := NetPassword
;
2017 with AddEdit(_lc
[I_NET_PORT
]) do
2023 Text := IntToStr(NetPort
);
2025 with AddEdit(_lc
[I_NET_MAX_CLIENTS
]) do
2027 Name
:= 'edMaxPlayers';
2031 Text := IntToStr(NetMaxClients
);
2033 with AddSwitch(_lc
[I_NET_USE_MASTER
]) do
2035 Name
:= 'swUseMaster';
2036 AddItem(_lc
[I_MENU_YES
]);
2037 AddItem(_lc
[I_MENU_NO
]);
2038 if NetUseMaster
then
2044 with AddLabel(_lc
[I_MENU_MAP
]) do
2049 OnClick
:= @ProcSelectMapMenu
;
2051 with AddSwitch(_lc
[I_MENU_GAME_TYPE
]) do
2053 Name
:= 'swGameMode';
2054 AddItem(_lc
[I_MENU_GAME_TYPE_DM
]);
2055 AddItem(_lc
[I_MENU_GAME_TYPE_TDM
]);
2056 AddItem(_lc
[I_MENU_GAME_TYPE_CTF
]);
2057 AddItem(_lc
[I_MENU_GAME_TYPE_COOP
]);
2058 case g_Game_TextToMode(gnGameMode
) of
2060 GM_DM
: ItemIndex
:= 0;
2061 GM_TDM
: ItemIndex
:= 1;
2062 GM_CTF
: ItemIndex
:= 2;
2064 GM_COOP
: ItemIndex
:= 3;
2066 OnChange
:= ProcSwitchMonstersNet
;
2068 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
2070 Name
:= 'edTimeLimit';
2074 if gnTimeLimit
> 0 then
2075 Text := IntToStr(gnTimeLimit
);
2077 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
2079 Name
:= 'edGoalLimit';
2083 if gnGoalLimit
> 0 then
2084 Text := IntToStr(gnGoalLimit
);
2086 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
2088 Name
:= 'edMaxLives';
2092 if gnMaxLives
> 0 then
2093 Text := IntToStr(gnMaxLives
);
2095 with AddSwitch(_lc
[I_MENU_SERVER_PLAYERS
]) do
2097 Name
:= 'swPlayers';
2098 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2099 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2100 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2101 ItemIndex
:= gnPlayers
;
2103 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
2105 Name
:= 'swTeamDamage';
2106 AddItem(_lc
[I_MENU_YES
]);
2107 AddItem(_lc
[I_MENU_NO
]);
2108 if gnTeamDamage
then
2113 with AddSwitch(_lc
[I_MENU_ENABLE_EXITS
]) do
2115 Name
:= 'swEnableExits';
2116 AddItem(_lc
[I_MENU_YES
]);
2117 AddItem(_lc
[I_MENU_NO
]);
2123 with AddSwitch(_lc
[I_MENU_WEAPONS_STAY
]) do
2125 Name
:= 'swWeaponStay';
2126 AddItem(_lc
[I_MENU_YES
]);
2127 AddItem(_lc
[I_MENU_NO
]);
2128 if gnWeaponStay
then
2133 with AddSwitch(_lc
[I_MENU_ENABLE_MONSTERS
]) do
2135 Name
:= 'swMonsters';
2136 AddItem(_lc
[I_MENU_YES
]);
2137 AddItem(_lc
[I_MENU_NO
]);
2143 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
2146 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
2147 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
2148 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
2150 if gnBotsVS
= 'Players' then
2152 if gnBotsVS
= 'Monsters' then
2156 AddButton(@ProcStartNetGame
, _lc
[I_MENU_START_GAME
]);
2160 Menu
.DefControl
:= 'mNetServerMenu';
2161 g_GUI_AddWindow(Menu
);
2163 Menu
:= TGUIWindow
.Create('NetClientMenu');
2164 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_START_CLIENT
]))) do
2166 Name
:= 'mNetClientMenu';
2168 AddButton(@ProcServerlist
, _lc
[I_NET_SLIST
]);
2171 with AddEdit(_lc
[I_NET_ADDRESS
]) do
2177 Text := 'localhost';
2179 with AddEdit(_lc
[I_NET_PORT
]) do
2187 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
2190 OnlyDigits
:= False;
2197 AddButton(@ProcConnectNetGame
, _lc
[I_MENU_CLIENT_CONNECT
]);
2201 Menu
.DefControl
:= 'mNetClientMenu';
2202 g_GUI_AddWindow(Menu
);
2204 Menu
:= TGUIWindow
.Create('LoadMenu');
2205 Menu
.OnShow
:= ProcLoadMenu
;
2206 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_LOAD_GAME
]))) do
2208 Name
:= 'mmLoadMenu';
2213 Name
:= 'edSlot'+IntToStr(a
);
2216 OnEnter
:= ProcLoadGame
;
2219 Menu
.DefControl
:= 'mmLoadMenu';
2220 g_GUI_AddWindow(Menu
);
2222 Menu
:= TGUIWindow
.Create('SaveMenu');
2223 Menu
.OnShow
:= ProcSaveMenu
;
2224 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SAVE_GAME
]))) do
2226 Name
:= 'mmSaveMenu';
2231 Name
:= 'edSlot'+IntToStr(a
);
2234 OnChange
:= ProcSaveGame
;
2237 Menu
.DefControl
:= 'mmSaveMenu';
2238 g_GUI_AddWindow(Menu
);
2240 Menu
:= TGUIWindow
.Create('CustomGameMenu');
2241 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CUSTOM_GAME
]))) do
2243 Name
:= 'mCustomGameMenu';
2244 with AddLabel(_lc
[I_MENU_MAP
]) do
2249 OnClick
:= @ProcSelectMapMenu
;
2251 with AddSwitch(_lc
[I_MENU_GAME_TYPE
]) do
2253 Name
:= 'swGameMode';
2254 AddItem(_lc
[I_MENU_GAME_TYPE_DM
]);
2255 AddItem(_lc
[I_MENU_GAME_TYPE_TDM
]);
2256 AddItem(_lc
[I_MENU_GAME_TYPE_CTF
]);
2257 AddItem(_lc
[I_MENU_GAME_TYPE_COOP
]);
2258 case g_Game_TextToMode(gcGameMode
) of
2260 GM_DM
: ItemIndex
:= 0;
2261 GM_TDM
: ItemIndex
:= 1;
2262 GM_CTF
: ItemIndex
:= 2;
2264 GM_COOP
: ItemIndex
:= 3;
2266 OnChange
:= ProcSwitchMonstersCustom
;
2268 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
2270 Name
:= 'edTimeLimit';
2274 if gcTimeLimit
> 0 then
2275 Text := IntToStr(gcTimeLimit
);
2277 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
2279 Name
:= 'edGoalLimit';
2283 if gcGoalLimit
> 0 then
2284 Text := IntToStr(gcGoalLimit
);
2286 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
2288 Name
:= 'edMaxLives';
2292 if gcMaxLives
> 0 then
2293 Text := IntToStr(gcMaxLives
);
2295 with AddSwitch(_lc
[I_MENU_PLAYERS
]) do
2297 Name
:= 'swPlayers';
2298 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2299 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2300 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2301 ItemIndex
:= gcPlayers
;
2303 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
2305 Name
:= 'swTeamDamage';
2306 AddItem(_lc
[I_MENU_YES
]);
2307 AddItem(_lc
[I_MENU_NO
]);
2308 if gcTeamDamage
then
2313 with AddSwitch(_lc
[I_MENU_ENABLE_EXITS
]) do
2315 Name
:= 'swEnableExits';
2316 AddItem(_lc
[I_MENU_YES
]);
2317 AddItem(_lc
[I_MENU_NO
]);
2323 with AddSwitch(_lc
[I_MENU_WEAPONS_STAY
]) do
2325 Name
:= 'swWeaponStay';
2326 AddItem(_lc
[I_MENU_YES
]);
2327 AddItem(_lc
[I_MENU_NO
]);
2328 if gcWeaponStay
then
2333 with AddSwitch(_lc
[I_MENU_ENABLE_MONSTERS
]) do
2335 Name
:= 'swMonsters';
2336 AddItem(_lc
[I_MENU_YES
]);
2337 AddItem(_lc
[I_MENU_NO
]);
2343 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
2346 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
2347 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
2348 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
2350 if gcBotsVS
= 'Players' then
2352 if gcBotsVS
= 'Monsters' then
2356 AddButton(@ProcStartCustomGame
, _lc
[I_MENU_START_GAME
]);
2360 Menu
.DefControl
:= 'mCustomGameMenu';
2361 g_GUI_AddWindow(Menu
);
2363 Menu
:= TGUIWindow
.Create('CampaignMenu');
2364 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CAMPAIGN
]))) do
2366 Name
:= 'mCampaignMenu';
2375 with AddFileList('', 15, 4) do
2378 OnChange
:= ProcSelectCampaignWAD
;
2382 FileMask
:= '*.wad|*.pk3|*.zip|*.dfz';
2383 SetBase(MapsDir
+'megawads/');
2386 with AddLabel(_lc
[I_MENU_MAP_NAME
]) do
2388 Name
:= 'lbWADName';
2392 with AddLabel(_lc
[I_MENU_MAP_AUTHOR
]) do
2394 Name
:= 'lbWADAuthor';
2398 AddLine(_lc
[I_MENU_MAP_DESCRIPTION
]);
2399 with AddMemo('', 15, 3) do
2401 Name
:= 'meWADDescription';
2402 Color
:= MENU_ITEMSCTRL_COLOR
;
2404 with AddSwitch(_lc
[I_MENU_PLAYERS
]) do
2406 Name
:= 'swPlayers';
2407 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2408 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2411 AddButton(@ProcStartCampaign
, _lc
[I_MENU_START_GAME
]);
2415 with TGUIImage(Menu
.AddChild(TGUIImage
.Create
)) do
2417 Name
:= 'mpWADImage';
2418 DefaultRes
:= 'NOPIC';
2419 X
:= GetControl('lsWAD').X
+4;
2420 Y
:= GetControl('lsWAD').Y
-128-MENU_VSPACE
;
2423 Menu
.DefControl
:= 'mCampaignMenu';
2424 g_GUI_AddWindow(Menu
);
2426 Menu
:= TGUIWindow
.Create('SelectMapMenu');
2427 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SELECT_MAP
]))) do
2429 Name
:= 'mSelectMapMenu';
2430 with AddFileList(_lc
[I_MENU_MAP_WAD
], 12, 4) do
2433 OnChange
:= ProcSelectWAD
;
2437 FileMask
:= '*.wad|*.pk3|*.zip|*.dfz';
2440 with AddList(_lc
[I_MENU_MAP_RESOURCE
], 12, 4) do
2444 OnChange
:= ProcSelectMap
;
2447 with AddLabel(_lc
[I_MENU_MAP_NAME
]) do
2449 Name
:= 'lbMapName';
2453 with AddLabel(_lc
[I_MENU_MAP_AUTHOR
]) do
2455 Name
:= 'lbMapAuthor';
2459 with AddLabel(_lc
[I_MENU_MAP_SIZE
]) do
2461 Name
:= 'lbMapSize';
2465 with AddMemo(_lc
[I_MENU_MAP_DESCRIPTION
], 12, 4) do
2467 Name
:= 'meMapDescription';
2472 with TGUIMapPreview(Menu
.AddChild(TGUIMapPreview
.Create
)) do
2474 Name
:= 'mpMapPreview';
2475 X
:= GetControl('lsMapWAD').X
+TGUIListBox(GetControl('lsMapWAD')).GetWidth()+2;
2476 Y
:= GetControl('lsMapWAD').Y
;
2478 with TGUILabel(Menu
.AddChild(TGUILabel
.Create('', gMenuSmallFont
))) do
2480 Name
:= 'lbMapScale';
2483 Color
:= MENU_ITEMSCTRL_COLOR
;
2484 X
:= GetControl('lsMapWAD').X
+
2485 TGUIListBox(GetControl('lsMapWAD')).GetWidth() +
2486 2 + MAPPREVIEW_WIDTH
*4;
2487 Y
:= GetControl('lsMapWAD').Y
+ MAPPREVIEW_HEIGHT
*16 + 16;
2490 Menu
.OnClose
:= ProcSetMap
;
2491 Menu
.DefControl
:= 'mSelectMapMenu';
2492 g_GUI_AddWindow(Menu
);
2494 Menu
:= TGUIWindow
.Create('OptionsMenu');
2495 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_OPTIONS
]))) do
2497 Name
:= 'mmOptionsMenu';
2498 AddButton(nil, _lc
[I_MENU_VIDEO_OPTIONS
], 'OptionsVideoMenu');
2499 AddButton(nil, _lc
[I_MENU_SOUND_OPTIONS
], 'OptionsSoundMenu');
2500 AddButton(nil, _lc
[I_MENU_GAME_OPTIONS
], 'OptionsGameMenu');
2501 AddButton(nil, _lc
[I_MENU_CONTROLS_OPTIONS
], 'OptionsControlsMenu');
2502 AddButton(nil, _lc
[I_MENU_PLAYER_OPTIONS
], 'OptionsPlayersMenu');
2503 AddButton(nil, _lc
[I_MENU_LANGUAGE_OPTIONS
], 'OptionsLanguageMenu');
2505 AddButton(nil, _lc
[I_MENU_SAVED_OPTIONS
], 'SavedOptionsMenu').Color
:= _RGB(255, 0, 0);
2506 AddButton(nil, _lc
[I_MENU_DEFAULT_OPTIONS
], 'DefaultOptionsMenu').Color
:= _RGB(255, 0, 0);
2508 Menu
.OnClose
:= ProcApplyOptions
;
2509 Menu
.DefControl
:= 'mmOptionsMenu';
2510 g_GUI_AddWindow(Menu
);
2512 Menu
:= CreateYNMenu('SavedOptionsMenu', _lc
[I_MENU_LOAD_SAVED_PROMT
], Round(gScreenWidth
*0.6),
2513 gMenuSmallFont
, @ProcSavedMenuKeyDown
);
2514 g_GUI_AddWindow(Menu
);
2516 Menu
:= TGUIWindow
.Create('OptionsVideoMenu');
2517 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_VIDEO_OPTIONS
]))) do
2519 Name
:= 'mOptionsVideoMenu';
2520 AddButton(@ProcVideoOptionsRes
, _lc
[I_MENU_VIDEO_RESOLUTION
], 'OptionsVideoResMenu');
2521 with AddSwitch(_lc
[I_MENU_VIDEO_BPP
]) do
2530 with AddSwitch(_lc
[I_MENU_VIDEO_VSYNC
]) do
2533 AddItem(_lc
[I_MENU_YES
]);
2534 AddItem(_lc
[I_MENU_NO
]);
2536 with AddSwitch(_lc
[I_MENU_VIDEO_FILTER_SKY
]) do
2538 Name
:= 'swTextureFilter';
2539 AddItem(_lc
[I_MENU_YES
]);
2540 AddItem(_lc
[I_MENU_NO
]);
2542 with AddSwitch(_lc
[I_MENU_VIDEO_LEGACY_COMPATIBLE
]) do
2544 Name
:= 'swLegacyNPOT';
2545 AddItem(_lc
[I_MENU_NO
]);
2546 AddItem(_lc
[I_MENU_YES
]);
2549 AddText(_lc
[I_MENU_VIDEO_NEED_RESTART
], Round(gScreenWidth
*0.6));
2552 Menu
.DefControl
:= 'mOptionsVideoMenu';
2553 g_GUI_AddWindow(Menu
);
2555 Menu
:= TGUIWindow
.Create('OptionsVideoResMenu');
2556 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_RESOLUTION_SELECT
]))) do
2558 Name
:= 'mOptionsVideoResMenu';
2559 with AddLabel(_lc
[I_MENU_RESOLUTION_CURRENT
]) do
2561 Name
:= 'lbCurrentRes';
2565 with AddList(_lc
[I_MENU_RESOLUTION_LIST
], 12, 6) do
2567 Name
:= 'lsResolution';
2570 with AddSwitch(_lc
[I_MENU_RESOLUTION_FULLSCREEN
]) do
2572 Name
:= 'swFullScreen';
2573 AddItem(_lc
[I_MENU_YES
]);
2574 AddItem(_lc
[I_MENU_NO
]);
2577 AddButton(@ProcApplyVideoOptions
, _lc
[I_MENU_RESOLUTION_APPLY
]);
2580 Menu
.DefControl
:= 'mOptionsVideoResMenu';
2581 g_GUI_AddWindow(Menu
);
2583 Menu
:= TGUIWindow
.Create('OptionsSoundMenu');
2584 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SOUND_OPTIONS
]))) do
2586 Name
:= 'mOptionsSoundMenu';
2587 with AddScroll(_lc
[I_MENU_SOUND_MUSIC_LEVEL
]) do
2589 Name
:= 'scMusicLevel';
2591 OnChange
:= ProcChangeSoundSettings
;
2593 with AddScroll(_lc
[I_MENU_SOUND_SOUND_LEVEL
]) do
2595 Name
:= 'scSoundLevel';
2597 OnChange
:= ProcChangeSoundSettings
;
2599 with AddScroll(_lc
[I_MENU_SOUND_MAX_SIM_SOUNDS
]) do
2601 Name
:= 'scMaxSimSounds';
2604 with AddSwitch (_lc
[I_MENU_SOUND_ANNOUNCE
]) do
2606 Name
:= 'swAnnouncer';
2607 AddItem(_lc
[I_MENU_ANNOUNCE_NONE
]);
2608 AddItem(_lc
[I_MENU_ANNOUNCE_ME
]);
2609 AddItem(_lc
[I_MENU_ANNOUNCE_MEPLUS
]);
2610 AddItem(_lc
[I_MENU_ANNOUNCE_ALL
]);
2612 // Ïåðåêëþ÷àòåëü çâóêîâûõ ýôôåêòîâ (DF / Doom 2)
2613 with AddSwitch (_lc
[I_MENU_SOUND_COMPAT
]) do
2615 Name
:= 'swSoundEffects';
2616 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2617 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2619 // Ïåðåêëþ÷àòåëü çâóêîâ ÷àòà
2620 with AddSwitch (_lc
[I_MENU_SOUND_CHAT
]) do
2622 Name
:= 'swChatSpeech';
2623 AddItem(_lc
[I_MENU_YES
]);
2624 AddItem(_lc
[I_MENU_NO
]);
2626 with AddSwitch(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS
]) do
2628 Name
:= 'swInactiveSounds';
2629 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_ON
]);
2630 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_OFF
]);
2634 Menu
.DefControl
:= 'mOptionsSoundMenu';
2635 g_GUI_AddWindow(Menu
);
2637 Menu
:= TGUIWindow
.Create('OptionsGameMenu');
2638 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_GAME_OPTIONS
]))) do
2640 Name
:= 'mOptionsGameMenu';
2641 with AddScroll(_lc
[I_MENU_GAME_PARTICLES_COUNT
]) do
2643 Name
:= 'scParticlesCount';
2646 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_COUNT
]) do
2648 Name
:= 'swBloodCount';
2649 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2650 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2651 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2652 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2653 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2655 with AddScroll(_lc
[I_MENU_GAME_MAX_SHELLS
]) do
2657 Name
:= 'scShellsMax';
2660 with AddScroll(_lc
[I_MENU_GAME_GIBS_COUNT
]) do
2662 Name
:= 'scGibsMax';
2665 with AddScroll(_lc
[I_MENU_GAME_MAX_CORPSES
]) do
2667 Name
:= 'scCorpsesMax';
2670 with AddSwitch(_lc
[I_MENU_GAME_MAX_GIBS
]) do
2672 Name
:= 'swGibsCount';
2673 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2674 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2675 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2676 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2677 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2679 with AddSwitch(_lc
[I_MENU_GAME_CORPSE_TYPE
]) do
2681 Name
:= 'swCorpseType';
2682 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_SIMPLE
]);
2683 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_ADV
]);
2685 with AddSwitch(_lc
[I_MENU_GAME_GIBS_TYPE
]) do
2687 Name
:= 'swGibsType';
2688 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_SIMPLE
]);
2689 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_ADV
]);
2691 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_TYPE
]) do
2693 Name
:= 'swBloodType';
2694 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_SIMPLE
]);
2695 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_ADV
]);
2697 with AddSwitch(_lc
[I_MENU_GAME_SCREEN_FLASH
]) do
2699 Name
:= 'swScreenFlash';
2700 AddItem(_lc
[I_MENU_NO
]);
2701 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2702 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2704 with AddSwitch(_lc
[I_MENU_GAME_BACKGROUND
]) do
2706 Name
:= 'swBackground';
2707 AddItem(_lc
[I_MENU_YES
]);
2708 AddItem(_lc
[I_MENU_NO
]);
2710 with AddSwitch(_lc
[I_MENU_GAME_MESSAGES
]) do
2712 Name
:= 'swMessages';
2713 AddItem(_lc
[I_MENU_YES
]);
2714 AddItem(_lc
[I_MENU_NO
]);
2716 with AddSwitch(_lc
[I_MENU_GAME_REVERT_PLAYERS
]) do
2718 Name
:= 'swRevertPlayers';
2719 AddItem(_lc
[I_MENU_YES
]);
2720 AddItem(_lc
[I_MENU_NO
]);
2722 with AddSwitch(_lc
[I_MENU_GAME_CHAT_BUBBLE
]) do
2724 Name
:= 'swChatBubble';
2725 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_NONE
]);
2726 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_SIMPLE
]);
2727 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_ADV
]);
2728 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_COLOR
]);
2729 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_TEXTURE
]);
2731 with AddSwitch(_lc
[I_MENU_GAME_PLAYER_INDICATOR
]) do
2733 Name
:= 'swPlayerIndicator';
2734 AddItem(_lc
[I_MENU_YES
]);
2735 AddItem(_lc
[I_MENU_NO
]);
2737 with AddScroll(_lc
[I_MENU_GAME_SCALE_FACTOR
]) do
2739 Name
:= 'scScaleFactor';
2741 OnChange
:= ProcChangeGameSettings
;
2745 Menu
.DefControl
:= 'mOptionsGameMenu';
2746 g_GUI_AddWindow(Menu
);
2748 Menu
:= TGUIWindow
.Create('OptionsControlsMenu');
2749 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROLS_OPTIONS
]))) do
2751 Name
:= 'mOptionsControlsMenu';
2752 AddLine(_lc
[I_MENU_CONTROL_GLOBAL
]);
2753 AddKeyRead(_lc
[I_MENU_CONTROL_SCREENSHOT
]).Name
:= _lc
[I_MENU_CONTROL_SCREENSHOT
];
2754 AddKeyRead(_lc
[I_MENU_CONTROL_STAT
]).Name
:= _lc
[I_MENU_CONTROL_STAT
];
2755 AddKeyRead(_lc
[I_MENU_CONTROL_CHAT
]).Name
:= _lc
[I_MENU_CONTROL_CHAT
];
2756 AddKeyRead(_lc
[I_MENU_CONTROL_TEAMCHAT
]).Name
:= _lc
[I_MENU_CONTROL_TEAMCHAT
];
2758 AddButton(nil, _lc
[I_MENU_PLAYER_1_KBD
], 'OptionsControlsP1Menu');
2759 {AddButton(nil, _lc[I_MENU_PLAYER_1_ALT], 'OptionsControlsP1MenuAlt');}
2760 AddButton(nil, _lc
[I_MENU_PLAYER_1_WEAPONS
], 'OptionsControlsP1MenuWeapons');
2761 AddButton(nil, _lc
[I_MENU_PLAYER_2_KBD
], 'OptionsControlsP2Menu');
2762 {AddButton(nil, _lc[I_MENU_PLAYER_2_ALT], 'OptionsControlsP2MenuAlt');}
2763 AddButton(nil, _lc
[I_MENU_PLAYER_2_WEAPONS
], 'OptionsControlsP2MenuWeapons');
2764 if e_JoysticksAvailable
<> 0 then
2767 AddButton(nil, _lc
[I_MENU_CONTROL_JOYSTICKS
], 'OptionsControlsJoystickMenu');
2769 if g_touch_enabled
then
2772 AddButton(nil, _lc
[I_MENU_CONTROL_TOUCH
], 'OptionsControlsTouchMenu');
2775 Menu
.DefControl
:= 'mOptionsControlsMenu';
2776 g_GUI_AddWindow(Menu
);
2778 Menu
:= TGUIWindow
.Create('OptionsControlsP1Menu');
2779 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_1_KBD
]))) do
2781 Name
:= 'mOptionsControlsP1Menu';
2782 AddKeyRead2(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
2783 AddKeyRead2(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
2784 AddKeyRead2(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
2785 AddKeyRead2(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
2786 AddKeyRead2(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
2787 AddKeyRead2(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
2788 AddKeyRead2(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
2789 AddKeyRead2(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
2790 AddKeyRead2(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
2791 AddKeyRead2(_lc
[I_MENU_CONTROL_STRAFE
]).Name
:= _lc
[I_MENU_CONTROL_STRAFE
];
2793 Menu
.DefControl
:= 'mOptionsControlsP1Menu';
2794 g_GUI_AddWindow(Menu
);
2796 Menu
:= TGUIWindow
.Create('OptionsControlsP1MenuWeapons');
2797 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_1_WEAPONS
]))) do
2799 Name
:= 'mOptionsControlsP1MenuWeapons';
2800 for i
:= WP_FIRST
to WP_LAST
do
2801 AddKeyRead2(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)]).Name
:=
2802 _lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)];
2804 Menu
.DefControl
:= 'mOptionsControlsP1MenuWeapons';
2805 g_GUI_AddWindow(Menu
);
2807 Menu
:= TGUIWindow
.Create('OptionsControlsP2Menu');
2808 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_2_KBD
]))) do
2810 Name
:= 'mOptionsControlsP2Menu';
2811 AddKeyRead2(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
2812 AddKeyRead2(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
2813 AddKeyRead2(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
2814 AddKeyRead2(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
2815 AddKeyRead2(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
2816 AddKeyRead2(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
2817 AddKeyRead2(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
2818 AddKeyRead2(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
2819 AddKeyRead2(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
2820 AddKeyRead2(_lc
[I_MENU_CONTROL_STRAFE
]).Name
:= _lc
[I_MENU_CONTROL_STRAFE
];
2822 Menu
.DefControl
:= 'mOptionsControlsP2Menu';
2823 g_GUI_AddWindow(Menu
);
2825 Menu
:= TGUIWindow
.Create('OptionsControlsP2MenuWeapons');
2826 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_2_WEAPONS
]))) do
2828 Name
:= 'mOptionsControlsP2MenuWeapons';
2829 for i
:= WP_FIRST
to WP_LAST
do
2830 AddKeyRead2(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)]).Name
:=
2831 _lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)];
2833 Menu
.DefControl
:= 'mOptionsControlsP2MenuWeapons';
2834 g_GUI_AddWindow(Menu
);
2836 Menu
:= TGUIWindow
.Create('OptionsControlsJoystickMenu');
2837 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROL_JOYSTICKS
]))) do
2839 Name
:= 'mOptionsControlsJoystickMenu';
2840 for i
:= 0 to e_JoysticksAvailable
-1 do
2841 with AddScroll(Format(_lc
[I_MENU_CONTROL_DEADZONE
], [i
+ 1])) do
2843 Name
:= 'scDeadzone' + IntToStr(i
);
2847 Menu
.DefControl
:= 'mOptionsControlsJoystickMenu';
2848 g_GUI_AddWindow(Menu
);
2850 Menu
:= TGUIWindow
.Create('OptionsControlsTouchMenu');
2851 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROL_TOUCH
]))) do
2853 Name
:= 'mOptionsControlsTouchMenu';
2854 with AddSwitch(_lc
[I_MENU_CONTROL_TOUCH_ALT
]) do
2856 Name
:= 'swTouchAlt';
2857 AddItem(_lc
[I_MENU_NO
]);
2858 AddItem(_lc
[I_MENU_YES
]);
2859 OnChange
:= ProcChangeTouchSettings
;
2861 with AddScroll(_lc
[I_MENU_CONTROL_TOUCH_SIZE
]) do
2863 Name
:= 'scTouchSize';
2865 OnChange
:= ProcChangeTouchSettings
;
2867 with AddSwitch(_lc
[I_MENU_CONTROL_TOUCH_FIRE
]) do
2869 Name
:= 'swTouchFire';
2870 AddItem(_lc
[I_MENU_NO
]);
2871 AddItem(_lc
[I_MENU_YES
]);
2873 with AddScroll(_lc
[I_MENU_CONTROL_TOUCH_OFFSET
]) do
2875 Name
:= 'scTouchOffset';
2877 OnChange
:= ProcChangeTouchSettings
;
2880 Menu
.DefControl
:= 'mOptionsControlsTouchMenu';
2881 g_GUI_AddWindow(Menu
);
2883 Menu
:= TGUIWindow
.Create('OptionsPlayersMenu');
2884 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_OPTIONS
]))) do
2886 Name
:= 'mOptionsPlayersMenu';
2887 AddButton(nil, _lc
[I_MENU_PLAYER_1
], 'OptionsPlayersP1Menu');
2888 AddButton(nil, _lc
[I_MENU_PLAYER_2
], 'OptionsPlayersP2Menu');
2890 Menu
.DefControl
:= 'mOptionsPlayersMenu';
2891 g_GUI_AddWindow(Menu
);
2893 CreatePlayerOptionsMenu('P1');
2894 CreatePlayerOptionsMenu('P2');
2896 Menu
:= TGUIWindow
.Create('OptionsPlayersMIMenu');
2897 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_MODEL_INFO
]))) do
2899 Name
:= 'mOptionsPlayersMIMenu';
2900 with AddLabel(_lc
[I_MENU_MODEL_NAME
]) do
2905 with AddLabel(_lc
[I_MENU_MODEL_AUTHOR
]) do
2910 with AddMemo(_lc
[I_MENU_MODEL_COMMENT
], 14, 6) do
2912 Name
:= 'meComment';
2915 AddLine(_lc
[I_MENU_MODEL_OPTIONS
]);
2916 with AddLabel(_lc
[I_MENU_MODEL_WEAPON
]) do
2919 FixedLength
:= Max(Length(_lc
[I_MENU_YES
]), Length(_lc
[I_MENU_NO
]));
2923 Menu
.DefControl
:= 'mOptionsPlayersMIMenu';
2924 g_GUI_AddWindow(Menu
);
2926 Menu
:= TGUIWindow
.Create('OptionsLanguageMenu');
2927 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_LANGUAGE_OPTIONS
]))) do
2929 Name
:= 'mOptionsLanguageMenu';
2930 AddButton(@ProcSetRussianLanguage
, _lc
[I_MENU_LANGUAGE_RUSSIAN
]);
2931 AddButton(@ProcSetEnglishLanguage
, _lc
[I_MENU_LANGUAGE_ENGLISH
]);
2934 Menu
.DefControl
:= 'mOptionsLanguageMenu';
2935 g_GUI_AddWindow(Menu
);
2937 Menu
:= CreateYNMenu('DefaultOptionsMenu', _lc
[I_MENU_SET_DEFAULT_PROMT
], Round(gScreenWidth
*0.6),
2938 gMenuSmallFont
, @ProcDefaultMenuKeyDown
);
2939 g_GUI_AddWindow(Menu
);
2941 Menu
:= TGUIWindow
.Create('AuthorsMenu');
2942 Menu
.BackTexture
:= 'INTER';
2943 Menu
.OnClose
:= ProcAuthorsClose
;
2947 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_1
], gMenuFont
))) do
2949 Color
:= _RGB(255, 0, 0);
2950 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
2952 _y
:= _y
+GetHeight();
2954 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(Format(_lc
[I_CREDITS_CAP_2
], [GAME_VERSION
, NET_PROTOCOL_VER
]), gMenuSmallFont
))) do
2956 Color
:= _RGB(255, 0, 0);
2957 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
2959 _y
:= _y
+GetHeight()+32;
2961 // ×òî äåëàë: Êòî äåëàë
2962 cx
:= gScreenWidth
div 2 - 320 + 64;
2963 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1
], gMenuSmallFont
))) do
2965 Color
:= _RGB(255, 0, 0);
2970 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1_1
], gMenuSmallFont
))) do
2972 Color
:= _RGB(255, 255, 255);
2977 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2
], gMenuSmallFont
))) do
2979 Color
:= _RGB(255, 0, 0);
2984 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2_1
], gMenuSmallFont
))) do
2986 Color
:= _RGB(255, 255, 255);
2991 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2_2
], gMenuSmallFont
))) do
2993 Color
:= _RGB(255, 255, 255);
2998 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3
], gMenuSmallFont
))) do
3000 Color
:= _RGB(255, 0, 0);
3005 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3_1
], gMenuSmallFont
))) do
3007 Color
:= _RGB(255, 255, 255);
3012 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4
], gMenuSmallFont
))) do
3014 Color
:= _RGB(255, 0, 0);
3019 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4_1
], gMenuSmallFont
))) do
3021 Color
:= _RGB(255, 255, 255);
3024 _y
:= gScreenHeight
- 128;
3027 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_3
], gMenuSmallFont
))) do
3029 Color
:= _RGB(255, 0, 0);
3034 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_1
], gMenuSmallFont
))) do
3036 Color
:= _RGB(255, 255, 255);
3039 _y
:= _y
+GetHeight();
3041 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_2
], gMenuSmallFont
))) do
3043 Color
:= _RGB(255, 255, 255);
3046 _y
:= _y
+GetHeight();
3048 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_3
], gMenuSmallFont
))) do
3050 Color
:= _RGB(255, 255, 255);
3053 _y
:= gScreenHeight
- 32;
3055 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_4
], gMenuSmallFont
))) do
3057 Color
:= _RGB(255, 0, 0);
3058 X
:= gScreenWidth
div 2 - GetWidth() div 2;
3061 g_GUI_AddWindow(Menu
);
3063 Menu
:= CreateYNMenu('ExitMenu', _lc
[I_MENU_EXIT_PROMT
], Round(gScreenWidth
*0.6),
3064 gMenuSmallFont
, @ProcExitMenuKeyDown
);
3065 g_GUI_AddWindow(Menu
);
3067 Menu
:= TGUIWindow
.Create('GameSingleMenu');
3068 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
3070 Name
:= 'mmGameSingleMenu';
3071 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
3072 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
3073 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
3074 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3075 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
3076 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3078 Menu
.DefControl
:= 'mmGameSingleMenu';
3079 Menu
.MainWindow
:= True;
3080 Menu
.OnClose
:= ProcGMClose
;
3081 Menu
.OnShow
:= ProcGMShow
;
3082 g_GUI_AddWindow(Menu
);
3084 Menu
:= CreateYNMenu('EndGameMenu', _lc
[I_MENU_END_GAME_PROMT
], Round(gScreenWidth
*0.6),
3085 gMenuSmallFont
, @ProcEndMenuKeyDown
);
3086 g_GUI_AddWindow(Menu
);
3088 Menu
:= CreateYNMenu('RestartGameMenu', _lc
[I_MENU_RESTART_GAME_PROMT
], Round(gScreenWidth
*0.6),
3089 gMenuSmallFont
, @ProcRestartMenuKeyDown
);
3090 g_GUI_AddWindow(Menu
);
3092 Menu
:= TGUIWindow
.Create('GameCustomMenu');
3093 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
3095 Name
:= 'mmGameCustomMenu';
3096 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
3097 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
3098 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
3099 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
3100 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3101 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
3102 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3104 Menu
.DefControl
:= 'mmGameCustomMenu';
3105 Menu
.MainWindow
:= True;
3106 Menu
.OnClose
:= ProcGMClose
;
3107 Menu
.OnShow
:= ProcGMShow
;
3108 g_GUI_AddWindow(Menu
);
3110 Menu
:= TGUIWindow
.Create('GameServerMenu');
3111 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
3113 Name
:= 'mmGameServerMenu';
3114 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
3115 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
3116 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3117 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
3118 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3120 Menu
.DefControl
:= 'mmGameServerMenu';
3121 Menu
.MainWindow
:= True;
3122 Menu
.OnClose
:= ProcGMClose
;
3123 Menu
.OnShow
:= ProcGMShow
;
3124 g_GUI_AddWindow(Menu
);
3126 Menu
:= TGUIWindow
.Create('GameClientMenu');
3127 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
3129 Name
:= 'mmGameClientMenu';
3130 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
3131 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3132 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3134 Menu
.DefControl
:= 'mmGameClientMenu';
3135 Menu
.MainWindow
:= True;
3136 Menu
.OnClose
:= ProcGMClose
;
3137 Menu
.OnShow
:= ProcGMShow
;
3138 g_GUI_AddWindow(Menu
);
3140 Menu
:= TGUIWindow
.Create('ClientPasswordMenu');
3141 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuSmallFont
, gMenuSmallFont
, _lc
[I_MENU_ENTERPASSWORD
]))) do
3143 Name
:= 'mClientPasswordMenu';
3144 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
3152 AddButton(@ProcEnterPassword
, _lc
[I_MENU_START_GAME
]);
3155 Menu
.DefControl
:= 'mClientPasswordMenu';
3156 g_GUI_AddWindow(Menu
);
3158 Menu
:= TGUIWindow
.Create('GameSetGameMenu');
3159 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SET_GAME
]))) do
3161 Name
:= 'mGameSetGameMenu';
3162 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
3164 Name
:= 'swTeamDamage';
3165 AddItem(_lc
[I_MENU_YES
]);
3166 AddItem(_lc
[I_MENU_NO
]);
3169 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
3171 Name
:= 'edTimeLimit';
3176 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
3178 Name
:= 'edGoalLimit';
3183 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
3185 Name
:= 'edMaxLives';
3190 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
3193 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
3194 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
3195 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
3201 Menu
.DefControl
:= 'mGameSetGameMenu';
3202 Menu
.OnClose
:= ProcApplyGameSet
;
3203 g_GUI_AddWindow(Menu
);
3205 Menu
:= TGUIWindow
.Create('TeamMenu');
3206 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_CHANGE_PLAYERS
]))) do
3208 Name
:= 'mmTeamMenu';
3209 AddButton(@ProcJoinRed
, _lc
[I_MENU_JOIN_RED
], '').Name
:= 'tmJoinRed';
3210 AddButton(@ProcJoinBlue
, _lc
[I_MENU_JOIN_BLUE
], '').Name
:= 'tmJoinBlue';
3211 AddButton(@ProcJoinGame
, _lc
[I_MENU_JOIN_GAME
], '').Name
:= 'tmJoinGame';
3212 AddButton(@ProcSwitchP2
, _lc
[I_MENU_ADD_PLAYER_2
], '').Name
:= 'tmPlayer2';
3213 AddButton(@ProcSpectate
, _lc
[I_MENU_SPECTATE
], '').Name
:= 'tmSpectate';
3215 Menu
.DefControl
:= 'mmTeamMenu';
3216 Menu
.OnShow
:= ProcChangePlayers
;
3217 g_GUI_AddWindow(Menu
);
3220 procedure g_Menu_Show_SaveMenu();
3222 if g_Game_IsTestMap
then
3224 if gGameSettings
.GameType
= GT_SINGLE
then
3225 g_GUI_ShowWindow('GameSingleMenu')
3228 if g_Game_IsClient
then
3231 if g_Game_IsNet
then
3234 g_GUI_ShowWindow('GameCustomMenu');
3236 g_GUI_ShowWindow('SaveMenu');
3237 g_Sound_PlayEx('MENU_OPEN');
3240 procedure g_Menu_Show_LoadMenu (standalone
: Boolean=false);
3242 if (g_ActiveWindow
<> nil) and (g_ActiveWindow
.name
= 'LoadMenu') then exit
; // nothing to do
3243 if gGameSettings
.GameType
= GT_SINGLE
then
3245 if not standalone
then g_GUI_ShowWindow('GameSingleMenu')
3249 if g_Game_IsClient
then exit
;
3250 if g_Game_IsNet
then exit
;
3251 if not standalone
then g_GUI_ShowWindow('GameCustomMenu');
3253 g_GUI_ShowWindow('LoadMenu');
3254 g_Sound_PlayEx('MENU_OPEN');
3257 procedure g_Menu_Show_GameSetGame();
3259 if gGameSettings
.GameType
= GT_SINGLE
then
3260 g_GUI_ShowWindow('GameSingleMenu')
3263 if g_Game_IsClient
then
3266 if g_Game_IsNet
then
3267 g_GUI_ShowWindow('GameServerMenu')
3269 g_GUI_ShowWindow('GameCustomMenu');
3272 g_GUI_ShowWindow('GameSetGameMenu');
3273 g_Sound_PlayEx('MENU_OPEN');
3276 procedure g_Menu_Show_OptionsVideo();
3278 if gGameSettings
.GameType
= GT_SINGLE
then
3279 g_GUI_ShowWindow('GameSingleMenu')
3282 if g_Game_IsClient
then
3283 g_GUI_ShowWindow('GameClientMenu')
3285 if g_Game_IsNet
then
3286 g_GUI_ShowWindow('GameServerMenu')
3288 g_GUI_ShowWindow('GameCustomMenu');
3291 g_GUI_ShowWindow('OptionsMenu');
3292 g_GUI_ShowWindow('OptionsVideoMenu');
3293 g_Sound_PlayEx('MENU_OPEN');
3296 procedure g_Menu_Show_OptionsSound();
3298 if gGameSettings
.GameType
= GT_SINGLE
then
3299 g_GUI_ShowWindow('GameSingleMenu')
3302 if g_Game_IsClient
then
3303 g_GUI_ShowWindow('GameClientMenu')
3305 if g_Game_IsNet
then
3306 g_GUI_ShowWindow('GameServerMenu')
3308 g_GUI_ShowWindow('GameCustomMenu');
3311 g_GUI_ShowWindow('OptionsMenu');
3312 g_GUI_ShowWindow('OptionsSoundMenu');
3313 g_Sound_PlayEx('MENU_OPEN');
3316 procedure g_Menu_Show_EndGameMenu();
3318 g_GUI_ShowWindow('EndGameMenu');
3319 g_Sound_PlayEx('MENU_OPEN');
3322 procedure g_Menu_Show_QuitGameMenu();
3324 g_GUI_ShowWindow('ExitMenu');
3325 g_Sound_PlayEx('MENU_OPEN');
3328 procedure g_Menu_Init();
3335 procedure g_Menu_Free();
3339 e_WriteLog('Releasing menu data...', TMsgType
.Notify
);
3344 procedure g_Menu_Reset();
3348 g_GUI_SaveMenuPos();
3349 ex
:= g_GUI_Destroy();
3353 e_WriteLog('Recreating menu...', TMsgType
.Notify
);
3358 g_Game_SetDebugMode();
3360 g_GUI_LoadMenuPos();