-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmEegg.frm
284 lines (259 loc) · 8.35 KB
/
frmEegg.frm
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
VERSION 5.00
Begin VB.Form frmEegg
BorderStyle = 3 'Fixed Dialog
Caption = "System"
ClientHeight = 4215
ClientLeft = 45
ClientTop = 330
ClientWidth = 3765
Icon = "frmEegg.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4215
ScaleWidth = 3765
ShowInTaskbar = 0 'False
Begin VB.CommandButton cmdDefaults
Caption = "&Defaults"
Height = 390
Left = 195
TabIndex = 6
Top = 3645
Width = 1095
End
Begin VB.CommandButton cmdCancel
Caption = "&Cancel"
Height = 390
Left = 2460
TabIndex = 8
Top = 3645
Width = 1095
End
Begin VB.CommandButton cmdOk
Caption = "&OK"
Default = -1 'True
Height = 390
Left = 1320
TabIndex = 7
Top = 3645
Width = 1095
End
Begin VB.Frame Frame1
Height = 3210
Left = 195
TabIndex = 9
Top = 165
Width = 3345
Begin VB.TextBox txtBattlefieldWidth
Height = 315
Left = 2475
TabIndex = 16
Top = 2655
Width = 600
End
Begin VB.TextBox txtIconMoveSteps
Height = 315
Left = 2475
TabIndex = 2
Top = 1110
Width = 600
End
Begin VB.TextBox txtVelocityFactor
Height = 315
Left = 2475
TabIndex = 1
Top = 720
Width = 600
End
Begin VB.TextBox txtGravity
Height = 315
Left = 2475
TabIndex = 0
Top = 330
Width = 600
End
Begin VB.TextBox txtTimer2Interval
Height = 315
Left = 2475
TabIndex = 3
Top = 1500
Width = 600
End
Begin VB.TextBox txtBottom
Height = 315
Left = 2475
TabIndex = 4
Top = 1890
Width = 600
End
Begin VB.TextBox txtGunPosition
Height = 315
Left = 2475
TabIndex = 5
Top = 2280
Width = 600
End
Begin VB.Label Label7
Caption = "Battlefield width (restart game)"
Height = 225
Left = 240
TabIndex = 17
Top = 2700
Width = 2130
End
Begin VB.Label Label6
Caption = "Icon move steps"
Height = 225
Left = 240
TabIndex = 15
Top = 1125
Width = 1365
End
Begin VB.Label Label5
Caption = "Velocity factor"
Height = 225
Left = 240
TabIndex = 14
Top = 735
Width = 1365
End
Begin VB.Label Label1
Caption = "Gravity"
Height = 225
Left = 240
TabIndex = 13
Top = 360
Width = 630
End
Begin VB.Label Label2
Caption = "Bullet events in milliseconds"
Height = 225
Left = 240
TabIndex = 12
Top = 1515
Width = 1980
End
Begin VB.Label Label3
Caption = "Bottom position"
Height = 225
Left = 240
TabIndex = 11
Top = 1920
Width = 1215
End
Begin VB.Label Label4
Caption = "Gun position (restart game)"
Height = 225
Left = 240
TabIndex = 10
Top = 2325
Width = 1950
End
End
End
Attribute VB_Name = "frmEegg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'Go away
Private Sub cmdDefaults_Click()
txtGravity.Text = 9.81
txtVelocityFactor.Text = 8
txtIconMoveSteps.Text = 30
txtTimer2Interval.Text = 50
txtBottom.Text = 0.8
txtGunPosition.Text = 0.3
txtBattlefieldWidth.Text = 0.75
End Sub
Private Sub Form_Load()
txtGravity.Text = gsngGravity
txtVelocityFactor.Text = gintVelocityFactor
txtIconMoveSteps.Text = gintIconSteps
txtTimer2Interval.Text = gintTimer2Interval
txtBottom.Text = gsngBottom
txtGunPosition.Text = gsngGunPosition
txtBattlefieldWidth.Text = gsngBattlefieldWidth
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
On Error Resume Next
Me.ValidateControls
'Type mismatch
If Err.Number = 380 Then
Exit Sub
End If
On Error GoTo 0
SaveSetting REG_APP, REG_SYSTEM, "Gravity", txtGravity.Text
gsngGravity = GetValue(txtGravity.Text)
SaveSetting REG_APP, REG_SYSTEM, "Velocity Factor", txtVelocityFactor.Text
gintVelocityFactor = CInt(txtVelocityFactor.Text)
gintMaxVelocity = gintScreenWidht / (1.7 + ((gintScreenWidht / 80) / gintVelocityFactor))
SaveSetting REG_APP, REG_SYSTEM, "Icon Steps", txtIconMoveSteps.Text
gintIconSteps = CInt(txtIconMoveSteps.Text)
SaveSetting REG_APP, REG_SYSTEM, "Timer2 Interval", txtTimer2Interval.Text
gintTimer2Interval = CInt(txtTimer2Interval.Text)
SaveSetting REG_APP, REG_SYSTEM, "Bottom", txtBottom.Text
gsngBottom = GetValue(txtBottom.Text)
SaveSetting REG_APP, REG_SYSTEM, "Gun Position", txtGunPosition.Text
gsngGunPosition = GetValue(txtGunPosition.Text)
SaveSetting REG_APP, REG_SYSTEM, "Battlefield Width", txtBattlefieldWidth.Text
gsngBattlefieldWidth = GetValue(txtBattlefieldWidth.Text)
Unload Me
End Sub
Private Sub txtBattlefieldWidth_Validate(Cancel As Boolean)
If Not IsNumeric(txtBattlefieldWidth.Text) Then
MsgBox "Value is not numeric", vbInformation
Cancel = True
Else
If CInt(txtBattlefieldWidth.Text) = 0 Then txtBattlefieldWidth.Text = 0.01
End If
End Sub
Private Sub txtBottom_Validate(Cancel As Boolean)
If Not IsNumeric(txtBottom.Text) Then
MsgBox "Value is not numeric", vbInformation
Cancel = True
End If
End Sub
Private Sub txtGravity_Validate(Cancel As Boolean)
If Not IsNumeric(txtGravity.Text) Then
MsgBox "Value is not numeric", vbInformation
Cancel = True
End If
End Sub
Private Sub txtGunPosition_Validate(Cancel As Boolean)
If Not IsNumeric(txtGunPosition.Text) Then
MsgBox "Value is not numeric", vbInformation
Cancel = True
Else
If CInt(txtGunPosition.Text) = 0 Then txtGunPosition.Text = 0.05
End If
End Sub
Private Sub txtIconMoveSteps_Validate(Cancel As Boolean)
If Not IsNumeric(txtIconMoveSteps.Text) Then
MsgBox "Value is not numeric", vbInformation
Cancel = True
Else
If CInt(txtIconMoveSteps.Text) = 0 Then txtIconMoveSteps.Text = 1
End If
End Sub
Private Sub txtTimer2Interval_Validate(Cancel As Boolean)
If Not IsNumeric(txtTimer2Interval.Text) Then
MsgBox "Value is not numeric", vbInformation
Cancel = True
Else
If CInt(txtTimer2Interval.Text) = 0 Then txtTimer2Interval.Text = 1
End If
End Sub
Private Sub txtVelocityFactor_Validate(Cancel As Boolean)
If Not IsNumeric(txtVelocityFactor.Text) Then
MsgBox "Value is not numeric", vbInformation
Cancel = True
Else
If CInt(txtVelocityFactor.Text) = 0 Then txtVelocityFactor.Text = 1
End If
End Sub