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;
52 glLegacyNPOT
:= not (TGUISwitch(menu
.GetControl('swLegacyNPOT')).ItemIndex
= 0);
54 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
56 g_Sound_SetupAllVolumes(
57 Min(TGUIScroll(menu
.GetControl('scSoundLevel')).Value
*16, 255),
58 Min(TGUIScroll(menu
.GetControl('scMusicLevel')).Value
*16, 255)
61 gMaxSimSounds
:= Max(Min(TGUIScroll(menu
.GetControl('scMaxSimSounds')).Value
*4+2, 66), 2);
62 gMuteWhenInactive
:= TGUISwitch(menu
.GetControl('swInactiveSounds')).ItemIndex
= 1;
63 gAnnouncer
:= TGUISwitch(menu
.GetControl('swAnnouncer')).ItemIndex
;
64 gSoundEffectsDF
:= TGUISwitch(menu
.GetControl('swSoundEffects')).ItemIndex
= 1;
66 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
68 g_GFX_SetMax(TGUIScroll(menu
.GetControl('scParticlesCount')).Value
*1000);
69 g_Shells_SetMax(TGUIScroll(menu
.GetControl('scShellsMax')).Value
*30);
70 g_Gibs_SetMax(TGUIScroll(menu
.GetControl('scGibsMax')).Value
*25);
71 g_Corpses_SetMax(TGUIScroll(menu
.GetControl('scCorpsesMax')).Value
*5);
73 case TGUISwitch(menu
.GetControl('swGibsCount')).ItemIndex
of
78 else gGibsCount
:= 48;
81 gBloodCount
:= TGUISwitch(menu
.GetControl('swBloodCount')).ItemIndex
;
82 gFlash
:= TGUISwitch(menu
.GetControl('swScreenFlash')).ItemIndex
;
83 gAdvBlood
:= TGUISwitch(menu
.GetControl('swBloodType')).ItemIndex
= 1;
84 gAdvCorpses
:= TGUISwitch(menu
.GetControl('swCorpseType')).ItemIndex
= 1;
85 gAdvGibs
:= TGUISwitch(menu
.GetControl('swGibsType')).ItemIndex
= 1;
86 gDrawBackGround
:= TGUISwitch(menu
.GetControl('swBackGround')).ItemIndex
= 0;
87 gShowMessages
:= TGUISwitch(menu
.GetControl('swMessages')).ItemIndex
= 0;
88 gRevertPlayers
:= TGUISwitch(menu
.GetControl('swRevertPlayers')).ItemIndex
= 0;
89 gChatBubble
:= TGUISwitch(menu
.GetControl('swChatBubble')).ItemIndex
;
91 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
93 with menu
, gGameControls
.GameControls
do
95 TakeScreenshot
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_SCREENSHOT
])).Key
;
96 Stat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_STAT
])).Key
;
97 Chat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_CHAT
])).Key
;
98 TeamChat
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_TEAMCHAT
])).Key
;
101 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1Menu').GetControl('mOptionsControlsP1Menu'));
103 with menu
, gGameControls
.P1Control
do
105 KeyRight
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key
;
106 KeyLeft
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key
;
107 KeyUp
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key
;
108 KeyDown
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key
;
109 KeyFire
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key
;
110 KeyJump
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key
;
111 KeyNextWeapon
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key
;
112 KeyPrevWeapon
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key
;
113 KeyOpen
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key
;
116 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2Menu').GetControl('mOptionsControlsP2Menu'));
118 with menu
, gGameControls
.P2Control
do
120 KeyRight
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key
;
121 KeyLeft
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key
;
122 KeyUp
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key
;
123 KeyDown
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key
;
124 KeyFire
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key
;
125 KeyJump
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key
;
126 KeyNextWeapon
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key
;
127 KeyPrevWeapon
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key
;
128 KeyOpen
:= TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key
;
131 if e_JoysticksAvailable
> 0 then
133 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsJoystickMenu').GetControl('mOptionsControlsJoystickMenu'));
136 for i
:= 0 to e_JoysticksAvailable
-1 do
137 e_JoystickDeadzones
[i
] := TGUIScroll(menu
.GetControl('scDeadzone' + IntToStr(i
))).Value
*(32767 div 20);
141 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
143 gPlayer1Settings
.Name
:= b_Text_Unformat(TGUIEdit(menu
.GetControl('edP1Name')).Text);
144 gPlayer1Settings
.Team
:= IfThen(TGUISwitch(menu
.GetControl('swP1Team')).ItemIndex
= 0,
145 TEAM_RED
, TEAM_BLUE
);
147 with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mvP1Model')) do
149 gPlayer1Settings
.Model
:= Model
.Name
;
150 gPlayer1Settings
.Color
:= Model
.Color
;
153 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
155 gPlayer2Settings
.Name
:= b_Text_Unformat(TGUIEdit(menu
.GetControl('edP2Name')).Text);
156 gPlayer2Settings
.Team
:= IfThen(TGUISwitch(menu
.GetControl('swP2Team')).ItemIndex
= 0,
157 TEAM_RED
, TEAM_BLUE
);
158 with TGUIModelView(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mvP2Model')) do
160 gPlayer2Settings
.Model
:= Model
.Name
;
161 gPlayer2Settings
.Color
:= Model
.Color
;
164 if gPlayer1Settings
.Name
= '' then gPlayer1Settings
.Name
:= 'Player1';
165 if gPlayer2Settings
.Name
= '' then gPlayer2Settings
.Name
:= 'Player2';
167 if g_Game_IsServer
then
169 if gPlayer1
<> nil then
171 gPlayer1
.SetModel(gPlayer1Settings
.Model
);
172 gPlayer1
.Name
:= gPlayer1Settings
.Name
;
173 if not (gGameSettings
.GameMode
in [GM_TDM
, GM_CTF
]) then
174 gPlayer1
.SetColor(gPlayer1Settings
.Color
)
176 if gPlayer1
.Team
<> gPlayer1Settings
.Team
then
179 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
182 if gPlayer2
<> nil then
184 gPlayer2
.SetModel(gPlayer2Settings
.Model
);
185 gPlayer2
.Name
:= gPlayer2Settings
.Name
;
186 if (gGameSettings
.GameMode
<> GM_TDM
) and (gGameSettings
.GameMode
<> GM_CTF
) then
187 gPlayer2
.SetColor(gPlayer2Settings
.Color
)
189 if gPlayer2
.Team
<> gPlayer2Settings
.Team
then
194 if g_Game_IsClient
then MC_SEND_PlayerSettings
;
196 g_Options_Write(GameDir
+'/'+CONFIG_FILENAME
);
199 procedure ReadOptions();
204 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
206 with TGUISwitch(menu
.GetControl('swBPP')) do
212 with TGUISwitch(menu
.GetControl('swTextureFilter')) do
213 if gTextureFilter
then ItemIndex
:= 0 else ItemIndex
:= 1;
215 with TGUISwitch(menu
.GetControl('swVSync')) do
216 if gVSync
then ItemIndex
:= 0 else ItemIndex
:= 1;
218 with TGUISwitch(menu
.GetControl('swLegacyNPOT')) do
219 if not glLegacyNPOT
then ItemIndex
:= 0 else ItemIndex
:= 1;
221 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
223 TGUIScroll(menu
.GetControl('scSoundLevel')).Value
:= Round(gSoundLevel
/16);
224 TGUIScroll(menu
.GetControl('scMusicLevel')).Value
:= Round(gMusicLevel
/16);
225 TGUIScroll(menu
.GetControl('scMaxSimSounds')).Value
:= Round((gMaxSimSounds
-2)/4);
227 with TGUISwitch(menu
.GetControl('swInactiveSounds')) do
228 if gMuteWhenInactive
then
233 TGUISwitch(menu
.GetControl('swAnnouncer')).ItemIndex
:= gAnnouncer
;
235 with TGUISwitch(menu
.GetControl('swSoundEffects')) do
236 if gSoundEffectsDF
then
241 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP1Menu').GetControl('mOptionsControlsP1Menu'));
243 with menu
, gGameControls
.P1Control
do
245 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key
:= KeyRight
;
246 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key
:= KeyLeft
;
247 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key
:= KeyUp
;
248 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key
:= KeyDown
;
249 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key
:= KeyFire
;
250 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key
:= KeyJump
;
251 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key
:= KeyNextWeapon
;
252 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key
:= KeyPrevWeapon
;
253 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key
:= KeyOpen
;
256 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsP2Menu').GetControl('mOptionsControlsP2Menu'));
258 with menu
, gGameControls
.P2Control
do
260 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_RIGHT
])).Key
:= KeyRight
;
261 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_LEFT
])).Key
:= KeyLeft
;
262 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_UP
])).Key
:= KeyUp
;
263 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_DOWN
])).Key
:= KeyDown
;
264 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_FIRE
])).Key
:= KeyFire
;
265 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_JUMP
])).Key
:= KeyJump
;
266 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_NEXT_WEAPON
])).Key
:= KeyNextWeapon
;
267 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_PREV_WEAPON
])).Key
:= KeyPrevWeapon
;
268 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_USE
])).Key
:= KeyOpen
;
271 if e_JoysticksAvailable
> 0 then
273 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsJoystickMenu').GetControl('mOptionsControlsJoystickMenu'));
276 for i
:= 0 to e_JoysticksAvailable
-1 do
277 TGUIScroll(menu
.GetControl('scDeadzone' + IntToStr(i
))).Value
:= e_JoystickDeadzones
[i
] div (32767 div 20);
281 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
282 with menu
, gGameControls
.GameControls
do
284 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_SCREENSHOT
])).Key
:= TakeScreenshot
;
285 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_STAT
])).Key
:= Stat
;
286 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_CHAT
])).Key
:= Chat
;
287 TGUIKeyRead(GetControl(_lc
[I_MENU_CONTROL_TEAMCHAT
])).Key
:= TeamChat
;
290 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
292 TGUIScroll(menu
.GetControl('scParticlesCount')).Value
:= g_GFX_GetMax() div 1000;
293 TGUIScroll(menu
.GetControl('scShellsMax')).Value
:= g_Shells_GetMax() div 30;
294 TGUIScroll(menu
.GetControl('scGibsMax')).Value
:= g_Gibs_GetMax() div 25;
295 TGUIScroll(menu
.GetControl('scCorpsesMax')).Value
:= g_Corpses_GetMax() div 5;
296 TGUISwitch(menu
.GetControl('swBloodCount')).ItemIndex
:= gBloodCount
;
298 with TGUISwitch(menu
.GetControl('swScreenFlash')) do
301 with TGUISwitch(menu
.GetControl('swBloodType')) do
302 if gAdvBlood
then ItemIndex
:= 1 else ItemIndex
:= 0;
304 with TGUISwitch(menu
.GetControl('swCorpseType')) do
305 if gAdvCorpses
then ItemIndex
:= 1 else ItemIndex
:= 0;
307 with TGUISwitch(menu
.GetControl('swGibsType')) do
308 if gAdvGibs
then ItemIndex
:= 1 else ItemIndex
:= 0;
310 with TGUISwitch(menu
.GetControl('swGibsCount')) do
319 with TGUISwitch(menu
.GetControl('swBackGround')) do
320 if gDrawBackGround
then ItemIndex
:= 0 else ItemIndex
:= 1;
322 with TGUISwitch(menu
.GetControl('swMessages')) do
323 if gShowMessages
then ItemIndex
:= 0 else ItemIndex
:= 1;
325 with TGUISwitch(menu
.GetControl('swRevertPlayers')) do
326 if gRevertPlayers
then ItemIndex
:= 0 else ItemIndex
:= 1;
328 with TGUISwitch(menu
.GetControl('swChatBubble')) do
329 ItemIndex
:= gChatBubble
;
331 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
333 TGUIListBox(menu
.GetControl('lsP1Model')).SelectItem(gPlayer1Settings
.Model
);
334 TGUIEdit(menu
.GetControl('edP1Name')).Text := gPlayer1Settings
.Name
;
336 TGUISwitch(menu
.GetControl('swP1Team')).ItemIndex
:=
337 IfThen(gPlayer1Settings
.Team
= TEAM_BLUE
, 1, 0);
339 TGUIScroll(menu
.GetControl('scP1Red')).Value
:= Round(gPlayer1Settings
.Color
.R
/16);
340 TGUIScroll(menu
.GetControl('scP1Green')).Value
:= Round(gPlayer1Settings
.Color
.G
/16);
341 TGUIScroll(menu
.GetControl('scP1Blue')).Value
:= Round(gPlayer1Settings
.Color
.B
/16);
343 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2Menu').GetControl('mOptionsPlayersP2Menu'));
345 TGUIListBox(menu
.GetControl('lsP2Model')).SelectItem(gPlayer2Settings
.Model
);
346 TGUIEdit(menu
.GetControl('edP2Name')).Text := gPlayer2Settings
.Name
;
348 TGUISwitch(menu
.GetControl('swP2Team')).ItemIndex
:=
349 IfThen(gPlayer2Settings
.Team
= TEAM_BLUE
, 1, 0);
351 TGUIScroll(menu
.GetControl('scP2Red')).Value
:= Round(gPlayer2Settings
.Color
.R
/16);
352 TGUIScroll(menu
.GetControl('scP2Green')).Value
:= Round(gPlayer2Settings
.Color
.G
/16);
353 TGUIScroll(menu
.GetControl('scP2Blue')).Value
:= Round(gPlayer2Settings
.Color
.B
/16);
355 ProcSelectModel(nil);
358 procedure ProcSwitchMonstersCustom(Sender
: TGUIControl
);
360 with TGUIMenu(g_ActiveWindow
.GetControl('mCustomGameMenu')) do
361 if TGUISwitch(GetControl('swGameMode')).GetText
= _lc
[I_MENU_GAME_TYPE_COOP
] then
362 TGUISwitch(GetControl('swMonsters')).ItemIndex
:= 0
364 TGUISwitch(GetControl('swMonsters')).ItemIndex
:= 1;
367 procedure ProcSwitchMonstersNet(Sender
: TGUIControl
);
369 with TGUIMenu(g_ActiveWindow
.GetControl('mNetServerMenu')) do
370 if TGUISwitch(GetControl('swGameMode')).GetText
= _lc
[I_MENU_GAME_TYPE_COOP
] then
371 TGUISwitch(GetControl('swMonsters')).ItemIndex
:= 0
373 TGUISwitch(GetControl('swMonsters')).ItemIndex
:= 1;
376 procedure ProcStartCustomGame();
382 with TGUIMenu(g_ActiveWindow
.GetControl('mCustomGameMenu')) do
384 Map
:= TGUILabel(GetControl('lbMap')).Text;
387 if Pos(':\', Map
) = 0 then
390 GameMode
:= TGUISwitch(GetControl('swGameMode')).ItemIndex
+1;
391 gcGameMode
:= TGUISwitch(GetControl('swGameMode')).GetText
;
392 gcTimeLimit
:= StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
393 gcGoalLimit
:= StrToIntDef(TGUIEdit(GetControl('edGoalLimit')).Text, 0);
394 gcMaxLives
:= StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
396 gcTeamDamage
:= TGUISwitch(GetControl('swTeamDamage')).ItemIndex
= 0;
397 gcAllowExit
:= TGUISwitch(GetControl('swEnableExits')).ItemIndex
= 0;
398 gcWeaponStay
:= TGUISwitch(GetControl('swWeaponStay')).ItemIndex
= 0;
399 gcMonsters
:= TGUISwitch(GetControl('swMonsters')).ItemIndex
= 0;
402 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
404 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
406 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
408 Options
:= Options
or GAME_OPTION_MONSTERS
;
409 gcPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
;
411 case TGUISwitch(GetControl('swBotsVS')).ItemIndex
of
413 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
414 gcBotsVS
:= 'Monsters';
417 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
418 gcBotsVS
:= 'Everybody';
421 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
422 gcBotsVS
:= 'Players';
429 g_Options_Write_Gameplay_Custom(GameDir
+'/'+CONFIG_FILENAME
);
431 g_Game_StartCustom(Map
, GameMode
, gcTimeLimit
, gcGoalLimit
,
432 gcMaxLives
, Options
, gcPlayers
);
436 procedure ProcStartNetGame();
442 with TGUIMenu(g_ActiveWindow
.GetControl('mNetServerMenu')) do
444 Map
:= TGUILabel(GetControl('lbMap')).Text;
447 if Pos(':\', Map
) = 0 then
450 GameMode
:= TGUISwitch(GetControl('swGameMode')).ItemIndex
+1;
451 gnGameMode
:= TGUISwitch(GetControl('swGameMode')).GetText
;
452 gnTimeLimit
:= StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
453 gnGoalLimit
:= StrToIntDef(TGUIEdit(GetControl('edGoalLimit')).Text, 0);
454 gnMaxLives
:= StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
455 NetPort
:= StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
457 gnTeamDamage
:= TGUISwitch(GetControl('swTeamDamage')).ItemIndex
= 0;
458 gnAllowExit
:= TGUISwitch(GetControl('swEnableExits')).ItemIndex
= 0;
459 gnWeaponStay
:= TGUISwitch(GetControl('swWeaponStay')).ItemIndex
= 0;
460 gnMonsters
:= TGUISwitch(GetControl('swMonsters')).ItemIndex
= 0;
463 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
465 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
467 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
469 Options
:= Options
or GAME_OPTION_MONSTERS
;
470 gnPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
;
472 case TGUISwitch(GetControl('swBotsVS')).ItemIndex
of
474 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
475 gnBotsVS
:= 'Monsters';
478 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
479 gnBotsVS
:= 'Everybody';
482 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
483 gnBotsVS
:= 'Players';
488 NetServerName
:= TGUIEdit(GetControl('edSrvName')).Text;
489 NetMaxClients
:= Max(1, StrToIntDef(TGUIEdit(GetControl('edMaxPlayers')).Text, 1));
490 NetMaxClients
:= Min(NET_MAXCLIENTS
, NetMaxClients
);
491 NetPassword
:= TGUIEdit(GetControl('edSrvPassword')).Text;
492 NetUseMaster
:= TGUISwitch(GetControl('swUseMaster')).ItemIndex
= 0;
495 g_Options_Write_Net_Server(GameDir
+'/'+CONFIG_FILENAME
);
496 g_Options_Write_Gameplay_Net(GameDir
+'/'+CONFIG_FILENAME
);
498 g_Game_StartServer(Map
, GameMode
, gnTimeLimit
, gnGoalLimit
, gnMaxLives
,
499 Options
, gnPlayers
, 0, NetPort
);
502 procedure ProcConnectNetGame();
506 with TGUIMenu(g_ActiveWindow
.GetControl('mNetClientMenu')) do
508 NetClientIP
:= TGUIEdit(GetControl('edIP')).Text;
509 NetClientPort
:= StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
510 PW
:= TGUIEdit(GetControl('edPW')).Text;
513 g_Options_Write_Net_Client(GameDir
+'/'+CONFIG_FILENAME
);
514 g_Game_StartClient(NetClientIP
, NetClientPort
, PW
);
517 procedure ProcEnterPassword();
521 with TGUIMenu(g_ActiveWindow
.GetControl('mClientPasswordMenu')) do
523 NetClientIP
:= PromptIP
;
524 NetClientPort
:= PromptPort
;
525 PW
:= TGUIEdit(GetControl('edPW')).Text;
528 g_Options_Write_Net_Client(GameDir
+'/'+CONFIG_FILENAME
);
529 g_Game_StartClient(NetClientIP
, NetClientPort
, PW
);
532 procedure ProcServerlist();
534 if not NetInitDone
then
536 if (not g_Net_Init()) then
538 g_Console_Add('NET: ERROR: Failed to init ENet!');
545 g_Net_Slist_Set(NetSlistIP
, NetSlistPort
);
547 gState
:= STATE_SLIST
;
548 g_ActiveWindow
:= nil;
550 slWaitStr
:= _lc
[I_NET_SLIST_WAIT
];
555 slReturnPressed
:= True;
556 if g_Net_Slist_Fetch(slCurrent
) then
558 if slCurrent
= nil then
559 slWaitStr
:= _lc
[I_NET_SLIST_NOSERVERS
];
562 slWaitStr
:= _lc
[I_NET_SLIST_ERROR
];
565 procedure ProcStartCampaign();
571 with TGUIMenu(g_ActiveWindow
.GetControl('mCampaignMenu')) do
573 WAD
:= ExtractRelativePath(MapsDir
, TGUIFileListBox(GetControl('lsWAD')).SelectedItem());
574 TwoPlayers
:= TGUISwitch(GetControl('swPlayers')).ItemIndex
= 1;
581 g_Game_StartSingle(WAD
+ ':\MAP01', TwoPlayers
, n
);
584 procedure ProcSelectMap(Sender
: TGUIControl
);
588 wad
, map
, res
: String;
590 win
:= g_GUI_GetWindow('SelectMapMenu');
591 with TGUIMenu(win
.GetControl('mSelectMapMenu')) do
593 wad
:= TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem();
594 map
:= TGUIListBox(GetControl('lsMapRes')).SelectedItem();
596 if (wad
= '') or (map
= '') then
597 begin // Ýòî íå êàðòà
598 TGUILabel(GetControl('lbMapName')).Text := '';
599 TGUILabel(GetControl('lbMapAuthor')).Text := '';
600 TGUILabel(GetControl('lbMapSize')).Text := '';
601 TGUIMemo(GetControl('meMapDescription')).SetText('');
602 TGUIMapPreview(win
.GetControl('mpMapPreview')).ClearMap();
603 TGUILabel(win
.GetControl('lbMapScale')).Text := '';
609 a
:= g_Map_GetMapInfo(res
);
611 TGUILabel(GetControl('lbMapName')).Text := a
.Name
;
612 TGUILabel(GetControl('lbMapAuthor')).Text := a
.Author
;
613 TGUILabel(GetControl('lbMapSize')).Text := Format('%dx%d', [a
.Width
, a
.Height
]);
614 TGUIMemo(GetControl('meMapDescription')).SetText(a
.Description
);
615 TGUIMapPreview(win
.GetControl('mpMapPreview')).SetMap(res
);
616 TGUILabel(win
.GetControl('lbMapScale')).Text :=
617 TGUIMapPreview(win
.GetControl('mpMapPreview')).GetScaleStr
;
622 procedure ProcSelectWAD(Sender
: TGUIControl
);
627 with TGUIMenu(g_GUI_GetWindow('SelectMapMenu').GetControl('mSelectMapMenu')) do
629 wad
:= TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem();
631 with TGUIListBox(GetControl('lsMapRes')) do
637 list
:= g_Map_GetMapsList(wad
);
651 procedure ProcSelectCampaignWAD(Sender
: TGUIControl
);
657 win
:= g_GUI_GetWindow('CampaignMenu');
658 with TGUIMenu(win
.GetControl('mCampaignMenu')) do
660 wad
:= TGUIFileListBox(GetControl('lsWAD')).SelectedItem();
664 TGUILabel(GetControl('lbWADName')).Text := '';
665 TGUILabel(GetControl('lbWADAuthor')).Text := '';
666 TGUIMemo(GetControl('meWADDescription')).SetText('');
669 a
:= g_Game_GetMegaWADInfo(wad
);
671 TGUILabel(GetControl('lbWADName')).Text := a
.Name
;
672 TGUILabel(GetControl('lbWADAuthor')).Text := a
.Author
;
673 TGUIMemo(GetControl('meWADDescription')).SetText(a
.Description
);
675 TGUIImage(win
.GetControl('mpWADImage')).ClearImage();
679 g_ProcessResourceStr(a
.pic
, @fn
, nil, nil);
681 TGUIImage(win
.GetControl('mpWADImage')).SetImage(wad
+a
.pic
)
683 TGUIImage(win
.GetControl('mpWADImage')).SetImage(a
.pic
);
688 procedure ProcChangeColor(Sender
: TGUIControl
);
692 window
:= g_GUI_GetWindow('OptionsPlayersP1Menu');
693 with TGUIMenu(window
.GetControl('mOptionsPlayersP1Menu')) do
694 TGUIModelView(window
.GetControl('mvP1Model')).SetColor(
695 Min(TGUIScroll(GetControl('scP1Red')).Value
*16, 255),
696 Min(TGUIScroll(GetControl('scP1Green')).Value
*16, 255),
697 Min(TGUIScroll(GetControl('scP1Blue')).Value
*16, 255));
699 window
:= g_GUI_GetWindow('OptionsPlayersP2Menu');
700 with TGUIMenu(window
.GetControl('mOptionsPlayersP2Menu')) do
701 TGUIModelView(window
.GetControl('mvP2Model')).SetColor(
702 Min(TGUIScroll(GetControl('scP2Red')).Value
*16, 255),
703 Min(TGUIScroll(GetControl('scP2Green')).Value
*16, 255),
704 Min(TGUIScroll(GetControl('scP2Blue')).Value
*16, 255));
707 procedure ProcSelectModel(Sender
: TGUIControl
);
712 window
:= g_GUI_GetWindow('OptionsPlayersP1Menu');
713 a
:= TGUIListBox(TGUIMenu(window
.GetControl('mOptionsPlayersP1Menu')).GetControl('lsP1Model')).SelectedItem
;
714 if a
<> '' then TGUIModelView(window
.GetControl('mvP1Model')).SetModel(a
);
716 window
:= g_GUI_GetWindow('OptionsPlayersP2Menu');
717 a
:= TGUIListBox(TGUIMenu(window
.GetControl('mOptionsPlayersP2Menu')).GetControl('lsP2Model')).SelectedItem
;
718 if a
<> '' then TGUIModelView(window
.GetControl('mvP2Model')).SetModel(a
);
720 ProcChangeColor(nil);
723 procedure LoadStdFont(cfgres
, texture
: string; var FontID
: DWORD
);
735 wad
:= TWADEditor_1
.Create
;
736 if wad
.ReadFile(GameWAD
) then
737 wad
.GetResource('FONTS', cfgres
, cfgdata
, cfglen
);
742 g_Texture_CreateWADEx('FONT_STD', GameWAD
+':FONTS\'+texture
);
744 config
:= TConfig
.CreateMem(cfgdata
, cfglen
);
745 cwdt
:= Min(Max(config
.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
746 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
747 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
749 if g_Texture_Get('FONT_STD', ID
) then
750 e_TextureFontBuild(ID
, FontID
, cwdt
, chgt
, spc
);
755 if cfglen
<> 0 then FreeMem(cfgdata
);
758 procedure LoadFont(txtres
, fntres
: string; var FontID
: DWORD
);
764 cfgdata
, fntdata
: Pointer;
765 cfglen
, fntlen
: Integer;
773 wad
:= TWADEditor_1
.Create
;
774 if wad
.ReadFile(GameWAD
) then
776 wad
.GetResource('FONTS', txtres
, cfgdata
, cfglen
);
777 wad
.GetResource('FONTS', fntres
, fntdata
, fntlen
);
783 config
:= TConfig
.CreateMem(cfgdata
, cfglen
);
784 cwdt
:= Min(Max(config
.ReadInt('FontMap', 'CharWidth', 0), 0), 255);
785 chgt
:= Min(Max(config
.ReadInt('FontMap', 'CharHeight', 0), 0), 255);
787 spc
:= Min(Max(config
.ReadInt('FontMap', 'Kerning', 0), -128), 127);
788 FontID
:= e_CharFont_Create(spc
);
792 chrwidth
:= config
.ReadInt(IntToStr(a
), 'Width', 0);
793 if chrwidth
= 0 then Continue
;
795 if e_CreateTextureMemEx(fntdata
, CharID
, cwdt
*(a
mod 16), chgt
*(a
div 16),
797 e_CharFont_AddChar(FontID
, CharID
, Chr(a
), chrwidth
);
803 if cfglen
<> 0 then FreeMem(cfgdata
);
804 if fntlen
<> 0 then FreeMem(fntdata
);
807 procedure MenuLoadData();
809 e_WriteLog('Loading menu data...', MSG_NOTIFY
);
811 g_Texture_CreateWADEx('MAINMENU_MARKER1', GameWAD
+':TEXTURES\MARKER1');
812 g_Texture_CreateWADEx('MAINMENU_MARKER2', GameWAD
+':TEXTURES\MARKER2');
813 g_Texture_CreateWADEx('SCROLL_LEFT', GameWAD
+':TEXTURES\SLEFT');
814 g_Texture_CreateWADEx('SCROLL_RIGHT', GameWAD
+':TEXTURES\SRIGHT');
815 g_Texture_CreateWADEx('SCROLL_MIDDLE', GameWAD
+':TEXTURES\SMIDDLE');
816 g_Texture_CreateWADEx('SCROLL_MARKER', GameWAD
+':TEXTURES\SMARKER');
817 g_Texture_CreateWADEx('EDIT_LEFT', GameWAD
+':TEXTURES\ELEFT');
818 g_Texture_CreateWADEx('EDIT_RIGHT', GameWAD
+':TEXTURES\ERIGHT');
819 g_Texture_CreateWADEx('EDIT_MIDDLE', GameWAD
+':TEXTURES\EMIDDLE');
820 g_Texture_CreateWADEx('BOX1', GameWAD
+':TEXTURES\BOX1');
821 g_Texture_CreateWADEx('BOX2', GameWAD
+':TEXTURES\BOX2');
822 g_Texture_CreateWADEx('BOX3', GameWAD
+':TEXTURES\BOX3');
823 g_Texture_CreateWADEx('BOX4', GameWAD
+':TEXTURES\BOX4');
824 g_Texture_CreateWADEx('BOX5', GameWAD
+':TEXTURES\BOX5');
825 g_Texture_CreateWADEx('BOX6', GameWAD
+':TEXTURES\BOX6');
826 g_Texture_CreateWADEx('BOX7', GameWAD
+':TEXTURES\BOX7');
827 g_Texture_CreateWADEx('BOX8', GameWAD
+':TEXTURES\BOX8');
828 g_Texture_CreateWADEx('BOX9', GameWAD
+':TEXTURES\BOX9');
829 g_Texture_CreateWADEx('BSCROLL_UP_A', GameWAD
+':TEXTURES\SCROLLUPA');
830 g_Texture_CreateWADEx('BSCROLL_UP_U', GameWAD
+':TEXTURES\SCROLLUPU');
831 g_Texture_CreateWADEx('BSCROLL_DOWN_A', GameWAD
+':TEXTURES\SCROLLDOWNA');
832 g_Texture_CreateWADEx('BSCROLL_DOWN_U', GameWAD
+':TEXTURES\SCROLLDOWNU');
833 g_Texture_CreateWADEx('BSCROLL_MIDDLE', GameWAD
+':TEXTURES\SCROLLMIDDLE');
834 g_Texture_CreateWADEx('NOPIC', GameWAD
+':TEXTURES\NOPIC');
836 g_Sound_CreateWADEx('MENU_SELECT', GameWAD
+':SOUNDS\MENUSELECT');
837 g_Sound_CreateWADEx('MENU_OPEN', GameWAD
+':SOUNDS\MENUOPEN');
838 g_Sound_CreateWADEx('MENU_CLOSE', GameWAD
+':SOUNDS\MENUCLOSE');
839 g_Sound_CreateWADEx('MENU_CHANGE', GameWAD
+':SOUNDS\MENUCHANGE');
840 g_Sound_CreateWADEx('SCROLL_ADD', GameWAD
+':SOUNDS\SCROLLADD');
841 g_Sound_CreateWADEx('SCROLL_SUB', GameWAD
+':SOUNDS\SCROLLSUB');
842 g_Sound_CreateWADEx('SOUND_PLAYER_FALL', GameWAD
+':SOUNDS\FALL');
845 procedure MenuFreeData();
847 e_CharFont_Remove(gMenuFont
);
848 e_CharFont_Remove(gMenuSmallFont
);
850 g_Texture_Delete('MAINMENU_MARKER1');
851 g_Texture_Delete('MAINMENU_MARKER2');
852 g_Texture_Delete('SCROLL_LEFT');
853 g_Texture_Delete('SCROLL_RIGHT');
854 g_Texture_Delete('SCROLL_MIDDLE');
855 g_Texture_Delete('SCROLL_MARKER');
856 g_Texture_Delete('EDIT_LEFT');
857 g_Texture_Delete('EDIT_RIGHT');
858 g_Texture_Delete('EDIT_MIDDLE');
859 g_Texture_Delete('BOX1');
860 g_Texture_Delete('BOX2');
861 g_Texture_Delete('BOX3');
862 g_Texture_Delete('BOX4');
863 g_Texture_Delete('BOX5');
864 g_Texture_Delete('BOX6');
865 g_Texture_Delete('BOX7');
866 g_Texture_Delete('BOX8');
867 g_Texture_Delete('BOX9');
868 g_Texture_Delete('BSCROLL_UP_A');
869 g_Texture_Delete('BSCROLL_UP_U');
870 g_Texture_Delete('BSCROLL_DOWN_A');
871 g_Texture_Delete('BSCROLL_DOWN_U');
872 g_Texture_Delete('BSCROLL_MIDDLE');
873 g_Texture_Delete('NOPIC');
875 g_Sound_Delete('MENU_SELECT');
876 g_Sound_Delete('MENU_OPEN');
877 g_Sound_Delete('MENU_CLOSE');
878 g_Sound_Delete('MENU_CHANGE');
879 g_Sound_Delete('SCROLL_ADD');
880 g_Sound_Delete('SCROLL_SUB');
881 g_Sound_Delete('SOUND_PLAYER_FALL');
884 procedure ProcAuthorsMenu();
886 gMusic
.SetByName('MUSIC_INTERMUS');
890 procedure ProcExitMenuKeyDown(Key
: Byte);
898 g_Game_StopAllSounds(True);
900 0: s
:= 'SOUND_MONSTER_PAIN';
901 1: s
:= 'SOUND_MONSTER_DIE_3';
902 2: s
:= 'SOUND_MONSTER_SLOP';
903 3: s
:= 'SOUND_MONSTER_DEMON_DIE';
904 4: s
:= 'SOUND_MONSTER_IMP_DIE_2';
905 5: s
:= 'SOUND_MONSTER_MAN_DIE';
906 6: s
:= 'SOUND_MONSTER_BSP_DIE';
907 7: s
:= 'SOUND_MONSTER_VILE_DIE';
908 8: s
:= 'SOUND_MONSTER_SKEL_DIE';
909 9: s
:= 'SOUND_MONSTER_MANCUB_ALERT';
910 10: s
:= 'SOUND_MONSTER_PAIN_PAIN';
911 11: s
:= 'SOUND_MONSTER_BARON_DIE';
912 12: s
:= 'SOUND_MONSTER_CACO_DIE';
913 13: s
:= 'SOUND_MONSTER_CYBER_DIE';
914 14: s
:= 'SOUND_MONSTER_KNIGHT_ALERT';
915 15: s
:= 'SOUND_MONSTER_SPIDER_ALERT';
916 else s
:= 'SOUND_PLAYER_FALL';
919 snd
:= TPlayableSound
.Create();
920 res
:= snd
.SetByName(s
);
922 res
:= snd
.SetByName('SOUND_PLAYER_FALL');
927 while snd
.IsPlaying() do
938 procedure ProcLoadMenu();
943 TGUIEdit(TGUIMenu(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu')).GetControl('edSlot'+IntToStr(a
))).Text :=
947 procedure ProcSaveMenu();
952 TGUIEdit(TGUIMenu(g_GUI_GetWindow('SaveMenu').GetControl('mmSaveMenu')).GetControl('edSlot'+IntToStr(a
))).Text :=
956 procedure ProcSaveGame(Sender
: TGUIControl
);
960 if g_Game_IsNet
then Exit
;
961 if g_Game_IsTestMap
then Exit
;
962 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
963 g_Game_PauseAllSounds(True);
964 g_SaveGame(a
, TGUIEdit(Sender
).Text);
966 g_ActiveWindow
:= nil;
970 procedure ProcLoadGame(Sender
: TGUIControl
);
974 if g_Game_IsNet
then Exit
;
975 a
:= StrToInt(Copy(Sender
.Name
, Length(Sender
.Name
), 1));
976 if g_LoadGame(a
) then
977 g_Game_PauseAllSounds(False)
978 else // Íå çàãðóçèëîñü - âîçâðàò â ìåíþ
979 g_GUI_GetWindow('LoadMenu').SetActive(g_GUI_GetWindow('LoadMenu').GetControl('mmLoadMenu'));
982 procedure ProcSingle1Player();
984 g_Game_StartSingle('megawads/DOOM2D.WAD:\MAP01', False, 1);
987 procedure ProcSingle2Players();
989 g_Game_StartSingle('megawads/DOOM2D.WAD:\MAP01', True, 2);
992 procedure ProcSelectMapMenu();
995 wad_lb
: TGUIFileListBox
;
999 menu
:= TGUIMenu(g_GUI_GetWindow('SelectMapMenu').GetControl('mSelectMapMenu'));
1000 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsMapWAD'));
1001 map_lb
:= TGUIListBox(menu
.GetControl('lsMapRes'));
1003 if wad_lb
.SelectedItem() <> '' then
1004 map
:= map_lb
.SelectedItem()
1008 wad_lb
.UpdateFileList();
1011 if wad_lb
.SelectedItem() <> '' then
1014 map_lb
.SelectItem(map
);
1016 if map_lb
.SelectedItem() <> '' then
1020 g_GUI_ShowWindow('SelectMapMenu');
1023 procedure ProcSelectCampaignMenu();
1026 wad_lb
: TGUIFileListBox
;
1028 menu
:= TGUIMenu(g_GUI_GetWindow('CampaignMenu').GetControl('mCampaignMenu'));
1029 wad_lb
:= TGUIFileListBox(menu
.GetControl('lsWAD'));
1031 wad_lb
.UpdateFileList();
1033 if wad_lb
.SelectedItem() <> '' then
1034 ProcSelectCampaignWAD(nil);
1037 procedure ProcSetMap();
1039 wad
, map
, res
: String;
1041 with TGUIMenu(g_ActiveWindow
.GetControl('mSelectMapMenu')) do
1043 wad
:= ExtractRelativePath(MapsDir
, TGUIFileListBox(GetControl('lsMapWAD')).SelectedItem());
1044 map
:= TGUIListBox(GetControl('lsMapRes')).SelectedItem();
1047 if (wad
= '') or (map
= '') then
1050 res
:= wad
+':\'+map
;
1052 TGUILabel(TGUIMenu(g_GUI_GetWindow('CustomGameMenu').GetControl('mCustomGameMenu')).GetControl('lbMap')).Text := res
;
1053 TGUILabel(TGUIMenu(g_GUI_GetWindow('NetServerMenu').GetControl('mNetServerMenu')).GetControl('lbMap')).Text := res
;
1056 procedure ProcChangeSoundSettings(Sender
: TGUIControl
);
1060 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
1062 g_Sound_SetupAllVolumes(
1063 Min(TGUIScroll(menu
.GetControl('scSoundLevel')).Value
*16, 255),
1064 Min(TGUIScroll(menu
.GetControl('scMusicLevel')).Value
*16, 255)
1068 procedure ProcOptionsPlayersMIMenu();
1073 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1075 a
:= TGUIListBox(TGUIMenu(g_ActiveWindow
.GetControl('mOptionsPlayers'+s
+'Menu')).GetControl('ls'+s
+'Model')).SelectedItem
;
1077 if a
= '' then Exit
;
1079 b
:= g_PlayerModel_GetInfo(a
);
1081 with TGUIMenu(g_GUI_GetWindow('OptionsPlayersMIMenu').GetControl('mOptionsPlayersMIMenu')) do
1083 TGUILabel(GetControl('lbName')).Text := b
.Name
;
1084 TGUILabel(GetControl('lbAuthor')).Text := b
.Author
;
1085 TGUIMemo(GetControl('meComment')).SetText(b
.Description
);
1087 if b
.HaveWeapon
then
1088 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_YES
]
1090 TGUILabel(GetControl('lbWeapon')).Text := _lc
[I_MENU_NO
];
1093 g_GUI_ShowWindow('OptionsPlayersMIMenu');
1096 procedure ProcOptionsPlayersAnim();
1100 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1105 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1108 Model
.GetCurrentAnimation
.Loop
:= True;
1109 Model
.GetCurrentAnimationMask
.Loop
:= True;
1113 procedure ProcOptionsPlayersWeap();
1117 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then
1122 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')) do
1126 procedure ProcOptionsPlayersRot();
1130 if g_ActiveWindow
.Name
= 'OptionsPlayersP1Menu' then s
:= 'P1' else s
:= 'P2';
1131 with TGUIModelView(g_ActiveWindow
.GetControl('mv'+s
+'Model')).Model
do
1132 if Direction
= D_LEFT
then Direction
:= D_RIGHT
else Direction
:= D_LEFT
;
1135 procedure ProcDefaultMenuKeyDown(Key
: Byte);
1137 if Key
= Ord('y') then
1139 g_Options_SetDefault();
1143 if Key
= Ord('n') then g_GUI_HideWindow
;
1146 procedure ProcSavedMenuKeyDown(Key
: Byte);
1148 if Key
= Ord('y') then
1153 if Key
= Ord('n') then g_GUI_HideWindow
;
1156 procedure ProcAuthorsClose();
1158 gMusic
.SetByName('MUSIC_MENU');
1160 gState
:= STATE_MENU
;
1163 procedure ProcGMClose();
1165 g_Game_InGameMenu(False);
1168 procedure ProcGMShow();
1173 if (gGameSettings
.GameType
= GT_SINGLE
) and
1174 ((gPlayer1
= nil) or (not gPlayer1
.Live
)) and
1175 ((gPlayer2
= nil) or (not gPlayer2
.Live
)) then
1176 Enabled
:= False; // Îäèí èç èãðîêîâ ïîãèá â ñèíãëå
1178 Enabled
:= False; // Çàïðåòèòü ñîõðàíåíèå â èíòåðìèññèè (íå ðåàëèçîâàíî)
1179 if g_Game_IsTestMap
then
1180 Enabled
:= False; // Åñëè èãðàåì íà òåñòîâîé èëè âðåìåííîé êàðòå
1181 TGUIMainMenu(g_ActiveWindow
.GetControl(
1182 g_ActiveWindow
.DefControl
)).EnableButton('save', Enabled
);
1185 procedure ProcChangePlayers();
1187 TeamGame
, Spectator
, AddTwo
: Boolean;
1188 P1Team
{, P2Team}: Byte;
1189 bP2
: TGUITextButton
;
1191 TeamGame
:= gGameSettings
.GameMode
in [GM_TDM
, GM_CTF
];
1192 Spectator
:= (gPlayer1
= nil) and (gPlayer2
= nil);
1193 AddTwo
:= gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
];
1194 P1Team
:= TEAM_NONE
;
1195 if gPlayer1
<> nil then P1Team
:= gPlayer1
.Team
;
1197 //P2Team := TEAM_NONE;
1198 //if gPlayer2 <> nil then P2Team := gPlayer2.Team;
1200 TGUIMainMenu(g_ActiveWindow
.GetControl(
1201 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinRed', TeamGame
and (P1Team
<> TEAM_RED
));
1202 TGUIMainMenu(g_ActiveWindow
.GetControl(
1203 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinBlue', TeamGame
and (P1Team
<> TEAM_BLUE
));
1204 TGUIMainMenu(g_ActiveWindow
.GetControl(
1205 g_ActiveWindow
.DefControl
)).EnableButton('tmJoinGame', Spectator
and not TeamGame
);
1207 bP2
:= TGUIMainMenu(g_ActiveWindow
.GetControl(
1208 g_ActiveWindow
.DefControl
)).GetButton('tmPlayer2');
1209 bP2
.Enabled
:= AddTwo
and not Spectator
;
1211 bP2
.Color
:= MAINMENU_ITEMS_COLOR
1213 bP2
.Color
:= MAINMENU_UNACTIVEITEMS_COLOR
;
1214 if gPlayer2
= nil then
1215 bP2
.Caption
:= _lc
[I_MENU_ADD_PLAYER_2
]
1217 bP2
.Caption
:= _lc
[I_MENU_REM_PLAYER_2
];
1219 TGUIMainMenu(g_ActiveWindow
.GetControl(
1220 g_ActiveWindow
.DefControl
)).EnableButton('tmSpectate', not Spectator
);
1223 procedure ProcJoinRed();
1225 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1227 if g_Game_IsServer
then
1229 if gPlayer1
= nil then
1230 g_Game_AddPlayer(TEAM_RED
)
1233 if gPlayer1
.Team
<> TEAM_RED
then
1235 gPlayer1
.SwitchTeam
;
1236 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1239 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1244 gPlayer1Settings
.Team
:= TEAM_RED
;
1245 MC_SEND_PlayerSettings
;
1246 if gPlayer1
= nil then
1247 g_Game_AddPlayer(TEAM_RED
);
1249 g_ActiveWindow
:= nil;
1250 g_Game_Pause(False);
1253 procedure ProcJoinBlue();
1255 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1257 if g_Game_IsServer
then
1259 if gPlayer1
= nil then
1260 g_Game_AddPlayer(TEAM_BLUE
)
1263 if gPlayer1
.Team
<> TEAM_BLUE
then
1265 gPlayer1
.SwitchTeam
;
1266 gPlayer1Settings
.Team
:= gPlayer1
.Team
;
1269 if g_Game_IsNet
then MH_SEND_PlayerSettings(gPlayer1
.UID
);
1274 gPlayer1Settings
.Team
:= TEAM_BLUE
;
1275 MC_SEND_PlayerSettings
;
1276 if gPlayer1
= nil then
1277 g_Game_AddPlayer(TEAM_BLUE
);
1279 g_ActiveWindow
:= nil;
1280 g_Game_Pause(False);
1283 procedure ProcJoinGame();
1285 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1287 if gPlayer1
= nil then
1289 g_ActiveWindow
:= nil;
1290 g_Game_Pause(False);
1293 procedure ProcSwitchP2();
1295 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
]) then
1297 if gPlayer1
= nil then
1299 if gPlayer2
= nil then
1302 g_Game_RemovePlayer();
1303 g_ActiveWindow
:= nil;
1304 g_Game_Pause(False);
1307 procedure ProcSpectate();
1309 if not (gGameSettings
.GameType
in [GT_CUSTOM
, GT_SERVER
, GT_CLIENT
]) then
1312 g_ActiveWindow
:= nil;
1313 g_Game_Pause(False);
1316 procedure ProcRestartMenuKeyDown(Key
: Byte);
1318 if Key
= Ord('y') then g_Game_Restart()
1319 else if Key
= Ord('n') then g_GUI_HideWindow
;
1322 procedure ProcEndMenuKeyDown(Key
: Byte);
1324 if Key
= Ord('y') then gExit
:= EXIT_SIMPLE
1325 else if Key
= Ord('n') then g_GUI_HideWindow
;
1328 procedure ProcSetRussianLanguage();
1330 if gLanguage
<> LANGUAGE_RUSSIAN
then
1332 gLanguage
:= LANGUAGE_RUSSIAN
;
1333 gLanguageChange
:= True;
1334 gAskLanguage
:= False;
1336 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1338 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1343 procedure ProcSetEnglishLanguage();
1345 if gLanguage
<> LANGUAGE_ENGLISH
then
1347 gLanguage
:= LANGUAGE_ENGLISH
;
1348 gLanguageChange
:= True;
1349 gAskLanguage
:= False;
1351 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1353 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1358 procedure ReadGameSettings();
1362 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1364 with gGameSettings
do
1366 with TGUISwitch(menu
.GetControl('swTeamDamage')) do
1367 if LongBool(Options
and GAME_OPTION_TEAMDAMAGE
) then
1372 TGUIEdit(menu
.GetControl('edTimeLimit')).Text := IntToStr(TimeLimit
);
1373 TGUIEdit(menu
.GetControl('edGoalLimit')).Text := IntToStr(GoalLimit
);
1374 TGUIEdit(menu
.GetControl('edMaxLives')).Text := IntToStr(MaxLives
);
1376 with TGUISwitch(menu
.GetControl('swBotsVS')) do
1377 if LongBool(Options
and GAME_OPTION_BOTVSPLAYER
) and
1378 LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1381 if LongBool(Options
and GAME_OPTION_BOTVSMONSTER
) then
1386 if GameType
in [GT_CUSTOM
, GT_SERVER
] then
1388 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1389 TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
:= True;
1390 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1391 TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
:= True;
1392 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_ITEMSTEXT_COLOR
;
1393 TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
:= True;
1394 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_ITEMSTEXT_COLOR
;
1395 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1399 TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
:= True;
1400 with TGUIEdit(menu
.GetControl('edTimeLimit')) do
1405 TGUILabel(menu
.GetControlsText('edTimeLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1406 with TGUIEdit(menu
.GetControl('edGoalLimit')) do
1411 TGUILabel(menu
.GetControlsText('edGoalLimit')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1412 with TGUIEdit(menu
.GetControl('edMaxLives')) do
1417 TGUILabel(menu
.GetControlsText('edMaxLives')).Color
:= MENU_UNACTIVEITEMS_COLOR
;
1418 TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
:= True;
1423 procedure ProcApplyGameSet();
1427 stat
: TPlayerStatArray
;
1429 menu
:= TGUIMenu(g_GUI_GetWindow('GameSetGameMenu').GetControl('mGameSetGameMenu'));
1431 if not g_Game_IsServer
then Exit
;
1433 with gGameSettings
do
1435 if TGUISwitch(menu
.GetControl('swTeamDamage')).Enabled
then
1437 if TGUISwitch(menu
.GetControl('swTeamDamage')).ItemIndex
= 0 then
1438 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
1440 Options
:= Options
and (not GAME_OPTION_TEAMDAMAGE
);
1443 if TGUIEdit(menu
.GetControl('edTimeLimit')).Enabled
then
1445 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edTimeLimit')).Text, TimeLimit
);
1451 b
:= (gTime
- gGameStartTime
) div 1000 + 10; // 10 ñåêóíä íà ñìåíó
1453 TimeLimit
:= Max(n
, b
);
1457 if TGUIEdit(menu
.GetControl('edGoalLimit')).Enabled
then
1459 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edGoalLimit')).Text, GoalLimit
);
1466 if GameMode
= GM_DM
then
1468 stat
:= g_Player_GetStats();
1470 for a
:= 0 to High(stat
) do
1471 if stat
[a
].Frags
> b
then
1475 b
:= Max(gTeamStat
[TEAM_RED
].Goals
, gTeamStat
[TEAM_BLUE
].Goals
);
1477 GoalLimit
:= Max(n
, b
);
1481 if TGUIEdit(menu
.GetControl('edMaxLives')).Enabled
then
1483 n
:= StrToIntDef(TGUIEdit(menu
.GetControl('edMaxLives')).Text, GoalLimit
);
1484 if n
< 0 then n
:= 0;
1485 if n
> 255 then n
:= 255;
1491 stat
:= g_Player_GetStats();
1493 for a
:= 0 to High(stat
) do
1494 if stat
[a
].Lives
> b
then
1497 MaxLives
:= Max(n
, b
);
1501 if TGUISwitch(menu
.GetControl('swBotsVS')).Enabled
then
1503 case TGUISwitch(menu
.GetControl('swBotsVS')).ItemIndex
of
1506 Options
:= Options
and (not GAME_OPTION_BOTVSPLAYER
);
1507 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1511 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1512 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
1516 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
1517 Options
:= Options
and (not GAME_OPTION_BOTVSMONSTER
);
1523 if g_Game_IsNet
then MH_SEND_GameSettings
;
1526 procedure ProcVideoOptionsRes();
1532 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1534 TGUILabel(menu
.GetControl('lbCurrentRes')).Text :=
1535 IntToStr(gScreenWidth
) +
1536 ' x ' + IntToStr(gScreenHeight
) +
1537 ', ' + IntToStr(gBPP
) + ' bpp';
1539 with TGUIListBox(menu
.GetControl('lsResolution')) do
1541 list
:= GetDisplayModes(gBPP
, SR
);
1552 with TGUISwitch(menu
.GetControl('swFullScreen')) do
1559 procedure ProcApplyVideoOptions();
1562 Fullscreen
: Boolean;
1563 SWidth
, SHeight
: Integer;
1566 menu
:= TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
1568 str
:= TGUIListBox(menu
.GetControl('lsResolution')).SelectedItem
;
1569 SScanf(str
, '%dx%d', [@SWidth
, @SHeight
]);
1571 Fullscreen
:= TGUISwitch(menu
.GetControl('swFullScreen')).ItemIndex
= 0;
1573 if (SWidth
<> gScreenWidth
) or
1574 (SHeight
<> gScreenHeight
) or
1575 (Fullscreen
<> gFullscreen
) then
1577 gResolutionChange
:= True;
1578 gRC_Width
:= SWidth
;
1579 gRC_Height
:= SHeight
;
1580 gRC_FullScreen
:= Fullscreen
;
1581 gRC_Maximized
:= gWinMaximized
;
1584 // Ñîõðàíÿåì èçìåíåíèÿ âñåõ íàñòðîåê:
1588 function CreateYNMenu(Name
, Text: String; MaxLen
: Word; FontID
: DWORD
;
1589 KeyDownProc
: Pointer): TGUIWindow
;
1595 Result
:= TGUIWindow
.Create(Name
);
1599 OnKeyDown
:= KeyDownProc
;
1601 lines
:= GetLines(Text, FontID
, MaxLen
);
1603 h
:= e_CharFont_GetMaxHeight(FontID
);
1604 _x
:= (gScreenHeight
div 2)-(h
*Length(lines
) div 2);
1606 if lines
<> nil then
1608 for a
:= 0 to High(lines
) do
1609 with TGUILabel(Result
.AddChild(TGUILabel
.Create(lines
[a
], FontID
))) do
1611 X
:= (gScreenWidth
div 2)-(GetWidth
div 2);
1613 Color
:= _RGB(255, 0, 0);
1617 with TGUILabel(Result
.AddChild(TGUILabel
.Create('(Y/N)', FontID
))) do
1619 X
:= (gScreenWidth
div 2)-(GetWidth
div 2);
1621 Color
:= _RGB(255, 0, 0);
1630 procedure ProcSetFirstRussianLanguage();
1632 gLanguage
:= LANGUAGE_RUSSIAN
;
1633 gLanguageChange
:= True;
1634 gAskLanguage
:= False;
1636 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1639 procedure ProcSetFirstEnglishLanguage();
1641 gLanguage
:= LANGUAGE_ENGLISH
;
1642 gLanguageChange
:= True;
1643 gAskLanguage
:= False;
1645 g_Options_Write_Language(GameDir
+'/'+CONFIG_FILENAME
);
1648 procedure ProcRecallAddress();
1650 with TGUIMenu(g_GUI_GetWindow('NetClientMenu').GetControl('mNetClientMenu')) do
1652 TGUIEdit(GetControl('edIP')).Text := NetClientIP
;
1653 TGUIEdit(GetControl('edPort')).Text := IntToStr(NetClientPort
);
1657 procedure CreateFirstLanguageMenu();
1661 Menu
:= TGUIWindow
.Create('FirstLanguageMenu');
1663 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, ' '))) do
1665 Name
:= 'mmFirstLanguageMenu';
1666 AddButton(@ProcSetFirstRussianLanguage
, 'Ðóññêèé', '');
1667 AddButton(@ProcSetFirstEnglishLanguage
, 'English', '');
1670 Menu
.DefControl
:= 'mmFirstLanguageMenu';
1671 Menu
.MainWindow
:= True;
1672 g_GUI_AddWindow(Menu
);
1675 procedure g_Menu_AskLanguage();
1677 CreateFirstLanguageMenu();
1678 g_GUI_ShowWindow('FirstLanguageMenu');
1681 procedure CreatePlayerOptionsMenu(s
: String);
1686 Menu
:= TGUIWindow
.Create('OptionsPlayers'+s
+'Menu');
1688 a
:= _lc
[I_MENU_PLAYER_1
]
1690 a
:= _lc
[I_MENU_PLAYER_2
];
1691 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, a
))) do
1693 Name
:= 'mOptionsPlayers'+s
+'Menu';
1694 with AddEdit(_lc
[I_MENU_PLAYER_NAME
]) do
1696 Name
:= 'ed'+s
+'Name';
1700 with AddSwitch(_lc
[I_MENU_PLAYER_TEAM
]) do
1702 Name
:= 'sw'+s
+'Team';
1703 AddItem(_lc
[I_MENU_PLAYER_TEAM_RED
]);
1704 AddItem(_lc
[I_MENU_PLAYER_TEAM_BLUE
]);
1706 with AddList(_lc
[I_MENU_PLAYER_MODEL
], 12, 6) do
1708 Name
:= 'ls'+s
+'Model';
1710 Items
:= g_PlayerModel_GetNames();
1711 OnChange
:= ProcSelectModel
;
1713 with AddScroll(_lc
[I_MENU_PLAYER_RED
]) do
1715 Name
:= 'sc'+s
+'Red';
1717 OnChange
:= ProcChangeColor
;
1719 with AddScroll(_lc
[I_MENU_PLAYER_GREEN
]) do
1721 Name
:= 'sc'+s
+'Green';
1723 OnChange
:= ProcChangeColor
;
1725 with AddScroll(_lc
[I_MENU_PLAYER_BLUE
]) do
1727 Name
:= 'sc'+s
+'Blue';
1729 OnChange
:= ProcChangeColor
;
1732 AddButton(@ProcOptionsPlayersMIMenu
, _lc
[I_MENU_MODEL_INFO
]);
1733 AddButton(@ProcOptionsPlayersAnim
, _lc
[I_MENU_MODEL_ANIMATION
]);
1734 AddButton(@ProcOptionsPlayersWeap
, _lc
[I_MENU_MODEL_CHANGE_WEAPON
]);
1735 AddButton(@ProcOptionsPlayersRot
, _lc
[I_MENU_MODEL_ROTATE
]);
1737 with TGUIModelView(Menu
.AddChild(TGUIModelView
.Create
)) do
1739 Name
:= 'mv'+s
+'Model';
1740 X
:= GetControl('ls'+s
+'Model').X
+TGUIListBox(GetControl('ls'+s
+'Model')).GetWidth
+16;
1741 Y
:= GetControl('ls'+s
+'Model').Y
;
1744 Menu
.DefControl
:= 'mOptionsPlayers'+s
+'Menu';
1745 g_GUI_AddWindow(Menu
);
1748 procedure CreateAllMenus();
1752 a
, cx
, _y
, i
: Integer;
1755 Menu
:= TGUIWindow
.Create('MainMenu');
1756 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
1758 Name
:= 'mmMainMenu';
1759 AddButton(nil, _lc
[I_MENU_NEW_GAME
], 'NewGameMenu');
1760 AddButton(nil, _lc
[I_MENU_MULTIPLAYER
], 'NetGameMenu');
1761 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
1762 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
1763 AddButton(@ProcAuthorsMenu
, _lc
[I_MENU_AUTHORS
], 'AuthorsMenu');
1764 AddButton(nil, _lc
[I_MENU_EXIT
], 'ExitMenu');
1766 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(Format(_lc
[I_VERSION
], [GAME_VERSION
]), gMenuSmallFont
))) do
1768 Color
:= _RGB(255, 255, 255);
1769 X
:= gScreenWidth
-GetWidth
-8;
1770 Y
:= gScreenHeight
-GetHeight
-8;
1772 Menu
.DefControl
:= 'mmMainMenu';
1773 Menu
.MainWindow
:= True;
1774 g_GUI_AddWindow(Menu
);
1776 Menu
:= TGUIWindow
.Create('NewGameMenu');
1777 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_NEW_GAME
]))) do
1779 Name
:= 'mmNewGameMenu';
1780 AddButton(@ProcSingle1Player
, _lc
[I_MENU_1_PLAYER
]);
1781 AddButton(@ProcSingle2Players
, _lc
[I_MENU_2_PLAYERS
]);
1782 AddButton(nil, _lc
[I_MENU_CUSTOM_GAME
], 'CustomGameMenu');
1783 AddButton(@ProcSelectCampaignMenu
, _lc
[I_MENU_CAMPAIGN
], 'CampaignMenu');
1785 Menu
.DefControl
:= 'mmNewGameMenu';
1786 g_GUI_AddWindow(Menu
);
1788 Menu
:= TGUIWindow
.Create('NetGameMenu');
1789 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MULTIPLAYER
]))) do
1791 Name
:= 'mmNetGameMenu';
1792 AddButton(@ProcRecallAddress
, _lc
[I_MENU_START_CLIENT
], 'NetClientMenu');
1793 AddButton(nil, _lc
[I_MENU_START_SERVER
], 'NetServerMenu');
1795 Menu
.DefControl
:= 'mmNetGameMenu';
1796 g_GUI_AddWindow(Menu
);
1798 Menu
:= TGUIWindow
.Create('NetServerMenu');
1799 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_START_SERVER
]))) do
1801 Name
:= 'mNetServerMenu';
1802 with AddEdit(_lc
[I_NET_SERVER_NAME
]) do
1804 Name
:= 'edSrvName';
1805 OnlyDigits
:= False;
1808 Text := NetServerName
;
1810 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
1812 Name
:= 'edSrvPassword';
1813 OnlyDigits
:= False;
1816 Text := NetPassword
;
1818 with AddEdit(_lc
[I_NET_PORT
]) do
1824 Text := IntToStr(NetPort
);
1826 with AddEdit(_lc
[I_NET_MAX_CLIENTS
]) do
1828 Name
:= 'edMaxPlayers';
1832 Text := IntToStr(NetMaxClients
);
1834 with AddSwitch(_lc
[I_NET_USE_MASTER
]) do
1836 Name
:= 'swUseMaster';
1837 AddItem(_lc
[I_MENU_YES
]);
1838 AddItem(_lc
[I_MENU_NO
]);
1839 if NetUseMaster
then
1845 with AddLabel(_lc
[I_MENU_MAP
]) do
1850 OnClick
:= @ProcSelectMapMenu
;
1852 with AddSwitch(_lc
[I_MENU_GAME_TYPE
]) do
1854 Name
:= 'swGameMode';
1855 AddItem(_lc
[I_MENU_GAME_TYPE_DM
]);
1856 AddItem(_lc
[I_MENU_GAME_TYPE_TDM
]);
1857 AddItem(_lc
[I_MENU_GAME_TYPE_CTF
]);
1858 AddItem(_lc
[I_MENU_GAME_TYPE_COOP
]);
1859 case g_Game_TextToMode(gnGameMode
) of
1861 GM_DM
: ItemIndex
:= 0;
1862 GM_TDM
: ItemIndex
:= 1;
1863 GM_CTF
: ItemIndex
:= 2;
1865 GM_COOP
: ItemIndex
:= 3;
1867 OnChange
:= ProcSwitchMonstersNet
;
1869 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
1871 Name
:= 'edTimeLimit';
1875 if gnTimeLimit
> 0 then
1876 Text := IntToStr(gnTimeLimit
);
1878 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
1880 Name
:= 'edGoalLimit';
1884 if gnGoalLimit
> 0 then
1885 Text := IntToStr(gnGoalLimit
);
1887 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
1889 Name
:= 'edMaxLives';
1893 if gnMaxLives
> 0 then
1894 Text := IntToStr(gnMaxLives
);
1896 with AddSwitch(_lc
[I_MENU_SERVER_PLAYERS
]) do
1898 Name
:= 'swPlayers';
1899 AddItem(_lc
[I_MENU_COUNT_NONE
]);
1900 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
1901 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
1902 ItemIndex
:= gnPlayers
;
1904 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
1906 Name
:= 'swTeamDamage';
1907 AddItem(_lc
[I_MENU_YES
]);
1908 AddItem(_lc
[I_MENU_NO
]);
1909 if gnTeamDamage
then
1914 with AddSwitch(_lc
[I_MENU_ENABLE_EXITS
]) do
1916 Name
:= 'swEnableExits';
1917 AddItem(_lc
[I_MENU_YES
]);
1918 AddItem(_lc
[I_MENU_NO
]);
1924 with AddSwitch(_lc
[I_MENU_WEAPONS_STAY
]) do
1926 Name
:= 'swWeaponStay';
1927 AddItem(_lc
[I_MENU_YES
]);
1928 AddItem(_lc
[I_MENU_NO
]);
1929 if gnWeaponStay
then
1934 with AddSwitch(_lc
[I_MENU_ENABLE_MONSTERS
]) do
1936 Name
:= 'swMonsters';
1937 AddItem(_lc
[I_MENU_YES
]);
1938 AddItem(_lc
[I_MENU_NO
]);
1944 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
1947 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
1948 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
1949 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
1951 if gnBotsVS
= 'Players' then
1953 if gnBotsVS
= 'Monsters' then
1957 AddButton(@ProcStartNetGame
, _lc
[I_MENU_START_GAME
]);
1961 Menu
.DefControl
:= 'mNetServerMenu';
1962 g_GUI_AddWindow(Menu
);
1964 Menu
:= TGUIWindow
.Create('NetClientMenu');
1965 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_START_CLIENT
]))) do
1967 Name
:= 'mNetClientMenu';
1969 AddButton(@ProcServerlist
, _lc
[I_NET_SLIST
]);
1972 with AddEdit(_lc
[I_NET_ADDRESS
]) do
1978 Text := 'localhost';
1980 with AddEdit(_lc
[I_NET_PORT
]) do
1988 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
1991 OnlyDigits
:= False;
1998 AddButton(@ProcConnectNetGame
, _lc
[I_MENU_CLIENT_CONNECT
]);
2002 Menu
.DefControl
:= 'mNetClientMenu';
2003 g_GUI_AddWindow(Menu
);
2005 Menu
:= TGUIWindow
.Create('LoadMenu');
2006 Menu
.OnShow
:= ProcLoadMenu
;
2007 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_LOAD_GAME
]))) do
2009 Name
:= 'mmLoadMenu';
2014 Name
:= 'edSlot'+IntToStr(a
);
2017 OnEnter
:= ProcLoadGame
;
2020 Menu
.DefControl
:= 'mmLoadMenu';
2021 g_GUI_AddWindow(Menu
);
2023 Menu
:= TGUIWindow
.Create('SaveMenu');
2024 Menu
.OnShow
:= ProcSaveMenu
;
2025 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SAVE_GAME
]))) do
2027 Name
:= 'mmSaveMenu';
2032 Name
:= 'edSlot'+IntToStr(a
);
2035 OnChange
:= ProcSaveGame
;
2038 Menu
.DefControl
:= 'mmSaveMenu';
2039 g_GUI_AddWindow(Menu
);
2041 Menu
:= TGUIWindow
.Create('CustomGameMenu');
2042 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CUSTOM_GAME
]))) do
2044 Name
:= 'mCustomGameMenu';
2045 with AddLabel(_lc
[I_MENU_MAP
]) do
2050 OnClick
:= @ProcSelectMapMenu
;
2052 with AddSwitch(_lc
[I_MENU_GAME_TYPE
]) do
2054 Name
:= 'swGameMode';
2055 AddItem(_lc
[I_MENU_GAME_TYPE_DM
]);
2056 AddItem(_lc
[I_MENU_GAME_TYPE_TDM
]);
2057 AddItem(_lc
[I_MENU_GAME_TYPE_CTF
]);
2058 AddItem(_lc
[I_MENU_GAME_TYPE_COOP
]);
2059 case g_Game_TextToMode(gcGameMode
) of
2061 GM_DM
: ItemIndex
:= 0;
2062 GM_TDM
: ItemIndex
:= 1;
2063 GM_CTF
: ItemIndex
:= 2;
2065 GM_COOP
: ItemIndex
:= 3;
2067 OnChange
:= ProcSwitchMonstersCustom
;
2069 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
2071 Name
:= 'edTimeLimit';
2075 if gcTimeLimit
> 0 then
2076 Text := IntToStr(gcTimeLimit
);
2078 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
2080 Name
:= 'edGoalLimit';
2084 if gcGoalLimit
> 0 then
2085 Text := IntToStr(gcGoalLimit
);
2087 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
2089 Name
:= 'edMaxLives';
2093 if gcMaxLives
> 0 then
2094 Text := IntToStr(gcMaxLives
);
2096 with AddSwitch(_lc
[I_MENU_PLAYERS
]) do
2098 Name
:= 'swPlayers';
2099 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2100 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2101 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2102 ItemIndex
:= gcPlayers
;
2104 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
2106 Name
:= 'swTeamDamage';
2107 AddItem(_lc
[I_MENU_YES
]);
2108 AddItem(_lc
[I_MENU_NO
]);
2109 if gcTeamDamage
then
2114 with AddSwitch(_lc
[I_MENU_ENABLE_EXITS
]) do
2116 Name
:= 'swEnableExits';
2117 AddItem(_lc
[I_MENU_YES
]);
2118 AddItem(_lc
[I_MENU_NO
]);
2124 with AddSwitch(_lc
[I_MENU_WEAPONS_STAY
]) do
2126 Name
:= 'swWeaponStay';
2127 AddItem(_lc
[I_MENU_YES
]);
2128 AddItem(_lc
[I_MENU_NO
]);
2129 if gcWeaponStay
then
2134 with AddSwitch(_lc
[I_MENU_ENABLE_MONSTERS
]) do
2136 Name
:= 'swMonsters';
2137 AddItem(_lc
[I_MENU_YES
]);
2138 AddItem(_lc
[I_MENU_NO
]);
2144 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
2147 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
2148 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
2149 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
2151 if gcBotsVS
= 'Players' then
2153 if gcBotsVS
= 'Monsters' then
2157 AddButton(@ProcStartCustomGame
, _lc
[I_MENU_START_GAME
]);
2161 Menu
.DefControl
:= 'mCustomGameMenu';
2162 g_GUI_AddWindow(Menu
);
2164 Menu
:= TGUIWindow
.Create('CampaignMenu');
2165 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CAMPAIGN
]))) do
2167 Name
:= 'mCampaignMenu';
2176 with AddFileList('', 15, 4) do
2179 OnChange
:= ProcSelectCampaignWAD
;
2183 FileMask
:= '*.wad';
2184 SetBase(MapsDir
+'megawads/');
2187 with AddLabel(_lc
[I_MENU_MAP_NAME
]) do
2189 Name
:= 'lbWADName';
2193 with AddLabel(_lc
[I_MENU_MAP_AUTHOR
]) do
2195 Name
:= 'lbWADAuthor';
2199 AddLine(_lc
[I_MENU_MAP_DESCRIPTION
]);
2200 with AddMemo('', 15, 3) do
2202 Name
:= 'meWADDescription';
2203 Color
:= MENU_ITEMSCTRL_COLOR
;
2205 with AddSwitch(_lc
[I_MENU_PLAYERS
]) do
2207 Name
:= 'swPlayers';
2208 AddItem(_lc
[I_MENU_PLAYERS_ONE
]);
2209 AddItem(_lc
[I_MENU_PLAYERS_TWO
]);
2212 AddButton(@ProcStartCampaign
, _lc
[I_MENU_START_GAME
]);
2216 with TGUIImage(Menu
.AddChild(TGUIImage
.Create
)) do
2218 Name
:= 'mpWADImage';
2219 DefaultRes
:= 'NOPIC';
2220 X
:= GetControl('lsWAD').X
+4;
2221 Y
:= GetControl('lsWAD').Y
-128-MENU_VSPACE
;
2224 Menu
.DefControl
:= 'mCampaignMenu';
2225 g_GUI_AddWindow(Menu
);
2227 Menu
:= TGUIWindow
.Create('SelectMapMenu');
2228 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SELECT_MAP
]))) do
2230 Name
:= 'mSelectMapMenu';
2231 with AddFileList(_lc
[I_MENU_MAP_WAD
], 12, 4) do
2234 OnChange
:= ProcSelectWAD
;
2238 FileMask
:= '*.wad';
2241 with AddList(_lc
[I_MENU_MAP_RESOURCE
], 12, 4) do
2245 OnChange
:= ProcSelectMap
;
2248 with AddLabel(_lc
[I_MENU_MAP_NAME
]) do
2250 Name
:= 'lbMapName';
2254 with AddLabel(_lc
[I_MENU_MAP_AUTHOR
]) do
2256 Name
:= 'lbMapAuthor';
2260 with AddLabel(_lc
[I_MENU_MAP_SIZE
]) do
2262 Name
:= 'lbMapSize';
2266 with AddMemo(_lc
[I_MENU_MAP_DESCRIPTION
], 12, 4) do
2268 Name
:= 'meMapDescription';
2273 with TGUIMapPreview(Menu
.AddChild(TGUIMapPreview
.Create
)) do
2275 Name
:= 'mpMapPreview';
2276 X
:= GetControl('lsMapWAD').X
+TGUIListBox(GetControl('lsMapWAD')).GetWidth()+2;
2277 Y
:= GetControl('lsMapWAD').Y
;
2279 with TGUILabel(Menu
.AddChild(TGUILabel
.Create('', gMenuSmallFont
))) do
2281 Name
:= 'lbMapScale';
2284 Color
:= MENU_ITEMSCTRL_COLOR
;
2285 X
:= GetControl('lsMapWAD').X
+
2286 TGUIListBox(GetControl('lsMapWAD')).GetWidth() +
2287 2 + MAPPREVIEW_WIDTH
*4;
2288 Y
:= GetControl('lsMapWAD').Y
+ MAPPREVIEW_HEIGHT
*16 + 16;
2291 Menu
.OnClose
:= ProcSetMap
;
2292 Menu
.DefControl
:= 'mSelectMapMenu';
2293 g_GUI_AddWindow(Menu
);
2295 Menu
:= TGUIWindow
.Create('OptionsMenu');
2296 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_OPTIONS
]))) do
2298 Name
:= 'mmOptionsMenu';
2299 AddButton(nil, _lc
[I_MENU_VIDEO_OPTIONS
], 'OptionsVideoMenu');
2300 AddButton(nil, _lc
[I_MENU_SOUND_OPTIONS
], 'OptionsSoundMenu');
2301 AddButton(nil, _lc
[I_MENU_GAME_OPTIONS
], 'OptionsGameMenu');
2302 AddButton(nil, _lc
[I_MENU_CONTROLS_OPTIONS
], 'OptionsControlsMenu');
2303 AddButton(nil, _lc
[I_MENU_PLAYER_OPTIONS
], 'OptionsPlayersMenu');
2304 AddButton(nil, _lc
[I_MENU_LANGUAGE_OPTIONS
], 'OptionsLanguageMenu');
2306 AddButton(nil, _lc
[I_MENU_SAVED_OPTIONS
], 'SavedOptionsMenu').Color
:= _RGB(255, 0, 0);
2307 AddButton(nil, _lc
[I_MENU_DEFAULT_OPTIONS
], 'DefaultOptionsMenu').Color
:= _RGB(255, 0, 0);
2309 Menu
.OnClose
:= ProcApplyOptions
;
2310 Menu
.DefControl
:= 'mmOptionsMenu';
2311 g_GUI_AddWindow(Menu
);
2313 Menu
:= CreateYNMenu('SavedOptionsMenu', _lc
[I_MENU_LOAD_SAVED_PROMT
], Round(gScreenWidth
*0.6),
2314 gMenuSmallFont
, @ProcSavedMenuKeyDown
);
2315 g_GUI_AddWindow(Menu
);
2317 Menu
:= TGUIWindow
.Create('OptionsVideoMenu');
2318 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_VIDEO_OPTIONS
]))) do
2320 Name
:= 'mOptionsVideoMenu';
2321 AddButton(@ProcVideoOptionsRes
, _lc
[I_MENU_VIDEO_RESOLUTION
], 'OptionsVideoResMenu');
2322 with AddSwitch(_lc
[I_MENU_VIDEO_BPP
]) do
2328 with AddSwitch(_lc
[I_MENU_VIDEO_VSYNC
]) do
2331 AddItem(_lc
[I_MENU_YES
]);
2332 AddItem(_lc
[I_MENU_NO
]);
2334 with AddSwitch(_lc
[I_MENU_VIDEO_FILTER_SKY
]) do
2336 Name
:= 'swTextureFilter';
2337 AddItem(_lc
[I_MENU_YES
]);
2338 AddItem(_lc
[I_MENU_NO
]);
2340 with AddSwitch(_lc
[I_MENU_VIDEO_LEGACY_COMPATIBLE
]) do
2342 Name
:= 'swLegacyNPOT';
2343 AddItem(_lc
[I_MENU_NO
]);
2344 AddItem(_lc
[I_MENU_YES
]);
2347 AddText(_lc
[I_MENU_VIDEO_NEED_RESTART
], Round(gScreenWidth
*0.6));
2350 Menu
.DefControl
:= 'mOptionsVideoMenu';
2351 g_GUI_AddWindow(Menu
);
2353 Menu
:= TGUIWindow
.Create('OptionsVideoResMenu');
2354 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_RESOLUTION_SELECT
]))) do
2356 Name
:= 'mOptionsVideoResMenu';
2357 with AddLabel(_lc
[I_MENU_RESOLUTION_CURRENT
]) do
2359 Name
:= 'lbCurrentRes';
2363 with AddList(_lc
[I_MENU_RESOLUTION_LIST
], 12, 6) do
2365 Name
:= 'lsResolution';
2368 with AddSwitch(_lc
[I_MENU_RESOLUTION_FULLSCREEN
]) do
2370 Name
:= 'swFullScreen';
2371 AddItem(_lc
[I_MENU_YES
]);
2372 AddItem(_lc
[I_MENU_NO
]);
2375 AddButton(@ProcApplyVideoOptions
, _lc
[I_MENU_RESOLUTION_APPLY
]);
2378 Menu
.DefControl
:= 'mOptionsVideoResMenu';
2379 g_GUI_AddWindow(Menu
);
2381 Menu
:= TGUIWindow
.Create('OptionsSoundMenu');
2382 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SOUND_OPTIONS
]))) do
2384 Name
:= 'mOptionsSoundMenu';
2385 with AddScroll(_lc
[I_MENU_SOUND_MUSIC_LEVEL
]) do
2387 Name
:= 'scMusicLevel';
2389 OnChange
:= ProcChangeSoundSettings
;
2391 with AddScroll(_lc
[I_MENU_SOUND_SOUND_LEVEL
]) do
2393 Name
:= 'scSoundLevel';
2395 OnChange
:= ProcChangeSoundSettings
;
2397 with AddScroll(_lc
[I_MENU_SOUND_MAX_SIM_SOUNDS
]) do
2399 Name
:= 'scMaxSimSounds';
2402 with AddSwitch (_lc
[I_MENU_SOUND_ANNOUNCE
]) do
2404 Name
:= 'swAnnouncer';
2405 AddItem(_lc
[I_MENU_ANNOUNCE_NONE
]);
2406 AddItem(_lc
[I_MENU_ANNOUNCE_ME
]);
2407 AddItem(_lc
[I_MENU_ANNOUNCE_MEPLUS
]);
2408 AddItem(_lc
[I_MENU_ANNOUNCE_ALL
]);
2410 // Ïåðåêëþ÷àòåëü çâóêîâûõ ýôôåêòîâ (DF / Doom 2)
2411 with AddSwitch (_lc
[I_MENU_SOUND_COMPAT
]) do
2413 Name
:= 'swSoundEffects';
2414 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2415 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2417 with AddSwitch(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS
]) do
2419 Name
:= 'swInactiveSounds';
2420 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_ON
]);
2421 AddItem(_lc
[I_MENU_SOUND_INACTIVE_SOUNDS_OFF
]);
2425 Menu
.DefControl
:= 'mOptionsSoundMenu';
2426 g_GUI_AddWindow(Menu
);
2428 Menu
:= TGUIWindow
.Create('OptionsGameMenu');
2429 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_GAME_OPTIONS
]))) do
2431 Name
:= 'mOptionsGameMenu';
2432 with AddScroll(_lc
[I_MENU_GAME_PARTICLES_COUNT
]) do
2434 Name
:= 'scParticlesCount';
2437 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_COUNT
]) do
2439 Name
:= 'swBloodCount';
2440 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2441 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2442 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2443 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2444 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2446 with AddScroll(_lc
[I_MENU_GAME_MAX_SHELLS
]) do
2448 Name
:= 'scShellsMax';
2451 with AddScroll(_lc
[I_MENU_GAME_GIBS_COUNT
]) do
2453 Name
:= 'scGibsMax';
2456 with AddScroll(_lc
[I_MENU_GAME_MAX_CORPSES
]) do
2458 Name
:= 'scCorpsesMax';
2461 with AddSwitch(_lc
[I_MENU_GAME_MAX_GIBS
]) do
2463 Name
:= 'swGibsCount';
2464 AddItem(_lc
[I_MENU_COUNT_NONE
]);
2465 AddItem(_lc
[I_MENU_COUNT_SMALL
]);
2466 AddItem(_lc
[I_MENU_COUNT_NORMAL
]);
2467 AddItem(_lc
[I_MENU_COUNT_BIG
]);
2468 AddItem(_lc
[I_MENU_COUNT_VERYBIG
]);
2470 with AddSwitch(_lc
[I_MENU_GAME_CORPSE_TYPE
]) do
2472 Name
:= 'swCorpseType';
2473 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_SIMPLE
]);
2474 AddItem(_lc
[I_MENU_GAME_CORPSE_TYPE_ADV
]);
2476 with AddSwitch(_lc
[I_MENU_GAME_GIBS_TYPE
]) do
2478 Name
:= 'swGibsType';
2479 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_SIMPLE
]);
2480 AddItem(_lc
[I_MENU_GAME_GIBS_TYPE_ADV
]);
2482 with AddSwitch(_lc
[I_MENU_GAME_BLOOD_TYPE
]) do
2484 Name
:= 'swBloodType';
2485 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_SIMPLE
]);
2486 AddItem(_lc
[I_MENU_GAME_BLOOD_TYPE_ADV
]);
2488 with AddSwitch(_lc
[I_MENU_GAME_SCREEN_FLASH
]) do
2490 Name
:= 'swScreenFlash';
2491 AddItem(_lc
[I_MENU_NO
]);
2492 AddItem(_lc
[I_MENU_COMPAT_DF
]);
2493 AddItem(_lc
[I_MENU_COMPAT_DOOM2
]);
2495 with AddSwitch(_lc
[I_MENU_GAME_BACKGROUND
]) do
2497 Name
:= 'swBackground';
2498 AddItem(_lc
[I_MENU_YES
]);
2499 AddItem(_lc
[I_MENU_NO
]);
2501 with AddSwitch(_lc
[I_MENU_GAME_MESSAGES
]) do
2503 Name
:= 'swMessages';
2504 AddItem(_lc
[I_MENU_YES
]);
2505 AddItem(_lc
[I_MENU_NO
]);
2507 with AddSwitch(_lc
[I_MENU_GAME_REVERT_PLAYERS
]) do
2509 Name
:= 'swRevertPlayers';
2510 AddItem(_lc
[I_MENU_YES
]);
2511 AddItem(_lc
[I_MENU_NO
]);
2513 with AddSwitch(_lc
[I_MENU_GAME_CHAT_BUBBLE
]) do
2515 Name
:= 'swChatBubble';
2516 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_NONE
]);
2517 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_SIMPLE
]);
2518 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_ADV
]);
2519 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_COLOR
]);
2520 AddItem(_lc
[I_MENU_GAME_CHAT_TYPE_TEXTURE
]);
2524 Menu
.DefControl
:= 'mOptionsGameMenu';
2525 g_GUI_AddWindow(Menu
);
2527 Menu
:= TGUIWindow
.Create('OptionsControlsMenu');
2528 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROLS_OPTIONS
]))) do
2530 Name
:= 'mOptionsControlsMenu';
2531 AddLine(_lc
[I_MENU_CONTROL_GLOBAL
]);
2532 AddKeyRead(_lc
[I_MENU_CONTROL_SCREENSHOT
]).Name
:= _lc
[I_MENU_CONTROL_SCREENSHOT
];
2533 AddKeyRead(_lc
[I_MENU_CONTROL_STAT
]).Name
:= _lc
[I_MENU_CONTROL_STAT
];
2534 AddKeyRead(_lc
[I_MENU_CONTROL_CHAT
]).Name
:= _lc
[I_MENU_CONTROL_CHAT
];
2535 AddKeyRead(_lc
[I_MENU_CONTROL_TEAMCHAT
]).Name
:= _lc
[I_MENU_CONTROL_TEAMCHAT
];
2537 AddButton(nil, _lc
[I_MENU_PLAYER_1
], 'OptionsControlsP1Menu');
2538 AddButton(nil, _lc
[I_MENU_PLAYER_2
], 'OptionsControlsP2Menu');
2540 if e_JoysticksAvailable
<> 0 then
2541 AddButton(nil, _lc
[I_MENU_CONTROL_JOYSTICKS
], 'OptionsControlsJoystickMenu');
2543 Menu
.DefControl
:= 'mOptionsControlsMenu';
2544 g_GUI_AddWindow(Menu
);
2546 Menu
:= TGUIWindow
.Create('OptionsControlsP1Menu');
2547 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_1
]))) do
2549 Name
:= 'mOptionsControlsP1Menu';
2550 AddKeyRead(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
2551 AddKeyRead(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
2552 AddKeyRead(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
2553 AddKeyRead(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
2554 AddKeyRead(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
2555 AddKeyRead(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
2556 AddKeyRead(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
2557 AddKeyRead(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
2558 AddKeyRead(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
2560 Menu
.DefControl
:= 'mOptionsControlsP1Menu';
2561 g_GUI_AddWindow(Menu
);
2563 Menu
:= TGUIWindow
.Create('OptionsControlsP2Menu');
2564 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_2
]))) do
2566 Name
:= 'mOptionsControlsP2Menu';
2567 AddKeyRead(_lc
[I_MENU_CONTROL_LEFT
]).Name
:= _lc
[I_MENU_CONTROL_LEFT
];
2568 AddKeyRead(_lc
[I_MENU_CONTROL_RIGHT
]).Name
:= _lc
[I_MENU_CONTROL_RIGHT
];
2569 AddKeyRead(_lc
[I_MENU_CONTROL_UP
]).Name
:= _lc
[I_MENU_CONTROL_UP
];
2570 AddKeyRead(_lc
[I_MENU_CONTROL_DOWN
]).Name
:= _lc
[I_MENU_CONTROL_DOWN
];
2571 AddKeyRead(_lc
[I_MENU_CONTROL_JUMP
]).Name
:= _lc
[I_MENU_CONTROL_JUMP
];
2572 AddKeyRead(_lc
[I_MENU_CONTROL_FIRE
]).Name
:= _lc
[I_MENU_CONTROL_FIRE
];
2573 AddKeyRead(_lc
[I_MENU_CONTROL_USE
]).Name
:= _lc
[I_MENU_CONTROL_USE
];
2574 AddKeyRead(_lc
[I_MENU_CONTROL_NEXT_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_NEXT_WEAPON
];
2575 AddKeyRead(_lc
[I_MENU_CONTROL_PREV_WEAPON
]).Name
:= _lc
[I_MENU_CONTROL_PREV_WEAPON
];
2577 Menu
.DefControl
:= 'mOptionsControlsP2Menu';
2578 g_GUI_AddWindow(Menu
);
2580 Menu
:= TGUIWindow
.Create('OptionsControlsJoystickMenu');
2581 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_CONTROL_JOYSTICKS
]))) do
2583 Name
:= 'mOptionsControlsJoystickMenu';
2584 for i
:= 0 to e_JoysticksAvailable
-1 do
2585 with AddScroll(Format(_lc
[I_MENU_CONTROL_DEADZONE
], [i
+ 1])) do
2587 Name
:= 'scDeadzone' + IntToStr(i
);
2591 Menu
.DefControl
:= 'mOptionsControlsJoystickMenu';
2592 g_GUI_AddWindow(Menu
);
2594 Menu
:= TGUIWindow
.Create('OptionsPlayersMenu');
2595 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_PLAYER_OPTIONS
]))) do
2597 Name
:= 'mOptionsPlayersMenu';
2598 AddButton(nil, _lc
[I_MENU_PLAYER_1
], 'OptionsPlayersP1Menu');
2599 AddButton(nil, _lc
[I_MENU_PLAYER_2
], 'OptionsPlayersP2Menu');
2601 Menu
.DefControl
:= 'mOptionsPlayersMenu';
2602 g_GUI_AddWindow(Menu
);
2604 CreatePlayerOptionsMenu('P1');
2605 CreatePlayerOptionsMenu('P2');
2607 Menu
:= TGUIWindow
.Create('OptionsPlayersMIMenu');
2608 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_MODEL_INFO
]))) do
2610 Name
:= 'mOptionsPlayersMIMenu';
2611 with AddLabel(_lc
[I_MENU_MODEL_NAME
]) do
2616 with AddLabel(_lc
[I_MENU_MODEL_AUTHOR
]) do
2621 with AddMemo(_lc
[I_MENU_MODEL_COMMENT
], 14, 6) do
2623 Name
:= 'meComment';
2626 AddLine(_lc
[I_MENU_MODEL_OPTIONS
]);
2627 with AddLabel(_lc
[I_MENU_MODEL_WEAPON
]) do
2630 FixedLength
:= Max(Length(_lc
[I_MENU_YES
]), Length(_lc
[I_MENU_NO
]));
2634 Menu
.DefControl
:= 'mOptionsPlayersMIMenu';
2635 g_GUI_AddWindow(Menu
);
2637 Menu
:= TGUIWindow
.Create('OptionsLanguageMenu');
2638 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_LANGUAGE_OPTIONS
]))) do
2640 Name
:= 'mOptionsLanguageMenu';
2641 AddButton(@ProcSetRussianLanguage
, _lc
[I_MENU_LANGUAGE_RUSSIAN
]);
2642 AddButton(@ProcSetEnglishLanguage
, _lc
[I_MENU_LANGUAGE_ENGLISH
]);
2645 Menu
.DefControl
:= 'mOptionsLanguageMenu';
2646 g_GUI_AddWindow(Menu
);
2648 Menu
:= CreateYNMenu('DefaultOptionsMenu', _lc
[I_MENU_SET_DEFAULT_PROMT
], Round(gScreenWidth
*0.6),
2649 gMenuSmallFont
, @ProcDefaultMenuKeyDown
);
2650 g_GUI_AddWindow(Menu
);
2652 Menu
:= TGUIWindow
.Create('AuthorsMenu');
2653 Menu
.BackTexture
:= 'INTER';
2654 Menu
.OnClose
:= ProcAuthorsClose
;
2658 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_1
], gMenuFont
))) do
2660 Color
:= _RGB(255, 0, 0);
2661 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
2663 _y
:= _y
+GetHeight();
2665 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(Format(_lc
[I_CREDITS_CAP_2
], [GAME_VERSION
, NET_PROTOCOL_VER
]), gMenuSmallFont
))) do
2667 Color
:= _RGB(255, 0, 0);
2668 X
:= (gScreenWidth
div 2)-(GetWidth() div 2);
2670 _y
:= _y
+GetHeight()+32;
2672 // ×òî äåëàë: Êòî äåëàë
2673 cx
:= gScreenWidth
div 2 - 320 + 64;
2674 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1
], gMenuSmallFont
))) do
2676 Color
:= _RGB(255, 0, 0);
2681 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_1_1
], gMenuSmallFont
))) do
2683 Color
:= _RGB(255, 255, 255);
2688 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2
], gMenuSmallFont
))) do
2690 Color
:= _RGB(255, 0, 0);
2695 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2_1
], gMenuSmallFont
))) do
2697 Color
:= _RGB(255, 255, 255);
2702 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_2_2
], gMenuSmallFont
))) do
2704 Color
:= _RGB(255, 255, 255);
2709 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3
], gMenuSmallFont
))) do
2711 Color
:= _RGB(255, 0, 0);
2716 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_3_1
], gMenuSmallFont
))) do
2718 Color
:= _RGB(255, 255, 255);
2723 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4
], gMenuSmallFont
))) do
2725 Color
:= _RGB(255, 0, 0);
2730 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_A_4_1
], gMenuSmallFont
))) do
2732 Color
:= _RGB(255, 255, 255);
2735 _y
:= gScreenHeight
- 128;
2738 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CAP_3
], gMenuSmallFont
))) do
2740 Color
:= _RGB(255, 0, 0);
2745 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_1
], gMenuSmallFont
))) do
2747 Color
:= _RGB(255, 255, 255);
2750 _y
:= _y
+GetHeight();
2752 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_2
], gMenuSmallFont
))) do
2754 Color
:= _RGB(255, 255, 255);
2757 _y
:= _y
+GetHeight();
2759 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_3
], gMenuSmallFont
))) do
2761 Color
:= _RGB(255, 255, 255);
2764 _y
:= gScreenHeight
- 32;
2766 with TGUILabel(Menu
.AddChild(TGUILabel
.Create(_lc
[I_CREDITS_CLO_4
], gMenuSmallFont
))) do
2768 Color
:= _RGB(255, 0, 0);
2769 X
:= gScreenWidth
div 2 - GetWidth() div 2;
2772 g_GUI_AddWindow(Menu
);
2774 Menu
:= CreateYNMenu('ExitMenu', _lc
[I_MENU_EXIT_PROMT
], Round(gScreenWidth
*0.6),
2775 gMenuSmallFont
, @ProcExitMenuKeyDown
);
2776 g_GUI_AddWindow(Menu
);
2778 Menu
:= TGUIWindow
.Create('GameSingleMenu');
2779 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
2781 Name
:= 'mmGameSingleMenu';
2782 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
2783 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
2784 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
2785 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
2786 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
2787 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
2789 Menu
.DefControl
:= 'mmGameSingleMenu';
2790 Menu
.MainWindow
:= True;
2791 Menu
.OnClose
:= ProcGMClose
;
2792 Menu
.OnShow
:= ProcGMShow
;
2793 g_GUI_AddWindow(Menu
);
2795 Menu
:= CreateYNMenu('EndGameMenu', _lc
[I_MENU_END_GAME_PROMT
], Round(gScreenWidth
*0.6),
2796 gMenuSmallFont
, @ProcEndMenuKeyDown
);
2797 g_GUI_AddWindow(Menu
);
2799 Menu
:= CreateYNMenu('RestartGameMenu', _lc
[I_MENU_RESTART_GAME_PROMT
], Round(gScreenWidth
*0.6),
2800 gMenuSmallFont
, @ProcRestartMenuKeyDown
);
2801 g_GUI_AddWindow(Menu
);
2803 Menu
:= TGUIWindow
.Create('GameCustomMenu');
2804 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
2806 Name
:= 'mmGameCustomMenu';
2807 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
2808 AddButton(nil, _lc
[I_MENU_LOAD_GAME
], 'LoadMenu');
2809 AddButton(nil, _lc
[I_MENU_SAVE_GAME
], 'SaveMenu').Name
:= 'save';
2810 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
2811 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
2812 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
2813 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
2815 Menu
.DefControl
:= 'mmGameCustomMenu';
2816 Menu
.MainWindow
:= True;
2817 Menu
.OnClose
:= ProcGMClose
;
2818 Menu
.OnShow
:= ProcGMShow
;
2819 g_GUI_AddWindow(Menu
);
2821 Menu
:= TGUIWindow
.Create('GameServerMenu');
2822 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
2824 Name
:= 'mmGameServerMenu';
2825 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
2826 AddButton(@ReadGameSettings
, _lc
[I_MENU_SET_GAME
], 'GameSetGameMenu');
2827 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
2828 AddButton(nil, _lc
[I_MENU_RESTART
], 'RestartGameMenu');
2829 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
2831 Menu
.DefControl
:= 'mmGameServerMenu';
2832 Menu
.MainWindow
:= True;
2833 Menu
.OnClose
:= ProcGMClose
;
2834 Menu
.OnShow
:= ProcGMShow
;
2835 g_GUI_AddWindow(Menu
);
2837 Menu
:= TGUIWindow
.Create('GameClientMenu');
2838 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_MAIN_MENU
]))) do
2840 Name
:= 'mmGameClientMenu';
2841 AddButton(nil, _lc
[I_MENU_CHANGE_PLAYERS
], 'TeamMenu');
2842 AddButton(@ReadOptions
, _lc
[I_MENU_OPTIONS
], 'OptionsMenu');
2843 AddButton(nil, _lc
[I_MENU_END_GAME
], 'EndGameMenu');
2845 Menu
.DefControl
:= 'mmGameClientMenu';
2846 Menu
.MainWindow
:= True;
2847 Menu
.OnClose
:= ProcGMClose
;
2848 Menu
.OnShow
:= ProcGMShow
;
2849 g_GUI_AddWindow(Menu
);
2851 Menu
:= TGUIWindow
.Create('ClientPasswordMenu');
2852 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuSmallFont
, gMenuSmallFont
, _lc
[I_MENU_ENTERPASSWORD
]))) do
2854 Name
:= 'mClientPasswordMenu';
2855 with AddEdit(_lc
[I_NET_SERVER_PASSWORD
]) do
2863 AddButton(@ProcEnterPassword
, _lc
[I_MENU_START_GAME
]);
2866 Menu
.DefControl
:= 'mClientPasswordMenu';
2867 g_GUI_AddWindow(Menu
);
2869 Menu
:= TGUIWindow
.Create('GameSetGameMenu');
2870 with TGUIMenu(Menu
.AddChild(TGUIMenu
.Create(gMenuFont
, gMenuSmallFont
, _lc
[I_MENU_SET_GAME
]))) do
2872 Name
:= 'mGameSetGameMenu';
2873 with AddSwitch(_lc
[I_MENU_TEAM_DAMAGE
]) do
2875 Name
:= 'swTeamDamage';
2876 AddItem(_lc
[I_MENU_YES
]);
2877 AddItem(_lc
[I_MENU_NO
]);
2880 with AddEdit(_lc
[I_MENU_TIME_LIMIT
]) do
2882 Name
:= 'edTimeLimit';
2887 with AddEdit(_lc
[I_MENU_GOAL_LIMIT
]) do
2889 Name
:= 'edGoalLimit';
2894 with AddEdit(_lc
[I_MENU_MAX_LIVES
]) do
2896 Name
:= 'edMaxLives';
2901 with AddSwitch(_lc
[I_MENU_BOTS_VS
]) do
2904 AddItem(_lc
[I_MENU_BOTS_VS_PLAYERS
]);
2905 AddItem(_lc
[I_MENU_BOTS_VS_MONSTERS
]);
2906 AddItem(_lc
[I_MENU_BOTS_VS_ALL
]);
2912 Menu
.DefControl
:= 'mGameSetGameMenu';
2913 Menu
.OnClose
:= ProcApplyGameSet
;
2914 g_GUI_AddWindow(Menu
);
2916 Menu
:= TGUIWindow
.Create('TeamMenu');
2917 with TGUIMainMenu(Menu
.AddChild(TGUIMainMenu
.Create(gMenuFont
, _lc
[I_MENU_CHANGE_PLAYERS
]))) do
2919 Name
:= 'mmTeamMenu';
2920 AddButton(@ProcJoinRed
, _lc
[I_MENU_JOIN_RED
], '').Name
:= 'tmJoinRed';
2921 AddButton(@ProcJoinBlue
, _lc
[I_MENU_JOIN_BLUE
], '').Name
:= 'tmJoinBlue';
2922 AddButton(@ProcJoinGame
, _lc
[I_MENU_JOIN_GAME
], '').Name
:= 'tmJoinGame';
2923 AddButton(@ProcSwitchP2
, _lc
[I_MENU_ADD_PLAYER_2
], '').Name
:= 'tmPlayer2';
2924 AddButton(@ProcSpectate
, _lc
[I_MENU_SPECTATE
], '').Name
:= 'tmSpectate';
2926 Menu
.DefControl
:= 'mmTeamMenu';
2927 Menu
.OnShow
:= ProcChangePlayers
;
2928 g_GUI_AddWindow(Menu
);
2931 procedure g_Menu_Show_SaveMenu();
2933 if g_Game_IsTestMap
then
2935 if gGameSettings
.GameType
= GT_SINGLE
then
2936 g_GUI_ShowWindow('GameSingleMenu')
2939 if g_Game_IsClient
then
2942 if g_Game_IsNet
then
2945 g_GUI_ShowWindow('GameCustomMenu');
2947 g_GUI_ShowWindow('SaveMenu');
2948 g_Sound_PlayEx('MENU_OPEN');
2951 procedure g_Menu_Show_LoadMenu();
2953 if gGameSettings
.GameType
= GT_SINGLE
then
2954 g_GUI_ShowWindow('GameSingleMenu')
2957 if g_Game_IsClient
then
2960 if g_Game_IsNet
then
2963 g_GUI_ShowWindow('GameCustomMenu');
2965 g_GUI_ShowWindow('LoadMenu');
2966 g_Sound_PlayEx('MENU_OPEN');
2969 procedure g_Menu_Show_GameSetGame();
2971 if gGameSettings
.GameType
= GT_SINGLE
then
2972 g_GUI_ShowWindow('GameSingleMenu')
2975 if g_Game_IsClient
then
2978 if g_Game_IsNet
then
2979 g_GUI_ShowWindow('GameServerMenu')
2981 g_GUI_ShowWindow('GameCustomMenu');
2984 g_GUI_ShowWindow('GameSetGameMenu');
2985 g_Sound_PlayEx('MENU_OPEN');
2988 procedure g_Menu_Show_OptionsVideo();
2990 if gGameSettings
.GameType
= GT_SINGLE
then
2991 g_GUI_ShowWindow('GameSingleMenu')
2994 if g_Game_IsClient
then
2995 g_GUI_ShowWindow('GameClientMenu')
2997 if g_Game_IsNet
then
2998 g_GUI_ShowWindow('GameServerMenu')
3000 g_GUI_ShowWindow('GameCustomMenu');
3003 g_GUI_ShowWindow('OptionsMenu');
3004 g_GUI_ShowWindow('OptionsVideoMenu');
3005 g_Sound_PlayEx('MENU_OPEN');
3008 procedure g_Menu_Show_OptionsSound();
3010 if gGameSettings
.GameType
= GT_SINGLE
then
3011 g_GUI_ShowWindow('GameSingleMenu')
3014 if g_Game_IsClient
then
3015 g_GUI_ShowWindow('GameClientMenu')
3017 if g_Game_IsNet
then
3018 g_GUI_ShowWindow('GameServerMenu')
3020 g_GUI_ShowWindow('GameCustomMenu');
3023 g_GUI_ShowWindow('OptionsMenu');
3024 g_GUI_ShowWindow('OptionsSoundMenu');
3025 g_Sound_PlayEx('MENU_OPEN');
3028 procedure g_Menu_Show_EndGameMenu();
3030 g_GUI_ShowWindow('EndGameMenu');
3031 g_Sound_PlayEx('MENU_OPEN');
3034 procedure g_Menu_Show_QuitGameMenu();
3036 g_GUI_ShowWindow('ExitMenu');
3037 g_Sound_PlayEx('MENU_OPEN');
3040 procedure g_Menu_Init();
3047 procedure g_Menu_Free();
3051 e_WriteLog('Releasing menu data...', MSG_NOTIFY
);
3056 procedure g_Menu_Reset();
3060 g_GUI_SaveMenuPos();
3061 ex
:= g_GUI_Destroy();
3065 e_WriteLog('Recreating menu...', MSG_NOTIFY
);
3070 g_Game_SetDebugMode();
3072 g_GUI_LoadMenuPos();