-
Notifications
You must be signed in to change notification settings - Fork 1
/
frmLoadGame.frm
206 lines (200 loc) · 6.39 KB
/
frmLoadGame.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
VERSION 5.00
Begin VB.Form frmLoadGame
BackColor = &H00000000&
BorderStyle = 0 'None
Caption = "Load"
ClientHeight = 7695
ClientLeft = 60
ClientTop = 450
ClientWidth = 10500
FillColor = &H000020FF&
ForeColor = &H0000DF00&
Icon = "frmLoadGame.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7695
ScaleWidth = 10500
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
WindowState = 2 'Maximized
Begin VB.Frame frGame
BackColor = &H00000000&
Caption = "Çàãðóçêà"
ForeColor = &H0036FE4A&
Height = 2775
Left = 3240
TabIndex = 0
Top = 3360
Width = 4695
Begin VB.ListBox lstGame
BackColor = &H00000000&
ForeColor = &H000020FF&
Height = 1425
ItemData = "frmLoadGame.frx":000C
Left = 1920
List = "frmLoadGame.frx":000E
Sorted = -1 'True
TabIndex = 2
Top = 960
Width = 2295
End
Begin VB.TextBox txtNew
BackColor = &H00000000&
ForeColor = &H0036FE4A&
Height = 285
Left = 1920
TabIndex = 1
Top = 720
Visible = 0 'False
Width = 2295
End
Begin VB.Label lblLoad
AutoSize = -1 'True
BackColor = &H00000000&
Caption = "Çàãðóçèòü"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 204
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H000020FF&
Height = 195
Left = 720
TabIndex = 6
Top = 1080
Width = 1020
End
Begin VB.Label lblDel
AutoSize = -1 'True
BackColor = &H00000000&
Caption = "Óäàëèòü"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 204
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H000020FF&
Height = 195
Left = 720
TabIndex = 5
Top = 1440
Width = 855
End
Begin VB.Label lblExit
AutoSize = -1 'True
BackColor = &H00000000&
Caption = "Îòìåíà"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 204
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H000020FF&
Height = 195
Left = 720
TabIndex = 4
Top = 2160
Width = 780
End
Begin VB.Label lblNew
AutoSize = -1 'True
BackColor = &H00000000&
Caption = "Íîâàÿ"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 204
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H000020FF&
Height = 195
Left = 720
TabIndex = 3
Top = 720
Visible = 0 'False
Width = 660
End
End
End
Attribute VB_Name = "frmLoadGame"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim intCount As Integer
Private Sub Form_Load()
If SaveMode Then
frGame.Caption = "Ñîõðàíåíèå"
Else
frGame.Caption = "Çàãðóçèòü"
End If
ListGame
End Sub
Private Sub lblDel_Click()
lblLoad.ForeColor = frmMain.ForeColor
Kill App.Path & "\Save Games\" & lstGame.List(lstGame.ListIndex)
ListGame
lblLoad.ForeColor = frmMain.FillColor
End Sub
Private Sub lblExit_Click()
Unload frmLoadGame
frmMain.Show
End Sub
Public Sub lblLoad_Click()
Dim strFile As String
Dim strSpFile() As String
If SaveMode Then
Open App.Path & "\Save Games\" & lstGame.List(lstGame.ListIndex) For Binary As #1
Put #1, , " " & Company & " " & Level & " " & startLifes & " " & startMoney
Close #1
Else
Open App.Path & "\Save Games\" & lstGame.List(lstGame.ListIndex) For Binary As #1
strFile = Space(LOF(1))
Get #1, , strFile
Close #1
strSpFile = Split(strFile, " ")
Company = strSpFile(1)
Level = Val(strSpFile(2))
Lifes = Val(strSpFile(3))
Money = Val(strSpFile(4))
Unload frmLoadGame
OffSp.Load_Game
OffSp.Show
lblExit.Visible = True
Unload frmMain
End If
End Sub
Private Sub ListGame()
Dim strfIleName As String
lstGame.Clear
' ñíà÷àëà ïåðå÷èñëÿåì âñå îáû÷íûå ôàéëû â òåêóùåì êàòàëîãå
strfIleName = Dir(App.Path & "\Save Games\")
Do While strfIleName <> ""
lstGame.AddItem strfIleName
intCount = intCount + 1
strfIleName = Dir
Loop
If lstGame.ListCount <> 0 Then lstGame.Selected(0) = True
End Sub
Private Sub lblNew_Click()
Open App.Path & "\Save Games\" & txtNew & ".svg" For Binary As #1
Put #1, , " " & Company & " " & Level & " " & Lifes & " " & Money
Close #1
End Sub