9 TPlayerControl
= record
21 TGameControls
= record
29 GameControls
: TGameControls
;
30 P1Control
: TPlayerControl
;
31 P2Control
: TPlayerControl
;
34 procedure g_Options_SetDefault();
35 procedure g_Options_Read(FileName
: String);
36 procedure g_Options_Write(FileName
: String);
37 procedure g_Options_Write_Language(FileName
: String);
38 procedure g_Options_Write_Video(FileName
: String);
39 procedure g_Options_Write_Gameplay_Custom(FileName
: String);
40 procedure g_Options_Write_Gameplay_Net(FileName
: String);
41 procedure g_Options_Write_Net_Server(FileName
: String);
42 procedure g_Options_Write_Net_Client(FileName
: String);
45 gGameControls
: TControls
;
46 gScreenWidth
: Word = 800;
47 gScreenHeight
: Word = 600;
48 gWinRealPosX
: Integer = 0;
49 gWinRealPosY
: Integer = 0;
52 gFullscreen
: Boolean = False;
53 gWinMaximized
: Boolean = False;
54 gVSync
: Boolean = False;
55 glLegacyNPOT
: Boolean = False;
56 gTextureFilter
: Boolean = True;
57 gNoSound
: Boolean = False;
58 gSoundLevel
: Byte = 75;
59 gMusicLevel
: Byte = 65;
60 gMaxSimSounds
: Byte = 8;
61 gMuteWhenInactive
: Boolean = False;
62 gAdvCorpses
: Boolean = True;
63 gAdvBlood
: Boolean = True;
64 gAdvGibs
: Boolean = True;
65 gGibsCount
: Integer = 32;
66 gBloodCount
: Byte = 3;
68 gDrawBackGround
: Boolean = True;
69 gShowMessages
: Boolean = True;
70 gRevertPlayers
: Boolean = False;
71 gLanguage
: String = LANGUAGE_ENGLISH
;
72 gAskLanguage
: Boolean = True;
74 gcGameMode
: String = '';
75 gcTimeLimit
: Word = 0;
76 gcGoalLimit
: Word = 0;
79 gcTeamDamage
: Boolean = False;
80 gcAllowExit
: Boolean = True;
81 gcWeaponStay
: Boolean = False;
82 gcMonsters
: Boolean = False;
83 gcBotsVS
: String = 'Everybody';
85 gnGameMode
: String = '';
86 gnTimeLimit
: Word = 0;
87 gnGoalLimit
: Word = 0;
90 gnTeamDamage
: Boolean = False;
91 gnAllowExit
: Boolean = True;
92 gnWeaponStay
: Boolean = False;
93 gnMonsters
: Boolean = False;
94 gnBotsVS
: String = 'Everybody';
99 e_log
, e_input
, g_window
, g_sound
, g_gfx
, g_player
, Math
,
100 g_map
, g_net
, g_netmaster
, SysUtils
, CONFIG
, g_game
, g_main
, e_textures
,
103 procedure g_Options_SetDefault();
107 g_Sound_SetupAllVolumes(75, 65);
109 gMuteWhenInactive
:= False;
110 gAnnouncer
:= ANNOUNCE_MEPLUS
;
111 gSoundEffectsDF
:= True;
114 g_Corpses_SetMax(20);
115 g_Shells_SetMax(300);
122 gDrawBackGround
:= True;
123 gShowMessages
:= True;
124 gRevertPlayers
:= False;
126 for i
:= 0 to e_MaxJoys
-1 do
127 e_JoystickDeadzones
[i
] := 8192;
129 with gGameControls
.GameControls
do
131 TakeScreenshot
:= 183;
134 TeamChat
:= 21; // [Y]
137 with gGameControls
.P1Control
do
150 with gGameControls
.P2Control
do
163 with gPlayer1Settings
do
166 Model
:= STD_PLAYER_MODEL
;
167 Color
.R
:= PLAYER1_DEF_COLOR
.R
;
168 Color
.G
:= PLAYER1_DEF_COLOR
.G
;
169 Color
.B
:= PLAYER1_DEF_COLOR
.B
;
173 with gPlayer2Settings
do
176 Model
:= STD_PLAYER_MODEL
;
177 Color
.R
:= PLAYER2_DEF_COLOR
.R
;
178 Color
.G
:= PLAYER2_DEF_COLOR
.G
;
179 Color
.B
:= PLAYER2_DEF_COLOR
.B
;
183 NetUseMaster
:= True;
184 g_Net_Slist_Set('mpms.doom2d.org', 25665);
187 procedure g_Options_Read(FileName
: String);
193 gAskLanguage
:= True;
194 e_WriteLog('Reading config', MSG_NOTIFY
);
196 if not FileExists(FileName
) then
198 e_WriteLog('Config file '+FileName
+' not found', MSG_WARNING
);
199 g_Options_SetDefault();
201 // Default video options:
203 gScreenHeight
:= 600;
206 gWinMaximized
:= False;
207 gFullScreen
:= False;
210 gTextureFilter
:= True;
211 glLegacyNPOT
:= False;
216 config
:= TConfig
.CreateFile(FileName
);
218 gScreenWidth
:= config
.ReadInt('Video', 'ScreenWidth', 800);
219 if gScreenWidth
< 640 then
221 gScreenHeight
:= config
.ReadInt('Video', 'ScreenHeight', 600);
222 if gScreenHeight
< 480 then
223 gScreenHeight
:= 480;
224 gWinRealPosX
:= config
.ReadInt('Video', 'WinPosX', 0);
225 if gWinRealPosX
< 0 then
227 gWinRealPosY
:= config
.ReadInt('Video', 'WinPosY', 0);
228 if gWinRealPosY
< 0 then
230 gFullScreen
:= config
.ReadBool('Video', 'Fullscreen', False);
231 gWinMaximized
:= config
.ReadBool('Video', 'Maximized', False);
232 gBPP
:= config
.ReadInt('Video', 'BPP', 32);
233 gFreq
:= config
.ReadInt('Video', 'Freq', 0);
234 gVSync
:= config
.ReadBool('Video', 'VSync', True);
235 gTextureFilter
:= config
.ReadBool('Video', 'TextureFilter', True);
236 glLegacyNPOT
:= config
.ReadBool('Video', 'LegacyCompatible', False);
238 gNoSound
:= config
.ReadBool('Sound', 'NoSound', False);
239 gSoundLevel
:= Min(config
.ReadInt('Sound', 'SoundLevel', 75), 255);
240 gMusicLevel
:= Min(config
.ReadInt('Sound', 'MusicLevel', 65), 255);
241 gMaxSimSounds
:= Max(Min(config
.ReadInt('Sound', 'MaxSimSounds', 8), 66), 2);
242 gMuteWhenInactive
:= config
.ReadBool('Sound', 'MuteInactive', False);
243 gAnnouncer
:= Min(Max(config
.ReadInt('Sound', 'Announcer', ANNOUNCE_MEPLUS
), ANNOUNCE_NONE
), ANNOUNCE_ALL
);
244 gSoundEffectsDF
:= config
.ReadBool('Sound', 'SoundEffectsDF', True);
246 with gGameControls
.GameControls
do
248 TakeScreenshot
:= config
.ReadInt('GameControls', 'TakeScreenshot', 183);
249 Stat
:= config
.ReadInt('GameControls', 'Stat', 15);
250 Chat
:= config
.ReadInt('GameControls', 'Chat', 20);
251 TeamChat
:= config
.ReadInt('GameControls', 'TeamChat', 21);
254 with gGameControls
.P1Control
, config
do
256 KeyRight
:= ReadInt('Player1', 'KeyRight', 33);
257 KeyLeft
:= ReadInt('Player1', 'KeyLeft', 31);
258 KeyUp
:= ReadInt('Player1', 'KeyUp', 18);
259 KeyDown
:= ReadInt('Player1', 'KeyDown', 32);
260 KeyFire
:= ReadInt('Player1', 'KeyFire', 30);
261 KeyJump
:= ReadInt('Player1', 'KeyJump', 16);
262 KeyNextWeapon
:= ReadInt('Player1', 'KeyNextWeapon', 19);
263 KeyPrevWeapon
:= ReadInt('Player1', 'KeyPrevWeapon', 17);
264 KeyOpen
:= ReadInt('Player1', 'KeyOpen', 58);
267 with gPlayer1Settings
, config
do
269 Name
:= ReadStr('Player1', 'name', 'Player1');
270 Model
:= ReadStr('Player1', 'model', STD_PLAYER_MODEL
);
271 Color
.R
:= Min(Abs(ReadInt('Player1', 'red', PLAYER1_DEF_COLOR
.R
)), 255);
272 Color
.G
:= Min(Abs(ReadInt('Player1', 'green', PLAYER1_DEF_COLOR
.G
)), 255);
273 Color
.B
:= Min(Abs(ReadInt('Player1', 'blue', PLAYER1_DEF_COLOR
.B
)), 255);
274 Team
:= ReadInt('Player1', 'team', TEAM_RED
);
275 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
279 with gGameControls
.P2Control
, config
do
281 KeyRight
:= ReadInt('Player2', 'KeyRight', 205);
282 KeyLeft
:= ReadInt('Player2', 'KeyLeft', 203);
283 KeyUp
:= ReadInt('Player2', 'KeyUp', 200);
284 KeyDown
:= ReadInt('Player2', 'KeyDown', 208);
285 KeyFire
:= ReadInt('Player2', 'KeyFire', 184);
286 KeyJump
:= ReadInt('Player2', 'KeyJump', 157);
287 KeyNextWeapon
:= ReadInt('Player2', 'KeyNextWeapon', 73);
288 KeyPrevWeapon
:= ReadInt('Player2', 'KeyPrevWeapon', 71);
289 KeyOpen
:= ReadInt('Player2', 'KeyOpen', 54);
292 with gPlayer2Settings
, config
do
294 Name
:= ReadStr('Player2', 'name', 'Player2');
295 Model
:= ReadStr('Player2', 'model', STD_PLAYER_MODEL
);
296 Color
.R
:= Min(Abs(ReadInt('Player2', 'red', PLAYER2_DEF_COLOR
.R
)), 255);
297 Color
.G
:= Min(Abs(ReadInt('Player2', 'green', PLAYER2_DEF_COLOR
.G
)), 255);
298 Color
.B
:= Min(Abs(ReadInt('Player2', 'blue', PLAYER2_DEF_COLOR
.B
)), 255);
299 Team
:= ReadInt('Player2', 'team', TEAM_BLUE
);
300 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
304 for i
:= 0 to e_MaxJoys
-1 do
305 e_JoystickDeadzones
[i
] := config
.ReadInt('Joysticks', 'Deadzone' + IntToStr(i
), 8192);
307 g_GFX_SetMax(Min(config
.ReadInt('Game', 'MaxParticles', 1000), 50000));
308 g_Shells_SetMax(Min(config
.ReadInt('Game', 'MaxShells', 300), 600));
309 g_Gibs_SetMax(Min(config
.ReadInt('Game', 'MaxGibs', 150), 500));
310 g_Corpses_SetMax(Min(config
.ReadInt('Game', 'MaxCorpses', 20), 100));
312 case config
.ReadInt('Game', 'GibsCount', 3) of
317 else gGibsCount
:= 48;
320 ITEM_RESPAWNTIME
:= 36*Max(config
.ReadInt('Game', 'ItemRespawnTime', 60), 0);
321 gBloodCount
:= Min(config
.ReadInt('Game', 'BloodCount', 4), 4);
322 gAdvBlood
:= config
.ReadBool('Game', 'AdvancesBlood', True);
323 gAdvCorpses
:= config
.ReadBool('Game', 'AdvancesCorpses', True);
324 gAdvGibs
:= config
.ReadBool('Game', 'AdvancesGibs', True);
325 gFlash
:= Min(Max(config
.ReadInt('Game', 'Flash', 1), 0), 2);
326 gDrawBackGround
:= config
.ReadBool('Game', 'BackGround', True);
327 gShowMessages
:= config
.ReadBool('Game', 'Messages', True);
328 gRevertPlayers
:= config
.ReadBool('Game', 'RevertPlayers', False);
329 gChatBubble
:= Min(Max(config
.ReadInt('Game', 'ChatBubble', 4), 0), 4);
331 // Ãåéìïëåé â ñâîåé èãðå
332 gcMap
:= config
.ReadStr('GameplayCustom', 'Map', '');
333 gcGameMode
:= config
.ReadStr('GameplayCustom', 'GameMode', _lc
[I_MENU_GAME_TYPE_DM
]);
334 gcTimeLimit
:= Min(Max(config
.ReadInt('GameplayCustom', 'TimeLimit', 0), 0), 65535);
335 gcGoalLimit
:= Min(Max(config
.ReadInt('GameplayCustom', 'GoalLimit', 0), 0), 65535);
336 gcMaxLives
:= Min(Max(config
.ReadInt('GameplayCustom', 'MaxLives', 0), 0), 255);
337 gcPlayers
:= Min(Max(config
.ReadInt('GameplayCustom', 'Players', 1), 0), 2);
338 gcTeamDamage
:= config
.ReadBool('GameplayCustom', 'TeamDamage', False);
339 gcAllowExit
:= config
.ReadBool('GameplayCustom', 'AllowExit', True);
340 gcWeaponStay
:= config
.ReadBool('GameplayCustom', 'WeaponStay', False);
341 gcMonsters
:= config
.ReadBool('GameplayCustom', 'Monsters', False);
342 gcBotsVS
:= config
.ReadStr('GameplayCustom', 'BotsVS', 'Everybody');
344 with gGameSettings
do
346 GameMode
:= g_Game_TextToMode(gcGameMode
);
347 if GameMode
= GM_NONE
then
349 if GameMode
= GM_SINGLE
then
351 TimeLimit
:= gcTimeLimit
;
352 GoalLimit
:= gcGoalLimit
;
353 MaxLives
:= gcMaxLives
;
357 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
359 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
361 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
363 Options
:= Options
or GAME_OPTION_MONSTERS
;
364 if gcBotsVS
= 'Everybody' then
365 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
366 if gcBotsVS
= 'Players' then
367 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
368 if gcBotsVS
= 'Monsters' then
369 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
372 // Ãåéìïëåé â ñåòåâîé èãðå
373 gnMap
:= config
.ReadStr('GameplayNetwork', 'Map', '');
374 gnGameMode
:= config
.ReadStr('GameplayNetwork', 'GameMode', _lc
[I_MENU_GAME_TYPE_DM
]);
375 gnTimeLimit
:= Min(Max(config
.ReadInt('GameplayNetwork', 'TimeLimit', 0), 0), 65535);
376 gnGoalLimit
:= Min(Max(config
.ReadInt('GameplayNetwork', 'GoalLimit', 0), 0), 65535);
377 gnMaxLives
:= Min(Max(config
.ReadInt('GameplayNetwork', 'MaxLives', 0), 0), 255);
378 gnPlayers
:= Min(Max(config
.ReadInt('GameplayNetwork', 'Players', 1), 0), 2);
379 gnTeamDamage
:= config
.ReadBool('GameplayNetwork', 'TeamDamage', False);
380 gnAllowExit
:= config
.ReadBool('GameplayNetwork', 'AllowExit', True);
381 gnWeaponStay
:= config
.ReadBool('GameplayNetwork', 'WeaponStay', False);
382 gnMonsters
:= config
.ReadBool('GameplayNetwork', 'Monsters', False);
383 gnBotsVS
:= config
.ReadStr('GameplayNetwork', 'BotsVS', 'Everybody');
385 // Îáùèå ñåòåâûå
386 NetSlistIP
:= config
.ReadStr('MasterServer', 'IP', 'mpms.doom2d.org');
387 NetSlistPort
:= config
.ReadInt('MasterServer', 'Port', 25665);
390 NetServerName
:= config
.ReadStr('Server', 'Name', 'Unnamed Server');
391 NetPassword
:= config
.ReadStr('Server', 'Password', '');
392 NetPort
:= Min(Max(0, config
.ReadInt('Server', 'Port', 25666)), 65535);
393 NetMaxClients
:= Min(Max(0, config
.ReadInt('Server', 'MaxClients', 16)), NET_MAXCLIENTS
);
394 NetAllowRCON
:= config
.ReadBool('Server', 'RCON', False);
395 NetRCONPassword
:= config
.ReadStr('Server', 'RCONPassword', 'default');
396 NetUseMaster
:= config
.ReadBool('Server', 'SyncWithMaster', True);
397 NetUpdateRate
:= Max(0, config
.ReadInt('Server', 'UpdateInterval', 0));
398 NetRelupdRate
:= Max(0, config
.ReadInt('Server', 'ReliableUpdateInterval', 18));
399 NetMasterRate
:= Max(1, config
.ReadInt('Server', 'MasterSyncInterval', 60000));
402 NetInterpLevel
:= Max(0, config
.ReadInt('Client', 'InterpolationSteps', 2));
403 NetForcePlayerUpdate
:= config
.ReadBool('Client', 'ForcePlayerUpdate', False);
404 NetPredictSelf
:= config
.ReadBool('Client', 'PredictSelf', True);
405 NetClientIP
:= config
.ReadStr('Client', 'LastIP', '127.0.0.1');
406 NetClientPort
:= Max(0, config
.ReadInt('Client', 'LastPort', 25666));
409 str
:= config
.ReadStr('Game', 'Language', '');
410 if (str
= LANGUAGE_RUSSIAN
) or
411 (str
= LANGUAGE_ENGLISH
) then
414 gAskLanguage
:= False;
417 gLanguage
:= LANGUAGE_ENGLISH
;
421 if gTextureFilter
then
422 TEXTUREFILTER
:= GL_LINEAR
424 TEXTUREFILTER
:= GL_NEAREST
;
427 procedure g_Options_Write(FileName
: String);
432 e_WriteLog('Writing config', MSG_NOTIFY
);
434 config
:= TConfig
.CreateFile(FileName
);
436 config
.WriteInt('Video', 'ScreenWidth', gScreenWidth
);
437 config
.WriteInt('Video', 'ScreenHeight', gScreenHeight
);
438 config
.WriteInt('Video', 'WinPosX', gWinRealPosX
);
439 config
.WriteInt('Video', 'WinPosY', gWinRealPosY
);
440 config
.WriteBool('Video', 'Fullscreen', gFullScreen
);
441 config
.WriteBool('Video', 'Maximized', gWinMaximized
);
442 config
.WriteInt('Video', 'BPP', gBPP
);
443 config
.WriteBool('Video', 'VSync', gVSync
);
444 config
.WriteBool('Video', 'TextureFilter', gTextureFilter
);
445 config
.WriteBool('Video', 'LegacyCompatible', glLegacyNPOT
);
447 config
.WriteBool('Sound', 'NoSound', gNoSound
);
448 config
.WriteInt('Sound', 'SoundLevel', gSoundLevel
);
449 config
.WriteInt('Sound', 'MusicLevel', gMusicLevel
);
450 config
.WriteInt('Sound', 'MaxSimSounds', gMaxSimSounds
);
451 config
.WriteBool('Sound', 'MuteInactive', gMuteWhenInactive
);
452 config
.WriteInt('Sound', 'Announcer', gAnnouncer
);
453 config
.WriteBool('Sound', 'SoundEffectsDF', gSoundEffectsDF
);
455 with config
, gGameControls
.GameControls
do
457 WriteInt('GameControls', 'TakeScreenshot', TakeScreenshot
);
458 WriteInt('GameControls', 'Stat', Stat
);
459 WriteInt('GameControls', 'Chat', Chat
);
460 WriteInt('GameControls', 'TeamChat', TeamChat
);
463 with config
, gGameControls
.P1Control
, gPlayer1Settings
do
465 WriteInt('Player1', 'KeyRight', KeyRight
);
466 WriteInt('Player1', 'KeyLeft', KeyLeft
);
467 WriteInt('Player1', 'KeyUp', KeyUp
);
468 WriteInt('Player1', 'KeyDown', KeyDown
);
469 WriteInt('Player1', 'KeyFire', KeyFire
);
470 WriteInt('Player1', 'KeyJump', KeyJump
);
471 WriteInt('Player1', 'KeyNextWeapon', KeyNextWeapon
);
472 WriteInt('Player1', 'KeyPrevWeapon', KeyPrevWeapon
);
473 WriteInt('Player1', 'KeyOpen', KeyOpen
);
475 WriteStr('Player1', 'Name', Name
);
476 WriteStr('Player1', 'model', Model
);
477 WriteInt('Player1', 'red', Color
.R
);
478 WriteInt('Player1', 'green', Color
.G
);
479 WriteInt('Player1', 'blue', Color
.B
);
480 WriteInt('Player1', 'team', Team
);
483 with config
, gGameControls
.P2Control
, gPlayer2Settings
do
485 WriteInt('Player2', 'KeyRight', KeyRight
);
486 WriteInt('Player2', 'KeyLeft', KeyLeft
);
487 WriteInt('Player2', 'KeyUp', KeyUp
);
488 WriteInt('Player2', 'KeyDown', KeyDown
);
489 WriteInt('Player2', 'KeyFire', KeyFire
);
490 WriteInt('Player2', 'KeyJump', KeyJump
);
491 WriteInt('Player2', 'KeyNextWeapon', KeyNextWeapon
);
492 WriteInt('Player2', 'KeyPrevWeapon', KeyPrevWeapon
);
493 WriteInt('Player2', 'KeyOpen', KeyOpen
);
495 WriteStr('Player2', 'Name', Name
);
496 WriteStr('Player2', 'model', Model
);
497 WriteInt('Player2', 'red', Color
.R
);
498 WriteInt('Player2', 'green', Color
.G
);
499 WriteInt('Player2', 'blue', Color
.B
);
500 WriteInt('Player2', 'team', Team
);
503 for i
:= 0 to e_MaxJoys
-1 do
504 config
.WriteInt('Joysticks', 'Deadzone' + IntToStr(i
), e_JoystickDeadzones
[i
]);
508 0: config
.WriteInt('Game', 'GibsCount', 0);
509 8: config
.WriteInt('Game', 'GibsCount', 1);
510 16: config
.WriteInt('Game', 'GibsCount', 2);
511 32: config
.WriteInt('Game', 'GibsCount', 3);
512 else config
.WriteInt('Game', 'GibsCount', 4);
515 config
.WriteInt('Game', 'ItemRespawnTime', ITEM_RESPAWNTIME
div 36);
516 config
.WriteInt('Game', 'MaxParticles', g_GFX_GetMax());
517 config
.WriteInt('Game', 'MaxShells', g_Shells_GetMax());
518 config
.WriteInt('Game', 'MaxGibs', g_Gibs_GetMax());
519 config
.WriteInt('Game', 'MaxCorpses', g_Corpses_GetMax());
520 config
.WriteInt('Game', 'BloodCount', gBloodCount
);
521 config
.WriteBool('Game', 'AdvancesBlood', gAdvBlood
);
522 config
.WriteBool('Game', 'AdvancesCorpses', gAdvCorpses
);
523 config
.WriteBool('Game', 'AdvancesGibs', gAdvGibs
);
524 config
.WriteInt('Game', 'Flash', gFlash
);
525 config
.WriteBool('Game', 'BackGround', gDrawBackGround
);
526 config
.WriteBool('Game', 'Messages', gShowMessages
);
527 config
.WriteBool('Game', 'RevertPlayers', gRevertPlayers
);
528 config
.WriteInt('Game', 'ChatBubble', gChatBubble
);
530 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
531 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
532 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
533 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
534 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
535 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
536 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
537 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
538 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
539 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
540 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
542 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
543 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
544 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
545 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
546 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
547 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
548 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
549 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
550 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
551 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
552 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
554 config
.WriteStr('MasterServer', 'IP', NetSlistIP
);
555 config
.WriteInt('MasterServer', 'Port', NetSlistPort
);
557 config
.WriteStr ('Server', 'Name', NetServerName
);
558 config
.WriteStr ('Server', 'Password', NetPassword
);
559 config
.WriteInt ('Server', 'Port', NetPort
);
560 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
561 config
.WriteBool('Server', 'RCON', NetAllowRCON
);
562 config
.WriteStr ('Server', 'RCONPassword', NetRCONPassword
);
563 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
564 config
.WriteInt ('Server', 'UpdateInterval', NetUpdateRate
);
565 config
.WriteInt ('Server', 'ReliableUpdateInterval', NetRelupdRate
);
566 config
.WriteInt ('Server', 'MasterSyncInterval', NetMasterRate
);
568 config
.WriteInt ('Client', 'InterpolationSteps', NetInterpLevel
);
569 config
.WriteBool ('Client', 'ForcePlayerUpdate', NetForcePlayerUpdate
);
570 config
.WriteBool ('Client', 'PredictSelf', NetPredictSelf
);
571 config
.WriteStr ('Client', 'LastIP', NetClientIP
);
572 config
.WriteInt ('Client', 'LastPort', NetClientPort
);
574 config
.SaveFile(FileName
);
578 procedure g_Options_Write_Language(FileName
: String);
582 e_WriteLog('Writing language config', MSG_NOTIFY
);
584 config
:= TConfig
.CreateFile(FileName
);
585 config
.WriteStr('Game', 'Language', gLanguage
);
586 config
.SaveFile(FileName
);
590 procedure g_Options_Write_Video(FileName
: String);
595 e_WriteLog('Writing resolution to config', MSG_NOTIFY
);
597 config
:= TConfig
.CreateFile(FileName
);
599 if gWinMaximized
and (not gFullscreen
) then
610 config
.WriteInt('Video', 'ScreenWidth', sW
);
611 config
.WriteInt('Video', 'ScreenHeight', sH
);
612 config
.WriteInt('Video', 'WinPosX', gWinRealPosX
);
613 config
.WriteInt('Video', 'WinPosY', gWinRealPosY
);
614 config
.WriteBool('Video', 'Fullscreen', gFullscreen
);
615 config
.WriteBool('Video', 'Maximized', gWinMaximized
);
617 config
.SaveFile(FileName
);
621 procedure g_Options_Write_Gameplay_Custom(FileName
: String);
625 e_WriteLog('Writing custom gameplay config', MSG_NOTIFY
);
627 config
:= TConfig
.CreateFile(FileName
);
629 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
630 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
631 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
632 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
633 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
634 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
635 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
636 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
637 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
638 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
639 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
641 config
.SaveFile(FileName
);
645 procedure g_Options_Write_Gameplay_Net(FileName
: String);
649 e_WriteLog('Writing network gameplay config', MSG_NOTIFY
);
651 config
:= TConfig
.CreateFile(FileName
);
653 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
654 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
655 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
656 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
657 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
658 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
659 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
660 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
661 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
662 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
663 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
665 config
.SaveFile(FileName
);
669 procedure g_Options_Write_Net_Server(FileName
: String);
673 e_WriteLog('Writing server config', MSG_NOTIFY
);
675 config
:= TConfig
.CreateFile(FileName
);
677 config
.WriteStr ('Server', 'Name', NetServerName
);
678 config
.WriteStr ('Server', 'Password', NetPassword
);
679 config
.WriteInt ('Server', 'Port', NetPort
);
680 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
681 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
683 config
.SaveFile(FileName
);
687 procedure g_Options_Write_Net_Client(FileName
: String);
691 e_WriteLog('Writing client config', MSG_NOTIFY
);
693 config
:= TConfig
.CreateFile(FileName
);
695 config
.WriteStr('Client', 'LastIP', NetClientIP
);
696 config
.WriteInt('Client', 'LastPort', NetClientPort
);
698 config
.SaveFile(FileName
);