forked from 1dot13/source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Options Screen.cpp
1890 lines (1558 loc) · 63.8 KB
/
Options Screen.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 "Options Screen.h"
#include "Video.h"
#include "Font Control.h"
#include "Game Clock.h"
#include "Text Input.h"
#include "WordWrap.h"
#include "SaveLoadScreen.h"
#include "Render Dirty.h"
#include "WordWrap.h"
#include "WCheck.h"
#include "Utilities.h"
#include "Slider.h"
#include "Debug.h"
#include "Music Control.h"
#include "Sound Control.h"
#include "soundman.h"
#include "Ambient Control.h"
#include "Worlddat.h"
#include "Worlddef.h"
#include "GameSettings.h"
#include "Game Init.h"
#include "English.h"
#include "Overhead.h"
#include "Gap.h"
#include "Cursors.h"
#include "SysUtil.h"
#include "Exit Grids.h"
#include "Text.h"
#include "Interface Control.h"
#include "Message.h"
#include "Language Defines.h"
#include "Multi Language Graphic Utils.h"
#include "Map Information.h"
#include "SmokeEffects.h"
#include "Sys Globals.h"
#include "Cheats.h"
#include "connect.h"
#include "WorldMan.h"
#include "Init.h"
#include "Game Events.h"
#include "PostalService.h"
extern CPostalService gPostalService;
/////////////////////////////////
//
// Global Variables
//
/////////////////////////////////
UINT32 guiOptionBackGroundImage;
UINT32 guiOptionsAddOnImages;
UINT32 guiSoundEffectsSliderID;
UINT32 guiSpeechSliderID;
UINT32 guiMusicSliderID;
BOOLEAN gfOptionsScreenEntry = TRUE;
BOOLEAN gfOptionsScreenExit = FALSE;
BOOLEAN gfRedrawOptionsScreen = TRUE;
//CHAR8 gzSavedGameName[ 128 ]; //old
BOOLEAN gfEnteredFromMapScreen=FALSE;
UINT32 guiOptionsScreen = OPTIONS_SCREEN;
UINT32 guiPreviousOptionScreen = OPTIONS_SCREEN;
BOOLEAN gfExitOptionsDueToMessageBox=FALSE;
BOOLEAN gfExitOptionsAfterMessageBox = FALSE;
UINT32 guiSoundFxSliderMoving = 0xffffffff;
UINT32 guiSpeechSliderMoving = 0xffffffff;
INT32 giOptionsMessageBox = -1; // Options pop up messages index value
INT8 gbHighLightedOptionText = -1;
BOOLEAN gfOptionsScreenUnloading = FALSE;
//BOOLEAN gfHideBloodAndGoreOption=FALSE; //all this blood gore option enforcment is unused
//If a germany build we are to hide the blood and gore option
//UINT8 gubFirstColOfOptions=OPT_FIRST_COLUMN_TOGGLE_CUT_OFF; // old
BOOLEAN gfSettingOfTreeTopStatusOnEnterOfOptionScreen; //this is temp holder for the world state prior to any changes
BOOLEAN gfSettingOfItemGlowStatusOnEnterOfOptionScreen; //this is temp holder for the world state prior to any changes
BOOLEAN gfSettingOfDontAnimateSmoke; //this is temp holder for the world state prior to any changes
BOOLEAN gfSettingOfTacticalFaceIcon; //this is temp holder for the world state prior to any changes
// Goto save game Button
void BtnOptGotoSaveGameCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiOptGotoSaveGameBtn;
INT32 giOptionsButtonImages;
// Goto load game button
void BtnOptGotoLoadGameCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiOptGotoLoadGameBtn;
INT32 giGotoLoadBtnImage;
// QuitButton
void BtnOptQuitCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiQuitButton;
INT32 giQuitBtnImage;
// 1.13 Features Button
void Btn113FeaturesCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 gui113FeaturesButton;
INT32 gi113FeaturesBtnImage;
// arynn : need more option screen toggles : Add in button that allow for options column paging
// Options Screen globals
INT16 OptionsList_Column_Offset = 0 ; // the first column's -or- "half page" start
INT16 Current_First_Option_Index; // index of the first (single) option in the first column, used in lookup option vs togglebox
INT16 Max_Number_Of_Pages = 0 ; // dynamic column counter per build/mode type
void Establish_Options_Screen_Rules(void); // define the display rules
void Build_Options_List_Reinterpretation(void); // interpret rules and build a set of which options are used for use in options screen
void Create_Toggle_Buttons(void); // these two are blcok removals from functions, an isolation of toggle create/destroy
void Destroy_Toggle_Buttons(void);
void Handle_ButtonStyle_Options( UINT8 Button_UserData_1 );
// Next Button
void BtnOptNextCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiOptNextButton;
INT32 giOptNextBtnImage;
// Prev Button
void BtnOptPrevCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiOptPrevButton;
INT32 giOptPrevBtnImage;
// Done Button
void BtnDoneCallback(GUI_BUTTON *btn,INT32 reason);
extern UINT32 guiDoneButton; // symbol already declared globally in AimArchives.cpp (jonathanl)
INT32 giDoneBtnImage;
//checkbox to toggle tracking mode on or off
UINT32 guiOptionsToggles[ MAX_NUMBER_OF_OPTION_TOGGLES ]; //array of ButtonID, index's for button list
BOOL Buttons_Exist_State = 0;
void BtnOptionsTogglesCallback(GUI_BUTTON *btn,INT32 reason);
//Mouse regions for the name of the option
MOUSE_REGION gSelectedOptionTextRegion[ MAX_NUMBER_OF_OPTION_TOGGLES ];
void SelectedOptionTextRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
void SelectedOptionTextRegionMovementCallBack(MOUSE_REGION * pRegion, INT32 reason );
//Mouse regions for the area around the toggle boxs
MOUSE_REGION gSelectedToggleBoxAreaRegion;
void SelectedToggleBoxAreaRegionMovementCallBack(MOUSE_REGION * pRegion, INT32 reason );
//toggle box correspondence to option tracker
//1 define the render rules,
//2 recast real options into new array under constraints of rules,
//3 then using a pager system, create a subset that will fit on screen
int toggle_box_content_rules[NUM_GAME_OPTIONS]; // index = game option value = render state
int toggle_box_gGameSettings_recast[NUM_GAME_OPTIONS+OPT_FIRST_COLUMN_TOGGLE_CUT_OFF];
// index = reinterpreted positions value = game_option or state
//" + OPT_FIRST_COLUMN_TOGGLE_CUT_OFF " to account for potential empty togglebox positions up to next whole column
int toggle_box_array[MAX_NUMBER_OF_OPTION_TOGGLES]; // index = option position on screen value = game_option or state
/////////////////////////////////
//
// Function ProtoTypes
//
/////////////////////////////////
BOOLEAN EnterOptionsScreen();
void RenderOptionsScreen();
void ExitOptionsScreen();
void HandleOptionsScreen();
void GetOptionsScreenUserInput();
void NextPage();
void PreviousPage();
void SoundFXSliderChangeCallBack( INT32 iNewValue );
void SpeechSliderChangeCallBack( INT32 iNewValue );
void MusicSliderChangeCallBack( INT32 iNewValue );
//BOOLEAN DoOptionsMessageBox( UINT8 ubStyle, STR16zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback );
void ConfirmQuitToMainMenuMessageBoxCallBack( UINT8 bExitValue );
void HandleSliderBarMovementSounds();
void HandleOptionToggle( UINT8 Button_UserData_0, UINT8 Button_UserData_1, BOOLEAN fState, BOOLEAN fDown, BOOLEAN fPlaySound );
void HandleHighLightedText( BOOLEAN fHighLight );
extern BOOLEAN CheckIfGameCdromIsInCDromDrive();
extern void ToggleItemGlow( BOOLEAN fOn );
/////////////////////////////////
//
// Code
//
/////////////////////////////////
UINT32 OptionsScreenInit()
{
//Set so next time we come in, we can set up
gfOptionsScreenEntry = TRUE;
//init rules and paging extent
Establish_Options_Screen_Rules();
Build_Options_List_Reinterpretation(); //need to calc paging max before next/prev button creation
return( TRUE );
}
UINT32 OptionsScreenHandle()
{
StartFrameBufferRender();
if( gfOptionsScreenEntry )
{
PauseGame();
EnterOptionsScreen();
gfOptionsScreenEntry = FALSE;
gfOptionsScreenExit = FALSE;
gfRedrawOptionsScreen = TRUE;
RenderOptionsScreen();
//Blit the background to the save buffer
BlitBufferToBuffer( guiRENDERBUFFER, guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
InvalidateRegion( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
}
else
{
GetOptionsScreenUserInput();
}
RestoreBackgroundRects();
HandleOptionsScreen();
if( gfRedrawOptionsScreen )
{
RenderOptionsScreen();
RenderButtons();
gfRedrawOptionsScreen = FALSE;
}
//Render the active slider bars
RenderAllSliderBars();
// render buttons marked dirty
MarkButtonsDirty( );
RenderButtons( );
// ATE: Put here to save RECTS before any fast help being drawn...
SaveBackgroundRects( );
RenderButtonsFastHelp();
ExecuteBaseDirtyRectQueue();
EndFrameBufferRender();
if( gfOptionsScreenExit )
{
ExitOptionsScreen();
gfOptionsScreenExit = FALSE;
gfOptionsScreenEntry = TRUE;
UnPauseGame();
}
return( guiOptionsScreen );
}
UINT32 OptionsScreenShutdown()
{
return( TRUE );
}
void Establish_Options_Screen_Rules(void)
{
UINT16 counter;
// ary-05/05/2009 : note : pre-emptive definition of "game options render state". Show/Hide/etc options on option screen.
// : note : enum of states possible :
// : note : state -2 = is a state defined later, after rules build-up, and denotes the unused spots that exceed the final page.
// : note : state -1 = used in toggle_box_array, after rules build-up. and denotes the unused spots that are within last page.
// : note : state 0 = skip this option, consider it to be non-existant.. do not render..
// : note : state 1 = normal, default
// : note : state 2 = text only, no box, no option to toggle, a "header/divider" type rendering
//Re-init toggle_box_content_rules[]
for( counter = 0; counter < NUM_GAME_OPTIONS; counter++)
{
//this loop will re-initialize toggle_box_content_rules[counter1] to "display as normally" state
toggle_box_content_rules[counter] = 1;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
////// begining of options content rules ////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// these rules are first created in "normal" state. So change those where needed.
//if( (is_networked) ) //establish any Multiplayer Options rules
//{
// toggle_box_content_rules[TOPTION_TOGGLE_TURN_MODE] = 0; // do not consider FTM an option when in MP mode
//}
if( !(gGameSettings.fOptions[ TOPTION_SHOW_RESET_ALL_OPTIONS ]) )
{
// hide this to prevent user mistake of reseting options
toggle_box_content_rules[TOPTION_RESET_ALL_OPTIONS] = 0;
}
if( JA2BETAVERSION_FLAG || gGameSettings.fOptions[TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE] )
{
toggle_box_content_rules[TOPTION_CHEAT_MODE_OPTIONS_HEADER] = 2;
toggle_box_content_rules[TOPTION_CHEAT_MODE_OPTIONS_END] = 2;
toggle_box_content_rules[TOPTION_DEBUG_MODE_OPTIONS_HEADER] = 2; //a sample options screen options header (text)
toggle_box_content_rules[TOPTION_DEBUG_MODE_OPTIONS_END] = 2; //a sample options screen options divider(text)
toggle_box_content_rules[TOPTION_LAST_OPTION] = 2; //this is THE LAST option that exists
//example of "options screens option" in action :
if( !(gGameSettings.fOptions[TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP]))
{
toggle_box_content_rules[TOPTION_RENDER_MOUSE_REGIONS] = 0;
}
}
else //establish any NOT in "DEBUG build mode" rules
{
toggle_box_content_rules[TOPTION_CHEAT_MODE_OPTIONS_HEADER] = 0;
toggle_box_content_rules[TOPTION_FORCE_BOBBY_RAY_SHIPMENTS] = 0;
toggle_box_content_rules[TOPTION_CHEAT_MODE_OPTIONS_END] = 0;
toggle_box_content_rules[TOPTION_DEBUG_MODE_OPTIONS_HEADER] = 0; //a sample options screen options header (text)
toggle_box_content_rules[TOPTION_REPORT_MISS_MARGIN] = 0;
toggle_box_content_rules[TOPTION_SHOW_RESET_ALL_OPTIONS] = 0; //a sample option that hides/shows another option
toggle_box_content_rules[TOPTION_RESET_ALL_OPTIONS] = 0; // kept inside Debug Builds (dev's quick reset)
toggle_box_content_rules[TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE] = 0;
toggle_box_content_rules[TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP] = 0; //a sample option that hides/shows another option(s)
toggle_box_content_rules[TOPTION_RENDER_MOUSE_REGIONS] = 0; //a sample DEBUG build option
toggle_box_content_rules[TOPTION_DEBUG_MODE_OPTIONS_END] = 0; //a sample options screen options divider
toggle_box_content_rules[TOPTION_LAST_OPTION] = 0; //this is THE LAST option that exists
////however if allowing some debug options to bleed thru to release. Allow these options to be managable.
//if( gGameSettings.fOptions[TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE] )
//{
// toggle_box_content_rules[TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE] = 1;
// toggle_box_content_rules[TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP] = 1;
// toggle_box_content_rules[TOPTION_RENDER_MOUSE_REGIONS] = 1;
//}
}
//at this point despite whatever build rules, enable cheat mode options to render
if( CHEATER_CHEAT_LEVEL( ) )
{
toggle_box_content_rules[TOPTION_CHEAT_MODE_OPTIONS_HEADER] = 2; // text only
toggle_box_content_rules[TOPTION_FORCE_BOBBY_RAY_SHIPMENTS] = 1;
toggle_box_content_rules[TOPTION_CHEAT_MODE_OPTIONS_END] = 2; // text only
}
}
void Build_Options_List_Reinterpretation(void)
{
// This function fills out a recast of gGameSettings.fOptions[],
// it differs by constraint foun in Establish_Options_Screen_Rules()
INT16 counter1, counter2, index_of_last_valid_option;
for(counter1= 0 ; counter1 < (NUM_GAME_OPTIONS+OPT_FIRST_COLUMN_TOGGLE_CUT_OFF) ; counter1++)
{ toggle_box_gGameSettings_recast[counter1] = -2; }
index_of_last_valid_option = 0; //track where inside the recast we ran out of actual options,
//we then pad the rest with -1's
//also, this is the basis for column counting
// ary-05/05/2009 : counter1 represents the position inside toggle_box_gGameSettings_recast[], we dont skip these until there are no more options
// : counter2 represents the position inside gGameSettings.fOptions[], skip invalids until valid or NUM_GAME_OPTIONS
counter2 = 0; // init prior to the loop
for( counter1 = 0 ; counter1 < NUM_GAME_OPTIONS ; counter1++)
{
for( ; counter2<NUM_GAME_OPTIONS ; )
{
if(toggle_box_content_rules[counter2]) // might be change to bit_vect, or some other mechanic, but for only 0 is not rendered
{
toggle_box_gGameSettings_recast[counter1] = counter2;
index_of_last_valid_option = counter1;
counter2++;
break;
}
counter2++;
}
}
// pick up final tail of toggle box up to the next whole column
if((index_of_last_valid_option+1) % OPT_FIRST_COLUMN_TOGGLE_CUT_OFF)
{
Max_Number_Of_Pages = ((index_of_last_valid_option+1) / OPT_FIRST_COLUMN_TOGGLE_CUT_OFF)+1;
for( counter1 = (index_of_last_valid_option+1) ;
counter1 < (Max_Number_Of_Pages * OPT_FIRST_COLUMN_TOGGLE_CUT_OFF);
counter1++ )
{
toggle_box_gGameSettings_recast[counter1] = -1;
}
}
else
{
Max_Number_Of_Pages = ((index_of_last_valid_option+1) / OPT_FIRST_COLUMN_TOGGLE_CUT_OFF);
// no tail to fill out, index_of_last_valid_option is the last option up to a whole column
}
}
void Create_Toggle_Buttons(void)
{
UINT16 counter1;
UINT16 usPosY, usBoxPosX, usTextPosX;
UINT16 usTextWidth, usTextHeight;
//
// Toggle Boxes
//
// Build up a set of options toggles for render and callbacks. and remember set for deletion of set.
//
// main events:
// fill toggle_box_content_rules[] (content rules), and global state after conditions have been setup
// fill toggle_box_array[], with options based on content rule, or global rules
// show check_box images and text, create mouse regions, based on toggle_box_array[]
// see Destroy_Toggle_Buttons() for handling of deletion (this is all setup to prevent deletion of uncreated regions)
/////////////////////////////////////////////////////////////////////////////////////////////////////////
Establish_Options_Screen_Rules();
Build_Options_List_Reinterpretation(); // based on rules, build a options_screen version of gGameSetting[], and derive max_pages
// at this point we have an array that describes how the toggle boxes will be handled
// only thing left now is to describe the array of toggle_boxes that is currently about to be displayed on screen
// this should be easy enough, just offset into toggle_box_gGameSettings_recast, and direct copy into toggle_box_array
Current_First_Option_Index = OptionsList_Column_Offset * OPT_FIRST_COLUMN_TOGGLE_CUT_OFF;
for( counter1 = 0; counter1<MAX_NUMBER_OF_OPTION_TOGGLES; counter1++)
{
//counter1 represents index within toggle_box_array, we have to handle each one
toggle_box_array[counter1] = toggle_box_gGameSettings_recast[counter1+Current_First_Option_Index];
}
// at this point toggle_box_array has been built properly to content rules.
// now it is time to create/render/keep track of the toggle box options
usTextHeight = GetFontHeight( OPT_MAIN_FONT );
for( counter1=0; counter1<MAX_NUMBER_OF_OPTION_TOGGLES; counter1++)
{
// skip creating toggle box for cases : no option , option supression
if (toggle_box_array[counter1] == -1) // skip every thing for -1
{ continue; }
if (toggle_box_content_rules[toggle_box_array[counter1]] == 2) //skip creating the toggle box | mouse regions
{ // this case isnt creating toggle box, but is still using positions on the list, so adjust the graphics cursor
// init or re-init base points of where graphics/text/regions are going to be placed
if( counter1 % OPT_FIRST_COLUMN_TOGGLE_CUT_OFF == 0 )
{
//reset the vertical position
usPosY = OPT_TOGGLE_BOX_FIRST_COLUMN_START_Y;
}
//skip over vertical portion
usPosY += OPT_GAP_BETWEEN_TOGGLE_BOXES;
//init/reset horizontal
if( counter1 < OPT_FIRST_COLUMN_TOGGLE_CUT_OFF )
{
usBoxPosX = OPT_TOGGLE_BOX_FIRST_COLUMN_X;
usTextPosX = OPT_TOGGLE_BOX_FIRST_COL_TEXT_X;
}
else
{
usBoxPosX = OPT_TOGGLE_BOX_SECOND_COLUMN_X;
usTextPosX = OPT_TOGGLE_BOX_SECOND_TEXT_X;
}
continue;
}
// init or re-init base points of where graphics/text/regions are going to be placed
if( counter1 % OPT_FIRST_COLUMN_TOGGLE_CUT_OFF == 0 )
{
//reset the vertical position
usPosY = OPT_TOGGLE_BOX_FIRST_COLUMN_START_Y;
}
if( counter1 < OPT_FIRST_COLUMN_TOGGLE_CUT_OFF )
{
usBoxPosX = OPT_TOGGLE_BOX_FIRST_COLUMN_X;
usTextPosX = OPT_TOGGLE_BOX_FIRST_COL_TEXT_X;
}
else
{
usBoxPosX = OPT_TOGGLE_BOX_SECOND_COLUMN_X;
usTextPosX = OPT_TOGGLE_BOX_SECOND_TEXT_X;
}
// here is the point when the graphical toggle is drawn and associated with a mouse region
//Check box ID stored to guiOptionsToggles[] by toggle option
guiOptionsToggles[ counter1 ] = CreateCheckBoxButton( usBoxPosX, usPosY,
"INTERFACE\\OptionsCheckBoxes_12x12.sti",
MSYS_PRIORITY_HIGH+10,
BtnOptionsTogglesCallback );
//set the toggle box's UserData[0] to the toggle_box index (which toggle box it is)
//set the toggle box's UserData[1] to the option's index (which option the toggle box represents)
MSYS_SetBtnUserData( guiOptionsToggles[ counter1 ], 0, counter1 );
MSYS_SetBtnUserData( guiOptionsToggles[ counter1 ], 1, toggle_box_array[counter1] );
usTextWidth = StringPixLength( zOptionsToggleText[ toggle_box_array[ counter1 ] ], OPT_MAIN_FONT );
if( usTextWidth > OPT_TOGGLE_BOX_TEXT_WIDTH )
{
//Get how many lines will be used to display the string, without displaying the string
UINT8 ubNumLines = (UINT8) ( DisplayWrappedString( 0, 0, OPT_TOGGLE_BOX_TEXT_WIDTH, 2, OPT_MAIN_FONT, OPT_HIGHLIGHT_COLOR,
zOptionsToggleText[ toggle_box_array[ counter1 ] ], FONT_MCOLOR_BLACK, TRUE,
LEFT_JUSTIFIED | DONT_DISPLAY_TEXT ) / GetFontHeight( OPT_MAIN_FONT ) );
usTextWidth = OPT_TOGGLE_BOX_TEXT_WIDTH;
//Create mouse regions for the option toggle text
MSYS_DefineRegion( &gSelectedOptionTextRegion[counter1], usBoxPosX+13, usPosY,
(usTextPosX + usTextWidth), (UINT16)(usPosY+usTextHeight*ubNumLines), MSYS_PRIORITY_HIGH,
CURSOR_NORMAL, SelectedOptionTextRegionMovementCallBack, SelectedOptionTextRegionCallBack );
MSYS_AddRegion( &gSelectedOptionTextRegion[counter1]);
//set the text's region's UserData[0] to the toggle_box index (which toggle box it is)
//set the text's region's UserData[1] to the option's index (which option the toggle box represents)
MSYS_SetRegionUserData( &gSelectedOptionTextRegion[ counter1 ], 0, counter1);
MSYS_SetRegionUserData( &gSelectedOptionTextRegion[ counter1 ], 1, toggle_box_array[counter1]);
}
else
{
//Create mouse regions for the option toggle text
MSYS_DefineRegion( &gSelectedOptionTextRegion[counter1], usBoxPosX+13, usPosY,
(usTextPosX + usTextWidth), (UINT16)(usPosY+usTextHeight), MSYS_PRIORITY_HIGH,
CURSOR_NORMAL, SelectedOptionTextRegionMovementCallBack, SelectedOptionTextRegionCallBack );
MSYS_AddRegion( &gSelectedOptionTextRegion[counter1]);
//set the text's region's UserData[0] to the toggle_box index (which toggle box it is)
//set the text's region's UserData[1] to the option's index (which option the toggle box represents)
MSYS_SetRegionUserData( &gSelectedOptionTextRegion[ counter1 ], 0, counter1);
MSYS_SetRegionUserData( &gSelectedOptionTextRegion[ counter1 ], 1, toggle_box_array[counter1]);
}
SetRegionFastHelpText( &gSelectedOptionTextRegion[ counter1 ], zOptionsScreenHelpText[ toggle_box_array[ counter1 ] ] );
SetButtonFastHelpText( guiOptionsToggles[ counter1 ], zOptionsScreenHelpText[ toggle_box_array[ counter1 ] ] );
usPosY += OPT_GAP_BETWEEN_TOGGLE_BOXES;
}
Buttons_Exist_State = 1; // ok check boxes now exist, its safe to allow text highlights
}
void Destroy_Toggle_Buttons(void)
{
UINT8 counter1;
Buttons_Exist_State = 0; // set this to off, prevents HandleOptionsScreen() from causing a CTD when tring to
// higlight text for non-existing checkboxes
//Remove the toggle buttons
for( counter1=0; counter1<MAX_NUMBER_OF_OPTION_TOGGLES; counter1++)
{
if( toggle_box_array[ counter1 ] == -1 )
{
// dont delete non existing buttons
continue;
}
if( toggle_box_content_rules[toggle_box_array[ counter1 ]] == 2 )
{
// dont delete non existing buttons
continue;
}
RemoveButton( guiOptionsToggles[ counter1 ] );
MSYS_RemoveRegion( &gSelectedOptionTextRegion[counter1]);
}
}
BOOLEAN EnterOptionsScreen()
{
VOBJECT_DESC VObjectDesc;
// WANNE: Do not draw the blackground back
//ColorFillVideoSurfaceArea( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0 );
//if we are coming from mapscreen
if( guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN )
{
guiTacticalInterfaceFlags &= ~INTERFACE_MAPSCREEN;
gfEnteredFromMapScreen = TRUE;
}
// Stop ambients...
StopAmbients( );
guiOptionsScreen = OPTIONS_SCREEN;
//Init the slider bar;
InitSlider();
if( gfExitOptionsDueToMessageBox )
{
gfRedrawOptionsScreen = TRUE;
gfExitOptionsDueToMessageBox = FALSE;
return( TRUE );
}
gfExitOptionsDueToMessageBox = FALSE;
// load the options screen background graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\OptionScreenBase.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiOptionBackGroundImage));
// load button, title graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
GetMLGFilename( VObjectDesc.ImageFile, MLG_OPTIONHEADER );
CHECKF(AddVideoObject(&VObjectDesc, &guiOptionsAddOnImages));
//Save game button
giOptionsButtonImages = LoadButtonImage("INTERFACE\\OptionScreenAddons2.sti", -1,2,-1,3,-1 );
guiOptGotoSaveGameBtn = CreateIconAndTextButton( giOptionsButtonImages, zOptionsText[OPT_SAVE_GAME], OPT_BUTTON_FONT2,
OPT_BUTTON_ON_COLOR, DEFAULT_SHADOW,
OPT_BUTTON_OFF_COLOR, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
OPT_SAVE_BTN_X, OPT_SAVE_BTN_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnOptGotoSaveGameCallback);
SpecifyDisabledButtonStyle( guiOptGotoSaveGameBtn, DISABLED_STYLE_HATCHED );
if( guiPreviousOptionScreen == MAINMENU_SCREEN || !CanGameBeSaved() || guiPreviousOptionScreen == GAME_INIT_OPTIONS_SCREEN )
{
DisableButton( guiOptGotoSaveGameBtn );
}
//Load game button
giGotoLoadBtnImage = UseLoadedButtonImage( giOptionsButtonImages, -1,2,-1,3,-1 );
guiOptGotoLoadGameBtn = CreateIconAndTextButton( giGotoLoadBtnImage, zOptionsText[OPT_LOAD_GAME], OPT_BUTTON_FONT2,
OPT_BUTTON_ON_COLOR, DEFAULT_SHADOW,
OPT_BUTTON_OFF_COLOR, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
OPT_LOAD_BTN_X, OPT_LOAD_BTN_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnOptGotoLoadGameCallback);
// SpecifyDisabledButtonStyle( guiBobbyRAcceptOrder, DISABLED_STYLE_SHADED );
//Quit to main menu button
giQuitBtnImage = UseLoadedButtonImage( giOptionsButtonImages, -1,2,-1,3,-1 );
guiQuitButton = CreateIconAndTextButton( giQuitBtnImage, zOptionsText[OPT_MAIN_MENU], OPT_BUTTON_FONT2,
OPT_BUTTON_ON_COLOR, DEFAULT_SHADOW,
OPT_BUTTON_OFF_COLOR, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
OPT_QUIT_BTN_X, OPT_QUIT_BTN_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnOptQuitCallback);
SpecifyDisabledButtonStyle( guiQuitButton, DISABLED_STYLE_HATCHED );
// DisableButton( guiQuitButton );
// 1.13 Features Button
gi113FeaturesBtnImage = UseLoadedButtonImage( giOptionsButtonImages, -1,2,-1,3,-1 );
gui113FeaturesButton = CreateIconAndTextButton( gi113FeaturesBtnImage, zOptionsText[OPT_NEW_IN_113], OPT_BUTTON_FONT2,
FONT_MCOLOR_LTYELLOW, DEFAULT_SHADOW,
FONT_MCOLOR_LTYELLOW, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
OPT_SWAP_BTN_X, OPT_SWAP_BTN_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, Btn113FeaturesCallback);
if (is_networked)
{
DisableButton(gui113FeaturesButton);
}
// ary-05/05/2009 : need more option screen toggles : Add in buttons that allow for options column paging
// Previous Column of options
giOptPrevBtnImage = UseLoadedButtonImage( giOptionsButtonImages, -1,2,-1,3,-1 );
guiOptPrevButton = CreateIconAndTextButton( giOptPrevBtnImage, zOptionsText[OPT_PREV], OPT_BUTTON_FONT2,
OPT_BUTTON_ON_COLOR, DEFAULT_SHADOW,
OPT_BUTTON_OFF_COLOR, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
OPT_PREV_BTN_X, OPT_PREV_BTN_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnOptPrevCallback);
SpecifyDisabledButtonStyle( guiOptPrevButton, DISABLED_STYLE_HATCHED );
if( OptionsList_Column_Offset == 0 )
{
DisableButton( guiOptPrevButton );
}
// Next Column of options
giOptNextBtnImage = UseLoadedButtonImage( giOptionsButtonImages, -1,2,-1,3,-1 );
guiOptNextButton = CreateIconAndTextButton( giOptNextBtnImage, zOptionsText[OPT_NEXT], OPT_BUTTON_FONT2,
OPT_BUTTON_ON_COLOR, DEFAULT_SHADOW,
OPT_BUTTON_OFF_COLOR, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
OPT_NEXT_BTN_X, OPT_NEXT_BTN_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnOptNextCallback);
SpecifyDisabledButtonStyle( guiOptNextButton, DISABLED_STYLE_HATCHED );
if( OptionsList_Column_Offset >= (Max_Number_Of_Pages-2) )// ary-05/05/2009 : "Max_Number_Of_Pages-2" becaues each "page" = 2 "columns"
{
DisableButton( guiOptNextButton );
}
//Done button
giDoneBtnImage = UseLoadedButtonImage( giOptionsButtonImages, -1,2,-1,3,-1 );
guiDoneButton = CreateIconAndTextButton( giDoneBtnImage, zOptionsText[OPT_DONE], OPT_BUTTON_FONT2,
OPT_BUTTON_ON_COLOR, DEFAULT_SHADOW,
OPT_BUTTON_OFF_COLOR, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
OPT_DONE_BTN_X, OPT_DONE_BTN_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnDoneCallback);
// SpecifyDisabledButtonStyle( guiBobbyRAcceptOrder, DISABLED_STYLE_SHADED );
Create_Toggle_Buttons(); // ary-05/05/2009 : moved block out of func
//Create a mouse region so when the user leaves a togglebox text region we can detect it then unselect the region
MSYS_DefineRegion( &gSelectedToggleBoxAreaRegion, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, MSYS_PRIORITY_NORMAL,
CURSOR_NORMAL, SelectedToggleBoxAreaRegionMovementCallBack, MSYS_NO_CALLBACK );
MSYS_AddRegion( &gSelectedToggleBoxAreaRegion );
//Render the scene before adding the slider boxes
RenderOptionsScreen();
//Add a slider bar for the Sound Effects
guiSoundEffectsSliderID = AddSlider( SLIDER_VERTICAL_STEEL, CURSOR_NORMAL, OPT_SOUND_EFFECTS_SLIDER_X, OPT_SOUND_EFFECTS_SLIDER_Y,
OPT_SLIDER_BAR_SIZE, 127, MSYS_PRIORITY_HIGH, SoundFXSliderChangeCallBack, 0 );
AssertMsg( guiSoundEffectsSliderID, "Failed to AddSlider" );
SetSliderValue( guiSoundEffectsSliderID, GetSoundEffectsVolume() );
//Add a slider bar for the Speech
guiSpeechSliderID = AddSlider( SLIDER_VERTICAL_STEEL, CURSOR_NORMAL, OPT_SPEECH_SLIDER_X, OPT_SPEECH_SLIDER_Y,
OPT_SLIDER_BAR_SIZE, 127, MSYS_PRIORITY_HIGH, SpeechSliderChangeCallBack, 0 );
AssertMsg( guiSpeechSliderID, "Failed to AddSlider" );
SetSliderValue( guiSpeechSliderID, GetSpeechVolume() );
//Add a slider bar for the Music
guiMusicSliderID = AddSlider( SLIDER_VERTICAL_STEEL, CURSOR_NORMAL, OPT_MUSIC_SLIDER_X, OPT_MUSIC_SLIDER_Y,
OPT_SLIDER_BAR_SIZE, 127, MSYS_PRIORITY_HIGH, MusicSliderChangeCallBack, 0 );
AssertMsg( guiMusicSliderID, "Failed to AddSlider" );
SetSliderValue( guiMusicSliderID, MusicGetVolume() );
//Remove the mouse region over the clock
RemoveMouseRegionForPauseOfClock( );
//Draw the screen
gfRedrawOptionsScreen = TRUE;
//Set the option screen toggle boxes
SetOptionsScreenToggleBoxes();
DisableScrollMessages();
//reset
gbHighLightedOptionText = -1;
//get the status of the tree top option
gfSettingOfTreeTopStatusOnEnterOfOptionScreen = gGameSettings.fOptions[ TOPTION_TOGGLE_TREE_TOPS ];
//Get the status of the item glow option
gfSettingOfItemGlowStatusOnEnterOfOptionScreen = gGameSettings.fOptions[ TOPTION_GLOW_ITEMS ];
gfSettingOfDontAnimateSmoke = gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ];
gfSettingOfTacticalFaceIcon = gGameSettings.fOptions[ TOPTION_SHOW_TACTICAL_FACE_ICONS ];
gfOptionsScreenUnloading = FALSE;
return( TRUE );
}
void ExitOptionsScreen()
{
if (gfOptionsScreenUnloading == TRUE)
return;
gfOptionsScreenUnloading = TRUE;
if( gfExitOptionsDueToMessageBox )
{
gfOptionsScreenExit = FALSE;
if( !gfExitOptionsAfterMessageBox )
return;
gfExitOptionsAfterMessageBox = FALSE;
gfExitOptionsDueToMessageBox = FALSE;
}
//Get the current status of the toggle boxes
GetOptionsScreenToggleBoxes(); //currently empty, used to interpret button states to determine gGameSettings.fOptions[]
//its still remains in case of future dev where any final interpertations may be needed
//The save the current settings to disk
SaveGameSettings();
//Create the clock mouse region
// CreateMouseRegionForPauseOfClock( CLOCK_REGION_START_X, CLOCK_REGION_START_Y );
if( guiOptionsScreen == GAME_SCREEN )
{
EnterTacticalScreen( );
}
if (guiOptionsScreen == SAVE_LOAD_SCREEN && guiPreviousOptionScreen == MAINMENU_SCREEN)
{
giMAXIMUM_NUMBER_OF_PLAYER_SLOTS = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS;
InitDependingGameStyleOptions();
}
RemoveButton( guiOptGotoSaveGameBtn );
RemoveButton( guiOptGotoLoadGameBtn );
RemoveButton( guiQuitButton );
RemoveButton( gui113FeaturesButton );
RemoveButton( guiOptNextButton );// ary-05/05/2009 : more option screen toggles
RemoveButton( guiOptPrevButton );
RemoveButton( guiDoneButton );
UnloadButtonImage( giOptionsButtonImages );
UnloadButtonImage( giGotoLoadBtnImage );
UnloadButtonImage( giQuitBtnImage );
UnloadButtonImage( gi113FeaturesBtnImage);
UnloadButtonImage( giOptNextBtnImage );// ary-05/05/2009 : more option screen toggles
UnloadButtonImage( giOptPrevBtnImage );
UnloadButtonImage( giDoneBtnImage );
DeleteVideoObjectFromIndex( guiOptionBackGroundImage );
DeleteVideoObjectFromIndex( guiOptionsAddOnImages );
Destroy_Toggle_Buttons(); // ary-05/05/2009 : moved block out of func
//REmove the slider bars
RemoveSliderBar( guiSoundEffectsSliderID );
RemoveSliderBar( guiSpeechSliderID );
RemoveSliderBar( guiMusicSliderID );
MSYS_RemoveRegion( &gSelectedToggleBoxAreaRegion );
ShutDownSlider();
//if we are coming from mapscreen
if( gfEnteredFromMapScreen )
{
gfEnteredFromMapScreen = FALSE;
guiTacticalInterfaceFlags |= INTERFACE_MAPSCREEN;
}
//if the user changed the TREE TOP option, AND a world is loaded
// sevenfm: always update tree top state
//if( gfSettingOfTreeTopStatusOnEnterOfOptionScreen != gGameSettings.fOptions[ TOPTION_TOGGLE_TREE_TOPS ] && gfWorldLoaded )
if (gfWorldLoaded)
{
SetTreeTopStateForMap();
}
//if the user has changed the item glow option AND a world is loaded
if( gfSettingOfItemGlowStatusOnEnterOfOptionScreen != gGameSettings.fOptions[ TOPTION_GLOW_ITEMS ] && gfWorldLoaded )
{
ToggleItemGlow( gGameSettings.fOptions[ TOPTION_GLOW_ITEMS ] );
}
if( gfSettingOfDontAnimateSmoke != gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] && gfWorldLoaded )
{
UpdateSmokeEffectGraphics( );
}
//CHRISL: Reinitialize portrait graphic
if( gfSettingOfTacticalFaceIcon != gGameSettings.fOptions[ TOPTION_SHOW_TACTICAL_FACE_ICONS ] )
{
InitializeTacticalPortraits( );
}
}
void HandleOptionsScreen()
{
HandleSliderBarMovementSounds();
HandleHighLightedText( TRUE );
}
void RenderOptionsScreen()
{
HVOBJECT hPixHandle;
UINT16 usPosY, usPosX;
UINT16 usWidth=0;
UINT8 count;
CHAR16 sPage[60];
//Get and display the background image
GetVideoObject(&hPixHandle, guiOptionBackGroundImage);
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, iScreenWidthOffset, iScreenHeightOffset, VO_BLT_SRCTRANSPARENCY,NULL);
//Get and display the titla image
GetVideoObject(&hPixHandle, guiOptionsAddOnImages);
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, iScreenWidthOffset, iScreenHeightOffset, VO_BLT_SRCTRANSPARENCY,NULL);
BltVideoObject(FRAME_BUFFER, hPixHandle, 1, iScreenWidthOffset, iScreenHeightOffset + 434, VO_BLT_SRCTRANSPARENCY,NULL);
//
// Text for the toggle boxes
//
//Display the First column of toggles
for( count=0; count<MAX_NUMBER_OF_OPTION_TOGGLES; count++)
{
if( toggle_box_array[ count ] == -1 )
{ break; }// no text for non existing buttons
//setup base points of where graphics/text/regions are going to be placed
if( count % OPT_FIRST_COLUMN_TOGGLE_CUT_OFF == 0 )
{
//reset the vertical position
usPosY = OPT_TOGGLE_BOX_FIRST_COLUMN_START_Y + OPT_TOGGLE_TEXT_OFFSET_Y;
}
if( count < OPT_FIRST_COLUMN_TOGGLE_CUT_OFF )
{
usPosX = OPT_TOGGLE_BOX_FIRST_COL_TEXT_X;
}
else
{
usPosX = OPT_TOGGLE_BOX_SECOND_TEXT_X;
}
usWidth = StringPixLength( zOptionsToggleText[ toggle_box_array[ count ] ], OPT_MAIN_FONT );
//if the string is going to wrap, move the string up a bit
if( usWidth > OPT_TOGGLE_BOX_TEXT_WIDTH )
DisplayWrappedString( usPosX, usPosY, OPT_TOGGLE_BOX_TEXT_WIDTH, 2, OPT_MAIN_FONT, OPT_MAIN_COLOR,
zOptionsToggleText[ toggle_box_array[ count ] ], FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
else
DrawTextToScreen( zOptionsToggleText[ toggle_box_array[ count ] ], usPosX, usPosY, 0,
OPT_MAIN_FONT, OPT_MAIN_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
usPosY += OPT_GAP_BETWEEN_TOGGLE_BOXES;
}
//
// Text for the Slider Bars
//
//Display the Sound Fx text
DisplayWrappedString( OPT_SOUND_FX_TEXT_X, OPT_SOUND_FX_TEXT_Y, OPT_SLIDER_TEXT_WIDTH, 2, OPT_SLIDER_FONT, OPT_MAIN_COLOR,
zOptionsText[ OPT_SOUND_FX ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//Display the Speech text
DisplayWrappedString( OPT_SPEECH_TEXT_X, OPT_SPEECH_TEXT_Y, OPT_SLIDER_TEXT_WIDTH, 2, OPT_SLIDER_FONT, OPT_MAIN_COLOR,
zOptionsText[ OPT_SPEECH ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//Display the Music text
DisplayWrappedString( OPT_MUSIC_TEXT_X, OPT_MUSIC_TEXT_Y, OPT_SLIDER_TEXT_WIDTH, 2, OPT_SLIDER_FONT, OPT_MAIN_COLOR,
zOptionsText[ OPT_MUSIC ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//Display the option page numbers
swprintf( sPage, L"%d / %d", OptionsList_Column_Offset + 1, Max_Number_Of_Pages - 1 );
DisplayWrappedString( OPT_PAGE_X, OPT_PAGE_Y, OPT_SLIDER_TEXT_WIDTH, 2, OPT_BUTTON_FONT2, OPT_MAIN_COLOR,
sPage, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
InvalidateRegion( OPTIONS__TOP_LEFT_X, OPTIONS__TOP_LEFT_Y, OPTIONS__BOTTOM_RIGHT_X, OPTIONS__BOTTOM_RIGHT_Y);
}
void GetOptionsScreenUserInput()
{
InputAtom Event;
POINT MousePos;
GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords!
while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN )
{
switch( Event.usParam )
{
case 'q':
case 'Q':
//Confirm the Exit to the main menu screen
DoOptionsMessageBox( MSG_BOX_BASIC_STYLE, zOptionsText[OPT_RETURN_TO_MAIN], OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO,
ConfirmQuitToMainMenuMessageBoxCallBack );
break;
case ESC:
SetOptionsExitScreen( guiPreviousOptionScreen );
break;
//Enter the save game screen
case 's':
case 'S':
//if the save game button isnt disabled
if( ButtonList[ guiOptGotoSaveGameBtn ]->uiFlags & BUTTON_ENABLED )
{
SetOptionsExitScreen( SAVE_LOAD_SCREEN );
gfSaveGame = TRUE;
}
break;
//Enter the Load game screen
case 'l':
case 'L':
SetOptionsExitScreen( SAVE_LOAD_SCREEN );
gfSaveGame = FALSE;
break;
// toggle between features and options screen
case TAB: