/
frm_load.frm
338 lines (301 loc) · 9.69 KB
/
frm_load.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
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
VERSION 5.00
Begin VB.Form frm_load
BackColor = &H00000000&
BorderStyle = 1 'Fixed Single
Caption = "TakeDown - Load mission"
ClientHeight = 4155
ClientLeft = 45
ClientTop = 330
ClientWidth = 6810
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4155
ScaleWidth = 6810
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton com_save
Caption = "Save"
Height = 495
Left = 360
TabIndex = 1
Top = 2760
Width = 1095
End
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "OK"
Height = 495
Left = 5400
TabIndex = 3
Top = 3480
Width = 1095
End
Begin VB.CommandButton com_load
Caption = "Load"
Height = 495
Left = 360
TabIndex = 2
Top = 3480
Width = 1095
End
Begin VB.OptionButton Opt_save
BackColor = &H00000000&
Caption = "Slot 1"
ForeColor = &H00FFFFFF&
Height = 255
Index = 0
Left = 240
TabIndex = 5
Top = 720
Width = 2055
End
Begin VB.OptionButton Opt_save
BackColor = &H00000000&
Caption = "Slot 2"
ForeColor = &H00FFFFFF&
Height = 255
Index = 1
Left = 240
TabIndex = 6
Top = 1080
Width = 2055
End
Begin VB.OptionButton Opt_save
BackColor = &H00000000&
Caption = "Slot 3 "
ForeColor = &H00FFFFFF&
Height = 255
Index = 2
Left = 240
TabIndex = 7
Top = 1440
Width = 2055
End
Begin VB.OptionButton Opt_save
BackColor = &H00000000&
Caption = "Slot 4"
ForeColor = &H00FFFFFF&
Height = 255
Index = 3
Left = 240
TabIndex = 8
Top = 1800
Width = 2055
End
Begin VB.OptionButton Opt_save
BackColor = &H00000000&
Caption = "Slot 5"
ForeColor = &H00FFFFFF&
Height = 255
Index = 4
Left = 240
TabIndex = 9
Top = 2160
Width = 2055
End
Begin VB.Label label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Select a Save game slot"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 2655
Left = 2640
TabIndex = 0
Top = 600
Width = 3855
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Save or Load the game"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Left = 120
TabIndex = 4
Top = 120
Width = 2895
End
End
Attribute VB_Name = "frm_load"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sslot(0 To 4) As savegame
Dim savenum As Integer
Private Sub com_save_Click()
'Dim suggestTxt As String
Dim i As Integer, egDescription As String
If save.episode = "" Or save.mission = 0 Then MsgBox "No game to save!": Exit Sub
' If sslot(savenum).text <> "" Then
' suggestTxt = sslot(savenum).text
' Else
' suggestTxt = Str$(Date)
' End If
If savenum < 0 Then MsgBox "Choose a save slot!": Exit Sub
If sslot(savenum).text <> "EMPTY" And sslot(savenum).text <> "" Then egDescription = sslot(savenum).text Else egDescription = "Save Description"
savetext = InputBox("Enter save description", "Save game", egDescription)
If savetext = "" Then
MsgBox "Game has not been saved"
Exit Sub
End If
Opt_save(savenum).Caption = Mid$(savetext, 1, 18)
sslot(savenum).episode = save.episode
sslot(savenum).mission = save.mission
sslot(savenum).text = savetext
sslot(savenum).x = save.x
sslot(savenum).y = save.y
sslot(savenum).face = save.face
sslot(savenum).health = save.health
'this all isn't implimented
''''''''''''''
' cGun, gunMod, material
For a = 0 To 1
sslot(savenum).cGun(a) = save.cGun(a)
Next a
For a = 0 To wepTop
For b = 0 To upgTop
sslot(savenum).gunMod(a, b) = save.gunMod(a, b)
Next b, a
sslot(savenum).material = save.material
'''''''''''''''''''''''''''''''
'flags
For a = 0 To flagTop
sslot(savenum).flag(a) = save.flag(a)
Next a
Open App.path & "\saves.tds" For Output As #1
For i = 0 To 4
Print #1, sslot(i).episode
Print #1, sslot(i).mission
Print #1, sslot(i).text
Print #1, sslot(i).x
Print #1, sslot(i).y
Print #1, sslot(i).face
Print #1, sslot(i).health
' cGun, gunMod, material
For a = 0 To 1
Print #1, sslot(i).cGun(a)
Next a
For a = 0 To wepTop
For b = 0 To upgTop
Print #1, sslot(i).gunMod(a, b)
Next b, a
Print #1, sslot(i).material
'flags
For a = 0 To UBound(sslot(i).flag) ' 29
Print #1, sslot(i).flag(a)
Next a
'misTxts
For a = 0 To UBound(sslot(i).misTxt) ' 19
Print #1, sslot(i).misTxt(a)
Next a
Next
Close #1
Label1.Caption = "Episode: " + sslot(savenum).episode + Chr$(10) + "Mission: " + Str$(sslot(savenum).mission) + Chr$(10) + Chr$(10) + sslot(savenum).text
End Sub
Private Sub Com_Load_Click()
If savenum < 0 Then Exit Sub
If sslot(savenum).episode <> "" Then
save.episode = sslot(savenum).episode
save.mission = sslot(savenum).mission
save.text = sslot(savenum).text
save.x = sslot(savenum).x
save.y = sslot(savenum).y
save.face = sslot(savenum).face
save.health = sslot(savenum).health
' cGun, gunMod, material
For a = 0 To 1
save.cGun(a) = sslot(savenum).cGun(a)
Next a
For a = 0 To wepTop
For b = 0 To upgTop
save.gunMod(a, b) = sslot(savenum).gunMod(a, b)
Next b, a
save.material = sslot(savenum).material
'flags
For a = 0 To UBound(sslot(savenum).flag) '29
save.flag(a) = sslot(savenum).flag(a)
Next a
'misTxts
For a = 0 To UBound(sslot(savenum).misTxt) '19
save.misTxt(a) = sslot(savenum).misTxt(a)
Next a
frm_menu.changetext 3
frm_menu.cmdContinue.Enabled = True
'misTxt
Open App.path & "\" & save.episode & ".tdm" For Input As #1
Do
If EOF(1) = True Then Exit Do
Input #1, tempVal
If Mid$(LCase$(tempVal), 1, 7) = "[notes]" Then
For a = 0 To UBound(misTxt)
Input #1, misTxt(a)
Next a
Exit Do
End If
Loop
Close #1
Unload Me
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim a As Integer, b As Integer
If dir(App.path & "\saves.tds") = "" Then Exit Sub
Open App.path & "\saves.tds" For Input As #1
For savenum = 0 To 4
Input #1, sslot(savenum).episode
Input #1, sslot(savenum).mission
Input #1, sslot(savenum).text
If sslot(savenum).text = "" Then Opt_save(savenum).Caption = "EMPTY" Else Opt_save(savenum).Caption = Mid$(sslot(savenum).text, 1, 18)
Input #1, sslot(savenum).x
Input #1, sslot(savenum).y
Input #1, sslot(savenum).face
Input #1, sslot(savenum).health
' cGun, gunMod, material
For a = 0 To 1
Input #1, sslot(savenum).cGun(a)
Next a
For a = 0 To wepTop
For b = 0 To upgTop
Input #1, sslot(savenum).gunMod(a, b)
Next b, a
Input #1, sslot(savenum).material
'flags
For a = 0 To UBound(sslot(savenum).flag) '29
Input #1, sslot(savenum).flag(a)
Next a
'mission texts
For a = 0 To UBound(sslot(savenum).misTxt) '19
Input #1, sslot(savenum).misTxt(a)
Next a
Next
Close #1
savenum = -1
End Sub
Private Sub Opt_save_Click(Index As Integer)
savenum = Index
Label1.Caption = "Episode: " + sslot(Index).episode + Chr$(10) + "Mission: " + Str$(sslot(Index).mission) + Chr$(10) + Chr$(10)
If sslot(Index).text = "" Then Label1.Caption = Label1.Caption + "EMPTY" Else Label1.Caption = Label1.Caption + sslot(Index).text
End Sub