-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmDownload.xojo_window
598 lines (553 loc) · 14.2 KB
/
frmDownload.xojo_window
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
#tag Window
Begin Window frmDownload
BackColor = &cFFFFFF00
Backdrop = 0
CloseButton = False
Compatibility = ""
Composite = False
Frame = 0
FullScreen = False
FullScreenButton= True
HasBackColor = True
Height = 768
ImplicitInstance= True
LiveResize = True
MacProcID = 0
MaxHeight = 768
MaximizeButton = False
MaxWidth = 1024
MenuBar = 0
MenuBarVisible = True
MinHeight = 768
MinimizeButton = True
MinWidth = 1024
Placement = 2
Resizeable = False
Title = "Yu-Gi-Oh Duel Stadium"
Visible = True
Width = 1024
Begin ProgressBar prbDownload
AutoDeactivate = True
Enabled = True
Height = 20
HelpTag = ""
Index = -2147483648
InitialParent = ""
Left = 20
LockBottom = False
LockedInPosition= False
LockLeft = True
LockRight = False
LockTop = True
Maximum = 100
Scope = 2
TabPanelIndex = 0
Top = 374
Value = 0
Visible = True
Width = 984
End
Begin Label lblDownloading
AutoDeactivate = True
Bold = False
DataField = ""
DataSource = ""
Enabled = True
Height = 20
HelpTag = ""
Index = -2147483648
InitialParent = ""
Italic = False
Left = 29
LockBottom = False
LockedInPosition= False
LockLeft = True
LockRight = False
LockTop = True
Multiline = False
Scope = 2
Selectable = False
TabIndex = 0
TabPanelIndex = 0
Text = "Downloading"
TextAlign = 0
TextColor = &c00000000
TextFont = "Arial"
TextSize = 12.0
TextUnit = 2
Top = 342
Transparent = False
Underline = False
Visible = True
Width = 100
End
Begin HTTPSocket HTTPDownload
Address = ""
BytesAvailable = 0
BytesLeftToSend = 0
Handle = 0
httpProxyAddress= ""
httpProxyPort = 0
Index = -2147483648
InitialParent = ""
IsConnected = False
LastErrorCode = 0
LocalAddress = ""
LockedInPosition= False
Port = 0
RemoteAddress = ""
Scope = 2
TabPanelIndex = 0
yield = False
End
Begin Label lblTitle
AutoDeactivate = True
Bold = False
DataField = ""
DataSource = ""
Enabled = True
Height = 49
HelpTag = ""
Index = -2147483648
InitialParent = ""
Italic = False
Left = 338
LockBottom = False
LockedInPosition= False
LockLeft = True
LockRight = False
LockTop = True
Multiline = False
Scope = 0
Selectable = False
TabIndex = 1
TabPanelIndex = 0
Text = "Checking for updates"
TextAlign = 1
TextColor = &c00000000
TextFont = "Arial"
TextSize = 36.0
TextUnit = 0
Top = 46
Transparent = False
Underline = False
Visible = True
Width = 348
End
End
#tag EndWindow
#tag WindowCode
#tag Event
Sub Close()
//Set frmMain background audio
//frmBGSound.Hide
//frmBGSound.movBGSound.Movie = GetSound(1)
//frmBGSound.movBGSound.Play
//BGSound = New MoviePlayer
//BGSound.Movie = GetSound(1)
//BGSound.Play
//BGS = New Movie
//BGS = GetSound(1)
End Sub
#tag EndEvent
#tag Event
Sub Open()
//Dim f As New FolderItem
//Dim f1 As New FolderItem
//
////f = SavePath.Child("data.dat")
//f = GetFolderItem("data.dat")
//f1 = GetFolderItem("sound.dat")
//If f.Exists = False then
//Dim n As Integer
//n = MsgBox("data.dat' is either missing or corrupt. Would you like to download a fresh copy?", 36)
//If n = 6 Then
////user pressed Yes
////DownloadFile(strDataWebAddress, f)
////f = "data.dat"
////HTTPDownload.Yield = True
//HTTPDownload.Get(strDataWebAddress, f)
//dataDBPath = f.NativePath
//ElseIf n = 7 Then
////user pressed No
//MsgBox "Program cannot contuinue without 'data.dat' and will now quit"
//Quit
//End If
//
//Else
//dataDBPath = f.NativePath
//
//End If
//
//If f1.Exists = False then
//Dim n As Integer
//n = MsgBox("sound.dat' is either missing or corrupt. Would you like to download a fresh copy?", 36)
//If n = 6 Then
////user pressed Yes
////DownloadFile(strDataWebAddress, f)
////HTTPDownload.Yield = True
//HTTPDownload.Get(strSoundWebAddress, f)
//ElseIf n = 7 Then
////user pressed No
//MsgBox "Program cannot contuinue without 'sound.dat' and will now quit"
//Quit
//End If
//
//Else
//soundDBPath = f1.NativePath
//
//End If
//LoadDatabase
CheckDataDB
End Sub
#tag EndEvent
#tag Method, Flags = &h21
Private Sub CheckDataDB()
Dim f As FolderItem = GetFolderItem("data.dat")
If f.Exists = False or f.Length = 0 then
Dim n As Integer
n = MsgBox("data.dat' is either missing or corrupt. Would you like to download a fresh copy?", 36)
If n = 6 Then
//user pressed Yes
//HTTPDownload.Yield = True
//HTTPDownload.Get(strDataWebAddress, f)
//dataDBPath = f.NativePath
DownloadFile(strDataWebAddress, f)
ElseIf n = 7 Then
//user pressed No
MsgBox "Program cannot contuinue without 'data.dat' and will now quit"
Quit
End If
Else
dataDBPath = f.NativePath
CheckSoundDB
End If
End Sub
#tag EndMethod
#tag Method, Flags = &h21
Private Sub CheckSoundDB()
Dim f As FolderItem = GetFolderItem("sound.dat")
If f.Exists = False or f.Length = 0 then
Dim n As Integer
n = MsgBox("sound.dat' is either missing or corrupt. Would you like to download a fresh copy?", 36)
If n = 6 Then
//user pressed Yes
DownloadFile(strSoundWebAddress, f)
blnDataDB = True
ElseIf n = 7 Then
//user pressed No
MsgBox "Program cannot contuinue without 'sound.dat' and will now quit"
Quit
End If
Else
soundDBPath = f.NativePath
LoadDatabase
End If
End Sub
#tag EndMethod
#tag Method, Flags = &h21
Private Sub DownloadFile(url As String, f As FolderItem)
HTTPDownload.Get(url, f)
End Sub
#tag EndMethod
#tag Method, Flags = &h21
Private Sub LoadDatabase()
dataDb = New SQLiteDatabase
dataDb.DatabaseFile = GetFolderItem(dataDBPath, 3)
If dataDb.Connect then
dim rs as recordset
rs= DataDb.SQLSelect("select count(*) from Cards")
//MaxCard = 87
MaxCard = rs.IdxField(1).IntegerValue - 1
//f = GetFolderItem("sound.dat")
//Open Data.dat
curSummon = New MouseCursor
curSummon.Constructor(GetPicture("PNG", "Cursors", "PicRegular", 9), 10, 16)
curSet = New MouseCursor
curSet.Constructor(GetPicture("PNG", "Cursors", "PicRegular", 6), 10, 16)
curSummonClick = New MouseCursor
curSummonClick.Constructor(GetPicture("PNG", "Cursors", "PicClick", 9), 10, 16)
curSetClick = New MouseCursor
curSetClick.Constructor(GetPicture("PNG", "Cursors", "PicClick", 6), 10, 16)
curNormal = New MouseCursor
curNormal.Constructor(GetPicture("PNG", "Cursors", "PicRegular", 13), 10, 16)
curNormalClick = New MouseCursor
curNormalClick.Constructor(GetPicture("PNG", "Cursors", "PicClick", 13), 10, 16)
curActivate = New MouseCursor
curActivate.Constructor(GetPicture("PNG", "Cursors", "PicRegular", 1), 10, 16)
//curActivateClick = New MouseCursor
//curActivateClick.Constructor(GetPicture("PNG", "Cursors", "PicClick", 1), 10, 16)
frmMain.Show
//frmIntro.Show
frmDownload.Close
End If
sounddb = New SQLiteDatabase
sounddb.DatabaseFile = GetFolderItem(soundDBPath, 3)
If sounddb.Connect = False then
MsgBox "Error: Missing 'sound.dat'"
Quit
End If
End Sub
#tag EndMethod
#tag Property, Flags = &h21
Private blnDataDB As Boolean = False
#tag EndProperty
#tag Property, Flags = &h21
Private dataDBPath As String
#tag EndProperty
#tag Property, Flags = &h21
Private soundDBPath As String
#tag EndProperty
#tag EndWindowCode
#tag Events HTTPDownload
#tag Event
Sub ReceiveProgress(bytesReceived as integer, totalBytes as integer, newData as string)
prbDownload.Maximum = totalBytes
prbDownload.Value = bytesReceived
End Sub
#tag EndEvent
#tag Event
Sub DownloadComplete(url as string, httpStatus as integer, headers as internetHeaders, file as folderItem)
CheckDataDB
//If blnDataDB Then CheckSoundDB
End Sub
#tag EndEvent
#tag Event
Sub Error(code as integer)
If code <> 0 Then
MsgBox "Download Error"
Quit
End If
End Sub
#tag EndEvent
#tag EndEvents
#tag ViewBehavior
#tag ViewProperty
Name="BackColor"
Visible=true
Group="Appearance"
InitialValue="&hFFFFFF"
Type="Color"
#tag EndViewProperty
#tag ViewProperty
Name="Backdrop"
Visible=true
Group="Appearance"
Type="Picture"
EditorType="Picture"
#tag EndViewProperty
#tag ViewProperty
Name="CloseButton"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="Composite"
Visible=true
Group="Appearance"
InitialValue="False"
Type="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="Frame"
Visible=true
Group="Appearance"
InitialValue="0"
Type="Integer"
EditorType="Enum"
#tag EnumValues
"0 - Document"
"1 - Movable Modal"
"2 - Modal Dialog"
"3 - Floating Window"
"4 - Plain Box"
"5 - Shadowed Box"
"6 - Rounded Window"
"7 - Global Floating Window"
"8 - Sheet Window"
"9 - Metal Window"
"11 - Modeless Dialog"
#tag EndEnumValues
#tag EndViewProperty
#tag ViewProperty
Name="FullScreen"
Visible=true
Group="Appearance"
InitialValue="False"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="FullScreenButton"
Visible=true
Group="Appearance"
InitialValue="False"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="HasBackColor"
Visible=true
Group="Appearance"
InitialValue="False"
Type="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="Height"
Visible=true
Group="Position"
InitialValue="400"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="ImplicitInstance"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="Interfaces"
Visible=true
Group="ID"
Type="String"
EditorType="String"
#tag EndViewProperty
#tag ViewProperty
Name="LiveResize"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="MacProcID"
Visible=true
Group="Appearance"
InitialValue="0"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="MaxHeight"
Visible=true
Group="Position"
InitialValue="32000"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="MaximizeButton"
Visible=true
Group="Appearance"
InitialValue="False"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="MaxWidth"
Visible=true
Group="Position"
InitialValue="32000"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="MenuBar"
Visible=true
Group="Appearance"
Type="MenuBar"
EditorType="MenuBar"
#tag EndViewProperty
#tag ViewProperty
Name="MenuBarVisible"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="MinHeight"
Visible=true
Group="Position"
InitialValue="64"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="MinimizeButton"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="MinWidth"
Visible=true
Group="Position"
InitialValue="64"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="Name"
Visible=true
Group="ID"
Type="String"
EditorType="String"
#tag EndViewProperty
#tag ViewProperty
Name="Placement"
Visible=true
Group="Position"
InitialValue="0"
Type="Integer"
EditorType="Enum"
#tag EnumValues
"0 - Default"
"1 - Parent Window"
"2 - Main Screen"
"3 - Parent Window Screen"
"4 - Stagger"
#tag EndEnumValues
#tag EndViewProperty
#tag ViewProperty
Name="Resizeable"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="Super"
Visible=true
Group="ID"
Type="String"
EditorType="String"
#tag EndViewProperty
#tag ViewProperty
Name="Title"
Visible=true
Group="Appearance"
InitialValue="Untitled"
Type="String"
#tag EndViewProperty
#tag ViewProperty
Name="Visible"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="Width"
Visible=true
Group="Position"
InitialValue="600"
Type="Integer"
#tag EndViewProperty
#tag EndViewBehavior