-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameCode.bas
4313 lines (3558 loc) · 173 KB
/
GameCode.bas
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
Option Explicit
Option Base 1
Const debugEnabled As Boolean = True
'''''''''''''''''''''''''''''''''''''''''''''''''''
' GLOBAL CONFIGURATION VARIABLES '
'''''''''''''''''''''''''''''''''''''''''''''''''''
Public numberOfTeams_BorderedArray() As Variant, numberOfTeams_BorderlessArray() As Variant
Public numberOfLotteryTiles_BorderedArray() As Variant, numberOfLotteryTiles_BorderlessArray() As Variant
Public classTrackerDays_SelectedArray() As Variant, classTrackerDays_UnselectedArray() As Variant
Public classTrackerTimes_SelectedArray() As Variant, classTrackerTimes_UnselectedArray() As Variant
Public enabledGrade_SelectedArray() As Variant, enabledGrade_UnselectedArray() As Variant
Public enabledLevel_SelectedArray() As Variant, enabledLevel_UnselectedArray() As Variant
Public enabledBook_SelectedArray() As Variant, enabledBook_UnselectedArray() As Variant
Public enabledUnit_SelectedArray() As Variant, enabledUnit_UnselectedArray() As Variant
Public configSld As Integer, configSld2 As Integer, numberOfTeams As Integer, numberOfLotteryTiles As Integer
Public allowNegatives As Boolean, autoAddPoints As Boolean
Public enableTrivia As Boolean, enableGrammar As Boolean, enableReview As Boolean, enableChallenges As Boolean
Public enabledGrade As String, enabledLevel As String, enabledBook As String, enabledUnit As Integer
Public classDay As String, classTime As String
'''''''''''''''''''''''''''''''''''''''''''''''''''
' OS & ENVIRONMENT VARIABLES '
'''''''''''''''''''''''''''''''''''''''''''''''''''
Public pathSeparator As String, tempFolder As String, configFolder As String
Dim fileAccessGranted As Boolean
Public osIsWindows As Boolean
Public quotationMark As String
'''''''''''''''''''''''''''''''''''''''''''''''''''
' GLOBAL GAMEPLAY VARIABLES '
'''''''''''''''''''''''''''''''''''''''''''''''''''
Public alreadySeenSlidesArray() As Integer, previouslySeenQuestionsArray() As String, randomlySelectedLotteryTilesArray() As String
Public variableNamesArray() As String, variableValuesArray() As Variant
Public currentStateNamesArray() As String, currentStateValuesArray() As Variant
Public gameboardSlide As Integer, lotterySlide As Integer, rulesSlide As Integer
Public firstQuestionSlide As Integer, lastQuestionSlide As Integer, firstLotterySlide As Integer, lastLotterySlide As Integer
Public birdsPointsOne As Integer, birdsPointsTwo As Integer, birdsPointsThree As Integer, pigsPointsOne As Integer, pigsPointsTwo As Integer, pigsPointsThree As Integer
Public chosenTile As String, chosenLottery As String, chosenSlide As Integer
'''''''''''''''''''''''''''''''''''''''''''''''''''
' GLOBAL SCOREBOARD VARIABLES '
'''''''''''''''''''''''''''''''''''''''''''''''''''
Public team1Score As Integer, team2Score As Integer, team3Score As Integer, team4Score As Integer, marmosetsScore As Integer
Public swapFirstTeam As String, swapSecondTeam As String, swapInProgress As Boolean
Public doublePoints As Integer
'''''''''''''''''''''''''''''''''''''''''''''''''''
' DEFAULT VARIABLES '
'''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub InitializeDefaultValues()
If debugEnabled Then
Debug.Print vbCrLf & "Initializing default game values."
End If
quotationMark = """"
numberOfTeams = 2
numberOfLotteryTiles = 8
autoAddPoints = True
allowNegatives = True
enableTrivia = True
enableGrammar = False
enableReview = False
enableChallenges = False
classTime = "NoTime"
classDay = "NoDay"
enabledGrade = ""
enabledLevel = ""
enabledBook = ""
enabledUnit = 0
chosenTile = ""
chosenLottery = ""
chosenSlide = 0
team1Score = 0
team2Score = 0
team3Score = 0
team4Score = 0
marmosetsScore = 0
ReDim previouslySeenQuestionsArray(1)
previouslySeenQuestionsArray(1) = ""
If debugEnabled Then
Debug.Print " quotationMark: " & quotationMark
Debug.Print " numberOfTeams: " & numberOfTeams
Debug.Print " numberOfLotteryTiles: " & numberOfLotteryTiles
Debug.Print " autoAddPoints: " & autoAddPoints
Debug.Print " allowNegatives: " & allowNegatives
Debug.Print " enableTrivia: " & enableTrivia
Debug.Print " enableGrammar: " & enableGrammar
Debug.Print " enableReview: " & enableReview
Debug.Print " enableChallenges: " & enableChallenges
Debug.Print " classTime: " & classTime
Debug.Print " classDay: " & classDay
Debug.Print " enabledGrade: " & enabledGrade
Debug.Print " enabledLevel: " & enabledLevel
Debug.Print " enabledBook: " & enabledBook
Debug.Print " enabledUnit: " & enabledUnit
Debug.Print " chosenTile: " & chosenTile
Debug.Print " chosenLottery: " & chosenLottery
Debug.Print " chosenSlide: " & chosenSlide
Debug.Print " team1Score: " & team1Score
Debug.Print " team2Score: " & team2Score
Debug.Print " team3Score: " & team3Score
Debug.Print " team4Score: " & team4Score
Debug.Print " marmosetsScore: " & marmosetsScore
If IsEmpty(previouslySeenQuestionsArray) Then
Debug.Print " previouslySeenQuestionsArray size: Empty"
Else
Debug.Print " previouslySeenQuestionsArray size: " & IIf(UBound(previouslySeenQuestionsArray) <> LBound(previouslySeenQuestionsArray), (UBound(previouslySeenQuestionsArray) - LBound(previouslySeenQuestionsArray)), UBound(previouslySeenQuestionsArray))
Debug.Print " previouslySeenQuestionsArray(" & UBound(previouslySeenQuestionsArray) & "): " & previouslySeenQuestionsArray(UBound(previouslySeenQuestionsArray))
End If
Debug.Print "Default values set."
End If
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''
' TITLE SCREEN
'''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub TitleScreen(clickedShp As Shape)
Dim chosenConfigFile As String
#If Mac Then
CheckForAppleScript
#End If
SetOSVariables
SetFolders
ResetToDefaultState
CheckForUpdates
InitializeDefaultValues
Select Case clickedShp.Name
Case "LoadConfig"
chosenConfigFile = ChooseFileToLoad()
If chosenConfigFile <> "" Then
#If Mac Then
LoadConfigMac "ExistingConfig", chosenConfigFile
#Else
Dim fs As Object, configFileToLoad As Object
Set fs = CreateObject("Scripting.FileSystemObject")
Set configFileToLoad = fs.OpenTextFile(chosenConfigFile, 1, False, -1)
LoadConfigWindows "ExistingConfig", configFileToLoad
#End If
End If
Case "RestoreGame"
RestoreGame
Case "UseDefaults"
StartGameWithDefaults
Case "CreateConfig"
PrepareOptionsMenuStep1
End Select
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''
' SOFTWARE REQUIREMENTS & DEPENDENCIES
'''''''''''''''''''''''''''''''''''''''''''''''''''
#If Mac Then
Private Sub CheckForAppleScript()
Dim appleScriptPath As String, isScriptInstalled As String, messageToDisplay As String
Dim userChoice As Integer
appleScriptPath = MacScript("return POSIX path of (path to desktop folder) as string")
appleScriptPath = Replace(appleScriptPath, "/Desktop", "") & "Library/Application Scripts/com.microsoft.Powerpoint/AngryBirds.scpt"
If debugEnabled Then
Debug.Print "Verifying that AngryBirds.scpt is correctly installed."
Debug.Print "Script directory set to: " & appleScriptPath
End If
On Error Resume Next
isScriptInstalled = Dir(appleScriptPath, vbDirectory)
If debugEnabled Then
Debug.Print IIf(Not (isScriptInstalled = vbNullString), "AngryBirds.scpt found. Now checking if there is a newer version available.", "AngryBirds.scpt is missing. Please follow the instructions for how to install it.")
End If
If Not (isScriptInstalled = vbNullString) Then
On Error GoTo 0
CheckForScriptUpdate
Exit Sub
End If
On Error GoTo 0
messageToDisplay = "Warning! The AngryBirds.scpt file is not correctly installed. The game will not function correctly without it. Would you like to download the latest version now? If no, click 'No' to close the game."
DisplayMessage messageToDisplay, "AppleScriptNotFound", userChoice
If userChoice = vbYes Then
ActivePresentation.FollowHyperlink Address:="https://github.com/papercutter0324/applescripts/tree/main"
If debugEnabled Then
Debug.Print "Opening page to download and install AngryBirds.sctp."
End If
End If
ActivePresentation.SlideShowWindow.View.Exit
End Sub
#End If
#If Mac Then
#Else
Private Function CheckForCurl() As Boolean
Dim objShell As Object, objExec As Object
Dim output As String, messageToDisplay As String
Dim checkResult As Boolean
If debugEnabled Then
Debug.Print "Checking if curl.exe is installed."
End If
'Create a shell object
Set objShell = CreateObject("WScript.Shell")
'Attempt to run curl and capture the output
On Error Resume Next
Set objExec = objShell.exec("cmd /c curl.exe --version")
On Error GoTo 0
If objExec Is Nothing Then
If debugEnabled Then
Debug.Print " Not installed. Falling back to .Net."
End If
Set objExec = Nothing
Set objShell = Nothing
CheckForCurl = False
Else
Do While Not objExec.StdOut.AtEndOfStream
output = output & objExec.StdOut.ReadLine() & vbCrLf
Loop
checkResult = ((InStr(output, "curl")) > 0)
If debugEnabled Then
Debug.Print IIf(checkResult, " Installed.", " Not installed. Falling back to .Net.")
End If
Set objExec = Nothing
Set objShell = Nothing
CheckForCurl = checkResult
End If
End Function
#End If
Private Function CheckForExcel() As Boolean
If debugEnabled Then
Debug.Print "Verifying that Microsoft Excel is installed."
End If
#If Mac Then
CheckForExcel = AppleScriptTask("AngryBirds.scpt", "IsExcelInstalled", "noParam")
#Else
Dim xlApp As Object
On Error Resume Next
Set xlApp = CreateObject("Excel.Application")
On Error GoTo 0
xlApp.Quit
Set xlApp = Nothing
CheckForExcel = Not (Err.Number <> 0)
#End If
If debugEnabled Then
Debug.Print " Installed: " & CheckForExcel
End If
End Function
#If Mac Then
#Else
Private Function CheckForDotNet35() As Boolean
If debugEnabled Then
Debug.Print "Verifying that Microsoft DotNet 3.5 is installed."
End If
CheckForDotNet35 = Not (Dir$(Environ$("systemroot") & "\Microsoft.NET\Framework\v3.5", vbDirectory) = vbNullString)
If debugEnabled Then
Debug.Print " Installed: " & CheckForDotNet35
End If
End Function
#End If
'''''''''''''''''''''''''''''''''''''''''''''''''''
' INITIAL GAME SETUP
'''''''''''''''''''''''''''''''''''''''''''''''''''
#If Mac Then
Private Sub RequestFileAccess()
Dim fileNameList As String, filePermissionCandidates() As String
Dim i As Integer
If debugEnabled Then
Debug.Print vbCrLf & "Requesting access to game files."
End If
fileNameList = AppleScriptTask("AngryBirds.scpt", "GetFileList", "configFolder")
If fileNameList = "" Then
Exit Sub
End If
filePermissionCandidates = Split(fileNameList, ";")
If Not (UBound(filePermissionCandidates) >= LBound(filePermissionCandidates)) Then
Exit Sub
End If
For i = LBound(filePermissionCandidates) To UBound(filePermissionCandidates)
filePermissionCandidates(i) = configFolder & pathSeparator & filePermissionCandidates(i)
Next i
fileAccessGranted = GrantAccessToMultipleFiles(filePermissionCandidates)
If debugEnabled Then
Debug.Print IIf(fileAccessGranted, " Access has been granted.", " Acees has been denied.")
End If
End Sub
#End If
Private Sub SetOSVariables()
If debugEnabled Then
Debug.Print "Setting OS-specific variables."
End If
#If Mac Then
osIsWindows = False
pathSeparator = "/"
#Else
osIsWindows = True
pathSeparator = "\"
#End If
If debugEnabled Then
Debug.Print " Operating System: " & Application.OperatingSystem
Debug.Print " File path separator: " & pathSeparator
End If
End Sub
Private Sub SetFolders()
If debugEnabled Then
Debug.Print vbCrLf & "Initializing working directories."
End If
#If Mac Then
configFolder = AppleScriptTask("AngryBirds.scpt", "SetConfigDirectory", "NoParam")
tempFolder = AppleScriptTask("AngryBirds.scpt", "SetTempDirectory", "NoParam")
If configFolder = "" Then
configFolder = ActivePresentation.Path
End If
If tempFolder = "" Then
tempFolder = ActivePresentation.Path
End If
#Else
Dim winDocumentsFolder As String
Dim objFolder As Object
Set objFolder = CreateObject("WScript.Shell").SpecialFolders
winDocumentsFolder = objFolder("mydocuments")
configFolder = ConvertOneDriveToLocalPath(winDocumentsFolder & "\DYB_AngryBird_ConfigFiles")
VerifyFolderExists configFolder, "Config folder", ActivePresentation.Path
If VerifyFileOrFolderExists(Environ$("TEMP")) Then
tempFolder = Environ$("TEMP")
ElseIf VerifyFileOrFolderExists(Environ$("TMP")) Then
tempFolder = Environ$("TMP")
Else
tempFolder = ActivePresentation.Path
End If
#End If
If debugEnabled Then
Debug.Print " Configuration folder: " & configFolder
Debug.Print " Temporary files folder: " & tempFolder
End If
End Sub
#If Mac Then
#Else
Private Sub VerifyFolderExists(ByVal folderPath As String, ByVal folderName As String, ByVal fallbackPath As String)
Dim messageToDisplay As String
Dim fs As Object
If debugEnabled Then
Debug.Print " Verfiying that directories exist."
End If
If VerifyFileOrFolderExists(folderPath) Then
Exit Sub
End If
If debugEnabled Then
Debug.Print " Folder not found. Attempting to create: " & folderPath
End If
Set fs = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
fs.CreateFolder folderPath
On Error GoTo 0
If VerifyFileOrFolderExists(folderPath) Then
If debugEnabled Then
Debug.Print " Folder creation successful. Using path: " & folderPath
End If
Exit Sub
End If
If VerifyFileOrFolderExists(fallbackPath) Then
folderPath = fallbackPath
If debugEnabled Then
Debug.Print " Folder creation unsuccessful. Using fallback path: " & folderPath
End If
Else
messageToDisplay = "Critical error! Could not set a working directory. Game cannot continue."
DisplayMessage messageToDisplay, "OkOnly"
If debugEnabled Then
Debug.Print " Unable to set working directory. Terminating game." & folderPath
End If
ActivePresentation.SlideShowWindow.View.Exit
End If
End Sub
#End If
Private Sub ResetToDefaultState()
Dim sld As Slide, shp As Shape
Dim numOfTeams As String
If debugEnabled Then
Debug.Print vbCrLf & "Resetting PPT to default state."
End If
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.Name = "Slide Category" Then
Select Case Mid(shp.TextFrame.TextRange.Text, 17)
Case "Gameboard"
ResetGameboardAndLotteryShapes sld
numOfTeams = Right(sld.Shapes("Number of Teams").TextFrame.TextRange.Text, 1)
Select Case numOfTeams
Case "2"
With sld.Shapes
.Item("Team1_Scoreboard").TextFrame.TextRange.Text = 0
.Item("Team2_Scoreboard").TextFrame.TextRange.Text = 0
.Item("Marmoset_Scoreboard").TextFrame.TextRange.Text = 0
End With
Case "3"
With sld.Shapes
.Item("Team1_Scoreboard").TextFrame.TextRange.Text = 0
.Item("Team2_Scoreboard").TextFrame.TextRange.Text = 0
.Item("Team3_Scoreboard").TextFrame.TextRange.Text = 0
.Item("Marmoset_Scoreboard").TextFrame.TextRange.Text = 0
End With
Case "4"
With sld.Shapes
.Item("Team1_Scoreboard").TextFrame.TextRange.Text = 0
.Item("Team2_Scoreboard").TextFrame.TextRange.Text = 0
.Item("Team3_Scoreboard").TextFrame.TextRange.Text = 0
.Item("Team4_Scoreboard").TextFrame.TextRange.Text = 0
End With
End Select
Case "Lottery"
ResetGameboardAndLotteryShapes sld
Case "Config_1"
configSld = sld.SlideIndex
Case "Config_2"
configSld2 = sld.SlideIndex
End Select
ElseIf shp.Name = "ChosenQuestionTile" Then
shp.Delete
End If
Next shp
Next sld
If debugEnabled Then
Debug.Print " Gameboard reset to default state."
Debug.Print " Scoreboards reset to 0."
Debug.Print " Lottery slide reset to deafult state."
Debug.Print " Question IDs removed from trivia slides."
Debug.Print " Configuration menu found on slides " & configSld & " and " & configSld2 & "."
End If
End Sub
Private Sub ResetGameboardAndLotteryShapes(ByVal sld As Slide)
Dim tline As TimeLine, shp As Shape
Dim i As Integer
Set tline = sld.TimeLine
For Each shp In sld.Shapes
shp.Visible = msoTrue
Next shp
If tline.MainSequence.Count > 0 Then
For i = tline.MainSequence.Count To 1 Step -1
tline.MainSequence.Item(i).Delete
Next i
End If
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''
' CHECK FOR UPDATES
'''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub CheckForUpdates()
Dim currentGameVersion As Long, currentQuestionsVersion As Long, onlineGameVersion As Long, onlineQuestionsVersion As Long
Dim gameUpdateExists As Boolean, questionsUpdateExists As Boolean
If debugEnabled Then
Debug.Print vbCrLf & "Checking for game and question updates."
End If
currentGameVersion = GetCurrentVersionNumber("Game")
currentQuestionsVersion = GetCurrentVersionNumber("Questions")
onlineGameVersion = GetOnlineVersionNumber("Game")
onlineQuestionsVersion = GetOnlineVersionNumber("Questions")
ActivePresentation.Slides(configSld).Shapes("Versions_Game_Update").Visible = (onlineGameVersion > currentGameVersion)
ActivePresentation.Slides(configSld).Shapes("Versions_Questions_Update").Visible = (onlineQuestionsVersion > currentQuestionsVersion)
If debugEnabled Then
Debug.Print vbCrLf & "Version Check Results:"
Debug.Print IIf(onlineGameVersion > currentGameVersion, " Game update found. Displaying update button.", " Local game version is up-to-date.")
Debug.Print IIf(onlineGameVersion > currentGameVersion, " Questions update found. Displaying update button.", " Local questions version is up-to-date.")
End If
End Sub
#If Mac Then
Private Sub CheckForScriptUpdate()
Dim onlineScriptVersion As Long
Dim updateResult As Boolean
onlineScriptVersion = GetOnlineVersionNumber("AngryBirds.scpt")
If debugEnabled Then
Debug.Print vbCrLf & "Checking for AngryBirds.scpt updates."
Debug.Print " " & AppleScriptTask("AngryBirds.scpt", "GetScriptVersionNumber", "noParam")
Debug.Print " Online version: " & onlineScriptVersion
End If
If onlineScriptVersion <> 0 Then
updateResult = AppleScriptTask("AngryBirds.scpt", "GetLatestScriptVersion", onlineScriptVersion)
End If
If debugEnabled Then
Debug.Print IIf(updateResult, " AngryBirds.scpt has been updated to latest version.", " AngryBirds.scpt is already up-to-date.")
End If
End Sub
#End If
Private Function GetCurrentVersionNumber(ByVal versionToCheck As String) As Long
Dim localVersion As Long
Dim sld As Slide
Set sld = ActivePresentation.Slides(configSld)
On Error Resume Next
If versionToCheck = "Game" Then
localVersion = ConvertStringToLong(sld.Shapes("Versions_Game_Version").TextFrame.TextRange.Text, 0, ".")
ElseIf versionToCheck = "Questions" Then
localVersion = CLng(sld.Shapes("Versions_Questions_Version").TextFrame.TextRange.Text)
End If
On Error GoTo 0
GetCurrentVersionNumber = IIf(localVersion <> 0, localVersion, 0)
If debugEnabled Then
Debug.Print " Local " & versionToCheck & " version: " & localVersion
End If
End Function
Private Function GetOnlineVersionNumber(ByVal versionToCheck As String) As Long
Dim commitDate As String
#If Mac Then
On Error Resume Next
commitDate = AppleScriptTask("AngryBirds.scpt", "CheckForNewVersion", versionToCheck)
On Error GoTo 0
If commitDate <> "" And commitDate <> "0" Then
commitDate = JsonConverter.ParseJson(commitDate)(1)("commit")("author")("date")
End If
#Else
Dim fileName As String, urlToQuery As String
Dim http As Object
fileName = IIf(versionToCheck = "Game", "AngryBirdsPPT.txt", "Questions.xlsx") 'Set which file to check for
urlToQuery = "https://api.github.com/repos/papercutter0324/AngryBirdsTrivia-AdditionalFiles/commits?path=" & fileName
Set http = CreateObject("MSXML2.ServerXMLHTTP")
http.Open "GET", urlToQuery, False
http.setRequestHeader "Accept", "application/json"
http.send
On Error Resume Next
commitDate = JsonConverter.ParseJson(http.responseText)(1)("commit")("author")("date")
On Error GoTo 0
#End If
If commitDate <> "" Then
GetOnlineVersionNumber = ConvertStringToLong(commitDate)
End If
If debugEnabled Then
Debug.Print " Online " & versionToCheck & " version: " & GetOnlineVersionNumber
End If
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''
' PREPARE CONFIG & SETTINGS
'''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub PrepareOptionsMenuStep1(Optional ByVal loadPreviousConfig As String = "Startup")
Dim sld As Slide
Dim borderedShape As String, classDayEnabled As String, classTimeEnabled As String
Dim enableGrammarOrReview As Boolean
Dim shapePairs As Variant
Dim i As Integer
Set sld = ActivePresentation.Slides(configSld)
If loadPreviousConfig = "Startup" Then
If debugEnabled Then
Debug.Print vbCrLf & "Beginning setup of the configuration menus."
End If
CreateConfigButtonArrays
End If
' Create a multi-dimension array to track shape pairs and their setting's boolean value
shapePairs = Array( _
Array("AllowNegatives_Yes", "AllowNegatives_No", allowNegatives), _
Array("AutoPoints_Yes", "AutoPoints_No", autoAddPoints), _
Array("RandomChallenges_Yes", "RandomChallenges_No", enableChallenges), _
Array("Trivia_Include", "Trivia_Exclude", enableTrivia), _
Array("Grammar_Include", "Grammar_Exclude", enableGrammar), _
Array("Review_Include", "Review_Exclude", enableReview))
' Loop through the shape pairs and set visibility
For i = LBound(shapePairs) To UBound(shapePairs)
sld.Shapes(shapePairs(i)(1)).Visible = shapePairs(i)(3)
sld.Shapes(shapePairs(i)(2)).Visible = Not shapePairs(i)(3)
Next i
' Determine if the 'Next' or 'Save' button should be shown
enableGrammarOrReview = enableGrammar Or enableReview
sld.Shapes("Next_Config").Visible = enableGrammarOrReview
sld.Shapes("Save_and_Start").Visible = Not enableGrammarOrReview
' Ensure these shapes are hidden
sld.Shapes("Updating Indicator").Visible = msoFalse
sld.Shapes("Updating Message").Visible = msoFalse
sld.Shapes("Updating Background").Visible = msoFalse
SetConfigButtonVisibility "NumberOfTeams", sld, LBound(numberOfTeams_BorderedArray), UBound(numberOfTeams_BorderedArray), "NumberOfTeams_" & CStr(numberOfTeams) & "_Border", numberOfTeams_BorderedArray, numberOfTeams_BorderlessArray
SetConfigButtonVisibility "NumberOfLotteryTiles", sld, LBound(numberOfLotteryTiles_BorderedArray), UBound(numberOfLotteryTiles_BorderedArray), "NumberOfLotteryTiles_" & CStr(numberOfLotteryTiles) & "_Border", numberOfLotteryTiles_BorderedArray, numberOfLotteryTiles_BorderlessArray
SetConfigButtonVisibility "ClassDay", sld, LBound(classTrackerDays_SelectedArray), UBound(classTrackerDays_SelectedArray), "ClassDay_" & classDay & "_Enabled", classTrackerDays_SelectedArray, classTrackerDays_UnselectedArray
SetConfigButtonVisibility "ClassTime", sld, LBound(classTrackerTimes_SelectedArray), UBound(classTrackerTimes_SelectedArray), "ClassTime_" & classTime & "_Enabled", classTrackerTimes_SelectedArray, classTrackerTimes_UnselectedArray
PrepareOptionsMenuStep2 loadPreviousConfig
If debugEnabled Then
Debug.Print "Setup complete. Loading menu." & vbCrLf
End If
ChangeToNewSlide configSld
DisplayUpdateMessage
End Sub
Private Sub SetConfigButtonVisibility(ByVal setCase As String, ByVal sld As Slide, ByVal firstElement As Integer, ByVal lastElement As Integer, ByVal selectedShape As String, ByRef borderedArray() As Variant, ByRef borderlessArray() As Variant)
Dim buttonSection As String
Dim i As Integer
Select Case setCase
Case "NumberOfTeams", "NumberOfLotteryTiles"
For i = firstElement To lastElement
sld.Shapes(borderedArray(i)).Visible = (borderedArray(i) = selectedShape)
sld.Shapes(borderlessArray(i)).Visible = Not (borderedArray(i) = selectedShape)
Next i
Case "ClassDay", "ClassTime"
buttonSection = IIf(setCase = "ClassDay", classDay, classTime)
If buttonSection <> "" And buttonSection <> "NoTime" And buttonSection <> "NoDay" Then
For i = firstElement To lastElement
sld.Shapes(borderedArray(i)).Visible = (borderedArray(i) = selectedShape)
sld.Shapes(borderlessArray(i)).Visible = Not (borderedArray(i) = selectedShape)
Next i
Else
For i = firstElement To lastElement
sld.Shapes(borderedArray(i)).Visible = msoFalse
sld.Shapes(borderlessArray(i)).Visible = msoTrue
Next i
End If
End Select
End Sub
Private Sub PrepareOptionsMenuStep2(Optional ByVal resetPoint As String)
Dim sld As Slide
Dim i As Integer
Set sld = ActivePresentation.Slides(configSld2)
Select Case resetPoint
Case "Startup"
ResetVisibility sld, enabledGrade_SelectedArray, enabledGrade_UnselectedArray, False, True
ResetVisibility sld, enabledLevel_SelectedArray, enabledLevel_UnselectedArray, False, False
ResetVisibility sld, enabledBook_SelectedArray, enabledBook_UnselectedArray, False, False
ResetVisibility sld, enabledUnit_SelectedArray, enabledUnit_UnselectedArray, False, False
Case "PreviousConfig"
If enabledGrade <> "" Then
SetVisibility sld, enabledGrade_SelectedArray, enabledGrade_UnselectedArray, enabledGrade, "Grade"
End If
SetLevelVisibility sld, enabledLevel_SelectedArray, enabledLevel_UnselectedArray, enabledGrade, enabledLevel
If enabledBook <> "" And enabledLevel <> "" Then
SetBookVisibility sld, enabledBook_SelectedArray, enabledBook_UnselectedArray, enabledLevel, enabledBook
If enabledUnit > 0 Then
SetUnitVisibility sld, enabledUnit_SelectedArray, enabledUnit_UnselectedArray, enabledUnit
Else
ResetVisibility sld, enabledUnit_SelectedArray, enabledUnit_UnselectedArray, False, False
End If
Else
ResetVisibility sld, enabledBook_SelectedArray, enabledBook_UnselectedArray, False, False
ResetVisibility sld, enabledUnit_SelectedArray, enabledUnit_UnselectedArray, False, False
End If
Case Else
If resetPoint = "Grade" Then
SetVisibility sld, enabledGrade_SelectedArray, enabledGrade_UnselectedArray, enabledGrade, "Grade"
End If
If resetPoint = "Grade" Or resetPoint = "Level" Then
SetVisibility sld, enabledLevel_SelectedArray, enabledLevel_UnselectedArray, enabledLevel, "Level"
End If
If resetPoint = "Grade" Or resetPoint = "Level" Or resetPoint = "Book" Then
SetVisibility sld, enabledBook_SelectedArray, enabledBook_UnselectedArray, enabledBook, "Book"
SetUnitVisibility sld, enabledUnit_SelectedArray, enabledUnit_UnselectedArray, enabledUnit
End If
End Select
End Sub
Private Sub ResetVisibility(ByRef sld As Slide, ByRef selectedArray() As Variant, ByRef unselectedArray() As Variant, ByVal selectedVisible As Boolean, ByVal unselectedVisible As Boolean)
Dim i As Integer
For i = LBound(selectedArray) To UBound(selectedArray)
sld.Shapes(selectedArray(i)).Visible = selectedVisible
sld.Shapes(unselectedArray(i)).Visible = unselectedVisible
Next i
End Sub
Private Sub SetVisibility(ByRef sld As Slide, ByRef selectedArray() As Variant, ByRef unselectedArray() As Variant, ByVal enabledValue As String, ByVal prefix As String)
Dim i As Integer
If enabledValue <> "" Then
For i = LBound(selectedArray) To UBound(selectedArray)
sld.Shapes(selectedArray(i)).Visible = (selectedArray(i) = prefix & "_" & enabledValue & "_Enabled")
sld.Shapes(unselectedArray(i)).Visible = Not (selectedArray(i) = prefix & "_" & enabledValue & "_Enabled")
Next i
Else
For i = LBound(selectedArray) To UBound(selectedArray)
sld.Shapes(selectedArray(i)).Visible = msoFalse
sld.Shapes(unselectedArray(i)).Visible = msoFalse
Next i
End If
End Sub
Private Sub SetLevelVisibility(ByRef sld As Slide, ByRef selectedArray() As Variant, ByRef unselectedArray() As Variant, ByVal enabledGrade As String, ByVal enabledLevel As String)
Dim shp As Shape
Dim i As Integer, caseLevel As String
For i = LBound(unselectedArray) To UBound(unselectedArray)
Set shp = sld.Shapes(unselectedArray(i))
caseLevel = unselectedArray(i)
shp.Visible = IsLevelVisibleForGrade(caseLevel, enabledGrade)
If selectedArray(i) = "Level_" & enabledLevel & "_Enabled" Then
sld.Shapes(selectedArray(i)).Visible = msoTrue
sld.Shapes(unselectedArray(i)).Visible = msoFalse
End If
Next i
End Sub
Private Sub SetBookVisibility(ByRef sld As Slide, ByRef selectedArray() As Variant, ByRef unselectedArray() As Variant, ByVal enabledLevel As String, ByVal enabledBook As String)
Dim shp As Shape
Dim i As Integer, caseBook As String, bookNameArray() As String
For i = LBound(unselectedArray) To UBound(unselectedArray)
Set shp = sld.Shapes(unselectedArray(i))
bookNameArray = Split(enabledBook_UnselectedArray(i), "_")
caseBook = bookNameArray(1)
shp.Visible = IsBookVisibleForLevel(caseBook, enabledLevel)
If selectedArray(i) = "Book_" & enabledBook & "_Enabled" Then
sld.Shapes(selectedArray(i)).Visible = msoTrue
sld.Shapes(unselectedArray(i)).Visible = msoFalse
End If
Next i
End Sub
Private Sub SetUnitVisibility(ByRef sld As Slide, ByRef selectedArray() As Variant, ByRef unselectedArray() As Variant, ByVal enabledUnit As Integer)
Dim i As Integer, maxUnitNumber As Integer
maxUnitNumber = SetMaxUnitNumber
If maxUnitNumber = 0 Then
maxUnitNumber = UBound(selectedArray)
End If
Select Case True
Case (enabledUnit > 0)
For i = LBound(selectedArray) To maxUnitNumber
sld.Shapes(selectedArray(i)).Visible = (i <= enabledUnit)
sld.Shapes(unselectedArray(i)).Visible = Not (i <= enabledUnit)
Next i
If maxUnitNumber < UBound(selectedArray) Then
For i = maxUnitNumber + 1 To UBound(selectedArray)
sld.Shapes(selectedArray(i)).Visible = msoFalse
sld.Shapes(unselectedArray(i)).Visible = msoFalse
Next i
End If
Case (enabledUnit < 0)
For i = LBound(selectedArray) To maxUnitNumber
sld.Shapes(selectedArray(i)).Visible = msoFalse
sld.Shapes(unselectedArray(i)).Visible = msoTrue
Next i
If maxUnitNumber < UBound(selectedArray) Then
For i = maxUnitNumber + 1 To UBound(selectedArray)
sld.Shapes(selectedArray(i)).Visible = msoFalse
sld.Shapes(unselectedArray(i)).Visible = msoFalse
Next i
End If
Case Else
For i = LBound(selectedArray) To UBound(selectedArray)
sld.Shapes(selectedArray(i)).Visible = msoFalse
sld.Shapes(unselectedArray(i)).Visible = msoFalse
Next i
End Select
End Sub
Private Function SetMaxUnitNumber() As Integer
Select Case enabledBook
Case "WC-2.5", "WC-2.6", "WC-3.1", "WC-3.2", "WC-3.3", "WC-3.4", "WC-3.5"
SetMaxUnitNumber = 0
Case "Journeys-3.1", "Journeys-3.2"
SetMaxUnitNumber = 0
Case "IntoReading-4.1", "IntoReading-4.2"
SetMaxUnitNumber = 0
Case "BR-4.3", "BR-5.1", "BR-5.2", "BR-5.3"
SetMaxUnitNumber = 0
Case "SL4", "SL5", "SL6", "SL7", "SL8"
SetMaxUnitNumber = 0
Case "RD5", "RD6", "RD7", "RD8"
SetMaxUnitNumber = 0
Case "ReadUp1", "ReadUp2"
SetMaxUnitNumber = 20
Case "TARA"
SetMaxUnitNumber = 25
Case "Gravoca1A", "Gravoca1B", "Gravoca1C"
SetMaxUnitNumber = 0
Case "Gravoca2A", "Gravoca2B"
SetMaxUnitNumber = 0
Case "RS-S1B1", "RS-S1B2", "RS-S1B3", "RS-S1B4", "RS-S1B5", "RS-S1B6", "RS-S1B7"
SetMaxUnitNumber = 8
Case "RS-S2B1", "RS-S2B2", "RS-S2B3", "RS-S2B4", "RS-S2B5", "RS-S2B6", "RS-S2B7"
SetMaxUnitNumber = 8
Case Else
SetMaxUnitNumber = -1
End Select
End Function
Private Sub DisplayUpdateMessage()
Dim sld As Slide
Dim messageToDisplay As String
Set sld = ActivePresentation.Slides(configSld)
If (sld.Shapes("Versions_Game_Update").Visible = msoTrue) Or (sld.Shapes("Versions_Questions_Update").Visible = msoTrue) Then
messageToDisplay = "There is an update available!" & vbCrLf & "It is highly recommended to download the update before continuing."
DisplayMessage messageToDisplay, "OkOnly"
End If
End Sub
Private Sub CreateConfigButtonArrays()
Dim numberOfTeamsButtons As Integer, numberOfLotteryTilesButtons As Integer, numberOfGradeButtons As Integer, numberOfLevelButtons As Integer
Dim numberOfBookButtons As Integer, numberOfUnitButtons As Integer, numberOfClassDayButtons As Integer, numberOfClassTimeButtons As Integer
numberOfTeamsButtons = 3
numberOfLotteryTilesButtons = 7
numberOfGradeButtons = 5
numberOfLevelButtons = 24
numberOfBookButtons = 47
numberOfUnitButtons = 30
numberOfClassDayButtons = 9
numberOfClassTimeButtons = 11
ReDim numberOfTeams_BorderedArray(1 To numberOfTeamsButtons)
ReDim numberOfTeams_BorderlessArray(1 To numberOfTeamsButtons)
ReDim numberOfLotteryTiles_BorderedArray(1 To numberOfLotteryTilesButtons)
ReDim numberOfLotteryTiles_BorderlessArray(1 To numberOfLotteryTilesButtons)
ReDim enabledGrade_SelectedArray(1 To numberOfGradeButtons)
ReDim enabledGrade_UnselectedArray(1 To numberOfGradeButtons)
ReDim enabledLevel_SelectedArray(1 To numberOfLevelButtons)
ReDim enabledLevel_UnselectedArray(1 To numberOfLevelButtons)
ReDim enabledBook_SelectedArray(1 To numberOfLevelButtons)
ReDim enabledBook_UnselectedArray(1 To numberOfLevelButtons)
ReDim enabledUnit_SelectedArray(1 To numberOfUnitButtons)
ReDim enabledUnit_UnselectedArray(1 To numberOfUnitButtons)
ReDim classTrackerDays_SelectedArray(1 To numberOfClassDayButtons)
ReDim classTrackerDays_UnselectedArray(1 To numberOfClassDayButtons)
ReDim classTrackerTimes_SelectedArray(1 To numberOfClassTimeButtons)
ReDim classTrackerTimes_UnselectedArray(1 To numberOfClassTimeButtons)
numberOfTeams_BorderedArray = Array("NumberOfTeams_2_Border", "NumberOfTeams_3_Border", "NumberOfTeams_4_Border")
numberOfTeams_BorderlessArray = Array("NumberOfTeams_2_Borderless", "NumberOfTeams_3_Borderless", "NumberOfTeams_4_Borderless")
numberOfLotteryTiles_BorderedArray = Array("NumberOfLotteryTiles_2_Border", "NumberOfLotteryTiles_3_Border", "NumberOfLotteryTiles_4_Border", _
"NumberOfLotteryTiles_5_Border", "NumberOfLotteryTiles_6_Border", "NumberOfLotteryTiles_7_Border", _
"NumberOfLotteryTiles_8_Border")
numberOfLotteryTiles_BorderlessArray = Array("NumberOfLotteryTiles_2_Borderless", "NumberOfLotteryTiles_3_Borderless", "NumberOfLotteryTiles_4_Borderless", _
"NumberOfLotteryTiles_5_Borderless", "NumberOfLotteryTiles_6_Borderless", "NumberOfLotteryTiles_7_Borderless", _
"NumberOfLotteryTiles_8_Borderless")
enabledGrade_SelectedArray = Array("Grade_E4_Enabled", "Grade_E5_Enabled", "Grade_E6_Enabled", "Grade_M1_Enabled", "Grade_M2_Enabled")
enabledGrade_UnselectedArray = Array("Grade_E4_Disabled", "Grade_E5_Disabled", "Grade_E6_Disabled", "Grade_M1_Disabled", "Grade_M2_Disabled")
enabledLevel_SelectedArray = Array("Level_Theseus_Enabled", "Level_Perseus_Enabled", "Level_Odysseus_Enabled", "Level_Hercules_Enabled", _
"Level_Artemis_Enabled", "Level_Hermes_Enabled", "Level_Apollo_Enabled", "Level_Zeus_Enabled", _
"Level_Helios_Enabled", "Level_Poseidon_Enabled", "Level_Gaia_Enabled", "Level_Hera_Enabled", _
"Level_E5-Athena_Enabled", "Level_E6-Song's_Enabled", "Level_M1-Song's_Enabled", "Level_M2-Song's_Enabled", _
"Level_Elephantus_Enabled", "Level_Galaxia_Enabled", "Level_Solis_Enabled", "Level_M1-Major_Enabled", _
"Level_Ursa_Enabled", "Level_Leo_Enabled", "Level_Tigris_Enabled", "Level_M2-Major_Enabled")
enabledLevel_UnselectedArray = Array("Level_Theseus_Disabled", "Level_Perseus_Disabled", "Level_Odysseus_Disabled", "Level_Hercules_Disabled", _
"Level_Artemis_Disabled", "Level_Hermes_Disabled", "Level_Apollo_Disabled", "Level_Zeus_Disabled", _
"Level_Helios_Disabled", "Level_Poseidon_Disabled", "Level_Gaia_Disabled", "Level_Hera_Disabled", _
"Level_E5-Athena_Disabled", "Level_E6-Song's_Disabled", "Level_M1-Song's_Disabled", "Level_M2-Song's_Disabled", _
"Level_Elephantus_Disabled", "Level_Galaxia_Disabled", "Level_Solis_Disabled", "Level_M1-Major_Disabled", _
"Level_Ursa_Disabled", "Level_Leo_Disabled", "Level_Tigris_Disabled", "Level_M2-Major_Disabled")
enabledBook_SelectedArray = Array("Book_WC-2.5_Enabled", "Book_WC-2.6_Enabled", "Book_WC-3.1_Enabled", "Book_WC-3.2_Enabled", "Book_WC-3.3_Enabled", _
"Book_WC-3.4_Enabled", "Book_WC-3.5_Enabled", "Book_WC-2.5_Enabled", "Book_Journeys-3.1_Enabled", "Book_Journeys-3.2_Enabled", _
"Book_IntoReading-4.1_Enabled", "Book_IntoReading-4.2_Enabled", "Book_BR-4.3_Enabled", "Book_BR-5.1_Enabled", "Book_BR-5.2_Enabled", _
"Book_BR-5.3_Enabled", "Book_SL4_Enabled", "Book_SL5_Enabled", "Book_SL6_Enabled", "Book_SL7_Enabled", "Book_SL8_Enabled", _
"Book_RD5_Enabled", "Book_RD6_Enabled", "Book_RD7_Enabled", "Book_RD8_Enabled", "Book_ReadUp1_Enabled", "Book_ReadUp2_Enabled", _
"Book_TARA_Enabled", "Book_Gravoca1A_Enabled", "Book_Gravoca1B_Enabled", "Book_Gravoca1C_Enabled", "Book_Gravoca2A_Enabled", _
"Book_Gravoca2B_Enabled", "Book_RS-S1B1_Enabled", "Book_RS-S1B2_Enabled", "Book_RS-S1B3_Enabled", "Book_RS-S1B4_Enabled", _
"Book_RS-S1B5_Enabled", "Book_RS-S1B6_Enabled", "Book_RS-S1B7_Enabled", "Book_RS-S2B1_Enabled", "Book_RS-S2B2_Enabled", _
"Book_RS-S2B3_Enabled", "Book_RS-S2B4_Enabled", "Book_RS-S2B5_Enabled", "Book_RS-S2B6_Enabled", "Book_RS-S2B7_Enabled")
enabledBook_UnselectedArray = Array("Book_WC-2.5_Disabled", "Book_WC-2.6_Disabled", "Book_WC-3.1_Disabled", "Book_WC-3.2_Disabled", "Book_WC-3.3_Disabled", _
"Book_WC-3.4_Disabled", "Book_WC-3.5_Disabled", "Book_WC-2.5_Disabled", "Book_Journeys-3.1_Disabled", "Book_Journeys-3.2_Disabled", _
"Book_IntoReading-4.1_Disabled", "Book_IntoReading-4.2_Disabled", "Book_BR-4.3_Disabled", "Book_BR-5.1_Disabled", "Book_BR-5.2_Disabled", _
"Book_BR-5.3_Disabled", "Book_SL4_Disabled", "Book_SL5_Disabled", "Book_SL6_Disabled", "Book_SL7_Disabled", "Book_SL8_Disabled", _
"Book_RD5_Disabled", "Book_RD6_Disabled", "Book_RD7_Disabled", "Book_RD8_Disabled", "Book_ReadUp1_Disabled", "Book_ReadUp2_Disabled", _
"Book_TARA_Disabled", "Book_Gravoca1A_Disabled", "Book_Gravoca1B_Disabled", "Book_Gravoca1C_Disabled", "Book_Gravoca2A_Disabled", _
"Book_Gravoca2B_Disabled", "Book_RS-S1B1_Disabled", "Book_RS-S1B2_Disabled", "Book_RS-S1B3_Disabled", "Book_RS-S1B4_Disabled", _
"Book_RS-S1B5_Disabled", "Book_RS-S1B6_Disabled", "Book_RS-S1B7_Disabled", "Book_RS-S2B1_Disabled", "Book_RS-S2B2_Disabled", _
"Book_RS-S2B3_Disabled", "Book_RS-S2B4_Disabled", "Book_RS-S2B5_Disabled", "Book_RS-S2B6_Disabled", "Book_RS-S2B7_Disabled")
enabledUnit_SelectedArray = Array("Unit_1_Enabled", "Unit_2_Enabled", "Unit_3_Enabled", "Unit_4_Enabled", "Unit_5_Enabled", "Unit_6_Enabled", "Unit_7_Enabled", _
"Unit_8_Enabled", "Unit_9_Enabled", "Unit_10_Enabled", "Unit_11_Enabled", "Unit_12_Enabled", "Unit_13_Enabled", "Unit_14_Enabled", _
"Unit_15_Enabled", "Unit_16_Enabled", "Unit_17_Enabled", "Unit_18_Enabled", "Unit_19_Enabled", "Unit_20_Enabled", "Unit_21_Enabled", _
"Unit_22_Enabled", "Unit_23_Enabled", "Unit_24_Enabled", "Unit_25_Enabled", "Unit_26_Enabled", "Unit_27_Enabled", "Unit_28_Enabled", _
"Unit_29_Enabled", "Unit_99_Enabled")
enabledUnit_UnselectedArray = Array("Unit_1_Disabled", "Unit_2_Disabled", "Unit_3_Disabled", "Unit_4_Disabled", "Unit_5_Disabled", "Unit_6_Disabled", "Unit_7_Disabled", _
"Unit_8_Disabled", "Unit_9_Disabled", "Unit_10_Disabled", "Unit_11_Disabled", "Unit_12_Disabled", "Unit_13_Disabled", "Unit_14_Disabled", _
"Unit_15_Disabled", "Unit_16_Disabled", "Unit_17_Disabled", "Unit_18_Disabled", "Unit_19_Disabled", "Unit_20_Disabled", "Unit_21_Disabled", _
"Unit_22_Disabled", "Unit_23_Disabled", "Unit_24_Disabled", "Unit_25_Disabled", "Unit_26_Disabled", "Unit_27_Disabled", "Unit_28_Disabled", _
"Unit_29_Disabled", "Unit_99_Disabled")
classTrackerDays_SelectedArray = Array("ClassDay_MonWed_Enabled", "ClassDay_MonFri_Enabled", "ClassDay_WedFri_Enabled", "ClassDay_TuesThurs_Enabled", "ClassDay_Monday_Enabled", _