forked from 1dot13/source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameSettings.cpp
4771 lines (3935 loc) · 405 KB
/
GameSettings.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "Types.h"
#include "GameSettings.h"
#include "FileMan.h"
#include "String.h"
#include "Sound Control.h"
#include "SaveLoadScreen.h"
#include "Music Control.h"
#include "Options Screen.h"
#include "Overhead.h"
#include "GameVersion.h"
#include "LibraryDataBase.h"
#include "Debug.h"
#include "Language Defines.h"
#include "HelpScreen.h"
#include "INIReader.h"
#include "Shade Table Util.h"
#include "soldier profile type.h"
#include "Random.h"
#include "SaveLoadGame.h"
#include "sgp.h"
#include "screenids.h"
#include "Font Control.h"
#include "message.h"
#include "Campaign.h"
#include "meanwhile.h"
#include "strategicmap.h"
#include "Queen Command.h"
#include "Game Clock.h"
#include "Init.h"
#include "InterfaceItemImages.h"
#include "DynamicDialogue.h" // added by Flugente
#include "KeyMap.h"
#include "Timer Control.h"
#include "Text.h"
#include "connect.h"
#include "sgp_logger.h"
#include "Map Information.h"
#include "GameInitOptionsScreen.h"
#include <vfs/Core/vfs.h>
#include <vfs/Core/vfs_file_raii.h>
#include <vfs/Core/File/vfs_file.h>
#define GAME_SETTINGS_FILE "Ja2_Settings.INI"
#define FEATURE_FLAGS_FILE "Ja2_Features.ini"
#define GAME_EXTERNAL_OPTIONS_FILE "Ja2_Options.ini"
#define AP_BP_CONSTANTS_FILE "APBPConstants.ini"
#define STOMP_SETTINGS_FILE "Skills_Settings.ini" // SANDRO - file for STOMP
// HEADROCK HAM 4: This file contains all the settings required to tweak the new Shooting Mechanism. There's lots of them.
#define CTH_COEFFICIENTS_FILE "CTHConstants.ini"
//DBrot: Settings for a mod that don't really fit in the Options file. This means GridNos for now.
#define MOD_SETTINGS_FILE "Mod_Settings.ini"
// silversurfer: Modifiers for item properties ( thresholds, range, damage, armor etc.)
#define ITEM_SETTINGS_FILE "Item_Settings.ini"
// anv: externalised taunt settings
#define TAUNTS_SETTINGS_FILE "Taunts_Settings.ini"
// anv: helicopter repair settings - enough of these to put them in own file
#define HELICOPTER_SETTINGS_FILE "Helicopter_Settings.ini"
#define MORALE_SETTINGS_FILE "Morale_Settings.ini"
#define REPUTATION_SETTINGS_FILE "Reputation_Settings.ini"
#define CREATURES_SETTINGS_FILE "Creatures_Settings.ini"
#define REBEL_COMMAND_SETTINGS_FILE "RebelCommand_Settings.ini"
#define CD_ROOT_DIR "DATA\\"
GAME_SETTINGS gGameSettings;
GAME_OPTIONS gGameOptions;
// Snap: Options read from an INI file in the default of custom Data directory
GAME_EXTERNAL_OPTIONS gGameExternalOptions;
SKILL_TRAIT_VALUES gSkillTraitValues; // SANDRO - added this one
TAUNTS_SETTINGS gTauntsSettings;
HELICOPTER_SETTINGS gHelicopterSettings;
MORALE_SETTINGS gMoraleSettings;
REPUTATION_SETTINGS gReputationSettings;
CREATURES_SETTINGS gCreaturesSettings;
REBELCOMMAND_SETTINGS gRebelCommandSettings;
CTH_CONSTANTS gGameCTHConstants; // HEADROCK HAM 4: CTH constants
MOD_SETTINGS gModSettings; //DBrot: mod specific settings
ITEM_SETTINGS gItemSettings; // silversurfer: item property modifiers
extern SGPFILENAME gCheckFilenames[];
extern CHAR8 gzErrorMsg[256];
extern INT16 APBPConstants[TOTAL_APBP_VALUES];
void InitGameSettings();
BOOLEAN GetCdromLocationFromIniFile( STR pRootOfCdromDrive );
extern BOOLEAN DoJA2FilesExistsOnDrive( CHAR8 *zCdLocation );
BOOLEAN GetCDromDriveLetter( STR8 pString );
BOOLEAN IsDriveLetterACDromDrive( STR pDriveLetter );
void CDromEjectionErrorMessageBoxCallBack( UINT8 bExitValue );
// these wrappers have the benefit that changing the location of the variable (gameinitoptionscreen/ini/ingame options) doesn't require huge changes throughout the code
// additionally, turning off a feature (for UB, for MP...) can be done here without additional checks in the code
bool UsingNewInventorySystem()
{
return (gGameOptions.ubInventorySystem == INVENTORY_NEW);
}
bool UsingNewAttachmentSystem()
{
return (gGameOptions.ubAttachmentSystem == ATTACHMENT_NEW);
}
bool UsingNewCTHSystem()
{
// this feature is off in multiplayer
return ( !is_networked && gGameExternalOptions.fUseNCTH);
}
BOOLEAN UsingFoodSystem()
{
return gGameExternalOptions.fFoodSystem;
}
BOOLEAN UsingBackGroundSystem()
{
return gGameExternalOptions.fBackGround;
}
BOOLEAN UsingImprovedInterruptSystem()
{
#ifdef JA2EDITOR
return FALSE;
#endif
// this feature is off in multiplayer
return (!is_networked && gGameExternalOptions.fImprovedInterruptSystem);
}
BOOLEAN UsingInventoryCostsAPSystem()
{
#ifdef JA2EDITOR
return FALSE;
#endif
return ( gGameExternalOptions.fInventoryCostsAP );
}
std::string StringToLower(std::string strToConvert)
{//change each element of the string to lower case
for(unsigned int i=0;i<strToConvert.length();i++)
{
strToConvert[i] = tolower(strToConvert[i]);
}
return strToConvert;//return the converted string
}
BOOLEAN IsNIVModeValid(bool checkRes)
{
bool isValid = FALSE;
// WANNE: Playing with NIV needs the v1.13 profile, because the "data" folder does not contains any NIV items!
// Check if the Profile with the NAME = "v1.13" is found in the specificed vfs_config.*.ini
if(getVFS()->getProfileStack()->getProfile(L"v1.13") != NULL)
{
isValid = TRUE;
}
else
isValid = FALSE;
// Also check the resolution if needed.
if(checkRes == true && iResolution >= _640x480 && iResolution < _800x600)
isValid = FALSE;
return isValid;
}
void UpdateFeatureFlags()
{
// do we need to override some ini settings?
if (gGameSettings.fFeatures[FF_FEATURES_SCREEN])
{
gGameExternalOptions.fUseNCTH = gGameSettings.fFeatures[FF_NCTH];
if (gGameSettings.fFeatures[FF_DROP_ALL])
gGameExternalOptions.fEnemiesDropAllItems = 1;
else if (gGameSettings.fFeatures[FF_DROP_ALL_DAMAGED])
gGameExternalOptions.fEnemiesDropAllItems = 2;
else
gGameExternalOptions.fEnemiesDropAllItems = 0;
gGameExternalOptions.sSuppressionEffectiveness = gGameSettings.fFeatures[FF_SUPPRESSION] ? 100 : 0;
gGameExternalOptions.ubSendTroopsToDrassen = gGameSettings.fFeatures[FF_TRIGGER_MASSIVE_ENEMY_COUNTERATTACK_AT_DRASSEN];
if (gGameSettings.fFeatures[FF_AGGRESSIVE_STRATEGIC_AI])
gGameExternalOptions.ubAgressiveStrategicAI = 1;
else if (gGameSettings.fFeatures[FF_AGGRESSIVE_STRATEGIC_AI_2])
gGameExternalOptions.ubAgressiveStrategicAI = 2;
else
gGameExternalOptions.ubAgressiveStrategicAI = 0;
gGameExternalOptions.fIntelResource = gGameSettings.fFeatures[FF_INTEL];
if (gGameExternalOptions.fIntelResource)
{
gGameExternalOptions.bExtraCivilians = TRUE;
gGameExternalOptions.bExtraMerchants = TRUE;
}
gGameExternalOptions.fAllowPrisonerSystem = gGameSettings.fFeatures[FF_PRISONERS];
gGameExternalOptions.fMineRequiresWorkers = gGameSettings.fFeatures[FF_MINES_REQUIRE_WORKERS];
gGameExternalOptions.fEnableChanceOfEnemyAmbushes = gGameSettings.fFeatures[FF_ENEMY_AMBUSHES];
gGameExternalOptions.fEnemyAssassins = gGameSettings.fFeatures[FF_ENEMY_ASSASSINS];
gGameExternalOptions.fEnemyRoles = gGameSettings.fFeatures[FF_ENEMY_ROLES];
gGameExternalOptions.fEnemyMedics = gGameSettings.fFeatures[FF_ENEMY_ROLE_MEDIC];
gGameExternalOptions.fEnemyOfficers = gGameSettings.fFeatures[FF_ENEMY_ROLE_OFFICER];
gGameExternalOptions.fEnemyGenerals = gGameSettings.fFeatures[FF_ENEMY_ROLE_GENERAL];
gGameExternalOptions.fPMC = gGameSettings.fFeatures[FF_KERBERUS];
gGameExternalOptions.fFoodSystem = gGameSettings.fFeatures[FF_FOOD];
gGameExternalOptions.fDisease = gGameSettings.fFeatures[FF_DISEASE];
gGameExternalOptions.fDynamicOpinions = gGameSettings.fFeatures[FF_DYNAMIC_OPINIONS];
gGameExternalOptions.fDynamicDialogue = gGameSettings.fFeatures[FF_DYNAMIC_DIALOGUE];
gGameExternalOptions.fASDActive = gGameSettings.fFeatures[FF_ASD];
gGameExternalOptions.fEnemyHeliActive = gGameSettings.fFeatures[FF_ASD_HELICOPTERS];
gGameExternalOptions.fEnemyTanksCanMoveInTactical = gGameSettings.fFeatures[FF_ENEMY_VEHICLES_CAN_MOVE];
gGameSettings.fOptions[TOPTION_ZOMBIES] = gGameSettings.fFeatures[FF_ZOMBIES];
gGameExternalOptions.gRaid_Bloodcats = gGameSettings.fFeatures[FF_BLOODCAT_RAIDS];
gGameExternalOptions.gRaid_Bandits = gGameSettings.fFeatures[FF_BANDIT_RAIDS];
gGameExternalOptions.gRaid_Zombies = gGameSettings.fFeatures[FF_ZOMBIE_RAIDS];
gGameExternalOptions.fMilitiaVolunteerPool = gGameSettings.fFeatures[FF_MILITIA_VOLUNTEER_POOL];
gGameExternalOptions.fAllowTacticalMilitiaCommand = gGameSettings.fFeatures[FF_ALLOW_TACTICAL_MILITIA_COMMAND];
gGameExternalOptions.fMilitiaStrategicCommand = gGameSettings.fFeatures[FF_ALLOW_STRATEGIC_MILITIA_COMMAND];
gGameExternalOptions.fMilitiaUseSectorInventory = gGameSettings.fFeatures[FF_MILITIA_USE_SECTOR_EQUIPMENT];
gGameExternalOptions.fMilitiaResources = gGameSettings.fFeatures[FF_MILITIA_REQUIRE_RESOURCES];
gGameExternalOptions.fEnhancedCloseCombatSystem = gGameSettings.fFeatures[FF_ENHANCED_CLOSE_COMBAT_SYSTEM];
gGameExternalOptions.fImprovedInterruptSystem = gGameSettings.fFeatures[FF_IMPROVED_INTERRUPT_SYSTEM];
gGameExternalOptions.fWeaponOverheating = gGameSettings.fFeatures[FF_OVERHEATING];
gGameExternalOptions.gfAllowRain = gGameSettings.fFeatures[FF_ALLOW_RAIN];
gGameExternalOptions.gfAllowLightning = gGameSettings.fFeatures[FF_ALLOW_LIGHTNING];
gGameExternalOptions.gfAllowSandStorms = gGameSettings.fFeatures[FF_ALLOW_SANDSTORM];
gGameExternalOptions.gfAllowSnow = gGameSettings.fFeatures[FF_ALLOW_SNOW];
gGameExternalOptions.fMiniEventsEnabled = gGameSettings.fFeatures[FF_MINI_EVENTS];
gGameExternalOptions.fRebelCommandEnabled = gGameSettings.fFeatures[FF_REBEL_COMMAND];
gGameExternalOptions.fStrategicTransportGroupsEnabled = gGameSettings.fFeatures[FF_STRATEGIC_TRANSPORT_GROUPS];
}
else
{
// reload options, since we may have overwritten them
CIniReader iniReader(GAME_SETTINGS_FILE, TRUE);
gGameSettings.fOptions[TOPTION_ZOMBIES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ZOMBIES",FALSE);
LoadGameExternalOptions();
}
}
BOOLEAN LoadGameSettings()
{
try
{
CIniReader iniReader(GAME_SETTINGS_FILE, TRUE); // force path even for non existing files
gGameSettings.bLastSavedGameSlot = iniReader.ReadInteger("JA2 Game Settings","bLastSavedGameSlot" , -1 , -1 , 255 );
gGameSettings.ubMusicVolumeSetting = iniReader.ReadInteger("JA2 Game Settings","ubMusicVolumeSetting" , MIDVOLUME , 0 , HIGHVOLUME );
gGameSettings.ubSoundEffectsVolume = iniReader.ReadInteger("JA2 Game Settings","ubSoundEffectsVolume" , MIDVOLUME , 0 , HIGHVOLUME );
gGameSettings.ubSpeechVolume = iniReader.ReadInteger("JA2 Game Settings","ubSpeechVolume" , MIDVOLUME , 0 , HIGHVOLUME );
gGameSettings.uiMeanwhileScenesSeenFlags = iniReader.ReadUINT32 ("JA2 Game Settings","uiMeanwhileScenesSeenFlags" , 0 , 0 , UINT_MAX );
gGameSettings.fHideHelpInAllScreens = iniReader.ReadBoolean("JA2 Game Settings","fHideHelpInAllScreens" , FALSE );
gGameSettings.fOptions[TOPTION_SPEECH] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SPEECH" , TRUE );
gGameSettings.fOptions[TOPTION_MUTE_CONFIRMATIONS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_MUTE_CONFIRMATIONS" , FALSE );
gGameSettings.fOptions[TOPTION_SUBTITLES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SUBTITLES" , TRUE );
gGameSettings.fOptions[TOPTION_KEY_ADVANCE_SPEECH] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_KEY_ADVANCE_SPEECH" , FALSE );
gGameSettings.fOptions[TOPTION_ANIMATE_SMOKE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ANIMATE_SMOKE" , TRUE );
gGameSettings.fOptions[TOPTION_BLOOD_N_GORE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_BLOOD_N_GORE" , TRUE );
gGameSettings.fOptions[TOPTION_DONT_MOVE_MOUSE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DONT_MOVE_MOUSE" , FALSE );
gGameSettings.fOptions[TOPTION_OLD_SELECTION_METHOD] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_OLD_SELECTION_METHOD" , FALSE );
gGameSettings.fOptions[TOPTION_ALWAYS_SHOW_MOVEMENT_PATH] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALWAYS_SHOW_MOVEMENT_PATH" , FALSE );
gGameSettings.fOptions[TOPTION_SHOW_MISSES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_MISSES" , FALSE );
gGameSettings.fOptions[TOPTION_RTCONFIRM] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RTCONFIRM" , FALSE );
gGameSettings.fOptions[TOPTION_SLEEPWAKE_NOTIFICATION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SLEEPWAKE_NOTIFICATION" , TRUE );
gGameSettings.fOptions[TOPTION_USE_METRIC_SYSTEM] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_METRIC_SYSTEM" , TRUE );
gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_MERC_CASTS_LIGHT" , FALSE);
gGameSettings.fOptions[TOPTION_SMART_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SMART_CURSOR" , FALSE );
gGameSettings.fOptions[TOPTION_SNAP_CURSOR_TO_DOOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SNAP_CURSOR_TO_DOOR" , TRUE );
gGameSettings.fOptions[TOPTION_GLOW_ITEMS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GLOW_ITEMS" , TRUE );
gGameSettings.fOptions[TOPTION_TOGGLE_TREE_TOPS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TOGGLE_TREE_TOPS" , TRUE );
gGameSettings.fOptions[TOPTION_SMART_TREE_TOPS] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_SMART_TREE_TOPS" , FALSE );
gGameSettings.fOptions[TOPTION_TOGGLE_WIREFRAME] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TOGGLE_WIREFRAME" , TRUE );
gGameSettings.fOptions[TOPTION_3D_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_3D_CURSOR" , FALSE );
gGameSettings.fOptions[TOPTION_CTH_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_CTH_CURSOR" , TRUE );
gGameSettings.fOptions[TOPTION_GL_BURST_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GL_BURST_CURSOR" , TRUE );
gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_TAUNTS" , TRUE ); // changed from drop all - SANDRO
gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GL_HIGH_ANGLE" , FALSE );
if (!is_networked)
gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_REAL_TIME_SNEAK" , FALSE ); // Changed from aim levels restriction - SANDRO
else
gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] = FALSE;
gGameSettings.fOptions[TOPTION_SPACE_SELECTS_NEXT_SQUAD] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SPACE_SELECTS_NEXT_SQUAD" , TRUE );
gGameSettings.fOptions[TOPTION_SHOW_ITEM_SHADOW] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_ITEM_SHADOW" , TRUE );
gGameSettings.fOptions[TOPTION_SHOW_WEAPON_RANGE_IN_TILES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_WEAPON_RANGE_IN_TILES" , TRUE );
gGameSettings.fOptions[TOPTION_TRACERS_FOR_SINGLE_FIRE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACERS_FOR_SINGLE_FIRE" , FALSE );
gGameSettings.fOptions[TOPTION_RAIN_SOUND] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RAIN_SOUND" , TRUE );
if (!is_networked)
gGameSettings.fOptions[TOPTION_ALLOW_CROWS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_CROWS" , TRUE );
else
gGameSettings.fOptions[TOPTION_ALLOW_CROWS] = FALSE;
if (!is_networked)
gGameSettings.fOptions[TOPTION_ALLOW_SOLDIER_TOOLTIPS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_SOLDIER_TOOLTIPS" , TRUE );
else
gGameSettings.fOptions[TOPTION_ALLOW_SOLDIER_TOOLTIPS] = FALSE;
if (!is_networked)
gGameSettings.fOptions[TOPTION_USE_AUTO_SAVE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_AUTO_SAVE" , FALSE );
else
gGameSettings.fOptions[TOPTION_USE_AUTO_SAVE] = FALSE;
gGameSettings.fOptions[TOPTION_SILENT_SKYRIDER] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SILENT_SKYRIDER" , FALSE );
//gGameSettings.fOptions[TOPTION_LOW_CPU_USAGE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_LOW_CPU_USAGE" , FALSE );
gGameSettings.fOptions[TOPTION_ENHANCED_DESC_BOX] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ENHANCED_DESC_BOX" , TRUE );
if (!is_networked)
gGameSettings.fOptions[TOPTION_TOGGLE_TURN_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TOGGLE_TURN_MODE" , FALSE );
else
gGameSettings.fOptions[TOPTION_TOGGLE_TURN_MODE] = FALSE;
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_ALT_START_AIM" , FALSE); // Start at max aiming level instead of default no aiming
gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_ALT_PATHFINDING" , FALSE); // A* pathfinding
gGameSettings.fOptions[TOPTION_MERCENARY_FORMATIONS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_MERCENARY_FORMATIONS" , TRUE ); // Flugente: mercenary formations
gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_ENEMY_LOCATION" , FALSE); // sevenfm: show locations of known enemies
gGameSettings.fOptions[TOPTION_REPORT_MISS_MARGIN] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_REPORT_MISS_MARGIN" , FALSE ); // HEADROCK HAM 4: Shot offset report
gGameSettings.fOptions[TOPTION_USE_LOGICAL_BODYTYPES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_LOGICAL_BODYTYPES" , FALSE );
gGameSettings.fOptions[TOPTION_ALT_MAP_COLOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALT_MAP_COLOR" , FALSE ); // HEADROCK HAM 4: Strategic Map Colors
gGameSettings.fOptions[TOPTION_ALTERNATE_BULLET_GRAPHICS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALTERNATE_BULLET_GRAPHICS" , TRUE );
gGameSettings.fOptions[TOPTION_SHOW_MERC_RANKS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_MERC_RANKS" , FALSE );
gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_GEAR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_TACTICAL_FACE_GEAR" , TRUE );
gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_ICONS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_TACTICAL_FACE_ICONS" , TRUE );
gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_HEADER] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_CHEAT_MODE_OPTIONS_HEADER" , FALSE );
gGameSettings.fOptions[TOPTION_FORCE_BOBBY_RAY_SHIPMENTS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_FORCE_BOBBY_RAY_SHIPMENTS" , FALSE );
gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_END] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_CHEAT_MODE_OPTIONS_END" , FALSE );
gGameSettings.fOptions[TOPTION_DEBUG_MODE_OPTIONS_HEADER] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DEBUG_MODE_OPTIONS_HEADER" , FALSE );
gGameSettings.fOptions[TOPTION_SHOW_RESET_ALL_OPTIONS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_RESET_ALL_OPTIONS" , FALSE );
gGameSettings.fOptions[TOPTION_RESET_ALL_OPTIONS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RESET_ALL_OPTIONS" , FALSE );
gGameSettings.fOptions[TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE" , FALSE );
gGameSettings.fOptions[TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP" , FALSE );
gGameSettings.fOptions[TOPTION_RENDER_MOUSE_REGIONS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RENDER_MOUSE_REGIONS" , FALSE );
gGameSettings.fOptions[TOPTION_DEBUG_MODE_OPTIONS_END] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DEBUG_MODE_OPTIONS_END" , FALSE );
gGameSettings.fOptions[TOPTION_LAST_OPTION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_LAST_OPTION" , FALSE );
gGameSettings.fOptions[NUM_GAME_OPTIONS] = iniReader.ReadBoolean("JA2 Game Settings","NUM_GAME_OPTIONS" , FALSE );
gGameSettings.fOptions[TOPTION_HIDE_BULLETS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_HIDE_BULLETS" , FALSE );
gGameSettings.fOptions[TOPTION_TRACKING_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACKING_MODE" , TRUE );
gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DISABLE_CURSOR_SWAP" , FALSE );
gGameSettings.fOptions[TOPTION_QUIET_TRAINING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_TRAINING" , FALSE );
gGameSettings.fOptions[TOPTION_QUIET_REPAIRING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_REPAIRING" , FALSE );
gGameSettings.fOptions[TOPTION_QUIET_DOCTORING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_DOCTORING" , FALSE );
if (!is_networked)
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_AUTO_FAST_FORWARD_MODE" , FALSE );
else
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = FALSE;
// The "HIGHSPEED_TIMER" property from the ja2.ini is not set, disable the option
if (!IsHiSpeedClockMode())
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = FALSE;
gGameSettings.fOptions[TOPTION_ZOMBIES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ZOMBIES" , FALSE );
gGameSettings.fOptions[TOPTION_ENABLE_INVENTORY_POPUPS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ENABLE_INVENTORY_POPUPS" , TRUE ); // the_bob : enable popups for picking items from sector inv
gGameSettings.fOptions[TOPTION_SHOW_LAST_ENEMY] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_LAST_ENEMY" , FALSE );
gGameSettings.fOptions[TOPTION_SHOW_LBE_CONTENT] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_LBE_CONTENT" , TRUE );
gGameSettings.fOptions[TOPTION_INVERT_WHEEL] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_INVERT_WHEEL" , FALSE );
gGameSettings.fOptions[NUM_ALL_GAME_OPTIONS] = iniReader.ReadBoolean("JA2 Game Settings","NUM_ALL_GAME_OPTIONS" , FALSE );
DeleteShadeTableDir(); // ary-05/05/2009 : Might be bad idea for it to be here. But its gotta happen for some reason every now and then.
// : The call to DeleteShadeTableDir() used to coincided with reseting an older settings file.
// : Shade Table Dir is rebuilt when ever LoadShadeTable() cant find it. Its only around ~1.5 MB.
//
//Do checking to make sure the settings are valid
//
if( gGameSettings.bLastSavedGameSlot < 0 || gGameSettings.bLastSavedGameSlot >= NUM_SLOT )
gGameSettings.bLastSavedGameSlot = -1;
if( gGameSettings.ubMusicVolumeSetting > HIGHVOLUME )
gGameSettings.ubMusicVolumeSetting = MIDVOLUME;
if( gGameSettings.ubSoundEffectsVolume > HIGHVOLUME )
gGameSettings.ubSoundEffectsVolume = MIDVOLUME;
if( gGameSettings.ubSpeechVolume > HIGHVOLUME )
gGameSettings.ubSpeechVolume = MIDVOLUME;
//make sure that at least subtitles or speech is enabled
if( !gGameSettings.fOptions[ TOPTION_SUBTITLES ] && !gGameSettings.fOptions[ TOPTION_SPEECH ] )
{
gGameSettings.fOptions[ TOPTION_SUBTITLES ] = TRUE;
gGameSettings.fOptions[ TOPTION_SPEECH ] = TRUE;
}
//
// Set the settings
//
SetSoundEffectsVolume( gGameSettings.ubSoundEffectsVolume );
SetSpeechVolume( gGameSettings.ubSpeechVolume );
MusicSetVolume( gGameSettings.ubMusicVolumeSetting );
//if the user doesnt want the help screens present
if( gGameSettings.fHideHelpInAllScreens )
{
gHelpScreen.usHasPlayerSeenHelpScreenInCurrentScreen = 0;
}
else
{
//Set it so that every screens help will come up the first time ( the 'x' will be set )
gHelpScreen.usHasPlayerSeenHelpScreenInCurrentScreen = 0xffff;
}
return( TRUE );
}
catch(vfs::Exception)
{
// file does not exist, InitGamesettings() and then return.
// InitGamesettings() will also call SaveGameSettings().
InitGameSettings();
return(FALSE);
}
}
BOOLEAN LoadFeatureFlags()
{
try
{
CIniReader iniReader(FEATURE_FLAGS_FILE, TRUE); // force path even for non existing files
if (is_networked)
{
for (int a = 0; a < NUM_FEATURE_FLAGS; ++a)
gGameSettings.fFeatures[a] = FALSE;
}
else
{
// don't show an error if we can't find the setting
gGameSettings.fFeatures[FF_FEATURES_SCREEN] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_FEATURES_SCREEN", FALSE, FALSE);
gGameSettings.fFeatures[FF_NCTH] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_NCTH", FALSE, FALSE);
gGameSettings.fFeatures[FF_DROP_ALL] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_DROP_ALL", FALSE, FALSE);
gGameSettings.fFeatures[FF_DROP_ALL_DAMAGED] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_DROP_ALL_DAMAGED", FALSE, FALSE);
gGameSettings.fFeatures[FF_SUPPRESSION] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_SUPPRESSION", TRUE, FALSE);
gGameSettings.fFeatures[FF_TRIGGER_MASSIVE_ENEMY_COUNTERATTACK_AT_DRASSEN]= iniReader.ReadBoolean("JA2 Feature Flags", "FF_TRIGGER_MASSIVE_ENEMY_COUNTERATTACK_AT_DRASSEN", FALSE, FALSE);
gGameSettings.fFeatures[FF_AGGRESSIVE_STRATEGIC_AI] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_AGGRESSIVE_STRATEGIC_AI", FALSE, FALSE);
gGameSettings.fFeatures[FF_AGGRESSIVE_STRATEGIC_AI_2] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_AGGRESSIVE_STRATEGIC_AI_2", FALSE, FALSE);
gGameSettings.fFeatures[FF_INTEL] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_INTEL", TRUE, FALSE);
gGameSettings.fFeatures[FF_PRISONERS] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_PRISONERS", TRUE, FALSE);
gGameSettings.fFeatures[FF_MINES_REQUIRE_WORKERS] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_MINES_REQUIRE_WORKERS", FALSE, FALSE);
gGameSettings.fFeatures[FF_ENEMY_AMBUSHES] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ENEMY_AMBUSHES", TRUE, FALSE);
gGameSettings.fFeatures[FF_ENEMY_ASSASSINS] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ENEMY_ASSASSINS", FALSE, FALSE);
gGameSettings.fFeatures[FF_ENEMY_ROLES] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ENEMY_ROLES", TRUE, FALSE);
gGameSettings.fFeatures[FF_ENEMY_ROLE_MEDIC] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ENEMY_ROLE_MEDIC", TRUE, FALSE);
gGameSettings.fFeatures[FF_ENEMY_ROLE_OFFICER] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ENEMY_ROLE_OFFICER", TRUE, FALSE);
gGameSettings.fFeatures[FF_ENEMY_ROLE_GENERAL] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ENEMY_ROLE_GENERAL", FALSE, FALSE);
gGameSettings.fFeatures[FF_KERBERUS] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_KERBERUS", TRUE, FALSE);
gGameSettings.fFeatures[FF_FOOD] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_FOOD", FALSE, FALSE);
gGameSettings.fFeatures[FF_DISEASE] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_DISEASE", FALSE, FALSE);
gGameSettings.fFeatures[FF_DYNAMIC_OPINIONS] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_DYNAMIC_OPINIONS", FALSE, FALSE);
gGameSettings.fFeatures[FF_DYNAMIC_DIALOGUE] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_DYNAMIC_DIALOGUE", FALSE, FALSE);
gGameSettings.fFeatures[FF_ASD] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ASD", FALSE, FALSE);
gGameSettings.fFeatures[FF_ASD_HELICOPTERS] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ASD_HELICOPTERS", FALSE, FALSE);
gGameSettings.fFeatures[FF_ENEMY_VEHICLES_CAN_MOVE] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ENEMY_VEHICLES_CAN_MOVE", FALSE, FALSE);
gGameSettings.fFeatures[FF_ZOMBIES] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ZOMBIES", FALSE, FALSE);
gGameSettings.fFeatures[FF_BLOODCAT_RAIDS] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_BLOODCAT_RAIDS", FALSE, FALSE);
gGameSettings.fFeatures[FF_BANDIT_RAIDS] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_BANDIT_RAIDS", FALSE, FALSE);
gGameSettings.fFeatures[FF_ZOMBIE_RAIDS] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ZOMBIE_RAIDS", FALSE, FALSE);
gGameSettings.fFeatures[FF_MILITIA_VOLUNTEER_POOL] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_MILITIA_VOLUNTEER_POOL", FALSE, FALSE);
gGameSettings.fFeatures[FF_ALLOW_TACTICAL_MILITIA_COMMAND] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ALLOW_TACTICAL_MILITIA_COMMAND", TRUE, FALSE);
gGameSettings.fFeatures[FF_ALLOW_STRATEGIC_MILITIA_COMMAND] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ALLOW_STRATEGIC_MILITIA_COMMAND", FALSE, FALSE);
gGameSettings.fFeatures[FF_MILITIA_USE_SECTOR_EQUIPMENT] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_MILITIA_USE_SECTOR_EQUIPMENT", FALSE, FALSE);
gGameSettings.fFeatures[FF_MILITIA_REQUIRE_RESOURCES] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_MILITIA_REQUIRE_RESOURCES", FALSE, FALSE);
gGameSettings.fFeatures[FF_ENHANCED_CLOSE_COMBAT_SYSTEM] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ENHANCED_CLOSE_COMBAT_SYSTEM", TRUE, FALSE);
gGameSettings.fFeatures[FF_IMPROVED_INTERRUPT_SYSTEM] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_IMPROVED_INTERRUPT_SYSTEM", TRUE, FALSE);
gGameSettings.fFeatures[FF_OVERHEATING] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_OVERHEATING", FALSE, FALSE);
gGameSettings.fFeatures[FF_ALLOW_RAIN] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ALLOW_RAIN", TRUE, FALSE);
gGameSettings.fFeatures[FF_ALLOW_LIGHTNING] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ALLOW_LIGHTNING", TRUE, FALSE);
gGameSettings.fFeatures[FF_ALLOW_SANDSTORM] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ALLOW_SANDSTORM", TRUE, FALSE);
gGameSettings.fFeatures[FF_ALLOW_SNOW] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_ALLOW_SNOW", TRUE, FALSE);
gGameSettings.fFeatures[FF_MINI_EVENTS] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_MINI_EVENTS", FALSE, FALSE);
gGameSettings.fFeatures[FF_REBEL_COMMAND] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_REBEL_COMMAND", FALSE, FALSE);
gGameSettings.fFeatures[FF_STRATEGIC_TRANSPORT_GROUPS] = iniReader.ReadBoolean("JA2 Feature Flags", "FF_STRATEGIC_TRANSPORT_GROUPS", FALSE, FALSE);
}
}
catch(vfs::Exception)
{
// file does not exist, InitGamesettings() and then return.
// InitGamesettings() will also call SaveGameSettings().
InitFeatureFlags();
}
UpdateFeatureFlags();
return TRUE;
}
BOOLEAN SaveGameSettings()
{
if (!is_networked)
{
//Record the current settings into the game settins structure
gGameSettings.ubSoundEffectsVolume = (UINT8)GetSoundEffectsVolume( );
gGameSettings.ubSpeechVolume = (UINT8)GetSpeechVolume( );
gGameSettings.ubMusicVolumeSetting = (UINT8)MusicGetVolume( );
std::stringstream settings;
const char endl[] = "\r\n";
settings << ";******************************************************************************************************************************" << endl;
settings << ";******************************************************************************************************************************" << endl;
settings << "; Jagged Alliance 2 --Settings File-- " << endl;
settings << "; " << endl;
settings << "; Please note that this file is automatically generated by the game. " << endl;
settings << "; " << endl;
settings << "; While it is safe to change things from within this file, not all values are acceptable. Some may break the game, " << endl;
settings << "; some may be ignored, but most likely they will be acceptable or reset to a default value. " << endl;
settings << "; " << endl;
settings << "; Please note, This file and its contents are in a beta phase. Expect changes, however they should be minimal and automated." << endl;
settings << "; " << endl;
settings << ";******************************************************************************************************************************" << endl;
settings << endl;
settings << ";******************************************************************************************************************************" << endl;
settings << endl;
settings << "; The Current Game Setting Struct is defined as : " << endl;
settings << ";" << endl;
settings << "; typedef struct" << endl;
settings << "; {" << endl;
settings << "; INT8 bLastSavedGameSlot; // The last saved game number goes in here" << endl;
settings << "; UINT8 ubMusicVolumeSetting; // Volume Setting" << endl;
settings << "; UINT8 ubSoundEffectsVolume; // Volume Setting" << endl;
settings << "; UINT8 ubSpeechVolume; // Volume Setting" << endl;
settings << "; UINT8 fOptions[ NUM_ALL_GAME_OPTIONS ]; // Toggle Options (Speech, Subtitles, Show Tree Tops, etc.. )" << endl;
settings << "; UINT32 uiMeanwhileScenesSeenFlags; // Bit Vector describing seen 'mean whiles..'" << endl;
settings << "; BOOLEAN fHideHelpInAllScreens; // Controls Help \"do not show help again\" checkbox" << endl;
settings << "; } GAME_SETTINGS" << endl;
settings << ";" << endl;
settings << ";******************************************************************************************************************************" << endl;
settings << endl << endl;
settings << "[JA2 Game Settings]" << endl;
settings << "bLastSavedGameSlot = " << (int)gGameSettings.bLastSavedGameSlot << endl;
settings << "ubMusicVolumeSetting = " << (int)gGameSettings.ubMusicVolumeSetting << endl;
settings << "ubSoundEffectsVolume = " << (int)gGameSettings.ubSoundEffectsVolume << endl;
settings << "ubSpeechVolume = " << (int)gGameSettings.ubSpeechVolume << endl;
settings << "uiMeanwhileScenesSeenFlags = " << gGameSettings.uiMeanwhileScenesSeenFlags << endl;
settings << "fHideHelpInAllScreens = " << (gGameSettings.fHideHelpInAllScreens ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SPEECH = " << (gGameSettings.fOptions[TOPTION_SPEECH] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_MUTE_CONFIRMATIONS = " << (gGameSettings.fOptions[TOPTION_MUTE_CONFIRMATIONS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SUBTITLES = " << (gGameSettings.fOptions[TOPTION_SUBTITLES] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_KEY_ADVANCE_SPEECH = " << (gGameSettings.fOptions[TOPTION_KEY_ADVANCE_SPEECH] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_ANIMATE_SMOKE = " << (gGameSettings.fOptions[TOPTION_ANIMATE_SMOKE] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_BLOOD_N_GORE = " << (gGameSettings.fOptions[TOPTION_BLOOD_N_GORE] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_DONT_MOVE_MOUSE = " << (gGameSettings.fOptions[TOPTION_DONT_MOVE_MOUSE] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_OLD_SELECTION_METHOD = " << (gGameSettings.fOptions[TOPTION_OLD_SELECTION_METHOD] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_ALWAYS_SHOW_MOVEMENT_PATH = " << (gGameSettings.fOptions[TOPTION_ALWAYS_SHOW_MOVEMENT_PATH] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SHOW_MISSES = " << (gGameSettings.fOptions[TOPTION_SHOW_MISSES] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_RTCONFIRM = " << (gGameSettings.fOptions[TOPTION_RTCONFIRM] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SLEEPWAKE_NOTIFICATION = " << (gGameSettings.fOptions[TOPTION_SLEEPWAKE_NOTIFICATION] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_USE_METRIC_SYSTEM = " << (gGameSettings.fOptions[TOPTION_USE_METRIC_SYSTEM] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_MERC_CASTS_LIGHT = " << (gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] ? "TRUE" : "FALSE") << endl;
settings << "TOPTION_SMART_CURSOR = " << (gGameSettings.fOptions[TOPTION_SMART_CURSOR] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SNAP_CURSOR_TO_DOOR = " << (gGameSettings.fOptions[TOPTION_SNAP_CURSOR_TO_DOOR] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_GLOW_ITEMS = " << (gGameSettings.fOptions[TOPTION_GLOW_ITEMS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_TOGGLE_TREE_TOPS = " << (gGameSettings.fOptions[TOPTION_TOGGLE_TREE_TOPS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SMART_TREE_TOPS = " << (gGameSettings.fOptions[TOPTION_SMART_TREE_TOPS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_TOGGLE_WIREFRAME = " << (gGameSettings.fOptions[TOPTION_TOGGLE_WIREFRAME] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_3D_CURSOR = " << (gGameSettings.fOptions[TOPTION_3D_CURSOR] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_CTH_CURSOR = " << (gGameSettings.fOptions[TOPTION_CTH_CURSOR] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_GL_BURST_CURSOR = " << (gGameSettings.fOptions[TOPTION_GL_BURST_CURSOR] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_ALLOW_TAUNTS = " << (gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] ? "TRUE" : "FALSE" ) << endl; // changed from drop all - SANDRO
settings << "TOPTION_GL_HIGH_ANGLE = " << (gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_ALLOW_REAL_TIME_SNEAK = " << (gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] ? "TRUE" : "FALSE" ) << endl; // changed from restrict aim levels - SANDRO
settings << "TOPTION_SPACE_SELECTS_NEXT_SQUAD = " << (gGameSettings.fOptions[TOPTION_SPACE_SELECTS_NEXT_SQUAD] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SHOW_ITEM_SHADOW = " << (gGameSettings.fOptions[TOPTION_SHOW_ITEM_SHADOW] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SHOW_WEAPON_RANGE_IN_TILES = " << (gGameSettings.fOptions[TOPTION_SHOW_WEAPON_RANGE_IN_TILES] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_TRACERS_FOR_SINGLE_FIRE = " << (gGameSettings.fOptions[TOPTION_TRACERS_FOR_SINGLE_FIRE] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_RAIN_SOUND = " << (gGameSettings.fOptions[TOPTION_RAIN_SOUND] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_ALLOW_CROWS = " << (gGameSettings.fOptions[TOPTION_ALLOW_CROWS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_ALLOW_SOLDIER_TOOLTIPS = " << (gGameSettings.fOptions[TOPTION_ALLOW_SOLDIER_TOOLTIPS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_USE_AUTO_SAVE = " << (gGameSettings.fOptions[TOPTION_USE_AUTO_SAVE] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SILENT_SKYRIDER = " << (gGameSettings.fOptions[TOPTION_SILENT_SKYRIDER] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_ENHANCED_DESC_BOX = " << (gGameSettings.fOptions[TOPTION_ENHANCED_DESC_BOX] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_TOGGLE_TURN_MODE = " << (gGameSettings.fOptions[TOPTION_TOGGLE_TURN_MODE] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_ALT_MAP_COLOR = " << (gGameSettings.fOptions[TOPTION_ALT_MAP_COLOR] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 4: Alt Map Colors
settings << "TOPTION_ALTERNATE_BULLET_GRAPHICS = " << (gGameSettings.fOptions[TOPTION_ALTERNATE_BULLET_GRAPHICS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SHOW_MERC_RANKS = " << (gGameSettings.fOptions[TOPTION_SHOW_MERC_RANKS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SHOW_TACTICAL_FACE_GEAR = " << (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_GEAR] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SHOW_TACTICAL_FACE_ICONS = " << (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_ICONS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_DISABLE_CURSOR_SWAP = " << (gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_QUIET_TRAINING = " << (gGameSettings.fOptions[TOPTION_QUIET_TRAINING] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_QUIET_REPAIRING = " << (gGameSettings.fOptions[TOPTION_QUIET_REPAIRING] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_QUIET_DOCTORING = " << (gGameSettings.fOptions[TOPTION_QUIET_DOCTORING] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_AUTO_FAST_FORWARD_MODE = " << (gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SHOW_LAST_ENEMY = " << (gGameSettings.fOptions[TOPTION_SHOW_LAST_ENEMY] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SHOW_LBE_CONTENT = " << (gGameSettings.fOptions[TOPTION_SHOW_LBE_CONTENT] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_INVERT_WHEEL = " << (gGameSettings.fOptions[TOPTION_INVERT_WHEEL] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_ZOMBIES = " << (gGameSettings.fOptions[TOPTION_ZOMBIES] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_ENABLE_INVENTORY_POPUPS = " << (gGameSettings.fOptions[TOPTION_ENABLE_INVENTORY_POPUPS] ? "TRUE" : "FALSE" ) << endl; // the_bob : enable popups for picking items from sector inv
settings << "TOPTION_MERCENARY_FORMATIONS = " << (gGameSettings.fOptions[TOPTION_MERCENARY_FORMATIONS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_SHOW_ENEMY_LOCATION = " << (gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_ALT_START_AIM = " << (gGameSettings.fOptions[TOPTION_ALT_START_AIM] ? "TRUE" : "FALSE") << endl;
settings << "TOPTION_ALT_PATHFINDING = " << (gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] ? "TRUE" : "FALSE") << endl;
settings << "TOPTION_CHEAT_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_FORCE_BOBBY_RAY_SHIPMENTS = " << (gGameSettings.fOptions[TOPTION_FORCE_BOBBY_RAY_SHIPMENTS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_CHEAT_MODE_OPTIONS_END = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_END] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_DEBUG_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_REPORT_MISS_MARGIN = " << (gGameSettings.fOptions[TOPTION_REPORT_MISS_MARGIN] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 4: Shot offset report
settings << "TOPTION_USE_LOGICAL_BODYTYPES = " << (gGameSettings.fOptions[TOPTION_USE_LOGICAL_BODYTYPES] ? "TRUE" : "FALSE" ) << endl; // BIO
settings << "TOPTION_SHOW_RESET_ALL_OPTIONS = " << (gGameSettings.fOptions[TOPTION_SHOW_RESET_ALL_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_RESET_ALL_OPTIONS = " << (gGameSettings.fOptions[TOPTION_RESET_ALL_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE = " << (gGameSettings.fOptions[TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_RENDER_MOUSE_REGIONS = " << (gGameSettings.fOptions[TOPTION_RENDER_MOUSE_REGIONS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_DEBUG_MODE_OPTIONS_END = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_OPTIONS_END] ? "TRUE" : "FALSE" ) << endl;
settings << ";******************************************************************************************************************************" << endl;
settings << "; Options beyond this point are Code derived options, DO NOT CHANGE THESE UNLESS YOU KNOW WHAT YOUR ARE DOING." << endl;
settings << "; They are only included here for complete transparency for all GameSettings content. " << endl;
settings << ";******************************************************************************************************************************" << endl;
settings << "TOPTION_LAST_OPTION = " << (gGameSettings.fOptions[TOPTION_LAST_OPTION] ? "TRUE" : "FALSE" ) << endl;
settings << "NUM_GAME_OPTIONS = " << (gGameSettings.fOptions[NUM_GAME_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_HIDE_BULLETS = " << (gGameSettings.fOptions[TOPTION_HIDE_BULLETS] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_TRACKING_MODE = " << (gGameSettings.fOptions[TOPTION_TRACKING_MODE] ? "TRUE" : "FALSE" ) << endl;
settings << "NUM_ALL_GAME_OPTIONS = " << (gGameSettings.fOptions[NUM_ALL_GAME_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
try
{
vfs::COpenWriteFile wfile(GAME_SETTINGS_FILE,true,true);
wfile->write(settings.str().c_str(), settings.str().length());
}
catch(vfs::Exception& ex)
{
SGP_WARNING(ex.what());
vfs::CFile file(GAME_SETTINGS_FILE);
if(file.openWrite(true,true))
{
vfs::COpenWriteFile wfile( vfs::tWritableFile::cast(&file));
SGP_TRYCATCH_RETHROW(file.write(settings.str().c_str(), settings.str().length()),L"");
}
}
}
return( TRUE );
}
BOOLEAN SaveFeatureFlags()
{
if (!is_networked)
{
std::stringstream settings;
const char endl[] = "\r\n";
settings << ";******************************************************************************************************************************" << endl;
settings << ";******************************************************************************************************************************" << endl;
settings << "; Jagged Alliance 2 --Feature Flags File-- " << endl;
settings << "; " << endl;
settings << "; Please note that this file is automatically generated by the game. " << endl;
settings << "; " << endl;
settings << "; While it is safe to change things from within this file, not all values are acceptable. Some may break the game, " << endl;
settings << "; some may be ignored, but most likely they will be acceptable or reset to a default value. " << endl;
settings << "; " << endl;
settings << "; Please note, This file and its contents are in a beta phase. Expect changes, however they should be minimal and automated." << endl;
settings << "; " << endl;
settings << ";******************************************************************************************************************************" << endl;
settings << endl;
settings << ";******************************************************************************************************************************" << endl;
settings << endl;
settings << "[JA2 Feature Flags]" << endl;
settings << "FF_FEATURES_SCREEN = " << (gGameSettings.fFeatures[FF_FEATURES_SCREEN] ? "TRUE" : "FALSE") << endl;
settings << "FF_NCTH = " << (gGameSettings.fFeatures[FF_NCTH] ? "TRUE" : "FALSE") << endl;
settings << "FF_DROP_ALL = " << (gGameSettings.fFeatures[FF_DROP_ALL] ? "TRUE" : "FALSE") << endl;
settings << "FF_DROP_ALL_DAMAGED = " << (gGameSettings.fFeatures[FF_DROP_ALL_DAMAGED] ? "TRUE" : "FALSE") << endl;
settings << "FF_SUPPRESSION = " << (gGameSettings.fFeatures[FF_SUPPRESSION] ? "TRUE" : "FALSE") << endl;
settings << "FF_TRIGGER_MASSIVE_ENEMY_COUNTERATTACK_AT_DRASSEN= " << (gGameSettings.fFeatures[FF_TRIGGER_MASSIVE_ENEMY_COUNTERATTACK_AT_DRASSEN] ? "TRUE" : "FALSE") << endl;
settings << "FF_AGGRESSIVE_STRATEGIC_AI = " << (gGameSettings.fFeatures[FF_AGGRESSIVE_STRATEGIC_AI] ? "TRUE" : "FALSE") << endl;
settings << "FF_AGGRESSIVE_STRATEGIC_AI_2 = " << (gGameSettings.fFeatures[FF_AGGRESSIVE_STRATEGIC_AI_2] ? "TRUE" : "FALSE") << endl;
settings << "FF_INTEL = " << (gGameSettings.fFeatures[FF_INTEL] ? "TRUE" : "FALSE") << endl;
settings << "FF_PRISONERS = " << (gGameSettings.fFeatures[FF_PRISONERS] ? "TRUE" : "FALSE") << endl;
settings << "FF_MINES_REQUIRE_WORKERS = " << (gGameSettings.fFeatures[FF_MINES_REQUIRE_WORKERS] ? "TRUE" : "FALSE") << endl;
settings << "FF_ENEMY_AMBUSHES = " << (gGameSettings.fFeatures[FF_ENEMY_AMBUSHES] ? "TRUE" : "FALSE") << endl;
settings << "FF_ENEMY_ASSASSINS = " << (gGameSettings.fFeatures[FF_ENEMY_ASSASSINS] ? "TRUE" : "FALSE") << endl;
settings << "FF_ENEMY_ROLES = " << (gGameSettings.fFeatures[FF_ENEMY_ROLES] ? "TRUE" : "FALSE") << endl;
settings << "FF_ENEMY_ROLE_MEDIC = " << (gGameSettings.fFeatures[FF_ENEMY_ROLE_MEDIC] ? "TRUE" : "FALSE") << endl;
settings << "FF_ENEMY_ROLE_OFFICER = " << (gGameSettings.fFeatures[FF_ENEMY_ROLE_OFFICER] ? "TRUE" : "FALSE") << endl;
settings << "FF_ENEMY_ROLE_GENERAL = " << (gGameSettings.fFeatures[FF_ENEMY_ROLE_GENERAL] ? "TRUE" : "FALSE") << endl;
settings << "FF_KERBERUS = " << (gGameSettings.fFeatures[FF_KERBERUS] ? "TRUE" : "FALSE") << endl;
settings << "FF_FOOD = " << (gGameSettings.fFeatures[FF_FOOD] ? "TRUE" : "FALSE") << endl;
settings << "FF_DISEASE = " << (gGameSettings.fFeatures[FF_DISEASE] ? "TRUE" : "FALSE") << endl;
settings << "FF_DYNAMIC_OPINIONS = " << (gGameSettings.fFeatures[FF_DYNAMIC_OPINIONS] ? "TRUE" : "FALSE") << endl;
settings << "FF_DYNAMIC_DIALOGUE = " << (gGameSettings.fFeatures[FF_DYNAMIC_DIALOGUE] ? "TRUE" : "FALSE") << endl;
settings << "FF_ASD = " << (gGameSettings.fFeatures[FF_ASD] ? "TRUE" : "FALSE") << endl;
settings << "FF_ASD_HELICOPTERS = " << (gGameSettings.fFeatures[FF_ASD_HELICOPTERS] ? "TRUE" : "FALSE") << endl;
settings << "FF_ENEMY_VEHICLES_CAN_MOVE = " << (gGameSettings.fFeatures[FF_ENEMY_VEHICLES_CAN_MOVE] ? "TRUE" : "FALSE") << endl;
settings << "FF_ZOMBIES = " << (gGameSettings.fFeatures[FF_ZOMBIES] ? "TRUE" : "FALSE") << endl;
settings << "FF_BLOODCAT_RAIDS = " << (gGameSettings.fFeatures[FF_BLOODCAT_RAIDS] ? "TRUE" : "FALSE") << endl;
settings << "FF_BANDIT_RAIDS = " << (gGameSettings.fFeatures[FF_BANDIT_RAIDS] ? "TRUE" : "FALSE") << endl;
settings << "FF_ZOMBIE_RAIDS = " << (gGameSettings.fFeatures[FF_ZOMBIE_RAIDS] ? "TRUE" : "FALSE") << endl;
settings << "FF_MILITIA_VOLUNTEER_POOL = " << (gGameSettings.fFeatures[FF_MILITIA_VOLUNTEER_POOL] ? "TRUE" : "FALSE") << endl;
settings << "FF_ALLOW_TACTICAL_MILITIA_COMMAND = " << (gGameSettings.fFeatures[FF_ALLOW_TACTICAL_MILITIA_COMMAND] ? "TRUE" : "FALSE") << endl;
settings << "FF_ALLOW_STRATEGIC_MILITIA_COMMAND = " << (gGameSettings.fFeatures[FF_ALLOW_STRATEGIC_MILITIA_COMMAND] ? "TRUE" : "FALSE") << endl;
settings << "FF_MILITIA_USE_SECTOR_EQUIPMENT = " << (gGameSettings.fFeatures[FF_MILITIA_USE_SECTOR_EQUIPMENT] ? "TRUE" : "FALSE") << endl;
settings << "FF_MILITIA_REQUIRE_RESOURCES = " << (gGameSettings.fFeatures[FF_MILITIA_REQUIRE_RESOURCES] ? "TRUE" : "FALSE") << endl;
settings << "FF_ENHANCED_CLOSE_COMBAT_SYSTEM = " << (gGameSettings.fFeatures[FF_ENHANCED_CLOSE_COMBAT_SYSTEM] ? "TRUE" : "FALSE") << endl;
settings << "FF_IMPROVED_INTERRUPT_SYSTEM = " << (gGameSettings.fFeatures[FF_IMPROVED_INTERRUPT_SYSTEM] ? "TRUE" : "FALSE") << endl;
settings << "FF_OVERHEATING = " << (gGameSettings.fFeatures[FF_OVERHEATING] ? "TRUE" : "FALSE") << endl;
settings << "FF_ALLOW_RAIN = " << (gGameSettings.fFeatures[FF_ALLOW_RAIN] ? "TRUE" : "FALSE") << endl;
settings << "FF_ALLOW_LIGHTNING = " << (gGameSettings.fFeatures[FF_ALLOW_LIGHTNING] ? "TRUE" : "FALSE") << endl;
settings << "FF_ALLOW_SANDSTORM = " << (gGameSettings.fFeatures[FF_ALLOW_SANDSTORM] ? "TRUE" : "FALSE") << endl;
settings << "FF_ALLOW_SNOW = " << (gGameSettings.fFeatures[FF_ALLOW_SNOW] ? "TRUE" : "FALSE") << endl;
settings << "FF_MINI_EVENTS = " << (gGameSettings.fFeatures[FF_MINI_EVENTS] ? "TRUE" : "FALSE") << endl;
settings << "FF_REBEL_COMMAND = " << (gGameSettings.fFeatures[FF_REBEL_COMMAND] ? "TRUE" : "FALSE") << endl;
settings << "FF_STRATEGIC_TRANSPORT_GROUPS = " << (gGameSettings.fFeatures[FF_STRATEGIC_TRANSPORT_GROUPS] ? "TRUE" : "FALSE") << endl;
try
{
vfs::COpenWriteFile wfile(FEATURE_FLAGS_FILE,true,true);
wfile->write(settings.str().c_str(), settings.str().length());
}
catch(vfs::Exception& ex)
{
SGP_WARNING(ex.what());
vfs::CFile file(FEATURE_FLAGS_FILE);
if(file.openWrite(true,true))
{
vfs::COpenWriteFile wfile( vfs::tWritableFile::cast(&file));
SGP_TRYCATCH_RETHROW(file.write(settings.str().c_str(), settings.str().length()),L"");
}
}
UpdateFeatureFlags();
}
return( TRUE );
}
void InitGameSettings()
{
// completely blank out gGameSettings
memset( &gGameSettings, 0, sizeof( GAME_SETTINGS ) );
//Init the Game Settings
gGameSettings.bLastSavedGameSlot = -1;
gGameSettings.ubMusicVolumeSetting = 63;
gGameSettings.ubSoundEffectsVolume = 63;
gGameSettings.ubSpeechVolume = 63;
//Set the settings
SetSoundEffectsVolume( gGameSettings.ubSoundEffectsVolume );
SetSpeechVolume( gGameSettings.ubSpeechVolume );
MusicSetVolume( gGameSettings.ubMusicVolumeSetting );
gGameSettings.fOptions[ TOPTION_SPEECH ] = TRUE;
gGameSettings.fOptions[ TOPTION_MUTE_CONFIRMATIONS ] = FALSE;
gGameSettings.fOptions[ TOPTION_SUBTITLES ] = TRUE;
gGameSettings.fOptions[ TOPTION_KEY_ADVANCE_SPEECH ] = FALSE;
gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] = TRUE;
gGameSettings.fOptions[ TOPTION_BLOOD_N_GORE ] = TRUE;
gGameSettings.fOptions[ TOPTION_DONT_MOVE_MOUSE ] = FALSE;
gGameSettings.fOptions[ TOPTION_OLD_SELECTION_METHOD ] = FALSE;
gGameSettings.fOptions[ TOPTION_ALWAYS_SHOW_MOVEMENT_PATH ] = FALSE;
gGameSettings.fOptions[ TOPTION_SHOW_MISSES ] = FALSE;
gGameSettings.fOptions[ TOPTION_RTCONFIRM ] = FALSE;
gGameSettings.fOptions[ TOPTION_SLEEPWAKE_NOTIFICATION ] = TRUE;
gGameSettings.fOptions[ TOPTION_USE_METRIC_SYSTEM ] = TRUE;
gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] = FALSE;
gGameSettings.fOptions[ TOPTION_SMART_CURSOR ] = FALSE;
gGameSettings.fOptions[ TOPTION_SNAP_CURSOR_TO_DOOR ] = TRUE;
gGameSettings.fOptions[ TOPTION_GLOW_ITEMS ] = TRUE;
gGameSettings.fOptions[ TOPTION_TOGGLE_TREE_TOPS ] = TRUE;
gGameSettings.fOptions[ TOPTION_SMART_TREE_TOPS ] = FALSE;
gGameSettings.fOptions[ TOPTION_TOGGLE_WIREFRAME ] = TRUE;
gGameSettings.fOptions[ TOPTION_3D_CURSOR ] = FALSE;
gGameSettings.fOptions[ TOPTION_CTH_CURSOR ] = TRUE;
//Madd:
gGameSettings.fOptions[ TOPTION_GL_BURST_CURSOR ] = TRUE;
gGameSettings.fOptions[ TOPTION_ALLOW_TAUNTS ] = TRUE; // changed - SANDRO
gGameSettings.fOptions[ TOPTION_GL_HIGH_ANGLE ] = FALSE;
gGameSettings.fOptions[ TOPTION_ALLOW_REAL_TIME_SNEAK ] = FALSE; // changed - SANDRO
//lalien
gGameSettings.fOptions[ TOPTION_SPACE_SELECTS_NEXT_SQUAD ] = TRUE;
gGameSettings.fOptions[ TOPTION_SHOW_ITEM_SHADOW ] = TRUE;
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] = TRUE;
gGameSettings.fOptions[ TOPTION_TRACERS_FOR_SINGLE_FIRE ] = FALSE;
gGameSettings.fOptions[ TOPTION_RAIN_SOUND ] = TRUE;
gGameSettings.fOptions[ TOPTION_ALLOW_CROWS ] = TRUE;
gGameSettings.fOptions[ TOPTION_ALLOW_SOLDIER_TOOLTIPS ] = TRUE;
gGameSettings.fOptions[ TOPTION_USE_AUTO_SAVE ] = FALSE;
gGameSettings.fOptions[ TOPTION_SILENT_SKYRIDER ] = FALSE;
//gGameSettings.fOptions[ TOPTION_LOW_CPU_USAGE ] = FALSE;
gGameSettings.fOptions[ TOPTION_ENHANCED_DESC_BOX ] = TRUE;
// arynn
gGameSettings.fOptions[ TOPTION_TOGGLE_TURN_MODE ] = FALSE;
// HEADROCK HAM 4:
gGameSettings.fOptions[ TOPTION_ALT_MAP_COLOR ] = FALSE;
gGameSettings.fOptions[ TOPTION_ALTERNATE_BULLET_GRAPHICS ] = TRUE;
gGameSettings.fOptions[ TOPTION_SHOW_MERC_RANKS ] = TRUE;
// WANNE:
gGameSettings.fOptions[ TOPTION_SHOW_TACTICAL_FACE_GEAR ] = TRUE;
gGameSettings.fOptions[ TOPTION_SHOW_TACTICAL_FACE_ICONS ] = TRUE;
gGameSettings.fOptions[ TOPTION_REPORT_MISS_MARGIN ] = FALSE;
// BIO
gGameSettings.fOptions[ TOPTION_USE_LOGICAL_BODYTYPES ] = FALSE;
gGameSettings.fOptions[ TOPTION_DISABLE_CURSOR_SWAP ] = FALSE;
gGameSettings.fOptions[ TOPTION_QUIET_TRAINING ] = FALSE;
gGameSettings.fOptions[ TOPTION_QUIET_REPAIRING ] = FALSE;
gGameSettings.fOptions[ TOPTION_QUIET_DOCTORING ] = FALSE;
gGameSettings.fOptions[ TOPTION_AUTO_FAST_FORWARD_MODE ] = FALSE;
gGameSettings.fOptions[ TOPTION_ZOMBIES ] = FALSE; // Flugente Zombies
gGameSettings.fOptions[ TOPTION_ENABLE_INVENTORY_POPUPS ] = TRUE; // the_bob : enable popups for picking items from sector inv
gGameSettings.fOptions[TOPTION_SHOW_LAST_ENEMY] = FALSE;
gGameSettings.fOptions[TOPTION_SHOW_LBE_CONTENT] = TRUE;
gGameSettings.fOptions[TOPTION_INVERT_WHEEL] = FALSE;
gGameSettings.fOptions[ TOPTION_MERCENARY_FORMATIONS ] = FALSE; // Flugente: mercenary formations
gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] = FALSE; // sevenfm: show locations of known enemies
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = FALSE;
gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] = FALSE;
// arynn: Cheat/Debug Menu
gGameSettings.fOptions[ TOPTION_CHEAT_MODE_OPTIONS_HEADER ] = FALSE;
gGameSettings.fOptions[ TOPTION_FORCE_BOBBY_RAY_SHIPMENTS ] = FALSE; // force all pending Bobby Ray shipments
gGameSettings.fOptions[ TOPTION_CHEAT_MODE_OPTIONS_END ] = FALSE;
gGameSettings.fOptions[ TOPTION_DEBUG_MODE_OPTIONS_HEADER ] = FALSE; // an example options screen options header (pure text)
gGameSettings.fOptions[ TOPTION_SHOW_RESET_ALL_OPTIONS ] = FALSE; // failsafe show/hide option to reset all options
gGameSettings.fOptions[ TOPTION_REPORT_MISS_MARGIN ] = FALSE;
gGameSettings.fOptions[ TOPTION_RESET_ALL_OPTIONS ] = FALSE; // a do once and reset self option (button like effect)
gGameSettings.fOptions[ TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE ] = FALSE; // allow debug options that were set in debug.exe to continue in a rel.exe (debugging release can be beneficial)
gGameSettings.fOptions[ TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP ] = FALSE; // an example option that will show/hide other options
gGameSettings.fOptions[ TOPTION_RENDER_MOUSE_REGIONS ] = FALSE; // an example of a DEBUG build option
gGameSettings.fOptions[ TOPTION_DEBUG_MODE_OPTIONS_END ] = FALSE; // an example options screen options divider (pure text)
// enum control options (not real options but included here for the sake of complete control of values)
//gGameSettings.ubSizeOfDisplayCover = 16;
//gGameSettings.ubSizeOfLOS = 16;
// ary-05/05/2009 : TOPTION_LAST_OPTION is THE LAST options screen toggle option that exists. (its still an option, and its < NUM_GAME_OPTIONS)
// : intended for debugging options screen final page. test to avoid last page over or under extension.
// : might be useful in future of toggle option content developement.
gGameSettings.fOptions[ TOPTION_LAST_OPTION ] = FALSE; // doesnt do anything except exist
gGameSettings.fOptions[ NUM_GAME_OPTIONS ] = FALSE; // Toggles prior to this will be able to be toggled by the player
// JA2Gold
gGameSettings.fOptions[ TOPTION_HIDE_BULLETS ] = FALSE;
gGameSettings.fOptions[ TOPTION_TRACKING_MODE ] = TRUE;
gGameSettings.fOptions[ NUM_ALL_GAME_OPTIONS ] = FALSE; // Absolute final end of enum
//Since we just set the settings, save them
SaveGameSettings();
}
void InitFeatureFlags()
{
for (int a = 0; a < NUM_FEATURE_FLAGS; ++a)
gGameSettings.fFeatures[a] = FALSE;
SaveFeatureFlags();
}
void InitGameOptions()
{
memset( &gGameOptions, 0, sizeof( GAME_OPTIONS ) );
gGameOptions.ubBobbyRayQuality = BR_GOOD;
gGameOptions.ubBobbyRayQuantity = BR_GOOD;
gGameOptions.fGunNut = TRUE;
gGameOptions.fAirStrikes = FALSE;
gGameOptions.ubGameStyle = STYLE_SCIFI;
gGameOptions.ubDifficultyLevel = DIF_LEVEL_MEDIUM;
//CHRISL: override default inventory mode when in low res
if(IsNIVModeValid(true) == FALSE)
{
gGameOptions.ubInventorySystem = INVENTORY_OLD;
gGameOptions.ubAttachmentSystem = ATTACHMENT_OLD;
}
else
{
gGameOptions.ubInventorySystem = INVENTORY_NEW;
gGameOptions.ubAttachmentSystem = ATTACHMENT_OLD;
}
gGameOptions.fTurnTimeLimit = FALSE;
gGameOptions.fIronManMode = FALSE;
gGameOptions.ubIronManMode = 0;
// following added by SANDRO
if (gGameExternalOptions.fReadProfileDataFromXML)
gGameOptions.fNewTraitSystem = TRUE;
else
gGameOptions.fNewTraitSystem = FALSE;
gGameOptions.ubProgressSpeedOfItemsChoices = ITEM_PROGRESS_NORMAL;
}
// WDS: These HAVE to total 100% at all times!!!
//#define PROGRESS_PORTION_KILLS 25
//#define PROGRESS_PORTION_CONTROL 25
//#define PROGRESS_PORTION_INCOME 50
// The following are for fixing problems when reading the .ini file
#define COUNT_STANDARD_MALE_SLOTS 3
#define FIRST_STANDARD_MALE_SLOT 51
#define COUNT_STANDARD_FEMALE_SLOTS 3
#define FIRST_STANDARD_FEMALE_SLOT 54
// Snap: Read options from an INI file in the default of custom Data directory
void LoadGameExternalOptions()
{
//Kaiden: Setting Ja2_Options.ini file to be read
CIniReader iniReader(GAME_EXTERNAL_OPTIONS_FILE);
//################# System Limit Settings #################
// WDS - make number of mercenaries, etc. be configurable. Note: Changing one of these can render savegames unloadable.
gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs = iniReader.ReadInteger("System Limit Settings","MAX_NUMBER_PLAYER_MERCS", 24, 1, CODE_MAXIMUM_NUMBER_OF_PLAYER_MERCS);
gGameExternalOptions.ubGameMaximumNumberOfPlayerVehicles = iniReader.ReadInteger("System Limit Settings","MAX_NUMBER_PLAYER_VEHICLES", 2, 2, CODE_MAXIMUM_NUMBER_OF_PLAYER_VEHICLES);
gGameExternalOptions.ubGameMaximumNumberOfEnemies = iniReader.ReadInteger("System Limit Settings","MAX_NUMBER_ENEMIES_IN_TACTICAL", 32, 16, CODE_MAXIMUM_NUMBER_OF_ENEMIES);
gGameExternalOptions.ubGameMaximumNumberOfCreatures = iniReader.ReadInteger("System Limit Settings","MAX_NUMBER_CREATURES_IN_TACTICAL", 32, 0, CODE_MAXIMUM_NUMBER_OF_CREATURES);
gGameExternalOptions.ubGameMaximumNumberOfRebels = iniReader.ReadInteger("System Limit Settings","MAX_NUMBER_MILITIA_IN_TACTICAL", 32, 16, CODE_MAXIMUM_NUMBER_OF_REBELS);
gGameExternalOptions.ubGameMaximumNumberOfCivilians = iniReader.ReadInteger("System Limit Settings","MAX_NUMBER_CIVS_IN_TACTICAL", 32, 16, CODE_MAXIMUM_NUMBER_OF_CIVS);
gGameExternalOptions.iMaxEnemyGroupSize = iniReader.ReadInteger("System Limit Settings","MAX_STRATEGIC_ENEMY_GROUP_SIZE",20, 10, 100);
//JMich
gGameExternalOptions.guiMaxItemSize = iniReader.ReadInteger("System Limit Settings","MAX_ITEM_SIZE",34, 0, 65000);
gGameExternalOptions.guiMaxWeaponSize = iniReader.ReadInteger("System Limit Settings","MAX_WEAPON_SIZE", 9, 0, 32000);
gGameExternalOptions.guiOIVSizeNumber = iniReader.ReadInteger("System Limit Settings","OLD_INVENTORY_ITEM_NUMBER", 99, 0, 65535);
// Flugente: this change allows to target head/torso/legs of prone targets. This option will be removed once accepted
gGameExternalOptions.fAllowTargetHeadAndLegIfProne = iniReader.ReadBoolean( "System Limit Settings", "ALLOW_TARGET_HEADANDLEG_IFPRONE", TRUE );
//################# Data File Settings #################
// WANNE: Always use prof.dat??
gGameExternalOptions.fUseDifficultyBasedProfDat = iniReader.ReadBoolean("Data File Settings", "USE_DIFFICULTY_BASED_PROF_DAT", TRUE);
// HEADROCK PROFEX/3.6: Activate this to read Profile data from MercProfiles.XML and MercOpinions.XML
gGameExternalOptions.fReadProfileDataFromXML = iniReader.ReadBoolean("Data File Settings","READ_PROFILE_DATA_FROM_XML", TRUE);
// HEADROCK PROFEX/3.6: Activate this to write Profile data to MercProfiles Out.XML and MercOpinions Out.XML. This can be used to convert PROF.DAT to XML format.
gGameExternalOptions.fWriteProfileDataToXML = iniReader.ReadBoolean("Data File Settings","WRITE_PROFILE_DATA_TO_XML", FALSE);
// Use "EnemyWeaponDrop.XML" etc. for determining which items are dropped?
gGameExternalOptions.ubEnemiesItemDrop = iniReader.ReadInteger("Data File Settings","USE_EXTERNALIZED_ENEMY_ITEM_DROPS", 0, 0, 1);
//Madd: use xml file for tilesets
gGameExternalOptions.fUseXmlTileSets = iniReader.ReadBoolean("Data File Settings","USE_XML_TILESETS", FALSE);
//Madd: set number of pItem files to be used
gGameExternalOptions.ubNumPItems = iniReader.ReadInteger("Data File Settings","NUM_P_ITEMS", 3, 3, MAX_PITEMS);
//################# Backgrounds #################
// Flugente: backgrounds
gGameExternalOptions.fBackGround = iniReader.ReadBoolean("Backgrounds", "ENABLE_BACKGROUNDS", TRUE );
// Kitty: show additional IMP backgrounds and determine which IMP backgrounds are available at selection based on choices for skills, chararcter traits and disabilities