forked from 1dot13/source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameInitOptionsScreen.cpp
4797 lines (3916 loc) · 165 KB
/
GameInitOptionsScreen.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 "GameInitOptionsScreen.h"
#include "GameSettings.h"
#include "Utilities.h"
#include "wCheck.h"
#include "Font Control.h"
#include "WordWrap.h"
#include "Render Dirty.h"
#include "Input.h"
#include "Options Screen.h"
#include "English.h"
#include "Sysutil.h"
#include "Fade Screen.h"
#include "Cursor Control.h"
#include "Music Control.h"
#include "cursors.h"
#include "Intro.h"
#include "Text.h"
#include "_Ja25EnglishText.h"
#include "Soldier Profile.h"
#include "gameloop.h"
#include "connect.h"
#include "saveloadscreen.h"
#ifdef JA2UB
#include "ub_config.h"
#endif
#include <vfs/Core/vfs.h>
#include <vfs/Core/vfs_init.h>
#include <vfs/Tools/vfs_property_container.h>
#include <vfs/Core/vfs_os_functions.h>
#ifdef JA2UB
// *********************************
// Unfinished Business: Initial Game Screen
// *********************************
//////////////////////////////////////////////////////////////
// SANDRO - the start-new-game screen has been changed a lot
//////////////////////////////////////////////////////////////
////////////////////////////////////////////
//
// Global Defines
//
///////////////////////////////////////////
#define GIO_TITLE_FONT FONT14ARIAL
#define GIO_TITLE_COLOR FONT_MCOLOR_WHITE
#define GIO_TOGGLE_TEXT_FONT FONT10ARIAL
#define GIO_TOGGLE_TEXT_COLOR FONT_MCOLOR_WHITE
//buttons
#define GIO_CANCEL_X iScreenWidthOffset + ((320 - 115) / 2)
#define GIO_113FEATURES_X iScreenWidthOffset + 263
#define GIO_BTN_START_X iScreenWidthOffset + 320 + 105
#define GIO_BTN_START_Y iScreenHeightOffset + 435
//main title
#define GIO_MAIN_TITLE_X 0
#define GIO_MAIN_TITLE_Y iScreenHeightOffset + 10
#define GIO_MAIN_TITLE_WIDTH SCREEN_WIDTH
////////////////////////////////////////////////////////////////////////////////////////////////////
//radio box locations
#define GIO_GAP_BN_SETTINGS 35
#define GIO_OFFSET_TO_TEXT 36
#define GIO_OFFSET_TO_TOGGLE_BOX 180
#define GIO_OFFSET_TO_TOGGLE_BOX_Y 9
#define GIO_TITLE_DISTANCE 30 // higher means closer
// ---------------------------------
// Y-Offset for Combo-Controls
#define COMBO_Y_OFFSET 63
// Y-Offset for Check-Controls
#define CHECK_Y_OFFSET 50
#define CORRECTION_Y_OFFSET (COMBO_Y_OFFSET - CHECK_Y_OFFSET)
// X-Offset for Checkbox-Controls
#define CHECK_X_OFFSET 36
#define COMBO_X_OFFSET 0
#define CHECK_WIDTH (GIO_OFFSET_TO_TOGGLE_BOX - GIO_OFFSET_TO_TEXT)
#define COMBO_WIDTH (GIO_OFFSET_TO_TOGGLE_BOX - GIO_OFFSET_TO_TEXT)
/*********************************
FIRST COLUMN
**********************************/
#define FIRST_COLUMN_X iScreenWidthOffset + 10
#define FIRST_COLUMN_Y iScreenHeightOffset + 75
#define GIO_DIF_SETTING_X FIRST_COLUMN_X + COMBO_X_OFFSET
#define GIO_DIF_SETTING_Y FIRST_COLUMN_Y
#define GIO_DIF_SETTING_WIDTH COMBO_WIDTH
#define GIO_TRAITS_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
#define GIO_TRAITS_SETTING_Y GIO_DIF_SETTING_Y + CHECK_Y_OFFSET
#define GIO_TRAITS_SETTING_WIDTH CHECK_WIDTH
#define GIO_GAME_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
#define GIO_GAME_SETTING_Y GIO_TRAITS_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
#define GIO_GAME_SETTING_WIDTH CHECK_WIDTH
#define GIO_IRON_MAN_SETTING_X FIRST_COLUMN_X + COMBO_X_OFFSET//FIRST_COLUMN_X + CHECK_X_OFFSET
#define GIO_IRON_MAN_SETTING_Y GIO_GAME_SETTING_Y + COMBO_Y_OFFSET + CORRECTION_Y_OFFSET//GIO_GAME_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
#define GIO_IRON_MAN_SETTING_WIDTH COMBO_WIDTH//CHECK_WIDTH
#define GIO_TIMED_TURN_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
#define GIO_TIMED_TURN_SETTING_Y GIO_IRON_MAN_SETTING_Y + CHECK_Y_OFFSET// + CORRECTION_Y_OFFSET
#define GIO_TIMED_TURN_SETTING_WIDTH CHECK_WIDTH
#define GIO_TERRORISTS_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
#define GIO_TERRORISTS_SETTING_Y GIO_IRON_MAN_SETTING_Y + CHECK_Y_OFFSET// + CORRECTION_Y_OFFSET
#define GIO_TERRORISTS_SETTING_WIDTH CHECK_WIDTH
/*********************************
SECOND COLUMN
**********************************/
#define SECOND_COLUMN_X iScreenWidthOffset + 210
#define SECOND_COLUMN_Y FIRST_COLUMN_Y
#define GIO_INV_SETTING_X SECOND_COLUMN_X + COMBO_X_OFFSET
#define GIO_INV_SETTING_Y SECOND_COLUMN_Y
#define GIO_INV_SETTING_WIDTH COMBO_WIDTH
#define GIO_PROGRESS_SETTING_X SECOND_COLUMN_X + COMBO_X_OFFSET
#define GIO_PROGRESS_SETTING_Y GIO_INV_SETTING_Y + COMBO_Y_OFFSET
#define GIO_PROGRESS_SETTING_WIDTH COMBO_WIDTH
#define GIO_GUN_SETTING_X SECOND_COLUMN_X + CHECK_X_OFFSET
#define GIO_GUN_SETTING_Y GIO_PROGRESS_SETTING_Y + CHECK_Y_OFFSET
#define GIO_GUN_SETTING_WIDTH CHECK_WIDTH
/*********************************
THIRD COLUMN
**********************************/
#define THIRD_COLUMN_X iScreenWidthOffset + 413
#define THIRD_COLUMN_Y FIRST_COLUMN_Y
#define GIO_SQUAD_SIZE_SETTING_X THIRD_COLUMN_X + COMBO_X_OFFSET
#define GIO_SQUAD_SIZE_SETTING_Y THIRD_COLUMN_Y
#define GIO_SQUAD_SIZE_SETTING_WIDTH COMBO_WIDTH
#define GIO_BR_QUALITY_SETTING_X THIRD_COLUMN_X + COMBO_X_OFFSET
#define GIO_BR_QUALITY_SETTING_Y GIO_SQUAD_SIZE_SETTING_Y + COMBO_Y_OFFSET
#define GIO_BR_QUALITY_SETTING_WIDTH COMBO_WIDTH
#define GIO_BR_QUANTITY_SETTING_X THIRD_COLUMN_X + COMBO_X_OFFSET
#define GIO_BR_QUANTITY_SETTING_Y GIO_BR_QUALITY_SETTING_Y + COMBO_Y_OFFSET
#define GIO_BR_QUANTITY_SETTING_WIDTH COMBO_WIDTH
////radio box locations
//#define GIO_GAP_BN_SETTINGS 35
//#define GIO_OFFSET_TO_TEXT 36
//#define GIO_OFFSET_TO_TOGGLE_BOX 180
//#define GIO_OFFSET_TO_TOGGLE_BOX_Y 9
//
//#define GIO_TITLE_DISTANCE 30 // higher means closer
//
//#define GIO_DIF_SETTING_X iScreenWidthOffset + 48
//#define GIO_DIF_SETTING_Y iScreenHeightOffset + 55
//#define GIO_DIF_SETTING_WIDTH GIO_OFFSET_TO_TOGGLE_BOX - GIO_OFFSET_TO_TEXT
//
//#define GIO_IMP_SETTING_X GIO_DIF_SETTING_X
//#define GIO_IMP_SETTING_Y GIO_DIF_SETTING_Y + 63
//#define GIO_IMP_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
//
//// old/new traits
//#define GIO_TRAITS_SETTING_X GIO_DIF_SETTING_X + 36
//#define GIO_TRAITS_SETTING_Y GIO_IMP_SETTING_Y + 52
//#define GIO_TRAITS_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
//
//// Madd
//#define GIO_GAME_SETTING_X GIO_TRAITS_SETTING_X
//#define GIO_GAME_SETTING_Y GIO_TRAITS_SETTING_Y + 67
//#define GIO_GAME_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
//
//#define GIO_IRON_MAN_SETTING_X GIO_TRAITS_SETTING_X
//#define GIO_IRON_MAN_SETTING_Y GIO_GAME_SETTING_Y + 67
//#define GIO_IRON_MAN_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
//
//// Tex and Jon
//#define GIO_TERRORISTS_SETTING_X GIO_TRAITS_SETTING_X
//#define GIO_TERRORISTS_SETTING_Y GIO_IRON_MAN_SETTING_Y + 67
//#define GIO_TERRORISTS_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
//
//#define GIO_BR_SETTING_X iScreenWidthOffset + 370
//#define GIO_BR_SETTING_Y GIO_DIF_SETTING_Y
//#define GIO_BR_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
//
//#define GIO_SQUAD_SIZE_SETTING_X GIO_BR_SETTING_X
//#define GIO_SQUAD_SIZE_SETTING_Y GIO_BR_SETTING_Y + 63
//#define GIO_SQUAD_SIZE_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
//
//#define GIO_INV_SETTING_X GIO_SQUAD_SIZE_SETTING_X
//#define GIO_INV_SETTING_Y GIO_SQUAD_SIZE_SETTING_Y + 63
//#define GIO_INV_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
//
//#define GIO_GUN_SETTING_X GIO_INV_SETTING_X + 36
//#define GIO_GUN_SETTING_Y GIO_INV_SETTING_Y + 56 + 67
//#define GIO_GUN_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
//
//#define GIO_CACHES_SETTING_X GIO_GUN_SETTING_X
//#define GIO_CACHES_SETTING_Y GIO_GUN_SETTING_Y + 67
//#define GIO_CACHES_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
//
//#define GIO_TIMED_TURN_SETTING_X GIO_GUN_SETTING_X
//#define GIO_TIMED_TURN_SETTING_Y GIO_IRON_MAN_SETTING_Y
//#define GIO_TIMED_TURN_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
//
//#define GIO_PROGRESS_SETTING_X GIO_SQUAD_SIZE_SETTING_X
//#define GIO_PROGRESS_SETTING_Y GIO_TERRORISTS_SETTING_Y + 13
//#define GIO_PROGRESS_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
// INI File
#define JA2SP_INI_FILENAME "ja2_sp.ini"
// INI Section
#define JA2SP_INI_INITIAL_SECTION "JA2 Singleplayer Initial Settings"
// INI Properties
#define JA2SP_DIFFICULTY_LEVEL "DIFFICULTY_LEVEL"
#define JA2SP_BOBBY_RAY_QUALITY "BOBBY_RAY_QUALITY"
#define JA2SP_BOBBY_RAY_QUANTITY "BOBBY_RAY_QUANTITY"
#define JA2SP_PROGRESS_SPEED_OF_ITEM_CHOICES "PROGRESS_SPEED_OF_ITEM_CHOICES"
#define JA2SP_SKILL_TRAITS "SKILL_TRAITS"
#define JA2SP_INVENTORY_ATTACHMENTS "INVENTORY_ATTACHMENTS"
#define JA2SP_GAME_STYLE "GAME_STYLE"
#define JA2SP_EXTRA_DIFFICULTY "EXTRA_DIFFICULTY"
#define JA2SP_AVAILABLE_ARSENAL "AVAILABLE_ARSENAL"
#define JA2SP_NUMBER_OF_TERRORISTS "NUMBER_OF_TERRORISTS"
#define JA2SP_SECRET_WEAPON_CACHES "SECRET_WEAPON_CACHES"
#define JA2SP_SQUAD_SIZE "SQUAD_SIZE"
// Exclusive UB
#define JA2SP_UB_RPC_TEX_AND_JOHN "RPC_TEX_AND_JOHN"
#define JA2SP_UB_RANDOM_MANUEL_TEXT "RANDOM_MANUEL_TEXT"
DIFFICULTY_SETTINGS_VALUES zDiffSetting[MAX_DIF_LEVEL];
UINT8 MaxDifficultySettingsValues;
enum
{
GIO_TRAITS_OLD,
GIO_TRAITS_NEW,
NUM_TRAIT_OPTIONS,
};
// Game Settings options
enum
{
GIO_TEXT_OFF,
GIO_TEXT_ON,
NUM_TEXT_STYLES,
};
enum
{
GIO_REALISTIC,
GIO_SCI_FI,
NUM_GAME_STYLES,
};
// Iron man mode
enum
{
GIO_CAN_SAVE,
GIO_IRON_MAN,
GIO_SOFT_IRON_MAN,
GIO_EXTREME_IRON_MAN,
NUM_SAVE_OPTIONS,
};
enum
{
GIO_TEX_JOHN_RANDOM,
GIO_TEX_AND_JOHN,
NUM_RPC_UB_OPTIONS,
};
enum
{
GIO_PROGRESS_VERY_SLOW,
GIO_PROGRESS_SLOW,
GIO_PROGRESS_NORMAL,
GIO_PROGRESS_FAST,
GIO_PROGRESS_VERY_FAST,
NUM_PROGRESS_OPTIONS,
};
// New inventory options
enum
{
GIO_INV_OLD,
GIO_INV_NEW,
GIO_INV_NEW_NAS, // WANNE: Added NAS to the start new game screen
NUM_INV_OPTIONS,
};
enum
{
GIO_SQUAD_SIZE_6,
GIO_SQUAD_SIZE_8,
GIO_SQUAD_SIZE_10,
NUM_SQUAD_SIZE_OPTIONS,
};
enum
{
GIO_BUTTON_OFF,
GIO_BUTTON_ON,
GIO_NUM_ONOFF_BUTTONS,
};
// Gun options
enum
{
GIO_REDUCED_GUNS,
GIO_GUN_NUT,
NUM_GUN_OPTIONS,
};
// Timed turns setting (Multiplayer exclusive)
enum
{
GIO_NO_TIMED_TURNS,
GIO_TIMED_TURNS,
GIO_NUM_TIMED_TURN_OPTIONS,
};
//enum for different states of game
enum
{
GIO_NOTHING,
GIO_CANCEL,
GIO_EXIT,
GIO_IRON_MAN_MODE,
GIO_113FEATURES,
MP_LOAD
};
////////////////////////////////////////////
//
// Global Variables
//
///////////////////////////////////////////
BOOLEAN gfGIOScreenEntry = TRUE;
BOOLEAN gfGIOScreenExit = FALSE;
BOOLEAN gfReRenderGIOScreen=TRUE;
BOOLEAN gfGIOButtonsAllocated = FALSE;
UINT8 gubGameOptionScreenHandler=GIO_NOTHING;
UINT32 gubGIOExitScreen = GAME_INIT_OPTIONS_SCREEN;
UINT32 guiGIOMainBackGroundImage;
INT32 giGioMessageBox = -1;
INT8 iCurrentDifficulty;
INT8 iCurrentExtraDifficultySetting;
INT8 iCurrentBRQualitySetting;
INT8 iCurrentBRQuantitySetting;
INT8 iCurrentProgressSetting;
INT8 iCurrentInventorySetting;
INT8 iCurrentSquadSize;
UINT32 guiGIOSMALLFRAME;
// Done Button
void BtnGIODoneCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiGIODoneButton;
INT32 giGIODoneBtnImage;
// Cancel Button
void BtnGIOCancelCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiGIOCancelButton;
INT32 giGIOCancelBtnImage;
// 1.13 Features Button
void BtnGIO113FeaturesCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiGIO113FeaturesButton;
INT32 giGIO113FeaturesBtnImage;
// MP LOAD Button
void MPBtnGIOCancelCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 MPguiGIOCancelButton;
INT32 MPgiGIOCancelBtnImage;
UINT32 giGIODifficultyButton[ 2 ];
INT32 giGIODifficultyButtonImage[ 2 ];
void BtnGIODifficultySelectionLeftCallback( GUI_BUTTON *btn,INT32 reason );
void BtnGIODifficultySelectionRightCallback( GUI_BUTTON *btn,INT32 reason );
UINT32 giGIOExtraDifficultySettingButton[ 2 ];
INT32 giGIOExtraDifficultySettingButtonImage[ 2 ];
void BtnGIOExtraDifficultySettingLeftCallback( GUI_BUTTON *btn,INT32 reason );
void BtnGIOExtraDifficultySettingRightCallback( GUI_BUTTON *btn,INT32 reason );
UINT32 giGIOBRQualitySettingButton[ 2 ];
INT32 giGIOBRQualitySettingButtonImage[ 2 ];
void BtnGIOBRQualitySettingLeftCallback( GUI_BUTTON *btn,INT32 reason );
void BtnGIOBRQualitySettingRightCallback( GUI_BUTTON *btn,INT32 reason );
UINT32 giGIOBRQuantitySettingButton[ 2 ];
INT32 giGIOBRQuantitySettingButtonImage[ 2 ];
void BtnGIOBRQuantitySettingLeftCallback( GUI_BUTTON *btn,INT32 reason );
void BtnGIOBRQuantitySettingRightCallback( GUI_BUTTON *btn,INT32 reason );
UINT32 giGIOProgressSettingButton[ 2 ];
INT32 giGIOProgressSettingButtonImage[ 2 ];
void BtnGIOProgressSettingLeftCallback( GUI_BUTTON *btn,INT32 reason );
void BtnGIOProgressSettingRightCallback( GUI_BUTTON *btn,INT32 reason );
UINT32 giGIOInventorySettingButton [ 2 ];
INT32 giGIOInventorySettingButtonImage [ 2 ];
void BtnGIOInventorySettingLeftCallback( GUI_BUTTON *btn,INT32 reason );
void BtnGIOInventorySettingRightCallback( GUI_BUTTON *btn,INT32 reason );
UINT32 guiTraitsOptionTogglesImage[ NUM_TRAIT_OPTIONS ];
UINT32 guiTraitsOptionToggles[ NUM_TRAIT_OPTIONS ];
void BtnGIOOldTraitsCallback(GUI_BUTTON *btn,INT32 reason);
void BtnGIONewTraitsCallback(GUI_BUTTON *btn,INT32 reason);
void NewTraitsNotPossibleMessageBoxCallBack( UINT8 bExitValue );
//checkbox to toggle Game style
UINT32 guiGameTextTogglesImage[ NUM_TEXT_STYLES ];
UINT32 guiGameTextToggles[ NUM_TEXT_STYLES ];
UINT32 guiGameStyleTogglesImage[ NUM_GAME_STYLES ];
UINT32 guiGameStyleToggles[ NUM_GAME_STYLES ];
void BtnGIOOffStyleCallback(GUI_BUTTON *btn,INT32 reason);
void BtnGIOOnStyleCallback(GUI_BUTTON *btn,INT32 reason);
//checkbox to toggle Save style
UINT32 guiGameSaveTogglesImage[ NUM_SAVE_OPTIONS ];
UINT32 guiGameSaveToggles[ NUM_SAVE_OPTIONS ];
void BtnGIOIronManOffCallback(GUI_BUTTON *btn,INT32 reason);
void BtnGIOIronManOnCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiRpcOptionTogglesImage[ NUM_RPC_UB_OPTIONS ];
UINT32 guiRpcOptionToggles[ NUM_RPC_UB_OPTIONS ];
void BtnGIORpcRandomCallback(GUI_BUTTON *btn,INT32 reason);
void BtnGIORpcAllCallback(GUI_BUTTON *btn,INT32 reason);
//checkbox to toggle Gun options
UINT32 guiGunOptionTogglesImage[ NUM_GUN_OPTIONS ];
UINT32 guiGunOptionToggles[ NUM_GUN_OPTIONS ];
void BtnGIOGunSettingReducedCallback(GUI_BUTTON *btn,INT32 reason);
void BtnGIOGunSettingToGCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 giGIOSquadSizeButton[ 2 ];
INT32 giGIOSquadSizeButtonImage[ 2 ];
void BtnGIOSquadSizeSelectionLeftCallback( GUI_BUTTON *btn,INT32 reason );
void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason );
UINT32 guiTimedTurnToggles[ GIO_NUM_TIMED_TURN_OPTIONS ];
void BtnTimedTurnsTogglesCallback(GUI_BUTTON *btn,INT32 reason);
void RenderGIOSmallSelectionFrame(INT16 sX, INT16 sY);
////////////////////////////////////////////
//
// Local Function Prototypes
//
///////////////////////////////////////////
extern void ClearMainMenu();
BOOLEAN EnterGIOScreen();
BOOLEAN ExitGIOScreen();
void HandleGIOScreen();
BOOLEAN RenderGIOScreen();
void GetGIOScreenUserInput();
UINT8 GetCurrentGunButtonSetting();
// JA2Gold: added save (iron man) button setting
UINT8 GetCurrentGameSaveButtonSetting();
UINT8 GetCurrentTextStyleButtonSetting();
// SANDRO - added following
UINT8 GetCurrentTraitsOptionButtonSetting();
UINT8 GetCurrentTexAndJohnButtonSetting();
void DoneFadeOutForExitGameInitOptionScreen( void );
void DoneFadeInForExitGameInitOptionScreen( void );
UINT8 GetCurrentTimedTurnsButtonSetting();
BOOLEAN DoGioMessageBox( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback );
void DisplayMessageToUserAboutGameDifficulty();
void ConfirmGioDifSettingMessageBoxCallBack( UINT8 bExitValue );
BOOLEAN DisplayMessageToUserAboutIronManMode();
BOOLEAN DisplayMessageToUserAboutOIVandNASincompatibility();
void ConfirmGioIronManMessageBoxCallBack( UINT8 bExitValue );
BOOLEAN SpIniExists()
{
BOOLEAN exists = TRUE;
if(!getVFS()->fileExists(JA2SP_INI_FILENAME))
exists = FALSE;
return exists;
}
UINT32 GameInitOptionsScreenInit( void )
{
memset( &gGameOptions, 0, sizeof( GAME_OPTIONS ) );
// WANNE: Read initial game settings from ja2_sp.ini
vfs::PropertyContainer props;
if (SpIniExists())
props.initFromIniFile(JA2SP_INI_FILENAME);
// Difficulty Level (Default: Experienced = 1)
gGameOptions.ubDifficultyLevel = ((UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_DIFFICULTY_LEVEL, 1)) + 1;
// Bobby Ray Quality (Default: Great = 2)
gGameOptions.ubBobbyRayQuality = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_BOBBY_RAY_QUALITY, 2);
// Bobby Ray Quantity (Default: Great = 2)
gGameOptions.ubBobbyRayQuantity = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_BOBBY_RAY_QUANTITY, 2);
// Progress Speed of Item Choices (Default: Normal)
gGameOptions.ubProgressSpeedOfItemsChoices = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_PROGRESS_SPEED_OF_ITEM_CHOICES, ITEM_PROGRESS_NORMAL);
// Skill Traits
UINT8 ubTraitSystem = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_SKILL_TRAITS, 0);
if (!gGameExternalOptions.fReadProfileDataFromXML)
ubTraitSystem = 0;
gGameOptions.fNewTraitSystem = ubTraitSystem;
// Inventory Attachments (Default: New/New = 2)
UINT8 ubInventoryAttachmentSystem = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_INVENTORY_ATTACHMENTS, 0);
// NIV is not allowed
if (!IsNIVModeValid(true))
ubInventoryAttachmentSystem = 0;
switch (ubInventoryAttachmentSystem)
{
// Old / Old
case 0:
gGameOptions.ubInventorySystem = INVENTORY_OLD;
gGameOptions.ubAttachmentSystem = ATTACHMENT_OLD;
break;
// New / Old
case 1:
gGameOptions.ubInventorySystem = INVENTORY_NEW;
gGameOptions.ubAttachmentSystem = ATTACHMENT_OLD;
break;
// New / New
case 2:
gGameOptions.ubInventorySystem = INVENTORY_NEW;
gGameOptions.ubAttachmentSystem = ATTACHMENT_NEW;
break;
}
// Game Style (Default: Sci Fi = 1)
gGameOptions.ubGameStyle = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_GAME_STYLE, STYLE_SCIFI);
// Extra Difficulty (Default: Save Anytime = 0)
gGameOptions.fIronManMode = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_EXTRA_DIFFICULTY, 0);
// Available Arsenal (Default: Tons of Guns = 1)
gGameOptions.fGunNut = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_AVAILABLE_ARSENAL, 1);
// tex and john
gGameUBOptions.fTexAndJohn = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_UB_RPC_TEX_AND_JOHN, 0);
// Random Manuel Text
gGameUBOptions.fRandomManuelText = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_UB_RANDOM_MANUEL_TEXT, 0);
// Squad size (Default: 6)
UINT8 ubSquadSize = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_SQUAD_SIZE, 6);
if (iResolution >= _640x480 && iResolution < _800x600)
ubSquadSize = 6;
gGameOptions.ubSquadSize = ubSquadSize;
gGameOptions.fAirStrikes = FALSE;
gGameOptions.fTurnTimeLimit = FALSE;
return (1);
}
UINT32 GameInitOptionsScreenHandle( void )
{
StartFrameBufferRender();
if( gfGIOScreenEntry )
{
GameInitOptionsScreenInit();
EnterGIOScreen();
gfGIOScreenEntry = FALSE;
gfGIOScreenExit = FALSE;
InvalidateRegion( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
}
GetGIOScreenUserInput();
HandleGIOScreen();
// render buttons marked dirty
MarkButtonsDirty( );
RenderButtons( );
ExecuteBaseDirtyRectQueue();
EndFrameBufferRender();
if ( HandleFadeOutCallback( ) )
{
ClearMainMenu();
return( gubGIOExitScreen );
}
if ( HandleBeginFadeOut( gubGIOExitScreen ) )
{
return( gubGIOExitScreen );
}
if( gfGIOScreenExit )
{
ExitGIOScreen();
}
if ( HandleFadeInCallback( ) )
{
// Re-render the scene!
RenderGIOScreen();
}
if ( HandleBeginFadeIn( gubGIOExitScreen ) )
{
}
return( gubGIOExitScreen );
}
UINT32 GameInitOptionsScreenShutdown( void )
{
return( 1 );
}
BOOLEAN EnterGIOScreen()
{
VOBJECT_DESC VObjectDesc, VObjectDesc2;
if( gfGIOButtonsAllocated )
return( TRUE );
SetCurrentCursorFromDatabase( CURSOR_NORMAL );
// load the Main trade screen backgroiund image
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
if (iResolution >= _640x480 && iResolution < _800x600)
FilenameForBPP("INTERFACE\\OptionsScreenBackGround.sti", VObjectDesc.ImageFile);
else if (iResolution < _1024x768)
FilenameForBPP("INTERFACE\\OptionsScreenBackGround_800x600.sti", VObjectDesc.ImageFile);
else
FilenameForBPP("INTERFACE\\OptionsScreenBackGround_1024x768.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiGIOMainBackGroundImage ));
VObjectDesc2.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\GIOSmallFrame.sti", VObjectDesc2.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc2, &guiGIOSMALLFRAME));
//Ok button
giGIODoneBtnImage = LoadButtonImage("INTERFACE\\PreferencesButtons.sti", -1,0,-1,2,-1 );
guiGIODoneButton = CreateIconAndTextButton( giGIODoneBtnImage, gzGIOScreenText[GIO_START_TEXT], OPT_BUTTON_FONT,
OPT_BUTTON_ON_COLOR, DEFAULT_SHADOW,
OPT_BUTTON_OFF_COLOR, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
GIO_BTN_START_X, GIO_BTN_START_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnGIODoneCallback);
SpecifyButtonSoundScheme( guiGIODoneButton, BUTTON_SOUND_SCHEME_BIGSWITCH3 );
SpecifyDisabledButtonStyle( guiGIODoneButton, DISABLED_STYLE_NONE );
//Cancel button
giGIOCancelBtnImage = UseLoadedButtonImage( giGIODoneBtnImage, -1,1,-1,3,-1 );
guiGIOCancelButton = CreateIconAndTextButton( giGIOCancelBtnImage, gzGIOScreenText[GIO_CANCEL_TEXT], OPT_BUTTON_FONT,
OPT_BUTTON_ON_COLOR, DEFAULT_SHADOW,
OPT_BUTTON_OFF_COLOR, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
GIO_CANCEL_X, GIO_BTN_START_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnGIOCancelCallback );
SpecifyButtonSoundScheme( guiGIOCancelButton, BUTTON_SOUND_SCHEME_BIGSWITCH3 );
//1.13 Features button
giGIO113FeaturesBtnImage = UseLoadedButtonImage( giGIODoneBtnImage, -1,1,-1,3,-1 );
guiGIO113FeaturesButton = CreateIconAndTextButton( giGIO113FeaturesBtnImage, zOptionsText[OPT_113_FEATURES], OPT_BUTTON_FONT,
OPT_BUTTON_ON_COLOR, DEFAULT_SHADOW,
OPT_BUTTON_OFF_COLOR, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
GIO_113FEATURES_X, GIO_BTN_START_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnGIO113FeaturesCallback );
SpecifyButtonSoundScheme( guiGIO113FeaturesButton, BUTTON_SOUND_SCHEME_BIGSWITCH3 );
///////////////////////////////////////////////////////////////////////////////////////////////////////
// DIFFICULTY SETTING
giGIODifficultyButtonImage[ 0 ]= LoadButtonImage( "INTERFACE\\GIO_SELECTION_ARROWS.STI" ,-1,0,-1,1,-1 );
giGIODifficultyButtonImage[ 1 ]= LoadButtonImage( "INTERFACE\\GIO_SELECTION_ARROWS.STI" ,-1,2,-1,3,-1 );
// left button - decrement difficulty level
giGIODifficultyButton[ 0 ] = QuickCreateButton( giGIODifficultyButtonImage[ 0 ], GIO_DIF_SETTING_X + 39, GIO_DIF_SETTING_Y ,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIODifficultySelectionLeftCallback );
// right button - increment difficulty level
giGIODifficultyButton[ 1 ] = QuickCreateButton( giGIODifficultyButtonImage[ 1 ], GIO_DIF_SETTING_X + 158, GIO_DIF_SETTING_Y ,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIODifficultySelectionRightCallback );
// set user data
MSYS_SetBtnUserData(giGIODifficultyButton[0],0, 0 );
MSYS_SetBtnUserData(giGIODifficultyButton[1],0, 1 );
iCurrentDifficulty = max( 0, gGameOptions.ubDifficultyLevel - 1);
///////////////////////////////////////////////////////////////////////////////////////////////////////
// OLD/NEW TARITS SETTING
guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ] = LoadButtonImage( "INTERFACE\\GIOCheckButton.sti" ,-1,0,-1,2,-1 );
guiTraitsOptionToggles[ GIO_TRAITS_OLD ] = CreateIconAndTextButton( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], gzGIOScreenText[ GIO_TRAITS_OLD_TEXT ], GIO_TOGGLE_TEXT_FONT,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
TEXT_CJUSTIFIED,
(GIO_TRAITS_SETTING_X + 74), (GIO_TRAITS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnGIOOldTraitsCallback);
guiTraitsOptionTogglesImage[ GIO_TRAITS_NEW ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
guiTraitsOptionToggles[ GIO_TRAITS_NEW ] = CreateIconAndTextButton( guiTraitsOptionTogglesImage[ GIO_TRAITS_NEW ], gzGIOScreenText[ GIO_TRAITS_NEW_TEXT ], GIO_TOGGLE_TEXT_FONT,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
TEXT_CJUSTIFIED,
(GIO_TRAITS_SETTING_X), (GIO_TRAITS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnGIONewTraitsCallback );
SpecifyButtonSoundScheme( guiTraitsOptionToggles[ GIO_TRAITS_OLD ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
SpecifyButtonSoundScheme( guiTraitsOptionToggles[ GIO_TRAITS_NEW ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
MSYS_SetBtnUserData(guiTraitsOptionToggles[ GIO_TRAITS_OLD ],0, 0 );
MSYS_SetBtnUserData(guiTraitsOptionToggles[ GIO_TRAITS_NEW ],0, 1 );
if( gGameOptions.fNewTraitSystem )
ButtonList[ guiTraitsOptionToggles[ GIO_TRAITS_NEW ] ]->uiFlags |= BUTTON_CLICKED_ON;
else
ButtonList[ guiTraitsOptionToggles[ GIO_TRAITS_OLD ] ]->uiFlags |= BUTTON_CLICKED_ON;
///////////////////////////////////////////////////////////////////////////////////////////////////////
// GAME SETTING ( realistic, sci fi )
guiGameTextTogglesImage[ GIO_TEXT_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
guiGameTextToggles[ GIO_TEXT_OFF ] = CreateIconAndTextButton( guiGameTextTogglesImage[ GIO_TEXT_OFF ], gzGIOScreenText[ GIO_REALISTIC_TEXT ], GIO_TOGGLE_TEXT_FONT,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
TEXT_CJUSTIFIED,
(GIO_GAME_SETTING_X + 74), (GIO_GAME_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnGIOOffStyleCallback);
guiGameTextTogglesImage[ GIO_TEXT_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
guiGameTextToggles[ GIO_TEXT_ON ] = CreateIconAndTextButton( guiGameTextTogglesImage[ GIO_TEXT_ON ], gzGIOScreenText[ GIO_SCI_FI_TEXT ], GIO_TOGGLE_TEXT_FONT,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
TEXT_CJUSTIFIED,
(GIO_GAME_SETTING_X), (GIO_GAME_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnGIOOnStyleCallback );
SpecifyButtonSoundScheme( guiGameTextToggles[ GIO_TEXT_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
SpecifyButtonSoundScheme( guiGameTextToggles[ GIO_TEXT_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
MSYS_SetBtnUserData(guiGameTextToggles[ GIO_TEXT_OFF ],0, 0 );
MSYS_SetBtnUserData(guiGameTextToggles[ GIO_TEXT_ON ],0, 1 );
if( gGameUBOptions.fRandomManuelText )
ButtonList[ guiGameTextToggles[ GIO_TEXT_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
else
ButtonList[ guiGameTextToggles[ GIO_TEXT_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
///////////////////////////////////////////////////////////////////////////////////////////////////////
// IRON MAN SETTING
//guiGameSaveTogglesImage[ GIO_CAN_SAVE ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
//guiGameSaveToggles[ GIO_CAN_SAVE ] = CreateIconAndTextButton( guiGameSaveTogglesImage[ GIO_CAN_SAVE ], gzGIOScreenText[ GIO_SAVE_ANYWHERE_TEXT ], GIO_TOGGLE_TEXT_FONT,
// GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
// GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
// TEXT_CJUSTIFIED,
// (GIO_IRON_MAN_SETTING_X), (GIO_IRON_MAN_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
// DEFAULT_MOVE_CALLBACK, BtnGIOIronManOffCallback);
//guiGameSaveTogglesImage[ GIO_IRON_MAN ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
//guiGameSaveToggles[ GIO_IRON_MAN ] = CreateIconAndTextButton( guiGameSaveTogglesImage[ GIO_IRON_MAN ], gzGIOScreenText[ GIO_IRON_MAN_TEXT ], GIO_TOGGLE_TEXT_FONT,
// GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
// GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
// TEXT_CJUSTIFIED,
// (GIO_IRON_MAN_SETTING_X + 74), (GIO_IRON_MAN_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
// DEFAULT_MOVE_CALLBACK, BtnGIOIronManOnCallback );
//SpecifyButtonSoundScheme( guiGameSaveToggles[ GIO_CAN_SAVE ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
//SpecifyButtonSoundScheme( guiGameSaveToggles[ GIO_IRON_MAN ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
//MSYS_SetBtnUserData(guiGameSaveToggles[ GIO_CAN_SAVE ],0, 0 );
//MSYS_SetBtnUserData(guiGameSaveToggles[ GIO_IRON_MAN ],0, 1 );
//if( gGameOptions.fIronManMode )
// ButtonList[ guiGameSaveToggles[ GIO_IRON_MAN ] ]->uiFlags |= BUTTON_CLICKED_ON;
//else
// ButtonList[ guiGameSaveToggles[ GIO_CAN_SAVE ] ]->uiFlags |= BUTTON_CLICKED_ON;
giGIOExtraDifficultySettingButtonImage[ 0 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 0 ], -1,0,-1,1,-1 );
giGIOExtraDifficultySettingButtonImage[ 1 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 1 ], -1,2,-1,3,-1 );
// left button - decrement Extra Difficulty
giGIOExtraDifficultySettingButton[ 0 ] = QuickCreateButton( giGIOExtraDifficultySettingButtonImage[ 0 ], GIO_IRON_MAN_SETTING_X + 39, GIO_IRON_MAN_SETTING_Y ,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOExtraDifficultySettingLeftCallback );
// right button - increment Extra Difficulty
giGIOExtraDifficultySettingButton[ 1 ] = QuickCreateButton( giGIOExtraDifficultySettingButtonImage[ 1 ], GIO_IRON_MAN_SETTING_X + 158, GIO_IRON_MAN_SETTING_Y ,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOExtraDifficultySettingRightCallback );
// set user data
MSYS_SetBtnUserData(giGIOExtraDifficultySettingButton[0],0, 0 );
MSYS_SetBtnUserData(giGIOExtraDifficultySettingButton[1],0, 1 );
iCurrentExtraDifficultySetting = gGameOptions.ubIronManMode;
///////////////////////////////////////////////////////////////////////////////////////////////////////
// NUMBER OF TERRORISTS SETTING
guiRpcOptionTogglesImage[ GIO_TEX_JOHN_RANDOM ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
guiRpcOptionToggles[ GIO_TEX_JOHN_RANDOM ] = CreateIconAndTextButton( guiRpcOptionTogglesImage[ GIO_TEX_JOHN_RANDOM ], gzGIOScreenText[ GIO_TERRORISTS_RANDOM_TEXT ], GIO_TOGGLE_TEXT_FONT,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
TEXT_CJUSTIFIED,
(GIO_TERRORISTS_SETTING_X), (GIO_TERRORISTS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnGIORpcRandomCallback);
guiRpcOptionTogglesImage[ GIO_TEX_AND_JOHN ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
guiRpcOptionToggles[ GIO_TEX_AND_JOHN ] = CreateIconAndTextButton( guiRpcOptionTogglesImage[ GIO_TEX_AND_JOHN ], gzGIOScreenText[ GIO_TERRORISTS_ALL_TEXT ], GIO_TOGGLE_TEXT_FONT,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
TEXT_CJUSTIFIED,
(GIO_TERRORISTS_SETTING_X + 74), (GIO_TERRORISTS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnGIORpcAllCallback );
SpecifyButtonSoundScheme( guiRpcOptionToggles[ GIO_TEX_JOHN_RANDOM ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
SpecifyButtonSoundScheme( guiRpcOptionToggles[ GIO_TEX_AND_JOHN ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
MSYS_SetBtnUserData(guiRpcOptionToggles[ GIO_TEX_JOHN_RANDOM ],0, 0 );
MSYS_SetBtnUserData(guiRpcOptionToggles[ GIO_TEX_AND_JOHN ],0, 1 );
if( gGameUBOptions.fTexAndJohn )
ButtonList[ guiRpcOptionToggles[ GIO_TEX_AND_JOHN ] ]->uiFlags |= BUTTON_CLICKED_ON;
else
ButtonList[ guiRpcOptionToggles[ GIO_TEX_JOHN_RANDOM ] ]->uiFlags |= BUTTON_CLICKED_ON;
///////////////////////////////////////////////////////////////////////////////////////////////////////
// BOBBY RAY SETTING
giGIOBRQualitySettingButtonImage[ 0 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 0 ], -1,0,-1,1,-1 );
giGIOBRQualitySettingButtonImage[ 1 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 1 ], -1,2,-1,3,-1 );
// left button - decrement BR level
giGIOBRQualitySettingButton[ 0 ] = QuickCreateButton( giGIOBRQualitySettingButtonImage[ 0 ], GIO_BR_QUALITY_SETTING_X + 39, GIO_BR_QUALITY_SETTING_Y ,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOBRQualitySettingLeftCallback );
// right button - increment BR level
giGIOBRQualitySettingButton[ 1 ] = QuickCreateButton( giGIOBRQualitySettingButtonImage[ 1 ], GIO_BR_QUALITY_SETTING_X + 158, GIO_BR_QUALITY_SETTING_Y ,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOBRQualitySettingRightCallback );
giGIOBRQuantitySettingButtonImage[ 0 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 0 ], -1,0,-1,1,-1 );
giGIOBRQuantitySettingButtonImage[ 1 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 1 ], -1,2,-1,3,-1 );
// left button - decrement BR level
giGIOBRQuantitySettingButton[ 0 ] = QuickCreateButton( giGIOBRQuantitySettingButtonImage[ 0 ], GIO_BR_QUANTITY_SETTING_X + 39, GIO_BR_QUANTITY_SETTING_Y ,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOBRQuantitySettingLeftCallback );
// right button - increment BR level
giGIOBRQuantitySettingButton[ 1 ] = QuickCreateButton( giGIOBRQuantitySettingButtonImage[ 1 ], GIO_BR_QUANTITY_SETTING_X + 158, GIO_BR_QUANTITY_SETTING_Y ,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOBRQuantitySettingRightCallback );
// set user data
MSYS_SetBtnUserData(giGIOBRQualitySettingButton[0],0, 0 );
MSYS_SetBtnUserData(giGIOBRQualitySettingButton[1],0, 1 );
MSYS_SetBtnUserData(giGIOBRQuantitySettingButton[0],0, 0 );
MSYS_SetBtnUserData(giGIOBRQuantitySettingButton[1],0, 1 );
// set initial value
iCurrentBRQualitySetting = gGameOptions.ubBobbyRayQuality;
iCurrentBRQuantitySetting = gGameOptions.ubBobbyRayQuantity;
///////////////////////////////////////////////////////////////////////////////////////////////////////
// ITEM PROGRESS SETTING
giGIOProgressSettingButtonImage[ 0 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 0 ], -1,0,-1,1,-1 );
giGIOProgressSettingButtonImage[ 1 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 1 ], -1,2,-1,3,-1 );
// left button - decrement BR level
giGIOProgressSettingButton[ 0 ] = QuickCreateButton( giGIOProgressSettingButtonImage[ 0 ], GIO_PROGRESS_SETTING_X + 39, GIO_PROGRESS_SETTING_Y ,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOProgressSettingLeftCallback );
// right button - increment BR level
giGIOProgressSettingButton[ 1 ] = QuickCreateButton( giGIOProgressSettingButtonImage[ 1 ], GIO_PROGRESS_SETTING_X + 158, GIO_PROGRESS_SETTING_Y ,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOProgressSettingRightCallback );
// set user data
MSYS_SetBtnUserData(giGIOProgressSettingButton[0],0, 0 );
MSYS_SetBtnUserData(giGIOProgressSettingButton[1],0, 1 );
// set initial value
iCurrentProgressSetting = gGameOptions.ubProgressSpeedOfItemsChoices;
///////////////////////////////////////////////////////////////////////////////////////////////////////
// OLD/NEW INVENTORY SETTING
if (IsNIVModeValid(true) == TRUE )
{
giGIOInventorySettingButtonImage[ 0 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 0 ],-1,0,-1,1,-1 );
giGIOInventorySettingButtonImage[ 1 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 1 ],-1,2,-1,3,-1 );
// left button - decrement difficulty level
giGIOInventorySettingButton[ 0 ] = QuickCreateButton( giGIOInventorySettingButtonImage[ 0 ], GIO_INV_SETTING_X + 39, GIO_INV_SETTING_Y ,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOInventorySettingLeftCallback );
// right button - increment difficulty level
giGIOInventorySettingButton[ 1 ] = QuickCreateButton( giGIOInventorySettingButtonImage[ 1 ], GIO_INV_SETTING_X + 158, GIO_INV_SETTING_Y ,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOInventorySettingRightCallback );
// set user data
MSYS_SetBtnUserData(giGIOInventorySettingButton[0],0, 0 );
MSYS_SetBtnUserData(giGIOInventorySettingButton[1],0, 1 );
if (UsingNewInventorySystem()==true &&
UsingNewAttachmentSystem()==true)
{
iCurrentInventorySetting = GIO_INV_NEW_NAS;
}
else
{
// set initial value
switch ( gGameOptions.ubInventorySystem )
{
case INVENTORY_OLD:
iCurrentInventorySetting = GIO_INV_OLD;
break;
case INVENTORY_NEW:
iCurrentInventorySetting = GIO_INV_NEW;
break;
}
}
}