-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGOGRepo GUI.au3
More file actions
7219 lines (7162 loc) · 282 KB
/
GOGRepo GUI.au3
File metadata and controls
7219 lines (7162 loc) · 282 KB
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; AutoIt Version: 3.3.14.2 ;;
;; ;;
;; Template AutoIt script. ;;
;; ;;
;; AUTHOR: Timboli ;;
;; ;;
;; SCRIPT FUNCTION: A limited GUI frontend for gogrepo.py ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; FUNCTIONS
; DownloadAllGUI(), DownloadGUI(), MainGUI(), QueueGUI(), SetupGUI(), UpdateGUI(), VerifyGUI()
;
; BackupManifestEtc(), CheckForConnection(), CheckIfPythonRunning(), CheckOnGameDownload(), CheckOnShutdown()
; ClearDisableEnableRestore(), CreateListOfGames($for, $file), DisableQueueButtons(), EnableDisableControls($state)
; FillTheGamesList(), FullComparisonCheck(), GetAllowedName(), GetAuthorAndVersion(), GetTheSize(), GetWindowPosition()
; ParseTheManifest($show), RemoveListEntry($num), ReplaceForeignCharacters($text), ShowCorrectImage()
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <ListBoxConstants.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <GuiListBox.au3>
#include <GuiComboBox.au3>
#include <Misc.au3>
#include <Inet.au3>
#include <File.au3>
#include <Date.au3>
#include <Array.au3>
#include <ScreenCapture.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
_Singleton("gog-repo-gui-timboli")
Global $Button_add, $Button_dest, $Button_detail, $Button_down, $Button_exit, $Button_find, $Button_fix
Global $Button_fold, $Button_info, $Button_last, $Button_log, $Button_more, $Button_movedown, $Button_moveup
Global $Button_pic, $Button_queue, $Button_removall, $Button_remove, $Button_setup, $Button_start, $Button_stop
Global $Checkbox_all, $Checkbox_alpha, $Checkbox_check, $Checkbox_cover, $Checkbox_extra, $Checkbox_files
Global $Checkbox_game, $Checkbox_image, $Checkbox_linux, $Checkbox_log, $Checkbox_other, $Checkbox_show
Global $Checkbox_test, $Checkbox_update, $Checkbox_verify, $Checkbox_win, $Combo_dest, $Combo_OS, $Combo_shutdown
Global $Group_done, $Group_download, $Group_games, $Group_waiting, $Input_dest, $Input_destination, $Input_download
Global $Input_extra, $Input_lang, $Input_langs, $Input_name, $Input_OP, $Input_OS, $Input_title, $Label_action
Global $Label_added, $Label_cover, $Label_num, $List_done, $List_games, $List_waiting, $Pic_cover, $Progress_bar
;, $Button_move
Global $Menu_games, $Menu_linux, $Menu_list, $Menu_mac, $Menu_windows, $Item_allsort, $Item_allunsort
Global $Item_content, $Item_forum, $Item_library, $Item_linsort, $Item_linunsort, $Item_macsort, $Item_macunsort
Global $Item_store, $Item_winsort, $Item_winunsort
;
Global $Control_1, $Control_2, $Control_3, $Control_4, $Control_5
;
Global $a, $addlist, $alf, $all, $alpha, $ans, $array, $auth, $auto, $backups, $bargui, $bigpic, $blackjpg, $c
Global $changed, $check, $chunk, $chunks, $cnt, $compfold, $connection, $cookies, $cover, $date, $delay, $delete
Global $dest, $done, $down, $downall, $downlist, $DownloadAllGUI, $DownloadGUI, $downlog, $drv, $extras, $fdate
Global $file, $files, $finished, $flag, $for, $forum, $galaxy, $game, $gamefold, $gamepic, $games, $gamesfle
Global $gamesfold, $gogrepo, $GOGRepoGUI, $height, $icoD, $icoF, $icoI, $icoS, $icoT, $icoX, $image, $imgfle
Global $ind, $infofle, $inifle, $lang, $langskip, $last, $latest, $left, $line, $lines, $locations, $logfle
Global $manifest, $md5, $message, $minimize, $name, $newfile, $num, $open, $OS, $OSextras, $OSget, $osskip
Global $path, $percent, $pid, $progbar, $progress, $QueueGUI, $read, $repolog, $res, $script, $segment, $SetupGUI
Global $shared, $shell, $show, $shutdown, $SimpleGUI, $size, $sizecheck, $skiplang, $skipos, $splash, $split
Global $stagesfix, $standalone, $started, $state, $stop, $store, $style, $t, $text, $textdump, $threads, $titfile
Global $title, $titles, $titlist, $top, $tot, $total, $type, $update, $updated, $UpdateGUI, $updating, $user, $val
Global $validate, $validation, $verify, $VerifyGUI, $verifying, $vers, $version, $veryalone, $veryextra, $verygalaxy
Global $verygames, $verylog, $veryshare, $wait, $warning, $width, $window, $winpos, $xpos, $ypos, $zipcheck
$addlist = @ScriptDir & "\Added.txt"
$backups = @ScriptDir & "\Backups"
$bigpic = @ScriptDir & "\Big.jpg"
$blackjpg = @ScriptDir & "\Black.jpg"
$changed = @ScriptDir & "\Changed.txt"
$compfold = @ScriptDir & "\Comparisons"
$cookies = @ScriptDir & "\gog-cookies.dat"
$downlist = @ScriptDir & "\Downloads.ini"
$finished = @ScriptDir & "\Finished.txt"
$gamesfle = @ScriptDir & "\Games.ini"
$gogrepo = @ScriptDir & "\gogrepo.py"
$imgfle = @ScriptDir & "\Image.jpg"
$infofle = @ScriptDir & "\Game Info.html"
$inifle = @ScriptDir & "\Settings.ini"
$locations = @ScriptDir & "\Locations.ini"
$logfle = @ScriptDir & "\Record.log"
$manifest = @ScriptDir & "\gog-manifest.dat"
$progbar = @ScriptDir & "\Reporun.exe"
$repolog = @ScriptDir & "\gogrepo.log"
$splash = @ScriptDir & "\Splash.jpg"
$titlist = @ScriptDir & "\Titles.txt"
$version = "v1.0"
$SimpleGUI = @ScriptDir & "\GOGRepo Simple GUI.au3"
If FileExists($SimpleGUI) Then
$warning = 1
Else
$SimpleGUI = @ScriptDir & "\GOGRepo Simple GUI.exe"
If FileExists($SimpleGUI) Then
$warning = 1
EndIf
EndIf
If $warning = 1 Then
MsgBox(262192, "Program Warning", "This program cannot exist and run in the same folder" _
& @LF & "as my GOGRepo Simple GUI program. It will now exit.", 0)
Exit
EndIf
If FileExists($splash) Then SplashImageOn("", $splash, 350, 300, Default, Default, 1)
If Not FileExists($titlist) Then _FileCreate($titlist)
If Not FileExists($changed) Then _FileCreate($changed)
If Not FileExists($compfold) Then DirCreate($compfold)
If Not FileExists($blackjpg) Then
Local $hBitmap, $hGraphic, $hImage
_GDIPlus_Startup()
$hBitmap = _ScreenCapture_Capture("", 0, 0, 100, 100, False)
$hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
$hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)
_GDIPlus_GraphicsClear($hGraphic, 0xFF000000)
_GDIPlus_ImageSaveToFile($hImage, $blackjpg)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage)
_WinAPI_DeleteObject($hBitmap)
_GDIPlus_ShutDown()
If Not FileExists($blackjpg) Then
If FileExists($splash) Then SplashOff()
MsgBox(262192, "Program Error", "This program requires an image file named" _
& @LF & "'Black.jpg' for the default cover image file." _
& @LF & "It needs to be in the main program folder." _
& @LF & @LF & "This program will now exit.", 0)
Exit
EndIf
EndIf
$bargui = IniRead($inifle, "Floating Progress Bar GUI", "use", "")
If FileExists($progbar) Then
If $bargui = "" Then
$bargui = 4
IniWrite($inifle, "Floating Progress Bar GUI", "use", $bargui)
EndIf
Else
If $bargui = 1 Or $bargui = "" Then
$bargui = 4
IniWrite($inifle, "Floating Progress Bar GUI", "use", $bargui)
EndIf
EndIf
;~ ;SplashTextOn("Updating", @LF & "Starting!", 180, 110, Default, Default, 18, "", 12, 400)
;~ SplashTextOn("", "Updating!", 180, 110, Default, Default, 33, "", 12, 400)
;~ Sleep(1000)
;~ $loop = 1
;~ $blocks = 3
;~ $id = 44
;~ $message = "Block " & $loop & " of " & $blocks & @LF & "(" & $id & " games)"
;~ ;ControlSetText("Updating", "", "Static1", $message, 1)
;~ SplashTextOn("", $message, 180, 110, Default, Default, 35, "", 12, 400)
;~ Sleep(9000)
;~ SplashOff()
If FileExists($titlist) Then
$updated = IniRead($inifle, "Program", "updated", "")
$lines = _FileCountLines($titlist)
If $lines = 0 Or $updated <> 1 Then
If FileExists($splash) Then
ParseTheManifest(0)
Else
ParseTheManifest(1)
EndIf
$updated = 1
IniWrite($inifle, "Program", "updated", $updated)
EndIf
MainGUI()
Else
If FileExists($splash) Then SplashOff()
MsgBox(262192, "Program Error", "Titles.txt file could not be created!", 0)
EndIf
Exit
Func MainGUI()
Local $Group_added, $Group_cover, $Group_dest, $Group_down, $Group_update, $Item_delete, $Item_remove
Local $Label_extra, $Label_OS, $Label_title
;
Local $add, $content, $display, $dll, $exist, $find, $fold, $mpos, $OSes, $pth
;
$width = 590
$height = 405
$left = IniRead($inifle, "Program Window", "left", @DesktopWidth - $width - 25)
$top = IniRead($inifle, "Program Window", "top", @DesktopHeight - $height - 30)
$style = $WS_OVERLAPPED + $WS_CAPTION + $WS_SYSMENU + $WS_CLIPSIBLINGS + $WS_MINIMIZEBOX ; + $WS_VISIBLE
$GOGRepoGUI = GuiCreate("GOGRepo GUI", $width, $height, $left, $top, $style, $WS_EX_TOPMOST)
GUISetBkColor($COLOR_SKYBLUE, $GOGRepoGUI)
;GuiSetState(@SW_DISABLE, $GOGRepoGUI)
; CONTROLS
$Group_games = GuiCtrlCreateGroup("Games", 10, 10, 370, 323)
$List_games = GuiCtrlCreateList("", 20, 30, 350, 220)
GUICtrlSetBkColor($List_games, 0xBBFFBB)
GUICtrlSetTip($List_games, "List of games!")
$Input_name = GUICtrlCreateInput("", 20, 250, 305, 20)
GUICtrlSetBkColor($Input_name, 0xFFFFB0)
GUICtrlSetTip($Input_name, "Game Name!")
$Button_last = GuiCtrlCreateButton("Last", 330, 249, 40, 22)
GUICtrlSetFont($Button_last, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_last, "Find the latest added game(s)!")
$Label_title = GuiCtrlCreateLabel("Title", 20, 275, 38, 20, $SS_CENTER + $SS_CENTERIMAGE + $SS_SUNKEN + $SS_NOTIFY)
GUICtrlSetBkColor($Label_title, $COLOR_BLUE)
GUICtrlSetColor($Label_title, $COLOR_WHITE)
GUICtrlSetFont($Label_title, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Label_title, "Click to restore last search text to Title input field!")
$Input_title = GUICtrlCreateInput("", 58, 275, 250, 20) ;, $ES_READONLY
GUICtrlSetBkColor($Input_title, 0xBBFFBB)
GUICtrlSetTip($Input_title, "Game Title!")
$Button_find = GuiCtrlCreateButton("?", 311, 274, 22, 22, $BS_ICON)
;GUICtrlSetFont($Button_find, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_find, "Find the specified game title on list!")
$Button_fix = GuiCtrlCreateButton("FIX", 335, 274, 35, 22)
GUICtrlSetFont($Button_fix, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_fix, "Click to convert text in input field!")
$Label_OS = GuiCtrlCreateLabel("OS", 20, 300, 30, 20, $SS_CENTER + $SS_CENTERIMAGE + $SS_SUNKEN)
GUICtrlSetBkColor($Label_OS, $COLOR_BLACK)
GUICtrlSetColor($Label_OS, $COLOR_WHITE)
GUICtrlSetFont($Label_OS, 7, 600, 0, "Small Fonts")
$Input_OS = GUICtrlCreateInput("", 50, 300, 130, 20, $ES_READONLY)
GUICtrlSetBkColor($Input_OS, 0xBBFFBB)
GUICtrlSetTip($Input_OS, "OS files available!")
$Label_extra = GuiCtrlCreateLabel("Extras", 190, 300, 50, 20, $SS_CENTER + $SS_CENTERIMAGE + $SS_SUNKEN)
GUICtrlSetBkColor($Label_extra, $COLOR_MAROON)
GUICtrlSetColor($Label_extra, $COLOR_WHITE)
GUICtrlSetFont($Label_extra, 7, 600, 0, "Small Fonts")
$Input_extra = GUICtrlCreateInput("", 240, 300, 70, 20, $ES_READONLY)
GUICtrlSetBkColor($Input_extra, 0xBBFFBB)
GUICtrlSetTip($Input_extra, "Extra files available!")
$Button_detail = GuiCtrlCreateButton("INFO", 320, 299, 50, 22)
GUICtrlSetFont($Button_detail, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_detail, "View the information from manifest!")
;
$Group_cover = GuiCtrlCreateGroup("Cover or Status", 390, 10, 190, 160)
$Pic_cover = GUICtrlCreatePic($blackjpg, 400, 30, 170, 100, $SS_NOTIFY)
GUICtrlSetTip($Pic_cover, "Game cover image (click to enlarge)!")
$Label_action = GuiCtrlCreateLabel("", 405, 40, 160, 20, $SS_CENTER + $SS_CENTERIMAGE)
GUICtrlSetFont($Label_action, 8, 600)
GUICtrlSetBkColor($Label_action, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor($Label_action, $COLOR_WHITE)
$Label_cover = GuiCtrlCreateLabel("", 405, 70, 160, 20, $SS_CENTER + $SS_CENTERIMAGE)
GUICtrlSetBkColor($Label_cover, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor($Label_cover, $COLOR_WHITE)
$Label_num = GuiCtrlCreateLabel("", 405, 100, 160, 20, $SS_CENTER + $SS_CENTERIMAGE)
GUICtrlSetFont($Label_num, 9, 600)
GUICtrlSetBkColor($Label_num, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor($Label_num, $COLOR_WHITE)
$Button_pic = GuiCtrlCreateButton("Download Cover", 400, 135, 120, 25)
GUICtrlSetFont($Button_pic, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_pic, "Download the selected image!")
$Checkbox_show = GUICtrlCreateCheckbox("Show", 525, 138, 45, 20)
GUICtrlSetTip($Checkbox_show, "Show the cover image!")
;
$Group_down = GuiCtrlCreateGroup("", 450, 175, 70, 51)
$Button_down = GuiCtrlCreateButton("Down" & @LF & "One", 390, 180, 67, 48, $BS_MULTILINE)
GUICtrlSetFont($Button_down, 9, 600)
GUICtrlSetTip($Button_down, "Download the selected game!")
$Checkbox_update = GUICtrlCreateCheckbox("Update", 461, 186, 50, 18)
GUICtrlSetFont($Checkbox_update, 8, 400)
GUICtrlSetTip($Checkbox_update, "Enable updating one or all games!")
$Checkbox_verify = GUICtrlCreateCheckbox("Verify", 461, 204, 45, 18)
GUICtrlSetFont($Checkbox_verify, 8, 400)
GUICtrlSetTip($Checkbox_verify, "Enable verifying one or all games!")
;
$Group_all = GuiCtrlCreateGroup("Games", 530, 180, 50, 46)
GUICtrlSetFont($Group_all, 7, 400, 0, "Small Fonts")
$Checkbox_all = GUICtrlCreateCheckbox("ALL", 538, 197, 32, 20)
GUICtrlSetFont($Checkbox_all, 7, 400, 0, "Small Fonts")
GUICtrlSetTip($Checkbox_all, "Process one or ALL games!")
;
$Group_opts = GuiCtrlCreateGroup("Download Options", 390, 233, 130, 107)
$Combo_OS = GUICtrlCreateCombo("", 400, 249, 110, 21)
GUICtrlSetBkColor($Combo_OS, 0xFFD5FF)
GUICtrlSetTip($Combo_OS, "OS to download files for!")
$Checkbox_test = GUICtrlCreateCheckbox("Validate", 400, 273, 55, 20)
GUICtrlSetTip($Checkbox_test, "Verify integrity of downloaded files!")
$Checkbox_extra = GUICtrlCreateCheckbox("Extras", 466, 273, 45, 21)
GUICtrlSetFont($Checkbox_extra, 7, 400, 0, "Small Fonts")
GUICtrlSetTip($Checkbox_extra, "Download game extras files!")
$Checkbox_cover = GUICtrlCreateCheckbox("Download the cover", 400, 293, 115, 20)
GUICtrlSetFont($Checkbox_cover, 8, 400)
GUICtrlSetTip($Checkbox_cover, "Download the cover image files!")
;~ $Checkbox_game = GUICtrlCreateCheckbox("Game Files", 400, 313, 67, 20)
;~ GUICtrlSetFont($Checkbox_game, 7, 400, 0, "Small Fonts")
;~ GUICtrlSetTip($Checkbox_game, "Download the game files!")
;$Input_langs = GUICtrlCreateInput("", 475, 313, 35, 18, $ES_READONLY)
$Input_langs = GUICtrlCreateInput("", 472, 313, 38, 18, $ES_READONLY)
GUICtrlSetBkColor($Input_langs, 0xFFD5FF)
GUICtrlSetFont($Input_langs, 9, 400, 0, "MS Serif")
GUICtrlSetTip($Input_langs, "Download language(s)!")
;
$Group_added = GuiCtrlCreateGroup("Added", 530, 233, 50, 45)
GUICtrlSetFont($Group_added, 7, 400, 0, "Small Fonts")
$Label_added = GuiCtrlCreateLabel("0", 536, 246, 38, 26, $SS_CENTER + $SS_CENTERIMAGE)
GUICtrlSetFont($Label_added, 8.5, 600)
GUICtrlSetBkColor($Label_added, $COLOR_BLACK)
GUICtrlSetColor($Label_added, $COLOR_WHITE)
;
$Group_dest = GuiCtrlCreateGroup("Download Destination - Games Folder", 10, $height - 63, 370, 52)
$Combo_dest = GUICtrlCreateCombo("", 20, $height - 43, 63, 21)
GUICtrlSetBkColor($Combo_dest, 0xFFFFB0)
GUICtrlSetTip($Combo_dest, "Type of download location!")
$Input_dest = GUICtrlCreateInput("", 88, $height - 43, 179, 21)
;GUICtrlSetBkColor($Input_dest, 0xFFFFB0)
GUICtrlSetTip($Input_dest, "Destination path (main parent folder for games)!")
$Button_dest = GuiCtrlCreateButton("B", 272, $height - 43, 20, 21, $BS_ICON)
GUICtrlSetTip($Button_dest, "Browse to set the destination folder!")
$Checkbox_alpha = GUICtrlCreateCheckbox("Alpha", 297, $height - 43, 45, 21)
GUICtrlSetTip($Checkbox_alpha, "Create alphanumeric sub-folder!")
$Button_fold = GuiCtrlCreateButton("Open", 347, $height - 44, 23, 22, $BS_ICON)
GUICtrlSetTip($Button_fold, "Open the selected destination folder!")
;$Button_move = GuiCtrlCreateButton("Move", 321, $height - 44, 49, 22)
;GUICtrlSetFont($Button_move, 7, 600, 0, "Small Fonts")
;GUICtrlSetTip($Button_move, "Relocate game files!")
;
$Button_queue = GuiCtrlCreateButton("VIEW" & @LF & "QUEUE", $width - 200, $height - 55, 62, 45, $BS_MULTILINE)
GUICtrlSetFont($Button_queue, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_queue, "View the download queue!")
;
$Button_setup = GuiCtrlCreateButton("SETUP", $width - 129, $height - 55, 60, 22)
GUICtrlSetFont($Button_setup, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_setup, "Setup username and password!")
;
;~ $Button_log = GuiCtrlCreateButton("LOG", $width - 129, $height - 30, 43, 20)
;~ GUICtrlSetFont($Button_log, 7, 600, 0, "Small Fonts")
;~ GUICtrlSetTip($Button_log, "View the record log file!")
;~ $Checkbox_log = GUICtrlCreateCheckbox("", $width - 83, $height - 30, 16, 20)
;~ GUICtrlSetTip($Checkbox_log, "Enable viewing 'gogrepo.log' file!")
;
$Button_info = GuiCtrlCreateButton("Info", $width - 60, $height - 118, 50, 50, $BS_ICON)
GUICtrlSetTip($Button_info, "Program Information!")
;
$Button_exit = GuiCtrlCreateButton("EXIT", $width - 60, $height - 60, 50, 50, $BS_ICON)
GUICtrlSetTip($Button_exit, "Exit / Close / Quit the program!")
;
; CONTEXT MENU
$Menu_list = GUICtrlCreateContextMenu($List_games)
$Item_store = GUICtrlCreateMenuItem("Go to Store page", $Menu_list)
GUICtrlCreateMenuItem("", $Menu_list)
$Item_forum = GUICtrlCreateMenuItem("Go to Forum page", $Menu_list)
GUICtrlCreateMenuItem("", $Menu_list)
$Item_library = GUICtrlCreateMenuItem("Go to Library page", $Menu_list)
GUICtrlCreateMenuItem("", $Menu_list)
GUICtrlCreateMenuItem("", $Menu_list)
$Item_content = GUICtrlCreateMenuItem("Folder Content", $Menu_list)
GUICtrlCreateMenuItem("", $Menu_list)
GUICtrlCreateMenuItem("", $Menu_list)
$Item_remove = GUICtrlCreateMenuItem("Remove Selected Game", $Menu_list)
GUICtrlCreateMenuItem("", $Menu_list)
GUICtrlCreateMenuItem("", $Menu_list)
$Item_delete = GUICtrlCreateMenuItem("Delete Manifest", $Menu_list)
GUICtrlCreateMenuItem("", $Menu_list)
GUICtrlCreateMenuItem("", $Menu_list)
$Menu_games = GUICtrlCreateMenu("ALL Games", $Menu_list)
$Item_allsort = GUICtrlCreateMenuItem("Sorted List", $Menu_games)
$Item_allunsort = GUICtrlCreateMenuItem("Unsorted List", $Menu_games)
GUICtrlCreateMenuItem("", $Menu_list)
$Menu_linux = GUICtrlCreateMenu("Linux Games", $Menu_list)
$Item_linsort = GUICtrlCreateMenuItem("Sorted List", $Menu_linux)
$Item_linunsort = GUICtrlCreateMenuItem("Unsorted List", $Menu_linux)
GUICtrlCreateMenuItem("", $Menu_list)
$Menu_mac = GUICtrlCreateMenu("MAC Games", $Menu_list)
$Item_macsort = GUICtrlCreateMenuItem("Sorted List", $Menu_mac)
$Item_macunsort = GUICtrlCreateMenuItem("Unsorted List", $Menu_mac)
GUICtrlCreateMenuItem("", $Menu_list)
$Menu_windows = GUICtrlCreateMenu("Windows Games (only)", $Menu_list)
$Item_winsort = GUICtrlCreateMenuItem("Sorted List", $Menu_windows)
$Item_winunsort = GUICtrlCreateMenuItem("Unsorted List", $Menu_windows)
;
; OS SETTINGS
$user = @SystemDir & "\user32.dll"
$shell = @SystemDir & "\shell32.dll"
$icoD = -4
$icoF = -85
$icoI = -5
$icoS = -23
$icoT = -71
$icoX = -4
GUICtrlSetImage($Button_find, $shell, $icoS, 0)
GUICtrlSetImage($Button_dest, $shell, $icoF, 0)
GUICtrlSetImage($Button_fold, $shell, $icoD, 0)
GUICtrlSetImage($Button_info, $user, $icoI, 1)
GUICtrlSetImage($Button_exit, $user, $icoX, 1)
;
; SETTINGS
If Not FileExists($cookies) Then
GUICtrlSetState($Button_down, $GUI_DISABLE)
EndIf
If Not FileExists($manifest) Then
GUICtrlSetState($Button_detail, $GUI_DISABLE)
GUICtrlSetState($Button_pic, $GUI_DISABLE)
EndIf
;
$shutdown = IniRead($inifle, "Shutdown", "use", "")
If $shutdown = "" Then
$shutdown = "none"
IniWrite($inifle, "Shutdown", "use", $shutdown)
EndIf
If $shutdown <> "none" Then
WinSetTitle($GOGRepoGUI, "", "GOGRepo GUI - " & $shutdown & " is ENABLED")
EndIf
;
$display = IniRead($inifle, "Cover Image", "show", "")
If $display = "" Then
$display = 1
IniWrite($inifle, "Cover Image", "show", $display)
EndIf
GUICtrlSetState($Checkbox_show, $display)
;
$OSes = "Windows + Linux|Windows + Mac|Linux + Mac|Windows|Linux|Mac|Every OS"
$OSget = IniRead($inifle, "Download Options", "OS", "")
If $OSget = "" Then
$OSget = "Windows + Linux"
IniWrite($inifle, "Download Options", "OS", $OSget)
EndIf
GUICtrlSetData($Combo_OS, $OSes, $OSget)
;
$extras = IniRead($inifle, "Download Options", "extras", "")
If $extras = "" Then
$extras = 1
IniWrite($inifle, "Download Options", "extras", $extras)
EndIf
GUICtrlSetState($Checkbox_extra, $extras)
;
$validate = IniRead($inifle, "Download Options", "verify", "")
If $validate = "" Then
$validate = 1
IniWrite($inifle, "Download Options", "verify", $validate)
EndIf
GUICtrlSetState($Checkbox_test, $validate)
;
$cover = IniRead($inifle, "Download Options", "cover", "")
If $cover = "" Then
$cover = 1
IniWrite($inifle, "Download Options", "cover", $cover)
EndIf
GUICtrlSetState($Checkbox_cover, $cover)
;
;~ $files = IniRead($inifle, "Download Options", "files", "")
;~ If $files = "" Then
;~ $files = 1
;~ IniWrite($inifle, "Download Options", "files", $files)
;~ EndIf
;~ GUICtrlSetState($Checkbox_game, $files)
;
$dests = "Default|Specific"
GUICtrlSetData($Combo_dest, $dests, "Default")
$dest = IniRead($inifle, "Main Games Folder", "path", "")
If $dest = "" Then
$dest = @ScriptDir & "\GAMES"
IniWrite($inifle, "Main Games Folder", "path", $dest)
If Not FileExists($dest) Then DirCreate($dest)
EndIf
GUICtrlSetData($Input_dest, $dest)
$gamesfold = $dest
$alpha = IniRead($inifle, "Alphanumerical Game Folders", "use", "")
If $alpha = "" Then
$alpha = 4
IniWrite($inifle, "Alphanumerical Game Folders", "use", $alpha)
EndIf
GUICtrlSetState($Checkbox_alpha, $alpha)
;
$auto = IniRead($inifle, "Start Downloading", "auto", "")
If $auto = "" Then
$auto = 4
IniWrite($inifle, "Start Downloading", "auto", $auto)
EndIf
;
$lang = IniRead($inifle, "Download Options", "language", "")
If $lang = "" Then
$lang = "en"
$val = InputBox("Language Query", "Please enter the two character" _
& @LF & "code for your language ... plus" _
& @LF & "any other languages you wish" _
& @LF & "to download for, using a space" _
& @LF & "as divider between." & @LF _
& @LF & "i.e. de en fr", _
$lang, "", 100, 205, Default, Default, 0, $GOGRepoGUI)
If Not @error Then
$lang = $val
EndIf
IniWrite($inifle, "Download Options", "language", $lang)
EndIf
GUICtrlSetData($Input_langs, $lang)
;
If FileExists($gogrepo) Then
$auth = IniRead($inifle, "gogrepo.py", "author", "")
$vers = IniRead($inifle, "gogrepo.py", "version", "")
$fdate = IniRead($inifle, "gogrepo.py", "file_date", "")
If $fdate = "" Then
GetAuthorAndVersion()
If Not FileExists($splash) Then SplashTextOn("", "Please Wait!", 200, 120, Default, Default, 33)
$file = FileOpen($gogrepo, 0)
$read = FileRead($file)
FileClose($file)
$chunk = StringSplit($read, "HTTP_GAME_DOWNLOADER_THREADS = ", 1)
If $chunk[0] > 1 Then
$chunk = $chunk[2]
;MsgBox(262192, "Threads Check", $chunk, 0, $GOGRepoGUI)
$chunk = StringSplit($chunk, @LF, 1)
$chunk = $chunk[1]
$chunk = StringStripWS($chunk, 8)
;MsgBox(262192, "Threads Check 1", $chunk, 0, $GOGRepoGUI)
If StringIsDigit($chunk) Then
$threads = $chunk
Else
$threads = ""
EndIf
EndIf
If Not FileExists($splash) Then SplashOff()
;MsgBox(262192, "Threads Check 2", $threads, 0, $GOGRepoGUI)
;Exit
If $threads <> "" And $threads <> 1 Then
$ans = MsgBox(262177, "Threads Query", _
"By default, 'gogrepo.py' is set to use '" & $threads & "' threads." & @LF & @LF & _
"Do you want to change it to '1' thread?" & @LF & @LF & _
"NOTE - This is the number of threads it uses for" & @LF & _
"downloading, which in practice, means it will be" & @LF & _
"downloading up to '" & $threads & "' files simultaneously." & @LF & @LF & _
"ADVICE - This could potentially result in those" & @LF & _
"'" & $threads & "' downloads being incomplete, if cancelled or" & @LF & _
"an issue occurs. Whatever your choice, you can" & @LF & _
"later change it on the SETUP window.", 0, $GOGRepoGUI)
If $ans = 1 Then
$res = _ReplaceStringInFile($gogrepo, "HTTP_GAME_DOWNLOADER_THREADS = " & $threads, "HTTP_GAME_DOWNLOADER_THREADS = 1")
If $res > 0 Then
$threads = 1
EndIf
EndIf
ElseIf $threads = "" Then
$threads = "X"
EndIf
IniWrite($inifle, "Downloading", "threads", $threads)
$fdate = FileGetTime($gogrepo, 0, 1)
IniWrite($inifle, "gogrepo.py", "file_date", $fdate)
Else
If $fdate <> FileGetTime($gogrepo, 0, 1) Then
If Not FileExists($splash) Then SplashTextOn("", "Please Wait!", 200, 120, Default, Default, 33)
GetAuthorAndVersion()
; NOTE - Threads are automatically checked and updated to previous choice.
$file = FileOpen($gogrepo, 0)
$read = FileRead($file)
FileClose($file)
$chunk = StringSplit($read, "HTTP_GAME_DOWNLOADER_THREADS = ", 1)
If $chunk[0] > 1 Then
$chunk = $chunk[2]
;MsgBox(262192, "Threads Check", $chunk, 0, $GOGRepoGUI)
$chunk = StringSplit($chunk, @LF, 1)
$chunk = $chunk[1]
$chunk = StringStripWS($chunk, 8)
;MsgBox(262192, "Threads Check 1", "'" & $chunk & "'", 0, $GOGRepoGUI)
If StringIsDigit($chunk) = 0 Then
$chunk = ""
EndIf
EndIf
If Not FileExists($splash) Then SplashOff()
;MsgBox(262192, "Threads Check 2", $chunk, 0, $GOGRepoGUI)
$threads = IniRead($inifle, "Downloading", "threads", "")
If $threads <> $chunk And $chunk <> "" And $threads <> "X" Then
$res = _ReplaceStringInFile($gogrepo, "HTTP_GAME_DOWNLOADER_THREADS = " & $chunk, "HTTP_GAME_DOWNLOADER_THREADS = " & $threads)
If $res < 1 Then
$threads = $chunk
IniWrite($inifle, "Downloading", "threads", $threads)
EndIf
ElseIf $chunk = "" Then
$threads = "X"
IniWrite($inifle, "Downloading", "threads", $threads)
ElseIf $threads = "X" Then
$threads = $chunk
IniWrite($inifle, "Downloading", "threads", $threads)
EndIf
$fdate = FileGetTime($gogrepo, 0, 1)
IniWrite($inifle, "gogrepo.py", "file_date", $fdate)
Else
If $auth = "" Or $vers = "" Then GetAuthorAndVersion()
$threads = IniRead($inifle, "Downloading", "threads", "")
If $threads = "" Then
$threads = "X"
IniWrite($inifle, "Downloading", "threads", $threads)
EndIf
EndIf
EndIf
Else
GUICtrlSetState($Button_down, $GUI_DISABLE)
GUICtrlSetState($Checkbox_update, $GUI_DISABLE)
GUICtrlSetState($Checkbox_verify, $GUI_DISABLE)
GUICtrlSetState($Checkbox_all, $GUI_DISABLE)
GUICtrlSetState($Button_queue, $GUI_DISABLE)
GUICtrlSetState($Button_setup, $GUI_DISABLE)
EndIf
If $auth = "eddie3" Or $auth <> "eddie3,kalynr" Then
;eddie3-0.3a
$script = "default"
;
; Check if any existing manifest is original compatible
If FileExists($manifest) Then
$res = _FileReadToArray($manifest, $array)
If $res = 1 Then
$ind = _ArraySearch($array, "'galaxyDownloads':", 1, 0, 0, 1)
;MsgBox(262192, "Line Search", $ind, 0, $GOGRepoGUI)
;If $ind = -1 Then
If $ind <> -1 Then
$ans = MsgBox(262433, "Manifest Query", _
"The existing manifest format appears to be newer than" & @LF & _
"the current version of 'gogrepo.py', that you are using." & @LF & @LF & _
"This means there will likely be compatibility issues." & @LF & @LF & _
"OK = Backup & Continue with no manifest." & @LF & _
"CANCEL = Abort & Exit with no changes." & @LF & @LF & _
"WARNING - To continue means you will need to start" & @LF & _
"again, recreating your manifest file from scratch. The" & @LF & _
"existing manifest & related files will be copied to the" & @LF & _
"'Backups\Forked' folder.", 0, $GOGRepoGUI)
If $ans = 1 Then
Local $forked = $backups & "\Forked"
If Not FileExists($forked) Then DirCreate($forked)
$forked = $forked & "\"
$res = FileMove($manifest, $forked, 0)
If $res = 1 Then
FileMove($addlist, $forked, 0)
FileMove($gamesfle, $forked, 0)
FileMove($logfle, $forked, 0)
FileMove($titlist, $forked, 0)
FileCopy($inifle, $forked, 0)
FileMove($backups & "\*.bak", $forked, 0)
Else
MsgBox(262192, "Backup Error", "Manifest file could not be relocated!" _
& @LF & @LF & "Check for existing backups in - " _
& @LF & $forked & @LF _
& @LF & "You may need to delete, rename or relocate any" _
& @LF & "previous backups manually, before trying again." & @LF _
& @LF & "Folder will open and program will now exit.", 0, $GOGRepoGUI)
If FileExists($forked) Then ShellExecute($forked)
If FileExists($splash) Then SplashOff()
Exit
EndIf
Else
If FileExists($splash) Then SplashOff()
Exit
EndIf
EndIf
EndIf
EndIf
;
$res = _FileReadToArray($gogrepo, $array)
If $res = 1 Then
$ind = _ArraySearch($array, "TITLES_FILENAME = r'gog-titles.dat'", 0)
;MsgBox(262192, "Line Search", $ind, 0, $GOGRepoGUI)
If $ind = -1 Then
$stagesfix = 4
$exist = "MANIFEST_FILENAME = r'gog-manifest.dat'"
$chunk = "MANIFEST_FILENAME = r'gog-manifest.dat'" & @CRLF & "TITLES_FILENAME = r'gog-titles.dat'"
$res = _ReplaceStringInFile($gogrepo, $exist, $chunk)
If $res = 1 Then
$exist = " # fetch item details"
$chunk = " # save item titles" & @CRLF & " titlesdb = sorted(items, key=lambda item: item.title)" & @CRLF _
& " save_titles(titlesdb)" & @CRLF & @CRLF & " # fetch item details"
$res = _ReplaceStringInFile($gogrepo, $exist, $chunk)
If $res = 1 Then
$exist = " gamesdb = load_manifest()"
$chunk = " gamesdb = load_manifest()" & @CRLF & @CRLF & " try:" & @CRLF & " titlesdb = load_titles()" & @CRLF _
& " except:" & @CRLF & " titlesdb = None"
$res = _ReplaceStringInFile($gogrepo, $exist, $chunk, 0, 0)
If $res = 1 Then
$exist = "def save_manifest(items):" & @CRLF & " info('saving manifest...')" & @CRLF _
& " with codecs.open(MANIFEST_FILENAME, 'w', 'utf-8') as w:" & @CRLF _
& " print('# {} games'.format(len(items)), file=w)" & @CRLF _
& " pprint.pprint(items, width=123, stream=w)"
$chunk = "def save_manifest(items):" & @CRLF & " info('saving manifest...')" & @CRLF _
& " with codecs.open(MANIFEST_FILENAME, 'w', 'utf-8') as w:" & @CRLF _
& " print('# {} games'.format(len(items)), file=w)" & @CRLF _
& " pprint.pprint(items, width=123, stream=w)" & @CRLF & @CRLF & @CRLF _
& "def load_titles(filepath=TITLES_FILENAME):" & @CRLF & " info('loading local titles...')" & @CRLF _
& " try:" & @CRLF & " with codecs.open(TITLES_FILENAME, 'rU', 'utf-8') as r:" & @CRLF _
& " ad = r.read().replace('{', 'AttrDict(**{').replace('}', '})')" & @CRLF & " return eval(ad)" & @CRLF _
& " except IOError:" & @CRLF & " return []" & @CRLF & @CRLF & @CRLF _
& "def save_titles(items):" & @CRLF & " info('saving titles...')" & @CRLF _
& " with codecs.open(TITLES_FILENAME, 'w', 'utf-8') as w:" & @CRLF _
& " print('# {} games'.format(len(items)), file=w)" & @CRLF _
& " pprint.pprint(items, width=123, stream=w)" & @CRLF _
& " info('saved titles')"
$res = _ReplaceStringInFile($gogrepo, $exist, $chunk)
If $res = 1 Then
$stagesfix = 1
EndIf
EndIf
EndIf
EndIf
IniWrite($inifle, "Stages Support", "fix", $stagesfix)
Else
$stagesfix = IniRead($inifle, "Stages Support", "fix", "")
EndIf
Else
$stagesfix = 4
IniWrite($inifle, "Stages Support", "fix", $stagesfix)
EndIf
ElseIf $auth = "eddie3,kalynr" Then
;eddie3,kalynr-k0.3a
$script = "fork"
;
; Check if any existing manifest is fork compatible
If FileExists($manifest) Then
$res = _FileReadToArray($manifest, $array)
If $res = 1 Then
;$ind = _ArraySearch($array, "'galaxyDownloads':", 0)
$ind = _ArraySearch($array, "'galaxyDownloads':", 1, 0, 0, 1)
;MsgBox(262192, "Line Search", $ind, 0, $GOGRepoGUI)
If $ind = -1 Then
$ans = MsgBox(262433, "Manifest Query", _
"The existing manifest format appears to pre-date the" & @LF & _
"current version of 'gogrepo.py', that you are using." & @LF & @LF & _
"This means there will likely be compatibility issues." & @LF & @LF & _
"OK = Backup & Continue with no manifest." & @LF & _
"CANCEL = Abort & Exit with no changes." & @LF & @LF & _
"WARNING - To continue means you will need to start" & @LF & _
"again, recreating your manifest file from scratch. The" & @LF & _
"existing manifest & related files will be copied to the" & @LF & _
"'Backups\Original' folder.", 0, $GOGRepoGUI)
If $ans = 1 Then
Local $original = $backups & "\Original"
If Not FileExists($original) Then DirCreate($original)
$original = $original & "\"
$res = FileMove($manifest, $original, 0)
If $res = 1 Then
FileMove($addlist, $original, 0)
FileMove($gamesfle, $original, 0)
FileMove($logfle, $original, 0)
FileMove($titlist, $original, 0)
FileCopy($inifle, $original, 0)
FileMove($backups & "\*.bak", $original, 0)
Else
MsgBox(262192, "Backup Error", "Manifest file could not be relocated!" _
& @LF & @LF & "Check for existing backups in - " _
& @LF & $original & @LF _
& @LF & "You may need to delete, rename or relocate any" _
& @LF & "previous backups manually, before trying again." & @LF _
& @LF & "Folder will open and program will now exit.", 0, $GOGRepoGUI)
If FileExists($original) Then ShellExecute($original)
If FileExists($splash) Then SplashOff()
Exit
EndIf
Else
If FileExists($splash) Then SplashOff()
Exit
EndIf
EndIf
EndIf
EndIf
EndIf
If $script = "default" Then
$Checkbox_game = GUICtrlCreateCheckbox("Game Files", 400, 313, 67, 20)
GUICtrlSetFont($Checkbox_game, 7, 400, 0, "Small Fonts")
GUICtrlSetTip($Checkbox_game, "Download the game files!")
;
$Button_log = GuiCtrlCreateButton("LOG", $width - 129, $height - 30, 60, 20)
GUICtrlSetFont($Button_log, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_log, "View the record log file!")
;
$files = IniRead($inifle, "Download Options", "files", "")
If $files = "" Then
$files = 1
IniWrite($inifle, "Download Options", "files", $files)
EndIf
GUICtrlSetState($Checkbox_game, $files)
Else
$Button_more = GUICtrlCreateButton("MORE", 400, 313, 62, 20)
GUICtrlSetFont($Button_more, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_more, "More download options!")
;
$Button_log = GuiCtrlCreateButton("LOG", $width - 129, $height - 30, 43, 20)
GUICtrlSetFont($Button_log, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_log, "View the record log file!")
$Checkbox_log = GUICtrlCreateCheckbox("", $width - 83, $height - 30, 16, 20)
GUICtrlSetTip($Checkbox_log, "Enable viewing 'gogrepo.log' file!")
;
$downlog = IniRead($inifle, "Download", "log", "")
If $downlog = "" Then
$downlog = 1
IniWrite($inifle, "Download", "log", $downlog)
EndIf
$standalone = IniRead($inifle, "Download", "standalone", "")
If $standalone = "" Then
$standalone = 1
IniWrite($inifle, "Download", "standalone", $standalone)
EndIf
$shared = IniRead($inifle, "Download", "shared", "")
If $shared = "" Then
$shared = 1
IniWrite($inifle, "Download", "shared", $shared)
EndIf
$galaxy = IniRead($inifle, "Download", "galaxy", "")
If $galaxy = "" Then
$galaxy = 4
IniWrite($inifle, "Download", "galaxy", $galaxy)
EndIf
;
$skipos = IniRead($inifle, "Skip Files", "OS", "")
If $skipos = "" Then
$skipos = 4
IniWrite($inifle, "Skip Files", "OS", $skipos)
EndIf
$osskip = IniRead($inifle, "Skip Files", "OSes", "")
;
$skiplang = IniRead($inifle, "Skip Files", "language", "")
If $skiplang = "" Then
$skiplang = 4
IniWrite($inifle, "Skip Files", "language", $skiplang)
EndIf
$langskip = IniRead($inifle, "Skip Files", "languages", "")
;
$verylog = IniRead($inifle, "Verifying", "log", "")
If $verylog = "" Then
$verylog = 1
IniWrite($inifle, "Verifying", "log", $verylog)
EndIf
;
$veryextra = IniRead($inifle, "Verifying", "extras", "")
If $veryextra = "" Then
$veryextra = 1
IniWrite($inifle, "Verifying", "extras", $veryextra)
EndIf
;
$verygames = IniRead($inifle, "Verifying", "games", "")
If $verygames = "" Then
$verygames = 1
IniWrite($inifle, "Verifying", "games", $verygames)
EndIf
;
$veryalone = IniRead($inifle, "Verifying", "standalone", "")
If $veryalone = "" Then
$veryalone = 1
IniWrite($inifle, "Verifying", "standalone", $veryalone)
EndIf
;
$veryshare = IniRead($inifle, "Verifying", "shared", "")
If $veryshare = "" Then
$veryshare = 1
IniWrite($inifle, "Verifying", "shared", $veryshare)
EndIf
;
$verygalaxy = IniRead($inifle, "Verifying", "galaxy", "")
If $verygalaxy = "" Then
$verygalaxy = 4
IniWrite($inifle, "Verifying", "galaxy", $verygalaxy)
EndIf
EndIf
;
FillTheGamesList()
;
$sizecheck = IniRead($inifle, "Verify", "size", "")
If $sizecheck = "" Then
$sizecheck = 1
IniWrite($inifle, "Verify", "size", $sizecheck)
EndIf
;
$zipcheck = IniRead($inifle, "Verify", "zips", "")
If $zipcheck = "" Then
$zipcheck = 1
IniWrite($inifle, "Verify", "zips", $zipcheck)
EndIf
;
$md5 = IniRead($inifle, "Verify", "md5", "")
If $md5 = "" Then
$md5 = 1
IniWrite($inifle, "Verify", "md5", $md5)
EndIf
;
$delete = IniRead($inifle, "Verify Failure", "delete", "")
If $delete = "" Then
$delete = 4
IniWrite($inifle, "Verify Failure", "delete", $delete)
EndIf
;
$downall = IniRead($inifle, "Download ALL", "activated", "")
If $downall = "" Then
$downall = 4
IniWrite($inifle, "Download ALL", "activated", $downall)
EndIf
If $downall = 1 Then
GUICtrlSetState($Checkbox_all, $GUI_DISABLE)
GUICtrlSetState($Checkbox_update, $GUI_DISABLE)
GUICtrlSetState($Checkbox_verify, $GUI_DISABLE)
EndIf
;
$all = 4
$connection = ""
$done = 0
$down = ""
$find = ""
$last = ""
$percent = 0
$started = 4
;$total = 0
$update = 4
$verify = 4
$wait = 0
;
$minimize = 4
IniWrite($inifle, "Progress Bar Or Console", "minimize", $minimize)
;
$pid = ""
$tot = IniRead($downlist, "Downloads", "total", 0)
If $tot > 0 Then
$tot = IniReadSectionNames($downlist)
$tot = $tot[0] - 1
If $tot = 0 Then
IniWrite($downlist, "Downloads", "total", $tot)
EndIf
EndIf
$title = IniRead($inifle, "Current Download", "title", "")
If $title <> "" Then
$ans = MsgBox(262177 + 256, "Restore Query", _
"It appears that the last download did not complete." & @LF & @LF & _
$title & @LF & @LF & _
"Do you want to restore it to the download list?" & @LF & @LF & _
"OK = Restore & Disable any 'Auto' start." & @LF & _
"CANCEL = Ignore & Remove the record.", 0, $GOGRepoGUI)
If $ans = 1 Then
$tot = $tot + 1
IniWrite($downlist, "Downloads", "total", $tot)
IniWrite($downlist, $title, "rank", $tot)
$val = IniRead($inifle, "Current Download", "destination", "")
IniWrite($downlist, $title, "destination", $val)
If $script = "default" Then
$val = IniRead($inifle, "Current Download", "files", "")
IniWrite($downlist, $title, "files", $val)
Else
$val = IniRead($inifle, "Current Download", "OS", "")
IniWrite($downlist, $title, "OS", $val)
$val = IniRead($inifle, "Current Download", "language", "")
IniWrite($downlist, $title, "language", $val)
$val = IniRead($inifle, "Current Download", "standalone", "")
IniWrite($downlist, $title, "standalone", $val)
$val = IniRead($inifle, "Current Download", "galaxy", "")
IniWrite($downlist, $title, "galaxy", $val)
$val = IniRead($inifle, "Current Download", "shared", "")
IniWrite($downlist, $title, "shared", $val)
$val = IniRead($inifle, "Current Download", "log", "")
IniWrite($downlist, $title, "log", $val)
;
$val = IniRead($inifle, "Current Download", "skiplang", "")
IniWrite($downlist, $title, "skiplang", $val)
$val = IniRead($inifle, "Current Download", "langskip", "")
IniWrite($downlist, $title, "languages", $val)
$val = IniRead($inifle, "Current Download", "skipOS", "")
IniWrite($downlist, $title, "skipOS", $val)
$val = IniRead($inifle, "Current Download", "OSes", "")
IniWrite($downlist, $title, "OSes", $val)
EndIf
$val = IniRead($inifle, "Current Download", "extras", "")
IniWrite($downlist, $title, "extras", $val)
$val = IniRead($inifle, "Current Download", "cover", "")
IniWrite($downlist, $title, "cover", $val)
$val = IniRead($inifle, "Current Download", "image", "")
IniWrite($downlist, $title, "image", $val)
$val = IniRead($inifle, "Current Download", "verify", "")
IniWrite($downlist, $title, "verify", $val)
$val = IniRead($inifle, "Current Download", "md5", "")
IniWrite($downlist, $title, "md5", $val)
$val = IniRead($inifle, "Current Download", "size", "")
IniWrite($downlist, $title, "size", $val)
$val = IniRead($inifle, "Current Download", "zips", "")
IniWrite($downlist, $title, "zips", $val)
$val = IniRead($inifle, "Current Download", "delete", "")
IniWrite($downlist, $title, "delete", $val)
If $auto = 1 Then
$auto = 4
IniWrite($inifle, "Start Downloading", "auto", $auto)
EndIf
EndIf
IniDelete($inifle, "Current Download")
EndIf
$total = $tot
If $total > 0 Then
GUICtrlSetData($Label_added, $total)
GUICtrlSetBkColor($Label_added, $COLOR_GREEN)
EndIf
;
$window = $GOGRepoGUI
If FileExists($splash) Then SplashOff()
;GuiSetState(@SW_ENABLE, $GOGRepoGUI)
GuiSetState(@SW_SHOWNORMAL, $GOGRepoGUI)
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_exit
; Exit / Close / Quit the program
If $started = 1 Then
$ans = MsgBox(262177 + 256, "Exit Query", _
"Game downloading is still currently occurring." & @LF & @LF & _
"Do you really want to quit now?" & @LF & @LF & _