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', 0), 0), 255);
955 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
956 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
958 if g_Texture_Get('FONT_STD', ID
) then
959 e_TextureFontBuild(ID
, FontID
, cwdt
, chgt
, spc
);
964 if cfglen
<> 0 then FreeMem(cfgdata
);
967 procedure LoadFont(txtres
, fntres
: string; var FontID
: DWORD
);
973 cfgdata
, fntdata
: Pointer;
974 cfglen
, fntlen
: Integer;
982 wad
:= TWADFile
.Create
;
983 if wad
.ReadFile(GameWAD
) then
985 wad
.GetResource('FONTS/'+txtres
, cfgdata
, cfglen
);
986 wad
.GetResource('FONTS/'+fntres
, fntdata
, fntlen
);
992 config
:= TConfig
.CreateMem(cfgdata
, cfglen
);
993 cwdt
:= Min(Max(config
.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
994 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
996 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
997 FontID
:= e_CharFont_Create(spc
);
1001 chrwidth
:= config
.ReadInt(IntToStr(a
), 'Width', 0);
1002 if chrwidth
= 0 then Continue
;
1004 if e_CreateTextureMemEx(fntdata
, fntlen
, CharID
, cwdt
*(a
mod 16), chgt
*(a
div 16),
1006 e_CharFont_AddChar(FontID
, CharID
, Chr(a
), chrwidth
);
1012 if cfglen
<> 0 then FreeMem(cfgdata
);
1013 if fntlen
<> 0 then FreeMem(fntdata
);
1016 procedure MenuLoadData();
1018 e_WriteLog('Loading menu data...', TMsgType
.Notify
);
1020 g_Texture_CreateWADEx('MAINMENU_MARKER1', GameWAD
+':TEXTURES\MARKER1');
1021 g_Texture_CreateWADEx('MAINMENU_MARKER2', GameWAD
+':TEXTURES\MARKER2');
1022 g_Texture_CreateWADEx('SCROLL_LEFT', GameWAD
+':TEXTURES\SLEFT');
1023 g_Texture_CreateWADEx('SCROLL_RIGHT', GameWAD
+':TEXTURES\SRIGHT');
1024 g_Texture_CreateWADEx('SCROLL_MIDDLE', GameWAD
+':TEXTURES\SMIDDLE');
1025 g_Texture_CreateWADEx('SCROLL_MARKER', GameWAD
+':TEXTURES\SMARKER');
1026 g_Texture_CreateWADEx('EDIT_LEFT', GameWAD
+':TEXTURES\ELEFT');
1027 g_Texture_CreateWADEx('EDIT_RIGHT', GameWAD
+':TEXTURES\ERIGHT');
1028 g_Texture_CreateWADEx('EDIT_MIDDLE', GameWAD
+':TEXTURES\EMIDDLE');
1029 g_Texture_CreateWADEx('BOX1', GameWAD
+':TEXTURES\BOX1');
1030 g_Texture_CreateWADEx('BOX2', GameWAD
+':TEXTURES\BOX2');
1031 g_Texture_CreateWADEx('BOX3', GameWAD
+':TEXTURES\BOX3');
1032 g_Texture_CreateWADEx('BOX4', GameWAD
+':TEXTURES\BOX4');
1033 g_Texture_CreateWADEx('BOX5', GameWAD
+':TEXTURES\BOX5');
1034 g_Texture_CreateWADEx('BOX6', GameWAD
+':TEXTURES\BOX6');
1035 g_Texture_CreateWADEx('BOX7', GameWAD
+':TEXTURES\BOX7');
1036 g_Texture_CreateWADEx('BOX8', GameWAD
+':TEXTURES\BOX8');
1037 g_Texture_CreateWADEx('BOX9', GameWAD
+':TEXTURES\BOX9');
1038 g_Texture_CreateWADEx('BSCROLL_UP_A', GameWAD
+':TEXTURES\SCROLLUPA');
1039 g_Texture_CreateWADEx('BSCROLL_UP_U', GameWAD
+':TEXTURES\SCROLLUPU');
1040 g_Texture_CreateWADEx('BSCROLL_DOWN_A', GameWAD
+':TEXTURES\SCROLLDOWNA');
1041 g_Texture_CreateWADEx('BSCROLL_DOWN_U', GameWAD
+':TEXTURES\SCROLLDOWNU');
1042 g_Texture_CreateWADEx('BSCROLL_MIDDLE', GameWAD
+':TEXTURES\SCROLLMIDDLE');
1043 g_Texture_CreateWADEx('NOPIC', GameWAD
+':TEXTURES\NOPIC');
1045 g_Sound_CreateWADEx('MENU_SELECT', GameWAD
+':SOUNDS\MENUSELECT');
1046 g_Sound_CreateWADEx('MENU_OPEN', GameWAD
+':SOUNDS\MENUOPEN');
1047 g_Sound_CreateWADEx('MENU_CLOSE', GameWAD
+':SOUNDS\MENUCLOSE');
1048 g_Sound_CreateWADEx('MENU_CHANGE', GameWAD
+':SOUNDS\MENUCHANGE');
1049 g_Sound_CreateWADEx('SCROLL_ADD', GameWAD
+':SOUNDS\SCROLLADD');
1050 g_Sound_CreateWADEx('SCROLL_SUB', GameWAD
+':SOUNDS\SCROLLSUB');
1051 g_Sound_CreateWADEx('SOUND_PLAYER_FALL', GameWAD
+':SOUNDS\FALL');
1054 procedure MenuFreeData();
1056 e_CharFont_Remove(gMenuFont
);
1057 e_CharFont_Remove(gMenuSmallFont
);
1059 g_Texture_Delete('MAINMENU_MARKER1');
1060 g_Texture_Delete('MAINMENU_MARKER2');
1061 g_Texture_Delete('SCROLL_LEFT');
1062 g_Texture_Delete('SCROLL_RIGHT');
1063 g_Texture_Delete('SCROLL_MIDDLE');
1064 g_Texture_Delete('SCROLL_MARKER');
1065 g_Texture_Delete('EDIT_LEFT');
1066 g_Texture_Delete('EDIT_RIGHT');
1067 g_Texture_Delete('EDIT_MIDDLE');
1068 g_Texture_Delete('BOX1');
1069 g_Texture_Delete('BOX2');
1070 g_Texture_Delete('BOX3');
1071 g_Texture_Delete('BOX4');
1072 g_Texture_Delete('BOX5');
1073 g_Texture_Delete('BOX6');
1074 g_Texture_Delete('BOX7');
1075 g_Texture_Delete('BOX8');
1076 g_Texture_Delete('BOX9');
1077 g_Texture_Delete('BSCROLL_UP_A');
1078 g_Texture_Delete('BSCROLL_UP_U');
1079 g_Texture_Delete('BSCROLL_DOWN_A');
1080 g_Texture_Delete('BSCROLL_DOWN_U');
1081 g_Texture_Delete('BSCROLL_MIDDLE');
1082 g_Texture_Delete('NOPIC');
1084 g_Sound_Delete('MENU_SELECT');
1085 g_Sound_Delete('MENU_OPEN');
1086 g_Sound_Delete('MENU_CLOSE');
1087 g_Sound_Delete('MENU_CHANGE');
1088 g_Sound_Delete('SCROLL_ADD');
1089 g_Sound_Delete('SCROLL_SUB');
1090 g_Sound_Delete('SOUND_PLAYER_FALL');
1093 procedure ProcAuthorsMenu();
1095 gMusic
.SetByName('MUSIC_INTERMUS');
1099 procedure ProcExitMenuKeyDown (yes
: Boolean);
1102 snd
: TPlayableSound
;
1107 g_Game_StopAllSounds(True);
1108 case (Random(18)) of
1109 0: s
:= 'SOUND_MONSTER_PAIN';
1110 1: s
:= 'SOUND_MONSTER_DIE_3';
1111 2: s
:= 'SOUND_MONSTER_SLOP';
1112 3: s
:= 'SOUND_MONSTER_DEMON_DIE';
1113 4: s
:= 'SOUND_MONSTER_IMP_DIE_2';
1114 5: s
:= 'SOUND_MONSTER_MAN_DIE';
1115 6: s
:= 'SOUND_MONSTER_BSP_DIE';
1116 7: s
:= 'SOUND_MONSTER_VILE_DIE';
1117 8: s
:= 'SOUND_MONSTER_SKEL_DIE';
1118 9: s
:= 'SOUND_MONSTER_MANCUB_ALERT';
1119 10: s
:= 'SOUND_MONSTER_PAIN_PAIN';
1120 11: s
:= 'SOUND_MONSTER_BARON_DIE';
1121 12: s
:= 'SOUND_MONSTER_CACO_DIE';
1122 13: s
:= 'SOUND_MONSTER_CYBER_DIE';
1123 14: s
:= 'SOUND_MONSTER_KNIGHT_ALERT';
1124 15: s
:= 'SOUND_MONSTER_SPIDER_ALERT';
1125 else s
:= 'SOUND_PLAYER_FALL';
1127 snd
:= TPlayableSound
.Create();
1128 res
:= snd
.SetByName(s
);
1129 if not res
then res
:= snd
.SetByName('SOUND_PLAYER_FALL');
1133 while snd
.IsPlaying() do begin end;
1141 procedure ProcLoadMenu();
1148 TGUIEdit(TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a
))).Text := g_GetSaveName(a
, valid
);
1149 TGUIEdit(TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a
))).Invalid
:= not valid
;
1150 //TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a)).Enabled := valid;
1154 procedure ProcSaveMenu();
1162 name
:= g_GetSaveName(a
, valid
);
1163 TGUIEdit(TGUIMenu(g_GUI_GetWindow('SaveMenu').GetControl('mmSaveMenu')).GetControl('edSlot'+IntToStr(a
))).Text := name
;
1164 TGUIEdit(TGUIMenu(g_GUI_GetWindow('SaveMenu').GetControl('mmSaveMenu')).GetControl('edSlot'+IntToStr(a
))).Invalid
:= (name
<> '') and (not valid
);
1168 procedure ProcSaveGame(Sender
: TGUIControl
);
1172 if g_Game_IsNet
then Exit
;
1173 if g_Game_IsTestMap
then Exit
;
1174 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
1175 g_Game_PauseAllSounds(True);
1176 g_SaveGame(a
, TGUIEdit(Sender
).Text);
1178 g_ActiveWindow
:= nil;
1179 g_Game_Pause(False);
1182 procedure ProcLoadGame(Sender
: TGUIControl
);
1186 if g_Game_IsNet
then Exit
;
1187 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
1188 if g_LoadGame(a
) then
1190 g_Game_PauseAllSounds(False)
1192 else // Íå çàãðóçèëîñü - âîçâðàò â ìåíþ
1194 g_Console_Add(_lc
[I_MSG_BAD_SAVE_VERSION
], true);
1195 g_GUI_GetWindow('LoadMenu').SetActive(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu'));
1196 //g_ActiveWindow := nil;
1200 procedure ProcSingle1Player();
1202 g_Game_StartSingle(gDefaultMegawadStart
, False, 1);
1205 procedure ProcSingle2Players();
1207 g_Game_StartSingle(gDefaultMegawadStart
, True, 2);
1210 procedure ProcSelectMapMenu();
1213 wad_lb
: TGUIFileListBox
;
1214 map_lb
: TGUIListBox
;
1217 menu
:= TGUIMenu(g_GUI_GetWindow('SelectMapMenu').GetControl('mSelectMapMenu'));
1218 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsMapWAD'));
1219 map_lb
:= TGUIListBox(menu
.GetControl('lsMapRes'));
1221 if wad_lb
.SelectedItem() <> '' then
1222 map
:= map_lb
.SelectedItem()
1226 wad_lb
.UpdateFileList();
1229 if wad_lb
.SelectedItem() <> '' then
1232 map_lb
.SelectItem(map
);
1234 if map_lb
.SelectedItem() <> '' then
1238 g_GUI_ShowWindow('SelectMapMenu');
1241 procedure ProcSelectCampaignMenu();
1244 wad_lb
: TGUIFileListBox
;
1246 menu
:= TGUIMenu(g_GUI_GetWindow('CampaignMenu').GetControl('mCampaignMenu'));
1247 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsWAD'));
1249 wad_lb
.UpdateFileList();
1251 if wad_lb
.SelectedItem() <> '' then
1252 ProcSelectCampaignWAD(nil);
1255 procedure ProcSetMap();
1257 wad
, map
, res
: String;
1259 with TGUIMenu(g_ActiveWindow
.GetControl('mSelectMapMenu')) do
1261 wad
:= ExtractRelativePath(MapsDir
, TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem());
1262 map
:= TGUIListBox(GetControl('lsMapRes')).SelectedItem();
1265 if (wad
= '') or (map
= '') then
1268 res
:= wad
+':\'+map
;
1270 TGUILabel(TGUIMenu(g_GUI_GetWindow('CustomGameMenu').GetControl('mCustomGameMenu')).GetControl('lbMap')).Text := res
;
1271 TGUILabel(TGUIMenu(g_GUI_GetWindow('NetServerMenu').GetControl('mNetServerMenu')).GetControl('lbMap')).Text := res
;
1274 procedure ProcChangeSoundSettings(Sender
: TGUIControl
);
1278 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
1280 g_Sound_SetupAllVolumes(
1281 Min(TGUIScroll(menu
.GetControl('scSoundLevel')).Value
*16, 255),
1282 Min(TGUIScroll(menu
.GetControl('scMusicLevel')).Value
*16, 255)
1286 procedure ProcChangeGameSettings(Sender
: TGUIControl
);
1290 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
1291 g_dbg_scale
:= TGUIScroll(menu
.GetControl('scScaleFactor')).Value
+ 1;
1294 procedure ProcChangeTouchSettings(Sender
: TGUIControl
);
1298 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsTouchMenu').GetControl('mOptionsControlsTouchMenu'));
1299 g_touch_alt
:= TGUISwitch(menu
.GetControl('swTouchAlt')).ItemIndex
= 1;
1300 g_touch_size
:= TGUIScroll(menu
.GetControl('scTouchSize')).Value
/ 10 + 0.5;
1301 g_touch_offset
:= TGUIScroll(menu
.GetControl('scTouchOffset')).Value
* 5;
1304 procedure ProcOptionsPlayersMIMenu();
1309 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1311 a
:= TGUIListBox(TGUIMenu(g_ActiveWindow
.GetControl('mOptionsPlayers'+s
+'Menu')).GetControl('ls'+s
+'Model')).SelectedItem
;
1313 if a
= '' then Exit
;
1315 b
:= g_PlayerModel_GetInfo(a
);
1317 with TGUIMenu(g_GUI_GetWindow('OptionsPlayersMIMenu').GetControl('mOptionsPlayersMIMenu')) do
1319 TGUILabel(GetControl('lbName')).Text := b
.Name
;
1320 TGUILabel(GetControl('lbAuthor')).Text := b
.Author
;
1321 TGUIMemo(GetControl('meComment')).SetText(b
.Description
);
1323 if b
.HaveWeapon
then
1324 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_YES
]
1326 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_NO
];
1329 g_GUI_ShowWindow('OptionsPlayersMIMenu');
1332 procedure ProcOptionsPlayersAnim();
1336 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1341 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1344 Model
.GetCurrentAnimation
.Loop
:= True;
1345 Model
.GetCurrentAnimationMask
.Loop
:= True;
1349 procedure ProcOptionsPlayersWeap();
1353 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1358 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1362 procedure ProcOptionsPlayersRot();
1366 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1367 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')).Model
do
1369 if Direction
= TDirection
.D_LEFT
then Direction
:= TDirection
.D_RIGHT
else Direction
:= TDirection
.D_LEFT
;
1373 procedure ProcDefaultMenuKeyDown (yes
: Boolean);
1377 g_Options_SetDefault();
1383 procedure ProcSavedMenuKeyDown (yes
: Boolean);
1385 if yes
then ReadOptions();
1389 procedure ProcAuthorsClose();
1391 gMusic
.SetByName('MUSIC_MENU');
1393 gState
:= STATE_MENU
;
1396 procedure ProcGMClose();
1398 g_Game_InGameMenu(False);
1401 procedure ProcGMShow();
1406 if (gGameSettings
.GameType
= GT_SINGLE
) and
1407 ((gPlayer1
= nil) or (not gPlayer1
.alive
)) and
1408 ((gPlayer2
= nil) or (not gPlayer2
.alive
)) then
1409 Enabled
:= False; // Îäèí èç èãðîêîâ ïîãèá â ñèíãëå
1411 Enabled
:= False; // Çàïðåòèòü ñîõðàíåíèå â èíòåðìèññèè (íå ðåàëèçîâàíî)
1412 if g_Game_IsTestMap
then
1413 Enabled
:= False; // Åñëè èãðàåì íà òåñòîâîé èëè âðåìåííîé êàðòå
1414 TGUIMainMenu(g_ActiveWindow
.GetControl(
1415 g_ActiveWindow
.DefControl
)).EnableButton('save', Enabled
);
1418 procedure ProcChangePlayers();
1420 TeamGame
, Spectator
, AddTwo
: Boolean;
1421 P1Team
{, P2Team}: Byte;
1422 bP2
: TGUITextButton
;
1424 TeamGame
:= gGameSettings
.GameMode
in [GM_TDM
, GM_CTF
];
1425 Spectator
:= (gPlayer1
= nil) and (gPlayer2
= nil);
1426 AddTwo
:= gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
];
1427 P1Team
:= TEAM_NONE
;
1428 if gPlayer1
<> nil then P1Team
:= gPlayer1
.Team
;
1430 //P2Team := TEAM_NONE;
1431 //if gPlayer2 <> nil then P2Team := gPlayer2.Team;
1433 TGUIMainMenu(g_ActiveWindow
.GetControl(
1434 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinRed', TeamGame
and (P1Team
<> TEAM_RED
));
1435 TGUIMainMenu(g_ActiveWindow
.GetControl(
1436 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinBlue', TeamGame
and (P1Team
<> TEAM_BLUE
));
1437 TGUIMainMenu(g_ActiveWindow
.GetControl(
1438 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinGame', Spectator
and not TeamGame
);
1440 bP2
:= TGUIMainMenu(g_ActiveWindow
.GetControl(
1441 g_ActiveWindow
.DefControl
)).GetButton('tmPlayer2');
1442 bP2
.Enabled
:= AddTwo
and not Spectator
;
1444 bP2
.Color
:= MAINMENU_ITEMS_COLOR
1446 bP2
.Color
:= MAINMENU_UNACTIVEITEMS_COLOR
;
1447 if gPlayer2
= nil then
1448 bP2
.Caption
:= _lc
[I_MENU_ADD_PLAYER_2
]
1450 bP2
.Caption
:= _lc
[I_MENU_REM_PLAYER_2
];
1452 TGUIMainMenu(g_ActiveWindow
.GetControl(
1453 g_ActiveWindow
.DefControl
)).EnableButton('tmSpectate', not Spectator
);
1456 procedure ProcJoinRed();
1458 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1460 if g_Game_IsServer
then
1462 if gPlayer1
= nil then
1463 g_Game_AddPlayer(TEAM_RED
)
1466 if gPlayer1
.Team
<> TEAM_RED
then
1468 gPlayer1
.SwitchTeam
;
1469 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1472 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1477 gPlayer1Settings
.Team
:= TEAM_RED
;
1478 MC_SEND_PlayerSettings
;
1479 if gPlayer1
= nil then
1480 g_Game_AddPlayer(TEAM_RED
);
1482 g_ActiveWindow
:= nil;
1483 g_Game_Pause(False);
1486 procedure ProcJoinBlue();
1488 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1490 if g_Game_IsServer
then
1492 if gPlayer1
= nil then
1493 g_Game_AddPlayer(TEAM_BLUE
)
1496 if gPlayer1
.Team
<> TEAM_BLUE
then
1498 gPlayer1
.SwitchTeam
;
1499 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1502 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1507 gPlayer1Settings
.Team
:= TEAM_BLUE
;
1508 MC_SEND_PlayerSettings
;
1509 if gPlayer1
= nil then
1510 g_Game_AddPlayer(TEAM_BLUE
);
1512 g_ActiveWindow
:= nil;
1513 g_Game_Pause(False);
1516 procedure ProcJoinGame();
1518 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1520 if gPlayer1
= nil then
1522 g_ActiveWindow
:= nil;
1523 g_Game_Pause(False);
1526 procedure ProcSwitchP2();
1528 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
]) then
1530 if gPlayer1
= nil then
1532 if gPlayer2
= nil then
1535 g_Game_RemovePlayer();
1536 g_ActiveWindow
:= nil;
1537 g_Game_Pause(False);
1540 procedure ProcSpectate();
1542 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1545 g_ActiveWindow
:= nil;
1546 g_Game_Pause(False);
1549 procedure ProcRestartMenuKeyDown (yes
: Boolean);
1551 if yes
then g_Game_Restart() else g_GUI_HideWindow
;
1554 procedure ProcEndMenuKeyDown (yes
: Boolean);
1556 if yes
then gExit
:= EXIT_SIMPLE
else g_GUI_HideWindow
;
1559 procedure ProcSetRussianLanguage();
1561 if gLanguage
<> LANGUAGE_RUSSIAN
then
1563 gLanguage
:= LANGUAGE_RUSSIAN
;
1564 gLanguageChange
:= True;
1565 gAskLanguage
:= False;
1567 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1569 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1574 procedure ProcSetEnglishLanguage();
1576 if gLanguage
<> LANGUAGE_ENGLISH
then
1578 gLanguage
:= LANGUAGE_ENGLISH
;
1579 gLanguageChange
:= True;
1580 gAskLanguage
:= False;
1582 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1584 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1589 procedure ReadGameSettings();
1593 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1595 with gGameSettings
do
1597 with TGUISwitch(menu
.GetControl('swTeamDamage')) do
1598 if LongBool(Options
and GAME_OPTION_TEAMDAMAGE
) then
1603 TGUIEdit(menu
.GetControl('edTimeLimit')).Text := IntToStr(TimeLimit
);
1604 TGUIEdit(menu
.GetControl('edGoalLimit')).Text := IntToStr(GoalLimit
);
1605 TGUIEdit(menu
.GetControl('edMaxLives')).Text := IntToStr(MaxLives
);
1607 with TGUISwitch(menu
.GetControl('swBotsVS')) do
1608 if LongBool(Options
and GAME_OPTION_BOTVSPLAYER
) and
1609 LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1612 if LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1617 if GameType
in [GT_CUSTOM
, GT_SERVER
] then
1619 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1620 TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
:= True;
1621 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1622 TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
:= True;
1623 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1624 TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
:= True;
1625 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_ITEMSTEXT_COLOR
;
1626 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1630 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1631 with TGUIEdit(menu
.GetControl('edTimeLimit')) do
1636 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1637 with TGUIEdit(menu
.GetControl('edGoalLimit')) do
1642 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1643 with TGUIEdit(menu
.GetControl('edMaxLives')) do
1648 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1649 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1654 procedure ProcApplyGameSet();
1658 stat
: TPlayerStatArray
;
1660 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1662 if not g_Game_IsServer
then Exit
;
1664 with gGameSettings
do
1666 if TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
then
1668 if TGUISwitch(menu
.GetControl('swTeamDamage')).ItemIndex
= 0 then
1669 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
1671 Options
:= Options
and (not GAME_OPTION_TEAMDAMAGE
);
1674 if TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
then
1676 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edTimeLimit')).Text, TimeLimit
);
1682 b
:= (gTime
- gGameStartTime
) div 1000 + 10; // 10 ñåêóíä íà ñìåíó
1684 TimeLimit
:= Max(n
, b
);
1688 if TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
then
1690 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edGoalLimit')).Text, GoalLimit
);
1697 if GameMode
= GM_DM
then
1699 stat
:= g_Player_GetStats();
1701 for a
:= 0 to High(stat
) do
1702 if stat
[a
].Frags
> b
then
1706 b
:= Max(gTeamStat
[TEAM_RED
].Goals
, gTeamStat
[TEAM_BLUE
].Goals
);
1708 GoalLimit
:= Max(n
, b
);
1712 if TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
then
1714 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edMaxLives')).Text, GoalLimit
);
1715 if n
< 0 then n
:= 0;
1716 if n
> 255 then n
:= 255;
1722 stat
:= g_Player_GetStats();
1724 for a
:= 0 to High(stat
) do
1725 if stat
[a
].Lives
> b
then
1728 MaxLives
:= Max(n
, b
);
1732 if TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
then
1734 case TGUISwitch(menu
.GetControl('swBotsVS')).ItemIndex
of
1737 Options
:= Options
and (not GAME_OPTION_BOTVSPLAYER
);
1738 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1742 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1743 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1747 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1748 Options
:= Options
and (not GAME_OPTION_BOTVSMONSTER
);
1754 if g_Game_IsNet
then MH_SEND_GameSettings
;
1757 procedure ProcVideoOptionsRes();
1763 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1765 TGUILabel(menu
.GetControl('lbCurrentRes')).Text :=
1766 IntToStr(gScreenWidth
) +
1767 ' x ' + IntToStr(gScreenHeight
) +
1768 ', ' + IntToStr(gBPP
) + ' bpp';
1770 with TGUIListBox(menu
.GetControl('lsResolution')) do
1772 list
:= GetDisplayModes(gBPP
, SR
);
1783 with TGUISwitch(menu
.GetControl('swFullScreen')) do
1790 procedure ProcApplyVideoOptions();
1793 Fullscreen
: Boolean;
1794 SWidth
, SHeight
: Integer;
1797 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1799 str
:= TGUIListBox(menu
.GetControl('lsResolution')).SelectedItem
;
1800 SScanf(str
, '%dx%d', [@SWidth
, @SHeight
]);
1802 Fullscreen
:= TGUISwitch(menu
.GetControl('swFullScreen')).ItemIndex
= 0;
1804 if (SWidth
<> gScreenWidth
) or
1805 (SHeight
<> gScreenHeight
) or
1806 (Fullscreen
<> gFullscreen
) then
1808 gResolutionChange
:= True;
1809 gRC_Width
:= SWidth
;
1810 gRC_Height
:= SHeight
;
1811 gRC_FullScreen
:= Fullscreen
;
1812 gRC_Maximized
:= gWinMaximized
;
1815 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1819 procedure ProcSetFirstRussianLanguage();
1821 gLanguage
:= LANGUAGE_RUSSIAN
;
1822 gLanguageChange
:= True;
1823 gAskLanguage
:= False;
1825 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1828 procedure ProcSetFirstEnglishLanguage();
1830 gLanguage
:= LANGUAGE_ENGLISH
;
1831 gLanguageChange
:= True;
1832 gAskLanguage
:= False;
1834 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1837 procedure ProcRecallAddress();
1839 with TGUIMenu(g_GUI_GetWindow('NetClientMenu').GetControl('mNetClientMenu')) do
1841 TGUIEdit(GetControl('edIP')).Text := NetClientIP
;
1842 TGUIEdit(GetControl('edPort')).Text := IntToStr(NetClientPort
);
1846 procedure CreateFirstLanguageMenu();
1850 Menu
:= TGUIWindow
.Create('FirstLanguageMenu');
1852 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, ' '))) do
1854 Name
:= 'mmFirstLanguageMenu';
1855 AddButton(@ProcSetFirstRussianLanguage
, 'Ðóññêèé', '');
1856 AddButton(@ProcSetFirstEnglishLanguage
, 'English', '');
1859 Menu
.DefControl
:= 'mmFirstLanguageMenu';
1860 Menu
.MainWindow
:= True;
1861 g_GUI_AddWindow(Menu
);
1864 procedure g_Menu_AskLanguage();
1866 CreateFirstLanguageMenu();
1867 g_GUI_ShowWindow('FirstLanguageMenu');
1870 procedure CreatePlayerOptionsMenu(s
: String);
1875 Menu
:= TGUIWindow
.Create('OptionsPlayers'+s
+'Menu');
1877 a
:= _lc
[I_MENU_PLAYER_1
]
1879 a
:= _lc
[I_MENU_PLAYER_2
];
1880 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, a
))) do
1882 Name
:= 'mOptionsPlayers'+s
+'Menu';
1883 with AddEdit(_lc
[I_MENU_PLAYER_NAME
]) do
1885 Name
:= 'ed'+s
+'Name';
1889 with AddSwitch(_lc
[I_MENU_PLAYER_TEAM
]) do
1891 Name
:= 'sw'+s
+'Team';
1892 AddItem(_lc
[I_MENU_PLAYER_TEAM_RED
]);
1893 AddItem(_lc
[I_MENU_PLAYER_TEAM_BLUE
]);
1895 with AddList(_lc
[I_MENU_PLAYER_MODEL
], 12, 6) do
1897 Name
:= 'ls'+s
+'Model';
1899 Items
:= g_PlayerModel_GetNames();
1900 OnChange
:= ProcSelectModel
;
1902 with AddScroll(_lc
[I_MENU_PLAYER_RED
]) do
1904 Name
:= 'sc'+s
+'Red';
1906 OnChange
:= ProcChangeColor
;
1908 with AddScroll(_lc
[I_MENU_PLAYER_GREEN
]) do
1910 Name
:= 'sc'+s
+'Green';
1912 OnChange
:= ProcChangeColor
;
1914 with AddScroll(_lc
[I_MENU_PLAYER_BLUE
]) do
1916 Name
:= 'sc'+s
+'Blue';
1918 OnChange
:= ProcChangeColor
;
1921 AddButton(@ProcOptionsPlayersMIMenu
, _lc
[I_MENU_MODEL_INFO
]);
1922 AddButton(@ProcOptionsPlayersAnim
, _lc
[I_MENU_MODEL_ANIMATION
]);
1923 AddButton(@ProcOptionsPlayersWeap
, _lc
[I_MENU_MODEL_CHANGE_WEAPON
]);
1924 AddButton(@ProcOptionsPlayersRot
, _lc
[I_MENU_MODEL_ROTATE
]);
1926 with TGUIModelView(Menu
.AddChild(TGUIModelView
.Create
)) do
1928 Name
:= 'mv'+s
+'Model';
1929 X
:= GetControl('ls'+s
+'Model').X
+TGUIListBox(GetControl('ls'+s
+'Model')).GetWidth
+16;
1930 Y
:= GetControl('ls'+s
+'Model').Y
;
1933 Menu
.DefControl
:= 'mOptionsPlayers'+s
+'Menu';
1934 g_GUI_AddWindow(Menu
);
1937 procedure CreateAllMenus();
1941 a
, cx
, _y
, i
: Integer;
1944 Menu
:= TGUIWindow
.Create('MainMenu');
1945 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
1947 Name
:= 'mmMainMenu';
1948 AddButton(nil, _lc
[I_MENU_NEW_GAME
], 'NewGameMenu');
1949 AddButton(nil, _lc
[I_MENU_MULTIPLAYER
], 'NetGameMenu');
1950 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
1951 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
1952 AddButton(@ProcAuthorsMenu
, _lc
[I_MENU_AUTHORS
], 'AuthorsMenu');
1953 AddButton(nil, _lc
[I_MENU_EXIT
], 'ExitMenu');
1955 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(Format(_lc
[I_VERSION
], [GAME_VERSION
]), gMenuSmallFont
))) do
1957 Color
:= _RGB(255, 255, 255);
1958 X
:= gScreenWidth
-GetWidth
-8;
1959 Y
:= gScreenHeight
-GetHeight
-8;
1961 Menu
.DefControl
:= 'mmMainMenu';
1962 Menu
.MainWindow
:= True;
1963 g_GUI_AddWindow(Menu
);
1965 Menu
:= TGUIWindow
.Create('NewGameMenu');
1966 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_NEW_GAME
]))) do
1968 Name
:= 'mmNewGameMenu';
1969 AddButton(@ProcSingle1Player
, _lc
[I_MENU_1_PLAYER
]);
1970 AddButton(@ProcSingle2Players
, _lc
[I_MENU_2_PLAYERS
]);
1971 AddButton(nil, _lc
[I_MENU_CUSTOM_GAME
], 'CustomGameMenu');
1972 AddButton(@ProcSelectCampaignMenu
, _lc
[I_MENU_CAMPAIGN
], 'CampaignMenu');
1974 Menu
.DefControl
:= 'mmNewGameMenu';
1975 g_GUI_AddWindow(Menu
);
1977 Menu
:= TGUIWindow
.Create('NetGameMenu');
1978 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MULTIPLAYER
]))) do
1980 Name
:= 'mmNetGameMenu';
1981 AddButton(@ProcRecallAddress
, _lc
[I_MENU_START_CLIENT
], 'NetClientMenu');
1982 AddButton(nil, _lc
[I_MENU_START_SERVER
], 'NetServerMenu');
1984 Menu
.DefControl
:= 'mmNetGameMenu';
1985 g_GUI_AddWindow(Menu
);
1987 Menu
:= TGUIWindow
.Create('NetServerMenu');
1988 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_START_SERVER
]))) do
1990 Name
:= 'mNetServerMenu';
1991 with AddEdit(_lc
[I_NET_SERVER_NAME
]) do
1993 Name
:= 'edSrvName';
1994 OnlyDigits
:= False;
1997 Text := NetServerName
;
1999 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
2001 Name
:= 'edSrvPassword';
2002 OnlyDigits
:= False;
2005 Text := NetPassword
;
2007 with AddEdit(_lc
[I_NET_PORT
]) do
2013 Text := IntToStr(NetPort
);
2015 with AddEdit(_lc
[I_NET_MAX_CLIENTS
]) do
2017 Name
:= 'edMaxPlayers';
2021 Text := IntToStr(NetMaxClients
);
2023 with AddSwitch(_lc
[I_NET_USE_MASTER
]) do
2025 Name
:= 'swUseMaster';
2026 AddItem(_lc
[I_MENU_YES
]);
2027 AddItem(_lc
[I_MENU_NO
]);
2028 if NetUseMaster
then
2034 with AddLabel(_lc
[I_MENU_MAP
]) do
2039 OnClick
:= @ProcSelectMapMenu
;
2041 with AddSwitch(_lc
[I_MENU_GAME_TYPE
]) do
2043 Name
:= 'swGameMode';
2044 AddItem(_lc
[I_MENU_GAME_TYPE_DM
]);
2045 AddItem(_lc
[I_MENU_GAME_TYPE_TDM
]);
2046 AddItem(_lc
[I_MENU_GAME_TYPE_CTF
]);
2047 AddItem(_lc
[I_MENU_GAME_TYPE_COOP
]);
2048 case g_Game_TextToMode(gnGameMode
) of
2050 GM_DM
: ItemIndex
:= 0;
2051 GM_TDM
: ItemIndex
:= 1;
2052 GM_CTF
: ItemIndex
:= 2;
2054 GM_COOP
: ItemIndex
:= 3;
2056 OnChange
:= ProcSwitchMonstersNet
;
2058 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
2060 Name
:= 'edTimeLimit';
2064 if gnTimeLimit
> 0 then
2065 Text := IntToStr(gnTimeLimit
);
2067 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
2069 Name
:= 'edGoalLimit';
2073 if gnGoalLimit
> 0 then
2074 Text := IntToStr(gnGoalLimit
);
2076 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
2078 Name
:= 'edMaxLives';
2082 if gnMaxLives
> 0 then
2083 Text := IntToStr(gnMaxLives
);
2085 with AddSwitch(_lc
[I_MENU_SERVER_PLAYERS
]) do
2087 Name
:= 'swPlayers';
2088 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2089 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2090 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2091 ItemIndex
:= gnPlayers
;
2093 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
2095 Name
:= 'swTeamDamage';
2096 AddItem(_lc
[I_MENU_YES
]);
2097 AddItem(_lc
[I_MENU_NO
]);
2098 if gnTeamDamage
then
2103 with AddSwitch(_lc
[I_MENU_ENABLE_EXITS
]) do
2105 Name
:= 'swEnableExits';
2106 AddItem(_lc
[I_MENU_YES
]);
2107 AddItem(_lc
[I_MENU_NO
]);
2113 with AddSwitch(_lc
[I_MENU_WEAPONS_STAY
]) do
2115 Name
:= 'swWeaponStay';
2116 AddItem(_lc
[I_MENU_YES
]);
2117 AddItem(_lc
[I_MENU_NO
]);
2118 if gnWeaponStay
then
2123 with AddSwitch(_lc
[I_MENU_ENABLE_MONSTERS
]) do
2125 Name
:= 'swMonsters';
2126 AddItem(_lc
[I_MENU_YES
]);
2127 AddItem(_lc
[I_MENU_NO
]);
2133 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
2136 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
2137 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
2138 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
2140 if gnBotsVS
= 'Players' then
2142 if gnBotsVS
= 'Monsters' then
2146 AddButton(@ProcStartNetGame
, _lc
[I_MENU_START_GAME
]);
2150 Menu
.DefControl
:= 'mNetServerMenu';
2151 g_GUI_AddWindow(Menu
);
2153 Menu
:= TGUIWindow
.Create('NetClientMenu');
2154 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_START_CLIENT
]))) do
2156 Name
:= 'mNetClientMenu';
2158 AddButton(@ProcServerlist
, _lc
[I_NET_SLIST
]);
2161 with AddEdit(_lc
[I_NET_ADDRESS
]) do
2167 Text := 'localhost';
2169 with AddEdit(_lc
[I_NET_PORT
]) do
2177 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
2180 OnlyDigits
:= False;
2187 AddButton(@ProcConnectNetGame
, _lc
[I_MENU_CLIENT_CONNECT
]);
2191 Menu
.DefControl
:= 'mNetClientMenu';
2192 g_GUI_AddWindow(Menu
);
2194 Menu
:= TGUIWindow
.Create('LoadMenu');
2195 Menu
.OnShow
:= ProcLoadMenu
;
2196 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_LOAD_GAME
]))) do
2198 Name
:= 'mmLoadMenu';
2203 Name
:= 'edSlot'+IntToStr(a
);
2206 OnEnter
:= ProcLoadGame
;
2209 Menu
.DefControl
:= 'mmLoadMenu';
2210 g_GUI_AddWindow(Menu
);
2212 Menu
:= TGUIWindow
.Create('SaveMenu');
2213 Menu
.OnShow
:= ProcSaveMenu
;
2214 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SAVE_GAME
]))) do
2216 Name
:= 'mmSaveMenu';
2221 Name
:= 'edSlot'+IntToStr(a
);
2224 OnChange
:= ProcSaveGame
;
2227 Menu
.DefControl
:= 'mmSaveMenu';
2228 g_GUI_AddWindow(Menu
);
2230 Menu
:= TGUIWindow
.Create('CustomGameMenu');
2231 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CUSTOM_GAME
]))) do
2233 Name
:= 'mCustomGameMenu';
2234 with AddLabel(_lc
[I_MENU_MAP
]) do
2239 OnClick
:= @ProcSelectMapMenu
;
2241 with AddSwitch(_lc
[I_MENU_GAME_TYPE
]) do
2243 Name
:= 'swGameMode';
2244 AddItem(_lc
[I_MENU_GAME_TYPE_DM
]);
2245 AddItem(_lc
[I_MENU_GAME_TYPE_TDM
]);
2246 AddItem(_lc
[I_MENU_GAME_TYPE_CTF
]);
2247 AddItem(_lc
[I_MENU_GAME_TYPE_COOP
]);
2248 case g_Game_TextToMode(gcGameMode
) of
2250 GM_DM
: ItemIndex
:= 0;
2251 GM_TDM
: ItemIndex
:= 1;
2252 GM_CTF
: ItemIndex
:= 2;
2254 GM_COOP
: ItemIndex
:= 3;
2256 OnChange
:= ProcSwitchMonstersCustom
;
2258 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
2260 Name
:= 'edTimeLimit';
2264 if gcTimeLimit
> 0 then
2265 Text := IntToStr(gcTimeLimit
);
2267 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
2269 Name
:= 'edGoalLimit';
2273 if gcGoalLimit
> 0 then
2274 Text := IntToStr(gcGoalLimit
);
2276 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
2278 Name
:= 'edMaxLives';
2282 if gcMaxLives
> 0 then
2283 Text := IntToStr(gcMaxLives
);
2285 with AddSwitch(_lc
[I_MENU_PLAYERS
]) do
2287 Name
:= 'swPlayers';
2288 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2289 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2290 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2291 ItemIndex
:= gcPlayers
;
2293 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
2295 Name
:= 'swTeamDamage';
2296 AddItem(_lc
[I_MENU_YES
]);
2297 AddItem(_lc
[I_MENU_NO
]);
2298 if gcTeamDamage
then
2303 with AddSwitch(_lc
[I_MENU_ENABLE_EXITS
]) do
2305 Name
:= 'swEnableExits';
2306 AddItem(_lc
[I_MENU_YES
]);
2307 AddItem(_lc
[I_MENU_NO
]);
2313 with AddSwitch(_lc
[I_MENU_WEAPONS_STAY
]) do
2315 Name
:= 'swWeaponStay';
2316 AddItem(_lc
[I_MENU_YES
]);
2317 AddItem(_lc
[I_MENU_NO
]);
2318 if gcWeaponStay
then
2323 with AddSwitch(_lc
[I_MENU_ENABLE_MONSTERS
]) do
2325 Name
:= 'swMonsters';
2326 AddItem(_lc
[I_MENU_YES
]);
2327 AddItem(_lc
[I_MENU_NO
]);
2333 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
2336 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
2337 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
2338 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
2340 if gcBotsVS
= 'Players' then
2342 if gcBotsVS
= 'Monsters' then
2346 AddButton(@ProcStartCustomGame
, _lc
[I_MENU_START_GAME
]);
2350 Menu
.DefControl
:= 'mCustomGameMenu';
2351 g_GUI_AddWindow(Menu
);
2353 Menu
:= TGUIWindow
.Create('CampaignMenu');
2354 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CAMPAIGN
]))) do
2356 Name
:= 'mCampaignMenu';
2365 with AddFileList('', 15, 4) do
2368 OnChange
:= ProcSelectCampaignWAD
;
2372 FileMask
:= '*.wad|*.pk3|*.zip';
2373 SetBase(MapsDir
+'megawads/');
2376 with AddLabel(_lc
[I_MENU_MAP_NAME
]) do
2378 Name
:= 'lbWADName';
2382 with AddLabel(_lc
[I_MENU_MAP_AUTHOR
]) do
2384 Name
:= 'lbWADAuthor';
2388 AddLine(_lc
[I_MENU_MAP_DESCRIPTION
]);
2389 with AddMemo('', 15, 3) do
2391 Name
:= 'meWADDescription';
2392 Color
:= MENU_ITEMSCTRL_COLOR
;
2394 with AddSwitch(_lc
[I_MENU_PLAYERS
]) do
2396 Name
:= 'swPlayers';
2397 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2398 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2401 AddButton(@ProcStartCampaign
, _lc
[I_MENU_START_GAME
]);
2405 with TGUIImage(Menu
.AddChild(TGUIImage
.Create
)) do
2407 Name
:= 'mpWADImage';
2408 DefaultRes
:= 'NOPIC';
2409 X
:= GetControl('lsWAD').X
+4;
2410 Y
:= GetControl('lsWAD').Y
-128-MENU_VSPACE
;
2413 Menu
.DefControl
:= 'mCampaignMenu';
2414 g_GUI_AddWindow(Menu
);
2416 Menu
:= TGUIWindow
.Create('SelectMapMenu');
2417 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SELECT_MAP
]))) do
2419 Name
:= 'mSelectMapMenu';
2420 with AddFileList(_lc
[I_MENU_MAP_WAD
], 12, 4) do
2423 OnChange
:= ProcSelectWAD
;
2427 FileMask
:= '*.wad|*.pk3|*.zip';
2430 with AddList(_lc
[I_MENU_MAP_RESOURCE
], 12, 4) do
2434 OnChange
:= ProcSelectMap
;
2437 with AddLabel(_lc
[I_MENU_MAP_NAME
]) do
2439 Name
:= 'lbMapName';
2443 with AddLabel(_lc
[I_MENU_MAP_AUTHOR
]) do
2445 Name
:= 'lbMapAuthor';
2449 with AddLabel(_lc
[I_MENU_MAP_SIZE
]) do
2451 Name
:= 'lbMapSize';
2455 with AddMemo(_lc
[I_MENU_MAP_DESCRIPTION
], 12, 4) do
2457 Name
:= 'meMapDescription';
2462 with TGUIMapPreview(Menu
.AddChild(TGUIMapPreview
.Create
)) do
2464 Name
:= 'mpMapPreview';
2465 X
:= GetControl('lsMapWAD').X
+TGUIListBox(GetControl('lsMapWAD')).GetWidth()+2;
2466 Y
:= GetControl('lsMapWAD').Y
;
2468 with TGUILabel(Menu
.AddChild(TGUILabel
.Create('', gMenuSmallFont
))) do
2470 Name
:= 'lbMapScale';
2473 Color
:= MENU_ITEMSCTRL_COLOR
;
2474 X
:= GetControl('lsMapWAD').X
+
2475 TGUIListBox(GetControl('lsMapWAD')).GetWidth() +
2476 2 + MAPPREVIEW_WIDTH
*4;
2477 Y
:= GetControl('lsMapWAD').Y
+ MAPPREVIEW_HEIGHT
*16 + 16;
2480 Menu
.OnClose
:= ProcSetMap
;
2481 Menu
.DefControl
:= 'mSelectMapMenu';
2482 g_GUI_AddWindow(Menu
);
2484 Menu
:= TGUIWindow
.Create('OptionsMenu');
2485 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_OPTIONS
]))) do
2487 Name
:= 'mmOptionsMenu';
2488 AddButton(nil, _lc
[I_MENU_VIDEO_OPTIONS
], 'OptionsVideoMenu');
2489 AddButton(nil, _lc
[I_MENU_SOUND_OPTIONS
], 'OptionsSoundMenu');
2490 AddButton(nil, _lc
[I_MENU_GAME_OPTIONS
], 'OptionsGameMenu');
2491 AddButton(nil, _lc
[I_MENU_CONTROLS_OPTIONS
], 'OptionsControlsMenu');
2492 AddButton(nil, _lc
[I_MENU_PLAYER_OPTIONS
], 'OptionsPlayersMenu');
2493 AddButton(nil, _lc
[I_MENU_LANGUAGE_OPTIONS
], 'OptionsLanguageMenu');
2495 AddButton(nil, _lc
[I_MENU_SAVED_OPTIONS
], 'SavedOptionsMenu').Color
:= _RGB(255, 0, 0);
2496 AddButton(nil, _lc
[I_MENU_DEFAULT_OPTIONS
], 'DefaultOptionsMenu').Color
:= _RGB(255, 0, 0);
2498 Menu
.OnClose
:= ProcApplyOptions
;
2499 Menu
.DefControl
:= 'mmOptionsMenu';
2500 g_GUI_AddWindow(Menu
);
2502 Menu
:= CreateYNMenu('SavedOptionsMenu', _lc
[I_MENU_LOAD_SAVED_PROMT
], Round(gScreenWidth
*0.6),
2503 gMenuSmallFont
, @ProcSavedMenuKeyDown
);
2504 g_GUI_AddWindow(Menu
);
2506 Menu
:= TGUIWindow
.Create('OptionsVideoMenu');
2507 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_VIDEO_OPTIONS
]))) do
2509 Name
:= 'mOptionsVideoMenu';
2510 AddButton(@ProcVideoOptionsRes
, _lc
[I_MENU_VIDEO_RESOLUTION
], 'OptionsVideoResMenu');
2511 with AddSwitch(_lc
[I_MENU_VIDEO_BPP
]) do
2517 with AddSwitch(_lc
[I_MENU_VIDEO_VSYNC
]) do
2520 AddItem(_lc
[I_MENU_YES
]);
2521 AddItem(_lc
[I_MENU_NO
]);
2523 with AddSwitch(_lc
[I_MENU_VIDEO_FILTER_SKY
]) do
2525 Name
:= 'swTextureFilter';
2526 AddItem(_lc
[I_MENU_YES
]);
2527 AddItem(_lc
[I_MENU_NO
]);
2529 with AddSwitch(_lc
[I_MENU_VIDEO_LEGACY_COMPATIBLE
]) do
2531 Name
:= 'swLegacyNPOT';
2532 AddItem(_lc
[I_MENU_NO
]);
2533 AddItem(_lc
[I_MENU_YES
]);
2536 AddText(_lc
[I_MENU_VIDEO_NEED_RESTART
], Round(gScreenWidth
*0.6));
2539 Menu
.DefControl
:= 'mOptionsVideoMenu';
2540 g_GUI_AddWindow(Menu
);
2542 Menu
:= TGUIWindow
.Create('OptionsVideoResMenu');
2543 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_RESOLUTION_SELECT
]))) do
2545 Name
:= 'mOptionsVideoResMenu';
2546 with AddLabel(_lc
[I_MENU_RESOLUTION_CURRENT
]) do
2548 Name
:= 'lbCurrentRes';
2552 with AddList(_lc
[I_MENU_RESOLUTION_LIST
], 12, 6) do
2554 Name
:= 'lsResolution';
2557 with AddSwitch(_lc
[I_MENU_RESOLUTION_FULLSCREEN
]) do
2559 Name
:= 'swFullScreen';
2560 AddItem(_lc
[I_MENU_YES
]);
2561 AddItem(_lc
[I_MENU_NO
]);
2564 AddButton(@ProcApplyVideoOptions
, _lc
[I_MENU_RESOLUTION_APPLY
]);
2567 Menu
.DefControl
:= 'mOptionsVideoResMenu';
2568 g_GUI_AddWindow(Menu
);
2570 Menu
:= TGUIWindow
.Create('OptionsSoundMenu');
2571 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SOUND_OPTIONS
]))) do
2573 Name
:= 'mOptionsSoundMenu';
2574 with AddScroll(_lc
[I_MENU_SOUND_MUSIC_LEVEL
]) do
2576 Name
:= 'scMusicLevel';
2578 OnChange
:= ProcChangeSoundSettings
;
2580 with AddScroll(_lc
[I_MENU_SOUND_SOUND_LEVEL
]) do
2582 Name
:= 'scSoundLevel';
2584 OnChange
:= ProcChangeSoundSettings
;
2586 with AddScroll(_lc
[I_MENU_SOUND_MAX_SIM_SOUNDS
]) do
2588 Name
:= 'scMaxSimSounds';
2591 with AddSwitch (_lc
[I_MENU_SOUND_ANNOUNCE
]) do
2593 Name
:= 'swAnnouncer';
2594 AddItem(_lc
[I_MENU_ANNOUNCE_NONE
]);
2595 AddItem(_lc
[I_MENU_ANNOUNCE_ME
]);
2596 AddItem(_lc
[I_MENU_ANNOUNCE_MEPLUS
]);
2597 AddItem(_lc
[I_MENU_ANNOUNCE_ALL
]);
2599 // Ïåðåêëþ÷àòåëü çâóêîâûõ ýôôåêòîâ (DF / Doom 2)
2600 with AddSwitch (_lc
[I_MENU_SOUND_COMPAT
]) do
2602 Name
:= 'swSoundEffects';
2603 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2604 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2606 // Ïåðåêëþ÷àòåëü çâóêîâ ÷àòà
2607 with AddSwitch (_lc
[I_MENU_SOUND_CHAT
]) do
2609 Name
:= 'swChatSpeech';
2610 AddItem(_lc
[I_MENU_YES
]);
2611 AddItem(_lc
[I_MENU_NO
]);
2613 with AddSwitch(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS
]) do
2615 Name
:= 'swInactiveSounds';
2616 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_ON
]);
2617 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_OFF
]);
2621 Menu
.DefControl
:= 'mOptionsSoundMenu';
2622 g_GUI_AddWindow(Menu
);
2624 Menu
:= TGUIWindow
.Create('OptionsGameMenu');
2625 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_GAME_OPTIONS
]))) do
2627 Name
:= 'mOptionsGameMenu';
2628 with AddScroll(_lc
[I_MENU_GAME_PARTICLES_COUNT
]) do
2630 Name
:= 'scParticlesCount';
2633 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_COUNT
]) do
2635 Name
:= 'swBloodCount';
2636 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2637 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2638 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2639 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2640 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2642 with AddScroll(_lc
[I_MENU_GAME_MAX_SHELLS
]) do
2644 Name
:= 'scShellsMax';
2647 with AddScroll(_lc
[I_MENU_GAME_GIBS_COUNT
]) do
2649 Name
:= 'scGibsMax';
2652 with AddScroll(_lc
[I_MENU_GAME_MAX_CORPSES
]) do
2654 Name
:= 'scCorpsesMax';
2657 with AddSwitch(_lc
[I_MENU_GAME_MAX_GIBS
]) do
2659 Name
:= 'swGibsCount';
2660 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2661 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2662 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2663 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2664 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2666 with AddSwitch(_lc
[I_MENU_GAME_CORPSE_TYPE
]) do
2668 Name
:= 'swCorpseType';
2669 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_SIMPLE
]);
2670 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_ADV
]);
2672 with AddSwitch(_lc
[I_MENU_GAME_GIBS_TYPE
]) do
2674 Name
:= 'swGibsType';
2675 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_SIMPLE
]);
2676 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_ADV
]);
2678 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_TYPE
]) do
2680 Name
:= 'swBloodType';
2681 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_SIMPLE
]);
2682 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_ADV
]);
2684 with AddSwitch(_lc
[I_MENU_GAME_SCREEN_FLASH
]) do
2686 Name
:= 'swScreenFlash';
2687 AddItem(_lc
[I_MENU_NO
]);
2688 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2689 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2691 with AddSwitch(_lc
[I_MENU_GAME_BACKGROUND
]) do
2693 Name
:= 'swBackground';
2694 AddItem(_lc
[I_MENU_YES
]);
2695 AddItem(_lc
[I_MENU_NO
]);
2697 with AddSwitch(_lc
[I_MENU_GAME_MESSAGES
]) do
2699 Name
:= 'swMessages';
2700 AddItem(_lc
[I_MENU_YES
]);
2701 AddItem(_lc
[I_MENU_NO
]);
2703 with AddSwitch(_lc
[I_MENU_GAME_REVERT_PLAYERS
]) do
2705 Name
:= 'swRevertPlayers';
2706 AddItem(_lc
[I_MENU_YES
]);
2707 AddItem(_lc
[I_MENU_NO
]);
2709 with AddSwitch(_lc
[I_MENU_GAME_CHAT_BUBBLE
]) do
2711 Name
:= 'swChatBubble';
2712 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_NONE
]);
2713 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_SIMPLE
]);
2714 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_ADV
]);
2715 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_COLOR
]);
2716 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_TEXTURE
]);
2718 with AddSwitch(_lc
[I_MENU_GAME_PLAYER_INDICATOR
]) do
2720 Name
:= 'swPlayerIndicator';
2721 AddItem(_lc
[I_MENU_YES
]);
2722 AddItem(_lc
[I_MENU_NO
]);
2724 with AddScroll(_lc
[I_MENU_GAME_SCALE_FACTOR
]) do
2726 Name
:= 'scScaleFactor';
2728 OnChange
:= ProcChangeGameSettings
;
2732 Menu
.DefControl
:= 'mOptionsGameMenu';
2733 g_GUI_AddWindow(Menu
);
2735 Menu
:= TGUIWindow
.Create('OptionsControlsMenu');
2736 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROLS_OPTIONS
]))) do
2738 Name
:= 'mOptionsControlsMenu';
2739 AddLine(_lc
[I_MENU_CONTROL_GLOBAL
]);
2740 AddKeyRead(_lc
[I_MENU_CONTROL_SCREENSHOT
]).Name
:= _lc
[I_MENU_CONTROL_SCREENSHOT
];
2741 AddKeyRead(_lc
[I_MENU_CONTROL_STAT
]).Name
:= _lc
[I_MENU_CONTROL_STAT
];
2742 AddKeyRead(_lc
[I_MENU_CONTROL_CHAT
]).Name
:= _lc
[I_MENU_CONTROL_CHAT
];
2743 AddKeyRead(_lc
[I_MENU_CONTROL_TEAMCHAT
]).Name
:= _lc
[I_MENU_CONTROL_TEAMCHAT
];
2745 AddButton(nil, _lc
[I_MENU_PLAYER_1_KBD
], 'OptionsControlsP1Menu');
2746 {AddButton(nil, _lc[I_MENU_PLAYER_1_ALT], 'OptionsControlsP1MenuAlt');}
2747 AddButton(nil, _lc
[I_MENU_PLAYER_1_WEAPONS
], 'OptionsControlsP1MenuWeapons');
2748 AddButton(nil, _lc
[I_MENU_PLAYER_2_KBD
], 'OptionsControlsP2Menu');
2749 {AddButton(nil, _lc[I_MENU_PLAYER_2_ALT], 'OptionsControlsP2MenuAlt');}
2750 AddButton(nil, _lc
[I_MENU_PLAYER_2_WEAPONS
], 'OptionsControlsP2MenuWeapons');
2751 if e_JoysticksAvailable
<> 0 then
2754 AddButton(nil, _lc
[I_MENU_CONTROL_JOYSTICKS
], 'OptionsControlsJoystickMenu');
2756 if g_touch_enabled
then
2759 AddButton(nil, _lc
[I_MENU_CONTROL_TOUCH
], 'OptionsControlsTouchMenu');
2762 Menu
.DefControl
:= 'mOptionsControlsMenu';
2763 g_GUI_AddWindow(Menu
);
2765 Menu
:= TGUIWindow
.Create('OptionsControlsP1Menu');
2766 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_1_KBD
]))) do
2768 Name
:= 'mOptionsControlsP1Menu';
2769 AddKeyRead2(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
2770 AddKeyRead2(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
2771 AddKeyRead2(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
2772 AddKeyRead2(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
2773 AddKeyRead2(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
2774 AddKeyRead2(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
2775 AddKeyRead2(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
2776 AddKeyRead2(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
2777 AddKeyRead2(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
2778 AddKeyRead2(_lc
[I_MENU_CONTROL_STRAFE
]).Name
:= _lc
[I_MENU_CONTROL_STRAFE
];
2780 Menu
.DefControl
:= 'mOptionsControlsP1Menu';
2781 g_GUI_AddWindow(Menu
);
2783 Menu
:= TGUIWindow
.Create('OptionsControlsP1MenuWeapons');
2784 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_1_WEAPONS
]))) do
2786 Name
:= 'mOptionsControlsP1MenuWeapons';
2787 for i
:= WP_FIRST
to WP_LAST
do
2788 AddKeyRead2(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)]).Name
:=
2789 _lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)];
2791 Menu
.DefControl
:= 'mOptionsControlsP1MenuWeapons';
2792 g_GUI_AddWindow(Menu
);
2794 Menu
:= TGUIWindow
.Create('OptionsControlsP2Menu');
2795 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_2_KBD
]))) do
2797 Name
:= 'mOptionsControlsP2Menu';
2798 AddKeyRead2(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
2799 AddKeyRead2(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
2800 AddKeyRead2(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
2801 AddKeyRead2(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
2802 AddKeyRead2(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
2803 AddKeyRead2(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
2804 AddKeyRead2(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
2805 AddKeyRead2(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
2806 AddKeyRead2(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
2807 AddKeyRead2(_lc
[I_MENU_CONTROL_STRAFE
]).Name
:= _lc
[I_MENU_CONTROL_STRAFE
];
2809 Menu
.DefControl
:= 'mOptionsControlsP2Menu';
2810 g_GUI_AddWindow(Menu
);
2812 Menu
:= TGUIWindow
.Create('OptionsControlsP2MenuWeapons');
2813 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_2_WEAPONS
]))) do
2815 Name
:= 'mOptionsControlsP2MenuWeapons';
2816 for i
:= WP_FIRST
to WP_LAST
do
2817 AddKeyRead2(_lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)]).Name
:=
2818 _lc
[TStrings_Locale(Cardinal(I_GAME_WEAPON0
) + i
)];
2820 Menu
.DefControl
:= 'mOptionsControlsP2MenuWeapons';
2821 g_GUI_AddWindow(Menu
);
2823 Menu
:= TGUIWindow
.Create('OptionsControlsJoystickMenu');
2824 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROL_JOYSTICKS
]))) do
2826 Name
:= 'mOptionsControlsJoystickMenu';
2827 for i
:= 0 to e_JoysticksAvailable
-1 do
2828 with AddScroll(Format(_lc
[I_MENU_CONTROL_DEADZONE
], [i
+ 1])) do
2830 Name
:= 'scDeadzone' + IntToStr(i
);
2834 Menu
.DefControl
:= 'mOptionsControlsJoystickMenu';
2835 g_GUI_AddWindow(Menu
);
2837 Menu
:= TGUIWindow
.Create('OptionsControlsTouchMenu');
2838 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROL_TOUCH
]))) do
2840 Name
:= 'mOptionsControlsTouchMenu';
2841 with AddSwitch(_lc
[I_MENU_CONTROL_TOUCH_ALT
]) do
2843 Name
:= 'swTouchAlt';
2844 AddItem(_lc
[I_MENU_NO
]);
2845 AddItem(_lc
[I_MENU_YES
]);
2846 OnChange
:= ProcChangeTouchSettings
;
2848 with AddScroll(_lc
[I_MENU_CONTROL_TOUCH_SIZE
]) do
2850 Name
:= 'scTouchSize';
2852 OnChange
:= ProcChangeTouchSettings
;
2854 with AddSwitch(_lc
[I_MENU_CONTROL_TOUCH_FIRE
]) do
2856 Name
:= 'swTouchFire';
2857 AddItem(_lc
[I_MENU_NO
]);
2858 AddItem(_lc
[I_MENU_YES
]);
2860 with AddScroll(_lc
[I_MENU_CONTROL_TOUCH_OFFSET
]) do
2862 Name
:= 'scTouchOffset';
2864 OnChange
:= ProcChangeTouchSettings
;
2867 Menu
.DefControl
:= 'mOptionsControlsTouchMenu';
2868 g_GUI_AddWindow(Menu
);
2870 Menu
:= TGUIWindow
.Create('OptionsPlayersMenu');
2871 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_OPTIONS
]))) do
2873 Name
:= 'mOptionsPlayersMenu';
2874 AddButton(nil, _lc
[I_MENU_PLAYER_1
], 'OptionsPlayersP1Menu');
2875 AddButton(nil, _lc
[I_MENU_PLAYER_2
], 'OptionsPlayersP2Menu');
2877 Menu
.DefControl
:= 'mOptionsPlayersMenu';
2878 g_GUI_AddWindow(Menu
);
2880 CreatePlayerOptionsMenu('P1');
2881 CreatePlayerOptionsMenu('P2');
2883 Menu
:= TGUIWindow
.Create('OptionsPlayersMIMenu');
2884 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_MODEL_INFO
]))) do
2886 Name
:= 'mOptionsPlayersMIMenu';
2887 with AddLabel(_lc
[I_MENU_MODEL_NAME
]) do
2892 with AddLabel(_lc
[I_MENU_MODEL_AUTHOR
]) do
2897 with AddMemo(_lc
[I_MENU_MODEL_COMMENT
], 14, 6) do
2899 Name
:= 'meComment';
2902 AddLine(_lc
[I_MENU_MODEL_OPTIONS
]);
2903 with AddLabel(_lc
[I_MENU_MODEL_WEAPON
]) do
2906 FixedLength
:= Max(Length(_lc
[I_MENU_YES
]), Length(_lc
[I_MENU_NO
]));
2910 Menu
.DefControl
:= 'mOptionsPlayersMIMenu';
2911 g_GUI_AddWindow(Menu
);
2913 Menu
:= TGUIWindow
.Create('OptionsLanguageMenu');
2914 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_LANGUAGE_OPTIONS
]))) do
2916 Name
:= 'mOptionsLanguageMenu';
2917 AddButton(@ProcSetRussianLanguage
, _lc
[I_MENU_LANGUAGE_RUSSIAN
]);
2918 AddButton(@ProcSetEnglishLanguage
, _lc
[I_MENU_LANGUAGE_ENGLISH
]);
2921 Menu
.DefControl
:= 'mOptionsLanguageMenu';
2922 g_GUI_AddWindow(Menu
);
2924 Menu
:= CreateYNMenu('DefaultOptionsMenu', _lc
[I_MENU_SET_DEFAULT_PROMT
], Round(gScreenWidth
*0.6),
2925 gMenuSmallFont
, @ProcDefaultMenuKeyDown
);
2926 g_GUI_AddWindow(Menu
);
2928 Menu
:= TGUIWindow
.Create('AuthorsMenu');
2929 Menu
.BackTexture
:= 'INTER';
2930 Menu
.OnClose
:= ProcAuthorsClose
;
2934 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_1
], gMenuFont
))) do
2936 Color
:= _RGB(255, 0, 0);
2937 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
2939 _y
:= _y
+GetHeight();
2941 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(Format(_lc
[I_CREDITS_CAP_2
], [GAME_VERSION
, NET_PROTOCOL_VER
]), gMenuSmallFont
))) do
2943 Color
:= _RGB(255, 0, 0);
2944 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
2946 _y
:= _y
+GetHeight()+32;
2948 // ×òî äåëàë: Êòî äåëàë
2949 cx
:= gScreenWidth
div 2 - 320 + 64;
2950 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1
], gMenuSmallFont
))) do
2952 Color
:= _RGB(255, 0, 0);
2957 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1_1
], gMenuSmallFont
))) do
2959 Color
:= _RGB(255, 255, 255);
2964 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2
], gMenuSmallFont
))) do
2966 Color
:= _RGB(255, 0, 0);
2971 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2_1
], gMenuSmallFont
))) do
2973 Color
:= _RGB(255, 255, 255);
2978 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2_2
], gMenuSmallFont
))) do
2980 Color
:= _RGB(255, 255, 255);
2985 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3
], gMenuSmallFont
))) do
2987 Color
:= _RGB(255, 0, 0);
2992 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3_1
], gMenuSmallFont
))) do
2994 Color
:= _RGB(255, 255, 255);
2999 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4
], gMenuSmallFont
))) do
3001 Color
:= _RGB(255, 0, 0);
3006 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4_1
], gMenuSmallFont
))) do
3008 Color
:= _RGB(255, 255, 255);
3011 _y
:= gScreenHeight
- 128;
3014 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_3
], gMenuSmallFont
))) do
3016 Color
:= _RGB(255, 0, 0);
3021 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_1
], gMenuSmallFont
))) do
3023 Color
:= _RGB(255, 255, 255);
3026 _y
:= _y
+GetHeight();
3028 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_2
], gMenuSmallFont
))) do
3030 Color
:= _RGB(255, 255, 255);
3033 _y
:= _y
+GetHeight();
3035 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_3
], gMenuSmallFont
))) do
3037 Color
:= _RGB(255, 255, 255);
3040 _y
:= gScreenHeight
- 32;
3042 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_4
], gMenuSmallFont
))) do
3044 Color
:= _RGB(255, 0, 0);
3045 X
:= gScreenWidth
div 2 - GetWidth() div 2;
3048 g_GUI_AddWindow(Menu
);
3050 Menu
:= CreateYNMenu('ExitMenu', _lc
[I_MENU_EXIT_PROMT
], Round(gScreenWidth
*0.6),
3051 gMenuSmallFont
, @ProcExitMenuKeyDown
);
3052 g_GUI_AddWindow(Menu
);
3054 Menu
:= TGUIWindow
.Create('GameSingleMenu');
3055 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
3057 Name
:= 'mmGameSingleMenu';
3058 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
3059 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
3060 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
3061 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3062 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
3063 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3065 Menu
.DefControl
:= 'mmGameSingleMenu';
3066 Menu
.MainWindow
:= True;
3067 Menu
.OnClose
:= ProcGMClose
;
3068 Menu
.OnShow
:= ProcGMShow
;
3069 g_GUI_AddWindow(Menu
);
3071 Menu
:= CreateYNMenu('EndGameMenu', _lc
[I_MENU_END_GAME_PROMT
], Round(gScreenWidth
*0.6),
3072 gMenuSmallFont
, @ProcEndMenuKeyDown
);
3073 g_GUI_AddWindow(Menu
);
3075 Menu
:= CreateYNMenu('RestartGameMenu', _lc
[I_MENU_RESTART_GAME_PROMT
], Round(gScreenWidth
*0.6),
3076 gMenuSmallFont
, @ProcRestartMenuKeyDown
);
3077 g_GUI_AddWindow(Menu
);
3079 Menu
:= TGUIWindow
.Create('GameCustomMenu');
3080 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
3082 Name
:= 'mmGameCustomMenu';
3083 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
3084 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
3085 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
3086 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
3087 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3088 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
3089 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3091 Menu
.DefControl
:= 'mmGameCustomMenu';
3092 Menu
.MainWindow
:= True;
3093 Menu
.OnClose
:= ProcGMClose
;
3094 Menu
.OnShow
:= ProcGMShow
;
3095 g_GUI_AddWindow(Menu
);
3097 Menu
:= TGUIWindow
.Create('GameServerMenu');
3098 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
3100 Name
:= 'mmGameServerMenu';
3101 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
3102 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
3103 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3104 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
3105 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3107 Menu
.DefControl
:= 'mmGameServerMenu';
3108 Menu
.MainWindow
:= True;
3109 Menu
.OnClose
:= ProcGMClose
;
3110 Menu
.OnShow
:= ProcGMShow
;
3111 g_GUI_AddWindow(Menu
);
3113 Menu
:= TGUIWindow
.Create('GameClientMenu');
3114 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
3116 Name
:= 'mmGameClientMenu';
3117 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
3118 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
3119 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
3121 Menu
.DefControl
:= 'mmGameClientMenu';
3122 Menu
.MainWindow
:= True;
3123 Menu
.OnClose
:= ProcGMClose
;
3124 Menu
.OnShow
:= ProcGMShow
;
3125 g_GUI_AddWindow(Menu
);
3127 Menu
:= TGUIWindow
.Create('ClientPasswordMenu');
3128 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuSmallFont
, gMenuSmallFont
, _lc
[I_MENU_ENTERPASSWORD
]))) do
3130 Name
:= 'mClientPasswordMenu';
3131 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
3139 AddButton(@ProcEnterPassword
, _lc
[I_MENU_START_GAME
]);
3142 Menu
.DefControl
:= 'mClientPasswordMenu';
3143 g_GUI_AddWindow(Menu
);
3145 Menu
:= TGUIWindow
.Create('GameSetGameMenu');
3146 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SET_GAME
]))) do
3148 Name
:= 'mGameSetGameMenu';
3149 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
3151 Name
:= 'swTeamDamage';
3152 AddItem(_lc
[I_MENU_YES
]);
3153 AddItem(_lc
[I_MENU_NO
]);
3156 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
3158 Name
:= 'edTimeLimit';
3163 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
3165 Name
:= 'edGoalLimit';
3170 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
3172 Name
:= 'edMaxLives';
3177 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
3180 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
3181 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
3182 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
3188 Menu
.DefControl
:= 'mGameSetGameMenu';
3189 Menu
.OnClose
:= ProcApplyGameSet
;
3190 g_GUI_AddWindow(Menu
);
3192 Menu
:= TGUIWindow
.Create('TeamMenu');
3193 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_CHANGE_PLAYERS
]))) do
3195 Name
:= 'mmTeamMenu';
3196 AddButton(@ProcJoinRed
, _lc
[I_MENU_JOIN_RED
], '').Name
:= 'tmJoinRed';
3197 AddButton(@ProcJoinBlue
, _lc
[I_MENU_JOIN_BLUE
], '').Name
:= 'tmJoinBlue';
3198 AddButton(@ProcJoinGame
, _lc
[I_MENU_JOIN_GAME
], '').Name
:= 'tmJoinGame';
3199 AddButton(@ProcSwitchP2
, _lc
[I_MENU_ADD_PLAYER_2
], '').Name
:= 'tmPlayer2';
3200 AddButton(@ProcSpectate
, _lc
[I_MENU_SPECTATE
], '').Name
:= 'tmSpectate';
3202 Menu
.DefControl
:= 'mmTeamMenu';
3203 Menu
.OnShow
:= ProcChangePlayers
;
3204 g_GUI_AddWindow(Menu
);
3207 procedure g_Menu_Show_SaveMenu();
3209 if g_Game_IsTestMap
then
3211 if gGameSettings
.GameType
= GT_SINGLE
then
3212 g_GUI_ShowWindow('GameSingleMenu')
3215 if g_Game_IsClient
then
3218 if g_Game_IsNet
then
3221 g_GUI_ShowWindow('GameCustomMenu');
3223 g_GUI_ShowWindow('SaveMenu');
3224 g_Sound_PlayEx('MENU_OPEN');
3227 procedure g_Menu_Show_LoadMenu (standalone
: Boolean=false);
3229 if (g_ActiveWindow
<> nil) and (g_ActiveWindow
.name
= 'LoadMenu') then exit
; // nothing to do
3230 if gGameSettings
.GameType
= GT_SINGLE
then
3232 if not standalone
then g_GUI_ShowWindow('GameSingleMenu')
3236 if g_Game_IsClient
then exit
;
3237 if g_Game_IsNet
then exit
;
3238 if not standalone
then g_GUI_ShowWindow('GameCustomMenu');
3240 g_GUI_ShowWindow('LoadMenu');
3241 g_Sound_PlayEx('MENU_OPEN');
3244 procedure g_Menu_Show_GameSetGame();
3246 if gGameSettings
.GameType
= GT_SINGLE
then
3247 g_GUI_ShowWindow('GameSingleMenu')
3250 if g_Game_IsClient
then
3253 if g_Game_IsNet
then
3254 g_GUI_ShowWindow('GameServerMenu')
3256 g_GUI_ShowWindow('GameCustomMenu');
3259 g_GUI_ShowWindow('GameSetGameMenu');
3260 g_Sound_PlayEx('MENU_OPEN');
3263 procedure g_Menu_Show_OptionsVideo();
3265 if gGameSettings
.GameType
= GT_SINGLE
then
3266 g_GUI_ShowWindow('GameSingleMenu')
3269 if g_Game_IsClient
then
3270 g_GUI_ShowWindow('GameClientMenu')
3272 if g_Game_IsNet
then
3273 g_GUI_ShowWindow('GameServerMenu')
3275 g_GUI_ShowWindow('GameCustomMenu');
3278 g_GUI_ShowWindow('OptionsMenu');
3279 g_GUI_ShowWindow('OptionsVideoMenu');
3280 g_Sound_PlayEx('MENU_OPEN');
3283 procedure g_Menu_Show_OptionsSound();
3285 if gGameSettings
.GameType
= GT_SINGLE
then
3286 g_GUI_ShowWindow('GameSingleMenu')
3289 if g_Game_IsClient
then
3290 g_GUI_ShowWindow('GameClientMenu')
3292 if g_Game_IsNet
then
3293 g_GUI_ShowWindow('GameServerMenu')
3295 g_GUI_ShowWindow('GameCustomMenu');
3298 g_GUI_ShowWindow('OptionsMenu');
3299 g_GUI_ShowWindow('OptionsSoundMenu');
3300 g_Sound_PlayEx('MENU_OPEN');
3303 procedure g_Menu_Show_EndGameMenu();
3305 g_GUI_ShowWindow('EndGameMenu');
3306 g_Sound_PlayEx('MENU_OPEN');
3309 procedure g_Menu_Show_QuitGameMenu();
3311 g_GUI_ShowWindow('ExitMenu');
3312 g_Sound_PlayEx('MENU_OPEN');
3315 procedure g_Menu_Init();
3322 procedure g_Menu_Free();
3326 e_WriteLog('Releasing menu data...', TMsgType
.Notify
);
3331 procedure g_Menu_Reset();
3335 g_GUI_SaveMenuPos();
3336 ex
:= g_GUI_Destroy();
3340 e_WriteLog('Recreating menu...', TMsgType
.Notify
);
3345 g_Game_SetDebugMode();
3347 g_GUI_LoadMenuPos();