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 if TGUISwitch(menu
.GetControl('swBPP')).ItemIndex
= 0 then
120 gVSync
:= TGUISwitch(menu
.GetControl('swVSync')).ItemIndex
= 0;
121 if (ovs
<> gVSync
) then g_SetVSync(gVSync
);
123 gTextureFilter
:= TGUISwitch(menu
.GetControl('swTextureFilter')).ItemIndex
= 0;
124 glLegacyNPOT
:= not (TGUISwitch(menu
.GetControl('swLegacyNPOT')).ItemIndex
= 0);
126 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
128 g_Sound_SetupAllVolumes(
129 Min(TGUIScroll(menu
.GetControl('scSoundLevel')).Value
*16, 255),
130 Min(TGUIScroll(menu
.GetControl('scMusicLevel')).Value
*16, 255)
133 gMaxSimSounds
:= Max(Min(TGUIScroll(menu
.GetControl('scMaxSimSounds')).Value
*4+2, 66), 2);
134 gMuteWhenInactive
:= TGUISwitch(menu
.GetControl('swInactiveSounds')).ItemIndex
= 1;
135 gAnnouncer
:= TGUISwitch(menu
.GetControl('swAnnouncer')).ItemIndex
;
136 gSoundEffectsDF
:= TGUISwitch(menu
.GetControl('swSoundEffects')).ItemIndex
= 1;
137 gUseChatSounds
:= TGUISwitch(menu
.GetControl('swChatSpeech')).ItemIndex
= 0;
139 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
141 g_GFX_SetMax(TGUIScroll(menu
.GetControl('scParticlesCount')).Value
*1000);
142 g_Shells_SetMax(TGUIScroll(menu
.GetControl('scShellsMax')).Value
*30);
143 g_Gibs_SetMax(TGUIScroll(menu
.GetControl('scGibsMax')).Value
*25);
144 g_Corpses_SetMax(TGUIScroll(menu
.GetControl('scCorpsesMax')).Value
*5);
146 case TGUISwitch(menu
.GetControl('swGibsCount')).ItemIndex
of
151 else gGibsCount
:= 48;
154 gBloodCount
:= TGUISwitch(menu
.GetControl('swBloodCount')).ItemIndex
;
155 gFlash
:= TGUISwitch(menu
.GetControl('swScreenFlash')).ItemIndex
;
156 gAdvBlood
:= TGUISwitch(menu
.GetControl('swBloodType')).ItemIndex
= 1;
157 gAdvCorpses
:= TGUISwitch(menu
.GetControl('swCorpseType')).ItemIndex
= 1;
158 gAdvGibs
:= TGUISwitch(menu
.GetControl('swGibsType')).ItemIndex
= 1;
159 gDrawBackGround
:= TGUISwitch(menu
.GetControl('swBackGround')).ItemIndex
= 0;
160 gShowMessages
:= TGUISwitch(menu
.GetControl('swMessages')).ItemIndex
= 0;
161 gRevertPlayers
:= TGUISwitch(menu
.GetControl('swRevertPlayers')).ItemIndex
= 0;
162 gChatBubble
:= TGUISwitch(menu
.GetControl('swChatBubble')).ItemIndex
;
163 gPlayerIndicator
:= TGUISwitch(menu
.GetControl('swPlayerIndicator')).ItemIndex
= 0;
164 g_dbg_scale
:= TGUIScroll(menu
.GetControl('scScaleFactor')).Value
+ 1;
166 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
168 with menu
, gGameControls
.GameControls
do
170 TakeScreenshot
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_SCREENSHOT
])).Key
;
171 Stat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_STAT
])).Key
;
172 Chat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_CHAT
])).Key
;
173 TeamChat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_TEAMCHAT
])).Key
;
176 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1Menu').GetControl('mOptionsControlsP1Menu'));
177 with menu
, gGameControls
.P1Control
do
179 KeyRight
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key0
;
180 KeyLeft
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key0
;
181 KeyUp
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key0
;
182 KeyDown
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key0
;
183 KeyFire
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key0
;
184 KeyJump
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key0
;
185 KeyNextWeapon
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key0
;
186 KeyPrevWeapon
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key0
;
187 KeyOpen
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key0
;
188 KeyStrafe
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key0
;
190 KeyRight2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key1
;
191 KeyLeft2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key1
;
192 KeyUp2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key1
;
193 KeyDown2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key1
;
194 KeyFire2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key1
;
195 KeyJump2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key1
;
196 KeyNextWeapon2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key1
;
197 KeyPrevWeapon2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key1
;
198 KeyOpen2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key1
;
199 KeyStrafe2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key1
;
202 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1MenuWeapons').GetControl('mOptionsControlsP1MenuWeapons'));
203 with menu
, gGameControls
.P1Control
do
205 for i
:= WP_FIRST
to WP_LAST
do
207 KeyWeapon
[i
] := TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key0
;
208 KeyWeapon2
[i
] := TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key1
;
212 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2Menu').GetControl('mOptionsControlsP2Menu'));
213 with menu
, gGameControls
.P2Control
do
215 KeyRight
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key0
;
216 KeyLeft
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key0
;
217 KeyUp
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key0
;
218 KeyDown
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key0
;
219 KeyFire
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key0
;
220 KeyJump
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key0
;
221 KeyNextWeapon
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key0
;
222 KeyPrevWeapon
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key0
;
223 KeyOpen
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key0
;
224 KeyStrafe
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key0
;
226 KeyRight2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key1
;
227 KeyLeft2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key1
;
228 KeyUp2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key1
;
229 KeyDown2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key1
;
230 KeyFire2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key1
;
231 KeyJump2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key1
;
232 KeyNextWeapon2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key1
;
233 KeyPrevWeapon2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key1
;
234 KeyOpen2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key1
;
235 KeyStrafe2
:= TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key1
;
238 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2MenuWeapons').GetControl('mOptionsControlsP2MenuWeapons'));
239 with menu
, gGameControls
.P2Control
do
241 for i
:= WP_FIRST
to WP_LAST
do
243 KeyWeapon
[i
] := TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key0
;
244 KeyWeapon2
[i
] := TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key1
;
248 if e_JoysticksAvailable
> 0 then
250 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsJoystickMenu').GetControl('mOptionsControlsJoystickMenu'));
253 for i
:= 0 to e_JoysticksAvailable
-1 do
254 e_JoystickDeadzones
[i
] := TGUIScroll(menu
.GetControl('scDeadzone' + IntToStr(i
))).Value
*(32767 div 20);
258 if g_touch_enabled
then
260 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsTouchMenu').GetControl('mOptionsControlsTouchMenu'));
261 g_touch_alt
:= TGUISwitch(menu
.GetControl('swTouchAlt')).ItemIndex
= 1;
262 g_touch_size
:= TGUIScroll(menu
.GetControl('scTouchSize')).Value
/ 10 + 0.5;
263 g_touch_fire
:= TGUISwitch(menu
.GetControl('swTouchFire')).ItemIndex
= 1;
264 g_touch_offset
:= TGUIScroll(menu
.GetControl('scTouchOffset')).Value
* 5;
267 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
269 gPlayer1Settings
.Name
:= b_Text_Unformat(TGUIEdit(menu
.GetControl('edP1Name')).Text);
270 gPlayer1Settings
.Team
:= IfThen(TGUISwitch(menu
.GetControl('swP1Team')).ItemIndex
= 0,
271 TEAM_RED
, TEAM_BLUE
);
273 with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mvP1Model')) do
275 gPlayer1Settings
.Model
:= Model
.Name
;
276 gPlayer1Settings
.Color
:= Model
.Color
;
279 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
281 gPlayer2Settings
.Name
:= b_Text_Unformat(TGUIEdit(menu
.GetControl('edP2Name')).Text);
282 gPlayer2Settings
.Team
:= IfThen(TGUISwitch(menu
.GetControl('swP2Team')).ItemIndex
= 0,
283 TEAM_RED
, TEAM_BLUE
);
284 with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mvP2Model')) do
286 gPlayer2Settings
.Model
:= Model
.Name
;
287 gPlayer2Settings
.Color
:= Model
.Color
;
290 if gPlayer1Settings
.Name
= '' then gPlayer1Settings
.Name
:= GenPlayerName(1);
291 if gPlayer2Settings
.Name
= '' then gPlayer2Settings
.Name
:= GenPlayerName(2);
293 if g_Game_IsServer
then
295 if gPlayer1
<> nil then
297 gPlayer1
.SetModel(gPlayer1Settings
.Model
);
298 gPlayer1
.Name
:= gPlayer1Settings
.Name
;
299 if not (gGameSettings
.GameMode
in [GM_TDM
, GM_CTF
]) then
300 gPlayer1
.SetColor(gPlayer1Settings
.Color
)
302 if gPlayer1
.Team
<> gPlayer1Settings
.Team
then
305 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
308 if gPlayer2
<> nil then
310 gPlayer2
.SetModel(gPlayer2Settings
.Model
);
311 gPlayer2
.Name
:= gPlayer2Settings
.Name
;
312 if (gGameSettings
.GameMode
<> GM_TDM
) and (gGameSettings
.GameMode
<> GM_CTF
) then
313 gPlayer2
.SetColor(gPlayer2Settings
.Color
)
315 if gPlayer2
.Team
<> gPlayer2Settings
.Team
then
320 if g_Game_IsClient
then MC_SEND_PlayerSettings
;
322 g_Options_Write(GameDir
+'/'+CONFIG_FILENAME
);
325 procedure ReadOptions();
330 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
332 with TGUISwitch(menu
.GetControl('swBPP')) do
338 with TGUISwitch(menu
.GetControl('swTextureFilter')) do
339 if gTextureFilter
then ItemIndex
:= 0 else ItemIndex
:= 1;
341 with TGUISwitch(menu
.GetControl('swVSync')) do
342 if gVSync
then ItemIndex
:= 0 else ItemIndex
:= 1;
344 with TGUISwitch(menu
.GetControl('swLegacyNPOT')) do
345 if not glLegacyNPOT
then ItemIndex
:= 0 else ItemIndex
:= 1;
347 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
349 TGUIScroll(menu
.GetControl('scSoundLevel')).Value
:= Round(gSoundLevel
/16);
350 TGUIScroll(menu
.GetControl('scMusicLevel')).Value
:= Round(gMusicLevel
/16);
351 TGUIScroll(menu
.GetControl('scMaxSimSounds')).Value
:= Round((gMaxSimSounds
-2)/4);
353 with TGUISwitch(menu
.GetControl('swInactiveSounds')) do
354 if gMuteWhenInactive
then
359 TGUISwitch(menu
.GetControl('swAnnouncer')).ItemIndex
:= gAnnouncer
;
361 with TGUISwitch(menu
.GetControl('swSoundEffects')) do
362 if gSoundEffectsDF
then
367 with TGUISwitch(menu
.GetControl('swChatSpeech')) do
368 if gUseChatSounds
then
373 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1Menu').GetControl('mOptionsControlsP1Menu'));
374 with menu
, gGameControls
.P1Control
do
376 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key0
:= KeyRight
;
377 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key0
:= KeyLeft
;
378 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key0
:= KeyUp
;
379 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key0
:= KeyDown
;
380 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key0
:= KeyFire
;
381 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key0
:= KeyJump
;
382 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key0
:= KeyNextWeapon
;
383 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key0
:= KeyPrevWeapon
;
384 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key0
:= KeyOpen
;
385 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key0
:= KeyStrafe
;
387 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key1
:= KeyRight2
;
388 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key1
:= KeyLeft2
;
389 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key1
:= KeyUp2
;
390 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key1
:= KeyDown2
;
391 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key1
:= KeyFire2
;
392 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key1
:= KeyJump2
;
393 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key1
:= KeyNextWeapon2
;
394 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key1
:= KeyPrevWeapon2
;
395 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key1
:= KeyOpen2
;
396 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key1
:= KeyStrafe2
;
399 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1MenuWeapons').GetControl('mOptionsControlsP1MenuWeapons'));
400 with menu
, gGameControls
.P1Control
do
402 for i
:= WP_FIRST
to WP_LAST
do
404 TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key0
:= KeyWeapon
[i
];
405 TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key1
:= KeyWeapon2
[i
];
409 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2Menu').GetControl('mOptionsControlsP2Menu'));
410 with menu
, gGameControls
.P2Control
do
412 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key0
:= KeyRight
;
413 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key0
:= KeyLeft
;
414 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key0
:= KeyUp
;
415 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key0
:= KeyDown
;
416 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key0
:= KeyFire
;
417 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key0
:= KeyJump
;
418 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key0
:= KeyNextWeapon
;
419 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key0
:= KeyPrevWeapon
;
420 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key0
:= KeyOpen
;
421 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key0
:= KeyStrafe
;
423 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key1
:= KeyRight2
;
424 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key1
:= KeyLeft2
;
425 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key1
:= KeyUp2
;
426 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key1
:= KeyDown2
;
427 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key1
:= KeyFire2
;
428 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key1
:= KeyJump2
;
429 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key1
:= KeyNextWeapon2
;
430 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key1
:= KeyPrevWeapon2
;
431 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key1
:= KeyOpen2
;
432 TGUIKeyRead2(GetControl(_lc
[I_MENU_CONTROL_STRAFE
])).Key1
:= KeyStrafe2
;
435 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2MenuWeapons').GetControl('mOptionsControlsP2MenuWeapons'));
436 with menu
, gGameControls
.P2Control
do
438 for i
:= WP_FIRST
to WP_LAST
do
440 TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key0
:= KeyWeapon
[i
];
441 TGUIKeyRead2(GetControl(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)])).Key1
:= KeyWeapon2
[i
];
445 if e_JoysticksAvailable
> 0 then
447 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsJoystickMenu').GetControl('mOptionsControlsJoystickMenu'));
450 for i
:= 0 to e_JoysticksAvailable
-1 do
451 TGUIScroll(menu
.GetControl('scDeadzone' + IntToStr(i
))).Value
:= e_JoystickDeadzones
[i
] div (32767 div 20);
455 if g_touch_enabled
then
457 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsTouchMenu').GetControl('mOptionsControlsTouchMenu'));
458 with TGUISwitch(menu
.GetControl('swTouchAlt')) do
459 if g_touch_alt
then ItemIndex
:= 1 else ItemIndex
:= 0;
460 TGUIScroll(menu
.GetControl('scTouchSize')).Value
:= Round((g_touch_size
- 0.5) * 10);
461 with TGUISwitch(menu
.GetControl('swTouchFire')) do
462 if g_touch_fire
then ItemIndex
:= 1 else ItemIndex
:= 0;
463 TGUIScroll(menu
.GetControl('scTouchOffset')).Value
:= Round(g_touch_offset
/ 5);
466 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
467 with menu
, gGameControls
.GameControls
do
469 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_SCREENSHOT
])).Key
:= TakeScreenshot
;
470 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_STAT
])).Key
:= Stat
;
471 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_CHAT
])).Key
:= Chat
;
472 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_TEAMCHAT
])).Key
:= TeamChat
;
475 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
477 TGUIScroll(menu
.GetControl('scParticlesCount')).Value
:= g_GFX_GetMax() div 1000;
478 TGUIScroll(menu
.GetControl('scShellsMax')).Value
:= g_Shells_GetMax() div 30;
479 TGUIScroll(menu
.GetControl('scGibsMax')).Value
:= g_Gibs_GetMax() div 25;
480 TGUIScroll(menu
.GetControl('scCorpsesMax')).Value
:= g_Corpses_GetMax() div 5;
481 TGUISwitch(menu
.GetControl('swBloodCount')).ItemIndex
:= gBloodCount
;
483 with TGUISwitch(menu
.GetControl('swScreenFlash')) do
486 with TGUISwitch(menu
.GetControl('swBloodType')) do
487 if gAdvBlood
then ItemIndex
:= 1 else ItemIndex
:= 0;
489 with TGUISwitch(menu
.GetControl('swCorpseType')) do
490 if gAdvCorpses
then ItemIndex
:= 1 else ItemIndex
:= 0;
492 with TGUISwitch(menu
.GetControl('swGibsType')) do
493 if gAdvGibs
then ItemIndex
:= 1 else ItemIndex
:= 0;
495 with TGUISwitch(menu
.GetControl('swGibsCount')) do
504 with TGUISwitch(menu
.GetControl('swBackGround')) do
505 if gDrawBackGround
then ItemIndex
:= 0 else ItemIndex
:= 1;
507 with TGUISwitch(menu
.GetControl('swMessages')) do
508 if gShowMessages
then ItemIndex
:= 0 else ItemIndex
:= 1;
510 with TGUISwitch(menu
.GetControl('swRevertPlayers')) do
511 if gRevertPlayers
then ItemIndex
:= 0 else ItemIndex
:= 1;
513 with TGUISwitch(menu
.GetControl('swChatBubble')) do
514 ItemIndex
:= gChatBubble
;
516 with TGUISwitch(menu
.GetControl('swPlayerIndicator')) do
517 if gPlayerIndicator
then ItemIndex
:= 0 else ItemIndex
:= 1;
519 TGUIScroll(menu
.GetControl('scScaleFactor')).Value
:= Round(g_dbg_scale
- 1);
521 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
523 TGUIListBox(menu
.GetControl('lsP1Model')).SelectItem(gPlayer1Settings
.Model
);
524 TGUIEdit(menu
.GetControl('edP1Name')).Text := gPlayer1Settings
.Name
;
526 TGUISwitch(menu
.GetControl('swP1Team')).ItemIndex
:=
527 IfThen(gPlayer1Settings
.Team
= TEAM_BLUE
, 1, 0);
529 TGUIScroll(menu
.GetControl('scP1Red')).Value
:= Round(gPlayer1Settings
.Color
.R
/16);
530 TGUIScroll(menu
.GetControl('scP1Green')).Value
:= Round(gPlayer1Settings
.Color
.G
/16);
531 TGUIScroll(menu
.GetControl('scP1Blue')).Value
:= Round(gPlayer1Settings
.Color
.B
/16);
533 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
535 TGUIListBox(menu
.GetControl('lsP2Model')).SelectItem(gPlayer2Settings
.Model
);
536 TGUIEdit(menu
.GetControl('edP2Name')).Text := gPlayer2Settings
.Name
;
538 TGUISwitch(menu
.GetControl('swP2Team')).ItemIndex
:=
539 IfThen(gPlayer2Settings
.Team
= TEAM_BLUE
, 1, 0);
541 TGUIScroll(menu
.GetControl('scP2Red')).Value
:= Round(gPlayer2Settings
.Color
.R
/16);
542 TGUIScroll(menu
.GetControl('scP2Green')).Value
:= Round(gPlayer2Settings
.Color
.G
/16);
543 TGUIScroll(menu
.GetControl('scP2Blue')).Value
:= Round(gPlayer2Settings
.Color
.B
/16);
545 ProcSelectModel(nil);
548 procedure ProcSwitchMonstersCustom(Sender
: TGUIControl
);
550 // don't turn off monsters in DM
552 with TGUIMenu(g_ActiveWindow.GetControl('mCustomGameMenu')) do
553 if TGUISwitch(GetControl('swGameMode')).GetText <> _lc[I_MENU_GAME_TYPE_CTF] then
554 TGUISwitch(GetControl('swMonsters')).ItemIndex := 0
556 TGUISwitch(GetControl('swMonsters')).ItemIndex := 1;
559 if TGUISwitch(GetControl('swGameMode')).GetText = _lc[I_MENU_GAME_TYPE_COOP] then
560 TGUISwitch(GetControl('swMonsters')).ItemIndex := 0
561 else if TGUISwitch(GetControl('swGameMode')).GetText = _lc[I_MENU_GAME_TYPE_CTF] then
562 TGUISwitch(GetControl('swMonsters')).ItemIndex := 1;
566 procedure ProcSwitchMonstersNet(Sender
: TGUIControl
);
568 // don't turn off monsters in DM
570 with TGUIMenu(g_ActiveWindow.GetControl('mNetServerMenu')) do
571 if TGUISwitch(GetControl('swGameMode')).GetText <> _lc[I_MENU_GAME_TYPE_CTF] then
572 TGUISwitch(GetControl('swMonsters')).ItemIndex := 0
574 TGUISwitch(GetControl('swMonsters')).ItemIndex := 1;
577 if TGUISwitch(GetControl('swGameMode')).GetText = _lc[I_MENU_GAME_TYPE_COOP] then
578 TGUISwitch(GetControl('swMonsters')).ItemIndex := 0
579 else if TGUISwitch(GetControl('swGameMode')).GetText = _lc[I_MENU_GAME_TYPE_CTF] then
580 TGUISwitch(GetControl('swMonsters')).ItemIndex := 1;
584 procedure ProcStartCustomGame();
590 with TGUIMenu(g_ActiveWindow
.GetControl('mCustomGameMenu')) do
592 Map
:= TGUILabel(GetControl('lbMap')).Text;
595 if not isWadPath(Map
) then
598 GameMode
:= TGUISwitch(GetControl('swGameMode')).ItemIndex
+1;
599 gcGameMode
:= TGUISwitch(GetControl('swGameMode')).GetText
;
600 gcTimeLimit
:= StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
601 gcGoalLimit
:= StrToIntDef(TGUIEdit(GetControl('edGoalLimit')).Text, 0);
602 gcMaxLives
:= StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
604 gcTeamDamage
:= TGUISwitch(GetControl('swTeamDamage')).ItemIndex
= 0;
605 gcAllowExit
:= TGUISwitch(GetControl('swEnableExits')).ItemIndex
= 0;
606 gcWeaponStay
:= TGUISwitch(GetControl('swWeaponStay')).ItemIndex
= 0;
607 gcMonsters
:= TGUISwitch(GetControl('swMonsters')).ItemIndex
= 0;
610 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
612 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
614 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
616 Options
:= Options
or GAME_OPTION_MONSTERS
;
617 gcPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
;
619 case TGUISwitch(GetControl('swBotsVS')).ItemIndex
of
621 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
622 gcBotsVS
:= 'Monsters';
625 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
626 gcBotsVS
:= 'Everybody';
629 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
630 gcBotsVS
:= 'Players';
637 g_Options_Write_Gameplay_Custom(GameDir
+'/'+CONFIG_FILENAME
);
639 g_Game_StartCustom(Map
, GameMode
, gcTimeLimit
, gcGoalLimit
,
640 gcMaxLives
, Options
, gcPlayers
);
644 procedure ProcStartNetGame();
650 with TGUIMenu(g_ActiveWindow
.GetControl('mNetServerMenu')) do
652 Map
:= TGUILabel(GetControl('lbMap')).Text;
655 if not isWadPath(Map
) then
658 GameMode
:= TGUISwitch(GetControl('swGameMode')).ItemIndex
+1;
659 gnGameMode
:= TGUISwitch(GetControl('swGameMode')).GetText
;
660 gnTimeLimit
:= StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
661 gnGoalLimit
:= StrToIntDef(TGUIEdit(GetControl('edGoalLimit')).Text, 0);
662 gnMaxLives
:= StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
663 NetPort
:= StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
665 gnTeamDamage
:= TGUISwitch(GetControl('swTeamDamage')).ItemIndex
= 0;
666 gnAllowExit
:= TGUISwitch(GetControl('swEnableExits')).ItemIndex
= 0;
667 gnWeaponStay
:= TGUISwitch(GetControl('swWeaponStay')).ItemIndex
= 0;
668 gnMonsters
:= TGUISwitch(GetControl('swMonsters')).ItemIndex
= 0;
671 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
673 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
675 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
677 Options
:= Options
or GAME_OPTION_MONSTERS
;
678 gnPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
;
680 case TGUISwitch(GetControl('swBotsVS')).ItemIndex
of
682 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
683 gnBotsVS
:= 'Monsters';
686 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
687 gnBotsVS
:= 'Everybody';
690 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
691 gnBotsVS
:= 'Players';
696 NetServerName
:= TGUIEdit(GetControl('edSrvName')).Text;
697 NetMaxClients
:= Max(1, StrToIntDef(TGUIEdit(GetControl('edMaxPlayers')).Text, 1));
698 NetMaxClients
:= Min(NET_MAXCLIENTS
, NetMaxClients
);
699 NetPassword
:= TGUIEdit(GetControl('edSrvPassword')).Text;
700 NetUseMaster
:= TGUISwitch(GetControl('swUseMaster')).ItemIndex
= 0;
703 g_Options_Write_Net_Server(GameDir
+'/'+CONFIG_FILENAME
);
704 g_Options_Write_Gameplay_Net(GameDir
+'/'+CONFIG_FILENAME
);
706 g_Game_StartServer(Map
, GameMode
, gnTimeLimit
, gnGoalLimit
, gnMaxLives
,
707 Options
, gnPlayers
, 0, NetPort
);
710 procedure ProcConnectNetGame();
714 with TGUIMenu(g_ActiveWindow
.GetControl('mNetClientMenu')) do
716 NetClientIP
:= TGUIEdit(GetControl('edIP')).Text;
717 NetClientPort
:= StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
718 PW
:= TGUIEdit(GetControl('edPW')).Text;
721 g_Options_Write_Net_Client(GameDir
+'/'+CONFIG_FILENAME
);
722 g_Game_StartClient(NetClientIP
, NetClientPort
, PW
);
725 procedure ProcEnterPassword();
729 with TGUIMenu(g_ActiveWindow
.GetControl('mClientPasswordMenu')) do
731 NetClientIP
:= PromptIP
;
732 NetClientPort
:= PromptPort
;
733 PW
:= TGUIEdit(GetControl('edPW')).Text;
736 g_Options_Write_Net_Client(GameDir
+'/'+CONFIG_FILENAME
);
737 g_Game_StartClient(NetClientIP
, NetClientPort
, PW
);
740 procedure ProcServerlist();
742 if not NetInitDone
then
744 if (not g_Net_Init()) then
746 g_Console_Add('NET: ERROR: Failed to init ENet!');
753 g_Net_Slist_Set(NetSlistIP
, NetSlistPort
);
755 gState
:= STATE_SLIST
;
756 g_ActiveWindow
:= nil;
758 slWaitStr
:= _lc
[I_NET_SLIST_WAIT
];
763 slReturnPressed
:= True;
764 if g_Net_Slist_Fetch(slCurrent
) then
766 if slCurrent
= nil then
767 slWaitStr
:= _lc
[I_NET_SLIST_NOSERVERS
];
770 slWaitStr
:= _lc
[I_NET_SLIST_ERROR
];
771 g_Serverlist_GenerateTable(slCurrent
, slTable
);
774 procedure ProcStartCampaign();
780 with TGUIMenu(g_ActiveWindow
.GetControl('mCampaignMenu')) do
782 WAD
:= ExtractRelativePath(MapsDir
, TGUIFileListBox(GetControl('lsWAD')).SelectedItem());
783 TwoPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
= 1;
790 g_Game_StartSingle(WAD
+ ':\MAP01', TwoPlayers
, n
);
793 procedure ProcSelectMap(Sender
: TGUIControl
);
797 wad
, map
, res
: String;
799 win
:= g_GUI_GetWindow('SelectMapMenu');
800 with TGUIMenu(win
.GetControl('mSelectMapMenu')) do
802 wad
:= TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem();
803 map
:= TGUIListBox(GetControl('lsMapRes')).SelectedItem();
805 if (wad
= '') or (map
= '') then
806 begin // Ýòî íå êàðòà
807 TGUILabel(GetControl('lbMapName')).Text := '';
808 TGUILabel(GetControl('lbMapAuthor')).Text := '';
809 TGUILabel(GetControl('lbMapSize')).Text := '';
810 TGUIMemo(GetControl('meMapDescription')).SetText('');
811 TGUIMapPreview(win
.GetControl('mpMapPreview')).ClearMap();
812 TGUILabel(win
.GetControl('lbMapScale')).Text := '';
818 a
:= g_Map_GetMapInfo(res
);
820 TGUILabel(GetControl('lbMapName')).Text := a
.Name
;
821 TGUILabel(GetControl('lbMapAuthor')).Text := a
.Author
;
822 TGUILabel(GetControl('lbMapSize')).Text := Format('%dx%d', [a
.Width
, a
.Height
]);
823 TGUIMemo(GetControl('meMapDescription')).SetText(a
.Description
);
824 TGUIMapPreview(win
.GetControl('mpMapPreview')).SetMap(res
);
825 TGUILabel(win
.GetControl('lbMapScale')).Text :=
826 TGUIMapPreview(win
.GetControl('mpMapPreview')).GetScaleStr
;
831 procedure ProcSelectWAD(Sender
: TGUIControl
);
836 with TGUIMenu(g_GUI_GetWindow('SelectMapMenu').GetControl('mSelectMapMenu')) do
838 wad
:= TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem();
840 with TGUIListBox(GetControl('lsMapRes')) do
846 list
:= g_Map_GetMapsList(wad
);
860 procedure ProcSelectCampaignWAD(Sender
: TGUIControl
);
866 win
:= g_GUI_GetWindow('CampaignMenu');
867 with TGUIMenu(win
.GetControl('mCampaignMenu')) do
869 wad
:= TGUIFileListBox(GetControl('lsWAD')).SelectedItem();
873 TGUILabel(GetControl('lbWADName')).Text := '';
874 TGUILabel(GetControl('lbWADAuthor')).Text := '';
875 TGUIMemo(GetControl('meWADDescription')).SetText('');
878 a
:= g_Game_GetMegaWADInfo(wad
);
880 TGUILabel(GetControl('lbWADName')).Text := a
.Name
;
881 TGUILabel(GetControl('lbWADAuthor')).Text := a
.Author
;
882 TGUIMemo(GetControl('meWADDescription')).SetText(a
.Description
);
884 TGUIImage(win
.GetControl('mpWADImage')).ClearImage();
888 fn
:= g_ExtractWadName(a
.pic
);
890 TGUIImage(win
.GetControl('mpWADImage')).SetImage(wad
+a
.pic
)
892 TGUIImage(win
.GetControl('mpWADImage')).SetImage(a
.pic
);
897 procedure ProcChangeColor(Sender
: TGUIControl
);
901 window
:= g_GUI_GetWindow('OptionsPlayersP1Menu');
902 with TGUIMenu(window
.GetControl('mOptionsPlayersP1Menu')) do
903 TGUIModelView(window
.GetControl('mvP1Model')).SetColor(
904 Min(TGUIScroll(GetControl('scP1Red')).Value
*16, 255),
905 Min(TGUIScroll(GetControl('scP1Green')).Value
*16, 255),
906 Min(TGUIScroll(GetControl('scP1Blue')).Value
*16, 255));
908 window
:= g_GUI_GetWindow('OptionsPlayersP2Menu');
909 with TGUIMenu(window
.GetControl('mOptionsPlayersP2Menu')) do
910 TGUIModelView(window
.GetControl('mvP2Model')).SetColor(
911 Min(TGUIScroll(GetControl('scP2Red')).Value
*16, 255),
912 Min(TGUIScroll(GetControl('scP2Green')).Value
*16, 255),
913 Min(TGUIScroll(GetControl('scP2Blue')).Value
*16, 255));
916 procedure ProcSelectModel(Sender
: TGUIControl
);
921 window
:= g_GUI_GetWindow('OptionsPlayersP1Menu');
922 a
:= TGUIListBox(TGUIMenu(window
.GetControl('mOptionsPlayersP1Menu')).GetControl('lsP1Model')).SelectedItem
;
923 if a
<> '' then TGUIModelView(window
.GetControl('mvP1Model')).SetModel(a
);
925 window
:= g_GUI_GetWindow('OptionsPlayersP2Menu');
926 a
:= TGUIListBox(TGUIMenu(window
.GetControl('mOptionsPlayersP2Menu')).GetControl('lsP2Model')).SelectedItem
;
927 if a
<> '' then TGUIModelView(window
.GetControl('mvP2Model')).SetModel(a
);
929 ProcChangeColor(nil);
932 procedure LoadStdFont(cfgres
, texture
: string; var FontID
: DWORD
);
944 wad
:= TWADFile
.Create
;
945 if wad
.ReadFile(GameWAD
) then
946 wad
.GetResource('FONTS/'+cfgres
, cfgdata
, cfglen
);
951 g_Texture_CreateWADEx('FONT_STD', GameWAD
+':FONTS\'+texture
);
953 config
:= TConfig
.CreateMem(cfgdata
, cfglen
);
954 cwdt
:= Min(Max(config
.ReadInt('FontMap', 'CharWidth', 1), 1), 255);
955 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 1), 1), 255);
956 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
958 e_LogWritefln('LoadStdFont cwdt=%s chgt=%s spc=%s', [cwdt
, chgt
, spc
]);
960 if g_Texture_Get('FONT_STD', ID
) then
961 e_TextureFontBuild(ID
, FontID
, cwdt
, chgt
, spc
);
966 if cfglen
<> 0 then FreeMem(cfgdata
);
969 procedure LoadFont(txtres
, fntres
: string; var FontID
: DWORD
);
975 cfgdata
, fntdata
: Pointer;
976 cfglen
, fntlen
: Integer;
984 wad
:= TWADFile
.Create
;
985 if wad
.ReadFile(GameWAD
) then
987 wad
.GetResource('FONTS/'+txtres
, cfgdata
, cfglen
);
988 wad
.GetResource('FONTS/'+fntres
, fntdata
, fntlen
);
994 config
:= TConfig
.CreateMem(cfgdata
, cfglen
);
995 cwdt
:= Min(Max(config
.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
996 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
998 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
999 FontID
:= e_CharFont_Create(spc
);
1001 for a
:= 0 to 255 do
1003 chrwidth
:= config
.ReadInt(IntToStr(a
), 'Width', 0);
1004 if chrwidth
= 0 then Continue
;
1006 if e_CreateTextureMemEx(fntdata
, fntlen
, CharID
, cwdt
*(a
mod 16), chgt
*(a
div 16),
1008 e_CharFont_AddChar(FontID
, CharID
, Chr(a
), chrwidth
);
1014 if cfglen
<> 0 then FreeMem(cfgdata
);
1015 if fntlen
<> 0 then FreeMem(fntdata
);
1018 procedure MenuLoadData();
1020 e_WriteLog('Loading menu data...', TMsgType
.Notify
);
1022 g_Texture_CreateWADEx('MAINMENU_MARKER1', GameWAD
+':TEXTURES\MARKER1');
1023 g_Texture_CreateWADEx('MAINMENU_MARKER2', GameWAD
+':TEXTURES\MARKER2');
1024 g_Texture_CreateWADEx('SCROLL_LEFT', GameWAD
+':TEXTURES\SLEFT');
1025 g_Texture_CreateWADEx('SCROLL_RIGHT', GameWAD
+':TEXTURES\SRIGHT');
1026 g_Texture_CreateWADEx('SCROLL_MIDDLE', GameWAD
+':TEXTURES\SMIDDLE');
1027 g_Texture_CreateWADEx('SCROLL_MARKER', GameWAD
+':TEXTURES\SMARKER');
1028 g_Texture_CreateWADEx('EDIT_LEFT', GameWAD
+':TEXTURES\ELEFT');
1029 g_Texture_CreateWADEx('EDIT_RIGHT', GameWAD
+':TEXTURES\ERIGHT');
1030 g_Texture_CreateWADEx('EDIT_MIDDLE', GameWAD
+':TEXTURES\EMIDDLE');
1031 g_Texture_CreateWADEx('BOX1', GameWAD
+':TEXTURES\BOX1');
1032 g_Texture_CreateWADEx('BOX2', GameWAD
+':TEXTURES\BOX2');
1033 g_Texture_CreateWADEx('BOX3', GameWAD
+':TEXTURES\BOX3');
1034 g_Texture_CreateWADEx('BOX4', GameWAD
+':TEXTURES\BOX4');
1035 g_Texture_CreateWADEx('BOX5', GameWAD
+':TEXTURES\BOX5');
1036 g_Texture_CreateWADEx('BOX6', GameWAD
+':TEXTURES\BOX6');
1037 g_Texture_CreateWADEx('BOX7', GameWAD
+':TEXTURES\BOX7');
1038 g_Texture_CreateWADEx('BOX8', GameWAD
+':TEXTURES\BOX8');
1039 g_Texture_CreateWADEx('BOX9', GameWAD
+':TEXTURES\BOX9');
1040 g_Texture_CreateWADEx('BSCROLL_UP_A', GameWAD
+':TEXTURES\SCROLLUPA');
1041 g_Texture_CreateWADEx('BSCROLL_UP_U', GameWAD
+':TEXTURES\SCROLLUPU');
1042 g_Texture_CreateWADEx('BSCROLL_DOWN_A', GameWAD
+':TEXTURES\SCROLLDOWNA');
1043 g_Texture_CreateWADEx('BSCROLL_DOWN_U', GameWAD
+':TEXTURES\SCROLLDOWNU');
1044 g_Texture_CreateWADEx('BSCROLL_MIDDLE', GameWAD
+':TEXTURES\SCROLLMIDDLE');
1045 g_Texture_CreateWADEx('NOPIC', GameWAD
+':TEXTURES\NOPIC');
1047 g_Sound_CreateWADEx('MENU_SELECT', GameWAD
+':SOUNDS\MENUSELECT');
1048 g_Sound_CreateWADEx('MENU_OPEN', GameWAD
+':SOUNDS\MENUOPEN');
1049 g_Sound_CreateWADEx('MENU_CLOSE', GameWAD
+':SOUNDS\MENUCLOSE');
1050 g_Sound_CreateWADEx('MENU_CHANGE', GameWAD
+':SOUNDS\MENUCHANGE');
1051 g_Sound_CreateWADEx('SCROLL_ADD', GameWAD
+':SOUNDS\SCROLLADD');
1052 g_Sound_CreateWADEx('SCROLL_SUB', GameWAD
+':SOUNDS\SCROLLSUB');
1053 g_Sound_CreateWADEx('SOUND_PLAYER_FALL', GameWAD
+':SOUNDS\FALL');
1056 procedure MenuFreeData();
1058 e_CharFont_Remove(gMenuFont
);
1059 e_CharFont_Remove(gMenuSmallFont
);
1061 g_Texture_Delete('MAINMENU_MARKER1');
1062 g_Texture_Delete('MAINMENU_MARKER2');
1063 g_Texture_Delete('SCROLL_LEFT');
1064 g_Texture_Delete('SCROLL_RIGHT');
1065 g_Texture_Delete('SCROLL_MIDDLE');
1066 g_Texture_Delete('SCROLL_MARKER');
1067 g_Texture_Delete('EDIT_LEFT');
1068 g_Texture_Delete('EDIT_RIGHT');
1069 g_Texture_Delete('EDIT_MIDDLE');
1070 g_Texture_Delete('BOX1');
1071 g_Texture_Delete('BOX2');
1072 g_Texture_Delete('BOX3');
1073 g_Texture_Delete('BOX4');
1074 g_Texture_Delete('BOX5');
1075 g_Texture_Delete('BOX6');
1076 g_Texture_Delete('BOX7');
1077 g_Texture_Delete('BOX8');
1078 g_Texture_Delete('BOX9');
1079 g_Texture_Delete('BSCROLL_UP_A');
1080 g_Texture_Delete('BSCROLL_UP_U');
1081 g_Texture_Delete('BSCROLL_DOWN_A');
1082 g_Texture_Delete('BSCROLL_DOWN_U');
1083 g_Texture_Delete('BSCROLL_MIDDLE');
1084 g_Texture_Delete('NOPIC');
1086 g_Sound_Delete('MENU_SELECT');
1087 g_Sound_Delete('MENU_OPEN');
1088 g_Sound_Delete('MENU_CLOSE');
1089 g_Sound_Delete('MENU_CHANGE');
1090 g_Sound_Delete('SCROLL_ADD');
1091 g_Sound_Delete('SCROLL_SUB');
1092 g_Sound_Delete('SOUND_PLAYER_FALL');
1095 procedure ProcAuthorsMenu();
1097 gMusic
.SetByName('MUSIC_INTERMUS');
1101 procedure ProcExitMenuKeyDown (yes
: Boolean);
1104 snd
: TPlayableSound
;
1109 g_Game_StopAllSounds(True);
1110 case (Random(18)) of
1111 0: s
:= 'SOUND_MONSTER_PAIN';
1112 1: s
:= 'SOUND_MONSTER_DIE_3';
1113 2: s
:= 'SOUND_MONSTER_SLOP';
1114 3: s
:= 'SOUND_MONSTER_DEMON_DIE';
1115 4: s
:= 'SOUND_MONSTER_IMP_DIE_2';
1116 5: s
:= 'SOUND_MONSTER_MAN_DIE';
1117 6: s
:= 'SOUND_MONSTER_BSP_DIE';
1118 7: s
:= 'SOUND_MONSTER_VILE_DIE';
1119 8: s
:= 'SOUND_MONSTER_SKEL_DIE';
1120 9: s
:= 'SOUND_MONSTER_MANCUB_ALERT';
1121 10: s
:= 'SOUND_MONSTER_PAIN_PAIN';
1122 11: s
:= 'SOUND_MONSTER_BARON_DIE';
1123 12: s
:= 'SOUND_MONSTER_CACO_DIE';
1124 13: s
:= 'SOUND_MONSTER_CYBER_DIE';
1125 14: s
:= 'SOUND_MONSTER_KNIGHT_ALERT';
1126 15: s
:= 'SOUND_MONSTER_SPIDER_ALERT';
1127 else s
:= 'SOUND_PLAYER_FALL';
1129 snd
:= TPlayableSound
.Create();
1130 res
:= snd
.SetByName(s
);
1131 if not res
then res
:= snd
.SetByName('SOUND_PLAYER_FALL');
1135 while snd
.IsPlaying() do begin end;
1143 procedure ProcLoadMenu();
1150 TGUIEdit(TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a
))).Text := g_GetSaveName(a
, valid
);
1151 TGUIEdit(TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a
))).Invalid
:= not valid
;
1152 //TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a)).Enabled := valid;
1156 procedure ProcSaveMenu();
1164 name
:= g_GetSaveName(a
, valid
);
1165 TGUIEdit(TGUIMenu(g_GUI_GetWindow('SaveMenu').GetControl('mmSaveMenu')).GetControl('edSlot'+IntToStr(a
))).Text := name
;
1166 TGUIEdit(TGUIMenu(g_GUI_GetWindow('SaveMenu').GetControl('mmSaveMenu')).GetControl('edSlot'+IntToStr(a
))).Invalid
:= (name
<> '') and (not valid
);
1170 procedure ProcSaveGame(Sender
: TGUIControl
);
1174 if g_Game_IsNet
then Exit
;
1175 if g_Game_IsTestMap
then Exit
;
1176 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
1177 g_Game_PauseAllSounds(True);
1178 g_SaveGame(a
, TGUIEdit(Sender
).Text);
1180 g_ActiveWindow
:= nil;
1181 g_Game_Pause(False);
1184 procedure ProcLoadGame(Sender
: TGUIControl
);
1188 if g_Game_IsNet
then Exit
;
1189 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
1190 if g_LoadGame(a
) then
1192 g_Game_PauseAllSounds(False)
1194 else // Íå çàãðóçèëîñü - âîçâðàò â ìåíþ
1196 g_Console_Add(_lc
[I_MSG_BAD_SAVE_VERSION
], true);
1197 g_GUI_GetWindow('LoadMenu').SetActive(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu'));
1198 //g_ActiveWindow := nil;
1202 procedure ProcSingle1Player();
1204 g_Game_StartSingle(gDefaultMegawadStart
, False, 1);
1207 procedure ProcSingle2Players();
1209 g_Game_StartSingle(gDefaultMegawadStart
, True, 2);
1212 procedure ProcSelectMapMenu();
1215 wad_lb
: TGUIFileListBox
;
1216 map_lb
: TGUIListBox
;
1219 menu
:= TGUIMenu(g_GUI_GetWindow('SelectMapMenu').GetControl('mSelectMapMenu'));
1220 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsMapWAD'));
1221 map_lb
:= TGUIListBox(menu
.GetControl('lsMapRes'));
1223 if wad_lb
.SelectedItem() <> '' then
1224 map
:= map_lb
.SelectedItem()
1228 wad_lb
.UpdateFileList();
1231 if wad_lb
.SelectedItem() <> '' then
1234 map_lb
.SelectItem(map
);
1236 if map_lb
.SelectedItem() <> '' then
1240 g_GUI_ShowWindow('SelectMapMenu');
1243 procedure ProcSelectCampaignMenu();
1246 wad_lb
: TGUIFileListBox
;
1248 menu
:= TGUIMenu(g_GUI_GetWindow('CampaignMenu').GetControl('mCampaignMenu'));
1249 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsWAD'));
1251 wad_lb
.UpdateFileList();
1253 if wad_lb
.SelectedItem() <> '' then
1254 ProcSelectCampaignWAD(nil);
1257 procedure ProcSetMap();
1259 wad
, map
, res
: String;
1261 with TGUIMenu(g_ActiveWindow
.GetControl('mSelectMapMenu')) do
1263 wad
:= ExtractRelativePath(MapsDir
, TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem());
1264 map
:= TGUIListBox(GetControl('lsMapRes')).SelectedItem();
1267 if (wad
= '') or (map
= '') then
1270 res
:= wad
+':\'+map
;
1272 TGUILabel(TGUIMenu(g_GUI_GetWindow('CustomGameMenu').GetControl('mCustomGameMenu')).GetControl('lbMap')).Text := res
;
1273 TGUILabel(TGUIMenu(g_GUI_GetWindow('NetServerMenu').GetControl('mNetServerMenu')).GetControl('lbMap')).Text := res
;
1276 procedure ProcChangeSoundSettings(Sender
: TGUIControl
);
1280 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
1282 g_Sound_SetupAllVolumes(
1283 Min(TGUIScroll(menu
.GetControl('scSoundLevel')).Value
*16, 255),
1284 Min(TGUIScroll(menu
.GetControl('scMusicLevel')).Value
*16, 255)
1288 procedure ProcChangeGameSettings(Sender
: TGUIControl
);
1292 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
1293 g_dbg_scale
:= TGUIScroll(menu
.GetControl('scScaleFactor')).Value
+ 1;
1296 procedure ProcChangeTouchSettings(Sender
: TGUIControl
);
1300 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsTouchMenu').GetControl('mOptionsControlsTouchMenu'));
1301 g_touch_alt
:= TGUISwitch(menu
.GetControl('swTouchAlt')).ItemIndex
= 1;
1302 g_touch_size
:= TGUIScroll(menu
.GetControl('scTouchSize')).Value
/ 10 + 0.5;
1303 g_touch_offset
:= TGUIScroll(menu
.GetControl('scTouchOffset')).Value
* 5;
1306 procedure ProcOptionsPlayersMIMenu();
1311 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1313 a
:= TGUIListBox(TGUIMenu(g_ActiveWindow
.GetControl('mOptionsPlayers'+s
+'Menu')).GetControl('ls'+s
+'Model')).SelectedItem
;
1315 if a
= '' then Exit
;
1317 b
:= g_PlayerModel_GetInfo(a
);
1319 with TGUIMenu(g_GUI_GetWindow('OptionsPlayersMIMenu').GetControl('mOptionsPlayersMIMenu')) do
1321 TGUILabel(GetControl('lbName')).Text := b
.Name
;
1322 TGUILabel(GetControl('lbAuthor')).Text := b
.Author
;
1323 TGUIMemo(GetControl('meComment')).SetText(b
.Description
);
1325 if b
.HaveWeapon
then
1326 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_YES
]
1328 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_NO
];
1331 g_GUI_ShowWindow('OptionsPlayersMIMenu');
1334 procedure ProcOptionsPlayersAnim();
1338 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1343 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1346 Model
.GetCurrentAnimation
.Loop
:= True;
1347 Model
.GetCurrentAnimationMask
.Loop
:= True;
1351 procedure ProcOptionsPlayersWeap();
1355 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1360 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1364 procedure ProcOptionsPlayersRot();
1368 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1369 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')).Model
do
1371 if Direction
= TDirection
.D_LEFT
then Direction
:= TDirection
.D_RIGHT
else Direction
:= TDirection
.D_LEFT
;
1375 procedure ProcDefaultMenuKeyDown (yes
: Boolean);
1379 g_Options_SetDefault();
1385 procedure ProcSavedMenuKeyDown (yes
: Boolean);
1387 if yes
then ReadOptions();
1391 procedure ProcAuthorsClose();
1393 gMusic
.SetByName('MUSIC_MENU');
1395 gState
:= STATE_MENU
;
1398 procedure ProcGMClose();
1400 g_Game_InGameMenu(False);
1403 procedure ProcGMShow();
1408 if (gGameSettings
.GameType
= GT_SINGLE
) and
1409 ((gPlayer1
= nil) or (not gPlayer1
.alive
)) and
1410 ((gPlayer2
= nil) or (not gPlayer2
.alive
)) then
1411 Enabled
:= False; // Îäèí èç èãðîêîâ ïîãèá â ñèíãëå
1413 Enabled
:= False; // Çàïðåòèòü ñîõðàíåíèå â èíòåðìèññèè (íå ðåàëèçîâàíî)
1414 if g_Game_IsTestMap
then
1415 Enabled
:= False; // Åñëè èãðàåì íà òåñòîâîé èëè âðåìåííîé êàðòå
1416 TGUIMainMenu(g_ActiveWindow
.GetControl(
1417 g_ActiveWindow
.DefControl
)).EnableButton('save', Enabled
);
1420 procedure ProcChangePlayers();
1422 TeamGame
, Spectator
, AddTwo
: Boolean;
1423 P1Team
{, P2Team}: Byte;
1424 bP2
: TGUITextButton
;
1426 TeamGame
:= gGameSettings
.GameMode
in [GM_TDM
, GM_CTF
];
1427 Spectator
:= (gPlayer1
= nil) and (gPlayer2
= nil);
1428 AddTwo
:= gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
];
1429 P1Team
:= TEAM_NONE
;
1430 if gPlayer1
<> nil then P1Team
:= gPlayer1
.Team
;
1432 //P2Team := TEAM_NONE;
1433 //if gPlayer2 <> nil then P2Team := gPlayer2.Team;
1435 TGUIMainMenu(g_ActiveWindow
.GetControl(
1436 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinRed', TeamGame
and (P1Team
<> TEAM_RED
));
1437 TGUIMainMenu(g_ActiveWindow
.GetControl(
1438 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinBlue', TeamGame
and (P1Team
<> TEAM_BLUE
));
1439 TGUIMainMenu(g_ActiveWindow
.GetControl(
1440 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinGame', Spectator
and not TeamGame
);
1442 bP2
:= TGUIMainMenu(g_ActiveWindow
.GetControl(
1443 g_ActiveWindow
.DefControl
)).GetButton('tmPlayer2');
1444 bP2
.Enabled
:= AddTwo
and not Spectator
;
1446 bP2
.Color
:= MAINMENU_ITEMS_COLOR
1448 bP2
.Color
:= MAINMENU_UNACTIVEITEMS_COLOR
;
1449 if gPlayer2
= nil then
1450 bP2
.Caption
:= _lc
[I_MENU_ADD_PLAYER_2
]
1452 bP2
.Caption
:= _lc
[I_MENU_REM_PLAYER_2
];
1454 TGUIMainMenu(g_ActiveWindow
.GetControl(
1455 g_ActiveWindow
.DefControl
)).EnableButton('tmSpectate', not Spectator
);
1458 procedure ProcJoinRed();
1460 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1462 if g_Game_IsServer
then
1464 if gPlayer1
= nil then
1465 g_Game_AddPlayer(TEAM_RED
)
1468 if gPlayer1
.Team
<> TEAM_RED
then
1470 gPlayer1
.SwitchTeam
;
1471 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1474 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1479 gPlayer1Settings
.Team
:= TEAM_RED
;
1480 MC_SEND_PlayerSettings
;
1481 if gPlayer1
= nil then
1482 g_Game_AddPlayer(TEAM_RED
);
1484 g_ActiveWindow
:= nil;
1485 g_Game_Pause(False);
1488 procedure ProcJoinBlue();
1490 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1492 if g_Game_IsServer
then
1494 if gPlayer1
= nil then
1495 g_Game_AddPlayer(TEAM_BLUE
)
1498 if gPlayer1
.Team
<> TEAM_BLUE
then
1500 gPlayer1
.SwitchTeam
;
1501 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1504 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1509 gPlayer1Settings
.Team
:= TEAM_BLUE
;
1510 MC_SEND_PlayerSettings
;
1511 if gPlayer1
= nil then
1512 g_Game_AddPlayer(TEAM_BLUE
);
1514 g_ActiveWindow
:= nil;
1515 g_Game_Pause(False);
1518 procedure ProcJoinGame();
1520 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1522 if gPlayer1
= nil then
1524 g_ActiveWindow
:= nil;
1525 g_Game_Pause(False);
1528 procedure ProcSwitchP2();
1530 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
]) then
1532 if gPlayer1
= nil then
1534 if gPlayer2
= nil then
1537 g_Game_RemovePlayer();
1538 g_ActiveWindow
:= nil;
1539 g_Game_Pause(False);
1542 procedure ProcSpectate();
1544 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1547 g_ActiveWindow
:= nil;
1548 g_Game_Pause(False);
1551 procedure ProcRestartMenuKeyDown (yes
: Boolean);
1553 if yes
then g_Game_Restart() else g_GUI_HideWindow
;
1556 procedure ProcEndMenuKeyDown (yes
: Boolean);
1558 if yes
then gExit
:= EXIT_SIMPLE
else g_GUI_HideWindow
;
1561 procedure ProcSetRussianLanguage();
1563 if gLanguage
<> LANGUAGE_RUSSIAN
then
1565 gLanguage
:= LANGUAGE_RUSSIAN
;
1566 gLanguageChange
:= True;
1567 gAskLanguage
:= False;
1569 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1571 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1576 procedure ProcSetEnglishLanguage();
1578 if gLanguage
<> LANGUAGE_ENGLISH
then
1580 gLanguage
:= LANGUAGE_ENGLISH
;
1581 gLanguageChange
:= True;
1582 gAskLanguage
:= False;
1584 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1586 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1591 procedure ReadGameSettings();
1595 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1597 with gGameSettings
do
1599 with TGUISwitch(menu
.GetControl('swTeamDamage')) do
1600 if LongBool(Options
and GAME_OPTION_TEAMDAMAGE
) then
1605 TGUIEdit(menu
.GetControl('edTimeLimit')).Text := IntToStr(TimeLimit
);
1606 TGUIEdit(menu
.GetControl('edGoalLimit')).Text := IntToStr(GoalLimit
);
1607 TGUIEdit(menu
.GetControl('edMaxLives')).Text := IntToStr(MaxLives
);
1609 with TGUISwitch(menu
.GetControl('swBotsVS')) do
1610 if LongBool(Options
and GAME_OPTION_BOTVSPLAYER
) and
1611 LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1614 if LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1619 if GameType
in [GT_CUSTOM
, GT_SERVER
] then
1621 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1622 TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
:= True;
1623 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1624 TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
:= True;
1625 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1626 TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
:= True;
1627 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_ITEMSTEXT_COLOR
;
1628 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1632 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1633 with TGUIEdit(menu
.GetControl('edTimeLimit')) do
1638 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1639 with TGUIEdit(menu
.GetControl('edGoalLimit')) do
1644 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1645 with TGUIEdit(menu
.GetControl('edMaxLives')) do
1650 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1651 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1656 procedure ProcApplyGameSet();
1660 stat
: TPlayerStatArray
;
1662 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1664 if not g_Game_IsServer
then Exit
;
1666 with gGameSettings
do
1668 if TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
then
1670 if TGUISwitch(menu
.GetControl('swTeamDamage')).ItemIndex
= 0 then
1671 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
1673 Options
:= Options
and (not GAME_OPTION_TEAMDAMAGE
);
1676 if TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
then
1678 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edTimeLimit')).Text, TimeLimit
);
1684 b
:= (gTime
- gGameStartTime
) div 1000 + 10; // 10 ñåêóíä íà ñìåíó
1686 TimeLimit
:= Max(n
, b
);
1690 if TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
then
1692 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edGoalLimit')).Text, GoalLimit
);
1699 if GameMode
= GM_DM
then
1701 stat
:= g_Player_GetStats();
1703 for a
:= 0 to High(stat
) do
1704 if stat
[a
].Frags
> b
then
1708 b
:= Max(gTeamStat
[TEAM_RED
].Goals
, gTeamStat
[TEAM_BLUE
].Goals
);
1710 GoalLimit
:= Max(n
, b
);
1714 if TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
then
1716 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edMaxLives')).Text, GoalLimit
);
1717 if n
< 0 then n
:= 0;
1718 if n
> 255 then n
:= 255;
1724 stat
:= g_Player_GetStats();
1726 for a
:= 0 to High(stat
) do
1727 if stat
[a
].Lives
> b
then
1730 MaxLives
:= Max(n
, b
);
1734 if TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
then
1736 case TGUISwitch(menu
.GetControl('swBotsVS')).ItemIndex
of
1739 Options
:= Options
and (not GAME_OPTION_BOTVSPLAYER
);
1740 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1744 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1745 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1749 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1750 Options
:= Options
and (not GAME_OPTION_BOTVSMONSTER
);
1756 if g_Game_IsNet
then MH_SEND_GameSettings
;
1759 procedure ProcVideoOptionsRes();
1765 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1767 TGUILabel(menu
.GetControl('lbCurrentRes')).Text :=
1768 IntToStr(gScreenWidth
) +
1769 ' x ' + IntToStr(gScreenHeight
) +
1770 ', ' + IntToStr(gBPP
) + ' bpp';
1772 with TGUIListBox(menu
.GetControl('lsResolution')) do
1774 list
:= GetDisplayModes(gBPP
, SR
);
1785 with TGUISwitch(menu
.GetControl('swFullScreen')) do
1792 procedure ProcApplyVideoOptions();
1795 Fullscreen
: Boolean;
1796 SWidth
, SHeight
: Integer;
1799 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1801 str
:= TGUIListBox(menu
.GetControl('lsResolution')).SelectedItem
;
1802 SScanf(str
, '%dx%d', [@SWidth
, @SHeight
]);
1804 Fullscreen
:= TGUISwitch(menu
.GetControl('swFullScreen')).ItemIndex
= 0;
1806 if (SWidth
<> gScreenWidth
) or
1807 (SHeight
<> gScreenHeight
) or
1808 (Fullscreen
<> gFullscreen
) then
1810 gResolutionChange
:= True;
1811 gRC_Width
:= SWidth
;
1812 gRC_Height
:= SHeight
;
1813 gRC_FullScreen
:= Fullscreen
;
1814 gRC_Maximized
:= gWinMaximized
;
1817 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1821 procedure ProcSetFirstRussianLanguage();
1823 gLanguage
:= LANGUAGE_RUSSIAN
;
1824 gLanguageChange
:= True;
1825 gAskLanguage
:= False;
1827 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1830 procedure ProcSetFirstEnglishLanguage();
1832 gLanguage
:= LANGUAGE_ENGLISH
;
1833 gLanguageChange
:= True;
1834 gAskLanguage
:= False;
1836 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1839 procedure ProcRecallAddress();
1841 with TGUIMenu(g_GUI_GetWindow('NetClientMenu').GetControl('mNetClientMenu')) do
1843 TGUIEdit(GetControl('edIP')).Text := NetClientIP
;
1844 TGUIEdit(GetControl('edPort')).Text := IntToStr(NetClientPort
);
1848 procedure CreateFirstLanguageMenu();
1852 Menu
:= TGUIWindow
.Create('FirstLanguageMenu');
1854 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, ' '))) do
1856 Name
:= 'mmFirstLanguageMenu';
1857 AddButton(@ProcSetFirstRussianLanguage
, 'Ðóññêèé', '');
1858 AddButton(@ProcSetFirstEnglishLanguage
, 'English', '');
1861 Menu
.DefControl
:= 'mmFirstLanguageMenu';
1862 Menu
.MainWindow
:= True;
1863 g_GUI_AddWindow(Menu
);
1866 procedure g_Menu_AskLanguage();
1868 CreateFirstLanguageMenu();
1869 g_GUI_ShowWindow('FirstLanguageMenu');
1872 procedure CreatePlayerOptionsMenu(s
: String);
1877 Menu
:= TGUIWindow
.Create('OptionsPlayers'+s
+'Menu');
1879 a
:= _lc
[I_MENU_PLAYER_1
]
1881 a
:= _lc
[I_MENU_PLAYER_2
];
1882 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, a
))) do
1884 Name
:= 'mOptionsPlayers'+s
+'Menu';
1885 with AddEdit(_lc
[I_MENU_PLAYER_NAME
]) do
1887 Name
:= 'ed'+s
+'Name';
1891 with AddSwitch(_lc
[I_MENU_PLAYER_TEAM
]) do
1893 Name
:= 'sw'+s
+'Team';
1894 AddItem(_lc
[I_MENU_PLAYER_TEAM_RED
]);
1895 AddItem(_lc
[I_MENU_PLAYER_TEAM_BLUE
]);
1897 with AddList(_lc
[I_MENU_PLAYER_MODEL
], 12, 6) do
1899 Name
:= 'ls'+s
+'Model';
1901 Items
:= g_PlayerModel_GetNames();
1902 OnChange
:= ProcSelectModel
;
1904 with AddScroll(_lc
[I_MENU_PLAYER_RED
]) do
1906 Name
:= 'sc'+s
+'Red';
1908 OnChange
:= ProcChangeColor
;
1910 with AddScroll(_lc
[I_MENU_PLAYER_GREEN
]) do
1912 Name
:= 'sc'+s
+'Green';
1914 OnChange
:= ProcChangeColor
;
1916 with AddScroll(_lc
[I_MENU_PLAYER_BLUE
]) do
1918 Name
:= 'sc'+s
+'Blue';
1920 OnChange
:= ProcChangeColor
;
1923 AddButton(@ProcOptionsPlayersMIMenu
, _lc
[I_MENU_MODEL_INFO
]);
1924 AddButton(@ProcOptionsPlayersAnim
, _lc
[I_MENU_MODEL_ANIMATION
]);
1925 AddButton(@ProcOptionsPlayersWeap
, _lc
[I_MENU_MODEL_CHANGE_WEAPON
]);
1926 AddButton(@ProcOptionsPlayersRot
, _lc
[I_MENU_MODEL_ROTATE
]);
1928 with TGUIModelView(Menu
.AddChild(TGUIModelView
.Create
)) do
1930 Name
:= 'mv'+s
+'Model';
1931 X
:= GetControl('ls'+s
+'Model').X
+TGUIListBox(GetControl('ls'+s
+'Model')).GetWidth
+16;
1932 Y
:= GetControl('ls'+s
+'Model').Y
;
1935 Menu
.DefControl
:= 'mOptionsPlayers'+s
+'Menu';
1936 g_GUI_AddWindow(Menu
);
1939 procedure CreateAllMenus();
1943 a
, cx
, _y
, i
: Integer;
1946 Menu
:= TGUIWindow
.Create('MainMenu');
1947 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
1949 Name
:= 'mmMainMenu';
1950 AddButton(nil, _lc
[I_MENU_NEW_GAME
], 'NewGameMenu');
1951 AddButton(nil, _lc
[I_MENU_MULTIPLAYER
], 'NetGameMenu');
1952 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
1953 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
1954 AddButton(@ProcAuthorsMenu
, _lc
[I_MENU_AUTHORS
], 'AuthorsMenu');
1955 AddButton(nil, _lc
[I_MENU_EXIT
], 'ExitMenu');
1957 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(Format(_lc
[I_VERSION
], [GAME_VERSION
]), gMenuSmallFont
))) do
1959 Color
:= _RGB(255, 255, 255);
1960 X
:= gScreenWidth
-GetWidth
-8;
1961 Y
:= gScreenHeight
-GetHeight
-8;
1963 Menu
.DefControl
:= 'mmMainMenu';
1964 Menu
.MainWindow
:= True;
1965 g_GUI_AddWindow(Menu
);
1967 Menu
:= TGUIWindow
.Create('NewGameMenu');
1968 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_NEW_GAME
]))) do
1970 Name
:= 'mmNewGameMenu';
1971 AddButton(@ProcSingle1Player
, _lc
[I_MENU_1_PLAYER
]);
1972 AddButton(@ProcSingle2Players
, _lc
[I_MENU_2_PLAYERS
]);
1973 AddButton(nil, _lc
[I_MENU_CUSTOM_GAME
], 'CustomGameMenu');
1974 AddButton(@ProcSelectCampaignMenu
, _lc
[I_MENU_CAMPAIGN
], 'CampaignMenu');
1976 Menu
.DefControl
:= 'mmNewGameMenu';
1977 g_GUI_AddWindow(Menu
);
1979 Menu
:= TGUIWindow
.Create('NetGameMenu');
1980 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MULTIPLAYER
]))) do
1982 Name
:= 'mmNetGameMenu';
1983 AddButton(@ProcRecallAddress
, _lc
[I_MENU_START_CLIENT
], 'NetClientMenu');
1984 AddButton(nil, _lc
[I_MENU_START_SERVER
], 'NetServerMenu');
1986 Menu
.DefControl
:= 'mmNetGameMenu';
1987 g_GUI_AddWindow(Menu
);
1989 Menu
:= TGUIWindow
.Create('NetServerMenu');
1990 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_START_SERVER
]))) do
1992 Name
:= 'mNetServerMenu';
1993 with AddEdit(_lc
[I_NET_SERVER_NAME
]) do
1995 Name
:= 'edSrvName';
1996 OnlyDigits
:= False;
1999 Text := NetServerName
;
2001 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
2003 Name
:= 'edSrvPassword';
2004 OnlyDigits
:= False;
2007 Text := NetPassword
;
2009 with AddEdit(_lc
[I_NET_PORT
]) do
2015 Text := IntToStr(NetPort
);
2017 with AddEdit(_lc
[I_NET_MAX_CLIENTS
]) do
2019 Name
:= 'edMaxPlayers';
2023 Text := IntToStr(NetMaxClients
);
2025 with AddSwitch(_lc
[I_NET_USE_MASTER
]) do
2027 Name
:= 'swUseMaster';
2028 AddItem(_lc
[I_MENU_YES
]);
2029 AddItem(_lc
[I_MENU_NO
]);
2030 if NetUseMaster
then
2036 with AddLabel(_lc
[I_MENU_MAP
]) do
2041 OnClick
:= @ProcSelectMapMenu
;
2043 with AddSwitch(_lc
[I_MENU_GAME_TYPE
]) do
2045 Name
:= 'swGameMode';
2046 AddItem(_lc
[I_MENU_GAME_TYPE_DM
]);
2047 AddItem(_lc
[I_MENU_GAME_TYPE_TDM
]);
2048 AddItem(_lc
[I_MENU_GAME_TYPE_CTF
]);
2049 AddItem(_lc
[I_MENU_GAME_TYPE_COOP
]);
2050 case g_Game_TextToMode(gnGameMode
) of
2052 GM_DM
: ItemIndex
:= 0;
2053 GM_TDM
: ItemIndex
:= 1;
2054 GM_CTF
: ItemIndex
:= 2;
2056 GM_COOP
: ItemIndex
:= 3;
2058 OnChange
:= ProcSwitchMonstersNet
;
2060 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
2062 Name
:= 'edTimeLimit';
2066 if gnTimeLimit
> 0 then
2067 Text := IntToStr(gnTimeLimit
);
2069 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
2071 Name
:= 'edGoalLimit';
2075 if gnGoalLimit
> 0 then
2076 Text := IntToStr(gnGoalLimit
);
2078 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
2080 Name
:= 'edMaxLives';
2084 if gnMaxLives
> 0 then
2085 Text := IntToStr(gnMaxLives
);
2087 with AddSwitch(_lc
[I_MENU_SERVER_PLAYERS
]) do
2089 Name
:= 'swPlayers';
2090 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2091 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2092 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2093 ItemIndex
:= gnPlayers
;
2095 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
2097 Name
:= 'swTeamDamage';
2098 AddItem(_lc
[I_MENU_YES
]);
2099 AddItem(_lc
[I_MENU_NO
]);
2100 if gnTeamDamage
then
2105 with AddSwitch(_lc
[I_MENU_ENABLE_EXITS
]) do
2107 Name
:= 'swEnableExits';
2108 AddItem(_lc
[I_MENU_YES
]);
2109 AddItem(_lc
[I_MENU_NO
]);
2115 with AddSwitch(_lc
[I_MENU_WEAPONS_STAY
]) do
2117 Name
:= 'swWeaponStay';
2118 AddItem(_lc
[I_MENU_YES
]);
2119 AddItem(_lc
[I_MENU_NO
]);
2120 if gnWeaponStay
then
2125 with AddSwitch(_lc
[I_MENU_ENABLE_MONSTERS
]) do
2127 Name
:= 'swMonsters';
2128 AddItem(_lc
[I_MENU_YES
]);
2129 AddItem(_lc
[I_MENU_NO
]);
2135 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
2138 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
2139 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
2140 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
2142 if gnBotsVS
= 'Players' then
2144 if gnBotsVS
= 'Monsters' then
2148 AddButton(@ProcStartNetGame
, _lc
[I_MENU_START_GAME
]);
2152 Menu
.DefControl
:= 'mNetServerMenu';
2153 g_GUI_AddWindow(Menu
);
2155 Menu
:= TGUIWindow
.Create('NetClientMenu');
2156 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_START_CLIENT
]))) do
2158 Name
:= 'mNetClientMenu';
2160 AddButton(@ProcServerlist
, _lc
[I_NET_SLIST
]);
2163 with AddEdit(_lc
[I_NET_ADDRESS
]) do
2169 Text := 'localhost';
2171 with AddEdit(_lc
[I_NET_PORT
]) do
2179 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
2182 OnlyDigits
:= False;
2189 AddButton(@ProcConnectNetGame
, _lc
[I_MENU_CLIENT_CONNECT
]);
2193 Menu
.DefControl
:= 'mNetClientMenu';
2194 g_GUI_AddWindow(Menu
);
2196 Menu
:= TGUIWindow
.Create('LoadMenu');
2197 Menu
.OnShow
:= ProcLoadMenu
;
2198 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_LOAD_GAME
]))) do
2200 Name
:= 'mmLoadMenu';
2205 Name
:= 'edSlot'+IntToStr(a
);
2208 OnEnter
:= ProcLoadGame
;
2211 Menu
.DefControl
:= 'mmLoadMenu';
2212 g_GUI_AddWindow(Menu
);
2214 Menu
:= TGUIWindow
.Create('SaveMenu');
2215 Menu
.OnShow
:= ProcSaveMenu
;
2216 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SAVE_GAME
]))) do
2218 Name
:= 'mmSaveMenu';
2223 Name
:= 'edSlot'+IntToStr(a
);
2226 OnChange
:= ProcSaveGame
;
2229 Menu
.DefControl
:= 'mmSaveMenu';
2230 g_GUI_AddWindow(Menu
);
2232 Menu
:= TGUIWindow
.Create('CustomGameMenu');
2233 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CUSTOM_GAME
]))) do
2235 Name
:= 'mCustomGameMenu';
2236 with AddLabel(_lc
[I_MENU_MAP
]) do
2241 OnClick
:= @ProcSelectMapMenu
;
2243 with AddSwitch(_lc
[I_MENU_GAME_TYPE
]) do
2245 Name
:= 'swGameMode';
2246 AddItem(_lc
[I_MENU_GAME_TYPE_DM
]);
2247 AddItem(_lc
[I_MENU_GAME_TYPE_TDM
]);
2248 AddItem(_lc
[I_MENU_GAME_TYPE_CTF
]);
2249 AddItem(_lc
[I_MENU_GAME_TYPE_COOP
]);
2250 case g_Game_TextToMode(gcGameMode
) of
2252 GM_DM
: ItemIndex
:= 0;
2253 GM_TDM
: ItemIndex
:= 1;
2254 GM_CTF
: ItemIndex
:= 2;
2256 GM_COOP
: ItemIndex
:= 3;
2258 OnChange
:= ProcSwitchMonstersCustom
;
2260 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
2262 Name
:= 'edTimeLimit';
2266 if gcTimeLimit
> 0 then
2267 Text := IntToStr(gcTimeLimit
);
2269 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
2271 Name
:= 'edGoalLimit';
2275 if gcGoalLimit
> 0 then
2276 Text := IntToStr(gcGoalLimit
);
2278 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
2280 Name
:= 'edMaxLives';
2284 if gcMaxLives
> 0 then
2285 Text := IntToStr(gcMaxLives
);
2287 with AddSwitch(_lc
[I_MENU_PLAYERS
]) do
2289 Name
:= 'swPlayers';
2290 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2291 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2292 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2293 ItemIndex
:= gcPlayers
;
2295 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
2297 Name
:= 'swTeamDamage';
2298 AddItem(_lc
[I_MENU_YES
]);
2299 AddItem(_lc
[I_MENU_NO
]);
2300 if gcTeamDamage
then
2305 with AddSwitch(_lc
[I_MENU_ENABLE_EXITS
]) do
2307 Name
:= 'swEnableExits';
2308 AddItem(_lc
[I_MENU_YES
]);
2309 AddItem(_lc
[I_MENU_NO
]);
2315 with AddSwitch(_lc
[I_MENU_WEAPONS_STAY
]) do
2317 Name
:= 'swWeaponStay';
2318 AddItem(_lc
[I_MENU_YES
]);
2319 AddItem(_lc
[I_MENU_NO
]);
2320 if gcWeaponStay
then
2325 with AddSwitch(_lc
[I_MENU_ENABLE_MONSTERS
]) do
2327 Name
:= 'swMonsters';
2328 AddItem(_lc
[I_MENU_YES
]);
2329 AddItem(_lc
[I_MENU_NO
]);
2335 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
2338 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
2339 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
2340 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
2342 if gcBotsVS
= 'Players' then
2344 if gcBotsVS
= 'Monsters' then
2348 AddButton(@ProcStartCustomGame
, _lc
[I_MENU_START_GAME
]);
2352 Menu
.DefControl
:= 'mCustomGameMenu';
2353 g_GUI_AddWindow(Menu
);
2355 Menu
:= TGUIWindow
.Create('CampaignMenu');
2356 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CAMPAIGN
]))) do
2358 Name
:= 'mCampaignMenu';
2367 with AddFileList('', 15, 4) do
2370 OnChange
:= ProcSelectCampaignWAD
;
2374 FileMask
:= '*.wad|*.pk3|*.zip|*.dfz';
2375 SetBase(MapsDir
+'megawads/');
2378 with AddLabel(_lc
[I_MENU_MAP_NAME
]) do
2380 Name
:= 'lbWADName';
2384 with AddLabel(_lc
[I_MENU_MAP_AUTHOR
]) do
2386 Name
:= 'lbWADAuthor';
2390 AddLine(_lc
[I_MENU_MAP_DESCRIPTION
]);
2391 with AddMemo('', 15, 3) do
2393 Name
:= 'meWADDescription';
2394 Color
:= MENU_ITEMSCTRL_COLOR
;
2396 with AddSwitch(_lc
[I_MENU_PLAYERS
]) do
2398 Name
:= 'swPlayers';
2399 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2400 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2403 AddButton(@ProcStartCampaign
, _lc
[I_MENU_START_GAME
]);
2407 with TGUIImage(Menu
.AddChild(TGUIImage
.Create
)) do
2409 Name
:= 'mpWADImage';
2410 DefaultRes
:= 'NOPIC';
2411 X
:= GetControl('lsWAD').X
+4;
2412 Y
:= GetControl('lsWAD').Y
-128-MENU_VSPACE
;
2415 Menu
.DefControl
:= 'mCampaignMenu';
2416 g_GUI_AddWindow(Menu
);
2418 Menu
:= TGUIWindow
.Create('SelectMapMenu');
2419 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SELECT_MAP
]))) do
2421 Name
:= 'mSelectMapMenu';
2422 with AddFileList(_lc
[I_MENU_MAP_WAD
], 12, 4) do
2425 OnChange
:= ProcSelectWAD
;
2429 FileMask
:= '*.wad|*.pk3|*.zip|*.dfz';
2432 with AddList(_lc
[I_MENU_MAP_RESOURCE
], 12, 4) do
2436 OnChange
:= ProcSelectMap
;
2439 with AddLabel(_lc
[I_MENU_MAP_NAME
]) do
2441 Name
:= 'lbMapName';
2445 with AddLabel(_lc
[I_MENU_MAP_AUTHOR
]) do
2447 Name
:= 'lbMapAuthor';
2451 with AddLabel(_lc
[I_MENU_MAP_SIZE
]) do
2453 Name
:= 'lbMapSize';
2457 with AddMemo(_lc
[I_MENU_MAP_DESCRIPTION
], 12, 4) do
2459 Name
:= 'meMapDescription';
2464 with TGUIMapPreview(Menu
.AddChild(TGUIMapPreview
.Create
)) do
2466 Name
:= 'mpMapPreview';
2467 X
:= GetControl('lsMapWAD').X
+TGUIListBox(GetControl('lsMapWAD')).GetWidth()+2;
2468 Y
:= GetControl('lsMapWAD').Y
;
2470 with TGUILabel(Menu
.AddChild(TGUILabel
.Create('', gMenuSmallFont
))) do
2472 Name
:= 'lbMapScale';
2475 Color
:= MENU_ITEMSCTRL_COLOR
;
2476 X
:= GetControl('lsMapWAD').X
+
2477 TGUIListBox(GetControl('lsMapWAD')).GetWidth() +
2478 2 + MAPPREVIEW_WIDTH
*4;
2479 Y
:= GetControl('lsMapWAD').Y
+ MAPPREVIEW_HEIGHT
*16 + 16;
2482 Menu
.OnClose
:= ProcSetMap
;
2483 Menu
.DefControl
:= 'mSelectMapMenu';
2484 g_GUI_AddWindow(Menu
);
2486 Menu
:= TGUIWindow
.Create('OptionsMenu');
2487 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_OPTIONS
]))) do
2489 Name
:= 'mmOptionsMenu';
2490 AddButton(nil, _lc
[I_MENU_VIDEO_OPTIONS
], 'OptionsVideoMenu');
2491 AddButton(nil, _lc
[I_MENU_SOUND_OPTIONS
], 'OptionsSoundMenu');
2492 AddButton(nil, _lc
[I_MENU_GAME_OPTIONS
], 'OptionsGameMenu');
2493 AddButton(nil, _lc
[I_MENU_CONTROLS_OPTIONS
], 'OptionsControlsMenu');
2494 AddButton(nil, _lc
[I_MENU_PLAYER_OPTIONS
], 'OptionsPlayersMenu');
2495 AddButton(nil, _lc
[I_MENU_LANGUAGE_OPTIONS
], 'OptionsLanguageMenu');
2497 AddButton(nil, _lc
[I_MENU_SAVED_OPTIONS
], 'SavedOptionsMenu').Color
:= _RGB(255, 0, 0);
2498 AddButton(nil, _lc
[I_MENU_DEFAULT_OPTIONS
], 'DefaultOptionsMenu').Color
:= _RGB(255, 0, 0);
2500 Menu
.OnClose
:= ProcApplyOptions
;
2501 Menu
.DefControl
:= 'mmOptionsMenu';
2502 g_GUI_AddWindow(Menu
);
2504 Menu
:= CreateYNMenu('SavedOptionsMenu', _lc
[I_MENU_LOAD_SAVED_PROMT
], Round(gScreenWidth
*0.6),
2505 gMenuSmallFont
, @ProcSavedMenuKeyDown
);
2506 g_GUI_AddWindow(Menu
);
2508 Menu
:= TGUIWindow
.Create('OptionsVideoMenu');
2509 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_VIDEO_OPTIONS
]))) do
2511 Name
:= 'mOptionsVideoMenu';
2512 AddButton(@ProcVideoOptionsRes
, _lc
[I_MENU_VIDEO_RESOLUTION
], 'OptionsVideoResMenu');
2513 with AddSwitch(_lc
[I_MENU_VIDEO_BPP
]) do
2519 with AddSwitch(_lc
[I_MENU_VIDEO_VSYNC
]) do
2522 AddItem(_lc
[I_MENU_YES
]);
2523 AddItem(_lc
[I_MENU_NO
]);
2525 with AddSwitch(_lc
[I_MENU_VIDEO_FILTER_SKY
]) do
2527 Name
:= 'swTextureFilter';
2528 AddItem(_lc
[I_MENU_YES
]);
2529 AddItem(_lc
[I_MENU_NO
]);
2531 with AddSwitch(_lc
[I_MENU_VIDEO_LEGACY_COMPATIBLE
]) do
2533 Name
:= 'swLegacyNPOT';
2534 AddItem(_lc
[I_MENU_NO
]);
2535 AddItem(_lc
[I_MENU_YES
]);
2538 AddText(_lc
[I_MENU_VIDEO_NEED_RESTART
], Round(gScreenWidth
*0.6));
2541 Menu
.DefControl
:= 'mOptionsVideoMenu';
2542 g_GUI_AddWindow(Menu
);
2544 Menu
:= TGUIWindow
.Create('OptionsVideoResMenu');
2545 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_RESOLUTION_SELECT
]))) do
2547 Name
:= 'mOptionsVideoResMenu';
2548 with AddLabel(_lc
[I_MENU_RESOLUTION_CURRENT
]) do
2550 Name
:= 'lbCurrentRes';
2554 with AddList(_lc
[I_MENU_RESOLUTION_LIST
], 12, 6) do
2556 Name
:= 'lsResolution';
2559 with AddSwitch(_lc
[I_MENU_RESOLUTION_FULLSCREEN
]) do
2561 Name
:= 'swFullScreen';
2562 AddItem(_lc
[I_MENU_YES
]);
2563 AddItem(_lc
[I_MENU_NO
]);
2566 AddButton(@ProcApplyVideoOptions
, _lc
[I_MENU_RESOLUTION_APPLY
]);
2569 Menu
.DefControl
:= 'mOptionsVideoResMenu';
2570 g_GUI_AddWindow(Menu
);
2572 Menu
:= TGUIWindow
.Create('OptionsSoundMenu');
2573 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SOUND_OPTIONS
]))) do
2575 Name
:= 'mOptionsSoundMenu';
2576 with AddScroll(_lc
[I_MENU_SOUND_MUSIC_LEVEL
]) do
2578 Name
:= 'scMusicLevel';
2580 OnChange
:= ProcChangeSoundSettings
;
2582 with AddScroll(_lc
[I_MENU_SOUND_SOUND_LEVEL
]) do
2584 Name
:= 'scSoundLevel';
2586 OnChange
:= ProcChangeSoundSettings
;
2588 with AddScroll(_lc
[I_MENU_SOUND_MAX_SIM_SOUNDS
]) do
2590 Name
:= 'scMaxSimSounds';
2593 with AddSwitch (_lc
[I_MENU_SOUND_ANNOUNCE
]) do
2595 Name
:= 'swAnnouncer';
2596 AddItem(_lc
[I_MENU_ANNOUNCE_NONE
]);
2597 AddItem(_lc
[I_MENU_ANNOUNCE_ME
]);
2598 AddItem(_lc
[I_MENU_ANNOUNCE_MEPLUS
]);
2599 AddItem(_lc
[I_MENU_ANNOUNCE_ALL
]);
2601 // Ïåðåêëþ÷àòåëü çâóêîâûõ ýôôåêòîâ (DF / Doom 2)
2602 with AddSwitch (_lc
[I_MENU_SOUND_COMPAT
]) do
2604 Name
:= 'swSoundEffects';
2605 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2606 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2608 // Ïåðåêëþ÷àòåëü çâóêîâ ÷àòà
2609 with AddSwitch (_lc
[I_MENU_SOUND_CHAT
]) do
2611 Name
:= 'swChatSpeech';
2612 AddItem(_lc
[I_MENU_YES
]);
2613 AddItem(_lc
[I_MENU_NO
]);
2615 with AddSwitch(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS
]) do
2617 Name
:= 'swInactiveSounds';
2618 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_ON
]);
2619 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_OFF
]);
2623 Menu
.DefControl
:= 'mOptionsSoundMenu';
2624 g_GUI_AddWindow(Menu
);
2626 Menu
:= TGUIWindow
.Create('OptionsGameMenu');
2627 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_GAME_OPTIONS
]))) do
2629 Name
:= 'mOptionsGameMenu';
2630 with AddScroll(_lc
[I_MENU_GAME_PARTICLES_COUNT
]) do
2632 Name
:= 'scParticlesCount';
2635 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_COUNT
]) do
2637 Name
:= 'swBloodCount';
2638 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2639 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2640 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2641 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2642 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2644 with AddScroll(_lc
[I_MENU_GAME_MAX_SHELLS
]) do
2646 Name
:= 'scShellsMax';
2649 with AddScroll(_lc
[I_MENU_GAME_GIBS_COUNT
]) do
2651 Name
:= 'scGibsMax';
2654 with AddScroll(_lc
[I_MENU_GAME_MAX_CORPSES
]) do
2656 Name
:= 'scCorpsesMax';
2659 with AddSwitch(_lc
[I_MENU_GAME_MAX_GIBS
]) do
2661 Name
:= 'swGibsCount';
2662 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2663 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2664 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2665 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2666 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2668 with AddSwitch(_lc
[I_MENU_GAME_CORPSE_TYPE
]) do
2670 Name
:= 'swCorpseType';
2671 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_SIMPLE
]);
2672 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_ADV
]);
2674 with AddSwitch(_lc
[I_MENU_GAME_GIBS_TYPE
]) do
2676 Name
:= 'swGibsType';
2677 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_SIMPLE
]);
2678 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_ADV
]);
2680 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_TYPE
]) do
2682 Name
:= 'swBloodType';
2683 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_SIMPLE
]);
2684 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_ADV
]);
2686 with AddSwitch(_lc
[I_MENU_GAME_SCREEN_FLASH
]) do
2688 Name
:= 'swScreenFlash';
2689 AddItem(_lc
[I_MENU_NO
]);
2690 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2691 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2693 with AddSwitch(_lc
[I_MENU_GAME_BACKGROUND
]) do
2695 Name
:= 'swBackground';
2696 AddItem(_lc
[I_MENU_YES
]);
2697 AddItem(_lc
[I_MENU_NO
]);
2699 with AddSwitch(_lc
[I_MENU_GAME_MESSAGES
]) do
2701 Name
:= 'swMessages';
2702 AddItem(_lc
[I_MENU_YES
]);
2703 AddItem(_lc
[I_MENU_NO
]);
2705 with AddSwitch(_lc
[I_MENU_GAME_REVERT_PLAYERS
]) do
2707 Name
:= 'swRevertPlayers';
2708 AddItem(_lc
[I_MENU_YES
]);
2709 AddItem(_lc
[I_MENU_NO
]);
2711 with AddSwitch(_lc
[I_MENU_GAME_CHAT_BUBBLE
]) do
2713 Name
:= 'swChatBubble';
2714 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_NONE
]);
2715 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_SIMPLE
]);
2716 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_ADV
]);
2717 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_COLOR
]);
2718 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_TEXTURE
]);
2720 with AddSwitch(_lc
[I_MENU_GAME_PLAYER_INDICATOR
]) do
2722 Name
:= 'swPlayerIndicator';
2723 AddItem(_lc
[I_MENU_YES
]);
2724 AddItem(_lc
[I_MENU_NO
]);
2726 with AddScroll(_lc
[I_MENU_GAME_SCALE_FACTOR
]) do
2728 Name
:= 'scScaleFactor';
2730 OnChange
:= ProcChangeGameSettings
;
2734 Menu
.DefControl
:= 'mOptionsGameMenu';
2735 g_GUI_AddWindow(Menu
);
2737 Menu
:= TGUIWindow
.Create('OptionsControlsMenu');
2738 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROLS_OPTIONS
]))) do
2740 Name
:= 'mOptionsControlsMenu';
2741 AddLine(_lc
[I_MENU_CONTROL_GLOBAL
]);
2742 AddKeyRead(_lc
[I_MENU_CONTROL_SCREENSHOT
]).Name
:= _lc
[I_MENU_CONTROL_SCREENSHOT
];
2743 AddKeyRead(_lc
[I_MENU_CONTROL_STAT
]).Name
:= _lc
[I_MENU_CONTROL_STAT
];
2744 AddKeyRead(_lc
[I_MENU_CONTROL_CHAT
]).Name
:= _lc
[I_MENU_CONTROL_CHAT
];
2745 AddKeyRead(_lc
[I_MENU_CONTROL_TEAMCHAT
]).Name
:= _lc
[I_MENU_CONTROL_TEAMCHAT
];
2747 AddButton(nil, _lc
[I_MENU_PLAYER_1_KBD
], 'OptionsControlsP1Menu');
2748 {AddButton(nil, _lc[I_MENU_PLAYER_1_ALT], 'OptionsControlsP1MenuAlt');}
2749 AddButton(nil, _lc
[I_MENU_PLAYER_1_WEAPONS
], 'OptionsControlsP1MenuWeapons');
2750 AddButton(nil, _lc
[I_MENU_PLAYER_2_KBD
], 'OptionsControlsP2Menu');
2751 {AddButton(nil, _lc[I_MENU_PLAYER_2_ALT], 'OptionsControlsP2MenuAlt');}
2752 AddButton(nil, _lc
[I_MENU_PLAYER_2_WEAPONS
], 'OptionsControlsP2MenuWeapons');
2753 if e_JoysticksAvailable
<> 0 then
2756 AddButton(nil, _lc
[I_MENU_CONTROL_JOYSTICKS
], 'OptionsControlsJoystickMenu');
2758 if g_touch_enabled
then
2761 AddButton(nil, _lc
[I_MENU_CONTROL_TOUCH
], 'OptionsControlsTouchMenu');
2764 Menu
.DefControl
:= 'mOptionsControlsMenu';
2765 g_GUI_AddWindow(Menu
);
2767 Menu
:= TGUIWindow
.Create('OptionsControlsP1Menu');
2768 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_1_KBD
]))) do
2770 Name
:= 'mOptionsControlsP1Menu';
2771 AddKeyRead2(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
2772 AddKeyRead2(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
2773 AddKeyRead2(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
2774 AddKeyRead2(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
2775 AddKeyRead2(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
2776 AddKeyRead2(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
2777 AddKeyRead2(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
2778 AddKeyRead2(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
2779 AddKeyRead2(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
2780 AddKeyRead2(_lc
[I_MENU_CONTROL_STRAFE
]).Name
:= _lc
[I_MENU_CONTROL_STRAFE
];
2782 Menu
.DefControl
:= 'mOptionsControlsP1Menu';
2783 g_GUI_AddWindow(Menu
);
2785 Menu
:= TGUIWindow
.Create('OptionsControlsP1MenuWeapons');
2786 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_1_WEAPONS
]))) do
2788 Name
:= 'mOptionsControlsP1MenuWeapons';
2789 for i
:= WP_FIRST
to WP_LAST
do
2790 AddKeyRead2(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)]).Name
:=
2791 _lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)];
2793 Menu
.DefControl
:= 'mOptionsControlsP1MenuWeapons';
2794 g_GUI_AddWindow(Menu
);
2796 Menu
:= TGUIWindow
.Create('OptionsControlsP2Menu');
2797 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_2_KBD
]))) do
2799 Name
:= 'mOptionsControlsP2Menu';
2800 AddKeyRead2(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
2801 AddKeyRead2(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
2802 AddKeyRead2(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
2803 AddKeyRead2(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
2804 AddKeyRead2(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
2805 AddKeyRead2(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
2806 AddKeyRead2(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
2807 AddKeyRead2(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
2808 AddKeyRead2(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
2809 AddKeyRead2(_lc
[I_MENU_CONTROL_STRAFE
]).Name
:= _lc
[I_MENU_CONTROL_STRAFE
];
2811 Menu
.DefControl
:= 'mOptionsControlsP2Menu';
2812 g_GUI_AddWindow(Menu
);
2814 Menu
:= TGUIWindow
.Create('OptionsControlsP2MenuWeapons');
2815 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_2_WEAPONS
]))) do
2817 Name
:= 'mOptionsControlsP2MenuWeapons';
2818 for i
:= WP_FIRST
to WP_LAST
do
2819 AddKeyRead2(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)]).Name
:=
2820 _lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)];
2822 Menu
.DefControl
:= 'mOptionsControlsP2MenuWeapons';
2823 g_GUI_AddWindow(Menu
);
2825 Menu
:= TGUIWindow
.Create('OptionsControlsJoystickMenu');
2826 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROL_JOYSTICKS
]))) do
2828 Name
:= 'mOptionsControlsJoystickMenu';
2829 for i
:= 0 to e_JoysticksAvailable
-1 do
2830 with AddScroll(Format(_lc
[I_MENU_CONTROL_DEADZONE
], [i
+ 1])) do
2832 Name
:= 'scDeadzone' + IntToStr(i
);
2836 Menu
.DefControl
:= 'mOptionsControlsJoystickMenu';
2837 g_GUI_AddWindow(Menu
);
2839 Menu
:= TGUIWindow
.Create('OptionsControlsTouchMenu');
2840 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROL_TOUCH
]))) do
2842 Name
:= 'mOptionsControlsTouchMenu';
2843 with AddSwitch(_lc
[I_MENU_CONTROL_TOUCH_ALT
]) do
2845 Name
:= 'swTouchAlt';
2846 AddItem(_lc
[I_MENU_NO
]);
2847 AddItem(_lc
[I_MENU_YES
]);
2848 OnChange
:= ProcChangeTouchSettings
;
2850 with AddScroll(_lc
[I_MENU_CONTROL_TOUCH_SIZE
]) do
2852 Name
:= 'scTouchSize';
2854 OnChange
:= ProcChangeTouchSettings
;
2856 with AddSwitch(_lc
[I_MENU_CONTROL_TOUCH_FIRE
]) do
2858 Name
:= 'swTouchFire';
2859 AddItem(_lc
[I_MENU_NO
]);
2860 AddItem(_lc
[I_MENU_YES
]);
2862 with AddScroll(_lc
[I_MENU_CONTROL_TOUCH_OFFSET
]) do
2864 Name
:= 'scTouchOffset';
2866 OnChange
:= ProcChangeTouchSettings
;
2869 Menu
.DefControl
:= 'mOptionsControlsTouchMenu';
2870 g_GUI_AddWindow(Menu
);
2872 Menu
:= TGUIWindow
.Create('OptionsPlayersMenu');
2873 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_OPTIONS
]))) do
2875 Name
:= 'mOptionsPlayersMenu';
2876 AddButton(nil, _lc
[I_MENU_PLAYER_1
], 'OptionsPlayersP1Menu');
2877 AddButton(nil, _lc
[I_MENU_PLAYER_2
], 'OptionsPlayersP2Menu');
2879 Menu
.DefControl
:= 'mOptionsPlayersMenu';
2880 g_GUI_AddWindow(Menu
);
2882 CreatePlayerOptionsMenu('P1');
2883 CreatePlayerOptionsMenu('P2');
2885 Menu
:= TGUIWindow
.Create('OptionsPlayersMIMenu');
2886 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_MODEL_INFO
]))) do
2888 Name
:= 'mOptionsPlayersMIMenu';
2889 with AddLabel(_lc
[I_MENU_MODEL_NAME
]) do
2894 with AddLabel(_lc
[I_MENU_MODEL_AUTHOR
]) do
2899 with AddMemo(_lc
[I_MENU_MODEL_COMMENT
], 14, 6) do
2901 Name
:= 'meComment';
2904 AddLine(_lc
[I_MENU_MODEL_OPTIONS
]);
2905 with AddLabel(_lc
[I_MENU_MODEL_WEAPON
]) do
2908 FixedLength
:= Max(Length(_lc
[I_MENU_YES
]), Length(_lc
[I_MENU_NO
]));
2912 Menu
.DefControl
:= 'mOptionsPlayersMIMenu';
2913 g_GUI_AddWindow(Menu
);
2915 Menu
:= TGUIWindow
.Create('OptionsLanguageMenu');
2916 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_LANGUAGE_OPTIONS
]))) do
2918 Name
:= 'mOptionsLanguageMenu';
2919 AddButton(@ProcSetRussianLanguage
, _lc
[I_MENU_LANGUAGE_RUSSIAN
]);
2920 AddButton(@ProcSetEnglishLanguage
, _lc
[I_MENU_LANGUAGE_ENGLISH
]);
2923 Menu
.DefControl
:= 'mOptionsLanguageMenu';
2924 g_GUI_AddWindow(Menu
);
2926 Menu
:= CreateYNMenu('DefaultOptionsMenu', _lc
[I_MENU_SET_DEFAULT_PROMT
], Round(gScreenWidth
*0.6),
2927 gMenuSmallFont
, @ProcDefaultMenuKeyDown
);
2928 g_GUI_AddWindow(Menu
);
2930 Menu
:= TGUIWindow
.Create('AuthorsMenu');
2931 Menu
.BackTexture
:= 'INTER';
2932 Menu
.OnClose
:= ProcAuthorsClose
;
2936 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_1
], gMenuFont
))) do
2938 Color
:= _RGB(255, 0, 0);
2939 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
2941 _y
:= _y
+GetHeight();
2943 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(Format(_lc
[I_CREDITS_CAP_2
], [GAME_VERSION
, NET_PROTOCOL_VER
]), gMenuSmallFont
))) do
2945 Color
:= _RGB(255, 0, 0);
2946 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
2948 _y
:= _y
+GetHeight()+32;
2950 // ×òî äåëàë: Êòî äåëàë
2951 cx
:= gScreenWidth
div 2 - 320 + 64;
2952 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1
], gMenuSmallFont
))) do
2954 Color
:= _RGB(255, 0, 0);
2959 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1_1
], gMenuSmallFont
))) do
2961 Color
:= _RGB(255, 255, 255);
2966 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2
], gMenuSmallFont
))) do
2968 Color
:= _RGB(255, 0, 0);
2973 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2_1
], gMenuSmallFont
))) do
2975 Color
:= _RGB(255, 255, 255);
2980 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2_2
], gMenuSmallFont
))) do
2982 Color
:= _RGB(255, 255, 255);
2987 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3
], gMenuSmallFont
))) do
2989 Color
:= _RGB(255, 0, 0);
2994 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3_1
], gMenuSmallFont
))) do
2996 Color
:= _RGB(255, 255, 255);
3001 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4
], gMenuSmallFont
))) do
3003 Color
:= _RGB(255, 0, 0);
3008 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4_1
], gMenuSmallFont
))) do
3010 Color
:= _RGB(255, 255, 255);
3013 _y
:= gScreenHeight
- 128;
3016 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_3
], gMenuSmallFont
))) do
3018 Color
:= _RGB(255, 0, 0);
3023 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_1
], gMenuSmallFont
))) do
3025 Color
:= _RGB(255, 255, 255);
3028 _y
:= _y
+GetHeight();
3030 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_2
], gMenuSmallFont
))) do
3032 Color
:= _RGB(255, 255, 255);
3035 _y
:= _y
+GetHeight();
3037 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_3
], gMenuSmallFont
))) do
3039 Color
:= _RGB(255, 255, 255);
3042 _y
:= gScreenHeight
- 32;
3044 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_4
], gMenuSmallFont
))) do
3046 Color
:= _RGB(255, 0, 0);
3047 X
:= gScreenWidth
div 2 - GetWidth() div 2;
3050 g_GUI_AddWindow(Menu
);
3052 Menu
:= CreateYNMenu('ExitMenu', _lc
[I_MENU_EXIT_PROMT
], Round(gScreenWidth
*0.6),
3053 gMenuSmallFont
, @ProcExitMenuKeyDown
);
3054 g_GUI_AddWindow(Menu
);
3056 Menu
:= TGUIWindow
.Create('GameSingleMenu');
3057 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
3059 Name
:= 'mmGameSingleMenu';
3060 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
3061 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
3062 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
3063 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3064 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
3065 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3067 Menu
.DefControl
:= 'mmGameSingleMenu';
3068 Menu
.MainWindow
:= True;
3069 Menu
.OnClose
:= ProcGMClose
;
3070 Menu
.OnShow
:= ProcGMShow
;
3071 g_GUI_AddWindow(Menu
);
3073 Menu
:= CreateYNMenu('EndGameMenu', _lc
[I_MENU_END_GAME_PROMT
], Round(gScreenWidth
*0.6),
3074 gMenuSmallFont
, @ProcEndMenuKeyDown
);
3075 g_GUI_AddWindow(Menu
);
3077 Menu
:= CreateYNMenu('RestartGameMenu', _lc
[I_MENU_RESTART_GAME_PROMT
], Round(gScreenWidth
*0.6),
3078 gMenuSmallFont
, @ProcRestartMenuKeyDown
);
3079 g_GUI_AddWindow(Menu
);
3081 Menu
:= TGUIWindow
.Create('GameCustomMenu');
3082 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
3084 Name
:= 'mmGameCustomMenu';
3085 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
3086 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
3087 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
3088 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
3089 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3090 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
3091 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3093 Menu
.DefControl
:= 'mmGameCustomMenu';
3094 Menu
.MainWindow
:= True;
3095 Menu
.OnClose
:= ProcGMClose
;
3096 Menu
.OnShow
:= ProcGMShow
;
3097 g_GUI_AddWindow(Menu
);
3099 Menu
:= TGUIWindow
.Create('GameServerMenu');
3100 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
3102 Name
:= 'mmGameServerMenu';
3103 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
3104 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
3105 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3106 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
3107 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3109 Menu
.DefControl
:= 'mmGameServerMenu';
3110 Menu
.MainWindow
:= True;
3111 Menu
.OnClose
:= ProcGMClose
;
3112 Menu
.OnShow
:= ProcGMShow
;
3113 g_GUI_AddWindow(Menu
);
3115 Menu
:= TGUIWindow
.Create('GameClientMenu');
3116 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
3118 Name
:= 'mmGameClientMenu';
3119 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
3120 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3121 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3123 Menu
.DefControl
:= 'mmGameClientMenu';
3124 Menu
.MainWindow
:= True;
3125 Menu
.OnClose
:= ProcGMClose
;
3126 Menu
.OnShow
:= ProcGMShow
;
3127 g_GUI_AddWindow(Menu
);
3129 Menu
:= TGUIWindow
.Create('ClientPasswordMenu');
3130 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuSmallFont
, gMenuSmallFont
, _lc
[I_MENU_ENTERPASSWORD
]))) do
3132 Name
:= 'mClientPasswordMenu';
3133 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
3141 AddButton(@ProcEnterPassword
, _lc
[I_MENU_START_GAME
]);
3144 Menu
.DefControl
:= 'mClientPasswordMenu';
3145 g_GUI_AddWindow(Menu
);
3147 Menu
:= TGUIWindow
.Create('GameSetGameMenu');
3148 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SET_GAME
]))) do
3150 Name
:= 'mGameSetGameMenu';
3151 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
3153 Name
:= 'swTeamDamage';
3154 AddItem(_lc
[I_MENU_YES
]);
3155 AddItem(_lc
[I_MENU_NO
]);
3158 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
3160 Name
:= 'edTimeLimit';
3165 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
3167 Name
:= 'edGoalLimit';
3172 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
3174 Name
:= 'edMaxLives';
3179 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
3182 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
3183 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
3184 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
3190 Menu
.DefControl
:= 'mGameSetGameMenu';
3191 Menu
.OnClose
:= ProcApplyGameSet
;
3192 g_GUI_AddWindow(Menu
);
3194 Menu
:= TGUIWindow
.Create('TeamMenu');
3195 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_CHANGE_PLAYERS
]))) do
3197 Name
:= 'mmTeamMenu';
3198 AddButton(@ProcJoinRed
, _lc
[I_MENU_JOIN_RED
], '').Name
:= 'tmJoinRed';
3199 AddButton(@ProcJoinBlue
, _lc
[I_MENU_JOIN_BLUE
], '').Name
:= 'tmJoinBlue';
3200 AddButton(@ProcJoinGame
, _lc
[I_MENU_JOIN_GAME
], '').Name
:= 'tmJoinGame';
3201 AddButton(@ProcSwitchP2
, _lc
[I_MENU_ADD_PLAYER_2
], '').Name
:= 'tmPlayer2';
3202 AddButton(@ProcSpectate
, _lc
[I_MENU_SPECTATE
], '').Name
:= 'tmSpectate';
3204 Menu
.DefControl
:= 'mmTeamMenu';
3205 Menu
.OnShow
:= ProcChangePlayers
;
3206 g_GUI_AddWindow(Menu
);
3209 procedure g_Menu_Show_SaveMenu();
3211 if g_Game_IsTestMap
then
3213 if gGameSettings
.GameType
= GT_SINGLE
then
3214 g_GUI_ShowWindow('GameSingleMenu')
3217 if g_Game_IsClient
then
3220 if g_Game_IsNet
then
3223 g_GUI_ShowWindow('GameCustomMenu');
3225 g_GUI_ShowWindow('SaveMenu');
3226 g_Sound_PlayEx('MENU_OPEN');
3229 procedure g_Menu_Show_LoadMenu (standalone
: Boolean=false);
3231 if (g_ActiveWindow
<> nil) and (g_ActiveWindow
.name
= 'LoadMenu') then exit
; // nothing to do
3232 if gGameSettings
.GameType
= GT_SINGLE
then
3234 if not standalone
then g_GUI_ShowWindow('GameSingleMenu')
3238 if g_Game_IsClient
then exit
;
3239 if g_Game_IsNet
then exit
;
3240 if not standalone
then g_GUI_ShowWindow('GameCustomMenu');
3242 g_GUI_ShowWindow('LoadMenu');
3243 g_Sound_PlayEx('MENU_OPEN');
3246 procedure g_Menu_Show_GameSetGame();
3248 if gGameSettings
.GameType
= GT_SINGLE
then
3249 g_GUI_ShowWindow('GameSingleMenu')
3252 if g_Game_IsClient
then
3255 if g_Game_IsNet
then
3256 g_GUI_ShowWindow('GameServerMenu')
3258 g_GUI_ShowWindow('GameCustomMenu');
3261 g_GUI_ShowWindow('GameSetGameMenu');
3262 g_Sound_PlayEx('MENU_OPEN');
3265 procedure g_Menu_Show_OptionsVideo();
3267 if gGameSettings
.GameType
= GT_SINGLE
then
3268 g_GUI_ShowWindow('GameSingleMenu')
3271 if g_Game_IsClient
then
3272 g_GUI_ShowWindow('GameClientMenu')
3274 if g_Game_IsNet
then
3275 g_GUI_ShowWindow('GameServerMenu')
3277 g_GUI_ShowWindow('GameCustomMenu');
3280 g_GUI_ShowWindow('OptionsMenu');
3281 g_GUI_ShowWindow('OptionsVideoMenu');
3282 g_Sound_PlayEx('MENU_OPEN');
3285 procedure g_Menu_Show_OptionsSound();
3287 if gGameSettings
.GameType
= GT_SINGLE
then
3288 g_GUI_ShowWindow('GameSingleMenu')
3291 if g_Game_IsClient
then
3292 g_GUI_ShowWindow('GameClientMenu')
3294 if g_Game_IsNet
then
3295 g_GUI_ShowWindow('GameServerMenu')
3297 g_GUI_ShowWindow('GameCustomMenu');
3300 g_GUI_ShowWindow('OptionsMenu');
3301 g_GUI_ShowWindow('OptionsSoundMenu');
3302 g_Sound_PlayEx('MENU_OPEN');
3305 procedure g_Menu_Show_EndGameMenu();
3307 g_GUI_ShowWindow('EndGameMenu');
3308 g_Sound_PlayEx('MENU_OPEN');
3311 procedure g_Menu_Show_QuitGameMenu();
3313 g_GUI_ShowWindow('ExitMenu');
3314 g_Sound_PlayEx('MENU_OPEN');
3317 procedure g_Menu_Init();
3324 procedure g_Menu_Free();
3328 e_WriteLog('Releasing menu data...', TMsgType
.Notify
);
3333 procedure g_Menu_Reset();
3337 g_GUI_SaveMenuPos();
3338 ex
:= g_GUI_Destroy();
3342 e_WriteLog('Recreating menu...', TMsgType
.Notify
);
3347 g_Game_SetDebugMode();
3349 g_GUI_LoadMenuPos();