-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOptions.bas
96 lines (70 loc) · 2.86 KB
/
Options.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
Type=Activity
Version=2.52
@EndOfDesignText@
#Region Activity Attributes
#FullScreen: True
#IncludeTitle: False
#End Region
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim PreviousRuleSet As Int
Dim R1, R2, R3, R4, R5 As RadioButton
Dim RadioRuleOption() As RadioButton
RadioRuleOption = Array As RadioButton(R1, R2, R3, R4, R5)
Dim RT1, RT2, RT3, RT4, RT5 As String
Dim RadioRuleOptionText() As String
RadioRuleOptionText = Array As String(RT1, RT2, RT3, RT4, RT5)
Dim CheckBoxAlternateControl As CheckBox
Dim CheckBoxSoundEnabled As CheckBox
Dim ButtonExitOptions As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
For i = 1 To 4
RadioRuleOption(i).Initialize("RuleOption")
Next
RadioRuleOptionText(1) = "Business rules"
RadioRuleOptionText(2) = "Thai rules"
RadioRuleOptionText(3) = "Casual rules A"
RadioRuleOptionText(4) = "Casual rules B"
Activity.LoadLayout("Cogito_Options") 'Load the options layout.
For i = 1 To 4
RadioRuleOption(i).Text = RadioRuleOptionText(i)
Activity.AddView(RadioRuleOption(i), 10%x, (i - 1) * 15%y, 40%x, 10%y)
Next
CheckBoxAlternateControl.Initialize("")
CheckBoxAlternateControl.Checked = Main.AlternateControl
CheckBoxAlternateControl.Text = "Alternate suits"
Activity.AddView(CheckBoxAlternateControl, 50%x, 0, 50%x, 10%y)
CheckBoxSoundEnabled.Initialize("")
CheckBoxSoundEnabled.Checked = Main.SoundEnabled
CheckBoxSoundEnabled.Text = "Enable sound"
Activity.AddView(CheckBoxSoundEnabled, 50%x, 15%y, 50%x, 10%y)
ButtonExitOptions.Initialize("ButtonExitOptions")
Activity.AddView(ButtonExitOptions, 40%x, 82.5%y, 20%x, 15%y)
ButtonExitOptions.Text = "Exit Options"
PreviousRuleSet = Main.RuleSet 'Remember what the rule set was before it was changed.
RadioRuleOption(Main.RuleSet).Checked = True 'Set the correct option to be selected by default.
End Sub
Sub ButtonExitOptions_Click
For i = 1 To 4
If RadioRuleOption(i).Checked = True Then Main.RuleSet = i 'Change rule set based on which button is selected.
Next
If Main.RuleSet <> PreviousRuleSet Then
Msgbox("Changing the rules will reset the game.", "Warning!") 'Notify the player that the rules have changed and reset the game.
PreviousRuleSet = Main.RuleSet
Main.ResetFlag = True 'Signal the main module that the game should be reset.
End If
Main.AlternateControl = CheckBoxAlternateControl.Checked
Main.SoundEnabled = CheckBoxSoundEnabled.Checked
Activity.Finish 'Close the options activity.
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub