-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathForm1.vb
More file actions
5839 lines (5336 loc) · 287 KB
/
Form1.vb
File metadata and controls
5839 lines (5336 loc) · 287 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
Option Explicit On
'Option Strict On
'TODO : facile - ajouter "cleanup" des videos dans le cas ou png/jpg/flv présent si MP4 est dispo
'TODO : possibilité de créer des "packages" pour Systèmes / Roms ... (facilité de partage)
'TODO : hard/prend du temps - Youtube video downloader
'TODO : integrate HyperLaunch\Data\Game Info\ for automatic rom XML adding ... (via form?)
'TODO : full fonctionnalité de HAVE/MISSING module
'TODO : un systeme drag and drop (plus de précisions)
'TODO : handle INI files within MediaManagement
'TODO : keep interface position(s) in config.ini - and load them at start
'VERSION CHANGES:
'- v1.3.2:
' - Corrected some entries if relative paths are used
'- v1.3.1:
' - Corrected some functions for rom search
'- v1.3.0.8:
' - Corrected RomSearch function - HyperT00ls was not looking in %path%/romname/romname.romextension
' - Loading XML or Check media for a System now does both at the same time - WARNING : do not forget to save your XML before Checking for Medias
' - Added XML Header + XML version for roms XML
' - Now double-clicking on ANY cell within RomsMediaCheck launches the Rom via HL3 - previously, this was working only if text on any cell was double-clicked
' - added two new buttons in RomsMediaCheck & RomsXML to Launch associated rom entry with HL3
' - Added check for Bezels in Systems ... and now handles Horizontal/Vertical bezels for both Roms & Systems
' - Can now "fill missing entries" in a XML by looking in another XML you select
'- v1.3.0.6:
' - Maintenant, le module de recherche de roms se base sur HL3 si trouvé, sinon, se base sur la config HyperSpin (donc oui, les deux sont gérés).
' - ajout de "Crop XML" : permet de réduire un XML uniquement aux roms trouvées
' - améliorations diverses de gestion des images
' - HaveRoms de la fonction generate Have/Missing Report corrigé
' - Double click sur une ligne de rom dans "Roms & Media Check" = lancement via Hyperlaunch !!
' - diverses améliorations ...
'- v1.3.0.5:
' - correction de nom pour la copie des pointers.png sur un système
' - Possibilité de sélectionner les colonnes à afficher dans RomsMediaCheck (voir paramètres)
'- v1.3.0.4:
' - charset UTF8 pour éviter les accents bizarres lors des copier/coller de guides en .txt
' - ajout du type de media que l'on peut copier/coller dans le menu contextuel pour chaque entrée (img et/ou txt)
' - il est maintenant possible de redimensionner les colonnes dans RomsMediaCheck (en attendant l'option de les désactiver complètement)
' - ajout de diverses améliorations esthétiques sur RomsMediaCheck
'- v1.3.0.3:
' - plein de nouveaux remerciements dans le splashscreen !
' - corrections de dernière minute (rien de grave)
'- v1.3.0.2:
' - double-click sur item dans Systems/MediaMgmt lance l'app définie par défaut de cet item
' - possibilité de renommer une rom dans le XML (et de copier/déplacer les medias associés)
' - possibilité de copier/déplacer les medias associés d'une rom vers une autre (pas forcément du même système)
'- v1.3.0.1:
' - correction mineure sur le SplashScreen
' - Media management : affiche maintenant les répertoires dans "Guides" si trouvés
'- v1.3.0.0:
' - possibilité de faire drag'n drop des entrées dans le XML des roms et des Systèmes
' !! attention, lorsqu'on sauvegarde le(s) XML, il garde l'ordre dans lequel sont affichées les entrées. Si vous faites un drag'n drop, ne triez pas par colonne après :)
' - ajout d'un SplashScreen
' - ajout du refresh des systèmes
' - sécurité renforcée : plus possible de supprimer des folders depuis le right-click menu des systèmes et roms
'- v1.2.0.9:
' - Correction de bugs divers
' - Possibilité d'ajouter des guides en format texte depuis le presse-papiers si on a copié du texte en mémoire (hypert00ls détecte automatiquement le type : image ou texte)
' - Possibilité de faire du MediaManagement au niveau systèmes (ajout/suppression/visualisation de medias etc ...)
' - Ajout d'un module de génération de rapports : Have & Missing list (demande de Metheore)
'- v1.2.0.8:
' - added check for alternate video path if set in systems config
' - removed double-click feature in the MediaRoms view to add files. You must now use right-click in any entry in MediaManagement tab.
' - Media Management:
' - Added 3 ways to add media : from file, from clipboard (for images only!!), from URL
' - all medias for selected rom are scanned and displayed in the treeview
' - even the "Screenshots" folder in HyperPause/Artworks
' - added way of opening the folder containing the media selected
' - double-click on a file in the treeview opens the file with its default associated program defined in windows
' because the integrated web browser does not open FLV files, by double-clicking on video, it opens the FLV player
'
Imports System.IO
Imports System.Data
Imports System.Xml
Imports System.Collections
Imports System.Collections.ObjectModel
Imports System.Net
Imports System.Text.RegularExpressions
Imports System.Reflection
Public Class Form1
Private fromIndex As Integer
Private dragIndex As Integer
Private dragRect As Rectangle
#Region "Loading"
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
System.Windows.Forms.Application.EnableVisualStyles()
Me.Visible = False
'SplashScreen1.Show()
Application.DoEvents()
IsLoading = True
LoadConfigFile()
TextBox2.Text = gHSPath
LoadSystems()
RichTextBox1.Text = "Tips :" & vbCrLf & _
"Goto MediaManagement to add/delete/open-folders medias related to selected rom" & vbCrLf & vbCrLf & _
"On MediaManagement : Right click anywhere in the treeview to open the menu" & vbCrLf & vbCrLf & _
"Double click on a Media under MediaManagement to open the file by the default associated program in windows."
IsLoading = False
TreeView2.ExpandAll()
TreeView3.ExpandAll()
'SplashScreen1.Close()
'Application.DoEvents()
LogEntry(LogType._Info, "{0}", "All systems ready :)")
Try
MakeGridViewDoubleBuffered(DataGridView1)
MakeGridViewDoubleBuffered(DataGridView2)
MakeGridViewDoubleBuffered(DataGridView3)
MakeGridViewDoubleBuffered(DataGridView4)
MakeGridViewDoubleBuffered(DataGridView5)
Catch ex As Exception
LogEntry(LogType._Warning, "{0}", ex.Message.ToString)
End Try
Try
SplitContainer7.SplitterDistance = TreeView3.Height + 15
SplitContainer9.SplitterDistance = CheckBox8.Width + 15
Catch ex As Exception
End Try
Try
File.Delete(gDebugLogFile)
Catch ex As Exception
End Try
ToolStripLabel3.Text = ""
Me.Cursor = Cursors.Default
Me.Visible = True
Me.Focus()
End Sub
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
Try
SplitContainer7.SplitterDistance = TreeView3.Height + 15
SplitContainer9.SplitterDistance = CheckBox8.Width + 15
Catch ex As Exception
End Try
End Sub
Private Sub LoadSystems()
LogEntry(LogType._Info, "{0}", "Func LoadSystems : reloading Systems in Treeview")
gHS = Nothing
gHS = New clsHyperSpin(gHSPath)
Try
ComboBox1.Items.Clear()
Catch ex As Exception
'
End Try
Me.Text = "HyperT00ls v" & Application.ProductVersion
Button13.Text = "Crop XML roms found"
Button16.Enabled = False
Button16.Visible = False
Button15.Enabled = False
Button15.Visible = False
CheckBox4.Enabled = False
CheckBox4.Visible = False
CheckBox7.Visible = False
CheckBox7.Checked = False
CheckBox9.Visible = False
CheckBox9.Checked = True
'we check if HyperSpin.exe is older than v1.4 (which handles the enabled tag)
Try
Dim HSversion As String = GetFileVersionInfo(gHSPath & "\Hyperspin.exe").ToString
Label10.Text = "Hyperspin version " & HSversion
Dim strAryFileVersion1() As String = Split(HSversion, ".")
If strAryFileVersion1(1) > 3 Then
gHSOldVersion = False
CheckBox7.Visible = True
CheckBox7.Enabled = True
CheckBox9.Visible = True
CheckBox7.Enabled = True
Button13.Text = "Disable roms not found"
Button15.Visible = True
Button16.Visible = True
CheckBox4.Enabled = True
CheckBox4.Visible = True
End If
Catch ex As Exception
gHSOldVersion = True
LogEntry(LogType._Warning, "{0}", ex.Message.ToString)
End Try
'DataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect
TreeView1.Nodes(0).Nodes.Clear()
'Creating node for each system
For Each Node As ClsSystem In gHS.Systems
If Node.Name.ToLower <> "main menu" Then
If gDisplayAllSystems = True Then
ComboBox1.Items.Add(Node.Name)
Dim vTreeNode As New TreeNode
vTreeNode.Name = Node.Name
vTreeNode.Text = Node.Name
If Node.IsEnabled = False Then
vTreeNode.NodeFont = New Font(TreeView1.Font, FontStyle.Italic)
End If
TreeView1.Nodes(0).Nodes.Add(vTreeNode)
Else
If Node.IsEnabled = True Then
ComboBox1.Items.Add(Node.Name)
Dim vTreeNode As New TreeNode
vTreeNode.Name = Node.Name
vTreeNode.Text = Node.Name
TreeView1.Nodes(0).Nodes.Add(vTreeNode)
End If
End If
End If
Next
'Expanding Systems
TreeView1.Nodes(0).Expand()
'Expanding Support
'TreeView1.Nodes(1).Expand()
FillSystemsDatagrid(DataGridView2, gDisplayAllSystems)
DataGridView2.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells)
End Sub
#End Region
#Region "Top Menu"
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
#End Region
#Region "Systems"
Private Sub FillSystemsDatagrid(ByRef Grid As DataGridView, Optional ByVal LoadFolders As Boolean = False)
LogEntry(LogType._Info, "{0}", "Filling Systems Grid")
'First, clear the grid
Grid.Rows.Clear()
'Then, we fill with Systems entries
For Each vSys In gHS.Systems
If vSys.Name.ToLower <> "main menu" Then
Dim vRow As New DataGridViewRow
vRow.CreateCells(Grid)
vRow.Cells(0).Value = vSys.Name
vRow.Cells(1).Value = vSys.IsEnabled
If vSys.IsEnabled = True Then
vRow.Cells(0).Style.BackColor = Color.LightGreen
vRow.Cells(1).Style.BackColor = Color.LightGreen
Else
vRow.Cells(0).Style.BackColor = Color.LightGray
vRow.Cells(1).Style.BackColor = Color.LightGray
End If
With vRow.Cells(2)
If vSys.HasWheel = True Then
.Value = "YES"
.Tag = vSys.WheelPath
.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
.Style.BackColor = Color.Red
End If
End With
With vRow.Cells(3)
If vSys.HasVideo = True Then
.Value = vSys.VideoExt
.Tag = vSys.VideoPath
.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
.Style.BackColor = Color.Red
End If
End With
With vRow.Cells(4)
If vSys.HasTheme = True Then
.Value = "YES"
.Tag = vSys.ThemePath
.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
.Style.BackColor = Color.Red
End If
End With
With vRow.Cells(5)
If vSys.HasBetaBriteClassic = True Then
.Value = "YES"
.Tag = vSys.BetaBriteClassicPath
.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
.Style.BackColor = Color.Red
End If
End With
With vRow.Cells(6)
If vSys.HasBetaBritePrism = True Then
.Value = "YES"
.Tag = vSys.BetaBritePrismPath
.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
.Style.BackColor = Color.Red
End If
End With
With vRow.Cells(7)
If vSys.IsEXE = True Then
.Value = True
Else
.Value = False
End If
.Tag = ""
.Style.BackColor = Color.LightGreen
End With
Grid.Rows.Add(vRow)
End If
Next
'And we fill with Folders not in MainMenu.xml if LoadFolders = true
If LoadFolders = True Then
'
End If
End Sub
Private Sub FillRomsMediaCheckDatagrid(ByVal System As String, ByVal Grid As DataGridView)
SplitContainer2.Enabled = False
'First, clear the grid
Grid.Enabled = False
Grid.Rows.Clear()
'Done before
'gHS.Systems(System).Roms.Clear()
'gHS.Systems(System).LoadSystemRoms(gHS.Systems(System).mSearchSubfolders)
ToolStripProgressBar1.Maximum = gHS.Systems(System).Roms.Count
ToolStripProgressBar1.Value = 0
Grid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
Grid.AllowUserToResizeColumns = True
'DISPLAYING COLUMNS OR NOT
For Each col As DataGridViewColumn In Grid.Columns
Select Case col.HeaderText
Case "Rom Name"
col.Visible = True
Case "Description"
col.Visible = gColDesc
Case "Enabled"
If gHSOldVersion = False Then
col.Visible = gColEnabled
Else
col.Visible = False
End If
Case "Rom"
col.Visible = gCheckRoms
Case "Wheel"
col.Visible = gColHSWheel
Case "Video"
col.Visible = gColHSVideo
Case "Art1"
col.Visible = gColHSArt1
Case "Art2"
col.Visible = gColHSArt2
Case "Art3"
col.Visible = gColHSArt3
Case "Art4"
col.Visible = gColHSArt4
Case "Theme"
col.Visible = gColHSTheme
Case "Artwork"
col.Visible = gColHPArtwork
Case "Backgrounds"
col.Visible = gColHPBackground
Case "Bezels"
col.Visible = gColHPBezel
Case "Controller"
col.Visible = gColHPController
Case "Fade"
col.Visible = gColHPFade
Case "Fonts"
col.Visible = gColHPFonts
Case "Guides"
col.Visible = gColHPGuides
Case "Manuals"
col.Visible = gColHPManuals
Case "MenuImages"
col.Visible = gColHPMenuImages
Case "Multigame"
col.Visible = gColHPMultigame
Case "Music"
col.Visible = gColHPMusic
Case "Sounds"
col.Visible = gColHPSounds
Case "Videos"
col.Visible = gColHPVideos
Case "HLWheels"
col.Visible = gColHPWheels
Case Else
col.Visible = False
End Select
col.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
Next
'Then, we fill with Systems entries
For Each vRom In gHS.Systems(System).Roms
'Dim vRom As ClsRom = xRom
ToolStripProgressBar1.Value = ToolStripProgressBar1.Value + 1
Dim vRow As New DataGridViewRow
vRow.CreateCells(Grid)
FillRomsMediaCheckROW(Grid, vRow, vRom, False)
Grid.Rows.Add(vRow)
Next
ColorizeMediaRomsCells(Grid)
Grid.Enabled = True
SplitContainer2.Enabled = True
'SplitContainer2.Refresh()
Grid.ScrollBars = ScrollBars.None
Grid.ScrollBars = ScrollBars.Both
Grid.ClearSelection()
End Sub
Function getColumnIDbyHeader(ByVal columnHeader As String, ByVal Grid As DataGridView) As Integer
Dim columnID As Integer = -1
For Each column As DataGridViewColumn In Grid.Columns
If column.HeaderText = columnHeader Then
columnID = Grid.Columns.IndexOf(column)
Exit For
End If
Next
Return columnID
End Function
Function getColumnIDbyName(ByVal columnName As String, ByVal Grid As DataGridView) As Integer
Dim columnID As Integer = -1
For Each column As DataGridViewColumn In Grid.Columns
If column.Name = columnName Then
columnID = Grid.Columns.IndexOf(column)
Exit For
End If
Next
Return columnID
End Function
Private Sub FillRomsMediaCheckROW(ByRef Grid As DataGridView, ByRef vRow As DataGridViewRow, ByVal vRom As ClsRom, Optional ByVal Reload As Boolean = True)
'vRow.CreateCells(Grid)
'Name
vRow.Cells(0).Value = vRom.Name
'vRow.Cells(0).Style.BackColor = Color.LightGreen
'Desc
If gColDesc = True Then
With vRow.Cells(getColumnIDbyName("ColDescription", Grid))
If Len(vRom.Description) > 0 Then
'.Style.BackColor = Color.LightGreen
.Value = vRom.Description
Else
.Value = ""
'.Style.BackColor = Color.Red
End If
End With
End If
'Enabled
If gHSOldVersion = False Then
If gColEnabled = True Then
With vRow.Cells(getColumnIDbyName("ColEnabled", Grid))
If vRom.Enabled = True Then
.Value = True
'.Style.BackColor = Color.LightGreen
Else
.Value = False
'.Style.BackColor = Color.Red
End If
End With
End If
End If
'RomFound
If gCheckRoms = True Then
With vRow.Cells(getColumnIDbyName("Column10", Grid))
If vRom.RomFound = True Then
.Value = "YES"
.Tag = vRom.RomPath
'.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
'.Style.BackColor = Color.Red
End If
End With
End If
'Wheel
If gColHSWheel = True Then
With vRow.Cells(getColumnIDbyName("Column4", Grid))
If vRom.HasWheel = True Then
.Value = "YES"
.Tag = vRom.WheelPath
'.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
'.Style.BackColor = Color.Red
End If
End With
End If
'Video
If gColHSVideo = True Then
With vRow.Cells(getColumnIDbyName("Column5", Grid))
If vRom.HasVideo = True Then
.Value = vRom.VideoExt
.Tag = vRom.VideoPath
'.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
'.Style.BackColor = Color.Red
End If
End With
End If
'Theme
If gColHSTheme = True Then
With vRow.Cells(getColumnIDbyName("Column2", Grid))
If vRom.HasTheme = True Then
.Value = "YES"
.Tag = vRom.ThemePath
'.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
'.Style.BackColor = Color.Red
End If
End With
End If
'Art1
If gColHSArt1 = True Then
With vRow.Cells(getColumnIDbyName("Column6", Grid))
If vRom.HasArt1 = True Then
.Value = "YES"
.Tag = vRom.Art1Path
'.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
'.Tag = ""
'.Style.BackColor = Color.Red
End If
End With
End If
'Art2
If gColHSArt2 = True Then
With vRow.Cells(getColumnIDbyName("Column7", Grid))
If vRom.HasArt2 = True Then
.Value = "YES"
.Tag = vRom.Art2Path
'.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
'.Tag = ""
'.Style.BackColor = Color.Red
End If
End With
End If
'Art3
If gColHSArt3 = True Then
With vRow.Cells(getColumnIDbyName("Column8", Grid))
If vRom.HasArt3 = True Then
.Value = "YES"
.Tag = vRom.Art3Path
'.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
'.Tag = ""
'.Style.BackColor = Color.Red
End If
End With
End If
'Art4
If gColHSArt4 = True Then
With vRow.Cells(getColumnIDbyName("Column1", Grid))
If vRom.HasArt4 = True Then
.Value = "YES"
.Tag = vRom.Art4Path
'.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
'.Tag = ""
'.Style.BackColor = Color.Red
End If
End With
End If
'CRC (DataGridViewTextBoxColumn11)
'vRow.Cells(11).Value = vRom.CRC.ToString
'HL Artwork
If gColHPArtwork = True Then
vRow.Cells(getColumnIDbyName("ColArtwork", Grid)).Value = vRom.HasArtwork.ToString
End If
'Backgrounds
If gColHPBackground = True Then
vRow.Cells(getColumnIDbyName("ColBackgrounds", Grid)).Value = vRom.HasBackgrounds.ToString
End If
'Bezels
If gColHPBezel = True Then
vRow.Cells(getColumnIDbyName("ColBezels", Grid)).Value = vRom.HasBezels.ToString
End If
'Controller
If gColHPController = True Then
vRow.Cells(getColumnIDbyName("ColController", Grid)).Value = vRom.HasController.ToString
End If
'Fade
If gColHPFade = True Then
vRow.Cells(getColumnIDbyName("ColFade", Grid)).Value = vRom.HasFade.ToString
End If
'Fonts
If gColHPFonts = True Then
vRow.Cells(getColumnIDbyName("ColFonts", Grid)).Value = vRom.HasFonts.ToString
End If
'Guides
If gColHPGuides = True Then
vRow.Cells(getColumnIDbyName("ColGuides", Grid)).Value = vRom.HasGuides.ToString
End If
'Manuals
If gColHPManuals = True Then
vRow.Cells(getColumnIDbyName("ColManuals", Grid)).Value = vRom.HasManuals.ToString
End If
'Menu Images
If gColHPMenuImages = True Then
vRow.Cells(getColumnIDbyName("ColMenuImages", Grid)).Value = vRom.HasMenuImages.ToString
End If
'MultiGame
If gColHPMultigame = True Then
vRow.Cells(getColumnIDbyName("ColMultigame", Grid)).Value = vRom.HasMultiGame.ToString
End If
'Music
If gColHPMusic = True Then
vRow.Cells(getColumnIDbyName("ColMusic", Grid)).Value = vRom.HasMusic.ToString
End If
'Sounds
If gColHPSounds = True Then
vRow.Cells(getColumnIDbyName("ColSounds", Grid)).Value = vRom.HasSounds.ToString
End If
'Videos
If gColHPVideos = True Then
vRow.Cells(getColumnIDbyName("ColVideos", Grid)).Value = vRom.HasHLVideos.ToString
End If
'HLWheels
If gColHPWheels = True Then
vRow.Cells(getColumnIDbyName("ColHLWheels", Grid)).Value = vRom.HasHLWheels.ToString
End If
If Reload = True Then
ColorizeMediaRomsCells(Grid)
Grid.Enabled = True
'SplitContainer2.Enabled = True
'SplitContainer2.Refresh()
Grid.ScrollBars = ScrollBars.None
Grid.ScrollBars = ScrollBars.Both
Grid.ClearSelection()
vRow.Selected = True
'Grid.SelectedRows(vRow.Index).Selected = True
Grid.FirstDisplayedScrollingRowIndex = vRow.Index
End If
End Sub
Private Sub FillSystemsMediaCheckROW(ByRef Grid As DataGridView, ByRef vRow As DataGridViewRow, ByVal vSys As ClsSystem)
vRow.Cells(0).Value = vSys.Name
vRow.Cells(1).Value = vSys.IsEnabled
If vSys.IsEnabled = True Then
vRow.Cells(0).Style.BackColor = Color.LightGreen
vRow.Cells(1).Style.BackColor = Color.LightGreen
Else
vRow.Cells(0).Style.BackColor = Color.LightGray
vRow.Cells(1).Style.BackColor = Color.LightGray
End If
With vRow.Cells(2)
If vSys.HasWheel = True Then
.Value = "YES"
.Tag = vSys.WheelPath
.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
.Style.BackColor = Color.Red
End If
End With
With vRow.Cells(3)
If vSys.HasVideo = True Then
.Value = vSys.VideoExt
.Tag = vSys.VideoPath
.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
.Style.BackColor = Color.Red
End If
End With
With vRow.Cells(4)
If vSys.HasTheme = True Then
.Value = "YES"
.Tag = vSys.ThemePath
.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
.Style.BackColor = Color.Red
End If
End With
With vRow.Cells(5)
If vSys.HasBetaBriteClassic = True Then
.Value = "YES"
.Tag = vSys.BetaBriteClassicPath
.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
.Style.BackColor = Color.Red
End If
End With
With vRow.Cells(6)
If vSys.HasBetaBritePrism = True Then
.Value = "YES"
.Tag = vSys.BetaBritePrismPath
.Style.BackColor = Color.LightGreen
Else
.Value = "NO"
.Tag = ""
.Style.BackColor = Color.Red
End If
End With
With vRow.Cells(7)
If vSys.IsEXE = True Then
.Value = True
Else
.Value = False
End If
.Tag = ""
.Style.BackColor = Color.LightGreen
End With
End Sub
Private Sub FillRomsXMLDatagrid(ByVal System As String, ByRef Grid As DataGridView, ByVal CheckRoms As Boolean)
'<game image="'" index="true" name="88games">
' <description>'88 Games</description>
' <cloneof />
' <crc />
' <manufacturer>Konami</manufacturer>
' <year>1988</year>
' <genre>Sports/Track & Field</genre>
' <rating>AAMA - Green (Suitable For All Ages)</rating>
' <enabled>Yes</enabled>
'</game>
SplitContainer4.Enabled = False
'First, clear the grid
Grid.Rows.Clear()
'Done before the load
'gHS.Systems(System).Roms.Clear()
'gHS.Systems(System).LoadSystemRoms(CheckRoms)
ToolStripProgressBar2.Maximum = gHS.Systems(System).Roms.Count
ToolStripProgressBar2.Value = 0
For Each col As DataGridViewColumn In Grid.Columns
col.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
Next
'Then, we fill with Systems entries
For Each xRom In gHS.Systems(System).Roms
Dim vRom As ClsRom = xRom
ToolStripProgressBar2.Value = ToolStripProgressBar2.Value + 1
Dim vRow As New DataGridViewRow
vRow.CreateCells(Grid)
'Name
vRow.Cells(0).Value = vRom.Name.ToString
'Desc
vRow.Cells(1).Value = vRom.Description.ToString
'Manufacturer
vRow.Cells(2).Value = vRom.Manufacturer.ToString
vRow.Cells(3).Value = vRom.Year.ToString
vRow.Cells(4).Value = vRom.Genre.ToString
vRow.Cells(5).Value = vRom.Rating.ToString
vRow.Cells(6).Value = vRom.CRC.ToString
vRow.Cells(7).Value = vRom.CloneOf.ToString
vRow.Cells(8).Value = vRom.Enabled
vRow.Cells(9).Value = vRom.Image.ToString
vRow.Cells(10).Value = vRom.Index
If vRom.Enabled = False Then
For i = 1 To 10
vRow.Cells(i).Style.BackColor = Color.Gray
vRow.Cells(i).Style.ForeColor = Color.Black
Next
End If
If CheckRoms = True Then
If vRom.RomFound = True Then
vRow.Cells(0).Style.BackColor = Color.LightGreen
vRow.Cells(0).Style.ForeColor = Color.Black
vRow.Cells(8).Style.BackColor = Color.LightGreen
vRow.Cells(8).Style.ForeColor = Color.Black
Else
vRow.Cells(0).Style.BackColor = Color.Red
vRow.Cells(0).Style.ForeColor = Color.White
vRow.Cells(8).Style.BackColor = Color.Red
vRow.Cells(8).Style.ForeColor = Color.White
End If
End If
Grid.Rows.Add(vRow)
Next
If gHSOldVersion = True Then
Grid.Columns(8).Visible = False
Else
Grid.Columns(8).Visible = True
End If
Grid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
'ColorizeCells(Grid)
SplitContainer4.Enabled = True
'SplitContainer4.Refresh()
'Grid.ScrollBars = ScrollBars.None
Grid.ScrollBars = ScrollBars.Both
Grid.ClearSelection()
Grid.Refresh()
End Sub
Private Sub ColorizeMediaRomsCells(ByVal Grid As DataGridView)
If Grid.Name = "DataGridView1" Then
'Colorize cells
Dim x As Integer
For x = 0 To Grid.RowCount - 1
For Each vCell As DataGridViewCell In Grid.Rows(x).Cells
If vCell.Value Is Nothing Then
vCell.Style.BackColor = Color.DarkOrange
Else
Select Case vCell.Value.ToString.ToLower
Case "flv", "mp4", "png"
vCell.Style.BackColor = Color.LightGreen
Case "jpg/png/mp4", "png/mp4", "jpg/mp4", "png/flv", "jpg/png/flv", "jpg/flv", "jpg/png"
vCell.Style.BackColor = Color.LightGreen
Case "mp4/flv", "png/flv/mp4"
vCell.Style.BackColor = Color.Orange
Case "jpg"
vCell.Style.BackColor = Color.Red
vCell.Style.ForeColor = Color.White
vCell.Style.Font = New Font(TreeView1.Font, FontStyle.Bold)
Case "ok", "yes", "true"
vCell.Style.BackColor = Color.LightGreen
Case "no", "nok", "false"
vCell.Style.BackColor = Color.Red
Case Else
If vCell.ColumnIndex = 0 Then
'Rom Name
vCell.Style.BackColor = Color.LightGreen
ElseIf Grid.Columns(getColumnIDbyName("ColDescription", Grid)).Visible = True And vCell.ColumnIndex = 1 Then
vCell.Style.BackColor = Color.LightGreen
Else
vCell.Style.BackColor = Color.DarkOrange
End If
End Select
End If
Next
'If Grid.Rows(x).Cells(2).Value = True Then
' Grid.Rows(x).Cells(2).Style.BackColor = Color.LightGreen
'Else
' Grid.Rows(x).Cells(2).Style.BackColor = Color.Gray
'End If
''Rom
'If Grid.Rows(x).Cells(3).Value = "YES" Then
' Grid.Rows(x).Cells(3).Style.BackColor = Color.LightGreen
'Else
' Grid.Rows(x).Cells(3).Style.BackColor = Color.Red
'End If
''Wheel
'If Grid.Rows(x).Cells(4).Value = "YES" Then
' Grid.Rows(x).Cells(4).Style.BackColor = Color.LightGreen
'Else
' Grid.Rows(x).Cells(4).Style.BackColor = Color.Red
'End If
''Video
'If Grid.Rows(x).Cells(5).Value = "NO" Then
' Grid.Rows(x).Cells(5).Style.BackColor = Color.Red
'Else
' '"jpg,png,flv,mp4"
' Select Case Grid.Rows(x).Cells(5).Value
' Case "flv", "mp4", "png"
' Grid.Rows(x).Cells(5).Style.BackColor = Color.LightGreen
' Case "jpg/png/mp4", "png/mp4", "jpg/mp4", "png/flv", "jpg/png/flv", "jpg/flv", "jpg/png"
' Grid.Rows(x).Cells(5).Style.BackColor = Color.LightGreen
' Case "mp4/flv", "png/flv/mp4"
' Grid.Rows(x).Cells(5).Style.BackColor = Color.Orange
' Case "jpg"
' Grid.Rows(x).Cells(5).Style.BackColor = Color.Red
' Grid.Rows(x).Cells(5).Style.ForeColor = Color.White
' Grid.Rows(x).Cells(5).Style.Font = New Font(TreeView1.Font, FontStyle.Bold)
' Case Else
' Grid.Rows(x).Cells(5).Style.BackColor = Color.DarkOrange
' End Select
'End If
''Theme
'If Grid.Rows(x).Cells(6).Value = "YES" Then
' Grid.Rows(x).Cells(6).Style.BackColor = Color.LightGreen
'Else
' Grid.Rows(x).Cells(6).Style.BackColor = Color.Red
'End If
''Art1
'If Grid.Rows(x).Cells(7).Value = "YES" Then
' Grid.Rows(x).Cells(7).Style.BackColor = Color.LightGreen
'Else
' Grid.Rows(x).Cells(7).Style.BackColor = Color.Red
'End If
''Art2
'If Grid.Rows(x).Cells(8).Value = "YES" Then
' Grid.Rows(x).Cells(8).Style.BackColor = Color.LightGreen
'Else
' Grid.Rows(x).Cells(8).Style.BackColor = Color.Red
'End If
''Art3
'If Grid.Rows(x).Cells(9).Value = "YES" Then
' Grid.Rows(x).Cells(9).Style.BackColor = Color.LightGreen
'Else
' Grid.Rows(x).Cells(9).Style.BackColor = Color.Red
'End If
''Art4
'If Grid.Rows(x).Cells(10).Value = "YES" Then
' Grid.Rows(x).Cells(10).Style.BackColor = Color.LightGreen
'Else
' Grid.Rows(x).Cells(10).Style.BackColor = Color.Red
'End If
''CRC
'Grid.Rows(x).Cells(11).Style.BackColor = Color.LightGray
''HL Artwork
'If Grid.Rows(x).Cells(12).Value.ToString.ToLower = "false" Then
' Grid.Rows(x).Cells(12).Style.BackColor = Color.Red
'Else
' Grid.Rows(x).Cells(12).Style.BackColor = Color.LightGreen
'End If
''HL Backgrounds
'If Grid.Rows(x).Cells(13).Value.ToString.ToLower = "false" Then
' Grid.Rows(x).Cells(13).Style.BackColor = Color.Red
'Else