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

📄 mainfrm.frm

📁 超级C&C有没有搞错,VB还能编出这种即时策略游戏来!没错,这就是我们的超级C&C!虽然游戏经常无故退出,但是原码仍有很多可圈可点的地方.祝你早日编出中国的超级RA,超级KKND,超级星际,超级家园
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Object Editor"
   ClientHeight    =   2055
   ClientLeft      =   4365
   ClientTop       =   2295
   ClientWidth     =   6585
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2055
   ScaleWidth      =   6585
   Begin VB.CommandButton Command3 
      Caption         =   "About"
      Height          =   255
      Left            =   3240
      TabIndex        =   7
      Top             =   1680
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Revert"
      Height          =   255
      Left            =   1200
      TabIndex        =   6
      Top             =   1680
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Save"
      Height          =   255
      Left            =   120
      TabIndex        =   5
      Top             =   1680
      Width           =   975
   End
   Begin VB.ComboBox Combo1 
      Height          =   315
      Left            =   120
      Style           =   2  'Dropdown List
      TabIndex        =   4
      Top             =   480
      Visible         =   0   'False
      Width           =   4095
   End
   Begin VB.TextBox Text1 
      Height          =   285
      Left            =   120
      Locked          =   -1  'True
      TabIndex        =   3
      Text            =   "TagName"
      Top             =   120
      Width           =   4095
   End
   Begin VB.HScrollBar HScroll1 
      Height          =   255
      Left            =   120
      Max             =   100
      Min             =   1
      TabIndex        =   2
      Top             =   840
      Value           =   1
      Width           =   4095
   End
   Begin VB.TextBox Text2 
      Height          =   285
      Left            =   120
      TabIndex        =   1
      Top             =   480
      Width           =   4095
   End
   Begin VB.ListBox List1 
      Height          =   1815
      Left            =   4320
      TabIndex        =   0
      Top             =   120
      Width           =   2175
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Combo1_Click()
If Combo1.Text <> "" Then Objects(CObj).Tags(Form1.HScroll1.Value) = Combo1.Text
End Sub

Private Sub Command1_Click()
Call SaveObjz
End Sub

Private Sub Command2_Click()
Call LoadObjz
End Sub

Private Sub Command3_Click()
AboutFrm.Show
End Sub

Private Sub Form_Load()

Form1.List1.AddItem "[New Object]"

Call LoadObjectTags
Call LoadObjz

If Form1.List1.ListCount = 1 Then Form1.List1.ListIndex = 0 Else Form1.List1.ListIndex = 1
End Sub

Private Sub Form_Unload(Cancel As Integer)
Style = vbYesNo
Response = MsgBox("Save Changes?", Style)
If Response = vbYes Then
  Call SaveObjz
End If
End Sub

Private Sub HScroll1_Change()
DoEvents
Call UpdatePage
End Sub

Private Sub List1_Click()
If CObj <> List1.ListIndex Then
    CObj = List1.ListIndex
    If List1.ListIndex = 0 Then
      If HScroll1.Value <> 1 Then HScroll1.Value = 1: DoEvents: Call UpdatePage
      HScroll1.Enabled = False
    Else
      HScroll1.Enabled = True
    End If
    If List1.ListIndex = 0 Then HScroll1.Value = 1
    Call UpdatePage
End If
End Sub

Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 46 Then 'delete
  If List1.ListIndex <> 0 Then
    pp = List1.ListIndex
    For i = List1.ListIndex To MAXOBJZ - 1
      Objects(i).active = Objects(i + 1).active
      For i2 = 1 To TAGDEFMAX
        Objects(i).Tags(i2) = Objects(i + 1).Tags(i2)
      Next i2
    Next i
    Objects(MAXOBJZ).active = False
    For i2 = 1 To TAGDEFMAX
      Objects(MAXOBJZ).Tags(i2) = ""
    Next i2
    List1.ListIndex = pp - 1
    Call UpdatePage
  End If
End If
End Sub

Private Sub Text2_Change()
If Text2.Text <> "-Enter a value-" Then
    If List1.ListIndex = 0 Then
      For i = 1 To MAXOBJZ
        If Objects(i).active = False Then
          Objects(i).active = True
          CObj = i
          Objects(CObj).Tags(1) = Text2.Text
          SS = Text2.SelStart
          Call UpdatePage
          List1.ListIndex = List1.ListCount - 1
          Text2.SelStart = SS
          Exit For
        End If
      Next i
    End If
End If
If Text2.Text <> "-Enter a value-" Then If List1.ListIndex <> 0 Then Objects(CObj).Tags(Form1.HScroll1.Value) = Text2.Text
Call UpdatePage
End Sub

⌨️ 快捷键说明

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