574a28beeaae652ca11f4076aa674d2de57585c4
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 gTextureFilter
: Boolean = True;
56 gNoSound
: Boolean = False;
57 gSoundLevel
: Byte = 75;
58 gMusicLevel
: Byte = 65;
59 gMaxSimSounds
: Byte = 8;
60 gMuteWhenInactive
: Boolean = False;
61 gAdvCorpses
: Boolean = True;
62 gAdvBlood
: Boolean = True;
63 gAdvGibs
: Boolean = True;
64 gGibsCount
: Integer = 32;
65 gBloodCount
: Byte = 3;
67 gDrawBackGround
: Boolean = True;
68 gShowMessages
: Boolean = True;
69 gRevertPlayers
: Boolean = False;
70 gLanguage
: String = LANGUAGE_ENGLISH
;
71 gAskLanguage
: Boolean = True;
73 gcGameMode
: String = '';
74 gcTimeLimit
: Word = 0;
75 gcGoalLimit
: Word = 0;
78 gcTeamDamage
: Boolean = False;
79 gcAllowExit
: Boolean = True;
80 gcWeaponStay
: Boolean = False;
81 gcMonsters
: Boolean = False;
82 gcBotsVS
: String = 'Everybody';
84 gnGameMode
: String = '';
85 gnTimeLimit
: Word = 0;
86 gnGoalLimit
: Word = 0;
89 gnTeamDamage
: Boolean = False;
90 gnAllowExit
: Boolean = True;
91 gnWeaponStay
: Boolean = False;
92 gnMonsters
: Boolean = False;
93 gnBotsVS
: String = 'Everybody';
98 e_log
, e_input
, g_window
, g_sound
, g_gfx
, g_player
, Math
,
99 g_map
, g_net
, g_netmaster
, SysUtils
, CONFIG
, g_game
, g_main
, e_textures
,
102 procedure g_Options_SetDefault();
106 g_Sound_SetupAllVolumes(75, 65);
108 gMuteWhenInactive
:= False;
109 gAnnouncer
:= ANNOUNCE_MEPLUS
;
110 gSoundEffectsDF
:= True;
113 g_Corpses_SetMax(20);
114 g_Shells_SetMax(300);
121 gDrawBackGround
:= True;
122 gShowMessages
:= True;
123 gRevertPlayers
:= False;
125 for i
:= 0 to e_MaxJoys
-1 do
126 e_JoystickDeadzones
[i
] := 8192;
128 with gGameControls
.GameControls
do
130 TakeScreenshot
:= 183;
133 TeamChat
:= 21; // [Y]
136 with gGameControls
.P1Control
do
149 with gGameControls
.P2Control
do
162 with gPlayer1Settings
do
165 Model
:= STD_PLAYER_MODEL
;
166 Color
.R
:= PLAYER1_DEF_COLOR
.R
;
167 Color
.G
:= PLAYER1_DEF_COLOR
.G
;
168 Color
.B
:= PLAYER1_DEF_COLOR
.B
;
172 with gPlayer2Settings
do
175 Model
:= STD_PLAYER_MODEL
;
176 Color
.R
:= PLAYER2_DEF_COLOR
.R
;
177 Color
.G
:= PLAYER2_DEF_COLOR
.G
;
178 Color
.B
:= PLAYER2_DEF_COLOR
.B
;
182 NetUseMaster
:= True;
183 g_Net_Slist_Set('mpms.doom2d.org', 25665);
186 procedure g_Options_Read(FileName
: String);
192 gAskLanguage
:= True;
193 e_WriteLog('Reading config', MSG_NOTIFY
);
195 if not FileExists(FileName
) then
197 e_WriteLog('Config file '+FileName
+' not found', MSG_WARNING
);
198 g_Options_SetDefault();
200 // Default video options:
202 gScreenHeight
:= 600;
205 gWinMaximized
:= False;
206 gFullScreen
:= False;
209 gTextureFilter
:= True;
210 fUseMipmaps
:= False;
215 config
:= TConfig
.CreateFile(FileName
);
217 gScreenWidth
:= config
.ReadInt('Video', 'ScreenWidth', 800);
218 if gScreenWidth
< 640 then
220 gScreenHeight
:= config
.ReadInt('Video', 'ScreenHeight', 600);
221 if gScreenHeight
< 480 then
222 gScreenHeight
:= 480;
223 gWinRealPosX
:= config
.ReadInt('Video', 'WinPosX', 0);
224 if gWinRealPosX
< 0 then
226 gWinRealPosY
:= config
.ReadInt('Video', 'WinPosY', 0);
227 if gWinRealPosY
< 0 then
229 gFullScreen
:= config
.ReadBool('Video', 'Fullscreen', False);
230 gWinMaximized
:= config
.ReadBool('Video', 'Maximized', False);
231 gBPP
:= config
.ReadInt('Video', 'BPP', 32);
232 gFreq
:= config
.ReadInt('Video', 'Freq', 0);
233 gVSync
:= config
.ReadBool('Video', 'VSync', True);
234 gTextureFilter
:= config
.ReadBool('Video', 'TextureFilter', True);
235 fUseMipmaps
:= config
.ReadBool('Video', 'LegacyCompatible', False);
237 gNoSound
:= config
.ReadBool('Sound', 'NoSound', False);
238 gSoundLevel
:= Min(config
.ReadInt('Sound', 'SoundLevel', 75), 255);
239 gMusicLevel
:= Min(config
.ReadInt('Sound', 'MusicLevel', 65), 255);
240 gMaxSimSounds
:= Max(Min(config
.ReadInt('Sound', 'MaxSimSounds', 8), 66), 2);
241 gMuteWhenInactive
:= config
.ReadBool('Sound', 'MuteInactive', False);
242 gAnnouncer
:= Min(Max(config
.ReadInt('Sound', 'Announcer', ANNOUNCE_MEPLUS
), ANNOUNCE_NONE
), ANNOUNCE_ALL
);
243 gSoundEffectsDF
:= config
.ReadBool('Sound', 'SoundEffectsDF', True);
245 with gGameControls
.GameControls
do
247 TakeScreenshot
:= config
.ReadInt('GameControls', 'TakeScreenshot', 183);
248 Stat
:= config
.ReadInt('GameControls', 'Stat', 15);
249 Chat
:= config
.ReadInt('GameControls', 'Chat', 20);
250 TeamChat
:= config
.ReadInt('GameControls', 'TeamChat', 21);
253 with gGameControls
.P1Control
, config
do
255 KeyRight
:= ReadInt('Player1', 'KeyRight', 33);
256 KeyLeft
:= ReadInt('Player1', 'KeyLeft', 31);
257 KeyUp
:= ReadInt('Player1', 'KeyUp', 18);
258 KeyDown
:= ReadInt('Player1', 'KeyDown', 32);
259 KeyFire
:= ReadInt('Player1', 'KeyFire', 30);
260 KeyJump
:= ReadInt('Player1', 'KeyJump', 16);
261 KeyNextWeapon
:= ReadInt('Player1', 'KeyNextWeapon', 19);
262 KeyPrevWeapon
:= ReadInt('Player1', 'KeyPrevWeapon', 17);
263 KeyOpen
:= ReadInt('Player1', 'KeyOpen', 58);
266 with gPlayer1Settings
, config
do
268 Name
:= ReadStr('Player1', 'name', 'Player1');
269 Model
:= ReadStr('Player1', 'model', STD_PLAYER_MODEL
);
270 Color
.R
:= Min(Abs(ReadInt('Player1', 'red', PLAYER1_DEF_COLOR
.R
)), 255);
271 Color
.G
:= Min(Abs(ReadInt('Player1', 'green', PLAYER1_DEF_COLOR
.G
)), 255);
272 Color
.B
:= Min(Abs(ReadInt('Player1', 'blue', PLAYER1_DEF_COLOR
.B
)), 255);
273 Team
:= ReadInt('Player1', 'team', TEAM_RED
);
274 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
278 with gGameControls
.P2Control
, config
do
280 KeyRight
:= ReadInt('Player2', 'KeyRight', 205);
281 KeyLeft
:= ReadInt('Player2', 'KeyLeft', 203);
282 KeyUp
:= ReadInt('Player2', 'KeyUp', 200);
283 KeyDown
:= ReadInt('Player2', 'KeyDown', 208);
284 KeyFire
:= ReadInt('Player2', 'KeyFire', 184);
285 KeyJump
:= ReadInt('Player2', 'KeyJump', 157);
286 KeyNextWeapon
:= ReadInt('Player2', 'KeyNextWeapon', 73);
287 KeyPrevWeapon
:= ReadInt('Player2', 'KeyPrevWeapon', 71);
288 KeyOpen
:= ReadInt('Player2', 'KeyOpen', 54);
291 with gPlayer2Settings
, config
do
293 Name
:= ReadStr('Player2', 'name', 'Player2');
294 Model
:= ReadStr('Player2', 'model', STD_PLAYER_MODEL
);
295 Color
.R
:= Min(Abs(ReadInt('Player2', 'red', PLAYER2_DEF_COLOR
.R
)), 255);
296 Color
.G
:= Min(Abs(ReadInt('Player2', 'green', PLAYER2_DEF_COLOR
.G
)), 255);
297 Color
.B
:= Min(Abs(ReadInt('Player2', 'blue', PLAYER2_DEF_COLOR
.B
)), 255);
298 Team
:= ReadInt('Player2', 'team', TEAM_BLUE
);
299 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
303 for i
:= 0 to e_MaxJoys
-1 do
304 e_JoystickDeadzones
[i
] := config
.ReadInt('Joysticks', 'Deadzone' + IntToStr(i
), 8192);
306 g_GFX_SetMax(Min(config
.ReadInt('Game', 'MaxParticles', 1000), 50000));
307 g_Shells_SetMax(Min(config
.ReadInt('Game', 'MaxShells', 300), 600));
308 g_Gibs_SetMax(Min(config
.ReadInt('Game', 'MaxGibs', 150), 500));
309 g_Corpses_SetMax(Min(config
.ReadInt('Game', 'MaxCorpses', 20), 100));
311 case config
.ReadInt('Game', 'GibsCount', 3) of
316 else gGibsCount
:= 48;
319 ITEM_RESPAWNTIME
:= 36*Max(config
.ReadInt('Game', 'ItemRespawnTime', 60), 0);
320 gBloodCount
:= Min(config
.ReadInt('Game', 'BloodCount', 4), 4);
321 gAdvBlood
:= config
.ReadBool('Game', 'AdvancesBlood', True);
322 gAdvCorpses
:= config
.ReadBool('Game', 'AdvancesCorpses', True);
323 gAdvGibs
:= config
.ReadBool('Game', 'AdvancesGibs', True);
324 gFlash
:= Min(Max(config
.ReadInt('Game', 'Flash', 1), 0), 2);
325 gDrawBackGround
:= config
.ReadBool('Game', 'BackGround', True);
326 gShowMessages
:= config
.ReadBool('Game', 'Messages', True);
327 gRevertPlayers
:= config
.ReadBool('Game', 'RevertPlayers', False);
328 gChatBubble
:= Min(Max(config
.ReadInt('Game', 'ChatBubble', 4), 0), 4);
330 // Ãåéìïëåé â ñâîåé èãðå
331 gcMap
:= config
.ReadStr('GameplayCustom', 'Map', '');
332 gcGameMode
:= config
.ReadStr('GameplayCustom', 'GameMode', _lc
[I_MENU_GAME_TYPE_DM
]);
333 gcTimeLimit
:= Min(Max(config
.ReadInt('GameplayCustom', 'TimeLimit', 0), 0), 65535);
334 gcGoalLimit
:= Min(Max(config
.ReadInt('GameplayCustom', 'GoalLimit', 0), 0), 65535);
335 gcMaxLives
:= Min(Max(config
.ReadInt('GameplayCustom', 'MaxLives', 0), 0), 255);
336 gcPlayers
:= Min(Max(config
.ReadInt('GameplayCustom', 'Players', 1), 0), 2);
337 gcTeamDamage
:= config
.ReadBool('GameplayCustom', 'TeamDamage', False);
338 gcAllowExit
:= config
.ReadBool('GameplayCustom', 'AllowExit', True);
339 gcWeaponStay
:= config
.ReadBool('GameplayCustom', 'WeaponStay', False);
340 gcMonsters
:= config
.ReadBool('GameplayCustom', 'Monsters', False);
341 gcBotsVS
:= config
.ReadStr('GameplayCustom', 'BotsVS', 'Everybody');
343 with gGameSettings
do
345 GameMode
:= g_Game_TextToMode(gcGameMode
);
346 if GameMode
= GM_NONE
then
348 if GameMode
= GM_SINGLE
then
350 TimeLimit
:= gcTimeLimit
;
351 GoalLimit
:= gcGoalLimit
;
352 MaxLives
:= gcMaxLives
;
356 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
358 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
360 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
362 Options
:= Options
or GAME_OPTION_MONSTERS
;
363 if gcBotsVS
= 'Everybody' then
364 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
365 if gcBotsVS
= 'Players' then
366 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
367 if gcBotsVS
= 'Monsters' then
368 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
371 // Ãåéìïëåé â ñåòåâîé èãðå
372 gnMap
:= config
.ReadStr('GameplayNetwork', 'Map', '');
373 gnGameMode
:= config
.ReadStr('GameplayNetwork', 'GameMode', _lc
[I_MENU_GAME_TYPE_DM
]);
374 gnTimeLimit
:= Min(Max(config
.ReadInt('GameplayNetwork', 'TimeLimit', 0), 0), 65535);
375 gnGoalLimit
:= Min(Max(config
.ReadInt('GameplayNetwork', 'GoalLimit', 0), 0), 65535);
376 gnMaxLives
:= Min(Max(config
.ReadInt('GameplayNetwork', 'MaxLives', 0), 0), 255);
377 gnPlayers
:= Min(Max(config
.ReadInt('GameplayNetwork', 'Players', 1), 0), 2);
378 gnTeamDamage
:= config
.ReadBool('GameplayNetwork', 'TeamDamage', False);
379 gnAllowExit
:= config
.ReadBool('GameplayNetwork', 'AllowExit', True);
380 gnWeaponStay
:= config
.ReadBool('GameplayNetwork', 'WeaponStay', False);
381 gnMonsters
:= config
.ReadBool('GameplayNetwork', 'Monsters', False);
382 gnBotsVS
:= config
.ReadStr('GameplayNetwork', 'BotsVS', 'Everybody');
384 // Îáùèå ñåòåâûå
385 NetSlistIP
:= config
.ReadStr('MasterServer', 'IP', 'mpms.doom2d.org');
386 NetSlistPort
:= config
.ReadInt('MasterServer', 'Port', 25665);
389 NetServerName
:= config
.ReadStr('Server', 'Name', 'Unnamed Server');
390 NetPassword
:= config
.ReadStr('Server', 'Password', '');
391 NetPort
:= Min(Max(0, config
.ReadInt('Server', 'Port', 25666)), 65535);
392 NetMaxClients
:= Min(Max(0, config
.ReadInt('Server', 'MaxClients', 16)), NET_MAXCLIENTS
);
393 NetAllowRCON
:= config
.ReadBool('Server', 'RCON', False);
394 NetRCONPassword
:= config
.ReadStr('Server', 'RCONPassword', 'default');
395 NetUseMaster
:= config
.ReadBool('Server', 'SyncWithMaster', True);
396 NetUpdateRate
:= Max(0, config
.ReadInt('Server', 'UpdateInterval', 0));
397 NetRelupdRate
:= Max(0, config
.ReadInt('Server', 'ReliableUpdateInterval', 18));
398 NetMasterRate
:= Max(1, config
.ReadInt('Server', 'MasterSyncInterval', 60000));
401 NetInterpLevel
:= Max(0, config
.ReadInt('Client', 'InterpolationSteps', 2));
402 NetForcePlayerUpdate
:= config
.ReadBool('Client', 'ForcePlayerUpdate', False);
403 NetPredictSelf
:= config
.ReadBool('Client', 'PredictSelf', True);
404 NetClientIP
:= config
.ReadStr('Client', 'LastIP', '127.0.0.1');
405 NetClientPort
:= Max(0, config
.ReadInt('Client', 'LastPort', 25666));
408 str
:= config
.ReadStr('Game', 'Language', '');
409 if (str
= LANGUAGE_RUSSIAN
) or
410 (str
= LANGUAGE_ENGLISH
) then
413 gAskLanguage
:= False;
416 gLanguage
:= LANGUAGE_ENGLISH
;
420 if gTextureFilter
then
421 TEXTUREFILTER
:= GL_LINEAR
423 TEXTUREFILTER
:= GL_NEAREST
;
426 procedure g_Options_Write(FileName
: String);
431 e_WriteLog('Writing config', MSG_NOTIFY
);
433 config
:= TConfig
.CreateFile(FileName
);
435 config
.WriteInt('Video', 'ScreenWidth', gScreenWidth
);
436 config
.WriteInt('Video', 'ScreenHeight', gScreenHeight
);
437 config
.WriteInt('Video', 'WinPosX', gWinRealPosX
);
438 config
.WriteInt('Video', 'WinPosY', gWinRealPosY
);
439 config
.WriteBool('Video', 'Fullscreen', gFullScreen
);
440 config
.WriteBool('Video', 'Maximized', gWinMaximized
);
441 config
.WriteInt('Video', 'BPP', gBPP
);
442 config
.WriteBool('Video', 'VSync', gVSync
);
443 config
.WriteBool('Video', 'TextureFilter', gTextureFilter
);
444 config
.WriteBool('Video', 'LegacyCompatible', fUseMipmaps
);
446 config
.WriteBool('Sound', 'NoSound', gNoSound
);
447 config
.WriteInt('Sound', 'SoundLevel', gSoundLevel
);
448 config
.WriteInt('Sound', 'MusicLevel', gMusicLevel
);
449 config
.WriteInt('Sound', 'MaxSimSounds', gMaxSimSounds
);
450 config
.WriteBool('Sound', 'MuteInactive', gMuteWhenInactive
);
451 config
.WriteInt('Sound', 'Announcer', gAnnouncer
);
452 config
.WriteBool('Sound', 'SoundEffectsDF', gSoundEffectsDF
);
454 with config
, gGameControls
.GameControls
do
456 WriteInt('GameControls', 'TakeScreenshot', TakeScreenshot
);
457 WriteInt('GameControls', 'Stat', Stat
);
458 WriteInt('GameControls', 'Chat', Chat
);
459 WriteInt('GameControls', 'TeamChat', TeamChat
);
462 with config
, gGameControls
.P1Control
, gPlayer1Settings
do
464 WriteInt('Player1', 'KeyRight', KeyRight
);
465 WriteInt('Player1', 'KeyLeft', KeyLeft
);
466 WriteInt('Player1', 'KeyUp', KeyUp
);
467 WriteInt('Player1', 'KeyDown', KeyDown
);
468 WriteInt('Player1', 'KeyFire', KeyFire
);
469 WriteInt('Player1', 'KeyJump', KeyJump
);
470 WriteInt('Player1', 'KeyNextWeapon', KeyNextWeapon
);
471 WriteInt('Player1', 'KeyPrevWeapon', KeyPrevWeapon
);
472 WriteInt('Player1', 'KeyOpen', KeyOpen
);
474 WriteStr('Player1', 'Name', Name
);
475 WriteStr('Player1', 'model', Model
);
476 WriteInt('Player1', 'red', Color
.R
);
477 WriteInt('Player1', 'green', Color
.G
);
478 WriteInt('Player1', 'blue', Color
.B
);
479 WriteInt('Player1', 'team', Team
);
482 with config
, gGameControls
.P2Control
, gPlayer2Settings
do
484 WriteInt('Player2', 'KeyRight', KeyRight
);
485 WriteInt('Player2', 'KeyLeft', KeyLeft
);
486 WriteInt('Player2', 'KeyUp', KeyUp
);
487 WriteInt('Player2', 'KeyDown', KeyDown
);
488 WriteInt('Player2', 'KeyFire', KeyFire
);
489 WriteInt('Player2', 'KeyJump', KeyJump
);
490 WriteInt('Player2', 'KeyNextWeapon', KeyNextWeapon
);
491 WriteInt('Player2', 'KeyPrevWeapon', KeyPrevWeapon
);
492 WriteInt('Player2', 'KeyOpen', KeyOpen
);
494 WriteStr('Player2', 'Name', Name
);
495 WriteStr('Player2', 'model', Model
);
496 WriteInt('Player2', 'red', Color
.R
);
497 WriteInt('Player2', 'green', Color
.G
);
498 WriteInt('Player2', 'blue', Color
.B
);
499 WriteInt('Player2', 'team', Team
);
502 for i
:= 0 to e_MaxJoys
-1 do
503 config
.WriteInt('Joysticks', 'Deadzone' + IntToStr(i
), e_JoystickDeadzones
[i
]);
507 0: config
.WriteInt('Game', 'GibsCount', 0);
508 8: config
.WriteInt('Game', 'GibsCount', 1);
509 16: config
.WriteInt('Game', 'GibsCount', 2);
510 32: config
.WriteInt('Game', 'GibsCount', 3);
511 else config
.WriteInt('Game', 'GibsCount', 4);
514 config
.WriteInt('Game', 'ItemRespawnTime', ITEM_RESPAWNTIME
div 36);
515 config
.WriteInt('Game', 'MaxParticles', g_GFX_GetMax());
516 config
.WriteInt('Game', 'MaxShells', g_Shells_GetMax());
517 config
.WriteInt('Game', 'MaxGibs', g_Gibs_GetMax());
518 config
.WriteInt('Game', 'MaxCorpses', g_Corpses_GetMax());
519 config
.WriteInt('Game', 'BloodCount', gBloodCount
);
520 config
.WriteBool('Game', 'AdvancesBlood', gAdvBlood
);
521 config
.WriteBool('Game', 'AdvancesCorpses', gAdvCorpses
);
522 config
.WriteBool('Game', 'AdvancesGibs', gAdvGibs
);
523 config
.WriteInt('Game', 'Flash', gFlash
);
524 config
.WriteBool('Game', 'BackGround', gDrawBackGround
);
525 config
.WriteBool('Game', 'Messages', gShowMessages
);
526 config
.WriteBool('Game', 'RevertPlayers', gRevertPlayers
);
527 config
.WriteInt('Game', 'ChatBubble', gChatBubble
);
529 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
530 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
531 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
532 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
533 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
534 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
535 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
536 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
537 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
538 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
539 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
541 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
542 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
543 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
544 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
545 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
546 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
547 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
548 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
549 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
550 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
551 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
553 config
.WriteStr('MasterServer', 'IP', NetSlistIP
);
554 config
.WriteInt('MasterServer', 'Port', NetSlistPort
);
556 config
.WriteStr ('Server', 'Name', NetServerName
);
557 config
.WriteStr ('Server', 'Password', NetPassword
);
558 config
.WriteInt ('Server', 'Port', NetPort
);
559 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
560 config
.WriteBool('Server', 'RCON', NetAllowRCON
);
561 config
.WriteStr ('Server', 'RCONPassword', NetRCONPassword
);
562 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
563 config
.WriteInt ('Server', 'UpdateInterval', NetUpdateRate
);
564 config
.WriteInt ('Server', 'ReliableUpdateInterval', NetRelupdRate
);
565 config
.WriteInt ('Server', 'MasterSyncInterval', NetMasterRate
);
567 config
.WriteInt ('Client', 'InterpolationSteps', NetInterpLevel
);
568 config
.WriteBool ('Client', 'ForcePlayerUpdate', NetForcePlayerUpdate
);
569 config
.WriteBool ('Client', 'PredictSelf', NetPredictSelf
);
570 config
.WriteStr ('Client', 'LastIP', NetClientIP
);
571 config
.WriteInt ('Client', 'LastPort', NetClientPort
);
573 config
.SaveFile(FileName
);
577 procedure g_Options_Write_Language(FileName
: String);
581 e_WriteLog('Writing language config', MSG_NOTIFY
);
583 config
:= TConfig
.CreateFile(FileName
);
584 config
.WriteStr('Game', 'Language', gLanguage
);
585 config
.SaveFile(FileName
);
589 procedure g_Options_Write_Video(FileName
: String);
594 e_WriteLog('Writing resolution to config', MSG_NOTIFY
);
596 config
:= TConfig
.CreateFile(FileName
);
598 if gWinMaximized
and (not gFullscreen
) then
609 config
.WriteInt('Video', 'ScreenWidth', sW
);
610 config
.WriteInt('Video', 'ScreenHeight', sH
);
611 config
.WriteInt('Video', 'WinPosX', gWinRealPosX
);
612 config
.WriteInt('Video', 'WinPosY', gWinRealPosY
);
613 config
.WriteBool('Video', 'Fullscreen', gFullscreen
);
614 config
.WriteBool('Video', 'Maximized', gWinMaximized
);
616 config
.SaveFile(FileName
);
620 procedure g_Options_Write_Gameplay_Custom(FileName
: String);
624 e_WriteLog('Writing custom gameplay config', MSG_NOTIFY
);
626 config
:= TConfig
.CreateFile(FileName
);
628 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
629 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
630 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
631 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
632 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
633 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
634 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
635 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
636 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
637 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
638 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
640 config
.SaveFile(FileName
);
644 procedure g_Options_Write_Gameplay_Net(FileName
: String);
648 e_WriteLog('Writing network gameplay config', MSG_NOTIFY
);
650 config
:= TConfig
.CreateFile(FileName
);
652 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
653 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
654 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
655 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
656 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
657 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
658 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
659 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
660 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
661 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
662 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
664 config
.SaveFile(FileName
);
668 procedure g_Options_Write_Net_Server(FileName
: String);
672 e_WriteLog('Writing server config', MSG_NOTIFY
);
674 config
:= TConfig
.CreateFile(FileName
);
676 config
.WriteStr ('Server', 'Name', NetServerName
);
677 config
.WriteStr ('Server', 'Password', NetPassword
);
678 config
.WriteInt ('Server', 'Port', NetPort
);
679 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
680 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
682 config
.SaveFile(FileName
);
686 procedure g_Options_Write_Net_Client(FileName
: String);
690 e_WriteLog('Writing client config', MSG_NOTIFY
);
692 config
:= TConfig
.CreateFile(FileName
);
694 config
.WriteStr('Client', 'LastIP', NetClientIP
);
695 config
.WriteInt('Client', 'LastPort', NetClientPort
);
697 config
.SaveFile(FileName
);