1 (* Copyright (C) DooM 2D:Forever Developers
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 TPlayerControl
= record
47 TGameControls
= record
55 GameControls
: TGameControls
;
56 P1Control
: TPlayerControl
;
57 P2Control
: TPlayerControl
;
60 procedure g_Options_SetDefault();
61 procedure g_Options_Read(FileName
: String);
62 procedure g_Options_Write(FileName
: String);
63 procedure g_Options_Write_Language(FileName
: String);
64 procedure g_Options_Write_Video(FileName
: String);
65 procedure g_Options_Write_Gameplay_Custom(FileName
: String);
66 procedure g_Options_Write_Gameplay_Net(FileName
: String);
67 procedure g_Options_Write_Net_Server(FileName
: String);
68 procedure g_Options_Write_Net_Client(FileName
: String);
71 gGameControls
: TControls
;
72 gScreenWidth
: Word = 800;
73 gScreenHeight
: Word = 600;
74 gWinRealPosX
: Integer = 0;
75 gWinRealPosY
: Integer = 0;
78 gFullscreen
: Boolean = False;
79 gWinMaximized
: Boolean = False;
80 gVSync
: Boolean = False;
81 glLegacyNPOT
: Boolean = False;
82 gTextureFilter
: Boolean = True;
83 gNoSound
: Boolean = False;
84 gSoundLevel
: Byte = 75;
85 gMusicLevel
: Byte = 65;
86 gMaxSimSounds
: Byte = 8;
87 gMuteWhenInactive
: Boolean = False;
88 gAdvCorpses
: Boolean = True;
89 gAdvBlood
: Boolean = True;
90 gAdvGibs
: Boolean = True;
91 gGibsCount
: Integer = 32;
92 gBloodCount
: Byte = 3;
94 gDrawBackGround
: Boolean = True;
95 gShowMessages
: Boolean = True;
96 gRevertPlayers
: Boolean = False;
97 gLanguage
: String = LANGUAGE_ENGLISH
;
98 gAskLanguage
: Boolean = True;
100 gcGameMode
: String = '';
101 gcTimeLimit
: Word = 0;
102 gcGoalLimit
: Word = 0;
103 gcMaxLives
: Byte = 0;
105 gcTeamDamage
: Boolean = False;
106 gcAllowExit
: Boolean = True;
107 gcWeaponStay
: Boolean = False;
108 gcMonsters
: Boolean = False;
109 gcBotsVS
: String = 'Everybody';
111 gnGameMode
: String = '';
112 gnTimeLimit
: Word = 0;
113 gnGoalLimit
: Word = 0;
114 gnMaxLives
: Byte = 0;
116 gnTeamDamage
: Boolean = False;
117 gnAllowExit
: Boolean = True;
118 gnWeaponStay
: Boolean = False;
119 gnMonsters
: Boolean = False;
120 gnBotsVS
: String = 'Everybody';
121 gsSDLSampleRate
: Integer = 44100;
122 gsSDLBufferSize
: Integer = 2048;
123 gSFSDebug
: Boolean = False;
124 gSFSFastMode
: Boolean = False;
129 e_log
, e_input
, g_window
, g_sound
, g_gfx
, g_player
, Math
,
130 g_map
, g_net
, g_netmaster
, SysUtils
, CONFIG
, g_game
, g_main
, e_textures
,
131 g_items
, GL
, GLExt
, wadreader
, e_graphics
;
133 procedure g_Options_SetDefault();
137 g_Sound_SetupAllVolumes(75, 65);
139 gMuteWhenInactive
:= False;
140 gAnnouncer
:= ANNOUNCE_MEPLUS
;
141 gSoundEffectsDF
:= True;
144 g_Corpses_SetMax(20);
145 g_Shells_SetMax(300);
152 gDrawBackGround
:= True;
153 gShowMessages
:= True;
154 gRevertPlayers
:= False;
156 for i
:= 0 to e_MaxJoys
-1 do
157 e_JoystickDeadzones
[i
] := 8192;
159 with gGameControls
.GameControls
do
161 TakeScreenshot
:= 183;
164 TeamChat
:= 21; // [Y]
167 with gGameControls
.P1Control
do
190 with gGameControls
.P2Control
do
213 with gPlayer1Settings
do
216 Model
:= STD_PLAYER_MODEL
;
217 Color
.R
:= PLAYER1_DEF_COLOR
.R
;
218 Color
.G
:= PLAYER1_DEF_COLOR
.G
;
219 Color
.B
:= PLAYER1_DEF_COLOR
.B
;
223 with gPlayer2Settings
do
226 Model
:= STD_PLAYER_MODEL
;
227 Color
.R
:= PLAYER2_DEF_COLOR
.R
;
228 Color
.G
:= PLAYER2_DEF_COLOR
.G
;
229 Color
.B
:= PLAYER2_DEF_COLOR
.B
;
233 NetUseMaster
:= True;
234 g_Net_Slist_Set('mpms.doom2d.org', 25665);
237 procedure g_Options_Read(FileName
: String);
243 gAskLanguage
:= True;
244 e_WriteLog('Reading config', MSG_NOTIFY
);
246 if not FileExists(FileName
) then
248 e_WriteLog('Config file '+FileName
+' not found', MSG_WARNING
);
249 g_Options_SetDefault();
251 // Default video options:
253 gScreenHeight
:= 600;
256 gWinMaximized
:= False;
257 gFullScreen
:= False;
260 gTextureFilter
:= True;
261 glLegacyNPOT
:= False;
266 config
:= TConfig
.CreateFile(FileName
);
268 gScreenWidth
:= config
.ReadInt('Video', 'ScreenWidth', 800);
269 if gScreenWidth
< 640 then
271 gScreenHeight
:= config
.ReadInt('Video', 'ScreenHeight', 600);
272 if gScreenHeight
< 480 then
273 gScreenHeight
:= 480;
274 gWinRealPosX
:= config
.ReadInt('Video', 'WinPosX', 0);
275 if gWinRealPosX
< 0 then
277 gWinRealPosY
:= config
.ReadInt('Video', 'WinPosY', 0);
278 if gWinRealPosY
< 0 then
280 gFullScreen
:= config
.ReadBool('Video', 'Fullscreen', False);
281 gWinMaximized
:= config
.ReadBool('Video', 'Maximized', False);
282 gBPP
:= config
.ReadInt('Video', 'BPP', 32);
283 gFreq
:= config
.ReadInt('Video', 'Freq', 0);
284 gVSync
:= config
.ReadBool('Video', 'VSync', True);
285 gTextureFilter
:= config
.ReadBool('Video', 'TextureFilter', True);
286 glLegacyNPOT
:= config
.ReadBool('Video', 'LegacyCompatible', False);
288 gNoSound
:= config
.ReadBool('Sound', 'NoSound', False);
289 gSoundLevel
:= Min(config
.ReadInt('Sound', 'SoundLevel', 75), 255);
290 gMusicLevel
:= Min(config
.ReadInt('Sound', 'MusicLevel', 65), 255);
291 gMaxSimSounds
:= Max(Min(config
.ReadInt('Sound', 'MaxSimSounds', 8), 66), 2);
292 gMuteWhenInactive
:= config
.ReadBool('Sound', 'MuteInactive', False);
293 gAnnouncer
:= Min(Max(config
.ReadInt('Sound', 'Announcer', ANNOUNCE_MEPLUS
), ANNOUNCE_NONE
), ANNOUNCE_ALL
);
294 gSoundEffectsDF
:= config
.ReadBool('Sound', 'SoundEffectsDF', True);
295 gsSDLSampleRate
:= Min(Max(config
.ReadInt('Sound', 'SDLSampleRate', 44100), 11025), 96000);
296 gsSDLBufferSize
:= Min(Max(config
.ReadInt('Sound', 'SDLBufferSize', 2048), 64), 16384);
298 with gGameControls
.GameControls
do
300 TakeScreenshot
:= config
.ReadInt('GameControls', 'TakeScreenshot', 183);
301 Stat
:= config
.ReadInt('GameControls', 'Stat', 15);
302 Chat
:= config
.ReadInt('GameControls', 'Chat', 20);
303 TeamChat
:= config
.ReadInt('GameControls', 'TeamChat', 21);
306 with gGameControls
.P1Control
, config
do
308 KeyRight
:= ReadInt('Player1', 'KeyRight', 33);
309 KeyLeft
:= ReadInt('Player1', 'KeyLeft', 31);
310 KeyUp
:= ReadInt('Player1', 'KeyUp', 18);
311 KeyDown
:= ReadInt('Player1', 'KeyDown', 32);
312 KeyFire
:= ReadInt('Player1', 'KeyFire', 30);
313 KeyJump
:= ReadInt('Player1', 'KeyJump', 16);
314 KeyNextWeapon
:= ReadInt('Player1', 'KeyNextWeapon', 19);
315 KeyPrevWeapon
:= ReadInt('Player1', 'KeyPrevWeapon', 17);
316 KeyOpen
:= ReadInt('Player1', 'KeyOpen', 58);
318 KeyRight2
:= ReadInt('Player1', 'KeyRight2', 0);
319 KeyLeft2
:= ReadInt('Player1', 'KeyLeft2', 0);
320 KeyUp2
:= ReadInt('Player1', 'KeyUp2', 0);
321 KeyDown2
:= ReadInt('Player1', 'KeyDown2', 0);
322 KeyFire2
:= ReadInt('Player1', 'KeyFire2', 0);
323 KeyJump2
:= ReadInt('Player1', 'KeyJump2', 0);
324 KeyNextWeapon2
:= ReadInt('Player1', 'KeyNextWeapon2', 0);
325 KeyPrevWeapon2
:= ReadInt('Player1', 'KeyPrevWeapon2', 0);
326 KeyOpen2
:= ReadInt('Player1', 'KeyOpen2', 0);
329 with gPlayer1Settings
, config
do
331 Name
:= ReadStr('Player1', 'name', 'Player1');
332 Model
:= ReadStr('Player1', 'model', STD_PLAYER_MODEL
);
333 Color
.R
:= Min(Abs(ReadInt('Player1', 'red', PLAYER1_DEF_COLOR
.R
)), 255);
334 Color
.G
:= Min(Abs(ReadInt('Player1', 'green', PLAYER1_DEF_COLOR
.G
)), 255);
335 Color
.B
:= Min(Abs(ReadInt('Player1', 'blue', PLAYER1_DEF_COLOR
.B
)), 255);
336 Team
:= ReadInt('Player1', 'team', TEAM_RED
);
337 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
341 with gGameControls
.P2Control
, config
do
343 KeyRight
:= ReadInt('Player2', 'KeyRight', 205);
344 KeyLeft
:= ReadInt('Player2', 'KeyLeft', 203);
345 KeyUp
:= ReadInt('Player2', 'KeyUp', 200);
346 KeyDown
:= ReadInt('Player2', 'KeyDown', 208);
347 KeyFire
:= ReadInt('Player2', 'KeyFire', 184);
348 KeyJump
:= ReadInt('Player2', 'KeyJump', 157);
349 KeyNextWeapon
:= ReadInt('Player2', 'KeyNextWeapon', 73);
350 KeyPrevWeapon
:= ReadInt('Player2', 'KeyPrevWeapon', 71);
351 KeyOpen
:= ReadInt('Player2', 'KeyOpen', 54);
353 KeyRight2
:= ReadInt('Player2', 'KeyRight2', 0);
354 KeyLeft2
:= ReadInt('Player2', 'KeyLeft2', 0);
355 KeyUp2
:= ReadInt('Player2', 'KeyUp2', 0);
356 KeyDown2
:= ReadInt('Player2', 'KeyDown2', 0);
357 KeyFire2
:= ReadInt('Player2', 'KeyFire2', 0);
358 KeyJump2
:= ReadInt('Player2', 'KeyJump2', 0);
359 KeyNextWeapon2
:= ReadInt('Player2', 'KeyNextWeapon2', 0);
360 KeyPrevWeapon2
:= ReadInt('Player2', 'KeyPrevWeapon2', 0);
361 KeyOpen2
:= ReadInt('Player2', 'KeyOpen2', 0);
364 with gPlayer2Settings
, config
do
366 Name
:= ReadStr('Player2', 'name', 'Player2');
367 Model
:= ReadStr('Player2', 'model', STD_PLAYER_MODEL
);
368 Color
.R
:= Min(Abs(ReadInt('Player2', 'red', PLAYER2_DEF_COLOR
.R
)), 255);
369 Color
.G
:= Min(Abs(ReadInt('Player2', 'green', PLAYER2_DEF_COLOR
.G
)), 255);
370 Color
.B
:= Min(Abs(ReadInt('Player2', 'blue', PLAYER2_DEF_COLOR
.B
)), 255);
371 Team
:= ReadInt('Player2', 'team', TEAM_BLUE
);
372 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
376 for i
:= 0 to e_MaxJoys
-1 do
377 e_JoystickDeadzones
[i
] := config
.ReadInt('Joysticks', 'Deadzone' + IntToStr(i
), 8192);
379 g_GFX_SetMax(Min(config
.ReadInt('Game', 'MaxParticles', 1000), 50000));
380 g_Shells_SetMax(Min(config
.ReadInt('Game', 'MaxShells', 300), 600));
381 g_Gibs_SetMax(Min(config
.ReadInt('Game', 'MaxGibs', 150), 500));
382 g_Corpses_SetMax(Min(config
.ReadInt('Game', 'MaxCorpses', 20), 100));
384 case config
.ReadInt('Game', 'GibsCount', 3) of
389 else gGibsCount
:= 48;
392 ITEM_RESPAWNTIME
:= 36*Max(config
.ReadInt('Game', 'ItemRespawnTime', 60), 0);
393 gBloodCount
:= Min(config
.ReadInt('Game', 'BloodCount', 4), 4);
394 gAdvBlood
:= config
.ReadBool('Game', 'AdvancesBlood', True);
395 gAdvCorpses
:= config
.ReadBool('Game', 'AdvancesCorpses', True);
396 gAdvGibs
:= config
.ReadBool('Game', 'AdvancesGibs', True);
397 gFlash
:= Min(Max(config
.ReadInt('Game', 'Flash', 1), 0), 2);
398 gDrawBackGround
:= config
.ReadBool('Game', 'BackGround', True);
399 gShowMessages
:= config
.ReadBool('Game', 'Messages', True);
400 gRevertPlayers
:= config
.ReadBool('Game', 'RevertPlayers', False);
401 gChatBubble
:= Min(Max(config
.ReadInt('Game', 'ChatBubble', 4), 0), 4);
402 gSFSDebug
:= config
.ReadBool('Game', 'SFSDebug', False);
403 wadoptDebug
:= gSFSDebug
;
404 gSFSFastMode
:= config
.ReadBool('Game', 'SFSFastMode', False);
405 wadoptFast
:= gSFSFastMode
;
406 e_FastScreenshots
:= config
.ReadBool('Game', 'FastScreenshots', True);
408 // Ãåéìïëåé â ñâîåé èãðå
409 gcMap
:= config
.ReadStr('GameplayCustom', 'Map', '');
410 gcGameMode
:= config
.ReadStr('GameplayCustom', 'GameMode', _lc
[I_MENU_GAME_TYPE_DM
]);
411 gcTimeLimit
:= Min(Max(config
.ReadInt('GameplayCustom', 'TimeLimit', 0), 0), 65535);
412 gcGoalLimit
:= Min(Max(config
.ReadInt('GameplayCustom', 'GoalLimit', 0), 0), 65535);
413 gcMaxLives
:= Min(Max(config
.ReadInt('GameplayCustom', 'MaxLives', 0), 0), 255);
414 gcPlayers
:= Min(Max(config
.ReadInt('GameplayCustom', 'Players', 1), 0), 2);
415 gcTeamDamage
:= config
.ReadBool('GameplayCustom', 'TeamDamage', False);
416 gcAllowExit
:= config
.ReadBool('GameplayCustom', 'AllowExit', True);
417 gcWeaponStay
:= config
.ReadBool('GameplayCustom', 'WeaponStay', False);
418 gcMonsters
:= config
.ReadBool('GameplayCustom', 'Monsters', False);
419 gcBotsVS
:= config
.ReadStr('GameplayCustom', 'BotsVS', 'Everybody');
421 with gGameSettings
do
423 GameMode
:= g_Game_TextToMode(gcGameMode
);
424 if GameMode
= GM_NONE
then
426 if GameMode
= GM_SINGLE
then
428 TimeLimit
:= gcTimeLimit
;
429 GoalLimit
:= gcGoalLimit
;
430 MaxLives
:= gcMaxLives
;
434 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
436 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
438 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
440 Options
:= Options
or GAME_OPTION_MONSTERS
;
441 if gcBotsVS
= 'Everybody' then
442 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
443 if gcBotsVS
= 'Players' then
444 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
445 if gcBotsVS
= 'Monsters' then
446 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
449 // Ãåéìïëåé â ñåòåâîé èãðå
450 gnMap
:= config
.ReadStr('GameplayNetwork', 'Map', '');
451 gnGameMode
:= config
.ReadStr('GameplayNetwork', 'GameMode', _lc
[I_MENU_GAME_TYPE_DM
]);
452 gnTimeLimit
:= Min(Max(config
.ReadInt('GameplayNetwork', 'TimeLimit', 0), 0), 65535);
453 gnGoalLimit
:= Min(Max(config
.ReadInt('GameplayNetwork', 'GoalLimit', 0), 0), 65535);
454 gnMaxLives
:= Min(Max(config
.ReadInt('GameplayNetwork', 'MaxLives', 0), 0), 255);
455 gnPlayers
:= Min(Max(config
.ReadInt('GameplayNetwork', 'Players', 1), 0), 2);
456 gnTeamDamage
:= config
.ReadBool('GameplayNetwork', 'TeamDamage', False);
457 gnAllowExit
:= config
.ReadBool('GameplayNetwork', 'AllowExit', True);
458 gnWeaponStay
:= config
.ReadBool('GameplayNetwork', 'WeaponStay', False);
459 gnMonsters
:= config
.ReadBool('GameplayNetwork', 'Monsters', False);
460 gnBotsVS
:= config
.ReadStr('GameplayNetwork', 'BotsVS', 'Everybody');
462 // Îáùèå ñåòåâûå
463 NetSlistIP
:= config
.ReadStr('MasterServer', 'IP', 'mpms.doom2d.org');
464 NetSlistPort
:= config
.ReadInt('MasterServer', 'Port', 25665);
467 NetServerName
:= config
.ReadStr('Server', 'Name', 'Unnamed Server');
468 NetPassword
:= config
.ReadStr('Server', 'Password', '');
469 NetPort
:= Min(Max(0, config
.ReadInt('Server', 'Port', 25666)), 65535);
470 NetMaxClients
:= Min(Max(0, config
.ReadInt('Server', 'MaxClients', 16)), NET_MAXCLIENTS
);
471 NetAllowRCON
:= config
.ReadBool('Server', 'RCON', False);
472 NetRCONPassword
:= config
.ReadStr('Server', 'RCONPassword', 'default');
473 NetUseMaster
:= config
.ReadBool('Server', 'SyncWithMaster', True);
474 NetUpdateRate
:= Max(0, config
.ReadInt('Server', 'UpdateInterval', 0));
475 NetRelupdRate
:= Max(0, config
.ReadInt('Server', 'ReliableUpdateInterval', 18));
476 NetMasterRate
:= Max(1, config
.ReadInt('Server', 'MasterSyncInterval', 60000));
479 NetInterpLevel
:= Max(0, config
.ReadInt('Client', 'InterpolationSteps', 2));
480 NetForcePlayerUpdate
:= config
.ReadBool('Client', 'ForcePlayerUpdate', False);
481 NetPredictSelf
:= config
.ReadBool('Client', 'PredictSelf', True);
482 NetClientIP
:= config
.ReadStr('Client', 'LastIP', '127.0.0.1');
483 NetClientPort
:= Max(0, config
.ReadInt('Client', 'LastPort', 25666));
486 str
:= config
.ReadStr('Game', 'Language', '');
487 if (str
= LANGUAGE_RUSSIAN
) or
488 (str
= LANGUAGE_ENGLISH
) then
491 gAskLanguage
:= False;
494 gLanguage
:= LANGUAGE_ENGLISH
;
498 if gTextureFilter
then
499 TEXTUREFILTER
:= GL_LINEAR
501 TEXTUREFILTER
:= GL_NEAREST
;
504 procedure g_Options_Write(FileName
: String);
509 e_WriteLog('Writing config', MSG_NOTIFY
);
511 config
:= TConfig
.CreateFile(FileName
);
513 config
.WriteInt('Video', 'ScreenWidth', gScreenWidth
);
514 config
.WriteInt('Video', 'ScreenHeight', gScreenHeight
);
515 config
.WriteInt('Video', 'WinPosX', gWinRealPosX
);
516 config
.WriteInt('Video', 'WinPosY', gWinRealPosY
);
517 config
.WriteBool('Video', 'Fullscreen', gFullScreen
);
518 config
.WriteBool('Video', 'Maximized', gWinMaximized
);
519 config
.WriteInt('Video', 'BPP', gBPP
);
520 config
.WriteBool('Video', 'VSync', gVSync
);
521 config
.WriteBool('Video', 'TextureFilter', gTextureFilter
);
522 config
.WriteBool('Video', 'LegacyCompatible', glLegacyNPOT
);
524 config
.WriteBool('Sound', 'NoSound', gNoSound
);
525 config
.WriteInt('Sound', 'SoundLevel', gSoundLevel
);
526 config
.WriteInt('Sound', 'MusicLevel', gMusicLevel
);
527 config
.WriteInt('Sound', 'MaxSimSounds', gMaxSimSounds
);
528 config
.WriteBool('Sound', 'MuteInactive', gMuteWhenInactive
);
529 config
.WriteInt('Sound', 'Announcer', gAnnouncer
);
530 config
.WriteBool('Sound', 'SoundEffectsDF', gSoundEffectsDF
);
531 config
.WriteInt('Sound', 'SDLSampleRate', gsSDLSampleRate
);
532 config
.WriteInt('Sound', 'SDLBufferSize', gsSDLBufferSize
);
534 with config
, gGameControls
.GameControls
do
536 WriteInt('GameControls', 'TakeScreenshot', TakeScreenshot
);
537 WriteInt('GameControls', 'Stat', Stat
);
538 WriteInt('GameControls', 'Chat', Chat
);
539 WriteInt('GameControls', 'TeamChat', TeamChat
);
542 with config
, gGameControls
.P1Control
, gPlayer1Settings
do
544 WriteInt('Player1', 'KeyRight', KeyRight
);
545 WriteInt('Player1', 'KeyLeft', KeyLeft
);
546 WriteInt('Player1', 'KeyUp', KeyUp
);
547 WriteInt('Player1', 'KeyDown', KeyDown
);
548 WriteInt('Player1', 'KeyFire', KeyFire
);
549 WriteInt('Player1', 'KeyJump', KeyJump
);
550 WriteInt('Player1', 'KeyNextWeapon', KeyNextWeapon
);
551 WriteInt('Player1', 'KeyPrevWeapon', KeyPrevWeapon
);
552 WriteInt('Player1', 'KeyOpen', KeyOpen
);
554 WriteInt('Player1', 'KeyRight2', KeyRight2
);
555 WriteInt('Player1', 'KeyLeft2', KeyLeft2
);
556 WriteInt('Player1', 'KeyUp2', KeyUp2
);
557 WriteInt('Player1', 'KeyDown2', KeyDown2
);
558 WriteInt('Player1', 'KeyFire2', KeyFire2
);
559 WriteInt('Player1', 'KeyJump2', KeyJump2
);
560 WriteInt('Player1', 'KeyNextWeapon2', KeyNextWeapon2
);
561 WriteInt('Player1', 'KeyPrevWeapon2', KeyPrevWeapon2
);
562 WriteInt('Player1', 'KeyOpen2', KeyOpen2
);
564 WriteStr('Player1', 'Name', Name
);
565 WriteStr('Player1', 'model', Model
);
566 WriteInt('Player1', 'red', Color
.R
);
567 WriteInt('Player1', 'green', Color
.G
);
568 WriteInt('Player1', 'blue', Color
.B
);
569 WriteInt('Player1', 'team', Team
);
572 with config
, gGameControls
.P2Control
, gPlayer2Settings
do
574 WriteInt('Player2', 'KeyRight', KeyRight
);
575 WriteInt('Player2', 'KeyLeft', KeyLeft
);
576 WriteInt('Player2', 'KeyUp', KeyUp
);
577 WriteInt('Player2', 'KeyDown', KeyDown
);
578 WriteInt('Player2', 'KeyFire', KeyFire
);
579 WriteInt('Player2', 'KeyJump', KeyJump
);
580 WriteInt('Player2', 'KeyNextWeapon', KeyNextWeapon
);
581 WriteInt('Player2', 'KeyPrevWeapon', KeyPrevWeapon
);
582 WriteInt('Player2', 'KeyOpen', KeyOpen
);
584 WriteInt('Player2', 'KeyRight2', KeyRight2
);
585 WriteInt('Player2', 'KeyLeft2', KeyLeft2
);
586 WriteInt('Player2', 'KeyUp2', KeyUp2
);
587 WriteInt('Player2', 'KeyDown2', KeyDown2
);
588 WriteInt('Player2', 'KeyFire2', KeyFire2
);
589 WriteInt('Player2', 'KeyJump2', KeyJump2
);
590 WriteInt('Player2', 'KeyNextWeapon2', KeyNextWeapon2
);
591 WriteInt('Player2', 'KeyPrevWeapon2', KeyPrevWeapon2
);
592 WriteInt('Player2', 'KeyOpen2', KeyOpen2
);
594 WriteStr('Player2', 'Name', Name
);
595 WriteStr('Player2', 'model', Model
);
596 WriteInt('Player2', 'red', Color
.R
);
597 WriteInt('Player2', 'green', Color
.G
);
598 WriteInt('Player2', 'blue', Color
.B
);
599 WriteInt('Player2', 'team', Team
);
602 for i
:= 0 to e_MaxJoys
-1 do
603 config
.WriteInt('Joysticks', 'Deadzone' + IntToStr(i
), e_JoystickDeadzones
[i
]);
607 0: config
.WriteInt('Game', 'GibsCount', 0);
608 8: config
.WriteInt('Game', 'GibsCount', 1);
609 16: config
.WriteInt('Game', 'GibsCount', 2);
610 32: config
.WriteInt('Game', 'GibsCount', 3);
611 else config
.WriteInt('Game', 'GibsCount', 4);
614 config
.WriteInt('Game', 'ItemRespawnTime', ITEM_RESPAWNTIME
div 36);
615 config
.WriteInt('Game', 'MaxParticles', g_GFX_GetMax());
616 config
.WriteInt('Game', 'MaxShells', g_Shells_GetMax());
617 config
.WriteInt('Game', 'MaxGibs', g_Gibs_GetMax());
618 config
.WriteInt('Game', 'MaxCorpses', g_Corpses_GetMax());
619 config
.WriteInt('Game', 'BloodCount', gBloodCount
);
620 config
.WriteBool('Game', 'AdvancesBlood', gAdvBlood
);
621 config
.WriteBool('Game', 'AdvancesCorpses', gAdvCorpses
);
622 config
.WriteBool('Game', 'AdvancesGibs', gAdvGibs
);
623 config
.WriteInt('Game', 'Flash', gFlash
);
624 config
.WriteBool('Game', 'BackGround', gDrawBackGround
);
625 config
.WriteBool('Game', 'Messages', gShowMessages
);
626 config
.WriteBool('Game', 'RevertPlayers', gRevertPlayers
);
627 config
.WriteInt('Game', 'ChatBubble', gChatBubble
);
628 config
.WriteBool('Game', 'SFSDebug', gSFSDebug
);
629 config
.WriteBool('Game', 'SFSFastMode', gSFSFastMode
);
630 config
.WriteBool('Game', 'FastScreenshots', e_FastScreenshots
);
632 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
633 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
634 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
635 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
636 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
637 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
638 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
639 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
640 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
641 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
642 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
644 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
645 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
646 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
647 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
648 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
649 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
650 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
651 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
652 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
653 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
654 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
656 config
.WriteStr('MasterServer', 'IP', NetSlistIP
);
657 config
.WriteInt('MasterServer', 'Port', NetSlistPort
);
659 config
.WriteStr ('Server', 'Name', NetServerName
);
660 config
.WriteStr ('Server', 'Password', NetPassword
);
661 config
.WriteInt ('Server', 'Port', NetPort
);
662 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
663 config
.WriteBool('Server', 'RCON', NetAllowRCON
);
664 config
.WriteStr ('Server', 'RCONPassword', NetRCONPassword
);
665 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
666 config
.WriteInt ('Server', 'UpdateInterval', NetUpdateRate
);
667 config
.WriteInt ('Server', 'ReliableUpdateInterval', NetRelupdRate
);
668 config
.WriteInt ('Server', 'MasterSyncInterval', NetMasterRate
);
670 config
.WriteInt ('Client', 'InterpolationSteps', NetInterpLevel
);
671 config
.WriteBool ('Client', 'ForcePlayerUpdate', NetForcePlayerUpdate
);
672 config
.WriteBool ('Client', 'PredictSelf', NetPredictSelf
);
673 config
.WriteStr ('Client', 'LastIP', NetClientIP
);
674 config
.WriteInt ('Client', 'LastPort', NetClientPort
);
676 config
.SaveFile(FileName
);
680 procedure g_Options_Write_Language(FileName
: String);
684 e_WriteLog('Writing language config', MSG_NOTIFY
);
686 config
:= TConfig
.CreateFile(FileName
);
687 config
.WriteStr('Game', 'Language', gLanguage
);
688 config
.SaveFile(FileName
);
692 procedure g_Options_Write_Video(FileName
: String);
697 e_WriteLog('Writing resolution to config', MSG_NOTIFY
);
699 config
:= TConfig
.CreateFile(FileName
);
701 if gWinMaximized
and (not gFullscreen
) then
712 config
.WriteInt('Video', 'ScreenWidth', sW
);
713 config
.WriteInt('Video', 'ScreenHeight', sH
);
714 config
.WriteInt('Video', 'WinPosX', gWinRealPosX
);
715 config
.WriteInt('Video', 'WinPosY', gWinRealPosY
);
716 config
.WriteBool('Video', 'Fullscreen', gFullscreen
);
717 config
.WriteBool('Video', 'Maximized', gWinMaximized
);
719 config
.SaveFile(FileName
);
723 procedure g_Options_Write_Gameplay_Custom(FileName
: String);
727 e_WriteLog('Writing custom gameplay config', MSG_NOTIFY
);
729 config
:= TConfig
.CreateFile(FileName
);
731 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
732 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
733 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
734 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
735 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
736 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
737 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
738 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
739 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
740 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
741 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
743 config
.SaveFile(FileName
);
747 procedure g_Options_Write_Gameplay_Net(FileName
: String);
751 e_WriteLog('Writing network gameplay config', MSG_NOTIFY
);
753 config
:= TConfig
.CreateFile(FileName
);
755 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
756 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
757 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
758 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
759 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
760 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
761 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
762 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
763 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
764 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
765 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
767 config
.SaveFile(FileName
);
771 procedure g_Options_Write_Net_Server(FileName
: String);
775 e_WriteLog('Writing server config', MSG_NOTIFY
);
777 config
:= TConfig
.CreateFile(FileName
);
779 config
.WriteStr ('Server', 'Name', NetServerName
);
780 config
.WriteStr ('Server', 'Password', NetPassword
);
781 config
.WriteInt ('Server', 'Port', NetPort
);
782 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
783 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
785 config
.SaveFile(FileName
);
789 procedure g_Options_Write_Net_Client(FileName
: String);
793 e_WriteLog('Writing client config', MSG_NOTIFY
);
795 config
:= TConfig
.CreateFile(FileName
);
797 config
.WriteStr('Client', 'LastIP', NetClientIP
);
798 config
.WriteInt('Client', 'LastPort', NetClientPort
);
800 config
.SaveFile(FileName
);