forked from syntax53/Nightmare-Redux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmMME_Export.frm
5859 lines (4919 loc) · 188 KB
/
frmMME_Export.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
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
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.2#0"; "mscomctl.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "ComDlg32.OCX"
Begin VB.Form frmMME_Export
BorderStyle = 1 'Fixed Single
Caption = "Export to MMUD Explorer"
ClientHeight = 5385
ClientLeft = 45
ClientTop = 330
ClientWidth = 5490
ClipControls = 0 'False
Icon = "frmMME_Export.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 5385
ScaleWidth = 5490
Begin VB.CommandButton cmdAddtlOptions
Caption = "Additional Options"
Height = 555
Left = 4080
TabIndex = 28
Top = 1380
Width = 1335
End
Begin VB.CommandButton cmdNote
Caption = "ReadMe"
Height = 315
Left = 2280
TabIndex = 27
Top = 4260
Width = 975
End
Begin VB.TextBox txtUpdateURL
Height = 285
Left = 120
MaxLength = 254
TabIndex = 24
Text = "http://www.mudinfo.net/mmudexp.php"
Top = 1620
Width = 3795
End
Begin VB.CommandButton cmdSaveConfig
Caption = "&Save Config ..."
Height = 435
Left = 4080
TabIndex = 12
Top = 780
Width = 1335
End
Begin VB.CommandButton cmdSelectConfig
Caption = "&Load Config ..."
Height = 435
Left = 4080
TabIndex = 11
Top = 180
Width = 1335
End
Begin VB.TextBox txtConfigFile
BackColor = &H8000000F&
Height = 315
Left = 120
Locked = -1 'True
TabIndex = 10
Top = 300
Width = 3795
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 2000
Left = 2700
Top = 60
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 3240
Top = 0
_ExtentX = 847
_ExtentY = 847
_Version = 393216
CancelError = -1 'True
End
Begin VB.TextBox txtCustom
Height = 285
Left = 1860
MaxLength = 20
TabIndex = 3
Top = 960
Width = 2055
End
Begin VB.TextBox txtDBVersion
Height = 285
Left = 120
MaxLength = 20
TabIndex = 2
Top = 960
Width = 1575
End
Begin MSComctlLib.ProgressBar ProgressBar
Height = 315
Left = 60
TabIndex = 6
Top = 4740
Visible = 0 'False
Width = 5400
_ExtentX = 9525
_ExtentY = 556
_Version = 393216
Appearance = 1
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "&Close"
Height = 495
Left = 4020
TabIndex = 1
Top = 4140
Width = 1335
End
Begin VB.CommandButton cmdGo
Caption = "&Export to MME"
Height = 495
Left = 120
TabIndex = 0
Top = 4140
Width = 1395
End
Begin VB.Frame fraRooms
Caption = "Exclude Rooms"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1995
Left = 120
TabIndex = 13
Top = 2040
Width = 5235
Begin VB.CommandButton cmdHideHelp
Caption = "?"
Enabled = 0 'False
BeginProperty Font
Name = "Arial Narrow"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Left = 1200
TabIndex = 44
Top = 750
Width = 255
End
Begin VB.CheckBox chkHideExcludedRooms
Caption = "Hide Only"
Enabled = 0 'False
Height = 195
Left = 180
TabIndex = 43
Top = 780
Width = 1095
End
Begin VB.CheckBox chkExcludeRooms
Caption = "Enable"
Height = 195
Left = 180
TabIndex = 40
Top = 300
Width = 1335
End
Begin VB.CheckBox chkNoRooms
Caption = "Exclude All"
Enabled = 0 'False
Height = 195
Left = 180
TabIndex = 26
Top = 540
Width = 1095
End
Begin MSComctlLib.ListView lvExludedRooms
Height = 1635
Left = 2700
TabIndex = 23
Top = 240
Width = 2415
_ExtentX = 4260
_ExtentY = 2884
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
FullRowSelect = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
Enabled = 0 'False
NumItems = 0
End
Begin VB.TextBox txtMap
Enabled = 0 'False
Height = 285
Left = 900
TabIndex = 21
Text = "1"
Top = 1560
Width = 615
End
Begin VB.CommandButton cmdRemove
Caption = "&Remove"
Enabled = 0 'False
Height = 435
Left = 1680
TabIndex = 18
Top = 1440
Width = 855
End
Begin VB.CommandButton cmdClear
Caption = "Clear"
Enabled = 0 'False
Height = 315
Left = 1680
TabIndex = 17
Top = 960
Width = 855
End
Begin VB.CommandButton cmdAdd
Caption = "&Add -->"
Enabled = 0 'False
Height = 555
Left = 1680
TabIndex = 16
Top = 240
Width = 855
End
Begin VB.TextBox txtTo
Enabled = 0 'False
Height = 315
Left = 900
TabIndex = 15
Text = "2"
Top = 1200
Width = 615
End
Begin VB.TextBox txtFrom
Enabled = 0 'False
Height = 315
Left = 180
TabIndex = 14
Text = "1"
Top = 1200
Width = 615
End
Begin VB.Label lblExRooms
Caption = "Map:"
Enabled = 0 'False
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Index = 2
Left = 180
TabIndex = 22
Top = 1560
Width = 615
End
Begin VB.Label lblExRooms
Caption = "End"
Enabled = 0 'False
Height = 195
Index = 1
Left = 900
TabIndex = 20
Top = 1020
Width = 555
End
Begin VB.Label lblExRooms
Caption = "Start"
Enabled = 0 'False
Height = 195
Index = 0
Left = 180
TabIndex = 19
Top = 1020
Width = 735
End
End
Begin VB.Frame fraSpecial
Caption = "Special Export Options"
Height = 1995
Left = 120
TabIndex = 29
Top = 2040
Visible = 0 'False
Width = 5235
Begin VB.CommandButton cmdDefaultExcludeList
Caption = "List"
Height = 255
Left = 1680
TabIndex = 42
Top = 960
Width = 795
End
Begin VB.CheckBox chkExcludeDefault
Caption = "Exclude Default ""Not in game"" Rooms"
Height = 495
Left = 240
TabIndex = 41
Top = 660
Value = 1 'Checked
Width = 2175
End
Begin VB.CommandButton cmdQ
Caption = "Help"
Height = 375
Left = 180
TabIndex = 39
Top = 1440
Width = 1095
End
Begin VB.CheckBox chkOnly
Caption = "Shops"
Enabled = 0 'False
Height = 195
Index = 7
Left = 4020
TabIndex = 38
Top = 1260
Width = 975
End
Begin VB.CheckBox chkOnly
Caption = "Export Only ..."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 0
Left = 2700
TabIndex = 37
Top = 300
Width = 2355
End
Begin VB.CheckBox chkOnly
Caption = "Races"
Enabled = 0 'False
Height = 195
Index = 6
Left = 4020
TabIndex = 36
Top = 960
Value = 1 'Checked
Width = 975
End
Begin VB.CheckBox chkOnly
Caption = "Classes"
Enabled = 0 'False
Height = 195
Index = 5
Left = 4020
TabIndex = 35
Top = 660
Value = 1 'Checked
Width = 975
End
Begin VB.CheckBox chkOnly
Caption = "Rooms"
Enabled = 0 'False
Height = 195
Index = 4
Left = 2700
TabIndex = 34
Top = 1560
Width = 1215
End
Begin VB.CheckBox chkOnly
Caption = "Spells"
Enabled = 0 'False
Height = 195
Index = 3
Left = 2700
TabIndex = 33
Top = 1260
Width = 1215
End
Begin VB.CheckBox chkOnly
Caption = "Monsters"
Enabled = 0 'False
Height = 195
Index = 2
Left = 2700
TabIndex = 32
Top = 960
Width = 1215
End
Begin VB.CheckBox chkOnly
Caption = "Items"
Enabled = 0 'False
Height = 195
Index = 1
Left = 2700
TabIndex = 31
Top = 660
Width = 1215
End
Begin VB.CheckBox chkLegit
Caption = """Legit"" Export"
Height = 255
Left = 240
TabIndex = 30
Top = 360
Width = 1395
End
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "Database Update Webpage"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Index = 1
Left = 120
TabIndex = 25
Top = 1380
Width = 2370
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Configuration File"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Index = 1
Left = 120
TabIndex = 9
Top = 60
Width = 1500
End
Begin VB.Label lblPanel
Alignment = 2 'Center
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
ForeColor = &H80000008&
Height = 255
Index = 1
Left = 2640
TabIndex = 8
Top = 5160
Width = 2895
End
Begin VB.Label lblPanel
Alignment = 2 'Center
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
ForeColor = &H80000008&
Height = 255
Index = 0
Left = -60
TabIndex = 7
Top = 5160
Width = 2715
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "BBS/Database Name"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Index = 0
Left = 1860
TabIndex = 5
Top = 720
Width = 1815
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Dat Version"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Index = 0
Left = 120
TabIndex = 4
Top = 720
Width = 1005
End
End
Attribute VB_Name = "frmMME_Export"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Base 0
Option Explicit
Const nPasses = 10
Dim bSomethingMarkedInGame As Boolean
Dim clsMonAtkSim As New clsMonsterAttackSim
Dim DB As Database
Dim tabItems As Recordset
Dim tabClasses As Recordset
Dim tabRaces As Recordset
Dim tabSpells As Recordset
Dim tabInfo As Recordset
Dim tabMonsters As Recordset
Dim tabShops As Recordset
Dim tabRooms As Recordset
Dim tabTBInfo As Recordset
Dim nProgressInterval As Integer
Dim nProgressCount As Integer
Dim bAllInGame As Boolean
Dim bCheckSave As Boolean
Dim bUpdateExistingADB As Boolean
Dim sDataSource As String
Dim sExportPath As String
Dim sConfigFile As String
Dim bStopExport As Boolean
Dim ExcludedRooms() As Long
Dim SpellInGame() As Boolean
Dim MonsterInGame() As Boolean
Dim ItemInGame() As Boolean
Dim TBScanned() As Boolean
Dim TBRandom() As Boolean
Dim TBCommands() As Boolean
Dim MonGroup() As String
Dim SpellFromContainerRef() As Boolean
Dim TBFromBadSource() As Boolean
'note 4/1/2016... I couldn't remember what the hell "TBFromBadSource" was and why i ever programmed it.
'It looks like it only gets flagged as from bad source if it's a monster greet text or a spell textblock
'called from an item container opening. and i believe this indicates that these textblocks only execute
'other textblocks by design. mushy memory ftl.
Dim nNewMax As Integer
Dim MaxValue As Double
Dim nScaleCount As Integer
Dim nScale As Integer
Dim nDefaultExcludeMap() As Long
Dim nDefaultExcludeFrom() As Long
Dim nDefaultExcludeTo() As Long
Dim sDefaultExcludeNote() As String
Private Enum MarkType
Spell = 0
Item = 1
Monster = 2
TextBlock = 3
End Enum
Private Sub LoadConfig(ByVal sFile As String)
Dim sLine As String, x As Long, y As Long, oLI As ListItem
Dim sTemp As String, sArray() As String, fso As FileSystemObject
On Error GoTo error:
sConfigFile = sFile
If Len(sConfigFile) > 40 Then
txtConfigFile.Text = Left(sConfigFile, 5) & "..." & Right(sConfigFile, 35)
Else
txtConfigFile.Text = sConfigFile
End If
Set fso = CreateObject("Scripting.FileSystemObject")
sExportPath = ReadINI("Settings", "ExportPath", sFile)
If Not fso.FolderExists(sExportPath) Then sExportPath = App.Path
sLine = ReadINI("Settings", "CustomName", sFile)
If Not sLine = "0" Then
txtCustom.Text = sLine
Else
txtCustom.Text = "My BBS Name"
End If
sLine = ReadINI("Settings", "DB_Ver", sFile)
If Not sLine = "0" Then
txtDBVersion.Text = sLine
Else
txtDBVersion.Text = FriendlyDatVersion(eDatFileVersion)
End If
sLine = ReadINI("Settings", "UpdateURL", sFile)
If Not sLine = "0" Then txtUpdateURL.Text = sLine
chkExcludeRooms.Value = ReadINI("Settings", "EnableExcludeRooms", sFile)
chkHideExcludedRooms.Value = ReadINI("Settings", "HideExcludedRooms", sFile)
chkLegit.Value = ReadINI("Settings", "Legit", sFile)
chkExcludeDefault.Value = ReadINI("Settings", "ExcludeDefault", sFile, "1")
chkNoRooms.Value = ReadINI("Settings", "NoRooms", sFile)
lvExludedRooms.ListItems.clear
sLine = ReadINI("Settings", "ExcludedRooms", sFile)
If Len(sLine) > 5 Then '1/1/1, = 6 chars
x = 0
Do While Not InStr(x + 1, sLine, ",") = 0
y = InStr(x + 1, sLine, ",")
sTemp = Mid(sLine, x + 1, y - x - 1)
sArray() = Split(sTemp, "/", 3)
Set oLI = lvExludedRooms.ListItems.add
oLI.Text = sArray(0)
oLI.ListSubItems.add 1, , sArray(1)
oLI.ListSubItems.add 2, , sArray(2)
Set oLI = Nothing
x = y
Loop
End If
bCheckSave = False
out:
Erase sArray()
Set oLI = Nothing
Set fso = Nothing
Exit Sub
error:
Call HandleError("LoadConfig")
Resume out:
End Sub
Private Function SaveConfig(ByVal sFile As String, _
Optional ByVal bPromptFile As Boolean) As Integer
Dim sTemp As String, x As Integer
On Error GoTo error:
If bPromptFile Then
CommonDialog1.Filter = "INI Files (*.ini)|*.ini"
CommonDialog1.DialogTitle = "Select MME Configuration File ..."
CommonDialog1.FileName = sConfigFile
CommonDialog1.InitDir = sConfigFile
On Error GoTo canceled:
CommonDialog1.ShowSave
If CommonDialog1.FileName = "" Then GoTo canceled:
On Error GoTo error:
sTemp = CommonDialog1.FileName
If Right(sTemp, 4) <> ".ini" Then sTemp = sTemp & ".ini"
sFile = sTemp
End If
sConfigFile = sFile
If Len(sConfigFile) > 40 Then
txtConfigFile.Text = Left(sConfigFile, 5) & "..." & Right(sConfigFile, 35)
Else
txtConfigFile.Text = sConfigFile
End If
Call WriteINI("Settings", "CustomName", txtCustom.Text, sFile)
Call WriteINI("Settings", "Legit", chkLegit.Value, sFile)
Call WriteINI("Settings", "ExcludeDefault", chkExcludeDefault.Value, sFile)
Call WriteINI("Settings", "DB_Ver", txtDBVersion.Text, sFile)
Call WriteINI("Settings", "UpdateURL", txtUpdateURL.Text, sFile)
Call WriteINI("Settings", "EnableExcludeRooms", chkExcludeRooms.Value, sFile)
Call WriteINI("Settings", "HideExcludedRooms", chkHideExcludedRooms.Value, sFile)
Call WriteINI("Settings", "ExportPath", sExportPath, sFile)
Call WriteINI("Settings", "NoRooms", chkNoRooms.Value, sFile)
sTemp = ""
If lvExludedRooms.ListItems.Count > 0 Then
For x = 1 To lvExludedRooms.ListItems.Count
sTemp = sTemp & lvExludedRooms.ListItems(x).Text _
& "/" & lvExludedRooms.ListItems(x).ListSubItems(1).Text _
& "/" & lvExludedRooms.ListItems(x).ListSubItems(2).Text _
& ","
Next x
Call WriteINI("Settings", "ExcludedRooms", sTemp, sFile)
Else
Call WriteINI("Settings", "ExcludedRooms", "0", sFile)
End If
bCheckSave = False
GoTo out:
canceled:
SaveConfig = -1
out:
Exit Function
error:
Call HandleError("SaveConfig")
Resume out:
End Function
Private Sub chkExcludeDefault_Click()
bCheckSave = True
End Sub
Private Sub chkExcludeRooms_Click()
If chkExcludeRooms.Value = 1 Then
Call ExcludeRoomsEnable(True)
Else
Call ExcludeRoomsEnable(False)
End If
bCheckSave = True
End Sub
Private Sub ExcludeRoomsEnable(ByVal bTrue As Boolean)
Dim x As Integer
On Error GoTo error:
If bTrue = True Then
txtFrom.Enabled = True
txtTo.Enabled = True
txtMap.Enabled = True
cmdAdd.Enabled = True
cmdRemove.Enabled = True
cmdClear.Enabled = True
lvExludedRooms.Enabled = True
chkNoRooms.Enabled = True
chkHideExcludedRooms.Enabled = True
cmdHideHelp.Enabled = True
For x = 0 To 2
lblExRooms(x).Enabled = True
Next x
Else
txtFrom.Enabled = False
txtTo.Enabled = False
txtMap.Enabled = False
cmdAdd.Enabled = False
cmdRemove.Enabled = False
cmdClear.Enabled = False
lvExludedRooms.Enabled = False
chkNoRooms.Enabled = False
chkHideExcludedRooms.Enabled = False
cmdHideHelp.Enabled = False
For x = 0 To 2
lblExRooms(x).Enabled = False
Next x
End If
Exit Sub
error:
Call HandleError("ExcludeRoomsEnable")
End Sub
Private Sub chkHideExcludedRooms_Click()
bCheckSave = True
End Sub
Private Sub chkLegit_Click()
If chkLegit.Value = 1 Then
Call EnableLegit(True)
Else
Call EnableLegit(False)
End If
bCheckSave = True
End Sub
Private Sub EnableLegit(ByVal bTrue As Boolean)
On Error GoTo error:
If bTrue Then
txtCustom.Enabled = False
txtUpdateURL.Enabled = False
fraRooms.Enabled = False
chkExcludeRooms.Value = 0
Call ExcludeRoomsEnable(False)
chkExcludeRooms.Enabled = False
lvExludedRooms.Enabled = False
chkOnly(0).Value = 0
chkOnly(0).Enabled = False
Else
txtCustom.Enabled = True
txtUpdateURL.Enabled = True
fraRooms.Enabled = True
chkExcludeRooms.Enabled = True
If chkExcludeRooms.Value = 1 Then
Call ExcludeRoomsEnable(True)
Else
Call ExcludeRoomsEnable(False)
End If
lvExludedRooms.Enabled = True
chkOnly(0).Enabled = True
chkOnly(0).Value = 0
End If
Exit Sub
error:
Call HandleError("EnableLegit")
End Sub
Private Sub chkNoRooms_Click()
bCheckSave = True
End Sub
Private Sub chkOnly_Click(Index As Integer)
Dim bAction As Boolean, x As Integer
Select Case Index
Case 0:
If chkOnly(0).Value = 1 Then bAction = True
For x = 1 To 7
If Not x = 5 And Not x = 6 Then chkOnly(x).Enabled = bAction
Next x
Case 1: 'items
If chkOnly(1).Value = 0 Then chkOnly(7).Value = 0
Case 7: 'shops
If chkOnly(7).Value = 1 Then chkOnly(1).Value = 1
End Select
End Sub
Private Sub cmdDefaultExcludeList_Click()
Dim x As Integer, sMsg As String
On Error GoTo error:
sMsg = "The default rooms to exclude are..."
For x = 0 To UBound(nDefaultExcludeMap())
sMsg = sMsg & vbCrLf & sDefaultExcludeNote(x) & ": " & nDefaultExcludeMap(x) & "/" & nDefaultExcludeFrom(x)
If Not nDefaultExcludeFrom(x) = nDefaultExcludeTo(x) Then
sMsg = sMsg & "-" & nDefaultExcludeTo(x)
End If
Next x
MsgBox sMsg, vbInformation
out:
Exit Sub
error:
Call HandleError("cmdDefaultExcludeList_Click")
Resume out:
End Sub
Private Sub cmdHideHelp_Click()
MsgBox "Excluded rooms are normally completey excluded (as of v1.6.3). That means that rooms are not exported at all and everything referenced from those rooms will be considered as NOT in the game (unless they are also referenced from somewhere else). Turning the HIDE option on will still consider those rooms in the game and basically only the names of the rooms will be exported (as was the case pre v1.6.3). Users will not be able to map those rooms, effectively hiding them.", vbInformation
End Sub
Private Sub cmdNote_Click()
MsgBox "Excluded rooms will still export the room names so monsters/shops/regen info/etc " _
& "show a nice name instead of 'Room: 1/234'. If the 'No Rooms' options is enabled " _
& "then no room information will be exported at all (this option exists mainly to " _
& "save export time for personal exports).", vbInformation
End Sub
Private Sub cmdQ_Click()
MsgBox "If you export only one or more databases, no cross-referencing will be done." _
& " This is for people who want get info on records and wish to use MME's style of viewing/copying stats without taking the time to compile a full MME file." _
& vbCrLf & vbCrLf & "The 'Legit Export' option is basically just for me (syntax) when " _
& "I make the default data files to post on MME's website.", vbInformation
End Sub
Private Sub cmdSaveConfig_Click()
Call SaveConfig(sConfigFile, True)
End Sub
Private Sub AddToDefaultsArr(ByRef x As Integer, nAddMap As Long, nAddFrom As Long, nAddTo As Long, sNote As String)
ReDim Preserve nDefaultExcludeMap(x)
ReDim Preserve nDefaultExcludeFrom(x)
ReDim Preserve nDefaultExcludeTo(x)
ReDim Preserve sDefaultExcludeNote(x)
nDefaultExcludeMap(x) = nAddMap
nDefaultExcludeFrom(x) = nAddFrom
nDefaultExcludeTo(x) = nAddTo
sDefaultExcludeNote(x) = sNote
x = x + 1
End Sub
Private Sub AddDefaultExcludes()
Dim x As Integer
On Error GoTo error:
x = 0
ReDim nDefaultExcludeMap(0) As Long
ReDim nDefaultExcludeFrom(0) As Long
ReDim nDefaultExcludeTo(0) As Long
ReDim sDefaultExcludeNote(0) As String
Call AddToDefaultsArr(x, 1, 164, 164, "sysop support chamber")
Call AddToDefaultsArr(x, 1, 238, 238, "sysop cheat room")
Call AddToDefaultsArr(x, 1, 288, 288, "fake silver river room")
Call AddToDefaultsArr(x, 1, 289, 289, "halls of training, entrance")
Call AddToDefaultsArr(x, 1, 3347, 3347, "sysop support chamber")
Call AddToDefaultsArr(x, 1, 2779, 2782, "sysop support module test rooms")
Call AddToDefaultsArr(x, 1, 3343, 3346, "sysop support empty rooms")
Call AddToDefaultsArr(x, 1, 3437, 3437, "sysop support rubbish room")
Call AddToDefaultsArr(x, 2, 2963, 2963, "mod test room, mod 1")
Call AddToDefaultsArr(x, 3, 788, 788, "mod test room, mod 2")
Call AddToDefaultsArr(x, 8, 1407, 1407, "mod test room, mod 3")
Call AddToDefaultsArr(x, 6, 3275, 3275, "mod test room, mod 4")
Call AddToDefaultsArr(x, 9, 1432, 1432, "mod test room, mod 5")
Call AddToDefaultsArr(x, 12, 2258, 2258, "mod test room, mod 6")
Call AddToDefaultsArr(x, 12, 2381, 2381, "platform of stars")
Call AddToDefaultsArr(x, 16, 2673, 2673, "mod test room, mod 7")
Call AddToDefaultsArr(x, 15, 2055, 2055, "mod test room, mod 8")
Call AddToDefaultsArr(x, 17, 2839, 2839, "mod test room, mod 9")
Call AddToDefaultsArr(x, 17, 2867, 2867, "sysop training room")
out:
Exit Sub
error:
Call HandleError("AddDefaultExcludes")
Resume out:
End Sub
Private Sub cmdAddtlOptions_Click()
If fraSpecial.Visible Then
fraSpecial.Visible = False
fraRooms.Visible = True
Else
fraSpecial.Visible = True
fraRooms.Visible = False
End If
End Sub
Private Sub Form_Load()
On Error Resume Next
Dim fso As FileSystemObject, x As Integer
lvExludedRooms.ColumnHeaders.clear
lvExludedRooms.ColumnHeaders.add , , "Map", 600
lvExludedRooms.ColumnHeaders.add , , "From", 700
lvExludedRooms.ColumnHeaders.add , , "To", 700
Set fso = CreateObject("Scripting.FileSystemObject")
sConfigFile = ReadINI("Options", "MME-ConfigFile")
If Not fso.FileExists(sConfigFile) Then sConfigFile = App.Path & "\MME-Config.ini"
Me.Left = ReadINI("Windows", "MME-Left")
Me.Top = ReadINI("Windows", "MME-Top")