⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 snddefedit.bas

📁 超级C&C有没有搞错,VB还能编出这种即时策略游戏来!没错,这就是我们的超级C&C!虽然游戏经常无故退出,但是原码仍有很多可圈可点的地方.祝你早日编出中国的超级RA,超级KKND,超级星际,超级家园
💻 BAS
字号:
Attribute VB_Name = "Module1"
Type snDfs
  filename As String
  tracktitle As String
End Type
Global Soundfiles(100) As snDfs
Global MaxSoundFiles As Integer
Sub Load()
MaxSoundFiles = 0
Open "Sound.Dat" For Input As #1
Do
  Line Input #1, a$
  If a$ = "[ENDOFFILE]" Then Exit Do
  If a$ = "[SOUNDDEF]" Then
    Soundfilenum = Soundfilenum + 1
    Line Input #1, a$
    propvalue$ = GetPropertyValue(a$)
    Soundfiles(Soundfilenum).tracktitle = propvalue$
    Line Input #1, a$
    propvalue$ = GetPropertyValue(a$)
    Soundfiles(Soundfilenum).filename = propvalue$
  End If
Loop
Close #1
MaxSoundFiles = Soundfilenum
End Sub
Sub Save()

Open "Sound.Dat" For Output As #1
Print #1, "ION FORMAT VERSION: 1.0"
  For i = 1 To MaxSoundFiles
    Print #1, "[SOUNDDEF]"
    Print #1, "Name: " & Soundfiles(i).tracktitle
    Print #1, "FileName: " & Soundfiles(i).filename
    Print #1, "[ENDMUSICDEF]"
  Next i
Print #1, "[ENDOFFILE]"
Close #1
End Sub
Public Function GetPropertyValue(TextString) As String
GetPropertyValue = Right$(TextString, Len(TextString) - InStr(1, TextString, " "))
End Function
Public Function GetPropertyName(TextString) As String
If InStr(1, TextString, " ") = 0 Then
  GetPropertyName = TextString
Else
  GetPropertyName = Left$(TextString, InStr(1, TextString, " ") - 1)
End If
End Function
Sub UpdateList()
Currindex = Form1.List1.ListIndex
Form1.List1.Clear
Form1.List1.AddItem "[NewSoundDef]"
For i = 1 To MaxSoundFiles
  Form1.List1.AddItem Soundfiles(i).tracktitle
Next i
Form1.List1.ListIndex = Currindex
End Sub
Sub UpdateProperties()
mnum = Form1.List1.ListIndex
Form1.Text1.Text = Soundfiles(mnum).tracktitle
Form1.Text2.Text = Soundfiles(mnum).filename
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -