warcraft-3-w3ts-utils 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.lua +13 -0
- package/dist/lua_modules/w3ts/globals/index.lua +23 -0
- package/dist/lua_modules/w3ts/globals/order.lua +2 -0
- package/dist/lua_modules/w3ts/handles/camera.lua +348 -0
- package/dist/lua_modules/w3ts/handles/destructable.lua +237 -0
- package/dist/lua_modules/w3ts/handles/dialog.lua +161 -0
- package/dist/lua_modules/w3ts/handles/effect.lua +198 -0
- package/dist/lua_modules/w3ts/handles/fogmodifier.lua +76 -0
- package/dist/lua_modules/w3ts/handles/force.lua +105 -0
- package/dist/lua_modules/w3ts/handles/frame.lua +417 -0
- package/dist/lua_modules/w3ts/handles/gamecache.lua +132 -0
- package/dist/lua_modules/w3ts/handles/group.lua +215 -0
- package/dist/lua_modules/w3ts/handles/handle.lua +38 -0
- package/dist/lua_modules/w3ts/handles/image.lua +105 -0
- package/dist/lua_modules/w3ts/handles/index.lua +226 -0
- package/dist/lua_modules/w3ts/handles/item.lua +375 -0
- package/dist/lua_modules/w3ts/handles/leaderboard.lua +211 -0
- package/dist/lua_modules/w3ts/handles/multiboard.lua +193 -0
- package/dist/lua_modules/w3ts/handles/player.lua +311 -0
- package/dist/lua_modules/w3ts/handles/point.lua +80 -0
- package/dist/lua_modules/w3ts/handles/quest.lua +176 -0
- package/dist/lua_modules/w3ts/handles/rect.lua +129 -0
- package/dist/lua_modules/w3ts/handles/region.lua +72 -0
- package/dist/lua_modules/w3ts/handles/sound.lua +174 -0
- package/dist/lua_modules/w3ts/handles/texttag.lua +97 -0
- package/dist/lua_modules/w3ts/handles/timer.lua +83 -0
- package/dist/lua_modules/w3ts/handles/timerdialog.lua +86 -0
- package/dist/lua_modules/w3ts/handles/trigger.lua +265 -0
- package/dist/lua_modules/w3ts/handles/ubersplat.lua +84 -0
- package/dist/lua_modules/w3ts/handles/unit.lua +1330 -0
- package/dist/lua_modules/w3ts/handles/weathereffect.lua +42 -0
- package/dist/lua_modules/w3ts/handles/widget.lua +53 -0
- package/dist/lua_modules/w3ts/hooks/index.lua +52 -0
- package/dist/lua_modules/w3ts/index.lua +36 -0
- package/dist/lua_modules/w3ts/system/base64.lua +108 -0
- package/dist/lua_modules/w3ts/system/binaryreader.lua +74 -0
- package/dist/lua_modules/w3ts/system/binarywriter.lua +88 -0
- package/dist/lua_modules/w3ts/system/file.lua +88 -0
- package/dist/lua_modules/w3ts/system/gametime.lua +27 -0
- package/dist/lua_modules/w3ts/system/host.lua +104 -0
- package/dist/lua_modules/w3ts/system/index.lua +58 -0
- package/dist/lua_modules/w3ts/system/sync.lua +239 -0
- package/dist/lua_modules/w3ts/utils/color.lua +189 -0
- package/dist/lua_modules/w3ts/utils/index.lua +38 -0
- package/dist/lualib_bundle.lua +2733 -0
- package/dist/package.json +41 -0
- package/dist/utils/abilities.lua +107 -0
- package/dist/utils/camera.lua +46 -0
- package/dist/utils/chat-command.lua +30 -0
- package/dist/utils/color.lua +41 -0
- package/dist/utils/index.lua +125 -0
- package/dist/utils/item.lua +173 -0
- package/dist/utils/math.lua +17 -0
- package/dist/utils/minimapIcons.lua +28 -0
- package/dist/utils/misc.lua +143 -0
- package/dist/utils/physics.lua +161 -0
- package/dist/utils/players.lua +234 -0
- package/dist/utils/point.lua +60 -0
- package/dist/utils/quests.lua +47 -0
- package/dist/utils/textTag.lua +110 -0
- package/dist/utils/timer.lua +21 -0
- package/dist/utils/units.lua +102 -0
- package/package.json +4 -6
- package/dist/index.js +0 -18
- package/dist/utils/abilities.js +0 -125
- package/dist/utils/camera.js +0 -37
- package/dist/utils/chat-command.js +0 -22
- package/dist/utils/color.js +0 -141
- package/dist/utils/index.js +0 -32
- package/dist/utils/item.js +0 -124
- package/dist/utils/math.js +0 -17
- package/dist/utils/minimapIcons.js +0 -27
- package/dist/utils/misc.js +0 -175
- package/dist/utils/physics.js +0 -194
- package/dist/utils/players.js +0 -189
- package/dist/utils/point.js +0 -74
- package/dist/utils/quests.js +0 -30
- package/dist/utils/textTag.js +0 -72
- package/dist/utils/timer.js +0 -16
- package/dist/utils/units.js +0 -81
- package/tsconfig.json +0 -37
package/dist/index.lua
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
do
|
|
4
|
+
local ____export = require("utils.index")
|
|
5
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
6
|
+
if ____exportKey ~= "default" then
|
|
7
|
+
____exports[____exportKey] = ____exportValue
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
return ____exports
|
|
12
|
+
|
|
13
|
+
--# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7dUJBQWMiLCJmaWxlIjoiaW5kZXgubHVhIiwic291cmNlUm9vdCI6IiJ9
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____player = require("lua_modules.w3ts.handles.player")
|
|
3
|
+
local MapPlayer = ____player.MapPlayer
|
|
4
|
+
do
|
|
5
|
+
local ____export = require("lua_modules.w3ts.globals.order")
|
|
6
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
7
|
+
if ____exportKey ~= "default" then
|
|
8
|
+
____exports[____exportKey] = ____exportValue
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
____exports.Players = {}
|
|
13
|
+
do
|
|
14
|
+
local i = 0
|
|
15
|
+
while i < bj_MAX_PLAYER_SLOTS do
|
|
16
|
+
local pl = MapPlayer:fromHandle(Player(i))
|
|
17
|
+
if pl then
|
|
18
|
+
____exports.Players[i + 1] = pl
|
|
19
|
+
end
|
|
20
|
+
i = i + 1
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
return ____exports
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
4
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
5
|
+
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
6
|
+
local __TS__ObjectAssign = ____lualib.__TS__ObjectAssign
|
|
7
|
+
local ____exports = {}
|
|
8
|
+
local ____handle = require("lua_modules.w3ts.handles.handle")
|
|
9
|
+
local Handle = ____handle.Handle
|
|
10
|
+
local ____point = require("lua_modules.w3ts.handles.point")
|
|
11
|
+
local Point = ____point.Point
|
|
12
|
+
____exports.Camera = __TS__Class()
|
|
13
|
+
local Camera = ____exports.Camera
|
|
14
|
+
Camera.name = "Camera"
|
|
15
|
+
function Camera.prototype.____constructor(self)
|
|
16
|
+
end
|
|
17
|
+
__TS__ObjectDefineProperty(
|
|
18
|
+
Camera,
|
|
19
|
+
"visible",
|
|
20
|
+
{
|
|
21
|
+
get = function(self)
|
|
22
|
+
return IsCineFilterDisplayed()
|
|
23
|
+
end,
|
|
24
|
+
set = function(self, flag)
|
|
25
|
+
DisplayCineFilter(flag)
|
|
26
|
+
end
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
__TS__ObjectDefineProperty(
|
|
30
|
+
Camera,
|
|
31
|
+
"boundMinX",
|
|
32
|
+
{get = function(self)
|
|
33
|
+
return GetCameraBoundMinX()
|
|
34
|
+
end}
|
|
35
|
+
)
|
|
36
|
+
__TS__ObjectDefineProperty(
|
|
37
|
+
Camera,
|
|
38
|
+
"boundMinY",
|
|
39
|
+
{get = function(self)
|
|
40
|
+
return GetCameraBoundMinY()
|
|
41
|
+
end}
|
|
42
|
+
)
|
|
43
|
+
__TS__ObjectDefineProperty(
|
|
44
|
+
Camera,
|
|
45
|
+
"boundMaxX",
|
|
46
|
+
{get = function(self)
|
|
47
|
+
return GetCameraBoundMaxX()
|
|
48
|
+
end}
|
|
49
|
+
)
|
|
50
|
+
__TS__ObjectDefineProperty(
|
|
51
|
+
Camera,
|
|
52
|
+
"boundMaxY",
|
|
53
|
+
{get = function(self)
|
|
54
|
+
return GetCameraBoundMaxY()
|
|
55
|
+
end}
|
|
56
|
+
)
|
|
57
|
+
__TS__ObjectDefineProperty(
|
|
58
|
+
Camera,
|
|
59
|
+
"targetX",
|
|
60
|
+
{get = function(self)
|
|
61
|
+
return GetCameraTargetPositionX()
|
|
62
|
+
end}
|
|
63
|
+
)
|
|
64
|
+
__TS__ObjectDefineProperty(
|
|
65
|
+
Camera,
|
|
66
|
+
"targetY",
|
|
67
|
+
{get = function(self)
|
|
68
|
+
return GetCameraTargetPositionY()
|
|
69
|
+
end}
|
|
70
|
+
)
|
|
71
|
+
__TS__ObjectDefineProperty(
|
|
72
|
+
Camera,
|
|
73
|
+
"targetZ",
|
|
74
|
+
{get = function(self)
|
|
75
|
+
return GetCameraTargetPositionZ()
|
|
76
|
+
end}
|
|
77
|
+
)
|
|
78
|
+
__TS__ObjectDefineProperty(
|
|
79
|
+
Camera,
|
|
80
|
+
"eyeX",
|
|
81
|
+
{get = function(self)
|
|
82
|
+
return GetCameraEyePositionX()
|
|
83
|
+
end}
|
|
84
|
+
)
|
|
85
|
+
__TS__ObjectDefineProperty(
|
|
86
|
+
Camera,
|
|
87
|
+
"eyeY",
|
|
88
|
+
{get = function(self)
|
|
89
|
+
return GetCameraEyePositionY()
|
|
90
|
+
end}
|
|
91
|
+
)
|
|
92
|
+
__TS__ObjectDefineProperty(
|
|
93
|
+
Camera,
|
|
94
|
+
"eyeZ",
|
|
95
|
+
{get = function(self)
|
|
96
|
+
return GetCameraEyePositionZ()
|
|
97
|
+
end}
|
|
98
|
+
)
|
|
99
|
+
__TS__ObjectDefineProperty(
|
|
100
|
+
Camera,
|
|
101
|
+
"eyePoint",
|
|
102
|
+
{get = function(self)
|
|
103
|
+
return Point:fromHandle(GetCameraEyePositionLoc())
|
|
104
|
+
end}
|
|
105
|
+
)
|
|
106
|
+
__TS__ObjectDefineProperty(
|
|
107
|
+
Camera,
|
|
108
|
+
"targetPoint",
|
|
109
|
+
{get = function(self)
|
|
110
|
+
return Point:fromHandle(GetCameraTargetPositionLoc())
|
|
111
|
+
end}
|
|
112
|
+
)
|
|
113
|
+
function Camera.adjustField(self, whichField, offset, duration)
|
|
114
|
+
AdjustCameraField(whichField, offset, duration)
|
|
115
|
+
end
|
|
116
|
+
function Camera.endCinematicScene(self)
|
|
117
|
+
EndCinematicScene()
|
|
118
|
+
end
|
|
119
|
+
function Camera.forceCinematicSubtitles(self, flag)
|
|
120
|
+
ForceCinematicSubtitles(flag)
|
|
121
|
+
end
|
|
122
|
+
function Camera.getField(self, field)
|
|
123
|
+
return GetCameraField(field)
|
|
124
|
+
end
|
|
125
|
+
function Camera.getMargin(self, whichMargin)
|
|
126
|
+
return GetCameraMargin(whichMargin)
|
|
127
|
+
end
|
|
128
|
+
function Camera.pan(self, x, y, zOffsetDest)
|
|
129
|
+
if zOffsetDest == nil then
|
|
130
|
+
PanCameraTo(x, y)
|
|
131
|
+
else
|
|
132
|
+
PanCameraToWithZ(x, y, zOffsetDest)
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
function Camera.panTimed(self, x, y, duration, zOffsetDest)
|
|
136
|
+
if zOffsetDest == nil then
|
|
137
|
+
PanCameraToTimed(x, y, duration)
|
|
138
|
+
else
|
|
139
|
+
PanCameraToTimedWithZ(x, y, zOffsetDest, duration)
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
function Camera.reset(self, duration)
|
|
143
|
+
ResetToGameCamera(duration)
|
|
144
|
+
end
|
|
145
|
+
function Camera.setBounds(self, x1, y1, x2, y2, x3, y3, x4, y4)
|
|
146
|
+
SetCameraBounds(
|
|
147
|
+
x1,
|
|
148
|
+
y1,
|
|
149
|
+
x2,
|
|
150
|
+
y2,
|
|
151
|
+
x3,
|
|
152
|
+
y3,
|
|
153
|
+
x4,
|
|
154
|
+
y4
|
|
155
|
+
)
|
|
156
|
+
end
|
|
157
|
+
function Camera.setCameraOrientController(self, whichUnit, xOffset, yOffset)
|
|
158
|
+
SetCameraOrientController(whichUnit, xOffset, yOffset)
|
|
159
|
+
end
|
|
160
|
+
function Camera.setCineFilterBlendMode(self, whichMode)
|
|
161
|
+
SetCineFilterBlendMode(whichMode)
|
|
162
|
+
end
|
|
163
|
+
function Camera.setCineFilterDuration(self, duration)
|
|
164
|
+
SetCineFilterDuration(duration)
|
|
165
|
+
end
|
|
166
|
+
function Camera.setCineFilterEndColor(self, red, green, blue, alpha)
|
|
167
|
+
SetCineFilterEndColor(red, green, blue, alpha)
|
|
168
|
+
end
|
|
169
|
+
function Camera.setCineFilterEndUV(self, minU, minV, maxU, maxV)
|
|
170
|
+
SetCineFilterEndUV(minU, minV, maxU, maxV)
|
|
171
|
+
end
|
|
172
|
+
function Camera.setCineFilterStartColor(self, red, green, blue, alpha)
|
|
173
|
+
SetCineFilterStartColor(red, green, blue, alpha)
|
|
174
|
+
end
|
|
175
|
+
function Camera.setCineFilterStartUV(self, minU, minV, maxU, maxV)
|
|
176
|
+
SetCineFilterStartUV(minU, minV, maxU, maxV)
|
|
177
|
+
end
|
|
178
|
+
function Camera.setCineFilterTexMapFlags(self, whichFlags)
|
|
179
|
+
SetCineFilterTexMapFlags(whichFlags)
|
|
180
|
+
end
|
|
181
|
+
function Camera.setCineFilterTexture(self, fileName)
|
|
182
|
+
SetCineFilterTexture(fileName)
|
|
183
|
+
end
|
|
184
|
+
function Camera.setCinematicAudio(self, cinematicAudio)
|
|
185
|
+
SetCinematicAudio(cinematicAudio)
|
|
186
|
+
end
|
|
187
|
+
function Camera.setCinematicCamera(self, cameraModelFile)
|
|
188
|
+
SetCinematicCamera(cameraModelFile)
|
|
189
|
+
end
|
|
190
|
+
function Camera.SetCinematicScene(self, portraitUnitId, color, speakerTitle, text, sceneDuration, voiceoverDuration)
|
|
191
|
+
SetCinematicScene(
|
|
192
|
+
portraitUnitId,
|
|
193
|
+
color,
|
|
194
|
+
speakerTitle,
|
|
195
|
+
text,
|
|
196
|
+
sceneDuration,
|
|
197
|
+
voiceoverDuration
|
|
198
|
+
)
|
|
199
|
+
end
|
|
200
|
+
function Camera.setDepthOfFieldScale(self, scale)
|
|
201
|
+
CameraSetDepthOfFieldScale(scale)
|
|
202
|
+
end
|
|
203
|
+
function Camera.setField(self, whichField, value, duration)
|
|
204
|
+
SetCameraField(whichField, value, duration)
|
|
205
|
+
end
|
|
206
|
+
function Camera.setFocalDistance(self, distance)
|
|
207
|
+
CameraSetFocalDistance(distance)
|
|
208
|
+
end
|
|
209
|
+
function Camera.setPos(self, x, y)
|
|
210
|
+
SetCameraPosition(x, y)
|
|
211
|
+
end
|
|
212
|
+
function Camera.setRotateMode(self, x, y, radiansToSweep, duration)
|
|
213
|
+
SetCameraRotateMode(x, y, radiansToSweep, duration)
|
|
214
|
+
end
|
|
215
|
+
function Camera.setSmoothingFactor(self, factor)
|
|
216
|
+
CameraSetSmoothingFactor(factor)
|
|
217
|
+
end
|
|
218
|
+
function Camera.setSourceNoise(self, mag, velocity, vertOnly)
|
|
219
|
+
if vertOnly == nil then
|
|
220
|
+
vertOnly = false
|
|
221
|
+
end
|
|
222
|
+
CameraSetSourceNoiseEx(mag, velocity, vertOnly)
|
|
223
|
+
end
|
|
224
|
+
function Camera.setTargetController(self, whichUnit, xOffset, yOffset, inheritOrientation)
|
|
225
|
+
SetCameraTargetController(whichUnit, xOffset, yOffset, inheritOrientation)
|
|
226
|
+
end
|
|
227
|
+
function Camera.setTargetNoise(self, mag, velocity, vertOnly)
|
|
228
|
+
if vertOnly == nil then
|
|
229
|
+
vertOnly = false
|
|
230
|
+
end
|
|
231
|
+
CameraSetTargetNoiseEx(mag, velocity, vertOnly)
|
|
232
|
+
end
|
|
233
|
+
function Camera.stop(self)
|
|
234
|
+
StopCamera()
|
|
235
|
+
end
|
|
236
|
+
____exports.CameraSetup = __TS__Class()
|
|
237
|
+
local CameraSetup = ____exports.CameraSetup
|
|
238
|
+
CameraSetup.name = "CameraSetup"
|
|
239
|
+
__TS__ClassExtends(CameraSetup, Handle)
|
|
240
|
+
function CameraSetup.prototype.____constructor(self)
|
|
241
|
+
if Handle:initFromHandle() then
|
|
242
|
+
Handle.prototype.____constructor(self)
|
|
243
|
+
return
|
|
244
|
+
end
|
|
245
|
+
local handle = CreateCameraSetup()
|
|
246
|
+
if handle == nil then
|
|
247
|
+
error("w3ts failed to create camerasetup handle.", 3)
|
|
248
|
+
end
|
|
249
|
+
Handle.prototype.____constructor(self, handle)
|
|
250
|
+
end
|
|
251
|
+
__TS__SetDescriptor(
|
|
252
|
+
CameraSetup.prototype,
|
|
253
|
+
"destPoint",
|
|
254
|
+
{get = function(self)
|
|
255
|
+
return Point:fromHandle(CameraSetupGetDestPositionLoc(self.handle))
|
|
256
|
+
end},
|
|
257
|
+
true
|
|
258
|
+
)
|
|
259
|
+
__TS__SetDescriptor(
|
|
260
|
+
CameraSetup.prototype,
|
|
261
|
+
"destX",
|
|
262
|
+
{
|
|
263
|
+
get = function(self)
|
|
264
|
+
return CameraSetupGetDestPositionX(self.handle)
|
|
265
|
+
end,
|
|
266
|
+
set = function(self, x)
|
|
267
|
+
CameraSetupSetDestPosition(self.handle, x, self.destY, 0)
|
|
268
|
+
end
|
|
269
|
+
},
|
|
270
|
+
true
|
|
271
|
+
)
|
|
272
|
+
__TS__SetDescriptor(
|
|
273
|
+
CameraSetup.prototype,
|
|
274
|
+
"destY",
|
|
275
|
+
{
|
|
276
|
+
get = function(self)
|
|
277
|
+
return CameraSetupGetDestPositionY(self.handle)
|
|
278
|
+
end,
|
|
279
|
+
set = function(self, y)
|
|
280
|
+
CameraSetupSetDestPosition(self.handle, self.destX, y, 0)
|
|
281
|
+
end
|
|
282
|
+
},
|
|
283
|
+
true
|
|
284
|
+
)
|
|
285
|
+
__TS__SetDescriptor(
|
|
286
|
+
CameraSetup.prototype,
|
|
287
|
+
"label",
|
|
288
|
+
{
|
|
289
|
+
get = function(self)
|
|
290
|
+
return BlzCameraSetupGetLabel(self.handle) or ""
|
|
291
|
+
end,
|
|
292
|
+
set = function(self, label)
|
|
293
|
+
BlzCameraSetupSetLabel(self.handle, label)
|
|
294
|
+
end
|
|
295
|
+
},
|
|
296
|
+
true
|
|
297
|
+
)
|
|
298
|
+
function CameraSetup.create(self)
|
|
299
|
+
local handle = CreateCameraSetup()
|
|
300
|
+
if handle then
|
|
301
|
+
local obj = self:getObject(handle)
|
|
302
|
+
local values = {}
|
|
303
|
+
values.handle = handle
|
|
304
|
+
return __TS__ObjectAssign(obj, values)
|
|
305
|
+
end
|
|
306
|
+
return nil
|
|
307
|
+
end
|
|
308
|
+
function CameraSetup.prototype.apply(self, doPan, panTimed)
|
|
309
|
+
CameraSetupApply(self.handle, doPan, panTimed)
|
|
310
|
+
end
|
|
311
|
+
function CameraSetup.prototype.applyForceDuration(self, doPan, forceDuration)
|
|
312
|
+
CameraSetupApplyForceDuration(self.handle, doPan, forceDuration)
|
|
313
|
+
end
|
|
314
|
+
function CameraSetup.prototype.applyForceDurationSmooth(self, doPan, forcedDuration, easeInDuration, easeOutDuration, smoothFactor)
|
|
315
|
+
BlzCameraSetupApplyForceDurationSmooth(
|
|
316
|
+
self.handle,
|
|
317
|
+
doPan,
|
|
318
|
+
forcedDuration,
|
|
319
|
+
easeInDuration,
|
|
320
|
+
easeOutDuration,
|
|
321
|
+
smoothFactor
|
|
322
|
+
)
|
|
323
|
+
end
|
|
324
|
+
function CameraSetup.prototype.applyForceDurationZ(self, zDestOffset, forceDuration)
|
|
325
|
+
CameraSetupApplyForceDurationWithZ(self.handle, zDestOffset, forceDuration)
|
|
326
|
+
end
|
|
327
|
+
function CameraSetup.prototype.applyZ(self, zDestOffset)
|
|
328
|
+
CameraSetupApplyWithZ(self.handle, zDestOffset)
|
|
329
|
+
end
|
|
330
|
+
function CameraSetup.prototype.getField(self, whichField)
|
|
331
|
+
return CameraSetupGetField(self.handle, whichField)
|
|
332
|
+
end
|
|
333
|
+
function CameraSetup.prototype.setDestPos(self, x, y, duration)
|
|
334
|
+
CameraSetupSetDestPosition(self.handle, x, y, duration)
|
|
335
|
+
end
|
|
336
|
+
function CameraSetup.prototype.setField(self, whichField, value, duration)
|
|
337
|
+
CameraSetupSetField(self.handle, whichField, value, duration)
|
|
338
|
+
end
|
|
339
|
+
function CameraSetup.fromHandle(self, handle)
|
|
340
|
+
local ____handle_0
|
|
341
|
+
if handle then
|
|
342
|
+
____handle_0 = self:getObject(handle)
|
|
343
|
+
else
|
|
344
|
+
____handle_0 = nil
|
|
345
|
+
end
|
|
346
|
+
return ____handle_0
|
|
347
|
+
end
|
|
348
|
+
return ____exports
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
|
+
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
5
|
+
local __TS__ObjectAssign = ____lualib.__TS__ObjectAssign
|
|
6
|
+
local ____exports = {}
|
|
7
|
+
local ____handle = require("lua_modules.w3ts.handles.handle")
|
|
8
|
+
local Handle = ____handle.Handle
|
|
9
|
+
local ____widget = require("lua_modules.w3ts.handles.widget")
|
|
10
|
+
local Widget = ____widget.Widget
|
|
11
|
+
____exports.Destructable = __TS__Class()
|
|
12
|
+
local Destructable = ____exports.Destructable
|
|
13
|
+
Destructable.name = "Destructable"
|
|
14
|
+
__TS__ClassExtends(Destructable, Widget)
|
|
15
|
+
function Destructable.prototype.____constructor(self, objectId, x, y, z, face, scale, variation)
|
|
16
|
+
if Handle:initFromHandle() then
|
|
17
|
+
Widget.prototype.____constructor(self)
|
|
18
|
+
return
|
|
19
|
+
end
|
|
20
|
+
local handle = CreateDestructableZ(
|
|
21
|
+
objectId,
|
|
22
|
+
x,
|
|
23
|
+
y,
|
|
24
|
+
z,
|
|
25
|
+
face,
|
|
26
|
+
scale,
|
|
27
|
+
variation
|
|
28
|
+
)
|
|
29
|
+
if handle == nil then
|
|
30
|
+
error("w3ts failed to create destructable handle.", 3)
|
|
31
|
+
end
|
|
32
|
+
Widget.prototype.____constructor(self, handle)
|
|
33
|
+
end
|
|
34
|
+
__TS__SetDescriptor(
|
|
35
|
+
Destructable.prototype,
|
|
36
|
+
"invulnerable",
|
|
37
|
+
{
|
|
38
|
+
get = function(self)
|
|
39
|
+
return IsDestructableInvulnerable(self.handle)
|
|
40
|
+
end,
|
|
41
|
+
set = function(self, flag)
|
|
42
|
+
SetDestructableInvulnerable(self.handle, flag)
|
|
43
|
+
end
|
|
44
|
+
},
|
|
45
|
+
true
|
|
46
|
+
)
|
|
47
|
+
__TS__SetDescriptor(
|
|
48
|
+
Destructable.prototype,
|
|
49
|
+
"life",
|
|
50
|
+
{
|
|
51
|
+
get = function(self)
|
|
52
|
+
return GetDestructableLife(self.handle)
|
|
53
|
+
end,
|
|
54
|
+
set = function(self, value)
|
|
55
|
+
SetDestructableLife(self.handle, value)
|
|
56
|
+
end
|
|
57
|
+
},
|
|
58
|
+
true
|
|
59
|
+
)
|
|
60
|
+
__TS__SetDescriptor(
|
|
61
|
+
Destructable.prototype,
|
|
62
|
+
"maxLife",
|
|
63
|
+
{
|
|
64
|
+
get = function(self)
|
|
65
|
+
return GetDestructableMaxLife(self.handle)
|
|
66
|
+
end,
|
|
67
|
+
set = function(self, value)
|
|
68
|
+
SetDestructableMaxLife(self.handle, value)
|
|
69
|
+
end
|
|
70
|
+
},
|
|
71
|
+
true
|
|
72
|
+
)
|
|
73
|
+
__TS__SetDescriptor(
|
|
74
|
+
Destructable.prototype,
|
|
75
|
+
"name",
|
|
76
|
+
{get = function(self)
|
|
77
|
+
return GetDestructableName(self.handle)
|
|
78
|
+
end},
|
|
79
|
+
true
|
|
80
|
+
)
|
|
81
|
+
__TS__SetDescriptor(
|
|
82
|
+
Destructable.prototype,
|
|
83
|
+
"occluderHeight",
|
|
84
|
+
{
|
|
85
|
+
get = function(self)
|
|
86
|
+
return GetDestructableOccluderHeight(self.handle)
|
|
87
|
+
end,
|
|
88
|
+
set = function(self, value)
|
|
89
|
+
SetDestructableOccluderHeight(self.handle, value)
|
|
90
|
+
end
|
|
91
|
+
},
|
|
92
|
+
true
|
|
93
|
+
)
|
|
94
|
+
__TS__SetDescriptor(
|
|
95
|
+
Destructable.prototype,
|
|
96
|
+
"typeId",
|
|
97
|
+
{get = function(self)
|
|
98
|
+
return GetDestructableTypeId(self.handle)
|
|
99
|
+
end},
|
|
100
|
+
true
|
|
101
|
+
)
|
|
102
|
+
__TS__SetDescriptor(
|
|
103
|
+
Destructable.prototype,
|
|
104
|
+
"x",
|
|
105
|
+
{get = function(self)
|
|
106
|
+
return GetDestructableX(self.handle)
|
|
107
|
+
end},
|
|
108
|
+
true
|
|
109
|
+
)
|
|
110
|
+
__TS__SetDescriptor(
|
|
111
|
+
Destructable.prototype,
|
|
112
|
+
"y",
|
|
113
|
+
{get = function(self)
|
|
114
|
+
return GetDestructableY(self.handle)
|
|
115
|
+
end},
|
|
116
|
+
true
|
|
117
|
+
)
|
|
118
|
+
function Destructable.create(self, objectId, x, y, face, scale, variation, skinId)
|
|
119
|
+
if face == nil then
|
|
120
|
+
face = 0
|
|
121
|
+
end
|
|
122
|
+
if scale == nil then
|
|
123
|
+
scale = 1
|
|
124
|
+
end
|
|
125
|
+
if variation == nil then
|
|
126
|
+
variation = 0
|
|
127
|
+
end
|
|
128
|
+
local handle
|
|
129
|
+
if skinId ~= nil then
|
|
130
|
+
handle = BlzCreateDestructableWithSkin(
|
|
131
|
+
objectId,
|
|
132
|
+
x,
|
|
133
|
+
y,
|
|
134
|
+
face,
|
|
135
|
+
scale,
|
|
136
|
+
variation,
|
|
137
|
+
skinId
|
|
138
|
+
)
|
|
139
|
+
else
|
|
140
|
+
handle = CreateDestructable(
|
|
141
|
+
objectId,
|
|
142
|
+
x,
|
|
143
|
+
y,
|
|
144
|
+
face,
|
|
145
|
+
scale,
|
|
146
|
+
variation
|
|
147
|
+
)
|
|
148
|
+
end
|
|
149
|
+
if handle then
|
|
150
|
+
local obj = self:getObject(handle)
|
|
151
|
+
local values = {}
|
|
152
|
+
values.handle = handle
|
|
153
|
+
if skinId ~= nil then
|
|
154
|
+
values.skin = skinId
|
|
155
|
+
end
|
|
156
|
+
return __TS__ObjectAssign(obj, values)
|
|
157
|
+
end
|
|
158
|
+
return nil
|
|
159
|
+
end
|
|
160
|
+
function Destructable.createZ(self, objectId, x, y, z, face, scale, variation, skinId)
|
|
161
|
+
if face == nil then
|
|
162
|
+
face = 0
|
|
163
|
+
end
|
|
164
|
+
if scale == nil then
|
|
165
|
+
scale = 1
|
|
166
|
+
end
|
|
167
|
+
if variation == nil then
|
|
168
|
+
variation = 0
|
|
169
|
+
end
|
|
170
|
+
local handle
|
|
171
|
+
if skinId ~= nil then
|
|
172
|
+
handle = BlzCreateDestructableZWithSkin(
|
|
173
|
+
objectId,
|
|
174
|
+
x,
|
|
175
|
+
y,
|
|
176
|
+
z,
|
|
177
|
+
face,
|
|
178
|
+
scale,
|
|
179
|
+
variation,
|
|
180
|
+
skinId
|
|
181
|
+
)
|
|
182
|
+
else
|
|
183
|
+
handle = CreateDestructableZ(
|
|
184
|
+
objectId,
|
|
185
|
+
x,
|
|
186
|
+
y,
|
|
187
|
+
z,
|
|
188
|
+
face,
|
|
189
|
+
scale,
|
|
190
|
+
variation
|
|
191
|
+
)
|
|
192
|
+
end
|
|
193
|
+
if handle then
|
|
194
|
+
local obj = self:getObject(handle)
|
|
195
|
+
local values = {}
|
|
196
|
+
values.handle = handle
|
|
197
|
+
if skinId ~= nil then
|
|
198
|
+
values.skin = skinId
|
|
199
|
+
end
|
|
200
|
+
return __TS__ObjectAssign(obj, values)
|
|
201
|
+
end
|
|
202
|
+
return nil
|
|
203
|
+
end
|
|
204
|
+
function Destructable.prototype.destroy(self)
|
|
205
|
+
RemoveDestructable(self.handle)
|
|
206
|
+
end
|
|
207
|
+
function Destructable.prototype.heal(self, life, birth)
|
|
208
|
+
DestructableRestoreLife(self.handle, life, birth)
|
|
209
|
+
end
|
|
210
|
+
function Destructable.prototype.kill(self)
|
|
211
|
+
KillDestructable(self.handle)
|
|
212
|
+
end
|
|
213
|
+
function Destructable.prototype.queueAnim(self, whichAnimation)
|
|
214
|
+
QueueDestructableAnimation(self.handle, whichAnimation)
|
|
215
|
+
end
|
|
216
|
+
function Destructable.prototype.setAnim(self, whichAnimation)
|
|
217
|
+
SetDestructableAnimation(self.handle, whichAnimation)
|
|
218
|
+
end
|
|
219
|
+
function Destructable.prototype.setAnimSpeed(self, speedFactor)
|
|
220
|
+
SetDestructableAnimationSpeed(self.handle, speedFactor)
|
|
221
|
+
end
|
|
222
|
+
function Destructable.prototype.show(self, flag)
|
|
223
|
+
ShowDestructable(self.handle, flag)
|
|
224
|
+
end
|
|
225
|
+
function Destructable.fromEvent(self)
|
|
226
|
+
return self:fromHandle(GetTriggerDestructable())
|
|
227
|
+
end
|
|
228
|
+
function Destructable.fromHandle(self, handle)
|
|
229
|
+
local ____handle_0
|
|
230
|
+
if handle then
|
|
231
|
+
____handle_0 = self:getObject(handle)
|
|
232
|
+
else
|
|
233
|
+
____handle_0 = nil
|
|
234
|
+
end
|
|
235
|
+
return ____handle_0
|
|
236
|
+
end
|
|
237
|
+
return ____exports
|