forked from Drossel-Studio/BMSE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodMain.vb
More file actions
2965 lines (2265 loc) · 152 KB
/
modMain.vb
File metadata and controls
2965 lines (2265 loc) · 152 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 Strict Off
Option Explicit On
Imports System.IO
Imports System.Runtime.InteropServices
Imports System.Runtime.InteropServices.ComTypes
Imports System.Text
Imports IniParser
Imports IniParser.Model
Imports IniParser.Model.Configuration
Imports VB = Microsoft.VisualBasic
Module modMain
#Const MODE_DEBUG = True
Private Const INI_VERSION As Integer = 30
#If MODE_DEBUG = True Then
Public Declare Function timeBeginPeriod Lib "winmm.dll" (ByVal uPeriod As Integer) As Integer
Public Declare Function timeEndPeriod Lib "winmm.dll" (ByVal uPeriod As Integer) As Integer
#End If
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringW" (<MarshalAs(UnmanagedType.LPWStr)> ByVal lpstrCommand As String, <MarshalAs(UnmanagedType.LPWStr)> ByVal lpstrTempurnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As IntPtr) As Integer
Public Declare Function mciGetErrorString Lib "winmm.dll" Alias "mciGetErrorStringW" (ByVal dwError As Integer, <MarshalAs(UnmanagedType.LPWStr)> ByVal lpstrBuffer As String, ByVal uLength As Integer) As Integer
Public Declare Function GetWindowPlacement Lib "user32" (ByVal hwnd As IntPtr, <Out()> ByRef lpwndpl As WINDOWPLACEMENT) As Integer
Public Declare Function SetWindowPlacement Lib "user32" (ByVal hwnd As IntPtr, <[In]()> ByRef lpwndpl As WINDOWPLACEMENT) As Integer
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteW" (ByVal hwnd As IntPtr, <MarshalAs(UnmanagedType.LPWStr)> ByVal lpOperation As String, <MarshalAs(UnmanagedType.LPWStr)> ByVal lpFile As String, <MarshalAs(UnmanagedType.LPWStr)> ByVal lpParameters As String, <MarshalAs(UnmanagedType.LPWStr)> ByVal lpDirectory As String, ByVal nShowCmd As Integer) As IntPtr
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongW" (ByVal hwnd As IntPtr, ByVal nIndex As Integer) As Integer
Public Declare Function GetWindowLongPtr Lib "user32" Alias "GetWindowLongPtrW" (ByVal hwnd As IntPtr, ByVal nIndex As Integer) As IntPtr
Public Declare Function AdjustWindowRectEx Lib "user32" (<[In]()> ByRef lpRect As RECT, ByVal dsStyle As Integer, ByVal bMenu As Integer, ByVal dwEsStyle As Integer) As Integer
Private Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As Integer) As IntPtr
Private Declare Function GetObject_Renamed Lib "gdi32" Alias "GetObjectW" (ByVal hObject As IntPtr, ByVal nCount As Integer, <Out()> ByRef lpObject As LOGFONT) As Integer
'Get/SetWindowPlacement・ShellExecute 関連の定数
Public Const SW_HIDE As Integer = 0
Public Const SW_MAXIMIZE As Integer = 3
Public Const SW_MINIMIZE As Integer = 6
Public Const SW_RESTORE As Integer = 9
Public Const SW_SHOW As Integer = 5
Public Const SW_SHOWDEFAULT As Integer = 10
Public Const SW_SHOWMAXIMIZED As Integer = 3
Public Const SW_SHOWMINIMIZED As Integer = 2
Public Const SW_SHOWMINNOACTIVE As Integer = 7
Public Const SW_SHOWNA As Integer = 8
Public Const SW_SHOWNOACTIVATE As Integer = 4
Public Const SW_SHOWNORMAL As Integer = 1
'GetWindowLong 関連の定数
Public Const GWL_STYLE As Integer = -16
Public Const GWL_EXSTYLE As Integer = -20
'GetStockObject 関連の定数
Private Const OEM_FIXED_FONT As Integer = 10
Private Const ANSI_FIXED_FONT As Integer = 11
Private Const ANSI_VAR_FONT As Integer = 12
Private Const SYSTEM_FONT As Integer = 13
Private Const SYSTEM_FIXED_FONT As Integer = 16
Private Const DEFAULT_GUI_FONT As Integer = 17
'LOGFONT 関連の定数
Private Const DEFAULT_CHARSET As Byte = 1
Private Const LF_FACESIZE As Integer = 32
'SystemParametersInfo 関連の定数
Private Const SPI_GETICONTITLELOGFONT As Integer = 31
Private Const SPI_GETNONCLIENTMETRICS As Integer = 41
Public Structure ItemWithData
Public ItemString As String
Public ItemData As Integer
'ComboBoxには、ToString()メソッドの内容が表示される
Public Overrides Function ToString() As String
Return ItemString
End Function
'登録を簡単にするため、引数付きのコンストラクタを定義
Public Sub New(ByVal S As String, ByVal I As Integer)
ItemString = S
ItemData = I
End Sub
Public Sub SetItemString(ByVal S As String)
ItemString = S
End Sub
Public Sub SetItemData(ByVal I As Integer)
ItemData = I
End Sub
End Structure
Public Sub SetItemString(obj As ComboBox, index As Integer, itemstring As String)
obj.Items.Insert(index, itemstring)
If obj.Items.Count > index + 1 Then
If obj.SelectedIndex = index + 1 Then
obj.SelectedIndex = index
End If
obj.Items.RemoveAt(index + 1)
End If
End Sub
Public Sub SetItemString(obj As ListBox, index As Integer, itemstring As String)
obj.Items.Insert(index, itemstring)
If obj.Items.Count > index + 1 Then
If obj.SelectedIndex = index + 1 Then
obj.SelectedIndex = index
End If
obj.Items.RemoveAt(index + 1)
End If
End Sub
Public Function GetItemString(obj As ComboBox, index As Integer) As String
GetItemString = obj.Items.Item(index).ToString()
End Function
Public Function GetItemString(obj As ListBox, index As Integer) As String
GetItemString = obj.Items.Item(index).ToString()
End Function
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1)> Public Structure LOGFONT
Public lfHeight As Int32
Public lfWidth As Int32
Public lfEscapement As Int32
Public lfOrientation As Int32
Public lfWeight As Int32
Public lfItalic As Byte
Public lfUnderline As Byte
Public lfStrikeOut As Byte
Public lfCharSet As Byte
Public lfOutPrecision As Byte
Public lfClipPrecision As Byte
Public lfQuality As Byte
Public lfPitchAndFamily As Byte
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=LF_FACESIZE)> Public lfFaceName As String
End Structure
Private Structure NONCLIENTMETRICS
Dim cbSize As Integer
Dim iBorderWidth As Integer
Dim iScrollWidth As Integer
Dim iScrollHeight As Integer
Dim iCaptionWidth As Integer
Dim iCaptionHeight As Integer
Dim lfCaptionFont As LOGFONT
Dim iSMCaptionWidth As Integer
Dim iSMCaptionHeight As Integer
Dim lfSMCaptionFont As LOGFONT
Dim iMenuWidth As Integer
Dim iMenuHeight As Integer
Dim lfMenuFont As LOGFONT
Dim lfStatusFont As LOGFONT
Dim lfMessageFont As LOGFONT
End Structure
Public Structure POINTAPI
Dim X As Integer
Dim Y As Integer
End Structure
<StructLayout(LayoutKind.Sequential)> Public Structure RECT
Dim left_Renamed As Integer
Dim Top As Integer
Dim right_Renamed As Integer
Dim Bottom As Integer
End Structure
<StructLayout(LayoutKind.Sequential)> Public Structure WINDOWPLACEMENT
Dim Length As Integer
Dim flags As Integer
Dim showCmd As Integer
Dim ptMinPosition As POINTAPI
Dim ptMaxPosition As POINTAPI
Dim rcNormalPosition As RECT
End Structure
Public Const PI As Single = 3.14159265358979
Public Const RAD As Single = PI / 180
Public Enum OBJ_SELECT
NON_SELECT '未選択
SELECTED '選択
QUICKSEND_SELECTED 'QuickSendの対象
EDIT_RECT '白枠 (編集モード)
DELETE_RECT '赤枠 (消去モード)
SELECTAREA_IN '選択範囲内にあるオブジェ、選択中
SELECTAREA_OUT '選択範囲を展開した時に既に選択状態にあったオブジェ、選択中
SELECTAREA_SELECTED '↑かつ選択範囲内、つまり選択状態でなくなったオブジェ
End Enum
Public Enum OBJ_ATT
OBJ_NORMAL
OBJ_INVISIBLE
OBJ_LONGNOTE
OBJ_MINE
End Enum
Public Enum BGA_PARA
BGA_NUM
BGA_X1
BGA_Y1
BGA_X2
BGA_Y2
BGA_dX
BGA_dY
End Enum
Public Enum CMD_LOG
NONE
OBJ_ADD
OBJ_DEL
OBJ_MOVE
OBJ_CHANGE
MSR_ADD
MSR_DEL
MSR_CHANGE
WAV_CHANGE
BMP_CHANGE
LIST_ALIGN
LIST_DEL
End Enum
Public g_strAppTitle As String
Public Structure m_udtMouse
Dim X As Integer
Dim Y As Integer
Dim Shift As Keys
Dim Button As MouseButtons
Dim measure As Integer
End Structure
Public g_Mouse As m_udtMouse
Public Structure m_udtDisplay
Dim X As Integer
Dim Y As Integer
Dim Width As Single
Dim Height As Single
Dim lngMaxX As Integer
Dim lngMaxY As Integer
Dim intStartMeasure As Integer
Dim intEndMeasure As Integer
Dim lngStartPos As Double
Dim lngEndPos As Double
Dim intMaxMeasure As Integer '最大表示小節
Dim intResolution As Integer '分解能
Dim intEffect As Integer '画面効果
End Structure
Public g_disp As m_udtDisplay
Public Structure m_udtBMS
Dim strDir As String 'ディレクトリ
Dim strFileName As String 'BMSファイル名
Dim intPlayerType As Integer '#PLAYER
Dim strGenre As String '#GENRE
Dim strTitle As String '#TITLE
Dim strArtist As String '#ARTIST
Dim sngBPM As Single '#BPM
Dim lngPlayLevel As Integer '#PLAYLEVEL
Dim intPlayRank As Integer '#RANK
Dim sngTotal As Single '#TOTAL
Dim intVolume As Integer '#VOLWAV
Dim strStageFile As String '#STAGEFILE
Dim strSubTitle As String '#SUBTITLE
Dim strSubArtist As String '#SUBARTIST
Dim intDifficulty As Integer '#DIFFICULTY
Dim strPreview As String '#PREVIEW
Dim strBanner As String '#BANNER
Dim intLNObj As Integer '#LNOBJ
Dim intLNMode As Integer '#LNMODE
Dim intDefExRank As Integer '#DEFEXRANK
Dim strBackBMP As String '#BACKBMP
Dim strComment As String '#COMMENT
Dim blnSaveFlag As Boolean
End Structure
Public g_BMS As m_udtBMS
Public Structure m_udtVerticalLine
Dim blnVisible As Boolean
Dim intCh As Integer
Dim strText As String
Dim intWidth As Integer
Dim lngLeft As Integer
Dim lngObjLeft As Integer
Dim lngBackColor As Integer
Dim intLightNum As Integer
Dim intShadowNum As Integer
Dim intBrushNum As Integer
Dim blnDraw As Boolean
End Structure
Public g_VGrid(31 + modInput.BGM_LANE) As m_udtVerticalLine
Public g_intVGridNum(36 ^ 2 + 4 * 36 + modInput.BGM_LANE) As Integer
Public Structure g_udtObj
Dim lngID As Integer
Dim intCh As Integer
Dim intAtt As OBJ_ATT
Dim intMeasure As Integer
Dim lngHeight As Integer
Dim lngPosition As Double
Dim lngTail As Double
Dim blnLNPair As Boolean
Dim sngValue As Single
Dim intSelect As OBJ_SELECT
'0・・・未選択
'1・・・選択
'2・・・白枠 (編集モード)
'3・・・赤枠 (消去モード)
'4・・・選択範囲内にあるオブジェ、選択中
'5・・・選択範囲を展開した時に既に選択状態にあったオブジェ、選択中
'6・・・5番かつ選択範囲内、つまり選択状態でなくなったオブジェ
End Structure
Public g_Obj() As g_udtObj
Public g_lngObjID() As Integer
Public g_lngIDNum As Integer
Public Structure m_udtSelectArea
Dim blnFlag As Boolean
Dim X1 As Single
Dim Y1 As Single
Dim X2 As Single
Dim Y2 As Single
End Structure
Public g_SelectArea As m_udtSelectArea
Public g_strLangFileName() As String
Public g_strThemeFileName() As String
Public g_strStatusBar(25) As String
Public g_blnIgnoreInput As Boolean
Public g_strAppDir As String
Public g_strHelpFilename As String
Public g_strFiler As String
Public g_strRecentFiles(9) As String
Public g_InputLog As New clsLog
Public Structure g_udtViewer
Dim strAppName As String
Dim strAppPath As String
Dim strArgAll As String
Dim strArgPlay As String
Dim strArgStop As String
End Structure
Public g_Viewer() As g_udtViewer
Public Enum Message
ERR_01
ERR_02
ERR_FILE_NOT_FOUND
ERR_LOAD_CANCEL
ERR_SAVE_ERROR
ERR_SAVE_CANCEL
ERR_OVERFLOW_LARGE
ERR_OVERFLOW_SMALL
ERR_OVERFLOW_BPM
ERR_OVERFLOW_STOP
ERR_OVERFLOW_SCROLL
ERR_OVERFLOW_SPEED
ERR_APP_NOT_FOUND
ERR_FILE_ALREADY_EXIST
ERR_OBJ_ALREADY_EXIST
ERR_NOT_ENOUGH_LANES
ERR_POSITION_ROUNDED
MSG_CONFIRM
MSG_FILE_CHANGED
MSG_INI_CHANGED
MSG_ALIGN_LIST
MSG_DELETE_FILE
MSG_DELETE_HISTORY
MSG_DELETED_HISTORY
INPUT_SCROLL
INPUT_BPM
INPUT_STOP
INPUT_SPEED
INPUT_RENAME
INPUT_SIZE
INPUT_OV_MAX
OV_BROKEN_LN_DETECTED
OV_BROKEN_LN_NOT_DETECTED
OV_INC_DETECTED
OV_INC_NOT_DETECTED
OV_DP_DETECTED
OV_DP_NOT_DETECTED
OV_OL_DETECTED
OV_OL_NOT_DETECTED
OV_MORE
OV_UNDEFINED
ST_1P_HEADER
ST_2P_HEADER
ST_NM
ST_INV
ST_LN
ST_MINE
ST_TOTAL
Max
End Enum
Public g_Message(Message.Max - 1) As String
Public bln62AutoSwiched As Boolean = False '62進数BMSを読み込んだことで自動で62進数モードに切り替わったかどうか。自動で切り替わったならば次回は元に戻したい。
Public intPreviousMode As Integer = 36 '直前に使用していたモードを記憶しておく
Public Function LenB(ByVal stTarget As String) As Integer
If stTarget <> Nothing Then
Return System.Text.Encoding.Unicode.GetByteCount(stTarget)
Else
Return 0
End If
End Function
Public Sub StartUp()
Dim i As Integer
Dim strTemp As String
If Right(My.Application.Info.DirectoryPath, 1) = "\" Then
g_strAppDir = My.Application.Info.DirectoryPath
Else
g_strAppDir = My.Application.Info.DirectoryPath & "\"
End If
g_strAppTitle = "BMx Sequence Editor " & My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor & "." & My.Application.Info.Version.Build
g_strAppTitle = g_strAppTitle & modVersion.VERSION_SUFFIX
#If MODE_DEBUG = False Then
Call modMessage.SubClass(frmMain.hwnd)
#End If
#If MODE_SPEEDTEST Then
Call timeBeginPeriod(1)
#End If
Call g_InputLog.Clear()
ReDim g_Viewer(1)
Const appConfig As String =
"<?xml version=""1.0"" encoding=""utf-8""?>
<configuration>
<startup>
<supportedRuntime version=""v4.0"" sku="".NETFramework,Version=v4.8""/>
</startup>
<runtime>
<!-- アセンブリの検索場所 -->
<assemblyBinding xmlns=""urn:schemas-microsoft-com:asm.v1"">
<probing privatePath=""lib""/>
</assemblyBinding>
</runtime>
</configuration>"
If Dir(g_strAppDir & "BMSE.exe.config", FileAttribute.Normal) = vbNullString Then File.WriteAllText(g_strAppDir & "BMSE.exe.config", appConfig, Encoding.UTF8)
'UPGRADE_WARNING: Dir に新しい動作が指定されています。 詳細については、'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' をクリックしてください。
If Dir(g_strAppDir & "bmse_viewer.ini", FileAttribute.Normal) = vbNullString Then
Using writer As New StreamWriter(g_strAppDir & "bmse_viewer.ini", False, Encoding.UTF8, 64)
writer.WriteLine("mBMplay")
writer.WriteLine("..\mBMplay\mBMplay.exe")
writer.WriteLine("<filename>")
writer.WriteLine("-s <measure> <filename>")
writer.WriteLine("-t")
writer.WriteLine("")
writer.WriteLine("uBMplay")
writer.WriteLine("..\uBMplay\uBMplay.exe")
writer.WriteLine("-P -N0 <filename>")
writer.WriteLine("-P -N<measure> <filename>")
writer.WriteLine("-S")
writer.WriteLine("")
writer.WriteLine("beatoraja")
writer.WriteLine("..\beatoraja-jre\beatoraja.exe")
writer.WriteLine("-a <filename>")
writer.WriteLine("-p <filename>")
writer.WriteLine("")
writer.WriteLine("")
writer.WriteLine("LR2")
writer.WriteLine("..\LR2\LR2body.exe")
writer.WriteLine("-a <filename>")
writer.WriteLine("-a <filename>")
writer.WriteLine("")
writer.WriteLine("")
End Using
End If
i = 0
Using reader As New StreamReader(g_strAppDir & "bmse_viewer.ini", Encoding.UTF8)
Do While Not reader.Peek() = -1
strTemp = reader.ReadLine()
Select Case i Mod 6
Case 0
'If Len(strTemp) = 0 Then Exit Do
g_Viewer(UBound(g_Viewer)).strAppName = strTemp
Case 1
'If Len(strTemp) = 0 Then Exit Do
g_Viewer(UBound(g_Viewer)).strAppPath = strTemp
If g_Viewer(UBound(g_Viewer)).strAppName = "" Then
If Len(Path.GetFileNameWithoutExtension(g_Viewer(UBound(g_Viewer)).strAppPath)) > 0 Then
g_Viewer(UBound(g_Viewer)).strAppName = Path.GetFileNameWithoutExtension(g_Viewer(UBound(g_Viewer)).strAppPath)
Else
g_Viewer(UBound(g_Viewer)).strAppName = "Unknown"
End If
End If
Case 2
g_Viewer(UBound(g_Viewer)).strArgAll = strTemp
Case 3
g_Viewer(UBound(g_Viewer)).strArgPlay = strTemp
Case 4
g_Viewer(UBound(g_Viewer)).strArgStop = strTemp
Call frmMain.cboViewer.Items.Add(g_Viewer(UBound(g_Viewer)).strAppName)
ReDim Preserve g_Viewer(UBound(g_Viewer) + 1)
End Select
i = i + 1
Loop
End Using
ReDim Preserve g_Viewer(frmMain.cboViewer.Items.Count)
'初期化
With g_BMS
.intPlayerType = modInput.PLAYER_TYPE.PLAYER_1P
.strGenre = ""
.strTitle = ""
.strArtist = ""
.sngBPM = CSng(Val(frmMain.txtBPM.Text))
.lngPlayLevel = 1
.intPlayRank = modInput.PLAY_RANK.RANK_EASY
.sngTotal = 0
.intVolume = 0
.strStageFile = ""
.strSubTitle = ""
.strSubArtist = ""
.intDifficulty = modInput.DIFFICULTY.NONE
.strPreview = ""
.strBanner = ""
.strBackBMP = ""
.intLNMode = modInput.LNMODE.NONE
.intLNObj = 0
.intDefExRank = 0
.strComment = ""
.blnSaveFlag = True
End With
ReDim g_Obj(0)
ReDim g_lngObjID(0)
g_lngIDNum = 0
For i = 0 To 999
g_Measure(i).intLen = MEASURE_LENGTH
If i = 0 Then
g_Measure(i).lngY = 0
Else
g_Measure(i).lngY += g_Measure(i - 1).intLen
End If
Next i
For i = 0 To 256 + 64
g_sngSin(i) = System.Math.Sin(i * PI / 128)
Next i
For i = 0 To UBound(g_VGrid)
With g_VGrid(i)
.intCh = Choose(i + 1, 0, OBJ_CH.CH_SPEED, OBJ_CH.CH_SCROLL, OBJ_CH.CH_EXBPM, OBJ_CH.CH_STOP,
0,
2 * 36 + 1, OBJ_CH.CH_1P_SC, OBJ_CH.CH_1P_KEY1, OBJ_CH.CH_1P_KEY2, OBJ_CH.CH_1P_KEY3, OBJ_CH.CH_1P_KEY4, OBJ_CH.CH_1P_KEY5, OBJ_CH.CH_1P_KEY6, OBJ_CH.CH_1P_KEY7, OBJ_CH.CH_1P_SC,
0,
OBJ_CH.CH_2P_SC, OBJ_CH.CH_2P_KEY1, OBJ_CH.CH_2P_KEY2, OBJ_CH.CH_2P_KEY3, OBJ_CH.CH_2P_KEY4, OBJ_CH.CH_2P_KEY5, OBJ_CH.CH_2P_KEY6, OBJ_CH.CH_2P_KEY7, OBJ_CH.CH_2P_SC,
0,
OBJ_CH.CH_BGA, OBJ_CH.CH_LAYER, OBJ_CH.CH_POOR,
0,
OBJ_CH.CH_BGM_LANE_OFFSET + 1, OBJ_CH.CH_BGM_LANE_OFFSET + 2, OBJ_CH.CH_BGM_LANE_OFFSET + 3, OBJ_CH.CH_BGM_LANE_OFFSET + 4, OBJ_CH.CH_BGM_LANE_OFFSET + 5, OBJ_CH.CH_BGM_LANE_OFFSET + 6, OBJ_CH.CH_BGM_LANE_OFFSET + 7, OBJ_CH.CH_BGM_LANE_OFFSET + 8, OBJ_CH.CH_BGM_LANE_OFFSET + 9, OBJ_CH.CH_BGM_LANE_OFFSET + 10,
OBJ_CH.CH_BGM_LANE_OFFSET + 11, OBJ_CH.CH_BGM_LANE_OFFSET + 12, OBJ_CH.CH_BGM_LANE_OFFSET + 13, OBJ_CH.CH_BGM_LANE_OFFSET + 14, OBJ_CH.CH_BGM_LANE_OFFSET + 15, OBJ_CH.CH_BGM_LANE_OFFSET + 16, OBJ_CH.CH_BGM_LANE_OFFSET + 17, OBJ_CH.CH_BGM_LANE_OFFSET + 18, OBJ_CH.CH_BGM_LANE_OFFSET + 19, OBJ_CH.CH_BGM_LANE_OFFSET + 20,
OBJ_CH.CH_BGM_LANE_OFFSET + 21, OBJ_CH.CH_BGM_LANE_OFFSET + 22, OBJ_CH.CH_BGM_LANE_OFFSET + 23, OBJ_CH.CH_BGM_LANE_OFFSET + 24, OBJ_CH.CH_BGM_LANE_OFFSET + 25, OBJ_CH.CH_BGM_LANE_OFFSET + 26, OBJ_CH.CH_BGM_LANE_OFFSET + 27, OBJ_CH.CH_BGM_LANE_OFFSET + 28, OBJ_CH.CH_BGM_LANE_OFFSET + 29, OBJ_CH.CH_BGM_LANE_OFFSET + 30,
OBJ_CH.CH_BGM_LANE_OFFSET + 31, OBJ_CH.CH_BGM_LANE_OFFSET + 32, OBJ_CH.CH_BGM_LANE_OFFSET + 33, OBJ_CH.CH_BGM_LANE_OFFSET + 34, OBJ_CH.CH_BGM_LANE_OFFSET + 35, OBJ_CH.CH_BGM_LANE_OFFSET + 36, OBJ_CH.CH_BGM_LANE_OFFSET + 37, OBJ_CH.CH_BGM_LANE_OFFSET + 38, OBJ_CH.CH_BGM_LANE_OFFSET + 39, OBJ_CH.CH_BGM_LANE_OFFSET + 40,
OBJ_CH.CH_BGM_LANE_OFFSET + 41, OBJ_CH.CH_BGM_LANE_OFFSET + 42, OBJ_CH.CH_BGM_LANE_OFFSET + 43, OBJ_CH.CH_BGM_LANE_OFFSET + 44, OBJ_CH.CH_BGM_LANE_OFFSET + 45, OBJ_CH.CH_BGM_LANE_OFFSET + 46, OBJ_CH.CH_BGM_LANE_OFFSET + 47, OBJ_CH.CH_BGM_LANE_OFFSET + 48, OBJ_CH.CH_BGM_LANE_OFFSET + 49, OBJ_CH.CH_BGM_LANE_OFFSET + 50,
OBJ_CH.CH_BGM_LANE_OFFSET + 51, OBJ_CH.CH_BGM_LANE_OFFSET + 52, OBJ_CH.CH_BGM_LANE_OFFSET + 53, OBJ_CH.CH_BGM_LANE_OFFSET + 54, OBJ_CH.CH_BGM_LANE_OFFSET + 55, OBJ_CH.CH_BGM_LANE_OFFSET + 56, OBJ_CH.CH_BGM_LANE_OFFSET + 57, OBJ_CH.CH_BGM_LANE_OFFSET + 58, OBJ_CH.CH_BGM_LANE_OFFSET + 59, OBJ_CH.CH_BGM_LANE_OFFSET + 60,
OBJ_CH.CH_BGM_LANE_OFFSET + 61, OBJ_CH.CH_BGM_LANE_OFFSET + 62, OBJ_CH.CH_BGM_LANE_OFFSET + 63, OBJ_CH.CH_BGM_LANE_OFFSET + 64, OBJ_CH.CH_BGM_LANE_OFFSET + 65, OBJ_CH.CH_BGM_LANE_OFFSET + 66, OBJ_CH.CH_BGM_LANE_OFFSET + 67, OBJ_CH.CH_BGM_LANE_OFFSET + 68, OBJ_CH.CH_BGM_LANE_OFFSET + 69, OBJ_CH.CH_BGM_LANE_OFFSET + 70,
OBJ_CH.CH_BGM_LANE_OFFSET + 71, OBJ_CH.CH_BGM_LANE_OFFSET + 72, OBJ_CH.CH_BGM_LANE_OFFSET + 73, OBJ_CH.CH_BGM_LANE_OFFSET + 74, OBJ_CH.CH_BGM_LANE_OFFSET + 75, OBJ_CH.CH_BGM_LANE_OFFSET + 76, OBJ_CH.CH_BGM_LANE_OFFSET + 77, OBJ_CH.CH_BGM_LANE_OFFSET + 78, OBJ_CH.CH_BGM_LANE_OFFSET + 79, OBJ_CH.CH_BGM_LANE_OFFSET + 80,
OBJ_CH.CH_BGM_LANE_OFFSET + 81, OBJ_CH.CH_BGM_LANE_OFFSET + 82, OBJ_CH.CH_BGM_LANE_OFFSET + 83, OBJ_CH.CH_BGM_LANE_OFFSET + 84, OBJ_CH.CH_BGM_LANE_OFFSET + 85, OBJ_CH.CH_BGM_LANE_OFFSET + 86, OBJ_CH.CH_BGM_LANE_OFFSET + 87, OBJ_CH.CH_BGM_LANE_OFFSET + 88, OBJ_CH.CH_BGM_LANE_OFFSET + 89, OBJ_CH.CH_BGM_LANE_OFFSET + 90,
OBJ_CH.CH_BGM_LANE_OFFSET + 91, OBJ_CH.CH_BGM_LANE_OFFSET + 92, OBJ_CH.CH_BGM_LANE_OFFSET + 93, OBJ_CH.CH_BGM_LANE_OFFSET + 94, OBJ_CH.CH_BGM_LANE_OFFSET + 95, OBJ_CH.CH_BGM_LANE_OFFSET + 96, OBJ_CH.CH_BGM_LANE_OFFSET + 97, OBJ_CH.CH_BGM_LANE_OFFSET + 98, OBJ_CH.CH_BGM_LANE_OFFSET + 99, OBJ_CH.CH_BGM_LANE_OFFSET + 100,
OBJ_CH.CH_BGM_LANE_OFFSET + 101, OBJ_CH.CH_BGM_LANE_OFFSET + 102, OBJ_CH.CH_BGM_LANE_OFFSET + 103, OBJ_CH.CH_BGM_LANE_OFFSET + 104, OBJ_CH.CH_BGM_LANE_OFFSET + 105, OBJ_CH.CH_BGM_LANE_OFFSET + 106, OBJ_CH.CH_BGM_LANE_OFFSET + 107, OBJ_CH.CH_BGM_LANE_OFFSET + 108, OBJ_CH.CH_BGM_LANE_OFFSET + 109, OBJ_CH.CH_BGM_LANE_OFFSET + 110,
OBJ_CH.CH_BGM_LANE_OFFSET + 111, OBJ_CH.CH_BGM_LANE_OFFSET + 112, OBJ_CH.CH_BGM_LANE_OFFSET + 113, OBJ_CH.CH_BGM_LANE_OFFSET + 114, OBJ_CH.CH_BGM_LANE_OFFSET + 115, OBJ_CH.CH_BGM_LANE_OFFSET + 116, OBJ_CH.CH_BGM_LANE_OFFSET + 117, OBJ_CH.CH_BGM_LANE_OFFSET + 118, OBJ_CH.CH_BGM_LANE_OFFSET + 119, OBJ_CH.CH_BGM_LANE_OFFSET + 120,
OBJ_CH.CH_BGM_LANE_OFFSET + 121, OBJ_CH.CH_BGM_LANE_OFFSET + 122, OBJ_CH.CH_BGM_LANE_OFFSET + 123, OBJ_CH.CH_BGM_LANE_OFFSET + 124, OBJ_CH.CH_BGM_LANE_OFFSET + 125, OBJ_CH.CH_BGM_LANE_OFFSET + 126, OBJ_CH.CH_BGM_LANE_OFFSET + 127, OBJ_CH.CH_BGM_LANE_OFFSET + 128, 0) 'これ直書きするの?マジで!? 1
'If .intCh Then g_intVGridNum(.intCh) = i
.blnVisible = True
Select Case .intCh
Case modInput.OBJ_CH.CH_BPM, modInput.OBJ_CH.CH_EXBPM, modInput.OBJ_CH.CH_STOP, modInput.OBJ_CH.CH_SCROLL, modInput.OBJ_CH.CH_SPEED 'BPM/STOP/SCROLL/SPEED
.intLightNum = modDraw.PEN_NUM.BPM_LIGHT
.intShadowNum = modDraw.PEN_NUM.BPM_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.BPM
Case modInput.OBJ_CH.CH_BGA, modInput.OBJ_CH.CH_LAYER, modInput.OBJ_CH.CH_POOR 'BGA/Layer/Poor
.intLightNum = modDraw.PEN_NUM.BGA_LIGHT
.intShadowNum = modDraw.PEN_NUM.BGA_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.BGA
Case OBJ_CH.CH_1P_KEY1
.intLightNum = modDraw.PEN_NUM.KEY01_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY01_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY01
Case OBJ_CH.CH_1P_KEY2
.intLightNum = modDraw.PEN_NUM.KEY02_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY02_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY02
Case OBJ_CH.CH_1P_KEY3
.intLightNum = modDraw.PEN_NUM.KEY03_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY03_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY03
Case OBJ_CH.CH_1P_KEY4
.intLightNum = modDraw.PEN_NUM.KEY04_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY04_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY04
Case OBJ_CH.CH_1P_KEY5
.intLightNum = modDraw.PEN_NUM.KEY05_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY05_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY05
Case OBJ_CH.CH_1P_KEY6
.intLightNum = modDraw.PEN_NUM.KEY06_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY06_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY06
Case OBJ_CH.CH_1P_KEY7
.intLightNum = modDraw.PEN_NUM.KEY07_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY07_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY07
Case OBJ_CH.CH_1P_SC
.intLightNum = modDraw.PEN_NUM.KEY08_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY08_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY08
Case OBJ_CH.CH_2P_KEY1
.intLightNum = modDraw.PEN_NUM.KEY11_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY11_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY11
Case OBJ_CH.CH_2P_KEY2
.intLightNum = modDraw.PEN_NUM.KEY12_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY12_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY12
Case OBJ_CH.CH_2P_KEY3
.intLightNum = modDraw.PEN_NUM.KEY13_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY13_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY13
Case OBJ_CH.CH_2P_KEY4
.intLightNum = modDraw.PEN_NUM.KEY14_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY14_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY14
Case OBJ_CH.CH_2P_KEY5
.intLightNum = modDraw.PEN_NUM.KEY15_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY15_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY15
Case OBJ_CH.CH_2P_KEY6
.intLightNum = modDraw.PEN_NUM.KEY16_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY16_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY16
Case OBJ_CH.CH_2P_KEY7
.intLightNum = modDraw.PEN_NUM.KEY17_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY17_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY17
Case OBJ_CH.CH_2P_SC
.intLightNum = modDraw.PEN_NUM.KEY18_LIGHT
.intShadowNum = modDraw.PEN_NUM.KEY18_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.KEY18
Case Is > OBJ_CH.CH_BGM_LANE_OFFSET 'BGM
.intLightNum = modDraw.PEN_NUM.BGM_LIGHT
.intShadowNum = modDraw.PEN_NUM.BGM_SHADOW
.intBrushNum = modDraw.BRUSH_NUM.BGM
End Select
If .intCh Then
.intWidth = GRID_WIDTH
Else
.intWidth = SPACE_WIDTH
End If
End With
Next i
'g_Disp.intMaxMeasure = 31
g_disp.intMaxMeasure = 0
Call modDraw.lngChangeMaxMeasure(15)
Call modDraw.ChangeResolution()
Call LoadShortcut()
End Sub
Public Sub CleanUp(Optional ByVal lngErrNum As Integer = 0, Optional ByRef strErrDescription As String = "", Optional ByRef strErrProcedure As String = "")
On Error Resume Next
Dim i As Integer
#If MODE_DEBUG = False Then
Call modMessage.UnSubClass(frmMain.hwnd)
#End If
#If MODE_SPEEDTEST Then
Call timeEndPeriod(1)
#End If
g_InputLog = Nothing
Call modEasterEgg.EndEffect()
Call SaveConfig()
Call mciSendString("close PREVIEW", vbNullString, 0, 0)
Call lngDeleteFile(g_BMS.strDir & "___bmse_temp.bms")
Call lngDeleteFile(g_strAppDir & "___bmse_temp.bms")
Call lngDeleteFile(g_BMS.strDir & "___bmse_temp.pms")
Call lngDeleteFile(g_strAppDir & "___bmse_temp.pms")
If lngErrNum <> 0 And strErrDescription <> "" And strErrProcedure <> "" Then
If Len(g_BMS.strDir) = 0 Then g_BMS.strDir = g_strAppDir
For i = 0 To 9999
g_BMS.strFileName = "temp" & Format(i, "0000") & ".bms"
If i = 9999 Then
Call CreateBMS(g_BMS.strDir & g_BMS.strFileName)
'UPGRADE_WARNING: Dir に新しい動作が指定されています。 詳細については、'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' をクリックしてください。
ElseIf Dir(g_BMS.strDir & g_BMS.strFileName) = vbNullString Then
Call CreateBMS(g_BMS.strDir & g_BMS.strFileName)
Exit For
End If
Next i
Call DebugOutput(lngErrNum, strErrDescription, strErrProcedure, True)
End If
End
End Sub
Public Sub DebugOutput(ByVal lngErrNum As Integer, ByRef strErrDescription As String, ByRef strErrProcedure As String, Optional ByVal blnCleanUp As Boolean = False)
Dim lngFFile As Integer
Dim strError As String = ""
lngFFile = FreeFile()
FileOpen(lngFFile, g_strAppDir & "error.txt", OpenMode.Append)
PrintLine(lngFFile, Today & TimeOfDay & "ErrorNo." & lngErrNum & " " & strErrDescription & "@" & strErrProcedure & "/BMSE_" & My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor & "." & My.Application.Info.Version.Build)
FileClose(lngFFile)
strError = strError & "ErrorNo." & lngErrNum & " " & strErrDescription & "@" & strErrProcedure
If blnCleanUp Then
strError = g_Message(modMain.Message.ERR_01) & vbCrLf & strError & vbCrLf
strError = strError & g_Message(modMain.Message.ERR_02) & vbCrLf
strError = strError & g_BMS.strDir & g_BMS.strFileName
End If
Call frmMain.Show()
Call MsgBox(strError, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, g_strAppTitle)
End Sub
Public Function lngDeleteFile(ByRef FileName As String) As Integer
On Error GoTo Err_Renamed
Kill(FileName)
Exit Function
Err_Renamed:
lngDeleteFile = 1
End Function
Public Function intSaveCheck() As Integer
On Error GoTo Err_Renamed
Dim lngTemp As Integer
Dim strArray() As String
With frmMain
If .cboPlayer.SelectedIndex + 1 <> g_BMS.intPlayerType Then g_BMS.blnSaveFlag = False
If .txtGenre.Text <> g_BMS.strGenre Then g_BMS.blnSaveFlag = False
If .txtTitle.Text <> g_BMS.strTitle Then g_BMS.blnSaveFlag = False
If .txtArtist.Text <> g_BMS.strArtist Then g_BMS.blnSaveFlag = False
If CLng(Val(.cboPlayLevel.Text)) <> g_BMS.lngPlayLevel Then g_BMS.blnSaveFlag = False
If CSng(Val(.txtBPM.Text)) <> g_BMS.sngBPM Then g_BMS.blnSaveFlag = False
If .cboPlayRank.SelectedIndex <> g_BMS.intPlayRank Then g_BMS.blnSaveFlag = False
If CSng(Val(.txtTotal.Text)) <> g_BMS.sngTotal Then g_BMS.blnSaveFlag = False
If CInt(Val(.txtVolume.Text)) <> g_BMS.intVolume Then g_BMS.blnSaveFlag = False
If .txtStageFile.Text <> g_BMS.strStageFile Then g_BMS.blnSaveFlag = False
'If .txtMissBMP.Text <> g_strBMP(0) Then g_BMS.blnSaveFlag = False
If .cboDifficulty.SelectedIndex <> g_BMS.intDifficulty Then g_BMS.blnSaveFlag = False
If .cboLNMode.SelectedIndex <> g_BMS.intLNMode Then g_BMS.blnSaveFlag = False
If .cboLNObj.SelectedIndex <> g_BMS.intLNObj Then g_BMS.blnSaveFlag = False
If .txtSubTitle.Text <> g_BMS.strSubTitle Then g_BMS.blnSaveFlag = False
If .txtSubArtist.Text <> g_BMS.strSubArtist Then g_BMS.blnSaveFlag = False
If .txtPreview.Text <> g_BMS.strPreview Then g_BMS.blnSaveFlag = False
If .txtBanner.Text <> g_BMS.strBanner Then g_BMS.blnSaveFlag = False
If .txtBackBmp.Text <> g_BMS.strBackBMP Then g_BMS.blnSaveFlag = False
If .txtLandmineWAV.Text <> g_strWAV(0) Then g_BMS.blnSaveFlag = False
If CInt(Val(.txtDefExRank.Text)) <> g_BMS.intDefExRank Then g_BMS.blnSaveFlag = False
If .txtComment.Text <> g_BMS.strComment Then g_BMS.blnSaveFlag = False
End With
If g_BMS.blnSaveFlag Then
intSaveCheck = 0
Exit Function
End If
Call frmMain.Show()
lngTemp = MsgBox(g_Message(modMain.Message.MSG_FILE_CHANGED), MsgBoxStyle.Exclamation Or MsgBoxStyle.YesNoCancel, g_strAppTitle)
Select Case lngTemp
Case MsgBoxResult.Yes
If g_BMS.strDir <> "" And g_BMS.strFileName <> "" Then
Call CreateBMS(g_BMS.strDir & g_BMS.strFileName)
Else
With frmMain.dlgMainSave
'UPGRADE_WARNING: Filter に新しい動作が指定されています。 詳細については、'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' をクリックしてください。
.Filter = "BMS files (*.bms,*.bme,*.bml,*.pms)|*.bms;*.bme;*.bml;*.pms|All files (*.*)|*.*"
.FileName = g_BMS.strFileName
If .ShowDialog() <> DialogResult.OK Then
intSaveCheck = 1
Exit Function
End If
strArray = Split(.FileName, "\")
g_BMS.strDir = Left(.FileName, Len(.FileName) - Len(strArray(UBound(strArray))))
g_BMS.strFileName = strArray(UBound(strArray))
Call CreateBMS(g_BMS.strDir & g_BMS.strFileName)
Call RecentFilesRotation(g_BMS.strDir & g_BMS.strFileName)
frmMain.dlgMainOpen.InitialDirectory = g_BMS.strDir
frmMain.dlgMainSave.InitialDirectory = g_BMS.strDir
End With
End If
Case MsgBoxResult.No
intSaveCheck = 0
Case MsgBoxResult.Cancel
intSaveCheck = 1
End Select
Exit Function
Err_Renamed:
intSaveCheck = 1
End Function
Public Sub RecentFilesRotation(ByRef strFilePath As String)
Dim i As Integer
Dim intTemp As Integer
For i = 0 To UBound(g_strRecentFiles)
If g_strRecentFiles(i) = strFilePath Then
Call SubRotate(0, i, strFilePath)
intTemp = 1
Exit For
End If
Next i
If intTemp = 0 Then Call SubRotate(0, UBound(g_strRecentFiles), strFilePath)