This repository was archived by the owner on Feb 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathfrmLevelWindow.frm
125 lines (113 loc) · 3.56 KB
/
frmLevelWindow.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
VERSION 5.00
Begin VB.Form frmLevelWindow
BackColor = &H00000000&
Caption = "Level Window"
ClientHeight = 9060
ClientLeft = 120
ClientTop = 405
ClientWidth = 12060
Icon = "frmLevelWindow.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 9060
ScaleWidth = 12060
Begin VB.PictureBox vScreen
BackColor = &H00000000&
Height = 9060
Index = 1
Left = 0
MouseIcon = "frmLevelWindow.frx":628A
MousePointer = 99 'Custom
ScaleHeight = 600
ScaleMode = 3 'Pixel
ScaleWidth = 800
TabIndex = 0
Top = 0
Width = 12059
End
End
Attribute VB_Name = "frmLevelWindow"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_KeyPress(KeyAscii As Integer)
Stop
End Sub
Private Sub Form_Load()
GFX.Split(1).Width = vScreen(1).Width
GFX.Split(1).Height = vScreen(1).Height
level(0).Height = 600
level(0).Width = 800
Me.Width = 12240
Me.Height = 9570
Do While vScreen(1).ScaleWidth > 800
Me.Width = Me.Width - 5
vScreen(1).Width = Me.ScaleWidth
DoEvents
Loop
Do While vScreen(1).ScaleHeight > 600
Me.Height = Me.Height - 5
vScreen(1).Height = Me.ScaleHeight
DoEvents
Loop
Do While vScreen(1).ScaleWidth < 800
Me.Width = Me.Width + 5
vScreen(1).Width = Me.ScaleWidth
DoEvents
Loop
Do While vScreen(1).ScaleHeight < 600
Me.Height = Me.Height + 5
vScreen(1).Height = Me.ScaleHeight
DoEvents
Loop
End Sub
Private Sub Form_LostFocus()
HideCursor
End Sub
Private Sub Form_Resize()
vScreen(1).Width = Me.ScaleWidth
vScreen(1).Height = Me.ScaleHeight
End Sub
Private Sub Form_Unload(Cancel As Integer)
Cancel = 1
End Sub
Private Sub vScreen_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF12 Then
TakeScreen = True
End If
End Sub
Private Sub vScreen_KeyPress(Index As Integer, KeyAscii As Integer)
CheatCode Chr(KeyAscii)
End Sub
Private Sub vScreen_LostFocus(Index As Integer)
HideCursor
End Sub
Private Sub vScreen_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
EditorControls.Mouse1 = True
ElseIf Button = 2 Then
If WorldEditor = True Then
frmLevelEditor.optCursor(14).Value = True
Else
frmLevelEditor.optCursor(13).Value = True
End If
frmLayers.lstLayer.ListIndex = 0
MouseMove X, Y
SetCursor
End If
End Sub
Private Sub vScreen_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
With EditorCursor
.X = Int(X * ScreenW / vScreen(Index).ScaleWidth)
.Y = Int(Y * ScreenH / vScreen(Index).ScaleHeight)
End With
MouseMove Int(X * ScreenW / vScreen(Index).ScaleWidth), Int(Y * ScreenH / vScreen(Index).ScaleHeight), True
MouseRelease = True
End Sub
Private Sub vScreen_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Index = 1 Then
EditorControls.Mouse1 = False
End If
End Sub