5 procedure g_Menu_Init();
6 procedure g_Menu_Free();
7 procedure g_Menu_Reset();
8 procedure LoadStdFont(cfgres
, texture
: string; var FontID
: DWORD
);
9 procedure LoadFont(txtres
, fntres
: string; var FontID
: DWORD
);
10 procedure g_Menu_AskLanguage();
12 procedure g_Menu_Show_SaveMenu();
13 procedure g_Menu_Show_LoadMenu();
14 procedure g_Menu_Show_GameSetGame();
15 procedure g_Menu_Show_OptionsVideo();
16 procedure g_Menu_Show_OptionsSound();
17 procedure g_Menu_Show_EndGameMenu();
18 procedure g_Menu_Show_QuitGameMenu();
22 gMenuSmallFont
: DWORD
;
29 g_gui
, g_textures
, e_graphics
, g_main
, g_window
, g_game
, g_map
,
30 g_basic
, g_console
, g_sound
, g_gfx
, g_player
, g_options
,
31 e_log
, SysUtils
, CONFIG
, g_playermodel
, DateUtils
,
32 MAPSTRUCT
, WADEDITOR
, Math
, WADSTRUCT
, g_saveload
,
33 e_textures
, GL
, GLExt
, g_language
,
34 g_net
, g_netmsg
, g_netmaster
, g_items
, e_input
;
36 procedure ProcChangeColor(Sender
: TGUIControl
); forward;
37 procedure ProcSelectModel(Sender
: TGUIControl
); forward;
39 procedure ProcApplyOptions();
44 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
46 if TGUISwitch(menu
.GetControl('swBPP')).ItemIndex
= 0 then
50 gVSync
:= TGUISwitch(menu
.GetControl('swVSync')).ItemIndex
= 0;
51 gTextureFilter
:= TGUISwitch(menu
.GetControl('swTextureFilter')).ItemIndex
= 0;
53 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
55 g_Sound_SetupAllVolumes(
56 Min(TGUIScroll(menu
.GetControl('scSoundLevel')).Value
*16, 255),
57 Min(TGUIScroll(menu
.GetControl('scMusicLevel')).Value
*16, 255)
60 gMaxSimSounds
:= Max(Min(TGUIScroll(menu
.GetControl('scMaxSimSounds')).Value
*4+2, 66), 2);
61 gMuteWhenInactive
:= TGUISwitch(menu
.GetControl('swInactiveSounds')).ItemIndex
= 1;
62 gAnnouncer
:= TGUISwitch(menu
.GetControl('swAnnouncer')).ItemIndex
;
63 gSoundEffectsDF
:= TGUISwitch(menu
.GetControl('swSoundEffects')).ItemIndex
= 1;
65 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
67 g_GFX_SetMax(TGUIScroll(menu
.GetControl('scParticlesCount')).Value
*1000);
68 g_Shells_SetMax(TGUIScroll(menu
.GetControl('scShellsMax')).Value
*30);
69 g_Gibs_SetMax(TGUIScroll(menu
.GetControl('scGibsMax')).Value
*25);
70 g_Corpses_SetMax(TGUIScroll(menu
.GetControl('scCorpsesMax')).Value
*5);
72 case TGUISwitch(menu
.GetControl('swGibsCount')).ItemIndex
of
77 else gGibsCount
:= 48;
80 gBloodCount
:= TGUISwitch(menu
.GetControl('swBloodCount')).ItemIndex
;
81 gFlash
:= TGUISwitch(menu
.GetControl('swScreenFlash')).ItemIndex
;
82 gAdvBlood
:= TGUISwitch(menu
.GetControl('swBloodType')).ItemIndex
= 1;
83 gAdvCorpses
:= TGUISwitch(menu
.GetControl('swCorpseType')).ItemIndex
= 1;
84 gAdvGibs
:= TGUISwitch(menu
.GetControl('swGibsType')).ItemIndex
= 1;
85 gDrawBackGround
:= TGUISwitch(menu
.GetControl('swBackGround')).ItemIndex
= 0;
86 gShowMessages
:= TGUISwitch(menu
.GetControl('swMessages')).ItemIndex
= 0;
87 gRevertPlayers
:= TGUISwitch(menu
.GetControl('swRevertPlayers')).ItemIndex
= 0;
88 gChatBubble
:= TGUISwitch(menu
.GetControl('swChatBubble')).ItemIndex
;
90 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
92 with menu
, gGameControls
.GameControls
do
94 TakeScreenshot
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_SCREENSHOT
])).Key
;
95 Stat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_STAT
])).Key
;
96 Chat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_CHAT
])).Key
;
97 TeamChat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_TEAMCHAT
])).Key
;
100 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1Menu').GetControl('mOptionsControlsP1Menu'));
102 with menu
, gGameControls
.P1Control
do
104 KeyRight
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key
;
105 KeyLeft
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key
;
106 KeyUp
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key
;
107 KeyDown
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key
;
108 KeyFire
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key
;
109 KeyJump
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key
;
110 KeyNextWeapon
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key
;
111 KeyPrevWeapon
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key
;
112 KeyOpen
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key
;
115 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2Menu').GetControl('mOptionsControlsP2Menu'));
117 with menu
, gGameControls
.P2Control
do
119 KeyRight
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key
;
120 KeyLeft
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key
;
121 KeyUp
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key
;
122 KeyDown
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key
;
123 KeyFire
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key
;
124 KeyJump
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key
;
125 KeyNextWeapon
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key
;
126 KeyPrevWeapon
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key
;
127 KeyOpen
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key
;
130 if e_JoysticksAvailable
> 0 then
132 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsJoystickMenu').GetControl('mOptionsControlsJoystickMenu'));
135 for i
:= 0 to e_JoysticksAvailable
-1 do
136 e_JoystickDeadzones
[i
] := TGUIScroll(menu
.GetControl('scDeadzone' + IntToStr(i
))).Value
*(32767 div 20);
140 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
142 gPlayer1Settings
.Name
:= b_Text_Unformat(TGUIEdit(menu
.GetControl('edP1Name')).Text);
143 gPlayer1Settings
.Team
:= IfThen(TGUISwitch(menu
.GetControl('swP1Team')).ItemIndex
= 0,
144 TEAM_RED
, TEAM_BLUE
);
146 with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mvP1Model')) do
148 gPlayer1Settings
.Model
:= Model
.Name
;
149 gPlayer1Settings
.Color
:= Model
.Color
;
152 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
154 gPlayer2Settings
.Name
:= b_Text_Unformat(TGUIEdit(menu
.GetControl('edP2Name')).Text);
155 gPlayer2Settings
.Team
:= IfThen(TGUISwitch(menu
.GetControl('swP2Team')).ItemIndex
= 0,
156 TEAM_RED
, TEAM_BLUE
);
157 with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mvP2Model')) do
159 gPlayer2Settings
.Model
:= Model
.Name
;
160 gPlayer2Settings
.Color
:= Model
.Color
;
163 if gPlayer1Settings
.Name
= '' then gPlayer1Settings
.Name
:= 'Player1';
164 if gPlayer2Settings
.Name
= '' then gPlayer2Settings
.Name
:= 'Player2';
166 if g_Game_IsServer
then
168 if gPlayer1
<> nil then
170 gPlayer1
.SetModel(gPlayer1Settings
.Model
);
171 gPlayer1
.Name
:= gPlayer1Settings
.Name
;
172 if not (gGameSettings
.GameMode
in [GM_TDM
, GM_CTF
]) then
173 gPlayer1
.SetColor(gPlayer1Settings
.Color
)
175 if gPlayer1
.Team
<> gPlayer1Settings
.Team
then
178 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
181 if gPlayer2
<> nil then
183 gPlayer2
.SetModel(gPlayer2Settings
.Model
);
184 gPlayer2
.Name
:= gPlayer2Settings
.Name
;
185 if (gGameSettings
.GameMode
<> GM_TDM
) and (gGameSettings
.GameMode
<> GM_CTF
) then
186 gPlayer2
.SetColor(gPlayer2Settings
.Color
)
188 if gPlayer2
.Team
<> gPlayer2Settings
.Team
then
193 if g_Game_IsClient
then MC_SEND_PlayerSettings
;
195 g_Options_Write(GameDir
+'/'+CONFIG_FILENAME
);
198 procedure ReadOptions();
203 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
205 with TGUISwitch(menu
.GetControl('swBPP')) do
211 with TGUISwitch(menu
.GetControl('swTextureFilter')) do
212 if gTextureFilter
then ItemIndex
:= 0 else ItemIndex
:= 1;
214 with TGUISwitch(menu
.GetControl('swVSync')) do
215 if gVSync
then ItemIndex
:= 0 else ItemIndex
:= 1;
217 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
219 TGUIScroll(menu
.GetControl('scSoundLevel')).Value
:= Round(gSoundLevel
/16);
220 TGUIScroll(menu
.GetControl('scMusicLevel')).Value
:= Round(gMusicLevel
/16);
221 TGUIScroll(menu
.GetControl('scMaxSimSounds')).Value
:= Round((gMaxSimSounds
-2)/4);
223 with TGUISwitch(menu
.GetControl('swInactiveSounds')) do
224 if gMuteWhenInactive
then
229 TGUISwitch(menu
.GetControl('swAnnouncer')).ItemIndex
:= gAnnouncer
;
231 with TGUISwitch(menu
.GetControl('swSoundEffects')) do
232 if gSoundEffectsDF
then
237 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1Menu').GetControl('mOptionsControlsP1Menu'));
239 with menu
, gGameControls
.P1Control
do
241 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key
:= KeyRight
;
242 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key
:= KeyLeft
;
243 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key
:= KeyUp
;
244 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key
:= KeyDown
;
245 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key
:= KeyFire
;
246 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key
:= KeyJump
;
247 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key
:= KeyNextWeapon
;
248 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key
:= KeyPrevWeapon
;
249 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key
:= KeyOpen
;
252 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2Menu').GetControl('mOptionsControlsP2Menu'));
254 with menu
, gGameControls
.P2Control
do
256 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key
:= KeyRight
;
257 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key
:= KeyLeft
;
258 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key
:= KeyUp
;
259 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key
:= KeyDown
;
260 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key
:= KeyFire
;
261 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key
:= KeyJump
;
262 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key
:= KeyNextWeapon
;
263 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key
:= KeyPrevWeapon
;
264 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key
:= KeyOpen
;
267 if e_JoysticksAvailable
> 0 then
269 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsJoystickMenu').GetControl('mOptionsControlsJoystickMenu'));
272 for i
:= 0 to e_JoysticksAvailable
-1 do
273 TGUIScroll(menu
.GetControl('scDeadzone' + IntToStr(i
))).Value
:= e_JoystickDeadzones
[i
] div (32767 div 20);
277 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
278 with menu
, gGameControls
.GameControls
do
280 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_SCREENSHOT
])).Key
:= TakeScreenshot
;
281 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_STAT
])).Key
:= Stat
;
282 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_CHAT
])).Key
:= Chat
;
283 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_TEAMCHAT
])).Key
:= TeamChat
;
286 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
288 TGUIScroll(menu
.GetControl('scParticlesCount')).Value
:= g_GFX_GetMax() div 1000;
289 TGUIScroll(menu
.GetControl('scShellsMax')).Value
:= g_Shells_GetMax() div 30;
290 TGUIScroll(menu
.GetControl('scGibsMax')).Value
:= g_Gibs_GetMax() div 25;
291 TGUIScroll(menu
.GetControl('scCorpsesMax')).Value
:= g_Corpses_GetMax() div 5;
292 TGUISwitch(menu
.GetControl('swBloodCount')).ItemIndex
:= gBloodCount
;
294 with TGUISwitch(menu
.GetControl('swScreenFlash')) do
297 with TGUISwitch(menu
.GetControl('swBloodType')) do
298 if gAdvBlood
then ItemIndex
:= 1 else ItemIndex
:= 0;
300 with TGUISwitch(menu
.GetControl('swCorpseType')) do
301 if gAdvCorpses
then ItemIndex
:= 1 else ItemIndex
:= 0;
303 with TGUISwitch(menu
.GetControl('swGibsType')) do
304 if gAdvGibs
then ItemIndex
:= 1 else ItemIndex
:= 0;
306 with TGUISwitch(menu
.GetControl('swGibsCount')) do
315 with TGUISwitch(menu
.GetControl('swBackGround')) do
316 if gDrawBackGround
then ItemIndex
:= 0 else ItemIndex
:= 1;
318 with TGUISwitch(menu
.GetControl('swMessages')) do
319 if gShowMessages
then ItemIndex
:= 0 else ItemIndex
:= 1;
321 with TGUISwitch(menu
.GetControl('swRevertPlayers')) do
322 if gRevertPlayers
then ItemIndex
:= 0 else ItemIndex
:= 1;
324 with TGUISwitch(menu
.GetControl('swChatBubble')) do
325 ItemIndex
:= gChatBubble
;
327 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
329 TGUIListBox(menu
.GetControl('lsP1Model')).SelectItem(gPlayer1Settings
.Model
);
330 TGUIEdit(menu
.GetControl('edP1Name')).Text := gPlayer1Settings
.Name
;
332 TGUISwitch(menu
.GetControl('swP1Team')).ItemIndex
:=
333 IfThen(gPlayer1Settings
.Team
= TEAM_BLUE
, 1, 0);
335 TGUIScroll(menu
.GetControl('scP1Red')).Value
:= Round(gPlayer1Settings
.Color
.R
/16);
336 TGUIScroll(menu
.GetControl('scP1Green')).Value
:= Round(gPlayer1Settings
.Color
.G
/16);
337 TGUIScroll(menu
.GetControl('scP1Blue')).Value
:= Round(gPlayer1Settings
.Color
.B
/16);
339 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
341 TGUIListBox(menu
.GetControl('lsP2Model')).SelectItem(gPlayer2Settings
.Model
);
342 TGUIEdit(menu
.GetControl('edP2Name')).Text := gPlayer2Settings
.Name
;
344 TGUISwitch(menu
.GetControl('swP2Team')).ItemIndex
:=
345 IfThen(gPlayer2Settings
.Team
= TEAM_BLUE
, 1, 0);
347 TGUIScroll(menu
.GetControl('scP2Red')).Value
:= Round(gPlayer2Settings
.Color
.R
/16);
348 TGUIScroll(menu
.GetControl('scP2Green')).Value
:= Round(gPlayer2Settings
.Color
.G
/16);
349 TGUIScroll(menu
.GetControl('scP2Blue')).Value
:= Round(gPlayer2Settings
.Color
.B
/16);
351 ProcSelectModel(nil);
354 procedure ProcSwitchMonstersCustom(Sender
: TGUIControl
);
356 with TGUIMenu(g_ActiveWindow
.GetControl('mCustomGameMenu')) do
357 if TGUISwitch(GetControl('swGameMode')).GetText
= _lc
[I_MENU_GAME_TYPE_COOP
] then
358 TGUISwitch(GetControl('swMonsters')).ItemIndex
:= 0
360 TGUISwitch(GetControl('swMonsters')).ItemIndex
:= 1;
363 procedure ProcSwitchMonstersNet(Sender
: TGUIControl
);
365 with TGUIMenu(g_ActiveWindow
.GetControl('mNetServerMenu')) do
366 if TGUISwitch(GetControl('swGameMode')).GetText
= _lc
[I_MENU_GAME_TYPE_COOP
] then
367 TGUISwitch(GetControl('swMonsters')).ItemIndex
:= 0
369 TGUISwitch(GetControl('swMonsters')).ItemIndex
:= 1;
372 procedure ProcStartCustomGame();
378 with TGUIMenu(g_ActiveWindow
.GetControl('mCustomGameMenu')) do
380 Map
:= TGUILabel(GetControl('lbMap')).Text;
383 if Pos(':\', Map
) = 0 then
386 GameMode
:= TGUISwitch(GetControl('swGameMode')).ItemIndex
+1;
387 gcGameMode
:= TGUISwitch(GetControl('swGameMode')).GetText
;
388 gcTimeLimit
:= StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
389 gcGoalLimit
:= StrToIntDef(TGUIEdit(GetControl('edGoalLimit')).Text, 0);
390 gcMaxLives
:= StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
392 gcTeamDamage
:= TGUISwitch(GetControl('swTeamDamage')).ItemIndex
= 0;
393 gcAllowExit
:= TGUISwitch(GetControl('swEnableExits')).ItemIndex
= 0;
394 gcWeaponStay
:= TGUISwitch(GetControl('swWeaponStay')).ItemIndex
= 0;
395 gcMonsters
:= TGUISwitch(GetControl('swMonsters')).ItemIndex
= 0;
398 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
400 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
402 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
404 Options
:= Options
or GAME_OPTION_MONSTERS
;
405 gcPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
;
407 case TGUISwitch(GetControl('swBotsVS')).ItemIndex
of
409 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
410 gcBotsVS
:= 'Monsters';
413 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
414 gcBotsVS
:= 'Everybody';
417 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
418 gcBotsVS
:= 'Players';
425 g_Options_Write_Gameplay_Custom(GameDir
+'/'+CONFIG_FILENAME
);
427 g_Game_StartCustom(Map
, GameMode
, gcTimeLimit
, gcGoalLimit
,
428 gcMaxLives
, Options
, gcPlayers
);
432 procedure ProcStartNetGame();
438 with TGUIMenu(g_ActiveWindow
.GetControl('mNetServerMenu')) do
440 Map
:= TGUILabel(GetControl('lbMap')).Text;
443 if Pos(':\', Map
) = 0 then
446 GameMode
:= TGUISwitch(GetControl('swGameMode')).ItemIndex
+1;
447 gnGameMode
:= TGUISwitch(GetControl('swGameMode')).GetText
;
448 gnTimeLimit
:= StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
449 gnGoalLimit
:= StrToIntDef(TGUIEdit(GetControl('edGoalLimit')).Text, 0);
450 gnMaxLives
:= StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
451 NetPort
:= StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
453 gnTeamDamage
:= TGUISwitch(GetControl('swTeamDamage')).ItemIndex
= 0;
454 gnAllowExit
:= TGUISwitch(GetControl('swEnableExits')).ItemIndex
= 0;
455 gnWeaponStay
:= TGUISwitch(GetControl('swWeaponStay')).ItemIndex
= 0;
456 gnMonsters
:= TGUISwitch(GetControl('swMonsters')).ItemIndex
= 0;
459 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
461 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
463 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
465 Options
:= Options
or GAME_OPTION_MONSTERS
;
466 gnPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
;
468 case TGUISwitch(GetControl('swBotsVS')).ItemIndex
of
470 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
471 gnBotsVS
:= 'Monsters';
474 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
475 gnBotsVS
:= 'Everybody';
478 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
479 gnBotsVS
:= 'Players';
484 NetServerName
:= TGUIEdit(GetControl('edSrvName')).Text;
485 NetMaxClients
:= Max(1, StrToIntDef(TGUIEdit(GetControl('edMaxPlayers')).Text, 1));
486 NetMaxClients
:= Min(NET_MAXCLIENTS
, NetMaxClients
);
487 NetPassword
:= TGUIEdit(GetControl('edSrvPassword')).Text;
488 NetUseMaster
:= TGUISwitch(GetControl('swUseMaster')).ItemIndex
= 0;
491 g_Options_Write_Net_Server(GameDir
+'/'+CONFIG_FILENAME
);
492 g_Options_Write_Gameplay_Net(GameDir
+'/'+CONFIG_FILENAME
);
494 g_Game_StartServer(Map
, GameMode
, gnTimeLimit
, gnGoalLimit
, gnMaxLives
,
495 Options
, gnPlayers
, 0, NetPort
);
498 procedure ProcConnectNetGame();
502 with TGUIMenu(g_ActiveWindow
.GetControl('mNetClientMenu')) do
504 NetClientIP
:= TGUIEdit(GetControl('edIP')).Text;
505 NetClientPort
:= StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
506 PW
:= TGUIEdit(GetControl('edPW')).Text;
509 g_Options_Write_Net_Client(GameDir
+'/'+CONFIG_FILENAME
);
510 g_Game_StartClient(NetClientIP
, NetClientPort
, PW
);
513 procedure ProcEnterPassword();
517 with TGUIMenu(g_ActiveWindow
.GetControl('mClientPasswordMenu')) do
519 NetClientIP
:= PromptIP
;
520 NetClientPort
:= PromptPort
;
521 PW
:= TGUIEdit(GetControl('edPW')).Text;
524 g_Options_Write_Net_Client(GameDir
+'/'+CONFIG_FILENAME
);
525 g_Game_StartClient(NetClientIP
, NetClientPort
, PW
);
528 procedure ProcServerlist();
530 if not NetInitDone
then
532 if (not g_Net_Init()) then
534 g_Console_Add('NET: ERROR: Failed to init ENet!');
541 g_Net_Slist_Set(NetSlistIP
, NetSlistPort
);
543 gState
:= STATE_SLIST
;
544 g_ActiveWindow
:= nil;
546 slWaitStr
:= _lc
[I_NET_SLIST_WAIT
];
551 slReturnPressed
:= True;
552 if g_Net_Slist_Fetch(slCurrent
) then
554 if slCurrent
= nil then
555 slWaitStr
:= _lc
[I_NET_SLIST_NOSERVERS
];
558 slWaitStr
:= _lc
[I_NET_SLIST_ERROR
];
561 procedure ProcStartCampaign();
567 with TGUIMenu(g_ActiveWindow
.GetControl('mCampaignMenu')) do
569 WAD
:= ExtractRelativePath(MapsDir
, TGUIFileListBox(GetControl('lsWAD')).SelectedItem());
570 TwoPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
= 1;
577 g_Game_StartSingle(WAD
+ ':\MAP01', TwoPlayers
, n
);
580 procedure ProcSelectMap(Sender
: TGUIControl
);
584 wad
, map
, res
: String;
586 win
:= g_GUI_GetWindow('SelectMapMenu');
587 with TGUIMenu(win
.GetControl('mSelectMapMenu')) do
589 wad
:= TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem();
590 map
:= TGUIListBox(GetControl('lsMapRes')).SelectedItem();
592 if (wad
= '') or (map
= '') then
593 begin // Ýòî íå êàðòà
594 TGUILabel(GetControl('lbMapName')).Text := '';
595 TGUILabel(GetControl('lbMapAuthor')).Text := '';
596 TGUILabel(GetControl('lbMapSize')).Text := '';
597 TGUIMemo(GetControl('meMapDescription')).SetText('');
598 TGUIMapPreview(win
.GetControl('mpMapPreview')).ClearMap();
599 TGUILabel(win
.GetControl('lbMapScale')).Text := '';
605 a
:= g_Map_GetMapInfo(res
);
607 TGUILabel(GetControl('lbMapName')).Text := a
.Name
;
608 TGUILabel(GetControl('lbMapAuthor')).Text := a
.Author
;
609 TGUILabel(GetControl('lbMapSize')).Text := Format('%dx%d', [a
.Width
, a
.Height
]);
610 TGUIMemo(GetControl('meMapDescription')).SetText(a
.Description
);
611 TGUIMapPreview(win
.GetControl('mpMapPreview')).SetMap(res
);
612 TGUILabel(win
.GetControl('lbMapScale')).Text :=
613 TGUIMapPreview(win
.GetControl('mpMapPreview')).GetScaleStr
;
618 procedure ProcSelectWAD(Sender
: TGUIControl
);
623 with TGUIMenu(g_GUI_GetWindow('SelectMapMenu').GetControl('mSelectMapMenu')) do
625 wad
:= TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem();
627 with TGUIListBox(GetControl('lsMapRes')) do
633 list
:= g_Map_GetMapsList(wad
);
647 procedure ProcSelectCampaignWAD(Sender
: TGUIControl
);
653 win
:= g_GUI_GetWindow('CampaignMenu');
654 with TGUIMenu(win
.GetControl('mCampaignMenu')) do
656 wad
:= TGUIFileListBox(GetControl('lsWAD')).SelectedItem();
660 TGUILabel(GetControl('lbWADName')).Text := '';
661 TGUILabel(GetControl('lbWADAuthor')).Text := '';
662 TGUIMemo(GetControl('meWADDescription')).SetText('');
665 a
:= g_Game_GetMegaWADInfo(wad
);
667 TGUILabel(GetControl('lbWADName')).Text := a
.Name
;
668 TGUILabel(GetControl('lbWADAuthor')).Text := a
.Author
;
669 TGUIMemo(GetControl('meWADDescription')).SetText(a
.Description
);
671 TGUIImage(win
.GetControl('mpWADImage')).ClearImage();
675 g_ProcessResourceStr(a
.pic
, @fn
, nil, nil);
677 TGUIImage(win
.GetControl('mpWADImage')).SetImage(wad
+a
.pic
)
679 TGUIImage(win
.GetControl('mpWADImage')).SetImage(a
.pic
);
684 procedure ProcChangeColor(Sender
: TGUIControl
);
688 window
:= g_GUI_GetWindow('OptionsPlayersP1Menu');
689 with TGUIMenu(window
.GetControl('mOptionsPlayersP1Menu')) do
690 TGUIModelView(window
.GetControl('mvP1Model')).SetColor(
691 Min(TGUIScroll(GetControl('scP1Red')).Value
*16, 255),
692 Min(TGUIScroll(GetControl('scP1Green')).Value
*16, 255),
693 Min(TGUIScroll(GetControl('scP1Blue')).Value
*16, 255));
695 window
:= g_GUI_GetWindow('OptionsPlayersP2Menu');
696 with TGUIMenu(window
.GetControl('mOptionsPlayersP2Menu')) do
697 TGUIModelView(window
.GetControl('mvP2Model')).SetColor(
698 Min(TGUIScroll(GetControl('scP2Red')).Value
*16, 255),
699 Min(TGUIScroll(GetControl('scP2Green')).Value
*16, 255),
700 Min(TGUIScroll(GetControl('scP2Blue')).Value
*16, 255));
703 procedure ProcSelectModel(Sender
: TGUIControl
);
708 window
:= g_GUI_GetWindow('OptionsPlayersP1Menu');
709 a
:= TGUIListBox(TGUIMenu(window
.GetControl('mOptionsPlayersP1Menu')).GetControl('lsP1Model')).SelectedItem
;
710 if a
<> '' then TGUIModelView(window
.GetControl('mvP1Model')).SetModel(a
);
712 window
:= g_GUI_GetWindow('OptionsPlayersP2Menu');
713 a
:= TGUIListBox(TGUIMenu(window
.GetControl('mOptionsPlayersP2Menu')).GetControl('lsP2Model')).SelectedItem
;
714 if a
<> '' then TGUIModelView(window
.GetControl('mvP2Model')).SetModel(a
);
716 ProcChangeColor(nil);
719 procedure LoadStdFont(cfgres
, texture
: string; var FontID
: DWORD
);
731 wad
:= TWADEditor_1
.Create
;
732 if wad
.ReadFile(GameWAD
) then
733 wad
.GetResource('FONTS', cfgres
, cfgdata
, cfglen
);
738 g_Texture_CreateWADEx('FONT_STD', GameWAD
+':FONTS\'+texture
);
740 config
:= TConfig
.CreateMem(cfgdata
, cfglen
);
741 cwdt
:= Min(Max(config
.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
742 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
743 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
745 if g_Texture_Get('FONT_STD', ID
) then
746 e_TextureFontBuild(ID
, FontID
, cwdt
, chgt
, spc
);
751 if cfglen
<> 0 then FreeMem(cfgdata
);
754 procedure LoadFont(txtres
, fntres
: string; var FontID
: DWORD
);
760 cfgdata
, fntdata
: Pointer;
761 cfglen
, fntlen
: Integer;
769 wad
:= TWADEditor_1
.Create
;
770 if wad
.ReadFile(GameWAD
) then
772 wad
.GetResource('FONTS', txtres
, cfgdata
, cfglen
);
773 wad
.GetResource('FONTS', fntres
, fntdata
, fntlen
);
779 config
:= TConfig
.CreateMem(cfgdata
, cfglen
);
780 cwdt
:= Min(Max(config
.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
781 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
783 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
784 FontID
:= e_CharFont_Create(spc
);
788 chrwidth
:= config
.ReadInt(IntToStr(a
), 'Width', 0);
789 if chrwidth
= 0 then Continue
;
791 if e_CreateTextureMemEx(fntdata
, CharID
, cwdt
*(a
mod 16), chgt
*(a
div 16),
793 e_CharFont_AddChar(FontID
, CharID
, Chr(a
), chrwidth
);
799 if cfglen
<> 0 then FreeMem(cfgdata
);
800 if fntlen
<> 0 then FreeMem(fntdata
);
803 procedure MenuLoadData();
805 e_WriteLog('Loading menu data...', MSG_NOTIFY
);
807 g_Texture_CreateWADEx('MAINMENU_MARKER1', GameWAD
+':TEXTURES\MARKER1');
808 g_Texture_CreateWADEx('MAINMENU_MARKER2', GameWAD
+':TEXTURES\MARKER2');
809 g_Texture_CreateWADEx('SCROLL_LEFT', GameWAD
+':TEXTURES\SLEFT');
810 g_Texture_CreateWADEx('SCROLL_RIGHT', GameWAD
+':TEXTURES\SRIGHT');
811 g_Texture_CreateWADEx('SCROLL_MIDDLE', GameWAD
+':TEXTURES\SMIDDLE');
812 g_Texture_CreateWADEx('SCROLL_MARKER', GameWAD
+':TEXTURES\SMARKER');
813 g_Texture_CreateWADEx('EDIT_LEFT', GameWAD
+':TEXTURES\ELEFT');
814 g_Texture_CreateWADEx('EDIT_RIGHT', GameWAD
+':TEXTURES\ERIGHT');
815 g_Texture_CreateWADEx('EDIT_MIDDLE', GameWAD
+':TEXTURES\EMIDDLE');
816 g_Texture_CreateWADEx('BOX1', GameWAD
+':TEXTURES\BOX1');
817 g_Texture_CreateWADEx('BOX2', GameWAD
+':TEXTURES\BOX2');
818 g_Texture_CreateWADEx('BOX3', GameWAD
+':TEXTURES\BOX3');
819 g_Texture_CreateWADEx('BOX4', GameWAD
+':TEXTURES\BOX4');
820 g_Texture_CreateWADEx('BOX5', GameWAD
+':TEXTURES\BOX5');
821 g_Texture_CreateWADEx('BOX6', GameWAD
+':TEXTURES\BOX6');
822 g_Texture_CreateWADEx('BOX7', GameWAD
+':TEXTURES\BOX7');
823 g_Texture_CreateWADEx('BOX8', GameWAD
+':TEXTURES\BOX8');
824 g_Texture_CreateWADEx('BOX9', GameWAD
+':TEXTURES\BOX9');
825 g_Texture_CreateWADEx('BSCROLL_UP_A', GameWAD
+':TEXTURES\SCROLLUPA');
826 g_Texture_CreateWADEx('BSCROLL_UP_U', GameWAD
+':TEXTURES\SCROLLUPU');
827 g_Texture_CreateWADEx('BSCROLL_DOWN_A', GameWAD
+':TEXTURES\SCROLLDOWNA');
828 g_Texture_CreateWADEx('BSCROLL_DOWN_U', GameWAD
+':TEXTURES\SCROLLDOWNU');
829 g_Texture_CreateWADEx('BSCROLL_MIDDLE', GameWAD
+':TEXTURES\SCROLLMIDDLE');
830 g_Texture_CreateWADEx('NOPIC', GameWAD
+':TEXTURES\NOPIC');
832 g_Sound_CreateWADEx('MENU_SELECT', GameWAD
+':SOUNDS\MENUSELECT');
833 g_Sound_CreateWADEx('MENU_OPEN', GameWAD
+':SOUNDS\MENUOPEN');
834 g_Sound_CreateWADEx('MENU_CLOSE', GameWAD
+':SOUNDS\MENUCLOSE');
835 g_Sound_CreateWADEx('MENU_CHANGE', GameWAD
+':SOUNDS\MENUCHANGE');
836 g_Sound_CreateWADEx('SCROLL_ADD', GameWAD
+':SOUNDS\SCROLLADD');
837 g_Sound_CreateWADEx('SCROLL_SUB', GameWAD
+':SOUNDS\SCROLLSUB');
838 g_Sound_CreateWADEx('SOUND_PLAYER_FALL', GameWAD
+':SOUNDS\FALL');
841 procedure MenuFreeData();
843 e_CharFont_Remove(gMenuFont
);
844 e_CharFont_Remove(gMenuSmallFont
);
846 g_Texture_Delete('MAINMENU_MARKER1');
847 g_Texture_Delete('MAINMENU_MARKER2');
848 g_Texture_Delete('SCROLL_LEFT');
849 g_Texture_Delete('SCROLL_RIGHT');
850 g_Texture_Delete('SCROLL_MIDDLE');
851 g_Texture_Delete('SCROLL_MARKER');
852 g_Texture_Delete('EDIT_LEFT');
853 g_Texture_Delete('EDIT_RIGHT');
854 g_Texture_Delete('EDIT_MIDDLE');
855 g_Texture_Delete('BOX1');
856 g_Texture_Delete('BOX2');
857 g_Texture_Delete('BOX3');
858 g_Texture_Delete('BOX4');
859 g_Texture_Delete('BOX5');
860 g_Texture_Delete('BOX6');
861 g_Texture_Delete('BOX7');
862 g_Texture_Delete('BOX8');
863 g_Texture_Delete('BOX9');
864 g_Texture_Delete('BSCROLL_UP_A');
865 g_Texture_Delete('BSCROLL_UP_U');
866 g_Texture_Delete('BSCROLL_DOWN_A');
867 g_Texture_Delete('BSCROLL_DOWN_U');
868 g_Texture_Delete('BSCROLL_MIDDLE');
869 g_Texture_Delete('NOPIC');
871 g_Sound_Delete('MENU_SELECT');
872 g_Sound_Delete('MENU_OPEN');
873 g_Sound_Delete('MENU_CLOSE');
874 g_Sound_Delete('MENU_CHANGE');
875 g_Sound_Delete('SCROLL_ADD');
876 g_Sound_Delete('SCROLL_SUB');
877 g_Sound_Delete('SOUND_PLAYER_FALL');
880 procedure ProcAuthorsMenu();
882 gMusic
.SetByName('MUSIC_INTERMUS');
886 procedure ProcExitMenuKeyDown(Key
: Byte);
894 g_Game_StopAllSounds(True);
896 0: s
:= 'SOUND_MONSTER_PAIN';
897 1: s
:= 'SOUND_MONSTER_DIE_3';
898 2: s
:= 'SOUND_MONSTER_SLOP';
899 3: s
:= 'SOUND_MONSTER_DEMON_DIE';
900 4: s
:= 'SOUND_MONSTER_IMP_DIE_2';
901 5: s
:= 'SOUND_MONSTER_MAN_DIE';
902 6: s
:= 'SOUND_MONSTER_BSP_DIE';
903 7: s
:= 'SOUND_MONSTER_VILE_DIE';
904 8: s
:= 'SOUND_MONSTER_SKEL_DIE';
905 9: s
:= 'SOUND_MONSTER_MANCUB_ALERT';
906 10: s
:= 'SOUND_MONSTER_PAIN_PAIN';
907 11: s
:= 'SOUND_MONSTER_BARON_DIE';
908 12: s
:= 'SOUND_MONSTER_CACO_DIE';
909 13: s
:= 'SOUND_MONSTER_CYBER_DIE';
910 14: s
:= 'SOUND_MONSTER_KNIGHT_ALERT';
911 15: s
:= 'SOUND_MONSTER_SPIDER_ALERT';
912 else s
:= 'SOUND_PLAYER_FALL';
915 snd
:= TPlayableSound
.Create();
916 res
:= snd
.SetByName(s
);
918 res
:= snd
.SetByName('SOUND_PLAYER_FALL');
923 while snd
.IsPlaying() do
934 procedure ProcLoadMenu();
939 TGUIEdit(TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a
))).Text :=
943 procedure ProcSaveMenu();
948 TGUIEdit(TGUIMenu(g_GUI_GetWindow('SaveMenu').GetControl('mmSaveMenu')).GetControl('edSlot'+IntToStr(a
))).Text :=
952 procedure ProcSaveGame(Sender
: TGUIControl
);
956 if g_Game_IsNet
then Exit
;
957 if g_Game_IsTestMap
then Exit
;
958 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
959 g_Game_PauseAllSounds(True);
960 g_SaveGame(a
, TGUIEdit(Sender
).Text);
962 g_ActiveWindow
:= nil;
966 procedure ProcLoadGame(Sender
: TGUIControl
);
970 if g_Game_IsNet
then Exit
;
971 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
972 if g_LoadGame(a
) then
973 g_Game_PauseAllSounds(False)
974 else // Íå çàãðóçèëîñü - âîçâðàò â ìåíþ
975 g_GUI_GetWindow('LoadMenu').SetActive(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu'));
978 procedure ProcSingle1Player();
980 g_Game_StartSingle('megawads/DOOM2D.WAD:\MAP01', False, 1);
983 procedure ProcSingle2Players();
985 g_Game_StartSingle('megawads/DOOM2D.WAD:\MAP01', True, 2);
988 procedure ProcSelectMapMenu();
991 wad_lb
: TGUIFileListBox
;
995 menu
:= TGUIMenu(g_GUI_GetWindow('SelectMapMenu').GetControl('mSelectMapMenu'));
996 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsMapWAD'));
997 map_lb
:= TGUIListBox(menu
.GetControl('lsMapRes'));
999 if wad_lb
.SelectedItem() <> '' then
1000 map
:= map_lb
.SelectedItem()
1004 wad_lb
.UpdateFileList();
1007 if wad_lb
.SelectedItem() <> '' then
1010 map_lb
.SelectItem(map
);
1012 if map_lb
.SelectedItem() <> '' then
1016 g_GUI_ShowWindow('SelectMapMenu');
1019 procedure ProcSelectCampaignMenu();
1022 wad_lb
: TGUIFileListBox
;
1024 menu
:= TGUIMenu(g_GUI_GetWindow('CampaignMenu').GetControl('mCampaignMenu'));
1025 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsWAD'));
1027 wad_lb
.UpdateFileList();
1029 if wad_lb
.SelectedItem() <> '' then
1030 ProcSelectCampaignWAD(nil);
1033 procedure ProcSetMap();
1035 wad
, map
, res
: String;
1037 with TGUIMenu(g_ActiveWindow
.GetControl('mSelectMapMenu')) do
1039 wad
:= ExtractRelativePath(MapsDir
, TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem());
1040 map
:= TGUIListBox(GetControl('lsMapRes')).SelectedItem();
1043 if (wad
= '') or (map
= '') then
1046 res
:= wad
+':\'+map
;
1048 TGUILabel(TGUIMenu(g_GUI_GetWindow('CustomGameMenu').GetControl('mCustomGameMenu')).GetControl('lbMap')).Text := res
;
1049 TGUILabel(TGUIMenu(g_GUI_GetWindow('NetServerMenu').GetControl('mNetServerMenu')).GetControl('lbMap')).Text := res
;
1052 procedure ProcChangeSoundSettings(Sender
: TGUIControl
);
1056 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
1058 g_Sound_SetupAllVolumes(
1059 Min(TGUIScroll(menu
.GetControl('scSoundLevel')).Value
*16, 255),
1060 Min(TGUIScroll(menu
.GetControl('scMusicLevel')).Value
*16, 255)
1064 procedure ProcOptionsPlayersMIMenu();
1069 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1071 a
:= TGUIListBox(TGUIMenu(g_ActiveWindow
.GetControl('mOptionsPlayers'+s
+'Menu')).GetControl('ls'+s
+'Model')).SelectedItem
;
1073 if a
= '' then Exit
;
1075 b
:= g_PlayerModel_GetInfo(a
);
1077 with TGUIMenu(g_GUI_GetWindow('OptionsPlayersMIMenu').GetControl('mOptionsPlayersMIMenu')) do
1079 TGUILabel(GetControl('lbName')).Text := b
.Name
;
1080 TGUILabel(GetControl('lbAuthor')).Text := b
.Author
;
1081 TGUIMemo(GetControl('meComment')).SetText(b
.Description
);
1083 if b
.HaveWeapon
then
1084 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_YES
]
1086 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_NO
];
1089 g_GUI_ShowWindow('OptionsPlayersMIMenu');
1092 procedure ProcOptionsPlayersAnim();
1096 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1101 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1104 Model
.GetCurrentAnimation
.Loop
:= True;
1105 Model
.GetCurrentAnimationMask
.Loop
:= True;
1109 procedure ProcOptionsPlayersWeap();
1113 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1118 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1122 procedure ProcOptionsPlayersRot();
1126 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1127 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')).Model
do
1128 if Direction
= D_LEFT
then Direction
:= D_RIGHT
else Direction
:= D_LEFT
;
1131 procedure ProcDefaultMenuKeyDown(Key
: Byte);
1133 if Key
= Ord('y') then
1135 g_Options_SetDefault();
1139 if Key
= Ord('n') then g_GUI_HideWindow
;
1142 procedure ProcSavedMenuKeyDown(Key
: Byte);
1144 if Key
= Ord('y') then
1149 if Key
= Ord('n') then g_GUI_HideWindow
;
1152 procedure ProcAuthorsClose();
1154 gMusic
.SetByName('MUSIC_MENU');
1156 gState
:= STATE_MENU
;
1159 procedure ProcGMClose();
1161 g_Game_InGameMenu(False);
1164 procedure ProcGMShow();
1169 if (gGameSettings
.GameType
= GT_SINGLE
) and
1170 ((gPlayer1
= nil) or (not gPlayer1
.Live
)) and
1171 ((gPlayer2
= nil) or (not gPlayer2
.Live
)) then
1172 Enabled
:= False; // Îäèí èç èãðîêîâ ïîãèá â ñèíãëå
1174 Enabled
:= False; // Çàïðåòèòü ñîõðàíåíèå â èíòåðìèññèè (íå ðåàëèçîâàíî)
1175 if g_Game_IsTestMap
then
1176 Enabled
:= False; // Åñëè èãðàåì íà òåñòîâîé èëè âðåìåííîé êàðòå
1177 TGUIMainMenu(g_ActiveWindow
.GetControl(
1178 g_ActiveWindow
.DefControl
)).EnableButton('save', Enabled
);
1181 procedure ProcChangePlayers();
1183 TeamGame
, Spectator
, AddTwo
: Boolean;
1184 P1Team
{, P2Team}: Byte;
1185 bP2
: TGUITextButton
;
1187 TeamGame
:= gGameSettings
.GameMode
in [GM_TDM
, GM_CTF
];
1188 Spectator
:= (gPlayer1
= nil) and (gPlayer2
= nil);
1189 AddTwo
:= gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
];
1190 P1Team
:= TEAM_NONE
;
1191 if gPlayer1
<> nil then P1Team
:= gPlayer1
.Team
;
1193 //P2Team := TEAM_NONE;
1194 //if gPlayer2 <> nil then P2Team := gPlayer2.Team;
1196 TGUIMainMenu(g_ActiveWindow
.GetControl(
1197 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinRed', TeamGame
and (P1Team
<> TEAM_RED
));
1198 TGUIMainMenu(g_ActiveWindow
.GetControl(
1199 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinBlue', TeamGame
and (P1Team
<> TEAM_BLUE
));
1200 TGUIMainMenu(g_ActiveWindow
.GetControl(
1201 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinGame', Spectator
and not TeamGame
);
1203 bP2
:= TGUIMainMenu(g_ActiveWindow
.GetControl(
1204 g_ActiveWindow
.DefControl
)).GetButton('tmPlayer2');
1205 bP2
.Enabled
:= AddTwo
and not Spectator
;
1207 bP2
.Color
:= MAINMENU_ITEMS_COLOR
1209 bP2
.Color
:= MAINMENU_UNACTIVEITEMS_COLOR
;
1210 if gPlayer2
= nil then
1211 bP2
.Caption
:= _lc
[I_MENU_ADD_PLAYER_2
]
1213 bP2
.Caption
:= _lc
[I_MENU_REM_PLAYER_2
];
1215 TGUIMainMenu(g_ActiveWindow
.GetControl(
1216 g_ActiveWindow
.DefControl
)).EnableButton('tmSpectate', not Spectator
);
1219 procedure ProcJoinRed();
1221 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1223 if g_Game_IsServer
then
1225 if gPlayer1
= nil then
1226 g_Game_AddPlayer(TEAM_RED
)
1229 if gPlayer1
.Team
<> TEAM_RED
then
1231 gPlayer1
.SwitchTeam
;
1232 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1235 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1240 gPlayer1Settings
.Team
:= TEAM_RED
;
1241 MC_SEND_PlayerSettings
;
1242 if gPlayer1
= nil then
1243 g_Game_AddPlayer(TEAM_RED
);
1245 g_ActiveWindow
:= nil;
1246 g_Game_Pause(False);
1249 procedure ProcJoinBlue();
1251 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1253 if g_Game_IsServer
then
1255 if gPlayer1
= nil then
1256 g_Game_AddPlayer(TEAM_BLUE
)
1259 if gPlayer1
.Team
<> TEAM_BLUE
then
1261 gPlayer1
.SwitchTeam
;
1262 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1265 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1270 gPlayer1Settings
.Team
:= TEAM_BLUE
;
1271 MC_SEND_PlayerSettings
;
1272 if gPlayer1
= nil then
1273 g_Game_AddPlayer(TEAM_BLUE
);
1275 g_ActiveWindow
:= nil;
1276 g_Game_Pause(False);
1279 procedure ProcJoinGame();
1281 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1283 if gPlayer1
= nil then
1285 g_ActiveWindow
:= nil;
1286 g_Game_Pause(False);
1289 procedure ProcSwitchP2();
1291 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
]) then
1293 if gPlayer1
= nil then
1295 if gPlayer2
= nil then
1298 g_Game_RemovePlayer();
1299 g_ActiveWindow
:= nil;
1300 g_Game_Pause(False);
1303 procedure ProcSpectate();
1305 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1308 g_ActiveWindow
:= nil;
1309 g_Game_Pause(False);
1312 procedure ProcRestartMenuKeyDown(Key
: Byte);
1314 if Key
= Ord('y') then g_Game_Restart()
1315 else if Key
= Ord('n') then g_GUI_HideWindow
;
1318 procedure ProcEndMenuKeyDown(Key
: Byte);
1320 if Key
= Ord('y') then gExit
:= EXIT_SIMPLE
1321 else if Key
= Ord('n') then g_GUI_HideWindow
;
1324 procedure ProcSetRussianLanguage();
1326 if gLanguage
<> LANGUAGE_RUSSIAN
then
1328 gLanguage
:= LANGUAGE_RUSSIAN
;
1329 gLanguageChange
:= True;
1330 gAskLanguage
:= False;
1332 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1334 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1339 procedure ProcSetEnglishLanguage();
1341 if gLanguage
<> LANGUAGE_ENGLISH
then
1343 gLanguage
:= LANGUAGE_ENGLISH
;
1344 gLanguageChange
:= True;
1345 gAskLanguage
:= False;
1347 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1349 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1354 procedure ReadGameSettings();
1358 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1360 with gGameSettings
do
1362 with TGUISwitch(menu
.GetControl('swTeamDamage')) do
1363 if LongBool(Options
and GAME_OPTION_TEAMDAMAGE
) then
1368 TGUIEdit(menu
.GetControl('edTimeLimit')).Text := IntToStr(TimeLimit
);
1369 TGUIEdit(menu
.GetControl('edGoalLimit')).Text := IntToStr(GoalLimit
);
1370 TGUIEdit(menu
.GetControl('edMaxLives')).Text := IntToStr(MaxLives
);
1372 with TGUISwitch(menu
.GetControl('swBotsVS')) do
1373 if LongBool(Options
and GAME_OPTION_BOTVSPLAYER
) and
1374 LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1377 if LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1382 if GameType
in [GT_CUSTOM
, GT_SERVER
] then
1384 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1385 TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
:= True;
1386 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1387 TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
:= True;
1388 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1389 TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
:= True;
1390 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_ITEMSTEXT_COLOR
;
1391 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1395 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1396 with TGUIEdit(menu
.GetControl('edTimeLimit')) do
1401 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1402 with TGUIEdit(menu
.GetControl('edGoalLimit')) do
1407 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1408 with TGUIEdit(menu
.GetControl('edMaxLives')) do
1413 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1414 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1419 procedure ProcApplyGameSet();
1423 stat
: TPlayerStatArray
;
1425 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1427 if not g_Game_IsServer
then Exit
;
1429 with gGameSettings
do
1431 if TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
then
1433 if TGUISwitch(menu
.GetControl('swTeamDamage')).ItemIndex
= 0 then
1434 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
1436 Options
:= Options
and (not GAME_OPTION_TEAMDAMAGE
);
1439 if TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
then
1441 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edTimeLimit')).Text, TimeLimit
);
1447 b
:= (gTime
- gGameStartTime
) div 1000 + 10; // 10 ñåêóíä íà ñìåíó
1449 TimeLimit
:= Max(n
, b
);
1453 if TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
then
1455 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edGoalLimit')).Text, GoalLimit
);
1462 if GameMode
= GM_DM
then
1464 stat
:= g_Player_GetStats();
1466 for a
:= 0 to High(stat
) do
1467 if stat
[a
].Frags
> b
then
1471 b
:= Max(gTeamStat
[TEAM_RED
].Goals
, gTeamStat
[TEAM_BLUE
].Goals
);
1473 GoalLimit
:= Max(n
, b
);
1477 if TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
then
1479 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edMaxLives')).Text, GoalLimit
);
1480 if n
< 0 then n
:= 0;
1481 if n
> 255 then n
:= 255;
1487 stat
:= g_Player_GetStats();
1489 for a
:= 0 to High(stat
) do
1490 if stat
[a
].Lives
> b
then
1493 MaxLives
:= Max(n
, b
);
1497 if TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
then
1499 case TGUISwitch(menu
.GetControl('swBotsVS')).ItemIndex
of
1502 Options
:= Options
and (not GAME_OPTION_BOTVSPLAYER
);
1503 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1507 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1508 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1512 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1513 Options
:= Options
and (not GAME_OPTION_BOTVSMONSTER
);
1519 if g_Game_IsNet
then MH_SEND_GameSettings
;
1522 procedure ProcVideoOptionsRes();
1528 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1530 TGUILabel(menu
.GetControl('lbCurrentRes')).Text :=
1531 IntToStr(gScreenWidth
) +
1532 ' x ' + IntToStr(gScreenHeight
) +
1533 ', ' + IntToStr(gBPP
) + ' bpp';
1535 with TGUIListBox(menu
.GetControl('lsResolution')) do
1537 list
:= GetDisplayModes(gBPP
, SR
);
1548 with TGUISwitch(menu
.GetControl('swFullScreen')) do
1555 procedure ProcApplyVideoOptions();
1558 Fullscreen
: Boolean;
1559 SWidth
, SHeight
: Integer;
1562 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1564 str
:= TGUIListBox(menu
.GetControl('lsResolution')).SelectedItem
;
1565 SScanf(str
, '%dx%d', [@SWidth
, @SHeight
]);
1567 Fullscreen
:= TGUISwitch(menu
.GetControl('swFullScreen')).ItemIndex
= 0;
1569 if (SWidth
<> gScreenWidth
) or
1570 (SHeight
<> gScreenHeight
) or
1571 (Fullscreen
<> gFullscreen
) then
1573 gResolutionChange
:= True;
1574 gRC_Width
:= SWidth
;
1575 gRC_Height
:= SHeight
;
1576 gRC_FullScreen
:= Fullscreen
;
1577 gRC_Maximized
:= gWinMaximized
;
1580 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1584 function CreateYNMenu(Name
, Text: String; MaxLen
: Word; FontID
: DWORD
;
1585 KeyDownProc
: Pointer): TGUIWindow
;
1591 Result
:= TGUIWindow
.Create(Name
);
1595 OnKeyDown
:= KeyDownProc
;
1597 lines
:= GetLines(Text, FontID
, MaxLen
);
1599 h
:= e_CharFont_GetMaxHeight(FontID
);
1600 _x
:= (gScreenHeight
div 2)-(h
*Length(lines
) div 2);
1602 if lines
<> nil then
1604 for a
:= 0 to High(lines
) do
1605 with TGUILabel(Result
.AddChild(TGUILabel
.Create(lines
[a
], FontID
))) do
1607 X
:= (gScreenWidth
div 2)-(GetWidth
div 2);
1609 Color
:= _RGB(255, 0, 0);
1613 with TGUILabel(Result
.AddChild(TGUILabel
.Create('(Y/N)', FontID
))) do
1615 X
:= (gScreenWidth
div 2)-(GetWidth
div 2);
1617 Color
:= _RGB(255, 0, 0);
1626 procedure ProcSetFirstRussianLanguage();
1628 gLanguage
:= LANGUAGE_RUSSIAN
;
1629 gLanguageChange
:= True;
1630 gAskLanguage
:= False;
1632 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1635 procedure ProcSetFirstEnglishLanguage();
1637 gLanguage
:= LANGUAGE_ENGLISH
;
1638 gLanguageChange
:= True;
1639 gAskLanguage
:= False;
1641 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1644 procedure ProcRecallAddress();
1646 with TGUIMenu(g_GUI_GetWindow('NetClientMenu').GetControl('mNetClientMenu')) do
1648 TGUIEdit(GetControl('edIP')).Text := NetClientIP
;
1649 TGUIEdit(GetControl('edPort')).Text := IntToStr(NetClientPort
);
1653 procedure CreateFirstLanguageMenu();
1657 Menu
:= TGUIWindow
.Create('FirstLanguageMenu');
1659 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, ' '))) do
1661 Name
:= 'mmFirstLanguageMenu';
1662 AddButton(@ProcSetFirstRussianLanguage
, 'Ðóññêèé', '');
1663 AddButton(@ProcSetFirstEnglishLanguage
, 'English', '');
1666 Menu
.DefControl
:= 'mmFirstLanguageMenu';
1667 Menu
.MainWindow
:= True;
1668 g_GUI_AddWindow(Menu
);
1671 procedure g_Menu_AskLanguage();
1673 CreateFirstLanguageMenu();
1674 g_GUI_ShowWindow('FirstLanguageMenu');
1677 procedure CreatePlayerOptionsMenu(s
: String);
1682 Menu
:= TGUIWindow
.Create('OptionsPlayers'+s
+'Menu');
1684 a
:= _lc
[I_MENU_PLAYER_1
]
1686 a
:= _lc
[I_MENU_PLAYER_2
];
1687 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, a
))) do
1689 Name
:= 'mOptionsPlayers'+s
+'Menu';
1690 with AddEdit(_lc
[I_MENU_PLAYER_NAME
]) do
1692 Name
:= 'ed'+s
+'Name';
1696 with AddSwitch(_lc
[I_MENU_PLAYER_TEAM
]) do
1698 Name
:= 'sw'+s
+'Team';
1699 AddItem(_lc
[I_MENU_PLAYER_TEAM_RED
]);
1700 AddItem(_lc
[I_MENU_PLAYER_TEAM_BLUE
]);
1702 with AddList(_lc
[I_MENU_PLAYER_MODEL
], 12, 6) do
1704 Name
:= 'ls'+s
+'Model';
1706 Items
:= g_PlayerModel_GetNames();
1707 OnChange
:= ProcSelectModel
;
1709 with AddScroll(_lc
[I_MENU_PLAYER_RED
]) do
1711 Name
:= 'sc'+s
+'Red';
1713 OnChange
:= ProcChangeColor
;
1715 with AddScroll(_lc
[I_MENU_PLAYER_GREEN
]) do
1717 Name
:= 'sc'+s
+'Green';
1719 OnChange
:= ProcChangeColor
;
1721 with AddScroll(_lc
[I_MENU_PLAYER_BLUE
]) do
1723 Name
:= 'sc'+s
+'Blue';
1725 OnChange
:= ProcChangeColor
;
1728 AddButton(@ProcOptionsPlayersMIMenu
, _lc
[I_MENU_MODEL_INFO
]);
1729 AddButton(@ProcOptionsPlayersAnim
, _lc
[I_MENU_MODEL_ANIMATION
]);
1730 AddButton(@ProcOptionsPlayersWeap
, _lc
[I_MENU_MODEL_CHANGE_WEAPON
]);
1731 AddButton(@ProcOptionsPlayersRot
, _lc
[I_MENU_MODEL_ROTATE
]);
1733 with TGUIModelView(Menu
.AddChild(TGUIModelView
.Create
)) do
1735 Name
:= 'mv'+s
+'Model';
1736 X
:= GetControl('ls'+s
+'Model').X
+TGUIListBox(GetControl('ls'+s
+'Model')).GetWidth
+16;
1737 Y
:= GetControl('ls'+s
+'Model').Y
;
1740 Menu
.DefControl
:= 'mOptionsPlayers'+s
+'Menu';
1741 g_GUI_AddWindow(Menu
);
1744 procedure CreateAllMenus();
1748 a
, cx
, _y
, i
: Integer;
1751 Menu
:= TGUIWindow
.Create('MainMenu');
1752 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
1754 Name
:= 'mmMainMenu';
1755 AddButton(nil, _lc
[I_MENU_NEW_GAME
], 'NewGameMenu');
1756 AddButton(nil, _lc
[I_MENU_MULTIPLAYER
], 'NetGameMenu');
1757 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
1758 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
1759 AddButton(@ProcAuthorsMenu
, _lc
[I_MENU_AUTHORS
], 'AuthorsMenu');
1760 AddButton(nil, _lc
[I_MENU_EXIT
], 'ExitMenu');
1762 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(Format(_lc
[I_VERSION
], [GAME_VERSION
]), gMenuSmallFont
))) do
1764 Color
:= _RGB(255, 255, 255);
1765 X
:= gScreenWidth
-GetWidth
-8;
1766 Y
:= gScreenHeight
-GetHeight
-8;
1768 Menu
.DefControl
:= 'mmMainMenu';
1769 Menu
.MainWindow
:= True;
1770 g_GUI_AddWindow(Menu
);
1772 Menu
:= TGUIWindow
.Create('NewGameMenu');
1773 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_NEW_GAME
]))) do
1775 Name
:= 'mmNewGameMenu';
1776 AddButton(@ProcSingle1Player
, _lc
[I_MENU_1_PLAYER
]);
1777 AddButton(@ProcSingle2Players
, _lc
[I_MENU_2_PLAYERS
]);
1778 AddButton(nil, _lc
[I_MENU_CUSTOM_GAME
], 'CustomGameMenu');
1779 AddButton(@ProcSelectCampaignMenu
, _lc
[I_MENU_CAMPAIGN
], 'CampaignMenu');
1781 Menu
.DefControl
:= 'mmNewGameMenu';
1782 g_GUI_AddWindow(Menu
);
1784 Menu
:= TGUIWindow
.Create('NetGameMenu');
1785 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MULTIPLAYER
]))) do
1787 Name
:= 'mmNetGameMenu';
1788 AddButton(@ProcRecallAddress
, _lc
[I_MENU_START_CLIENT
], 'NetClientMenu');
1789 AddButton(nil, _lc
[I_MENU_START_SERVER
], 'NetServerMenu');
1791 Menu
.DefControl
:= 'mmNetGameMenu';
1792 g_GUI_AddWindow(Menu
);
1794 Menu
:= TGUIWindow
.Create('NetServerMenu');
1795 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_START_SERVER
]))) do
1797 Name
:= 'mNetServerMenu';
1798 with AddEdit(_lc
[I_NET_SERVER_NAME
]) do
1800 Name
:= 'edSrvName';
1801 OnlyDigits
:= False;
1804 Text := NetServerName
;
1806 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
1808 Name
:= 'edSrvPassword';
1809 OnlyDigits
:= False;
1812 Text := NetPassword
;
1814 with AddEdit(_lc
[I_NET_PORT
]) do
1820 Text := IntToStr(NetPort
);
1822 with AddEdit(_lc
[I_NET_MAX_CLIENTS
]) do
1824 Name
:= 'edMaxPlayers';
1828 Text := IntToStr(NetMaxClients
);
1830 with AddSwitch(_lc
[I_NET_USE_MASTER
]) do
1832 Name
:= 'swUseMaster';
1833 AddItem(_lc
[I_MENU_YES
]);
1834 AddItem(_lc
[I_MENU_NO
]);
1835 if NetUseMaster
then
1841 with AddLabel(_lc
[I_MENU_MAP
]) do
1846 OnClick
:= @ProcSelectMapMenu
;
1848 with AddSwitch(_lc
[I_MENU_GAME_TYPE
]) do
1850 Name
:= 'swGameMode';
1851 AddItem(_lc
[I_MENU_GAME_TYPE_DM
]);
1852 AddItem(_lc
[I_MENU_GAME_TYPE_TDM
]);
1853 AddItem(_lc
[I_MENU_GAME_TYPE_CTF
]);
1854 AddItem(_lc
[I_MENU_GAME_TYPE_COOP
]);
1855 case g_Game_TextToMode(gnGameMode
) of
1857 GM_DM
: ItemIndex
:= 0;
1858 GM_TDM
: ItemIndex
:= 1;
1859 GM_CTF
: ItemIndex
:= 2;
1861 GM_COOP
: ItemIndex
:= 3;
1863 OnChange
:= ProcSwitchMonstersNet
;
1865 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
1867 Name
:= 'edTimeLimit';
1871 if gnTimeLimit
> 0 then
1872 Text := IntToStr(gnTimeLimit
);
1874 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
1876 Name
:= 'edGoalLimit';
1880 if gnGoalLimit
> 0 then
1881 Text := IntToStr(gnGoalLimit
);
1883 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
1885 Name
:= 'edMaxLives';
1889 if gnMaxLives
> 0 then
1890 Text := IntToStr(gnMaxLives
);
1892 with AddSwitch(_lc
[I_MENU_SERVER_PLAYERS
]) do
1894 Name
:= 'swPlayers';
1895 AddItem(_lc
[I_MENU_COUNT_NONE
]);
1896 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
1897 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
1898 ItemIndex
:= gnPlayers
;
1900 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
1902 Name
:= 'swTeamDamage';
1903 AddItem(_lc
[I_MENU_YES
]);
1904 AddItem(_lc
[I_MENU_NO
]);
1905 if gnTeamDamage
then
1910 with AddSwitch(_lc
[I_MENU_ENABLE_EXITS
]) do
1912 Name
:= 'swEnableExits';
1913 AddItem(_lc
[I_MENU_YES
]);
1914 AddItem(_lc
[I_MENU_NO
]);
1920 with AddSwitch(_lc
[I_MENU_WEAPONS_STAY
]) do
1922 Name
:= 'swWeaponStay';
1923 AddItem(_lc
[I_MENU_YES
]);
1924 AddItem(_lc
[I_MENU_NO
]);
1925 if gnWeaponStay
then
1930 with AddSwitch(_lc
[I_MENU_ENABLE_MONSTERS
]) do
1932 Name
:= 'swMonsters';
1933 AddItem(_lc
[I_MENU_YES
]);
1934 AddItem(_lc
[I_MENU_NO
]);
1940 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
1943 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
1944 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
1945 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
1947 if gnBotsVS
= 'Players' then
1949 if gnBotsVS
= 'Monsters' then
1953 AddButton(@ProcStartNetGame
, _lc
[I_MENU_START_GAME
]);
1957 Menu
.DefControl
:= 'mNetServerMenu';
1958 g_GUI_AddWindow(Menu
);
1960 Menu
:= TGUIWindow
.Create('NetClientMenu');
1961 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_START_CLIENT
]))) do
1963 Name
:= 'mNetClientMenu';
1965 AddButton(@ProcServerlist
, _lc
[I_NET_SLIST
]);
1968 with AddEdit(_lc
[I_NET_ADDRESS
]) do
1974 Text := 'localhost';
1976 with AddEdit(_lc
[I_NET_PORT
]) do
1984 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
1987 OnlyDigits
:= False;
1994 AddButton(@ProcConnectNetGame
, _lc
[I_MENU_CLIENT_CONNECT
]);
1998 Menu
.DefControl
:= 'mNetClientMenu';
1999 g_GUI_AddWindow(Menu
);
2001 Menu
:= TGUIWindow
.Create('LoadMenu');
2002 Menu
.OnShow
:= ProcLoadMenu
;
2003 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_LOAD_GAME
]))) do
2005 Name
:= 'mmLoadMenu';
2010 Name
:= 'edSlot'+IntToStr(a
);
2013 OnEnter
:= ProcLoadGame
;
2016 Menu
.DefControl
:= 'mmLoadMenu';
2017 g_GUI_AddWindow(Menu
);
2019 Menu
:= TGUIWindow
.Create('SaveMenu');
2020 Menu
.OnShow
:= ProcSaveMenu
;
2021 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SAVE_GAME
]))) do
2023 Name
:= 'mmSaveMenu';
2028 Name
:= 'edSlot'+IntToStr(a
);
2031 OnChange
:= ProcSaveGame
;
2034 Menu
.DefControl
:= 'mmSaveMenu';
2035 g_GUI_AddWindow(Menu
);
2037 Menu
:= TGUIWindow
.Create('CustomGameMenu');
2038 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CUSTOM_GAME
]))) do
2040 Name
:= 'mCustomGameMenu';
2041 with AddLabel(_lc
[I_MENU_MAP
]) do
2046 OnClick
:= @ProcSelectMapMenu
;
2048 with AddSwitch(_lc
[I_MENU_GAME_TYPE
]) do
2050 Name
:= 'swGameMode';
2051 AddItem(_lc
[I_MENU_GAME_TYPE_DM
]);
2052 AddItem(_lc
[I_MENU_GAME_TYPE_TDM
]);
2053 AddItem(_lc
[I_MENU_GAME_TYPE_CTF
]);
2054 AddItem(_lc
[I_MENU_GAME_TYPE_COOP
]);
2055 case g_Game_TextToMode(gcGameMode
) of
2057 GM_DM
: ItemIndex
:= 0;
2058 GM_TDM
: ItemIndex
:= 1;
2059 GM_CTF
: ItemIndex
:= 2;
2061 GM_COOP
: ItemIndex
:= 3;
2063 OnChange
:= ProcSwitchMonstersCustom
;
2065 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
2067 Name
:= 'edTimeLimit';
2071 if gcTimeLimit
> 0 then
2072 Text := IntToStr(gcTimeLimit
);
2074 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
2076 Name
:= 'edGoalLimit';
2080 if gcGoalLimit
> 0 then
2081 Text := IntToStr(gcGoalLimit
);
2083 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
2085 Name
:= 'edMaxLives';
2089 if gcMaxLives
> 0 then
2090 Text := IntToStr(gcMaxLives
);
2092 with AddSwitch(_lc
[I_MENU_PLAYERS
]) do
2094 Name
:= 'swPlayers';
2095 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2096 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2097 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2098 ItemIndex
:= gcPlayers
;
2100 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
2102 Name
:= 'swTeamDamage';
2103 AddItem(_lc
[I_MENU_YES
]);
2104 AddItem(_lc
[I_MENU_NO
]);
2105 if gcTeamDamage
then
2110 with AddSwitch(_lc
[I_MENU_ENABLE_EXITS
]) do
2112 Name
:= 'swEnableExits';
2113 AddItem(_lc
[I_MENU_YES
]);
2114 AddItem(_lc
[I_MENU_NO
]);
2120 with AddSwitch(_lc
[I_MENU_WEAPONS_STAY
]) do
2122 Name
:= 'swWeaponStay';
2123 AddItem(_lc
[I_MENU_YES
]);
2124 AddItem(_lc
[I_MENU_NO
]);
2125 if gcWeaponStay
then
2130 with AddSwitch(_lc
[I_MENU_ENABLE_MONSTERS
]) do
2132 Name
:= 'swMonsters';
2133 AddItem(_lc
[I_MENU_YES
]);
2134 AddItem(_lc
[I_MENU_NO
]);
2140 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
2143 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
2144 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
2145 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
2147 if gcBotsVS
= 'Players' then
2149 if gcBotsVS
= 'Monsters' then
2153 AddButton(@ProcStartCustomGame
, _lc
[I_MENU_START_GAME
]);
2157 Menu
.DefControl
:= 'mCustomGameMenu';
2158 g_GUI_AddWindow(Menu
);
2160 Menu
:= TGUIWindow
.Create('CampaignMenu');
2161 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CAMPAIGN
]))) do
2163 Name
:= 'mCampaignMenu';
2172 with AddFileList('', 15, 4) do
2175 OnChange
:= ProcSelectCampaignWAD
;
2179 FileMask
:= '*.wad';
2180 SetBase(MapsDir
+'megawads/');
2183 with AddLabel(_lc
[I_MENU_MAP_NAME
]) do
2185 Name
:= 'lbWADName';
2189 with AddLabel(_lc
[I_MENU_MAP_AUTHOR
]) do
2191 Name
:= 'lbWADAuthor';
2195 AddLine(_lc
[I_MENU_MAP_DESCRIPTION
]);
2196 with AddMemo('', 15, 3) do
2198 Name
:= 'meWADDescription';
2199 Color
:= MENU_ITEMSCTRL_COLOR
;
2201 with AddSwitch(_lc
[I_MENU_PLAYERS
]) do
2203 Name
:= 'swPlayers';
2204 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2205 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2208 AddButton(@ProcStartCampaign
, _lc
[I_MENU_START_GAME
]);
2212 with TGUIImage(Menu
.AddChild(TGUIImage
.Create
)) do
2214 Name
:= 'mpWADImage';
2215 DefaultRes
:= 'NOPIC';
2216 X
:= GetControl('lsWAD').X
+4;
2217 Y
:= GetControl('lsWAD').Y
-128-MENU_VSPACE
;
2220 Menu
.DefControl
:= 'mCampaignMenu';
2221 g_GUI_AddWindow(Menu
);
2223 Menu
:= TGUIWindow
.Create('SelectMapMenu');
2224 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SELECT_MAP
]))) do
2226 Name
:= 'mSelectMapMenu';
2227 with AddFileList(_lc
[I_MENU_MAP_WAD
], 12, 4) do
2230 OnChange
:= ProcSelectWAD
;
2234 FileMask
:= '*.wad';
2237 with AddList(_lc
[I_MENU_MAP_RESOURCE
], 12, 4) do
2241 OnChange
:= ProcSelectMap
;
2244 with AddLabel(_lc
[I_MENU_MAP_NAME
]) do
2246 Name
:= 'lbMapName';
2250 with AddLabel(_lc
[I_MENU_MAP_AUTHOR
]) do
2252 Name
:= 'lbMapAuthor';
2256 with AddLabel(_lc
[I_MENU_MAP_SIZE
]) do
2258 Name
:= 'lbMapSize';
2262 with AddMemo(_lc
[I_MENU_MAP_DESCRIPTION
], 12, 4) do
2264 Name
:= 'meMapDescription';
2269 with TGUIMapPreview(Menu
.AddChild(TGUIMapPreview
.Create
)) do
2271 Name
:= 'mpMapPreview';
2272 X
:= GetControl('lsMapWAD').X
+TGUIListBox(GetControl('lsMapWAD')).GetWidth()+2;
2273 Y
:= GetControl('lsMapWAD').Y
;
2275 with TGUILabel(Menu
.AddChild(TGUILabel
.Create('', gMenuSmallFont
))) do
2277 Name
:= 'lbMapScale';
2280 Color
:= MENU_ITEMSCTRL_COLOR
;
2281 X
:= GetControl('lsMapWAD').X
+
2282 TGUIListBox(GetControl('lsMapWAD')).GetWidth() +
2283 2 + MAPPREVIEW_WIDTH
*4;
2284 Y
:= GetControl('lsMapWAD').Y
+ MAPPREVIEW_HEIGHT
*16 + 16;
2287 Menu
.OnClose
:= ProcSetMap
;
2288 Menu
.DefControl
:= 'mSelectMapMenu';
2289 g_GUI_AddWindow(Menu
);
2291 Menu
:= TGUIWindow
.Create('OptionsMenu');
2292 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_OPTIONS
]))) do
2294 Name
:= 'mmOptionsMenu';
2295 AddButton(nil, _lc
[I_MENU_VIDEO_OPTIONS
], 'OptionsVideoMenu');
2296 AddButton(nil, _lc
[I_MENU_SOUND_OPTIONS
], 'OptionsSoundMenu');
2297 AddButton(nil, _lc
[I_MENU_GAME_OPTIONS
], 'OptionsGameMenu');
2298 AddButton(nil, _lc
[I_MENU_CONTROLS_OPTIONS
], 'OptionsControlsMenu');
2299 AddButton(nil, _lc
[I_MENU_PLAYER_OPTIONS
], 'OptionsPlayersMenu');
2300 AddButton(nil, _lc
[I_MENU_LANGUAGE_OPTIONS
], 'OptionsLanguageMenu');
2302 AddButton(nil, _lc
[I_MENU_SAVED_OPTIONS
], 'SavedOptionsMenu').Color
:= _RGB(255, 0, 0);
2303 AddButton(nil, _lc
[I_MENU_DEFAULT_OPTIONS
], 'DefaultOptionsMenu').Color
:= _RGB(255, 0, 0);
2305 Menu
.OnClose
:= ProcApplyOptions
;
2306 Menu
.DefControl
:= 'mmOptionsMenu';
2307 g_GUI_AddWindow(Menu
);
2309 Menu
:= CreateYNMenu('SavedOptionsMenu', _lc
[I_MENU_LOAD_SAVED_PROMT
], Round(gScreenWidth
*0.6),
2310 gMenuSmallFont
, @ProcSavedMenuKeyDown
);
2311 g_GUI_AddWindow(Menu
);
2313 Menu
:= TGUIWindow
.Create('OptionsVideoMenu');
2314 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_VIDEO_OPTIONS
]))) do
2316 Name
:= 'mOptionsVideoMenu';
2317 AddButton(@ProcVideoOptionsRes
, _lc
[I_MENU_VIDEO_RESOLUTION
], 'OptionsVideoResMenu');
2318 with AddSwitch(_lc
[I_MENU_VIDEO_BPP
]) do
2324 with AddSwitch(_lc
[I_MENU_VIDEO_VSYNC
]) do
2327 AddItem(_lc
[I_MENU_YES
]);
2328 AddItem(_lc
[I_MENU_NO
]);
2330 with AddSwitch(_lc
[I_MENU_VIDEO_FILTER_SKY
]) do
2332 Name
:= 'swTextureFilter';
2333 AddItem(_lc
[I_MENU_YES
]);
2334 AddItem(_lc
[I_MENU_NO
]);
2337 AddText(_lc
[I_MENU_VIDEO_NEED_RESTART
], Round(gScreenWidth
*0.6));
2340 Menu
.DefControl
:= 'mOptionsVideoMenu';
2341 g_GUI_AddWindow(Menu
);
2343 Menu
:= TGUIWindow
.Create('OptionsVideoResMenu');
2344 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_RESOLUTION_SELECT
]))) do
2346 Name
:= 'mOptionsVideoResMenu';
2347 with AddLabel(_lc
[I_MENU_RESOLUTION_CURRENT
]) do
2349 Name
:= 'lbCurrentRes';
2353 with AddList(_lc
[I_MENU_RESOLUTION_LIST
], 12, 6) do
2355 Name
:= 'lsResolution';
2358 with AddSwitch(_lc
[I_MENU_RESOLUTION_FULLSCREEN
]) do
2360 Name
:= 'swFullScreen';
2361 AddItem(_lc
[I_MENU_YES
]);
2362 AddItem(_lc
[I_MENU_NO
]);
2365 AddButton(@ProcApplyVideoOptions
, _lc
[I_MENU_RESOLUTION_APPLY
]);
2368 Menu
.DefControl
:= 'mOptionsVideoResMenu';
2369 g_GUI_AddWindow(Menu
);
2371 Menu
:= TGUIWindow
.Create('OptionsSoundMenu');
2372 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SOUND_OPTIONS
]))) do
2374 Name
:= 'mOptionsSoundMenu';
2375 with AddScroll(_lc
[I_MENU_SOUND_MUSIC_LEVEL
]) do
2377 Name
:= 'scMusicLevel';
2379 OnChange
:= ProcChangeSoundSettings
;
2381 with AddScroll(_lc
[I_MENU_SOUND_SOUND_LEVEL
]) do
2383 Name
:= 'scSoundLevel';
2385 OnChange
:= ProcChangeSoundSettings
;
2387 with AddScroll(_lc
[I_MENU_SOUND_MAX_SIM_SOUNDS
]) do
2389 Name
:= 'scMaxSimSounds';
2392 with AddSwitch (_lc
[I_MENU_SOUND_ANNOUNCE
]) do
2394 Name
:= 'swAnnouncer';
2395 AddItem(_lc
[I_MENU_ANNOUNCE_NONE
]);
2396 AddItem(_lc
[I_MENU_ANNOUNCE_ME
]);
2397 AddItem(_lc
[I_MENU_ANNOUNCE_MEPLUS
]);
2398 AddItem(_lc
[I_MENU_ANNOUNCE_ALL
]);
2400 // Ïåðåêëþ÷àòåëü çâóêîâûõ ýôôåêòîâ (DF / Doom 2)
2401 with AddSwitch (_lc
[I_MENU_SOUND_COMPAT
]) do
2403 Name
:= 'swSoundEffects';
2404 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2405 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2407 with AddSwitch(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS
]) do
2409 Name
:= 'swInactiveSounds';
2410 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_ON
]);
2411 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_OFF
]);
2415 Menu
.DefControl
:= 'mOptionsSoundMenu';
2416 g_GUI_AddWindow(Menu
);
2418 Menu
:= TGUIWindow
.Create('OptionsGameMenu');
2419 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_GAME_OPTIONS
]))) do
2421 Name
:= 'mOptionsGameMenu';
2422 with AddScroll(_lc
[I_MENU_GAME_PARTICLES_COUNT
]) do
2424 Name
:= 'scParticlesCount';
2427 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_COUNT
]) do
2429 Name
:= 'swBloodCount';
2430 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2431 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2432 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2433 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2434 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2436 with AddScroll(_lc
[I_MENU_GAME_MAX_SHELLS
]) do
2438 Name
:= 'scShellsMax';
2441 with AddScroll(_lc
[I_MENU_GAME_GIBS_COUNT
]) do
2443 Name
:= 'scGibsMax';
2446 with AddScroll(_lc
[I_MENU_GAME_MAX_CORPSES
]) do
2448 Name
:= 'scCorpsesMax';
2451 with AddSwitch(_lc
[I_MENU_GAME_MAX_GIBS
]) do
2453 Name
:= 'swGibsCount';
2454 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2455 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2456 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2457 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2458 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2460 with AddSwitch(_lc
[I_MENU_GAME_CORPSE_TYPE
]) do
2462 Name
:= 'swCorpseType';
2463 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_SIMPLE
]);
2464 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_ADV
]);
2466 with AddSwitch(_lc
[I_MENU_GAME_GIBS_TYPE
]) do
2468 Name
:= 'swGibsType';
2469 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_SIMPLE
]);
2470 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_ADV
]);
2472 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_TYPE
]) do
2474 Name
:= 'swBloodType';
2475 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_SIMPLE
]);
2476 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_ADV
]);
2478 with AddSwitch(_lc
[I_MENU_GAME_SCREEN_FLASH
]) do
2480 Name
:= 'swScreenFlash';
2481 AddItem(_lc
[I_MENU_NO
]);
2482 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2483 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2485 with AddSwitch(_lc
[I_MENU_GAME_BACKGROUND
]) do
2487 Name
:= 'swBackground';
2488 AddItem(_lc
[I_MENU_YES
]);
2489 AddItem(_lc
[I_MENU_NO
]);
2491 with AddSwitch(_lc
[I_MENU_GAME_MESSAGES
]) do
2493 Name
:= 'swMessages';
2494 AddItem(_lc
[I_MENU_YES
]);
2495 AddItem(_lc
[I_MENU_NO
]);
2497 with AddSwitch(_lc
[I_MENU_GAME_REVERT_PLAYERS
]) do
2499 Name
:= 'swRevertPlayers';
2500 AddItem(_lc
[I_MENU_YES
]);
2501 AddItem(_lc
[I_MENU_NO
]);
2503 with AddSwitch(_lc
[I_MENU_GAME_CHAT_BUBBLE
]) do
2505 Name
:= 'swChatBubble';
2506 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_NONE
]);
2507 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_SIMPLE
]);
2508 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_ADV
]);
2509 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_COLOR
]);
2510 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_TEXTURE
]);
2514 Menu
.DefControl
:= 'mOptionsGameMenu';
2515 g_GUI_AddWindow(Menu
);
2517 Menu
:= TGUIWindow
.Create('OptionsControlsMenu');
2518 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROLS_OPTIONS
]))) do
2520 Name
:= 'mOptionsControlsMenu';
2521 AddLine(_lc
[I_MENU_CONTROL_GLOBAL
]);
2522 AddKeyRead(_lc
[I_MENU_CONTROL_SCREENSHOT
]).Name
:= _lc
[I_MENU_CONTROL_SCREENSHOT
];
2523 AddKeyRead(_lc
[I_MENU_CONTROL_STAT
]).Name
:= _lc
[I_MENU_CONTROL_STAT
];
2524 AddKeyRead(_lc
[I_MENU_CONTROL_CHAT
]).Name
:= _lc
[I_MENU_CONTROL_CHAT
];
2525 AddKeyRead(_lc
[I_MENU_CONTROL_TEAMCHAT
]).Name
:= _lc
[I_MENU_CONTROL_TEAMCHAT
];
2527 AddButton(nil, _lc
[I_MENU_PLAYER_1
], 'OptionsControlsP1Menu');
2528 AddButton(nil, _lc
[I_MENU_PLAYER_2
], 'OptionsControlsP2Menu');
2530 if e_JoysticksAvailable
<> 0 then
2531 AddButton(nil, _lc
[I_MENU_CONTROL_JOYSTICKS
], 'OptionsControlsJoystickMenu');
2533 Menu
.DefControl
:= 'mOptionsControlsMenu';
2534 g_GUI_AddWindow(Menu
);
2536 Menu
:= TGUIWindow
.Create('OptionsControlsP1Menu');
2537 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_1
]))) do
2539 Name
:= 'mOptionsControlsP1Menu';
2540 AddKeyRead(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
2541 AddKeyRead(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
2542 AddKeyRead(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
2543 AddKeyRead(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
2544 AddKeyRead(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
2545 AddKeyRead(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
2546 AddKeyRead(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
2547 AddKeyRead(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
2548 AddKeyRead(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
2550 Menu
.DefControl
:= 'mOptionsControlsP1Menu';
2551 g_GUI_AddWindow(Menu
);
2553 Menu
:= TGUIWindow
.Create('OptionsControlsP2Menu');
2554 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_2
]))) do
2556 Name
:= 'mOptionsControlsP2Menu';
2557 AddKeyRead(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
2558 AddKeyRead(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
2559 AddKeyRead(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
2560 AddKeyRead(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
2561 AddKeyRead(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
2562 AddKeyRead(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
2563 AddKeyRead(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
2564 AddKeyRead(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
2565 AddKeyRead(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
2567 Menu
.DefControl
:= 'mOptionsControlsP2Menu';
2568 g_GUI_AddWindow(Menu
);
2570 Menu
:= TGUIWindow
.Create('OptionsControlsJoystickMenu');
2571 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROL_JOYSTICKS
]))) do
2573 Name
:= 'mOptionsControlsJoystickMenu';
2574 for i
:= 0 to e_JoysticksAvailable
-1 do
2575 with AddScroll(Format(_lc
[I_MENU_CONTROL_DEADZONE
], [i
+ 1])) do
2577 Name
:= 'scDeadzone' + IntToStr(i
);
2581 Menu
.DefControl
:= 'mOptionsControlsJoystickMenu';
2582 g_GUI_AddWindow(Menu
);
2584 Menu
:= TGUIWindow
.Create('OptionsPlayersMenu');
2585 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_OPTIONS
]))) do
2587 Name
:= 'mOptionsPlayersMenu';
2588 AddButton(nil, _lc
[I_MENU_PLAYER_1
], 'OptionsPlayersP1Menu');
2589 AddButton(nil, _lc
[I_MENU_PLAYER_2
], 'OptionsPlayersP2Menu');
2591 Menu
.DefControl
:= 'mOptionsPlayersMenu';
2592 g_GUI_AddWindow(Menu
);
2594 CreatePlayerOptionsMenu('P1');
2595 CreatePlayerOptionsMenu('P2');
2597 Menu
:= TGUIWindow
.Create('OptionsPlayersMIMenu');
2598 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_MODEL_INFO
]))) do
2600 Name
:= 'mOptionsPlayersMIMenu';
2601 with AddLabel(_lc
[I_MENU_MODEL_NAME
]) do
2606 with AddLabel(_lc
[I_MENU_MODEL_AUTHOR
]) do
2611 with AddMemo(_lc
[I_MENU_MODEL_COMMENT
], 14, 6) do
2613 Name
:= 'meComment';
2616 AddLine(_lc
[I_MENU_MODEL_OPTIONS
]);
2617 with AddLabel(_lc
[I_MENU_MODEL_WEAPON
]) do
2620 FixedLength
:= Max(Length(_lc
[I_MENU_YES
]), Length(_lc
[I_MENU_NO
]));
2624 Menu
.DefControl
:= 'mOptionsPlayersMIMenu';
2625 g_GUI_AddWindow(Menu
);
2627 Menu
:= TGUIWindow
.Create('OptionsLanguageMenu');
2628 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_LANGUAGE_OPTIONS
]))) do
2630 Name
:= 'mOptionsLanguageMenu';
2631 AddButton(@ProcSetRussianLanguage
, _lc
[I_MENU_LANGUAGE_RUSSIAN
]);
2632 AddButton(@ProcSetEnglishLanguage
, _lc
[I_MENU_LANGUAGE_ENGLISH
]);
2635 Menu
.DefControl
:= 'mOptionsLanguageMenu';
2636 g_GUI_AddWindow(Menu
);
2638 Menu
:= CreateYNMenu('DefaultOptionsMenu', _lc
[I_MENU_SET_DEFAULT_PROMT
], Round(gScreenWidth
*0.6),
2639 gMenuSmallFont
, @ProcDefaultMenuKeyDown
);
2640 g_GUI_AddWindow(Menu
);
2642 Menu
:= TGUIWindow
.Create('AuthorsMenu');
2643 Menu
.BackTexture
:= 'INTER';
2644 Menu
.OnClose
:= ProcAuthorsClose
;
2648 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_1
], gMenuFont
))) do
2650 Color
:= _RGB(255, 0, 0);
2651 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
2653 _y
:= _y
+GetHeight();
2655 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(Format(_lc
[I_CREDITS_CAP_2
], [GAME_VERSION
, NET_PROTOCOL_VER
]), gMenuSmallFont
))) do
2657 Color
:= _RGB(255, 0, 0);
2658 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
2660 _y
:= _y
+GetHeight()+32;
2662 // ×òî äåëàë: Êòî äåëàë
2663 cx
:= gScreenWidth
div 2 - 320 + 64;
2664 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1
], gMenuSmallFont
))) do
2666 Color
:= _RGB(255, 0, 0);
2671 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1_1
], gMenuSmallFont
))) do
2673 Color
:= _RGB(255, 255, 255);
2678 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2
], gMenuSmallFont
))) do
2680 Color
:= _RGB(255, 0, 0);
2685 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2_1
], gMenuSmallFont
))) do
2687 Color
:= _RGB(255, 255, 255);
2692 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3
], gMenuSmallFont
))) do
2694 Color
:= _RGB(255, 0, 0);
2699 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3_1
], gMenuSmallFont
))) do
2701 Color
:= _RGB(255, 255, 255);
2706 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4
], gMenuSmallFont
))) do
2708 Color
:= _RGB(255, 0, 0);
2713 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4_1
], gMenuSmallFont
))) do
2715 Color
:= _RGB(255, 255, 255);
2718 _y
:= gScreenHeight
- 128;
2721 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_3
], gMenuSmallFont
))) do
2723 Color
:= _RGB(255, 0, 0);
2728 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_1
], gMenuSmallFont
))) do
2730 Color
:= _RGB(255, 255, 255);
2733 _y
:= _y
+GetHeight();
2735 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_2
], gMenuSmallFont
))) do
2737 Color
:= _RGB(255, 255, 255);
2740 _y
:= _y
+GetHeight();
2742 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_3
], gMenuSmallFont
))) do
2744 Color
:= _RGB(255, 255, 255);
2747 _y
:= gScreenHeight
- 32;
2749 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_4
], gMenuSmallFont
))) do
2751 Color
:= _RGB(255, 0, 0);
2752 X
:= gScreenWidth
div 2 - GetWidth() div 2;
2755 g_GUI_AddWindow(Menu
);
2757 Menu
:= CreateYNMenu('ExitMenu', _lc
[I_MENU_EXIT_PROMT
], Round(gScreenWidth
*0.6),
2758 gMenuSmallFont
, @ProcExitMenuKeyDown
);
2759 g_GUI_AddWindow(Menu
);
2761 Menu
:= TGUIWindow
.Create('GameSingleMenu');
2762 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
2764 Name
:= 'mmGameSingleMenu';
2765 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
2766 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
2767 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
2768 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
2769 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
2770 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
2772 Menu
.DefControl
:= 'mmGameSingleMenu';
2773 Menu
.MainWindow
:= True;
2774 Menu
.OnClose
:= ProcGMClose
;
2775 Menu
.OnShow
:= ProcGMShow
;
2776 g_GUI_AddWindow(Menu
);
2778 Menu
:= CreateYNMenu('EndGameMenu', _lc
[I_MENU_END_GAME_PROMT
], Round(gScreenWidth
*0.6),
2779 gMenuSmallFont
, @ProcEndMenuKeyDown
);
2780 g_GUI_AddWindow(Menu
);
2782 Menu
:= CreateYNMenu('RestartGameMenu', _lc
[I_MENU_RESTART_GAME_PROMT
], Round(gScreenWidth
*0.6),
2783 gMenuSmallFont
, @ProcRestartMenuKeyDown
);
2784 g_GUI_AddWindow(Menu
);
2786 Menu
:= TGUIWindow
.Create('GameCustomMenu');
2787 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
2789 Name
:= 'mmGameCustomMenu';
2790 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
2791 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
2792 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
2793 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
2794 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
2795 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
2796 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
2798 Menu
.DefControl
:= 'mmGameCustomMenu';
2799 Menu
.MainWindow
:= True;
2800 Menu
.OnClose
:= ProcGMClose
;
2801 Menu
.OnShow
:= ProcGMShow
;
2802 g_GUI_AddWindow(Menu
);
2804 Menu
:= TGUIWindow
.Create('GameServerMenu');
2805 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
2807 Name
:= 'mmGameServerMenu';
2808 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
2809 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
2810 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
2811 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
2812 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
2814 Menu
.DefControl
:= 'mmGameServerMenu';
2815 Menu
.MainWindow
:= True;
2816 Menu
.OnClose
:= ProcGMClose
;
2817 Menu
.OnShow
:= ProcGMShow
;
2818 g_GUI_AddWindow(Menu
);
2820 Menu
:= TGUIWindow
.Create('GameClientMenu');
2821 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
2823 Name
:= 'mmGameClientMenu';
2824 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
2825 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
2826 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
2828 Menu
.DefControl
:= 'mmGameClientMenu';
2829 Menu
.MainWindow
:= True;
2830 Menu
.OnClose
:= ProcGMClose
;
2831 Menu
.OnShow
:= ProcGMShow
;
2832 g_GUI_AddWindow(Menu
);
2834 Menu
:= TGUIWindow
.Create('ClientPasswordMenu');
2835 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuSmallFont
, gMenuSmallFont
, _lc
[I_MENU_ENTERPASSWORD
]))) do
2837 Name
:= 'mClientPasswordMenu';
2838 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
2846 AddButton(@ProcEnterPassword
, _lc
[I_MENU_START_GAME
]);
2849 Menu
.DefControl
:= 'mClientPasswordMenu';
2850 g_GUI_AddWindow(Menu
);
2852 Menu
:= TGUIWindow
.Create('GameSetGameMenu');
2853 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SET_GAME
]))) do
2855 Name
:= 'mGameSetGameMenu';
2856 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
2858 Name
:= 'swTeamDamage';
2859 AddItem(_lc
[I_MENU_YES
]);
2860 AddItem(_lc
[I_MENU_NO
]);
2863 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
2865 Name
:= 'edTimeLimit';
2870 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
2872 Name
:= 'edGoalLimit';
2877 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
2879 Name
:= 'edMaxLives';
2884 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
2887 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
2888 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
2889 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
2895 Menu
.DefControl
:= 'mGameSetGameMenu';
2896 Menu
.OnClose
:= ProcApplyGameSet
;
2897 g_GUI_AddWindow(Menu
);
2899 Menu
:= TGUIWindow
.Create('TeamMenu');
2900 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_CHANGE_PLAYERS
]))) do
2902 Name
:= 'mmTeamMenu';
2903 AddButton(@ProcJoinRed
, _lc
[I_MENU_JOIN_RED
], '').Name
:= 'tmJoinRed';
2904 AddButton(@ProcJoinBlue
, _lc
[I_MENU_JOIN_BLUE
], '').Name
:= 'tmJoinBlue';
2905 AddButton(@ProcJoinGame
, _lc
[I_MENU_JOIN_GAME
], '').Name
:= 'tmJoinGame';
2906 AddButton(@ProcSwitchP2
, _lc
[I_MENU_ADD_PLAYER_2
], '').Name
:= 'tmPlayer2';
2907 AddButton(@ProcSpectate
, _lc
[I_MENU_SPECTATE
], '').Name
:= 'tmSpectate';
2909 Menu
.DefControl
:= 'mmTeamMenu';
2910 Menu
.OnShow
:= ProcChangePlayers
;
2911 g_GUI_AddWindow(Menu
);
2914 procedure g_Menu_Show_SaveMenu();
2916 if g_Game_IsTestMap
then
2918 if gGameSettings
.GameType
= GT_SINGLE
then
2919 g_GUI_ShowWindow('GameSingleMenu')
2922 if g_Game_IsClient
then
2925 if g_Game_IsNet
then
2928 g_GUI_ShowWindow('GameCustomMenu');
2930 g_GUI_ShowWindow('SaveMenu');
2931 g_Sound_PlayEx('MENU_OPEN');
2934 procedure g_Menu_Show_LoadMenu();
2936 if gGameSettings
.GameType
= GT_SINGLE
then
2937 g_GUI_ShowWindow('GameSingleMenu')
2940 if g_Game_IsClient
then
2943 if g_Game_IsNet
then
2946 g_GUI_ShowWindow('GameCustomMenu');
2948 g_GUI_ShowWindow('LoadMenu');
2949 g_Sound_PlayEx('MENU_OPEN');
2952 procedure g_Menu_Show_GameSetGame();
2954 if gGameSettings
.GameType
= GT_SINGLE
then
2955 g_GUI_ShowWindow('GameSingleMenu')
2958 if g_Game_IsClient
then
2961 if g_Game_IsNet
then
2962 g_GUI_ShowWindow('GameServerMenu')
2964 g_GUI_ShowWindow('GameCustomMenu');
2967 g_GUI_ShowWindow('GameSetGameMenu');
2968 g_Sound_PlayEx('MENU_OPEN');
2971 procedure g_Menu_Show_OptionsVideo();
2973 if gGameSettings
.GameType
= GT_SINGLE
then
2974 g_GUI_ShowWindow('GameSingleMenu')
2977 if g_Game_IsClient
then
2978 g_GUI_ShowWindow('GameClientMenu')
2980 if g_Game_IsNet
then
2981 g_GUI_ShowWindow('GameServerMenu')
2983 g_GUI_ShowWindow('GameCustomMenu');
2986 g_GUI_ShowWindow('OptionsMenu');
2987 g_GUI_ShowWindow('OptionsVideoMenu');
2988 g_Sound_PlayEx('MENU_OPEN');
2991 procedure g_Menu_Show_OptionsSound();
2993 if gGameSettings
.GameType
= GT_SINGLE
then
2994 g_GUI_ShowWindow('GameSingleMenu')
2997 if g_Game_IsClient
then
2998 g_GUI_ShowWindow('GameClientMenu')
3000 if g_Game_IsNet
then
3001 g_GUI_ShowWindow('GameServerMenu')
3003 g_GUI_ShowWindow('GameCustomMenu');
3006 g_GUI_ShowWindow('OptionsMenu');
3007 g_GUI_ShowWindow('OptionsSoundMenu');
3008 g_Sound_PlayEx('MENU_OPEN');
3011 procedure g_Menu_Show_EndGameMenu();
3013 g_GUI_ShowWindow('EndGameMenu');
3014 g_Sound_PlayEx('MENU_OPEN');
3017 procedure g_Menu_Show_QuitGameMenu();
3019 g_GUI_ShowWindow('ExitMenu');
3020 g_Sound_PlayEx('MENU_OPEN');
3023 procedure g_Menu_Init();
3030 procedure g_Menu_Free();
3034 e_WriteLog('Releasing menu data...', MSG_NOTIFY
);
3039 procedure g_Menu_Reset();
3043 g_GUI_SaveMenuPos();
3044 ex
:= g_GUI_Destroy();
3048 e_WriteLog('Recreating menu...', MSG_NOTIFY
);
3053 g_Game_SetDebugMode();
3055 g_GUI_LoadMenuPos();