📄 plugins.frm
字号:
i = i + 1
Loop While i < List2.ListCount
'add color names to List1 and List3
i = 0
Do
List2.ListIndex = i
DoGetName
List1.AddItem NameStr
List3.AddItem NameStr + Space(MaxLen - Len(NameStr)) + Format(i, "000")
i = i + 1
Loop While i < List2.ListCount
'hilight current color
i = List2.ListCount - 1
Do
List3.ListIndex = i
List1.ListIndex = i
List2.ListIndex = Val(Mid(List3.Text, MaxLen + 1))
i = i - 1
Loop While i >= 0 And LCase(List2.Text) <> LCase(Form1.CurrentColor)
End If
End If
DoGetDescription Form1.PluginsForm, List2.Text
MousePointer = vbDefault
SendKeys "{TAB}"
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.Enabled = True
Form1.mPopupStatus.Enabled = Form1.Enabled
Form1.mPopupOnTop.Enabled = Form1.Enabled
Form1.mCheats.Enabled = Form1.Enabled
Form1.mPopupChangeColor.Enabled = Form1.Enabled
Form1.mPopupPlugins.Enabled = Form1.Enabled
Form1.mPopupInstructions.Enabled = Form1.Enabled
Form1.mPopupAbout.Enabled = Form1.Enabled
If Form1.mPopupInsulatingSheet.Checked Then
Form5.Enabled = True
Else
Form1.mPopupInsulatingSheet.Enabled = True
End If
End Sub
Private Sub List1_Click()
List3.ListIndex = List1.ListIndex
List2.ListIndex = Val(Mid(List3.Text, MaxLen + 1))
DoGetDescription Form1.PluginsForm, List2.Text
End Sub
Private Sub List1_DblClick()
List3.ListIndex = List1.ListIndex
List2.ListIndex = Val(Mid(List3.Text, MaxLen + 1))
Command1_Click
End Sub
Private Sub DoSetPlugins()
Dim TamCharVisible As Boolean
If LCase(List2.Text) = "<default>" Then
Form1.Plugins = ""
Else
Form1.Plugins = List2.Text
End If
If Form1.Plugins <> OldDirectoryName Then
MousePointer = vbHourglass
Form1.DoGetPlugins "" 'set to default before loading a new plugin
Form1.DoEndCurrentAction
TamCharVisible = Form1.TamChar.Visible
Form1.TamChar.Visible = False
Form1.DoGetCharacterIni ""
Form1.DoLoadCharacter
If Form1.Plugins <> "" Then
Form1.DoGetPlugins Form1.Plugins
Form1.DoGetCharacterIni Form1.Plugins
Form1.DoLoadCharacter
End If
Form1.DoSetToolTip
MousePointer = vbDefault
Form1.TamChar.Visible = TamCharVisible
End If
End Sub
Private Sub DoGetDescription(IsPlugin As Boolean, List2Text As String)
Dim Filename As String
Dim InputData As String
Dim ValueName As String
Dim NewValue As String
Dim i As Integer
Dim FileNumber As Integer
If IsPlugin Then
If LCase(List2Text) = "<default>" Then
Filename = App.Path + "\default.ini"
Else
Filename = App.Path + "\plugins\" + List2Text + "\plugin.ini"
End If
Else
Filename = App.Path + "\colors\" + List2Text + "\color.ini"
ButtonALeft = Form1.ButtonALeft
ButtonATop = Form1.ButtonATop
ButtonBLeft = Form1.ButtonBLeft
ButtonBTop = Form1.ButtonBTop
ButtonCLeft = Form1.ButtonCLeft
ButtonCTop = Form1.ButtonCTop
ResetButtonLeft = Form1.ResetButtonLeft
ResetButtonTop = Form1.ResetButtonTop
End If
Text1.Text = ""
If IsPlugin Then
DefaultColor = ""
End If
If Dir(Filename, vbNormal) <> "" Then
FileNumber = FreeFile
Open Filename For Input As #FileNumber
Do While Not EOF(FileNumber)
Line Input #FileNumber, InputData
InputData = Trim(InputData)
If InputData <> "" And Mid(InputData, 1, 1) <> ";" Then
i = InStr(InputData, "=")
If i > 0 Then
NewValue = Trim(Mid(InputData, i + 1))
If NewValue <> "" Then
ValueName = LCase(Trim(Mid(InputData, 1, i - 1)))
Select Case ValueName
Case "description"
Text1.Text = NewValue
Case "defaultcolor"
DefaultColor = NewValue
End Select
If Not IsPlugin Then
i = Val(NewValue)
Select Case ValueName
Case "buttona.left"
ButtonALeft = i
Case "buttona.top"
ButtonATop = i
Case "buttonb.left"
ButtonBLeft = i
Case "buttonb.top"
ButtonBTop = i
Case "buttonc.left"
ButtonCLeft = i
Case "buttonc.top"
ButtonCTop = i
Case "reset.left"
ResetButtonLeft = i
Case "reset.top"
ResetButtonTop = i
End Select
End If
End If
End If
End If
Loop
Close #FileNumber
End If
End Sub
Private Sub DoGetName()
Dim Filename As String
Dim InputData As String
Dim ValueName As String
Dim NewValue As String
Dim i As Integer
Dim FileNumber As Integer
Dim flag As Boolean
If Form1.PluginsForm Then
If LCase(List2.Text) = "<default>" Then
Filename = App.Path + "\default.ini"
Else
Filename = App.Path + "\plugins\" + List2.Text + "\plugin.ini"
End If
Else
Filename = App.Path + "\colors\" + List2.Text + "\color.ini"
End If
NameStr = List2.Text
If Dir(Filename, vbNormal) <> "" Then
FileNumber = FreeFile
Open Filename For Input As #FileNumber
flag = False
Do While Not EOF(FileNumber) And Not flag
Line Input #FileNumber, InputData
InputData = Trim(InputData)
If InputData <> "" And Mid(InputData, 1, 1) <> ";" Then
i = InStr(InputData, "=")
If i > 0 Then
NewValue = Trim(Mid(InputData, i + 1))
If NewValue <> "" Then
ValueName = LCase(Trim(Mid(InputData, 1, i - 1)))
Select Case ValueName
Case "name"
NameStr = NewValue
flag = True
End Select
End If
End If
End If
Loop
Close #FileNumber
End If
End Sub
Private Sub DoSetColor(ColorPath As String)
Form1.CurrentColor = ColorPath
If Form1.CurrentColor <> OldDirectoryName Then
Form1.Caption = "Changing color..."
Form1.DoLoadPicture Form1.Plugins, Form1.FrontView, "\colors\" + Form1.CurrentColor + "\", "front.gif"
If Dir(App.Path + "\colors\" + Form1.CurrentColor + "\color.ico", vbNormal) <> "" Then
Form1.Icon = LoadPicture(App.Path + "\colors\" + Form1.CurrentColor + "\color.ico")
End If
Form1.DoLoadPicture Form1.Plugins, Form1.BackView, "\colors\" + Form1.CurrentColor + "\", "back.gif"
Form1.DoLoadPicture Form1.Plugins, Form1.ButtonA, "\colors\" + Form1.CurrentColor + "\", "button0.gif"
Form1.DoLoadPicture Form1.Plugins, Form1.ButtonB, "\colors\" + Form1.CurrentColor + "\", "button0.gif"
Form1.DoLoadPicture Form1.Plugins, Form1.ButtonC, "\colors\" + Form1.CurrentColor + "\", "button0.gif"
Form1.DoLoadPicture Form1.Plugins, Form1.ResetStatus(0), "\other\", "reset0.gif"
Form1.DoLoadPicture Form1.Plugins, Form1.ResetStatus(1), "\other\", "reset1.gif"
Form1.DoLoadPicture Form1.Plugins, Form1.ResetStatus(0), "\colors\" + Form1.CurrentColor + "\", "reset0.gif"
Form1.DoLoadPicture Form1.Plugins, Form1.ResetStatus(1), "\colors\" + Form1.CurrentColor + "\", "reset1.gif"
Form1.ButtonA.Left = ButtonALeft
Form1.ButtonA.Top = ButtonATop
Form1.ButtonB.Left = ButtonBLeft
Form1.ButtonB.Top = ButtonBTop
Form1.ButtonC.Left = ButtonCLeft
Form1.ButtonC.Top = ButtonCTop
Form1.ResetButton.Left = ResetButtonLeft
Form1.ResetButton.Top = ResetButtonTop
Form1.ResetButton.Picture = Form1.ResetStatus(0)
Form1.Caption = Form1.TamagotchiName
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -