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
|
@@ -0,0 +1,375 @@
|
|
|
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 __TS__StringSubstr = ____lualib.__TS__StringSubstr
|
|
7
|
+
local ____exports = {}
|
|
8
|
+
local ____handle = require("lua_modules.w3ts.handles.handle")
|
|
9
|
+
local Handle = ____handle.Handle
|
|
10
|
+
local ____widget = require("lua_modules.w3ts.handles.widget")
|
|
11
|
+
local Widget = ____widget.Widget
|
|
12
|
+
____exports.Item = __TS__Class()
|
|
13
|
+
local Item = ____exports.Item
|
|
14
|
+
Item.name = "Item"
|
|
15
|
+
__TS__ClassExtends(Item, Widget)
|
|
16
|
+
function Item.prototype.____constructor(self, itemId, x, y, skinId)
|
|
17
|
+
if Handle:initFromHandle() then
|
|
18
|
+
Widget.prototype.____constructor(self)
|
|
19
|
+
return
|
|
20
|
+
end
|
|
21
|
+
local ____temp_0
|
|
22
|
+
if skinId == nil then
|
|
23
|
+
____temp_0 = CreateItem(itemId, x, y)
|
|
24
|
+
else
|
|
25
|
+
____temp_0 = BlzCreateItemWithSkin(itemId, x, y, skinId)
|
|
26
|
+
end
|
|
27
|
+
local handle = ____temp_0
|
|
28
|
+
if handle == nil then
|
|
29
|
+
error("w3ts failed to create item handle.", 3)
|
|
30
|
+
end
|
|
31
|
+
Widget.prototype.____constructor(self, handle)
|
|
32
|
+
end
|
|
33
|
+
__TS__SetDescriptor(
|
|
34
|
+
Item.prototype,
|
|
35
|
+
"charges",
|
|
36
|
+
{
|
|
37
|
+
get = function(self)
|
|
38
|
+
return GetItemCharges(self.handle)
|
|
39
|
+
end,
|
|
40
|
+
set = function(self, value)
|
|
41
|
+
SetItemCharges(self.handle, value)
|
|
42
|
+
end
|
|
43
|
+
},
|
|
44
|
+
true
|
|
45
|
+
)
|
|
46
|
+
__TS__SetDescriptor(
|
|
47
|
+
Item.prototype,
|
|
48
|
+
"invulnerable",
|
|
49
|
+
{
|
|
50
|
+
get = function(self)
|
|
51
|
+
return IsItemInvulnerable(self.handle)
|
|
52
|
+
end,
|
|
53
|
+
set = function(self, flag)
|
|
54
|
+
SetItemInvulnerable(self.handle, true)
|
|
55
|
+
end
|
|
56
|
+
},
|
|
57
|
+
true
|
|
58
|
+
)
|
|
59
|
+
__TS__SetDescriptor(
|
|
60
|
+
Item.prototype,
|
|
61
|
+
"level",
|
|
62
|
+
{get = function(self)
|
|
63
|
+
return GetItemLevel(self.handle)
|
|
64
|
+
end},
|
|
65
|
+
true
|
|
66
|
+
)
|
|
67
|
+
__TS__SetDescriptor(
|
|
68
|
+
Item.prototype,
|
|
69
|
+
"description",
|
|
70
|
+
{
|
|
71
|
+
get = function(self)
|
|
72
|
+
return BlzGetItemDescription(self.handle) or ""
|
|
73
|
+
end,
|
|
74
|
+
set = function(self, description)
|
|
75
|
+
BlzSetItemDescription(self.handle, description)
|
|
76
|
+
end
|
|
77
|
+
},
|
|
78
|
+
true
|
|
79
|
+
)
|
|
80
|
+
__TS__SetDescriptor(
|
|
81
|
+
Item.prototype,
|
|
82
|
+
"extendedTooltip",
|
|
83
|
+
{
|
|
84
|
+
get = function(self)
|
|
85
|
+
return BlzGetItemExtendedTooltip(self.handle) or ""
|
|
86
|
+
end,
|
|
87
|
+
set = function(self, tooltip)
|
|
88
|
+
BlzSetItemExtendedTooltip(self.handle, tooltip)
|
|
89
|
+
end
|
|
90
|
+
},
|
|
91
|
+
true
|
|
92
|
+
)
|
|
93
|
+
__TS__SetDescriptor(
|
|
94
|
+
Item.prototype,
|
|
95
|
+
"icon",
|
|
96
|
+
{
|
|
97
|
+
get = function(self)
|
|
98
|
+
return BlzGetItemIconPath(self.handle) or ""
|
|
99
|
+
end,
|
|
100
|
+
set = function(self, path)
|
|
101
|
+
BlzSetItemIconPath(self.handle, path)
|
|
102
|
+
end
|
|
103
|
+
},
|
|
104
|
+
true
|
|
105
|
+
)
|
|
106
|
+
__TS__SetDescriptor(
|
|
107
|
+
Item.prototype,
|
|
108
|
+
"name",
|
|
109
|
+
{
|
|
110
|
+
get = function(self)
|
|
111
|
+
return GetItemName(self.handle) or ""
|
|
112
|
+
end,
|
|
113
|
+
set = function(self, value)
|
|
114
|
+
BlzSetItemName(self.handle, value)
|
|
115
|
+
end
|
|
116
|
+
},
|
|
117
|
+
true
|
|
118
|
+
)
|
|
119
|
+
__TS__SetDescriptor(
|
|
120
|
+
Item.prototype,
|
|
121
|
+
"tooltip",
|
|
122
|
+
{
|
|
123
|
+
get = function(self)
|
|
124
|
+
return BlzGetItemTooltip(self.handle) or ""
|
|
125
|
+
end,
|
|
126
|
+
set = function(self, tooltip)
|
|
127
|
+
BlzSetItemTooltip(self.handle, tooltip)
|
|
128
|
+
end
|
|
129
|
+
},
|
|
130
|
+
true
|
|
131
|
+
)
|
|
132
|
+
__TS__SetDescriptor(
|
|
133
|
+
Item.prototype,
|
|
134
|
+
"pawnable",
|
|
135
|
+
{
|
|
136
|
+
get = function(self)
|
|
137
|
+
return IsItemPawnable(self.handle)
|
|
138
|
+
end,
|
|
139
|
+
set = function(self, flag)
|
|
140
|
+
SetItemPawnable(self.handle, flag)
|
|
141
|
+
end
|
|
142
|
+
},
|
|
143
|
+
true
|
|
144
|
+
)
|
|
145
|
+
__TS__SetDescriptor(
|
|
146
|
+
Item.prototype,
|
|
147
|
+
"player",
|
|
148
|
+
{get = function(self)
|
|
149
|
+
return GetItemPlayer(self.handle)
|
|
150
|
+
end},
|
|
151
|
+
true
|
|
152
|
+
)
|
|
153
|
+
__TS__SetDescriptor(
|
|
154
|
+
Item.prototype,
|
|
155
|
+
"type",
|
|
156
|
+
{get = function(self)
|
|
157
|
+
return GetItemType(self.handle)
|
|
158
|
+
end},
|
|
159
|
+
true
|
|
160
|
+
)
|
|
161
|
+
__TS__SetDescriptor(
|
|
162
|
+
Item.prototype,
|
|
163
|
+
"typeId",
|
|
164
|
+
{get = function(self)
|
|
165
|
+
return GetItemTypeId(self.handle)
|
|
166
|
+
end},
|
|
167
|
+
true
|
|
168
|
+
)
|
|
169
|
+
__TS__SetDescriptor(
|
|
170
|
+
Item.prototype,
|
|
171
|
+
"userData",
|
|
172
|
+
{
|
|
173
|
+
get = function(self)
|
|
174
|
+
return GetItemUserData(self.handle)
|
|
175
|
+
end,
|
|
176
|
+
set = function(self, value)
|
|
177
|
+
SetItemUserData(self.handle, value)
|
|
178
|
+
end
|
|
179
|
+
},
|
|
180
|
+
true
|
|
181
|
+
)
|
|
182
|
+
__TS__SetDescriptor(
|
|
183
|
+
Item.prototype,
|
|
184
|
+
"visible",
|
|
185
|
+
{
|
|
186
|
+
get = function(self)
|
|
187
|
+
return IsItemVisible(self.handle)
|
|
188
|
+
end,
|
|
189
|
+
set = function(self, flag)
|
|
190
|
+
SetItemVisible(self.handle, flag)
|
|
191
|
+
end
|
|
192
|
+
},
|
|
193
|
+
true
|
|
194
|
+
)
|
|
195
|
+
__TS__SetDescriptor(
|
|
196
|
+
Item.prototype,
|
|
197
|
+
"skin",
|
|
198
|
+
{
|
|
199
|
+
get = function(self)
|
|
200
|
+
return BlzGetItemSkin(self.handle)
|
|
201
|
+
end,
|
|
202
|
+
set = function(self, skinId)
|
|
203
|
+
BlzSetItemSkin(self.handle, skinId)
|
|
204
|
+
end
|
|
205
|
+
},
|
|
206
|
+
true
|
|
207
|
+
)
|
|
208
|
+
__TS__SetDescriptor(
|
|
209
|
+
Item.prototype,
|
|
210
|
+
"x",
|
|
211
|
+
{
|
|
212
|
+
get = function(self)
|
|
213
|
+
return GetItemX(self.handle)
|
|
214
|
+
end,
|
|
215
|
+
set = function(self, value)
|
|
216
|
+
SetItemPosition(self.handle, value, self.y)
|
|
217
|
+
end
|
|
218
|
+
},
|
|
219
|
+
true
|
|
220
|
+
)
|
|
221
|
+
__TS__SetDescriptor(
|
|
222
|
+
Item.prototype,
|
|
223
|
+
"y",
|
|
224
|
+
{
|
|
225
|
+
get = function(self)
|
|
226
|
+
return GetItemY(self.handle)
|
|
227
|
+
end,
|
|
228
|
+
set = function(self, value)
|
|
229
|
+
SetItemPosition(self.handle, self.x, value)
|
|
230
|
+
end
|
|
231
|
+
},
|
|
232
|
+
true
|
|
233
|
+
)
|
|
234
|
+
function Item.create(self, itemId, x, y, skinId)
|
|
235
|
+
local ____temp_1
|
|
236
|
+
if skinId == nil then
|
|
237
|
+
____temp_1 = CreateItem(itemId, x, y)
|
|
238
|
+
else
|
|
239
|
+
____temp_1 = BlzCreateItemWithSkin(itemId, x, y, skinId)
|
|
240
|
+
end
|
|
241
|
+
local handle = ____temp_1
|
|
242
|
+
if handle then
|
|
243
|
+
local obj = self:getObject(handle)
|
|
244
|
+
local values = {}
|
|
245
|
+
values.handle = handle
|
|
246
|
+
return __TS__ObjectAssign(obj, values)
|
|
247
|
+
end
|
|
248
|
+
return nil
|
|
249
|
+
end
|
|
250
|
+
function Item.prototype.addAbility(self, abilCode)
|
|
251
|
+
BlzItemAddAbility(self.handle, abilCode)
|
|
252
|
+
end
|
|
253
|
+
function Item.prototype.getAbility(self, abilCode)
|
|
254
|
+
return BlzGetItemAbility(self.handle, abilCode)
|
|
255
|
+
end
|
|
256
|
+
function Item.prototype.getAbilityByIndex(self, index)
|
|
257
|
+
return BlzGetItemAbilityByIndex(self.handle, index)
|
|
258
|
+
end
|
|
259
|
+
function Item.prototype.removeAbility(self, abilCode)
|
|
260
|
+
BlzItemRemoveAbility(self.handle, abilCode)
|
|
261
|
+
end
|
|
262
|
+
function Item.prototype.destroy(self)
|
|
263
|
+
RemoveItem(self.handle)
|
|
264
|
+
end
|
|
265
|
+
function Item.prototype.getField(self, field)
|
|
266
|
+
local fieldType = __TS__StringSubstr(
|
|
267
|
+
tostring(field),
|
|
268
|
+
0,
|
|
269
|
+
(string.find(
|
|
270
|
+
tostring(field),
|
|
271
|
+
":",
|
|
272
|
+
nil,
|
|
273
|
+
true
|
|
274
|
+
) or 0) - 1
|
|
275
|
+
)
|
|
276
|
+
repeat
|
|
277
|
+
local ____switch43 = fieldType
|
|
278
|
+
local ____cond43 = ____switch43 == "unitbooleanfield"
|
|
279
|
+
if ____cond43 then
|
|
280
|
+
return BlzGetItemBooleanField(self.handle, field)
|
|
281
|
+
end
|
|
282
|
+
____cond43 = ____cond43 or ____switch43 == "unitintegerfield"
|
|
283
|
+
if ____cond43 then
|
|
284
|
+
return BlzGetItemIntegerField(self.handle, field)
|
|
285
|
+
end
|
|
286
|
+
____cond43 = ____cond43 or ____switch43 == "unitrealfield"
|
|
287
|
+
if ____cond43 then
|
|
288
|
+
return BlzGetItemRealField(self.handle, field)
|
|
289
|
+
end
|
|
290
|
+
____cond43 = ____cond43 or ____switch43 == "unitstringfield"
|
|
291
|
+
if ____cond43 then
|
|
292
|
+
return BlzGetItemStringField(self.handle, field)
|
|
293
|
+
end
|
|
294
|
+
do
|
|
295
|
+
return 0
|
|
296
|
+
end
|
|
297
|
+
until true
|
|
298
|
+
end
|
|
299
|
+
function Item.prototype.isOwned(self)
|
|
300
|
+
return IsItemOwned(self.handle)
|
|
301
|
+
end
|
|
302
|
+
function Item.prototype.isPawnable(self)
|
|
303
|
+
return IsItemPawnable(self.handle)
|
|
304
|
+
end
|
|
305
|
+
function Item.prototype.isPowerup(self)
|
|
306
|
+
return IsItemPowerup(self.handle)
|
|
307
|
+
end
|
|
308
|
+
function Item.prototype.isSellable(self)
|
|
309
|
+
return IsItemSellable(self.handle)
|
|
310
|
+
end
|
|
311
|
+
function Item.prototype.setDropId(self, unitId)
|
|
312
|
+
SetItemDropID(self.handle, unitId)
|
|
313
|
+
end
|
|
314
|
+
function Item.prototype.setDropOnDeath(self, flag)
|
|
315
|
+
SetItemDropOnDeath(self.handle, flag)
|
|
316
|
+
end
|
|
317
|
+
function Item.prototype.setDroppable(self, flag)
|
|
318
|
+
SetItemDroppable(self.handle, flag)
|
|
319
|
+
end
|
|
320
|
+
function Item.prototype.setField(self, field, value)
|
|
321
|
+
local fieldType = __TS__StringSubstr(
|
|
322
|
+
tostring(field),
|
|
323
|
+
0,
|
|
324
|
+
(string.find(
|
|
325
|
+
tostring(field),
|
|
326
|
+
":",
|
|
327
|
+
nil,
|
|
328
|
+
true
|
|
329
|
+
) or 0) - 1
|
|
330
|
+
)
|
|
331
|
+
if fieldType == "unitbooleanfield" and type(value) == "boolean" then
|
|
332
|
+
return BlzSetItemBooleanField(self.handle, field, value)
|
|
333
|
+
end
|
|
334
|
+
if fieldType == "unitintegerfield" and type(value) == "number" then
|
|
335
|
+
return BlzSetItemIntegerField(self.handle, field, value)
|
|
336
|
+
end
|
|
337
|
+
if fieldType == "unitrealfield" and type(value) == "number" then
|
|
338
|
+
return BlzSetItemRealField(self.handle, field, value)
|
|
339
|
+
end
|
|
340
|
+
if fieldType == "unitstringfield" and type(value) == "string" then
|
|
341
|
+
return BlzSetItemStringField(self.handle, field, value)
|
|
342
|
+
end
|
|
343
|
+
return false
|
|
344
|
+
end
|
|
345
|
+
function Item.prototype.setOwner(self, whichPlayer, changeColor)
|
|
346
|
+
SetItemPlayer(self.handle, whichPlayer.handle, changeColor)
|
|
347
|
+
end
|
|
348
|
+
function Item.prototype.setPoint(self, whichPoint)
|
|
349
|
+
SetItemPosition(self.handle, whichPoint.x, whichPoint.y)
|
|
350
|
+
end
|
|
351
|
+
function Item.prototype.setPosition(self, x, y)
|
|
352
|
+
SetItemPosition(self.handle, x, y)
|
|
353
|
+
end
|
|
354
|
+
function Item.fromEvent(self)
|
|
355
|
+
return self:fromHandle(GetManipulatedItem())
|
|
356
|
+
end
|
|
357
|
+
function Item.fromHandle(self, handle)
|
|
358
|
+
local ____handle_2
|
|
359
|
+
if handle then
|
|
360
|
+
____handle_2 = self:getObject(handle)
|
|
361
|
+
else
|
|
362
|
+
____handle_2 = nil
|
|
363
|
+
end
|
|
364
|
+
return ____handle_2
|
|
365
|
+
end
|
|
366
|
+
function Item.isIdPawnable(self, itemId)
|
|
367
|
+
return IsItemIdPawnable(itemId)
|
|
368
|
+
end
|
|
369
|
+
function Item.isIdPowerup(self, itemId)
|
|
370
|
+
return IsItemIdPowerup(itemId)
|
|
371
|
+
end
|
|
372
|
+
function Item.isIdSellable(self, itemId)
|
|
373
|
+
return IsItemIdSellable(itemId)
|
|
374
|
+
end
|
|
375
|
+
return ____exports
|
|
@@ -0,0 +1,211 @@
|
|
|
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
|
+
____exports.Leaderboard = __TS__Class()
|
|
10
|
+
local Leaderboard = ____exports.Leaderboard
|
|
11
|
+
Leaderboard.name = "Leaderboard"
|
|
12
|
+
__TS__ClassExtends(Leaderboard, Handle)
|
|
13
|
+
function Leaderboard.prototype.____constructor(self)
|
|
14
|
+
if Handle:initFromHandle() then
|
|
15
|
+
Handle.prototype.____constructor(self)
|
|
16
|
+
return
|
|
17
|
+
end
|
|
18
|
+
local handle = CreateLeaderboard()
|
|
19
|
+
if handle == nil then
|
|
20
|
+
error("w3ts failed to create leaderboard handle.", 3)
|
|
21
|
+
end
|
|
22
|
+
Handle.prototype.____constructor(self, handle)
|
|
23
|
+
end
|
|
24
|
+
__TS__SetDescriptor(
|
|
25
|
+
Leaderboard.prototype,
|
|
26
|
+
"displayed",
|
|
27
|
+
{get = function(self)
|
|
28
|
+
return IsLeaderboardDisplayed(self.handle)
|
|
29
|
+
end},
|
|
30
|
+
true
|
|
31
|
+
)
|
|
32
|
+
__TS__SetDescriptor(
|
|
33
|
+
Leaderboard.prototype,
|
|
34
|
+
"itemCount",
|
|
35
|
+
{
|
|
36
|
+
get = function(self)
|
|
37
|
+
return LeaderboardGetItemCount(self.handle)
|
|
38
|
+
end,
|
|
39
|
+
set = function(self, count)
|
|
40
|
+
LeaderboardSetSizeByItemCount(self.handle, count)
|
|
41
|
+
end
|
|
42
|
+
},
|
|
43
|
+
true
|
|
44
|
+
)
|
|
45
|
+
__TS__SetDescriptor(
|
|
46
|
+
Leaderboard.prototype,
|
|
47
|
+
"label",
|
|
48
|
+
{
|
|
49
|
+
get = function(self)
|
|
50
|
+
return LeaderboardGetLabelText(self.handle) or ""
|
|
51
|
+
end,
|
|
52
|
+
set = function(self, value)
|
|
53
|
+
LeaderboardSetLabel(self.handle, value)
|
|
54
|
+
end
|
|
55
|
+
},
|
|
56
|
+
true
|
|
57
|
+
)
|
|
58
|
+
function Leaderboard.create(self)
|
|
59
|
+
local handle = CreateLeaderboard()
|
|
60
|
+
if handle then
|
|
61
|
+
local obj = self:getObject(handle)
|
|
62
|
+
local values = {}
|
|
63
|
+
values.handle = handle
|
|
64
|
+
return __TS__ObjectAssign(obj, values)
|
|
65
|
+
end
|
|
66
|
+
return nil
|
|
67
|
+
end
|
|
68
|
+
function Leaderboard.prototype.addItem(self, label, value, p)
|
|
69
|
+
LeaderboardAddItem(self.handle, label, value, p.handle)
|
|
70
|
+
end
|
|
71
|
+
function Leaderboard.prototype.clear(self)
|
|
72
|
+
LeaderboardClear(self.handle)
|
|
73
|
+
end
|
|
74
|
+
function Leaderboard.prototype.destroy(self)
|
|
75
|
+
DestroyLeaderboard(self.handle)
|
|
76
|
+
end
|
|
77
|
+
function Leaderboard.prototype.display(self, flag)
|
|
78
|
+
if flag == nil then
|
|
79
|
+
flag = true
|
|
80
|
+
end
|
|
81
|
+
LeaderboardDisplay(self.handle, flag)
|
|
82
|
+
end
|
|
83
|
+
function Leaderboard.prototype.getPlayerIndex(self, p)
|
|
84
|
+
return LeaderboardGetPlayerIndex(self.handle, p.handle)
|
|
85
|
+
end
|
|
86
|
+
function Leaderboard.prototype.hasPlayerItem(self, p)
|
|
87
|
+
LeaderboardHasPlayerItem(self.handle, p.handle)
|
|
88
|
+
end
|
|
89
|
+
function Leaderboard.prototype.removeItem(self, index)
|
|
90
|
+
LeaderboardRemoveItem(self.handle, index)
|
|
91
|
+
end
|
|
92
|
+
function Leaderboard.prototype.removePlayerItem(self, p)
|
|
93
|
+
LeaderboardRemovePlayerItem(self.handle, p.handle)
|
|
94
|
+
end
|
|
95
|
+
function Leaderboard.prototype.setItemLabel(self, item, label)
|
|
96
|
+
LeaderboardSetItemLabel(self.handle, item, label)
|
|
97
|
+
end
|
|
98
|
+
function Leaderboard.prototype.setItemLabelColor(self, item, red, green, blue, alpha)
|
|
99
|
+
LeaderboardSetItemLabelColor(
|
|
100
|
+
self.handle,
|
|
101
|
+
item,
|
|
102
|
+
red,
|
|
103
|
+
green,
|
|
104
|
+
blue,
|
|
105
|
+
alpha
|
|
106
|
+
)
|
|
107
|
+
end
|
|
108
|
+
function Leaderboard.prototype.setItemStyle(self, item, showLabel, showValues, showIcons)
|
|
109
|
+
if showLabel == nil then
|
|
110
|
+
showLabel = true
|
|
111
|
+
end
|
|
112
|
+
if showValues == nil then
|
|
113
|
+
showValues = true
|
|
114
|
+
end
|
|
115
|
+
if showIcons == nil then
|
|
116
|
+
showIcons = true
|
|
117
|
+
end
|
|
118
|
+
LeaderboardSetItemStyle(
|
|
119
|
+
self.handle,
|
|
120
|
+
item,
|
|
121
|
+
showLabel,
|
|
122
|
+
showValues,
|
|
123
|
+
showIcons
|
|
124
|
+
)
|
|
125
|
+
end
|
|
126
|
+
function Leaderboard.prototype.setItemValue(self, item, value)
|
|
127
|
+
LeaderboardSetItemValue(self.handle, item, value)
|
|
128
|
+
end
|
|
129
|
+
function Leaderboard.prototype.setItemValueColor(self, item, red, green, blue, alpha)
|
|
130
|
+
LeaderboardSetItemValueColor(
|
|
131
|
+
self.handle,
|
|
132
|
+
item,
|
|
133
|
+
red,
|
|
134
|
+
green,
|
|
135
|
+
blue,
|
|
136
|
+
alpha
|
|
137
|
+
)
|
|
138
|
+
end
|
|
139
|
+
function Leaderboard.prototype.setLabelColor(self, red, green, blue, alpha)
|
|
140
|
+
LeaderboardSetLabelColor(
|
|
141
|
+
self.handle,
|
|
142
|
+
red,
|
|
143
|
+
green,
|
|
144
|
+
blue,
|
|
145
|
+
alpha
|
|
146
|
+
)
|
|
147
|
+
end
|
|
148
|
+
function Leaderboard.prototype.setPlayerBoard(self, p)
|
|
149
|
+
PlayerSetLeaderboard(p.handle, self.handle)
|
|
150
|
+
end
|
|
151
|
+
function Leaderboard.prototype.setStyle(self, showLabel, showNames, showValues, showIcons)
|
|
152
|
+
if showLabel == nil then
|
|
153
|
+
showLabel = true
|
|
154
|
+
end
|
|
155
|
+
if showNames == nil then
|
|
156
|
+
showNames = true
|
|
157
|
+
end
|
|
158
|
+
if showValues == nil then
|
|
159
|
+
showValues = true
|
|
160
|
+
end
|
|
161
|
+
if showIcons == nil then
|
|
162
|
+
showIcons = true
|
|
163
|
+
end
|
|
164
|
+
LeaderboardSetStyle(
|
|
165
|
+
self.handle,
|
|
166
|
+
showLabel,
|
|
167
|
+
showNames,
|
|
168
|
+
showValues,
|
|
169
|
+
showIcons
|
|
170
|
+
)
|
|
171
|
+
end
|
|
172
|
+
function Leaderboard.prototype.setValueColor(self, red, green, blue, alpha)
|
|
173
|
+
LeaderboardSetValueColor(
|
|
174
|
+
self.handle,
|
|
175
|
+
red,
|
|
176
|
+
green,
|
|
177
|
+
blue,
|
|
178
|
+
alpha
|
|
179
|
+
)
|
|
180
|
+
end
|
|
181
|
+
function Leaderboard.prototype.sortByLabel(self, asc)
|
|
182
|
+
if asc == nil then
|
|
183
|
+
asc = true
|
|
184
|
+
end
|
|
185
|
+
LeaderboardSortItemsByLabel(self.handle, asc)
|
|
186
|
+
end
|
|
187
|
+
function Leaderboard.prototype.sortByPlayer(self, asc)
|
|
188
|
+
if asc == nil then
|
|
189
|
+
asc = true
|
|
190
|
+
end
|
|
191
|
+
LeaderboardSortItemsByPlayer(self.handle, asc)
|
|
192
|
+
end
|
|
193
|
+
function Leaderboard.prototype.sortByValue(self, asc)
|
|
194
|
+
if asc == nil then
|
|
195
|
+
asc = true
|
|
196
|
+
end
|
|
197
|
+
LeaderboardSortItemsByValue(self.handle, asc)
|
|
198
|
+
end
|
|
199
|
+
function Leaderboard.fromHandle(self, handle)
|
|
200
|
+
local ____handle_0
|
|
201
|
+
if handle then
|
|
202
|
+
____handle_0 = self:getObject(handle)
|
|
203
|
+
else
|
|
204
|
+
____handle_0 = nil
|
|
205
|
+
end
|
|
206
|
+
return ____handle_0
|
|
207
|
+
end
|
|
208
|
+
function Leaderboard.fromPlayer(self, p)
|
|
209
|
+
return self:fromHandle(PlayerGetLeaderboard(p.handle))
|
|
210
|
+
end
|
|
211
|
+
return ____exports
|