-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmMDI.frm
1153 lines (1047 loc) · 35.9 KB
/
frmMDI.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 = "{A10D6B26-9A8F-4A87-A2D1-1D8C9EED0967}#1.3#0"; "StatBarU.ocx"
Begin VB.MDIForm frmMDI
AutoShowChildren= 0 'False
BackColor = &H8000000C&
Caption = "TTDX Editor"
ClientHeight = 8160
ClientLeft = 165
ClientTop = 735
ClientWidth = 11400
Icon = "frmMDI.frx":0000
LinkTopic = "MDIForm1"
OLEDropMode = 1 'Manual
StartUpPosition = 3 'Windows Default
Begin StatBarLibUCtl.StatusBar stBar
Align = 2 'Align Bottom
Height = 255
Left = 0
Top = 7905
Width = 11400
Version = 258
_cx = 20108
_cy = 450
Appearance = 0
BackColor = -1
BorderStyle = 0
CustomCapsLockText= "frmMDI.frx":0442
CustomInsertKeyText= "frmMDI.frx":0462
CustomKanaLockText= "frmMDI.frx":0482
CustomNumLockText= "frmMDI.frx":04A2
CustomScrollLockText= "frmMDI.frx":04C2
DisabledEvents = 7
DontRedraw = 0 'False
Enabled = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Microsoft Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForceSizeGripperDisplay= 0 'False
HoverTime = -1
MinimumHeight = 0
MousePointer = 0
BeginProperty Panels {CCA75315-B100-4B5F-80F6-8DFE616F8FDB}
Version = 257
NumPanels = 4
BeginProperty Panel1 {CB0F173F-9E1F-4365-BF3C-6CC52F8C268B}
Version = 258
Alignment = 0
BorderStyle = 0
Content = 0
Enabled = -1 'True
ForeColor = -1
MinimumWidth = 100
PanelData = 0
ParseTabs = -1 'True
PreferredWidth = 100
RightToLeftText = 0 'False
Text = "frmMDI.frx":04E2
Object.ToolTipText = "frmMDI.frx":0502
EndProperty
BeginProperty Panel2 {CB0F173F-9E1F-4365-BF3C-6CC52F8C268B}
Version = 258
Alignment = 1
BorderStyle = 0
Content = 0
Enabled = -1 'True
ForeColor = -1
MinimumWidth = 120
PanelData = 0
ParseTabs = -1 'True
PreferredWidth = 120
RightToLeftText = 0 'False
Text = "frmMDI.frx":0522
Object.ToolTipText = "frmMDI.frx":0542
EndProperty
BeginProperty Panel3 {CB0F173F-9E1F-4365-BF3C-6CC52F8C268B}
Version = 258
Alignment = 1
BorderStyle = 0
Content = 0
Enabled = -1 'True
ForeColor = -1
MinimumWidth = 150
PanelData = 0
ParseTabs = -1 'True
PreferredWidth = 150
RightToLeftText = 0 'False
Text = "frmMDI.frx":0562
Object.ToolTipText = "frmMDI.frx":0582
EndProperty
BeginProperty Panel4 {CB0F173F-9E1F-4365-BF3C-6CC52F8C268B}
Version = 258
Alignment = 1
BorderStyle = 0
Content = 0
Enabled = -1 'True
ForeColor = -1
MinimumWidth = 120
PanelData = 0
ParseTabs = -1 'True
PreferredWidth = 120
RightToLeftText = 0 'False
Text = "frmMDI.frx":05A2
Object.ToolTipText = "frmMDI.frx":05C2
EndProperty
EndProperty
PanelToAutoSize = 0
RegisterForOLEDragDrop= 0 'False
RightToLeftLayout= 0 'False
ShowToolTips = -1 'True
SimpleMode = 0 'False
SupportOLEDragImages= -1 'True
UseSystemFont = 0 'False
BeginProperty SimplePanel {CB0F173F-9E1F-4365-BF3C-6CC52F8C268B}
Version = 258
BorderStyle = 1
PanelData = 0
ParseTabs = -1 'True
RightToLeftText = 0 'False
Text = "frmMDI.frx":05E2
Object.ToolTipText = "frmMDI.frx":0602
EndProperty
End
Begin VB.PictureBox picTools
Align = 1 'Align Top
BorderStyle = 0 'None
Height = 615
Left = 0
ScaleHeight = 615
ScaleWidth = 11400
TabIndex = 0
Top = 0
Width = 11400
Begin VB.CommandButton cmdFinances
Height = 540
Left = 720
Picture = "frmMDI.frx":0622
Style = 1 'Graphical
TabIndex = 6
Top = 0
Width = 540
End
Begin VB.CommandButton cmdVeh
Height = 540
Left = 3120
Picture = "frmMDI.frx":0A64
Style = 1 'Graphical
TabIndex = 5
Top = 0
Width = 540
End
Begin VB.CommandButton cmdStations
Height = 540
Left = 2520
Picture = "frmMDI.frx":1266
Style = 1 'Graphical
TabIndex = 4
Top = 0
Width = 540
End
Begin VB.CommandButton cmdPlayer
Height = 540
Left = 120
Picture = "frmMDI.frx":1D70
Style = 1 'Graphical
TabIndex = 3
Top = 0
Width = 540
End
Begin VB.CommandButton cmdIndu
Height = 540
Left = 1920
Picture = "frmMDI.frx":287A
Style = 1 'Graphical
TabIndex = 2
Top = 0
Width = 540
End
Begin VB.CommandButton cmdCity
Height = 540
Left = 1320
Picture = "frmMDI.frx":3384
Style = 1 'Graphical
TabIndex = 1
Top = 0
Width = 555
End
End
Begin VB.Menu mnFile
Caption = "&File"
Begin VB.Menu mnFLoad
Caption = "&Load Game..."
Shortcut = ^L
End
Begin VB.Menu mnFsave
Caption = "&Save Game"
Shortcut = ^S
End
Begin VB.Menu mnFsaveAs
Caption = "Save Game &As..."
Enabled = 0 'False
Visible = 0 'False
End
Begin VB.Menu mnSep1
Caption = "-"
Index = 0
End
Begin VB.Menu mnFsaveU
Caption = "Save &Uncompressed"
End
Begin VB.Menu mnSep1a
Caption = "-"
End
Begin VB.Menu mnQuit
Caption = "E&xit"
End
Begin VB.Menu mnCleanQuit
Caption = "&Cleanout and Exit"
End
End
Begin VB.Menu mnView
Caption = "&Options"
Begin VB.Menu mnVtool
Caption = "&Toolbar"
Checked = -1 'True
Shortcut = ^T
End
Begin VB.Menu mnVTech
Caption = "Technical &Info"
Shortcut = ^I
End
Begin VB.Menu mnVmap
Caption = "&Map"
Begin VB.Menu mnVMnone
Caption = "&None"
Shortcut = ^{F1}
End
Begin VB.Menu mnVMsmall
Caption = "&Small"
Shortcut = ^{F2}
End
Begin VB.Menu mnVMlarge
Caption = "&Large"
Shortcut = ^{F3}
End
Begin VB.Menu mnVMextr
Caption = "&Extreme"
Shortcut = ^{F4}
End
End
Begin VB.Menu mnuOCurrency
Caption = "&Currency"
Begin VB.Menu mnuOCCur
Caption = "£ - &Pounds"
Index = 0
End
Begin VB.Menu mnuOCCur
Caption = "$ - &Dollars"
Index = 1
End
Begin VB.Menu mnuOCCur
Caption = "¥ - &Yen"
Index = 2
End
Begin VB.Menu mnuOCCur
Caption = "Fr - &Francs"
Index = 3
End
Begin VB.Menu mnuOCCur
Caption = "DM - D&eutschmark"
Index = 4
End
Begin VB.Menu mnuOCCur
Caption = "Pt - Pe&setas"
Index = 5
End
Begin VB.Menu mnuOCCur
Caption = " - E&uro"
Index = 6
End
Begin VB.Menu mnuOCCur
Caption = "Ft - &Hungarian Forint"
Index = 7
End
Begin VB.Menu mnuOCCur
Caption = "zl - Polish &Zloty"
Index = 8
End
Begin VB.Menu mnuOCCur
Caption = "ATS - Aus&trian Shilling"
Index = 9
End
Begin VB.Menu mnuOCCur
Caption = "BEF - Bel&gian Franc"
Index = 10
End
Begin VB.Menu mnuOCCur
Caption = "DKK - Da&nish Krone"
Index = 11
End
Begin VB.Menu mnuOCCur
Caption = "FIM - Finnish Mar&kka"
Index = 12
End
Begin VB.Menu mnuOCCur
Caption = "GRD - &Greek Drachma"
Index = 13
End
Begin VB.Menu mnuOCCur
Caption = "CHF - S&wiss Franc"
Index = 14
End
Begin VB.Menu mnuOCCur
Caption = "NLG - Dutch Guilde&r"
Index = 15
End
Begin VB.Menu mnuOCCur
Caption = "ITL - Itali&an Lira"
Index = 16
End
Begin VB.Menu mnuOCCur
Caption = "SEK - Swed&ish Krona"
Index = 17
End
Begin VB.Menu mnuOCCur
Caption = "RUB - &Russian Rubel"
Index = 18
End
End
Begin VB.Menu mnSep2
Caption = "-"
End
Begin VB.Menu mnOpFileAss
Caption = "File &Associations..."
End
Begin VB.Menu mnOsgm
Caption = "&SGM Plugin..."
End
Begin VB.Menu mnuOSep3
Caption = "-"
End
Begin VB.Menu mnuOCheckUpdates
Caption = "Check for &Updates..."
End
End
Begin VB.Menu mnPlayer
Caption = "&Players"
Begin VB.Menu mnPedit
Caption = "&Edit"
Shortcut = {F3}
End
Begin VB.Menu mnuPFinances
Caption = "&Finances"
End
Begin VB.Menu mnSep6
Caption = "-"
Visible = 0 'False
End
End
Begin VB.Menu mnTerrain
Caption = "&Terrain"
Begin VB.Menu mnTEremwood
Caption = "Remove &Trees"
End
Begin VB.Menu mnTownAIr
Caption = "Own AI &Roads"
End
Begin VB.Menu mnTownCbridge
Caption = "Own City &Bridges"
End
End
Begin VB.Menu mnCity
Caption = "&Cities"
Begin VB.Menu mnCedit
Caption = "&Edit"
Shortcut = {F5}
End
Begin VB.Menu mnSep10
Caption = "-"
Index = 0
End
Begin VB.Menu mnCmaxrat
Caption = "Maximize &Ratings"
Visible = 0 'False
Begin VB.Menu mnCmaxrate
Caption = "0"
Index = 0
End
End
End
Begin VB.Menu mnIndu
Caption = "&Industries"
Begin VB.Menu mnIedit
Caption = "&Edit"
Shortcut = {F6}
End
Begin VB.Menu mnSep11
Caption = "-"
Index = 0
End
Begin VB.Menu mnImaxPro
Caption = "M&aximize Production"
Begin VB.Menu mnMaxProAll
Caption = "&All"
End
Begin VB.Menu mnSep4
Caption = "-"
End
Begin VB.Menu mnMaxPro
Caption = "0"
Index = 0
End
End
Begin VB.Menu mnIminPro
Caption = "M&inimize Production"
Begin VB.Menu mnMinProAll
Caption = "&All"
End
Begin VB.Menu mnSep5
Caption = "-"
End
Begin VB.Menu mnMinPro
Caption = "0"
Index = 0
End
End
End
Begin VB.Menu mnStations
Caption = "&Stations"
Begin VB.Menu mnSedit
Caption = "&Edit"
Shortcut = {F7}
End
Begin VB.Menu mnSep12
Caption = "-"
End
Begin VB.Menu mnSownUn
Caption = "Own &Unowned"
Visible = 0 'False
End
End
Begin VB.Menu mnVehicles
Caption = "&Vehicles"
Begin VB.Menu mnVedit
Caption = "&Edit"
Shortcut = {F8}
End
End
Begin VB.Menu mnuWindows
Caption = "&Windows"
WindowList = -1 'True
End
Begin VB.Menu mnHelp
Caption = "&Help"
Begin VB.Menu mnHAbout
Caption = "&About TTDX Editor..."
Shortcut = ^A
End
End
End
Attribute VB_Name = "frmMDI"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Compare Text
Private F As New FileSystemObject, CleanUp As Boolean
Implements ISubclassedWindow
Public Sub CaptionW(Optional ByRef NewCaption As String)
' update to new caption if a non vbNullString was passed
If StrPtr(NewCaption) Then
Me.Tag = NewCaption
End If
' must have active form
If Not Me.ActiveForm Is Nothing Then
' see if window state is maximized
If Me.ActiveForm.WindowState = vbMaximized Then
' show both child caption and MDI caption
UniCaption(Me) = UniCaption(Me.ActiveForm) & " - " & Me.Tag
Else
' show only MDI caption
UniCaption(Me) = Me.Tag
End If
Else
' show only MDI caption
UniCaption(Me) = Me.Tag
End If
End Sub
Private Sub Subclass()
If Not SubclassWindow(Me.hWnd, Me, EnumSubclassID.escidMain) Then
Debug.Print "Subclassing failed!"
End If
' tell the control to negotiate the correct format with the form
SendMessageAsLong stBar.hWnd, WM_NOTIFYFORMAT, Me.hWnd, NF_REQUERY
End Sub
Sub CheckCurrencyItem(Item As Integer)
On Error GoTo Error
Dim MID As Long, TLMID As Long, SMID As Long
MID = GetMenu(hWnd)
TLMID = GetSubMenu(MID, 1)
SMID = GetSubMenu(TLMID, 3)
CheckMenuRadioItem SMID, 0, 18, Item, MF_BYPOSITION
Exit Sub
Error:
Select Case ErrorProc(Err, "Function: CheckCurrencyItem(" & Item & ")")
Case 3:
End
Case 2:
Resume Next
Case 1:
Resume
End Select
End Sub
Private Sub cmdCity_Click()
frmCity.Show
frmCity.SetFocus
End Sub
Private Sub cmdFinances_Click()
frmFinances.Show
frmFinances.SetFocus
End Sub
Private Sub cmdIndu_Click()
frmIndu.Show
frmIndu.SetFocus
End Sub
Private Sub cmdPlayer_Click()
frmPlayer.Show
frmPlayer.SetFocus
End Sub
Private Sub cmdStations_Click()
frmStation.Show
frmStation.SetFocus
End Sub
Private Sub cmdVeh_Click()
frmVehicle.Show
frmVehicle.SetFocus
End Sub
Private Function HandleMessage_Form(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long, bCallDefProc As Boolean) As Long
Dim lRet As Long
On Error GoTo StdHandler_End
If uMsg = WM_NOTIFYFORMAT Then
' give the control a chance to request Unicode notifications
lRet = SendMessageAsLong(wParam, OCM__BASE + uMsg, wParam, lParam)
bCallDefProc = False
End If
StdHandler_End:
HandleMessage_Form = lRet
End Function
Private Function ISubclassedWindow_HandleMessage(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long, ByVal eSubclassID As EnumSubclassID, bCallDefProc As Boolean) As Long
Dim lRet As Long
On Error GoTo StdHandler_End
If eSubclassID = EnumSubclassID.escidMain Then
lRet = HandleMessage_Form(hWnd, uMsg, wParam, lParam, bCallDefProc)
End If
StdHandler_End:
ISubclassedWindow_HandleMessage = lRet
End Function
Private Sub MDIForm_Load()
'On Error GoTo Error
Dim Wa As Long, Wsa As String
Subclass
Me.Caption = "TTDX Editor"
Wa = fWriteValue("HKLM", RegBaseKey, "Version", "S", Format(App.Major) + "." + Format(App.Minor, "00") + "." + Format(App.Revision, "0000"))
For Wa = 1 To 11: Load mnMaxPro(Wa): Load mnMinPro(Wa): Next Wa
Width = fReadValue("HKCU", RegBaseKey & "\Options", "LastWidth", "D", Width)
Height = fReadValue("HKCU", RegBaseKey & "\Options", "LastHeight", "D", Height)
Left = CInt(fReadValue("HKCU", RegBaseKey & "\Options", "LastLeft", "S", CStr(Left)))
Top = CInt(fReadValue("HKCU", RegBaseKey & "\Options", "LastTop", "S", CStr(Top)))
WindowState = fReadValue("HKCU", RegBaseKey & "\Options", "LastWindowState", "D", WindowState)
Me.Show: DoEvents: Me.Show
SetMenus
BasTests
CleanUp = False
' Load currency defaults
Wa = fReadValue("HKCU", RegBaseKey & "\Options", "Currency", "D", 0)
mnuOCCur_Click (Wa)
End Sub
Private Sub MDIForm_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, shift As Integer, X As Single, Y As Single)
Dim Wa As Long, Wsa As String
If Data.GetFormat(15) Then
Me.OLEDropMode = 0
Wa = Data.Files.Count
If Wa > 1 Then
Wa = MsgBox("This program only supports the dropping of one file.", 48)
ElseIf Wa = 1 Then
Wsa = Data.Files(1)
If F.FileExists(Wsa) Then
If InStr(".sv0.sv1.sv2.ss0.ss1.", "." + Left(F.GetExtensionName(Wsa), 3) + ".") Then
CallFileLoad Wsa
End If
End If
End If
Me.OLEDropMode = 1
End If
End Sub
Private Sub MDIForm_Resize()
frmTechInfo.SetMe
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
Dim Wa As Long
If FileChanged Then
Wa = MsgBox("Are you sure you want to exit without saving your changes?", vbYesNo Or vbExclamation, "TTDX Editor")
If Wa = vbNo Then Cancel = 1: Exit Sub
End If
Unload frmTechInfo
Wa = fWriteValue("HKCU", RegBaseKey + "\Map", "Size", "D", frmMap.MapSize)
Wa = fWriteValue("HKCU", RegBaseKey, "LastPath", "S", frmSelectGame.CurPath)
Wa = fWriteValue("HKCU", RegBaseKey + "\View", "ToolBar", "B", mnVtool.Checked)
Wa = fWriteValue("HKCU", RegBaseKey + "\View", "TechBar", "B", mnVTech.Checked)
Wa = fWriteValue("HKCU", RegBaseKey, "FastMode", "B", fFastMode)
Wa = fWriteValue("HKCU", RegBaseKey + "\Options", "LastWidth", "D", Width)
Wa = fWriteValue("HKCU", RegBaseKey + "\Options", "LastHeight", "D", Height)
Wa = fWriteValue("HKCU", RegBaseKey + "\Options", "LastLeft", "S", frmMDI.Left)
Wa = fWriteValue("HKCU", RegBaseKey + "\Options", "LastTop", "S", frmMDI.Top)
Wa = fWriteValue("HKCU", RegBaseKey + "\Options", "LastWindowState", "D", WindowState)
If CleanUp Then Wa = fRecDeleteKey("HKCU", "Software\Owen Rudge", "TTDX Editor")
If CleanUp Then Wa = fRecDeleteKey("HKLM", "Software\Owen Rudge", "TTDX Editor")
UnSubclassWindow Me.hWnd, EnumSubclassID.escidMain
End Sub
Private Sub mnCedit_Click()
cmdCity_Click
End Sub
Private Sub mnCleanQuit_Click()
Dim Wa As Long
Wa = MsgBox("All TTDX Editor settings are now being removed." + Chr(10) + "NOTE: File associations and the Saved Game Manager plugin are not affected.", 33)
If Wa = 1 Then
CleanUp = True
Unload Me
End If
End Sub
Private Sub mnFLoad_Click()
frmSelectGame.FileSet = 4
frmSelectGame.FileMode = 0
frmSelectGame.Caption = "Load Game"
frmSelectGame.Show vbModal, Me
If frmSelectGame.Selected > " " Then
CallFileLoad frmSelectGame.Selected
End If
End Sub
Public Sub CallFileLoad(wFile As String)
Dim Wa As Integer, Wua As TTDXgeneral, Wv As TTDXplayer
DoEvents
frmWSplash.labText.Caption = "Loading File."
Me.Enabled = False: DoEvents
Unload frmCity
Unload frmIndu
Unload frmPlayer
Unload frmStation
Unload frmFinances
frmWSplash.Show 0, Me
frmWSplash.Refresh: DoEvents
Wa = TTDXLoadFile(wFile)
Me.Enabled = True
If (Wa = 0) And (Not fAutoMode) Then
frmMap.UpdateInfo
Wua = TTDXGeneralInfo
stBar.Panels(0).Text = "File: " + CurFile
stBar.Panels(1).Text = "Climate: " + Wua.ClimName
stBar.Panels(2).Text = "City Names: " + Wua.CityNames
stBar.Panels(3).Text = "Vehicle Array: " + Format(Wua.VehSize)
Me.CaptionW "TTDX Editor - " & Wua.GameName & " [" & F.GetFileName(CurFile) & "]"
ElseIf Wa < 100 Then
stBar.Panels(0).Text = "Load Error: " + TTDXLoadError(Wa)
stBar.Panels(1).Text = ""
stBar.Panels(2).Text = ""
stBar.Panels(3).Text = ""
Me.Caption = "TTDX Editor"
End If
SetMenus
Unload frmWSplash
End Sub
Private Sub mnFsave_Click()
CallFileSave 0
End Sub
Private Sub mnFsaveAs_Click()
On Error Resume Next
'CommonDialog1.Flags = cdlOFNHideReadOnly Or cdlOFNPathMustExist Or cdlOFNOverwritePrompt
'CommonDialog1.FileName = CurFile
'CommonDialog1.ShowSave
'
'If Err = 0 Then
' CallFileSave 0, CommonDialog1.FileName
'End If
End Sub
Private Sub mnFsaveU_Click()
CallFileSave 1
End Sub
Public Sub CallFileSave(wMode As Integer, Optional ByVal wFile As String)
Dim Wa As Integer
If CurFile > " " Then
If wFile = "" Then wFile = CurFile
Select Case wMode
Case 0: frmWSplash.labText.Caption = "Saving File.."
Case 1: frmWSplash.labText.Caption = "Saving Uncompressed.."
End Select
Me.Enabled = False
frmWSplash.Show 0, Me
frmWSplash.Refresh
DoEvents
If Not fAutoMode Then
If frmIndu.Visible Then frmIndu.PrepSave
If frmIndu.Visible Then frmCity.PrepSave
If frmPlayer.Visible Then frmPlayer.PrepSave
If frmStation.Visible Then frmStation.PrepSave
If frmVehicle.Visible Then frmVehicle.PrepSave
End If
Me.Enabled = False
frmWSplash.Show 0, Me
frmWSplash.Refresh
DoEvents
Select Case wMode
Case 0: Wa = TTDXSaveFile(CurFile)
Case 1: Wa = TTDXSaveUncom(CurFile)
End Select
DoEvents
Me.Enabled = True
Unload frmWSplash
If Wa <> 0 Then Wa = MsgBox("Save failed.", 48)
End If
End Sub
Private Sub mnHAbout_Click()
frmAbout.Show vbModal, Me
End Sub
Private Sub mnIedit_Click()
cmdIndu_Click
End Sub
Private Sub mnMaxPro_Click(Index As Integer)
MacroIndustry 1, Index
frmIndu.UpdateInfo
End Sub
Private Sub mnMaxProAll_Click()
MacroIndustry 1, -1
frmIndu.UpdateInfo
End Sub
Private Sub mnMinPro_Click(Index As Integer)
MacroIndustry 2, Index
frmIndu.UpdateInfo
End Sub
Private Sub mnMinProAll_Click()
MacroIndustry 2, -1
frmIndu.UpdateInfo
End Sub
Private Sub mnOpFileAss_Click()
frmFileTypes.Show vbModal, Me
End Sub
Private Sub mnOsgm_Click()
frmSGM.Show vbModal, Me
End Sub
Private Sub mnPedit_Click()
cmdPlayer_Click
End Sub
Private Sub BasTests()
Dim Wsa As String, Wa As Long
Wsa = F.BuildPath(App.Path, App.EXEName & ".exe")
If IsElevated() = True Then
If LCase$(fReadValue("HKLM", RegBaseKey, "Path", "S", "")) <> LCase$(Wsa) Then
Wa = MsgBox("This program has been moved since last run." + Chr(10) + "If you have assigned filetypes you should update them now.", 48)
Wa = fWriteValue("HKLM", RegBaseKey, "Path", "S", Wsa)
End If
Else
Wa = fWriteValue("HKCU", RegBaseKey, "Path", "S", Wsa)
End If
frmMap.MapSize = fReadValue("HKCU", RegBaseKey + "\Map", "Size", "D", 0)
frmMap.Move 0, 0
frmSelectGame.CurPath = fReadValue("HKCU", RegBaseKey, "LastPath", "S", App.Path)
mnVtool.Checked = Not fReadValue("HKCU", RegBaseKey + "\View", "ToolBar", "B", True): mnVtool_Click
mnVTech.Checked = Not fReadValue("HKCU", RegBaseKey + "\View", "TechBar", "B", False): mnVTech_Click
fFastMode = True
End Sub
Private Sub mnQuit_Click()
Unload Me
End Sub
Private Sub mnSedit_Click()
cmdStations_Click
End Sub
Private Sub mnTEremwood_Click()
Dim Wa As Integer
TTDXtermacRemWood
Wa = MsgBox("Trees removed.")
frmMap.UpdateInfo
End Sub
Private Sub mnTownAIr_Click()
Dim Wa As Integer
TTDXtermacOwnAIRoad
End Sub
Private Sub mnTownCbridge_Click()
TTDXtermacOwnCityBridge
End Sub
Private Sub mnuOCCur_Click(Index As Integer)
On Error GoTo Error
Dim LangCharset As Byte
LangCharset = 0
Select Case Index
Case 0
CurrencyMultiplier = 1
If LangCharset <> 0 Then
CurrencyLabel = "GBP "
Else
CurrencyLabel = "£"
End If
CurrencySeparator = ","
CurrencySymbolBefore = True
Case 1
CurrencyMultiplier = 2
CurrencyLabel = "$"
CurrencySeparator = ","
CurrencySymbolBefore = True
Case 2
CurrencyMultiplier = 20
If LangCharset <> 0 Then
CurrencyLabel = "JPY "
Else
CurrencyLabel = "¥"
End If
CurrencySeparator = ","
CurrencySymbolBefore = True
Case 3
CurrencyMultiplier = 10
CurrencyLabel = "Fr "
CurrencySeparator = "."
CurrencySymbolBefore = True
Case 4
CurrencyMultiplier = 4
CurrencyLabel = "DM "
CurrencySeparator = "."
CurrencySymbolBefore = True
Case 5
CurrencyMultiplier = 20
CurrencyLabel = "Pt "
CurrencySeparator = "."
CurrencySymbolBefore = True
Case 6
CurrencyMultiplier = 2
CurrencyLabel = ""
CurrencySeparator = ","
CurrencySymbolBefore = True
Case 7
CurrencyMultiplier = 375.62
CurrencyLabel = " Ft"
CurrencySeparator = "."
CurrencySymbolBefore = False
Case 8
CurrencyMultiplier = 6.079
CurrencyLabel = " zl"
CurrencySeparator = " "
CurrencySymbolBefore = False
Case 9
CurrencyMultiplier = 19.41
CurrencyLabel = "ATS "
CurrencySeparator = ","
CurrencySymbolBefore = True
Case 10
CurrencyMultiplier = 56.89
CurrencyLabel = "BEF "
CurrencySeparator = ","
CurrencySymbolBefore = True
Case 11
CurrencyMultiplier = 10.48
CurrencyLabel = "DKK "
CurrencySeparator = ","
CurrencySymbolBefore = True
Case 12
CurrencyMultiplier = 8.38
CurrencyLabel = "FIM "
CurrencySeparator = ","
CurrencySymbolBefore = True
Case 13
CurrencyMultiplier = 480.47
CurrencyLabel = "GRD "
CurrencySeparator = ","
CurrencySymbolBefore = True
Case 14
CurrencyMultiplier = 2.16
CurrencyLabel = "CHF "
CurrencySeparator = ","
CurrencySymbolBefore = True
Case 15
CurrencyMultiplier = 3.11
CurrencyLabel = "NLG "
CurrencySeparator = ","
CurrencySymbolBefore = True
Case 16
CurrencyMultiplier = 2730.58
CurrencyLabel = "ITL "
CurrencySeparator = ","
CurrencySymbolBefore = True
Case 17
CurrencyMultiplier = 13.09
CurrencyLabel = "SEK "
CurrencySeparator = ","
CurrencySymbolBefore = True
Case 18
CurrencyMultiplier = 4.859
CurrencyLabel = " rur"
CurrencySeparator = " "
CurrencySymbolBefore = False
End Select
CheckCurrencyItem (Index)
'SaveRegEntry "Options", "Currency", CStr(Index)
fWriteValue "HKCU", RegBaseKey & "\Options", "Currency", "D", Index
Exit Sub
Error:
Select Case ErrorProc(Err, "Function: frmMDI.mnuOCCur_Click(" & Index & ")")
Case 3:
End
Case 2:
Resume Next
Case 1:
Resume
End Select
End Sub