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
;
37 type TYNCallback
= procedure (yes
:Boolean);
39 procedure YNKeyDownProc (win
: TGUIWindow
; Key
: Byte);
41 if win
.UserData
= nil then exit
;
43 IK_Y
, IK_SPACE
: TYNCallback(win
.UserData
)(true);
44 IK_N
: TYNCallback(win
.UserData
)(false);
48 function CreateYNMenu (Name
, Text: String; MaxLen
: Word; FontID
: DWORD
; ActionProc
: TYNCallback
): TGUIWindow
;
54 Result
:= TGUIWindow
.Create(Name
);
57 OnKeyDownEx
:= @YNKeyDownProc
;
58 UserData
:= @ActionProc
;
59 lines
:= GetLines(Text, FontID
, MaxLen
);
60 h
:= e_CharFont_GetMaxHeight(FontID
);
61 _x
:= (gScreenHeight
div 2)-(h
*Length(lines
) div 2);
64 for a
:= 0 to High(lines
) do
66 with TGUILabel(Result
.AddChild(TGUILabel
.Create(lines
[a
], FontID
))) do
68 X
:= (gScreenWidth
div 2)-(GetWidth
div 2);
70 Color
:= _RGB(255, 0, 0);
74 with TGUILabel(Result
.AddChild(TGUILabel
.Create('(Y/N)', FontID
))) do
76 X
:= (gScreenWidth
div 2)-(GetWidth
div 2);
78 Color
:= _RGB(255, 0, 0);
87 procedure ProcChangeColor(Sender
: TGUIControl
); forward;
88 procedure ProcSelectModel(Sender
: TGUIControl
); forward;
90 procedure ProcApplyOptions();
95 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
97 if TGUISwitch(menu
.GetControl('swBPP')).ItemIndex
= 0 then
101 gVSync
:= TGUISwitch(menu
.GetControl('swVSync')).ItemIndex
= 0;
102 gTextureFilter
:= TGUISwitch(menu
.GetControl('swTextureFilter')).ItemIndex
= 0;
103 glLegacyNPOT
:= not (TGUISwitch(menu
.GetControl('swLegacyNPOT')).ItemIndex
= 0);
105 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
107 g_Sound_SetupAllVolumes(
108 Min(TGUIScroll(menu
.GetControl('scSoundLevel')).Value
*16, 255),
109 Min(TGUIScroll(menu
.GetControl('scMusicLevel')).Value
*16, 255)
112 gMaxSimSounds
:= Max(Min(TGUIScroll(menu
.GetControl('scMaxSimSounds')).Value
*4+2, 66), 2);
113 gMuteWhenInactive
:= TGUISwitch(menu
.GetControl('swInactiveSounds')).ItemIndex
= 1;
114 gAnnouncer
:= TGUISwitch(menu
.GetControl('swAnnouncer')).ItemIndex
;
115 gSoundEffectsDF
:= TGUISwitch(menu
.GetControl('swSoundEffects')).ItemIndex
= 1;
117 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
119 g_GFX_SetMax(TGUIScroll(menu
.GetControl('scParticlesCount')).Value
*1000);
120 g_Shells_SetMax(TGUIScroll(menu
.GetControl('scShellsMax')).Value
*30);
121 g_Gibs_SetMax(TGUIScroll(menu
.GetControl('scGibsMax')).Value
*25);
122 g_Corpses_SetMax(TGUIScroll(menu
.GetControl('scCorpsesMax')).Value
*5);
124 case TGUISwitch(menu
.GetControl('swGibsCount')).ItemIndex
of
129 else gGibsCount
:= 48;
132 gBloodCount
:= TGUISwitch(menu
.GetControl('swBloodCount')).ItemIndex
;
133 gFlash
:= TGUISwitch(menu
.GetControl('swScreenFlash')).ItemIndex
;
134 gAdvBlood
:= TGUISwitch(menu
.GetControl('swBloodType')).ItemIndex
= 1;
135 gAdvCorpses
:= TGUISwitch(menu
.GetControl('swCorpseType')).ItemIndex
= 1;
136 gAdvGibs
:= TGUISwitch(menu
.GetControl('swGibsType')).ItemIndex
= 1;
137 gDrawBackGround
:= TGUISwitch(menu
.GetControl('swBackGround')).ItemIndex
= 0;
138 gShowMessages
:= TGUISwitch(menu
.GetControl('swMessages')).ItemIndex
= 0;
139 gRevertPlayers
:= TGUISwitch(menu
.GetControl('swRevertPlayers')).ItemIndex
= 0;
140 gChatBubble
:= TGUISwitch(menu
.GetControl('swChatBubble')).ItemIndex
;
142 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
144 with menu
, gGameControls
.GameControls
do
146 TakeScreenshot
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_SCREENSHOT
])).Key
;
147 Stat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_STAT
])).Key
;
148 Chat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_CHAT
])).Key
;
149 TeamChat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_TEAMCHAT
])).Key
;
152 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1Menu').GetControl('mOptionsControlsP1Menu'));
154 with menu
, gGameControls
.P1Control
do
156 KeyRight
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key
;
157 KeyLeft
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key
;
158 KeyUp
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key
;
159 KeyDown
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key
;
160 KeyFire
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key
;
161 KeyJump
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key
;
162 KeyNextWeapon
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key
;
163 KeyPrevWeapon
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key
;
164 KeyOpen
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key
;
167 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2Menu').GetControl('mOptionsControlsP2Menu'));
169 with menu
, gGameControls
.P2Control
do
171 KeyRight
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key
;
172 KeyLeft
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key
;
173 KeyUp
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key
;
174 KeyDown
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key
;
175 KeyFire
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key
;
176 KeyJump
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key
;
177 KeyNextWeapon
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key
;
178 KeyPrevWeapon
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key
;
179 KeyOpen
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key
;
182 if e_JoysticksAvailable
> 0 then
184 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsJoystickMenu').GetControl('mOptionsControlsJoystickMenu'));
187 for i
:= 0 to e_JoysticksAvailable
-1 do
188 e_JoystickDeadzones
[i
] := TGUIScroll(menu
.GetControl('scDeadzone' + IntToStr(i
))).Value
*(32767 div 20);
192 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
194 gPlayer1Settings
.Name
:= b_Text_Unformat(TGUIEdit(menu
.GetControl('edP1Name')).Text);
195 gPlayer1Settings
.Team
:= IfThen(TGUISwitch(menu
.GetControl('swP1Team')).ItemIndex
= 0,
196 TEAM_RED
, TEAM_BLUE
);
198 with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mvP1Model')) do
200 gPlayer1Settings
.Model
:= Model
.Name
;
201 gPlayer1Settings
.Color
:= Model
.Color
;
204 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
206 gPlayer2Settings
.Name
:= b_Text_Unformat(TGUIEdit(menu
.GetControl('edP2Name')).Text);
207 gPlayer2Settings
.Team
:= IfThen(TGUISwitch(menu
.GetControl('swP2Team')).ItemIndex
= 0,
208 TEAM_RED
, TEAM_BLUE
);
209 with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mvP2Model')) do
211 gPlayer2Settings
.Model
:= Model
.Name
;
212 gPlayer2Settings
.Color
:= Model
.Color
;
215 if gPlayer1Settings
.Name
= '' then gPlayer1Settings
.Name
:= 'Player1';
216 if gPlayer2Settings
.Name
= '' then gPlayer2Settings
.Name
:= 'Player2';
218 if g_Game_IsServer
then
220 if gPlayer1
<> nil then
222 gPlayer1
.SetModel(gPlayer1Settings
.Model
);
223 gPlayer1
.Name
:= gPlayer1Settings
.Name
;
224 if not (gGameSettings
.GameMode
in [GM_TDM
, GM_CTF
]) then
225 gPlayer1
.SetColor(gPlayer1Settings
.Color
)
227 if gPlayer1
.Team
<> gPlayer1Settings
.Team
then
230 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
233 if gPlayer2
<> nil then
235 gPlayer2
.SetModel(gPlayer2Settings
.Model
);
236 gPlayer2
.Name
:= gPlayer2Settings
.Name
;
237 if (gGameSettings
.GameMode
<> GM_TDM
) and (gGameSettings
.GameMode
<> GM_CTF
) then
238 gPlayer2
.SetColor(gPlayer2Settings
.Color
)
240 if gPlayer2
.Team
<> gPlayer2Settings
.Team
then
245 if g_Game_IsClient
then MC_SEND_PlayerSettings
;
247 g_Options_Write(GameDir
+'/'+CONFIG_FILENAME
);
250 procedure ReadOptions();
255 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
257 with TGUISwitch(menu
.GetControl('swBPP')) do
263 with TGUISwitch(menu
.GetControl('swTextureFilter')) do
264 if gTextureFilter
then ItemIndex
:= 0 else ItemIndex
:= 1;
266 with TGUISwitch(menu
.GetControl('swVSync')) do
267 if gVSync
then ItemIndex
:= 0 else ItemIndex
:= 1;
269 with TGUISwitch(menu
.GetControl('swLegacyNPOT')) do
270 if not glLegacyNPOT
then ItemIndex
:= 0 else ItemIndex
:= 1;
272 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
274 TGUIScroll(menu
.GetControl('scSoundLevel')).Value
:= Round(gSoundLevel
/16);
275 TGUIScroll(menu
.GetControl('scMusicLevel')).Value
:= Round(gMusicLevel
/16);
276 TGUIScroll(menu
.GetControl('scMaxSimSounds')).Value
:= Round((gMaxSimSounds
-2)/4);
278 with TGUISwitch(menu
.GetControl('swInactiveSounds')) do
279 if gMuteWhenInactive
then
284 TGUISwitch(menu
.GetControl('swAnnouncer')).ItemIndex
:= gAnnouncer
;
286 with TGUISwitch(menu
.GetControl('swSoundEffects')) do
287 if gSoundEffectsDF
then
292 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1Menu').GetControl('mOptionsControlsP1Menu'));
294 with menu
, gGameControls
.P1Control
do
296 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key
:= KeyRight
;
297 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key
:= KeyLeft
;
298 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key
:= KeyUp
;
299 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key
:= KeyDown
;
300 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key
:= KeyFire
;
301 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key
:= KeyJump
;
302 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key
:= KeyNextWeapon
;
303 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key
:= KeyPrevWeapon
;
304 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key
:= KeyOpen
;
307 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2Menu').GetControl('mOptionsControlsP2Menu'));
309 with menu
, gGameControls
.P2Control
do
311 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key
:= KeyRight
;
312 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key
:= KeyLeft
;
313 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key
:= KeyUp
;
314 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key
:= KeyDown
;
315 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key
:= KeyFire
;
316 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key
:= KeyJump
;
317 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key
:= KeyNextWeapon
;
318 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key
:= KeyPrevWeapon
;
319 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key
:= KeyOpen
;
322 if e_JoysticksAvailable
> 0 then
324 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsJoystickMenu').GetControl('mOptionsControlsJoystickMenu'));
327 for i
:= 0 to e_JoysticksAvailable
-1 do
328 TGUIScroll(menu
.GetControl('scDeadzone' + IntToStr(i
))).Value
:= e_JoystickDeadzones
[i
] div (32767 div 20);
332 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
333 with menu
, gGameControls
.GameControls
do
335 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_SCREENSHOT
])).Key
:= TakeScreenshot
;
336 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_STAT
])).Key
:= Stat
;
337 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_CHAT
])).Key
:= Chat
;
338 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_TEAMCHAT
])).Key
:= TeamChat
;
341 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
343 TGUIScroll(menu
.GetControl('scParticlesCount')).Value
:= g_GFX_GetMax() div 1000;
344 TGUIScroll(menu
.GetControl('scShellsMax')).Value
:= g_Shells_GetMax() div 30;
345 TGUIScroll(menu
.GetControl('scGibsMax')).Value
:= g_Gibs_GetMax() div 25;
346 TGUIScroll(menu
.GetControl('scCorpsesMax')).Value
:= g_Corpses_GetMax() div 5;
347 TGUISwitch(menu
.GetControl('swBloodCount')).ItemIndex
:= gBloodCount
;
349 with TGUISwitch(menu
.GetControl('swScreenFlash')) do
352 with TGUISwitch(menu
.GetControl('swBloodType')) do
353 if gAdvBlood
then ItemIndex
:= 1 else ItemIndex
:= 0;
355 with TGUISwitch(menu
.GetControl('swCorpseType')) do
356 if gAdvCorpses
then ItemIndex
:= 1 else ItemIndex
:= 0;
358 with TGUISwitch(menu
.GetControl('swGibsType')) do
359 if gAdvGibs
then ItemIndex
:= 1 else ItemIndex
:= 0;
361 with TGUISwitch(menu
.GetControl('swGibsCount')) do
370 with TGUISwitch(menu
.GetControl('swBackGround')) do
371 if gDrawBackGround
then ItemIndex
:= 0 else ItemIndex
:= 1;
373 with TGUISwitch(menu
.GetControl('swMessages')) do
374 if gShowMessages
then ItemIndex
:= 0 else ItemIndex
:= 1;
376 with TGUISwitch(menu
.GetControl('swRevertPlayers')) do
377 if gRevertPlayers
then ItemIndex
:= 0 else ItemIndex
:= 1;
379 with TGUISwitch(menu
.GetControl('swChatBubble')) do
380 ItemIndex
:= gChatBubble
;
382 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
384 TGUIListBox(menu
.GetControl('lsP1Model')).SelectItem(gPlayer1Settings
.Model
);
385 TGUIEdit(menu
.GetControl('edP1Name')).Text := gPlayer1Settings
.Name
;
387 TGUISwitch(menu
.GetControl('swP1Team')).ItemIndex
:=
388 IfThen(gPlayer1Settings
.Team
= TEAM_BLUE
, 1, 0);
390 TGUIScroll(menu
.GetControl('scP1Red')).Value
:= Round(gPlayer1Settings
.Color
.R
/16);
391 TGUIScroll(menu
.GetControl('scP1Green')).Value
:= Round(gPlayer1Settings
.Color
.G
/16);
392 TGUIScroll(menu
.GetControl('scP1Blue')).Value
:= Round(gPlayer1Settings
.Color
.B
/16);
394 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
396 TGUIListBox(menu
.GetControl('lsP2Model')).SelectItem(gPlayer2Settings
.Model
);
397 TGUIEdit(menu
.GetControl('edP2Name')).Text := gPlayer2Settings
.Name
;
399 TGUISwitch(menu
.GetControl('swP2Team')).ItemIndex
:=
400 IfThen(gPlayer2Settings
.Team
= TEAM_BLUE
, 1, 0);
402 TGUIScroll(menu
.GetControl('scP2Red')).Value
:= Round(gPlayer2Settings
.Color
.R
/16);
403 TGUIScroll(menu
.GetControl('scP2Green')).Value
:= Round(gPlayer2Settings
.Color
.G
/16);
404 TGUIScroll(menu
.GetControl('scP2Blue')).Value
:= Round(gPlayer2Settings
.Color
.B
/16);
406 ProcSelectModel(nil);
409 procedure ProcSwitchMonstersCustom(Sender
: TGUIControl
);
411 with TGUIMenu(g_ActiveWindow
.GetControl('mCustomGameMenu')) do
412 if TGUISwitch(GetControl('swGameMode')).GetText
= _lc
[I_MENU_GAME_TYPE_COOP
] then
413 TGUISwitch(GetControl('swMonsters')).ItemIndex
:= 0
415 TGUISwitch(GetControl('swMonsters')).ItemIndex
:= 1;
418 procedure ProcSwitchMonstersNet(Sender
: TGUIControl
);
420 with TGUIMenu(g_ActiveWindow
.GetControl('mNetServerMenu')) do
421 if TGUISwitch(GetControl('swGameMode')).GetText
= _lc
[I_MENU_GAME_TYPE_COOP
] then
422 TGUISwitch(GetControl('swMonsters')).ItemIndex
:= 0
424 TGUISwitch(GetControl('swMonsters')).ItemIndex
:= 1;
427 procedure ProcStartCustomGame();
433 with TGUIMenu(g_ActiveWindow
.GetControl('mCustomGameMenu')) do
435 Map
:= TGUILabel(GetControl('lbMap')).Text;
438 if Pos(':\', Map
) = 0 then
441 GameMode
:= TGUISwitch(GetControl('swGameMode')).ItemIndex
+1;
442 gcGameMode
:= TGUISwitch(GetControl('swGameMode')).GetText
;
443 gcTimeLimit
:= StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
444 gcGoalLimit
:= StrToIntDef(TGUIEdit(GetControl('edGoalLimit')).Text, 0);
445 gcMaxLives
:= StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
447 gcTeamDamage
:= TGUISwitch(GetControl('swTeamDamage')).ItemIndex
= 0;
448 gcAllowExit
:= TGUISwitch(GetControl('swEnableExits')).ItemIndex
= 0;
449 gcWeaponStay
:= TGUISwitch(GetControl('swWeaponStay')).ItemIndex
= 0;
450 gcMonsters
:= TGUISwitch(GetControl('swMonsters')).ItemIndex
= 0;
453 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
455 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
457 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
459 Options
:= Options
or GAME_OPTION_MONSTERS
;
460 gcPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
;
462 case TGUISwitch(GetControl('swBotsVS')).ItemIndex
of
464 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
465 gcBotsVS
:= 'Monsters';
468 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
469 gcBotsVS
:= 'Everybody';
472 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
473 gcBotsVS
:= 'Players';
480 g_Options_Write_Gameplay_Custom(GameDir
+'/'+CONFIG_FILENAME
);
482 g_Game_StartCustom(Map
, GameMode
, gcTimeLimit
, gcGoalLimit
,
483 gcMaxLives
, Options
, gcPlayers
);
487 procedure ProcStartNetGame();
493 with TGUIMenu(g_ActiveWindow
.GetControl('mNetServerMenu')) do
495 Map
:= TGUILabel(GetControl('lbMap')).Text;
498 if Pos(':\', Map
) = 0 then
501 GameMode
:= TGUISwitch(GetControl('swGameMode')).ItemIndex
+1;
502 gnGameMode
:= TGUISwitch(GetControl('swGameMode')).GetText
;
503 gnTimeLimit
:= StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
504 gnGoalLimit
:= StrToIntDef(TGUIEdit(GetControl('edGoalLimit')).Text, 0);
505 gnMaxLives
:= StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
506 NetPort
:= StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
508 gnTeamDamage
:= TGUISwitch(GetControl('swTeamDamage')).ItemIndex
= 0;
509 gnAllowExit
:= TGUISwitch(GetControl('swEnableExits')).ItemIndex
= 0;
510 gnWeaponStay
:= TGUISwitch(GetControl('swWeaponStay')).ItemIndex
= 0;
511 gnMonsters
:= TGUISwitch(GetControl('swMonsters')).ItemIndex
= 0;
514 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
516 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
518 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
520 Options
:= Options
or GAME_OPTION_MONSTERS
;
521 gnPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
;
523 case TGUISwitch(GetControl('swBotsVS')).ItemIndex
of
525 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
526 gnBotsVS
:= 'Monsters';
529 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
530 gnBotsVS
:= 'Everybody';
533 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
534 gnBotsVS
:= 'Players';
539 NetServerName
:= TGUIEdit(GetControl('edSrvName')).Text;
540 NetMaxClients
:= Max(1, StrToIntDef(TGUIEdit(GetControl('edMaxPlayers')).Text, 1));
541 NetMaxClients
:= Min(NET_MAXCLIENTS
, NetMaxClients
);
542 NetPassword
:= TGUIEdit(GetControl('edSrvPassword')).Text;
543 NetUseMaster
:= TGUISwitch(GetControl('swUseMaster')).ItemIndex
= 0;
546 g_Options_Write_Net_Server(GameDir
+'/'+CONFIG_FILENAME
);
547 g_Options_Write_Gameplay_Net(GameDir
+'/'+CONFIG_FILENAME
);
549 g_Game_StartServer(Map
, GameMode
, gnTimeLimit
, gnGoalLimit
, gnMaxLives
,
550 Options
, gnPlayers
, 0, NetPort
);
553 procedure ProcConnectNetGame();
557 with TGUIMenu(g_ActiveWindow
.GetControl('mNetClientMenu')) do
559 NetClientIP
:= TGUIEdit(GetControl('edIP')).Text;
560 NetClientPort
:= StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
561 PW
:= TGUIEdit(GetControl('edPW')).Text;
564 g_Options_Write_Net_Client(GameDir
+'/'+CONFIG_FILENAME
);
565 g_Game_StartClient(NetClientIP
, NetClientPort
, PW
);
568 procedure ProcEnterPassword();
572 with TGUIMenu(g_ActiveWindow
.GetControl('mClientPasswordMenu')) do
574 NetClientIP
:= PromptIP
;
575 NetClientPort
:= PromptPort
;
576 PW
:= TGUIEdit(GetControl('edPW')).Text;
579 g_Options_Write_Net_Client(GameDir
+'/'+CONFIG_FILENAME
);
580 g_Game_StartClient(NetClientIP
, NetClientPort
, PW
);
583 procedure ProcServerlist();
585 if not NetInitDone
then
587 if (not g_Net_Init()) then
589 g_Console_Add('NET: ERROR: Failed to init ENet!');
596 g_Net_Slist_Set(NetSlistIP
, NetSlistPort
);
598 gState
:= STATE_SLIST
;
599 g_ActiveWindow
:= nil;
601 slWaitStr
:= _lc
[I_NET_SLIST_WAIT
];
606 slReturnPressed
:= True;
607 if g_Net_Slist_Fetch(slCurrent
) then
609 if slCurrent
= nil then
610 slWaitStr
:= _lc
[I_NET_SLIST_NOSERVERS
];
613 slWaitStr
:= _lc
[I_NET_SLIST_ERROR
];
616 procedure ProcStartCampaign();
622 with TGUIMenu(g_ActiveWindow
.GetControl('mCampaignMenu')) do
624 WAD
:= ExtractRelativePath(MapsDir
, TGUIFileListBox(GetControl('lsWAD')).SelectedItem());
625 TwoPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
= 1;
632 g_Game_StartSingle(WAD
+ ':\MAP01', TwoPlayers
, n
);
635 procedure ProcSelectMap(Sender
: TGUIControl
);
639 wad
, map
, res
: String;
641 win
:= g_GUI_GetWindow('SelectMapMenu');
642 with TGUIMenu(win
.GetControl('mSelectMapMenu')) do
644 wad
:= TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem();
645 map
:= TGUIListBox(GetControl('lsMapRes')).SelectedItem();
647 if (wad
= '') or (map
= '') then
648 begin // Ýòî íå êàðòà
649 TGUILabel(GetControl('lbMapName')).Text := '';
650 TGUILabel(GetControl('lbMapAuthor')).Text := '';
651 TGUILabel(GetControl('lbMapSize')).Text := '';
652 TGUIMemo(GetControl('meMapDescription')).SetText('');
653 TGUIMapPreview(win
.GetControl('mpMapPreview')).ClearMap();
654 TGUILabel(win
.GetControl('lbMapScale')).Text := '';
660 a
:= g_Map_GetMapInfo(res
);
662 TGUILabel(GetControl('lbMapName')).Text := a
.Name
;
663 TGUILabel(GetControl('lbMapAuthor')).Text := a
.Author
;
664 TGUILabel(GetControl('lbMapSize')).Text := Format('%dx%d', [a
.Width
, a
.Height
]);
665 TGUIMemo(GetControl('meMapDescription')).SetText(a
.Description
);
666 TGUIMapPreview(win
.GetControl('mpMapPreview')).SetMap(res
);
667 TGUILabel(win
.GetControl('lbMapScale')).Text :=
668 TGUIMapPreview(win
.GetControl('mpMapPreview')).GetScaleStr
;
673 procedure ProcSelectWAD(Sender
: TGUIControl
);
678 with TGUIMenu(g_GUI_GetWindow('SelectMapMenu').GetControl('mSelectMapMenu')) do
680 wad
:= TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem();
682 with TGUIListBox(GetControl('lsMapRes')) do
688 list
:= g_Map_GetMapsList(wad
);
702 procedure ProcSelectCampaignWAD(Sender
: TGUIControl
);
708 win
:= g_GUI_GetWindow('CampaignMenu');
709 with TGUIMenu(win
.GetControl('mCampaignMenu')) do
711 wad
:= TGUIFileListBox(GetControl('lsWAD')).SelectedItem();
715 TGUILabel(GetControl('lbWADName')).Text := '';
716 TGUILabel(GetControl('lbWADAuthor')).Text := '';
717 TGUIMemo(GetControl('meWADDescription')).SetText('');
720 a
:= g_Game_GetMegaWADInfo(wad
);
722 TGUILabel(GetControl('lbWADName')).Text := a
.Name
;
723 TGUILabel(GetControl('lbWADAuthor')).Text := a
.Author
;
724 TGUIMemo(GetControl('meWADDescription')).SetText(a
.Description
);
726 TGUIImage(win
.GetControl('mpWADImage')).ClearImage();
730 g_ProcessResourceStr(a
.pic
, @fn
, nil, nil);
732 TGUIImage(win
.GetControl('mpWADImage')).SetImage(wad
+a
.pic
)
734 TGUIImage(win
.GetControl('mpWADImage')).SetImage(a
.pic
);
739 procedure ProcChangeColor(Sender
: TGUIControl
);
743 window
:= g_GUI_GetWindow('OptionsPlayersP1Menu');
744 with TGUIMenu(window
.GetControl('mOptionsPlayersP1Menu')) do
745 TGUIModelView(window
.GetControl('mvP1Model')).SetColor(
746 Min(TGUIScroll(GetControl('scP1Red')).Value
*16, 255),
747 Min(TGUIScroll(GetControl('scP1Green')).Value
*16, 255),
748 Min(TGUIScroll(GetControl('scP1Blue')).Value
*16, 255));
750 window
:= g_GUI_GetWindow('OptionsPlayersP2Menu');
751 with TGUIMenu(window
.GetControl('mOptionsPlayersP2Menu')) do
752 TGUIModelView(window
.GetControl('mvP2Model')).SetColor(
753 Min(TGUIScroll(GetControl('scP2Red')).Value
*16, 255),
754 Min(TGUIScroll(GetControl('scP2Green')).Value
*16, 255),
755 Min(TGUIScroll(GetControl('scP2Blue')).Value
*16, 255));
758 procedure ProcSelectModel(Sender
: TGUIControl
);
763 window
:= g_GUI_GetWindow('OptionsPlayersP1Menu');
764 a
:= TGUIListBox(TGUIMenu(window
.GetControl('mOptionsPlayersP1Menu')).GetControl('lsP1Model')).SelectedItem
;
765 if a
<> '' then TGUIModelView(window
.GetControl('mvP1Model')).SetModel(a
);
767 window
:= g_GUI_GetWindow('OptionsPlayersP2Menu');
768 a
:= TGUIListBox(TGUIMenu(window
.GetControl('mOptionsPlayersP2Menu')).GetControl('lsP2Model')).SelectedItem
;
769 if a
<> '' then TGUIModelView(window
.GetControl('mvP2Model')).SetModel(a
);
771 ProcChangeColor(nil);
774 procedure LoadStdFont(cfgres
, texture
: string; var FontID
: DWORD
);
786 wad
:= TWADEditor_1
.Create
;
787 if wad
.ReadFile(GameWAD
) then
788 wad
.GetResource('FONTS', cfgres
, cfgdata
, cfglen
);
793 g_Texture_CreateWADEx('FONT_STD', GameWAD
+':FONTS\'+texture
);
795 config
:= TConfig
.CreateMem(cfgdata
, cfglen
);
796 cwdt
:= Min(Max(config
.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
797 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
798 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
800 if g_Texture_Get('FONT_STD', ID
) then
801 e_TextureFontBuild(ID
, FontID
, cwdt
, chgt
, spc
);
806 if cfglen
<> 0 then FreeMem(cfgdata
);
809 procedure LoadFont(txtres
, fntres
: string; var FontID
: DWORD
);
815 cfgdata
, fntdata
: Pointer;
816 cfglen
, fntlen
: Integer;
824 wad
:= TWADEditor_1
.Create
;
825 if wad
.ReadFile(GameWAD
) then
827 wad
.GetResource('FONTS', txtres
, cfgdata
, cfglen
);
828 wad
.GetResource('FONTS', fntres
, fntdata
, fntlen
);
834 config
:= TConfig
.CreateMem(cfgdata
, cfglen
);
835 cwdt
:= Min(Max(config
.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
836 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
838 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
839 FontID
:= e_CharFont_Create(spc
);
843 chrwidth
:= config
.ReadInt(IntToStr(a
), 'Width', 0);
844 if chrwidth
= 0 then Continue
;
846 if e_CreateTextureMemEx(fntdata
, CharID
, cwdt
*(a
mod 16), chgt
*(a
div 16),
848 e_CharFont_AddChar(FontID
, CharID
, Chr(a
), chrwidth
);
854 if cfglen
<> 0 then FreeMem(cfgdata
);
855 if fntlen
<> 0 then FreeMem(fntdata
);
858 procedure MenuLoadData();
860 e_WriteLog('Loading menu data...', MSG_NOTIFY
);
862 g_Texture_CreateWADEx('MAINMENU_MARKER1', GameWAD
+':TEXTURES\MARKER1');
863 g_Texture_CreateWADEx('MAINMENU_MARKER2', GameWAD
+':TEXTURES\MARKER2');
864 g_Texture_CreateWADEx('SCROLL_LEFT', GameWAD
+':TEXTURES\SLEFT');
865 g_Texture_CreateWADEx('SCROLL_RIGHT', GameWAD
+':TEXTURES\SRIGHT');
866 g_Texture_CreateWADEx('SCROLL_MIDDLE', GameWAD
+':TEXTURES\SMIDDLE');
867 g_Texture_CreateWADEx('SCROLL_MARKER', GameWAD
+':TEXTURES\SMARKER');
868 g_Texture_CreateWADEx('EDIT_LEFT', GameWAD
+':TEXTURES\ELEFT');
869 g_Texture_CreateWADEx('EDIT_RIGHT', GameWAD
+':TEXTURES\ERIGHT');
870 g_Texture_CreateWADEx('EDIT_MIDDLE', GameWAD
+':TEXTURES\EMIDDLE');
871 g_Texture_CreateWADEx('BOX1', GameWAD
+':TEXTURES\BOX1');
872 g_Texture_CreateWADEx('BOX2', GameWAD
+':TEXTURES\BOX2');
873 g_Texture_CreateWADEx('BOX3', GameWAD
+':TEXTURES\BOX3');
874 g_Texture_CreateWADEx('BOX4', GameWAD
+':TEXTURES\BOX4');
875 g_Texture_CreateWADEx('BOX5', GameWAD
+':TEXTURES\BOX5');
876 g_Texture_CreateWADEx('BOX6', GameWAD
+':TEXTURES\BOX6');
877 g_Texture_CreateWADEx('BOX7', GameWAD
+':TEXTURES\BOX7');
878 g_Texture_CreateWADEx('BOX8', GameWAD
+':TEXTURES\BOX8');
879 g_Texture_CreateWADEx('BOX9', GameWAD
+':TEXTURES\BOX9');
880 g_Texture_CreateWADEx('BSCROLL_UP_A', GameWAD
+':TEXTURES\SCROLLUPA');
881 g_Texture_CreateWADEx('BSCROLL_UP_U', GameWAD
+':TEXTURES\SCROLLUPU');
882 g_Texture_CreateWADEx('BSCROLL_DOWN_A', GameWAD
+':TEXTURES\SCROLLDOWNA');
883 g_Texture_CreateWADEx('BSCROLL_DOWN_U', GameWAD
+':TEXTURES\SCROLLDOWNU');
884 g_Texture_CreateWADEx('BSCROLL_MIDDLE', GameWAD
+':TEXTURES\SCROLLMIDDLE');
885 g_Texture_CreateWADEx('NOPIC', GameWAD
+':TEXTURES\NOPIC');
887 g_Sound_CreateWADEx('MENU_SELECT', GameWAD
+':SOUNDS\MENUSELECT');
888 g_Sound_CreateWADEx('MENU_OPEN', GameWAD
+':SOUNDS\MENUOPEN');
889 g_Sound_CreateWADEx('MENU_CLOSE', GameWAD
+':SOUNDS\MENUCLOSE');
890 g_Sound_CreateWADEx('MENU_CHANGE', GameWAD
+':SOUNDS\MENUCHANGE');
891 g_Sound_CreateWADEx('SCROLL_ADD', GameWAD
+':SOUNDS\SCROLLADD');
892 g_Sound_CreateWADEx('SCROLL_SUB', GameWAD
+':SOUNDS\SCROLLSUB');
893 g_Sound_CreateWADEx('SOUND_PLAYER_FALL', GameWAD
+':SOUNDS\FALL');
896 procedure MenuFreeData();
898 e_CharFont_Remove(gMenuFont
);
899 e_CharFont_Remove(gMenuSmallFont
);
901 g_Texture_Delete('MAINMENU_MARKER1');
902 g_Texture_Delete('MAINMENU_MARKER2');
903 g_Texture_Delete('SCROLL_LEFT');
904 g_Texture_Delete('SCROLL_RIGHT');
905 g_Texture_Delete('SCROLL_MIDDLE');
906 g_Texture_Delete('SCROLL_MARKER');
907 g_Texture_Delete('EDIT_LEFT');
908 g_Texture_Delete('EDIT_RIGHT');
909 g_Texture_Delete('EDIT_MIDDLE');
910 g_Texture_Delete('BOX1');
911 g_Texture_Delete('BOX2');
912 g_Texture_Delete('BOX3');
913 g_Texture_Delete('BOX4');
914 g_Texture_Delete('BOX5');
915 g_Texture_Delete('BOX6');
916 g_Texture_Delete('BOX7');
917 g_Texture_Delete('BOX8');
918 g_Texture_Delete('BOX9');
919 g_Texture_Delete('BSCROLL_UP_A');
920 g_Texture_Delete('BSCROLL_UP_U');
921 g_Texture_Delete('BSCROLL_DOWN_A');
922 g_Texture_Delete('BSCROLL_DOWN_U');
923 g_Texture_Delete('BSCROLL_MIDDLE');
924 g_Texture_Delete('NOPIC');
926 g_Sound_Delete('MENU_SELECT');
927 g_Sound_Delete('MENU_OPEN');
928 g_Sound_Delete('MENU_CLOSE');
929 g_Sound_Delete('MENU_CHANGE');
930 g_Sound_Delete('SCROLL_ADD');
931 g_Sound_Delete('SCROLL_SUB');
932 g_Sound_Delete('SOUND_PLAYER_FALL');
935 procedure ProcAuthorsMenu();
937 gMusic
.SetByName('MUSIC_INTERMUS');
941 procedure ProcExitMenuKeyDown (yes
: Boolean);
949 g_Game_StopAllSounds(True);
951 0: s
:= 'SOUND_MONSTER_PAIN';
952 1: s
:= 'SOUND_MONSTER_DIE_3';
953 2: s
:= 'SOUND_MONSTER_SLOP';
954 3: s
:= 'SOUND_MONSTER_DEMON_DIE';
955 4: s
:= 'SOUND_MONSTER_IMP_DIE_2';
956 5: s
:= 'SOUND_MONSTER_MAN_DIE';
957 6: s
:= 'SOUND_MONSTER_BSP_DIE';
958 7: s
:= 'SOUND_MONSTER_VILE_DIE';
959 8: s
:= 'SOUND_MONSTER_SKEL_DIE';
960 9: s
:= 'SOUND_MONSTER_MANCUB_ALERT';
961 10: s
:= 'SOUND_MONSTER_PAIN_PAIN';
962 11: s
:= 'SOUND_MONSTER_BARON_DIE';
963 12: s
:= 'SOUND_MONSTER_CACO_DIE';
964 13: s
:= 'SOUND_MONSTER_CYBER_DIE';
965 14: s
:= 'SOUND_MONSTER_KNIGHT_ALERT';
966 15: s
:= 'SOUND_MONSTER_SPIDER_ALERT';
967 else s
:= 'SOUND_PLAYER_FALL';
969 snd
:= TPlayableSound
.Create();
970 res
:= snd
.SetByName(s
);
971 if not res
then res
:= snd
.SetByName('SOUND_PLAYER_FALL');
975 while snd
.IsPlaying() do begin end;
983 procedure ProcLoadMenu();
988 TGUIEdit(TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a
))).Text :=
992 procedure ProcSaveMenu();
997 TGUIEdit(TGUIMenu(g_GUI_GetWindow('SaveMenu').GetControl('mmSaveMenu')).GetControl('edSlot'+IntToStr(a
))).Text :=
1001 procedure ProcSaveGame(Sender
: TGUIControl
);
1005 if g_Game_IsNet
then Exit
;
1006 if g_Game_IsTestMap
then Exit
;
1007 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
1008 g_Game_PauseAllSounds(True);
1009 g_SaveGame(a
, TGUIEdit(Sender
).Text);
1011 g_ActiveWindow
:= nil;
1012 g_Game_Pause(False);
1015 procedure ProcLoadGame(Sender
: TGUIControl
);
1019 if g_Game_IsNet
then Exit
;
1020 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
1021 if g_LoadGame(a
) then
1022 g_Game_PauseAllSounds(False)
1023 else // Íå çàãðóçèëîñü - âîçâðàò â ìåíþ
1024 g_GUI_GetWindow('LoadMenu').SetActive(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu'));
1027 procedure ProcSingle1Player();
1029 g_Game_StartSingle('megawads/DOOM2D.WAD:\MAP01', False, 1);
1032 procedure ProcSingle2Players();
1034 g_Game_StartSingle('megawads/DOOM2D.WAD:\MAP01', True, 2);
1037 procedure ProcSelectMapMenu();
1040 wad_lb
: TGUIFileListBox
;
1041 map_lb
: TGUIListBox
;
1044 menu
:= TGUIMenu(g_GUI_GetWindow('SelectMapMenu').GetControl('mSelectMapMenu'));
1045 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsMapWAD'));
1046 map_lb
:= TGUIListBox(menu
.GetControl('lsMapRes'));
1048 if wad_lb
.SelectedItem() <> '' then
1049 map
:= map_lb
.SelectedItem()
1053 wad_lb
.UpdateFileList();
1056 if wad_lb
.SelectedItem() <> '' then
1059 map_lb
.SelectItem(map
);
1061 if map_lb
.SelectedItem() <> '' then
1065 g_GUI_ShowWindow('SelectMapMenu');
1068 procedure ProcSelectCampaignMenu();
1071 wad_lb
: TGUIFileListBox
;
1073 menu
:= TGUIMenu(g_GUI_GetWindow('CampaignMenu').GetControl('mCampaignMenu'));
1074 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsWAD'));
1076 wad_lb
.UpdateFileList();
1078 if wad_lb
.SelectedItem() <> '' then
1079 ProcSelectCampaignWAD(nil);
1082 procedure ProcSetMap();
1084 wad
, map
, res
: String;
1086 with TGUIMenu(g_ActiveWindow
.GetControl('mSelectMapMenu')) do
1088 wad
:= ExtractRelativePath(MapsDir
, TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem());
1089 map
:= TGUIListBox(GetControl('lsMapRes')).SelectedItem();
1092 if (wad
= '') or (map
= '') then
1095 res
:= wad
+':\'+map
;
1097 TGUILabel(TGUIMenu(g_GUI_GetWindow('CustomGameMenu').GetControl('mCustomGameMenu')).GetControl('lbMap')).Text := res
;
1098 TGUILabel(TGUIMenu(g_GUI_GetWindow('NetServerMenu').GetControl('mNetServerMenu')).GetControl('lbMap')).Text := res
;
1101 procedure ProcChangeSoundSettings(Sender
: TGUIControl
);
1105 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
1107 g_Sound_SetupAllVolumes(
1108 Min(TGUIScroll(menu
.GetControl('scSoundLevel')).Value
*16, 255),
1109 Min(TGUIScroll(menu
.GetControl('scMusicLevel')).Value
*16, 255)
1113 procedure ProcOptionsPlayersMIMenu();
1118 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1120 a
:= TGUIListBox(TGUIMenu(g_ActiveWindow
.GetControl('mOptionsPlayers'+s
+'Menu')).GetControl('ls'+s
+'Model')).SelectedItem
;
1122 if a
= '' then Exit
;
1124 b
:= g_PlayerModel_GetInfo(a
);
1126 with TGUIMenu(g_GUI_GetWindow('OptionsPlayersMIMenu').GetControl('mOptionsPlayersMIMenu')) do
1128 TGUILabel(GetControl('lbName')).Text := b
.Name
;
1129 TGUILabel(GetControl('lbAuthor')).Text := b
.Author
;
1130 TGUIMemo(GetControl('meComment')).SetText(b
.Description
);
1132 if b
.HaveWeapon
then
1133 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_YES
]
1135 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_NO
];
1138 g_GUI_ShowWindow('OptionsPlayersMIMenu');
1141 procedure ProcOptionsPlayersAnim();
1145 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1150 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1153 Model
.GetCurrentAnimation
.Loop
:= True;
1154 Model
.GetCurrentAnimationMask
.Loop
:= True;
1158 procedure ProcOptionsPlayersWeap();
1162 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1167 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1171 procedure ProcOptionsPlayersRot();
1175 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1176 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')).Model
do
1177 if Direction
= D_LEFT
then Direction
:= D_RIGHT
else Direction
:= D_LEFT
;
1180 procedure ProcDefaultMenuKeyDown (yes
: Boolean);
1184 g_Options_SetDefault();
1190 procedure ProcSavedMenuKeyDown (yes
: Boolean);
1192 if yes
then ReadOptions();
1196 procedure ProcAuthorsClose();
1198 gMusic
.SetByName('MUSIC_MENU');
1200 gState
:= STATE_MENU
;
1203 procedure ProcGMClose();
1205 g_Game_InGameMenu(False);
1208 procedure ProcGMShow();
1213 if (gGameSettings
.GameType
= GT_SINGLE
) and
1214 ((gPlayer1
= nil) or (not gPlayer1
.Live
)) and
1215 ((gPlayer2
= nil) or (not gPlayer2
.Live
)) then
1216 Enabled
:= False; // Îäèí èç èãðîêîâ ïîãèá â ñèíãëå
1218 Enabled
:= False; // Çàïðåòèòü ñîõðàíåíèå â èíòåðìèññèè (íå ðåàëèçîâàíî)
1219 if g_Game_IsTestMap
then
1220 Enabled
:= False; // Åñëè èãðàåì íà òåñòîâîé èëè âðåìåííîé êàðòå
1221 TGUIMainMenu(g_ActiveWindow
.GetControl(
1222 g_ActiveWindow
.DefControl
)).EnableButton('save', Enabled
);
1225 procedure ProcChangePlayers();
1227 TeamGame
, Spectator
, AddTwo
: Boolean;
1228 P1Team
{, P2Team}: Byte;
1229 bP2
: TGUITextButton
;
1231 TeamGame
:= gGameSettings
.GameMode
in [GM_TDM
, GM_CTF
];
1232 Spectator
:= (gPlayer1
= nil) and (gPlayer2
= nil);
1233 AddTwo
:= gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
];
1234 P1Team
:= TEAM_NONE
;
1235 if gPlayer1
<> nil then P1Team
:= gPlayer1
.Team
;
1237 //P2Team := TEAM_NONE;
1238 //if gPlayer2 <> nil then P2Team := gPlayer2.Team;
1240 TGUIMainMenu(g_ActiveWindow
.GetControl(
1241 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinRed', TeamGame
and (P1Team
<> TEAM_RED
));
1242 TGUIMainMenu(g_ActiveWindow
.GetControl(
1243 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinBlue', TeamGame
and (P1Team
<> TEAM_BLUE
));
1244 TGUIMainMenu(g_ActiveWindow
.GetControl(
1245 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinGame', Spectator
and not TeamGame
);
1247 bP2
:= TGUIMainMenu(g_ActiveWindow
.GetControl(
1248 g_ActiveWindow
.DefControl
)).GetButton('tmPlayer2');
1249 bP2
.Enabled
:= AddTwo
and not Spectator
;
1251 bP2
.Color
:= MAINMENU_ITEMS_COLOR
1253 bP2
.Color
:= MAINMENU_UNACTIVEITEMS_COLOR
;
1254 if gPlayer2
= nil then
1255 bP2
.Caption
:= _lc
[I_MENU_ADD_PLAYER_2
]
1257 bP2
.Caption
:= _lc
[I_MENU_REM_PLAYER_2
];
1259 TGUIMainMenu(g_ActiveWindow
.GetControl(
1260 g_ActiveWindow
.DefControl
)).EnableButton('tmSpectate', not Spectator
);
1263 procedure ProcJoinRed();
1265 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1267 if g_Game_IsServer
then
1269 if gPlayer1
= nil then
1270 g_Game_AddPlayer(TEAM_RED
)
1273 if gPlayer1
.Team
<> TEAM_RED
then
1275 gPlayer1
.SwitchTeam
;
1276 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1279 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1284 gPlayer1Settings
.Team
:= TEAM_RED
;
1285 MC_SEND_PlayerSettings
;
1286 if gPlayer1
= nil then
1287 g_Game_AddPlayer(TEAM_RED
);
1289 g_ActiveWindow
:= nil;
1290 g_Game_Pause(False);
1293 procedure ProcJoinBlue();
1295 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1297 if g_Game_IsServer
then
1299 if gPlayer1
= nil then
1300 g_Game_AddPlayer(TEAM_BLUE
)
1303 if gPlayer1
.Team
<> TEAM_BLUE
then
1305 gPlayer1
.SwitchTeam
;
1306 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1309 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1314 gPlayer1Settings
.Team
:= TEAM_BLUE
;
1315 MC_SEND_PlayerSettings
;
1316 if gPlayer1
= nil then
1317 g_Game_AddPlayer(TEAM_BLUE
);
1319 g_ActiveWindow
:= nil;
1320 g_Game_Pause(False);
1323 procedure ProcJoinGame();
1325 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1327 if gPlayer1
= nil then
1329 g_ActiveWindow
:= nil;
1330 g_Game_Pause(False);
1333 procedure ProcSwitchP2();
1335 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
]) then
1337 if gPlayer1
= nil then
1339 if gPlayer2
= nil then
1342 g_Game_RemovePlayer();
1343 g_ActiveWindow
:= nil;
1344 g_Game_Pause(False);
1347 procedure ProcSpectate();
1349 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1352 g_ActiveWindow
:= nil;
1353 g_Game_Pause(False);
1356 procedure ProcRestartMenuKeyDown (yes
: Boolean);
1358 if yes
then g_Game_Restart() else g_GUI_HideWindow
;
1361 procedure ProcEndMenuKeyDown (yes
: Boolean);
1363 if yes
then gExit
:= EXIT_SIMPLE
else g_GUI_HideWindow
;
1366 procedure ProcSetRussianLanguage();
1368 if gLanguage
<> LANGUAGE_RUSSIAN
then
1370 gLanguage
:= LANGUAGE_RUSSIAN
;
1371 gLanguageChange
:= True;
1372 gAskLanguage
:= False;
1374 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1376 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1381 procedure ProcSetEnglishLanguage();
1383 if gLanguage
<> LANGUAGE_ENGLISH
then
1385 gLanguage
:= LANGUAGE_ENGLISH
;
1386 gLanguageChange
:= True;
1387 gAskLanguage
:= False;
1389 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1391 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1396 procedure ReadGameSettings();
1400 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1402 with gGameSettings
do
1404 with TGUISwitch(menu
.GetControl('swTeamDamage')) do
1405 if LongBool(Options
and GAME_OPTION_TEAMDAMAGE
) then
1410 TGUIEdit(menu
.GetControl('edTimeLimit')).Text := IntToStr(TimeLimit
);
1411 TGUIEdit(menu
.GetControl('edGoalLimit')).Text := IntToStr(GoalLimit
);
1412 TGUIEdit(menu
.GetControl('edMaxLives')).Text := IntToStr(MaxLives
);
1414 with TGUISwitch(menu
.GetControl('swBotsVS')) do
1415 if LongBool(Options
and GAME_OPTION_BOTVSPLAYER
) and
1416 LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1419 if LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1424 if GameType
in [GT_CUSTOM
, GT_SERVER
] then
1426 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1427 TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
:= True;
1428 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1429 TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
:= True;
1430 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1431 TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
:= True;
1432 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_ITEMSTEXT_COLOR
;
1433 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1437 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1438 with TGUIEdit(menu
.GetControl('edTimeLimit')) do
1443 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1444 with TGUIEdit(menu
.GetControl('edGoalLimit')) do
1449 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1450 with TGUIEdit(menu
.GetControl('edMaxLives')) do
1455 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1456 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1461 procedure ProcApplyGameSet();
1465 stat
: TPlayerStatArray
;
1467 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1469 if not g_Game_IsServer
then Exit
;
1471 with gGameSettings
do
1473 if TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
then
1475 if TGUISwitch(menu
.GetControl('swTeamDamage')).ItemIndex
= 0 then
1476 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
1478 Options
:= Options
and (not GAME_OPTION_TEAMDAMAGE
);
1481 if TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
then
1483 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edTimeLimit')).Text, TimeLimit
);
1489 b
:= (gTime
- gGameStartTime
) div 1000 + 10; // 10 ñåêóíä íà ñìåíó
1491 TimeLimit
:= Max(n
, b
);
1495 if TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
then
1497 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edGoalLimit')).Text, GoalLimit
);
1504 if GameMode
= GM_DM
then
1506 stat
:= g_Player_GetStats();
1508 for a
:= 0 to High(stat
) do
1509 if stat
[a
].Frags
> b
then
1513 b
:= Max(gTeamStat
[TEAM_RED
].Goals
, gTeamStat
[TEAM_BLUE
].Goals
);
1515 GoalLimit
:= Max(n
, b
);
1519 if TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
then
1521 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edMaxLives')).Text, GoalLimit
);
1522 if n
< 0 then n
:= 0;
1523 if n
> 255 then n
:= 255;
1529 stat
:= g_Player_GetStats();
1531 for a
:= 0 to High(stat
) do
1532 if stat
[a
].Lives
> b
then
1535 MaxLives
:= Max(n
, b
);
1539 if TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
then
1541 case TGUISwitch(menu
.GetControl('swBotsVS')).ItemIndex
of
1544 Options
:= Options
and (not GAME_OPTION_BOTVSPLAYER
);
1545 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1549 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1550 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1554 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1555 Options
:= Options
and (not GAME_OPTION_BOTVSMONSTER
);
1561 if g_Game_IsNet
then MH_SEND_GameSettings
;
1564 procedure ProcVideoOptionsRes();
1570 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1572 TGUILabel(menu
.GetControl('lbCurrentRes')).Text :=
1573 IntToStr(gScreenWidth
) +
1574 ' x ' + IntToStr(gScreenHeight
) +
1575 ', ' + IntToStr(gBPP
) + ' bpp';
1577 with TGUIListBox(menu
.GetControl('lsResolution')) do
1579 list
:= GetDisplayModes(gBPP
, SR
);
1590 with TGUISwitch(menu
.GetControl('swFullScreen')) do
1597 procedure ProcApplyVideoOptions();
1600 Fullscreen
: Boolean;
1601 SWidth
, SHeight
: Integer;
1604 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1606 str
:= TGUIListBox(menu
.GetControl('lsResolution')).SelectedItem
;
1607 SScanf(str
, '%dx%d', [@SWidth
, @SHeight
]);
1609 Fullscreen
:= TGUISwitch(menu
.GetControl('swFullScreen')).ItemIndex
= 0;
1611 if (SWidth
<> gScreenWidth
) or
1612 (SHeight
<> gScreenHeight
) or
1613 (Fullscreen
<> gFullscreen
) then
1615 gResolutionChange
:= True;
1616 gRC_Width
:= SWidth
;
1617 gRC_Height
:= SHeight
;
1618 gRC_FullScreen
:= Fullscreen
;
1619 gRC_Maximized
:= gWinMaximized
;
1622 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
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|*.pk3|*.zip';
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|*.pk3|*.zip';
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
]);
2336 with AddSwitch(_lc
[I_MENU_VIDEO_LEGACY_COMPATIBLE
]) do
2338 Name
:= 'swLegacyNPOT';
2339 AddItem(_lc
[I_MENU_NO
]);
2340 AddItem(_lc
[I_MENU_YES
]);
2343 AddText(_lc
[I_MENU_VIDEO_NEED_RESTART
], Round(gScreenWidth
*0.6));
2346 Menu
.DefControl
:= 'mOptionsVideoMenu';
2347 g_GUI_AddWindow(Menu
);
2349 Menu
:= TGUIWindow
.Create('OptionsVideoResMenu');
2350 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_RESOLUTION_SELECT
]))) do
2352 Name
:= 'mOptionsVideoResMenu';
2353 with AddLabel(_lc
[I_MENU_RESOLUTION_CURRENT
]) do
2355 Name
:= 'lbCurrentRes';
2359 with AddList(_lc
[I_MENU_RESOLUTION_LIST
], 12, 6) do
2361 Name
:= 'lsResolution';
2364 with AddSwitch(_lc
[I_MENU_RESOLUTION_FULLSCREEN
]) do
2366 Name
:= 'swFullScreen';
2367 AddItem(_lc
[I_MENU_YES
]);
2368 AddItem(_lc
[I_MENU_NO
]);
2371 AddButton(@ProcApplyVideoOptions
, _lc
[I_MENU_RESOLUTION_APPLY
]);
2374 Menu
.DefControl
:= 'mOptionsVideoResMenu';
2375 g_GUI_AddWindow(Menu
);
2377 Menu
:= TGUIWindow
.Create('OptionsSoundMenu');
2378 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SOUND_OPTIONS
]))) do
2380 Name
:= 'mOptionsSoundMenu';
2381 with AddScroll(_lc
[I_MENU_SOUND_MUSIC_LEVEL
]) do
2383 Name
:= 'scMusicLevel';
2385 OnChange
:= ProcChangeSoundSettings
;
2387 with AddScroll(_lc
[I_MENU_SOUND_SOUND_LEVEL
]) do
2389 Name
:= 'scSoundLevel';
2391 OnChange
:= ProcChangeSoundSettings
;
2393 with AddScroll(_lc
[I_MENU_SOUND_MAX_SIM_SOUNDS
]) do
2395 Name
:= 'scMaxSimSounds';
2398 with AddSwitch (_lc
[I_MENU_SOUND_ANNOUNCE
]) do
2400 Name
:= 'swAnnouncer';
2401 AddItem(_lc
[I_MENU_ANNOUNCE_NONE
]);
2402 AddItem(_lc
[I_MENU_ANNOUNCE_ME
]);
2403 AddItem(_lc
[I_MENU_ANNOUNCE_MEPLUS
]);
2404 AddItem(_lc
[I_MENU_ANNOUNCE_ALL
]);
2406 // Ïåðåêëþ÷àòåëü çâóêîâûõ ýôôåêòîâ (DF / Doom 2)
2407 with AddSwitch (_lc
[I_MENU_SOUND_COMPAT
]) do
2409 Name
:= 'swSoundEffects';
2410 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2411 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2413 with AddSwitch(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS
]) do
2415 Name
:= 'swInactiveSounds';
2416 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_ON
]);
2417 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_OFF
]);
2421 Menu
.DefControl
:= 'mOptionsSoundMenu';
2422 g_GUI_AddWindow(Menu
);
2424 Menu
:= TGUIWindow
.Create('OptionsGameMenu');
2425 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_GAME_OPTIONS
]))) do
2427 Name
:= 'mOptionsGameMenu';
2428 with AddScroll(_lc
[I_MENU_GAME_PARTICLES_COUNT
]) do
2430 Name
:= 'scParticlesCount';
2433 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_COUNT
]) do
2435 Name
:= 'swBloodCount';
2436 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2437 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2438 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2439 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2440 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2442 with AddScroll(_lc
[I_MENU_GAME_MAX_SHELLS
]) do
2444 Name
:= 'scShellsMax';
2447 with AddScroll(_lc
[I_MENU_GAME_GIBS_COUNT
]) do
2449 Name
:= 'scGibsMax';
2452 with AddScroll(_lc
[I_MENU_GAME_MAX_CORPSES
]) do
2454 Name
:= 'scCorpsesMax';
2457 with AddSwitch(_lc
[I_MENU_GAME_MAX_GIBS
]) do
2459 Name
:= 'swGibsCount';
2460 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2461 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2462 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2463 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2464 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2466 with AddSwitch(_lc
[I_MENU_GAME_CORPSE_TYPE
]) do
2468 Name
:= 'swCorpseType';
2469 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_SIMPLE
]);
2470 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_ADV
]);
2472 with AddSwitch(_lc
[I_MENU_GAME_GIBS_TYPE
]) do
2474 Name
:= 'swGibsType';
2475 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_SIMPLE
]);
2476 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_ADV
]);
2478 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_TYPE
]) do
2480 Name
:= 'swBloodType';
2481 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_SIMPLE
]);
2482 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_ADV
]);
2484 with AddSwitch(_lc
[I_MENU_GAME_SCREEN_FLASH
]) do
2486 Name
:= 'swScreenFlash';
2487 AddItem(_lc
[I_MENU_NO
]);
2488 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2489 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2491 with AddSwitch(_lc
[I_MENU_GAME_BACKGROUND
]) do
2493 Name
:= 'swBackground';
2494 AddItem(_lc
[I_MENU_YES
]);
2495 AddItem(_lc
[I_MENU_NO
]);
2497 with AddSwitch(_lc
[I_MENU_GAME_MESSAGES
]) do
2499 Name
:= 'swMessages';
2500 AddItem(_lc
[I_MENU_YES
]);
2501 AddItem(_lc
[I_MENU_NO
]);
2503 with AddSwitch(_lc
[I_MENU_GAME_REVERT_PLAYERS
]) do
2505 Name
:= 'swRevertPlayers';
2506 AddItem(_lc
[I_MENU_YES
]);
2507 AddItem(_lc
[I_MENU_NO
]);
2509 with AddSwitch(_lc
[I_MENU_GAME_CHAT_BUBBLE
]) do
2511 Name
:= 'swChatBubble';
2512 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_NONE
]);
2513 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_SIMPLE
]);
2514 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_ADV
]);
2515 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_COLOR
]);
2516 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_TEXTURE
]);
2520 Menu
.DefControl
:= 'mOptionsGameMenu';
2521 g_GUI_AddWindow(Menu
);
2523 Menu
:= TGUIWindow
.Create('OptionsControlsMenu');
2524 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROLS_OPTIONS
]))) do
2526 Name
:= 'mOptionsControlsMenu';
2527 AddLine(_lc
[I_MENU_CONTROL_GLOBAL
]);
2528 AddKeyRead(_lc
[I_MENU_CONTROL_SCREENSHOT
]).Name
:= _lc
[I_MENU_CONTROL_SCREENSHOT
];
2529 AddKeyRead(_lc
[I_MENU_CONTROL_STAT
]).Name
:= _lc
[I_MENU_CONTROL_STAT
];
2530 AddKeyRead(_lc
[I_MENU_CONTROL_CHAT
]).Name
:= _lc
[I_MENU_CONTROL_CHAT
];
2531 AddKeyRead(_lc
[I_MENU_CONTROL_TEAMCHAT
]).Name
:= _lc
[I_MENU_CONTROL_TEAMCHAT
];
2533 AddButton(nil, _lc
[I_MENU_PLAYER_1
], 'OptionsControlsP1Menu');
2534 AddButton(nil, _lc
[I_MENU_PLAYER_2
], 'OptionsControlsP2Menu');
2536 if e_JoysticksAvailable
<> 0 then
2537 AddButton(nil, _lc
[I_MENU_CONTROL_JOYSTICKS
], 'OptionsControlsJoystickMenu');
2539 Menu
.DefControl
:= 'mOptionsControlsMenu';
2540 g_GUI_AddWindow(Menu
);
2542 Menu
:= TGUIWindow
.Create('OptionsControlsP1Menu');
2543 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_1
]))) do
2545 Name
:= 'mOptionsControlsP1Menu';
2546 AddKeyRead(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
2547 AddKeyRead(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
2548 AddKeyRead(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
2549 AddKeyRead(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
2550 AddKeyRead(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
2551 AddKeyRead(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
2552 AddKeyRead(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
2553 AddKeyRead(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
2554 AddKeyRead(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
2556 Menu
.DefControl
:= 'mOptionsControlsP1Menu';
2557 g_GUI_AddWindow(Menu
);
2559 Menu
:= TGUIWindow
.Create('OptionsControlsP2Menu');
2560 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_2
]))) do
2562 Name
:= 'mOptionsControlsP2Menu';
2563 AddKeyRead(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
2564 AddKeyRead(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
2565 AddKeyRead(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
2566 AddKeyRead(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
2567 AddKeyRead(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
2568 AddKeyRead(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
2569 AddKeyRead(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
2570 AddKeyRead(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
2571 AddKeyRead(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
2573 Menu
.DefControl
:= 'mOptionsControlsP2Menu';
2574 g_GUI_AddWindow(Menu
);
2576 Menu
:= TGUIWindow
.Create('OptionsControlsJoystickMenu');
2577 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROL_JOYSTICKS
]))) do
2579 Name
:= 'mOptionsControlsJoystickMenu';
2580 for i
:= 0 to e_JoysticksAvailable
-1 do
2581 with AddScroll(Format(_lc
[I_MENU_CONTROL_DEADZONE
], [i
+ 1])) do
2583 Name
:= 'scDeadzone' + IntToStr(i
);
2587 Menu
.DefControl
:= 'mOptionsControlsJoystickMenu';
2588 g_GUI_AddWindow(Menu
);
2590 Menu
:= TGUIWindow
.Create('OptionsPlayersMenu');
2591 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_OPTIONS
]))) do
2593 Name
:= 'mOptionsPlayersMenu';
2594 AddButton(nil, _lc
[I_MENU_PLAYER_1
], 'OptionsPlayersP1Menu');
2595 AddButton(nil, _lc
[I_MENU_PLAYER_2
], 'OptionsPlayersP2Menu');
2597 Menu
.DefControl
:= 'mOptionsPlayersMenu';
2598 g_GUI_AddWindow(Menu
);
2600 CreatePlayerOptionsMenu('P1');
2601 CreatePlayerOptionsMenu('P2');
2603 Menu
:= TGUIWindow
.Create('OptionsPlayersMIMenu');
2604 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_MODEL_INFO
]))) do
2606 Name
:= 'mOptionsPlayersMIMenu';
2607 with AddLabel(_lc
[I_MENU_MODEL_NAME
]) do
2612 with AddLabel(_lc
[I_MENU_MODEL_AUTHOR
]) do
2617 with AddMemo(_lc
[I_MENU_MODEL_COMMENT
], 14, 6) do
2619 Name
:= 'meComment';
2622 AddLine(_lc
[I_MENU_MODEL_OPTIONS
]);
2623 with AddLabel(_lc
[I_MENU_MODEL_WEAPON
]) do
2626 FixedLength
:= Max(Length(_lc
[I_MENU_YES
]), Length(_lc
[I_MENU_NO
]));
2630 Menu
.DefControl
:= 'mOptionsPlayersMIMenu';
2631 g_GUI_AddWindow(Menu
);
2633 Menu
:= TGUIWindow
.Create('OptionsLanguageMenu');
2634 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_LANGUAGE_OPTIONS
]))) do
2636 Name
:= 'mOptionsLanguageMenu';
2637 AddButton(@ProcSetRussianLanguage
, _lc
[I_MENU_LANGUAGE_RUSSIAN
]);
2638 AddButton(@ProcSetEnglishLanguage
, _lc
[I_MENU_LANGUAGE_ENGLISH
]);
2641 Menu
.DefControl
:= 'mOptionsLanguageMenu';
2642 g_GUI_AddWindow(Menu
);
2644 Menu
:= CreateYNMenu('DefaultOptionsMenu', _lc
[I_MENU_SET_DEFAULT_PROMT
], Round(gScreenWidth
*0.6),
2645 gMenuSmallFont
, @ProcDefaultMenuKeyDown
);
2646 g_GUI_AddWindow(Menu
);
2648 Menu
:= TGUIWindow
.Create('AuthorsMenu');
2649 Menu
.BackTexture
:= 'INTER';
2650 Menu
.OnClose
:= ProcAuthorsClose
;
2654 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_1
], gMenuFont
))) do
2656 Color
:= _RGB(255, 0, 0);
2657 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
2659 _y
:= _y
+GetHeight();
2661 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(Format(_lc
[I_CREDITS_CAP_2
], [GAME_VERSION
, NET_PROTOCOL_VER
]), gMenuSmallFont
))) do
2663 Color
:= _RGB(255, 0, 0);
2664 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
2666 _y
:= _y
+GetHeight()+32;
2668 // ×òî äåëàë: Êòî äåëàë
2669 cx
:= gScreenWidth
div 2 - 320 + 64;
2670 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1
], gMenuSmallFont
))) do
2672 Color
:= _RGB(255, 0, 0);
2677 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1_1
], gMenuSmallFont
))) do
2679 Color
:= _RGB(255, 255, 255);
2684 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2
], gMenuSmallFont
))) do
2686 Color
:= _RGB(255, 0, 0);
2691 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2_1
], gMenuSmallFont
))) do
2693 Color
:= _RGB(255, 255, 255);
2698 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2_2
], gMenuSmallFont
))) do
2700 Color
:= _RGB(255, 255, 255);
2705 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3
], gMenuSmallFont
))) do
2707 Color
:= _RGB(255, 0, 0);
2712 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3_1
], gMenuSmallFont
))) do
2714 Color
:= _RGB(255, 255, 255);
2719 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4
], gMenuSmallFont
))) do
2721 Color
:= _RGB(255, 0, 0);
2726 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4_1
], gMenuSmallFont
))) do
2728 Color
:= _RGB(255, 255, 255);
2731 _y
:= gScreenHeight
- 128;
2734 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_3
], gMenuSmallFont
))) do
2736 Color
:= _RGB(255, 0, 0);
2741 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_1
], gMenuSmallFont
))) do
2743 Color
:= _RGB(255, 255, 255);
2746 _y
:= _y
+GetHeight();
2748 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_2
], gMenuSmallFont
))) do
2750 Color
:= _RGB(255, 255, 255);
2753 _y
:= _y
+GetHeight();
2755 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_3
], gMenuSmallFont
))) do
2757 Color
:= _RGB(255, 255, 255);
2760 _y
:= gScreenHeight
- 32;
2762 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_4
], gMenuSmallFont
))) do
2764 Color
:= _RGB(255, 0, 0);
2765 X
:= gScreenWidth
div 2 - GetWidth() div 2;
2768 g_GUI_AddWindow(Menu
);
2770 Menu
:= CreateYNMenu('ExitMenu', _lc
[I_MENU_EXIT_PROMT
], Round(gScreenWidth
*0.6),
2771 gMenuSmallFont
, @ProcExitMenuKeyDown
);
2772 g_GUI_AddWindow(Menu
);
2774 Menu
:= TGUIWindow
.Create('GameSingleMenu');
2775 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
2777 Name
:= 'mmGameSingleMenu';
2778 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
2779 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
2780 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
2781 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
2782 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
2783 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
2785 Menu
.DefControl
:= 'mmGameSingleMenu';
2786 Menu
.MainWindow
:= True;
2787 Menu
.OnClose
:= ProcGMClose
;
2788 Menu
.OnShow
:= ProcGMShow
;
2789 g_GUI_AddWindow(Menu
);
2791 Menu
:= CreateYNMenu('EndGameMenu', _lc
[I_MENU_END_GAME_PROMT
], Round(gScreenWidth
*0.6),
2792 gMenuSmallFont
, @ProcEndMenuKeyDown
);
2793 g_GUI_AddWindow(Menu
);
2795 Menu
:= CreateYNMenu('RestartGameMenu', _lc
[I_MENU_RESTART_GAME_PROMT
], Round(gScreenWidth
*0.6),
2796 gMenuSmallFont
, @ProcRestartMenuKeyDown
);
2797 g_GUI_AddWindow(Menu
);
2799 Menu
:= TGUIWindow
.Create('GameCustomMenu');
2800 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
2802 Name
:= 'mmGameCustomMenu';
2803 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
2804 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
2805 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
2806 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
2807 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
2808 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
2809 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
2811 Menu
.DefControl
:= 'mmGameCustomMenu';
2812 Menu
.MainWindow
:= True;
2813 Menu
.OnClose
:= ProcGMClose
;
2814 Menu
.OnShow
:= ProcGMShow
;
2815 g_GUI_AddWindow(Menu
);
2817 Menu
:= TGUIWindow
.Create('GameServerMenu');
2818 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
2820 Name
:= 'mmGameServerMenu';
2821 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
2822 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
2823 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
2824 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
2825 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
2827 Menu
.DefControl
:= 'mmGameServerMenu';
2828 Menu
.MainWindow
:= True;
2829 Menu
.OnClose
:= ProcGMClose
;
2830 Menu
.OnShow
:= ProcGMShow
;
2831 g_GUI_AddWindow(Menu
);
2833 Menu
:= TGUIWindow
.Create('GameClientMenu');
2834 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
2836 Name
:= 'mmGameClientMenu';
2837 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
2838 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
2839 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
2841 Menu
.DefControl
:= 'mmGameClientMenu';
2842 Menu
.MainWindow
:= True;
2843 Menu
.OnClose
:= ProcGMClose
;
2844 Menu
.OnShow
:= ProcGMShow
;
2845 g_GUI_AddWindow(Menu
);
2847 Menu
:= TGUIWindow
.Create('ClientPasswordMenu');
2848 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuSmallFont
, gMenuSmallFont
, _lc
[I_MENU_ENTERPASSWORD
]))) do
2850 Name
:= 'mClientPasswordMenu';
2851 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
2859 AddButton(@ProcEnterPassword
, _lc
[I_MENU_START_GAME
]);
2862 Menu
.DefControl
:= 'mClientPasswordMenu';
2863 g_GUI_AddWindow(Menu
);
2865 Menu
:= TGUIWindow
.Create('GameSetGameMenu');
2866 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SET_GAME
]))) do
2868 Name
:= 'mGameSetGameMenu';
2869 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
2871 Name
:= 'swTeamDamage';
2872 AddItem(_lc
[I_MENU_YES
]);
2873 AddItem(_lc
[I_MENU_NO
]);
2876 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
2878 Name
:= 'edTimeLimit';
2883 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
2885 Name
:= 'edGoalLimit';
2890 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
2892 Name
:= 'edMaxLives';
2897 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
2900 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
2901 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
2902 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
2908 Menu
.DefControl
:= 'mGameSetGameMenu';
2909 Menu
.OnClose
:= ProcApplyGameSet
;
2910 g_GUI_AddWindow(Menu
);
2912 Menu
:= TGUIWindow
.Create('TeamMenu');
2913 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_CHANGE_PLAYERS
]))) do
2915 Name
:= 'mmTeamMenu';
2916 AddButton(@ProcJoinRed
, _lc
[I_MENU_JOIN_RED
], '').Name
:= 'tmJoinRed';
2917 AddButton(@ProcJoinBlue
, _lc
[I_MENU_JOIN_BLUE
], '').Name
:= 'tmJoinBlue';
2918 AddButton(@ProcJoinGame
, _lc
[I_MENU_JOIN_GAME
], '').Name
:= 'tmJoinGame';
2919 AddButton(@ProcSwitchP2
, _lc
[I_MENU_ADD_PLAYER_2
], '').Name
:= 'tmPlayer2';
2920 AddButton(@ProcSpectate
, _lc
[I_MENU_SPECTATE
], '').Name
:= 'tmSpectate';
2922 Menu
.DefControl
:= 'mmTeamMenu';
2923 Menu
.OnShow
:= ProcChangePlayers
;
2924 g_GUI_AddWindow(Menu
);
2927 procedure g_Menu_Show_SaveMenu();
2929 if g_Game_IsTestMap
then
2931 if gGameSettings
.GameType
= GT_SINGLE
then
2932 g_GUI_ShowWindow('GameSingleMenu')
2935 if g_Game_IsClient
then
2938 if g_Game_IsNet
then
2941 g_GUI_ShowWindow('GameCustomMenu');
2943 g_GUI_ShowWindow('SaveMenu');
2944 g_Sound_PlayEx('MENU_OPEN');
2947 procedure g_Menu_Show_LoadMenu();
2949 if gGameSettings
.GameType
= GT_SINGLE
then
2950 g_GUI_ShowWindow('GameSingleMenu')
2953 if g_Game_IsClient
then
2956 if g_Game_IsNet
then
2959 g_GUI_ShowWindow('GameCustomMenu');
2961 g_GUI_ShowWindow('LoadMenu');
2962 g_Sound_PlayEx('MENU_OPEN');
2965 procedure g_Menu_Show_GameSetGame();
2967 if gGameSettings
.GameType
= GT_SINGLE
then
2968 g_GUI_ShowWindow('GameSingleMenu')
2971 if g_Game_IsClient
then
2974 if g_Game_IsNet
then
2975 g_GUI_ShowWindow('GameServerMenu')
2977 g_GUI_ShowWindow('GameCustomMenu');
2980 g_GUI_ShowWindow('GameSetGameMenu');
2981 g_Sound_PlayEx('MENU_OPEN');
2984 procedure g_Menu_Show_OptionsVideo();
2986 if gGameSettings
.GameType
= GT_SINGLE
then
2987 g_GUI_ShowWindow('GameSingleMenu')
2990 if g_Game_IsClient
then
2991 g_GUI_ShowWindow('GameClientMenu')
2993 if g_Game_IsNet
then
2994 g_GUI_ShowWindow('GameServerMenu')
2996 g_GUI_ShowWindow('GameCustomMenu');
2999 g_GUI_ShowWindow('OptionsMenu');
3000 g_GUI_ShowWindow('OptionsVideoMenu');
3001 g_Sound_PlayEx('MENU_OPEN');
3004 procedure g_Menu_Show_OptionsSound();
3006 if gGameSettings
.GameType
= GT_SINGLE
then
3007 g_GUI_ShowWindow('GameSingleMenu')
3010 if g_Game_IsClient
then
3011 g_GUI_ShowWindow('GameClientMenu')
3013 if g_Game_IsNet
then
3014 g_GUI_ShowWindow('GameServerMenu')
3016 g_GUI_ShowWindow('GameCustomMenu');
3019 g_GUI_ShowWindow('OptionsMenu');
3020 g_GUI_ShowWindow('OptionsSoundMenu');
3021 g_Sound_PlayEx('MENU_OPEN');
3024 procedure g_Menu_Show_EndGameMenu();
3026 g_GUI_ShowWindow('EndGameMenu');
3027 g_Sound_PlayEx('MENU_OPEN');
3030 procedure g_Menu_Show_QuitGameMenu();
3032 g_GUI_ShowWindow('ExitMenu');
3033 g_Sound_PlayEx('MENU_OPEN');
3036 procedure g_Menu_Init();
3043 procedure g_Menu_Free();
3047 e_WriteLog('Releasing menu data...', MSG_NOTIFY
);
3052 procedure g_Menu_Reset();
3056 g_GUI_SaveMenuPos();
3057 ex
:= g_GUI_Destroy();
3061 e_WriteLog('Recreating menu...', MSG_NOTIFY
);
3066 g_Game_SetDebugMode();
3068 g_GUI_LoadMenuPos();