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.
Files changed (81) hide show
  1. package/dist/index.lua +13 -0
  2. package/dist/lua_modules/w3ts/globals/index.lua +23 -0
  3. package/dist/lua_modules/w3ts/globals/order.lua +2 -0
  4. package/dist/lua_modules/w3ts/handles/camera.lua +348 -0
  5. package/dist/lua_modules/w3ts/handles/destructable.lua +237 -0
  6. package/dist/lua_modules/w3ts/handles/dialog.lua +161 -0
  7. package/dist/lua_modules/w3ts/handles/effect.lua +198 -0
  8. package/dist/lua_modules/w3ts/handles/fogmodifier.lua +76 -0
  9. package/dist/lua_modules/w3ts/handles/force.lua +105 -0
  10. package/dist/lua_modules/w3ts/handles/frame.lua +417 -0
  11. package/dist/lua_modules/w3ts/handles/gamecache.lua +132 -0
  12. package/dist/lua_modules/w3ts/handles/group.lua +215 -0
  13. package/dist/lua_modules/w3ts/handles/handle.lua +38 -0
  14. package/dist/lua_modules/w3ts/handles/image.lua +105 -0
  15. package/dist/lua_modules/w3ts/handles/index.lua +226 -0
  16. package/dist/lua_modules/w3ts/handles/item.lua +375 -0
  17. package/dist/lua_modules/w3ts/handles/leaderboard.lua +211 -0
  18. package/dist/lua_modules/w3ts/handles/multiboard.lua +193 -0
  19. package/dist/lua_modules/w3ts/handles/player.lua +311 -0
  20. package/dist/lua_modules/w3ts/handles/point.lua +80 -0
  21. package/dist/lua_modules/w3ts/handles/quest.lua +176 -0
  22. package/dist/lua_modules/w3ts/handles/rect.lua +129 -0
  23. package/dist/lua_modules/w3ts/handles/region.lua +72 -0
  24. package/dist/lua_modules/w3ts/handles/sound.lua +174 -0
  25. package/dist/lua_modules/w3ts/handles/texttag.lua +97 -0
  26. package/dist/lua_modules/w3ts/handles/timer.lua +83 -0
  27. package/dist/lua_modules/w3ts/handles/timerdialog.lua +86 -0
  28. package/dist/lua_modules/w3ts/handles/trigger.lua +265 -0
  29. package/dist/lua_modules/w3ts/handles/ubersplat.lua +84 -0
  30. package/dist/lua_modules/w3ts/handles/unit.lua +1330 -0
  31. package/dist/lua_modules/w3ts/handles/weathereffect.lua +42 -0
  32. package/dist/lua_modules/w3ts/handles/widget.lua +53 -0
  33. package/dist/lua_modules/w3ts/hooks/index.lua +52 -0
  34. package/dist/lua_modules/w3ts/index.lua +36 -0
  35. package/dist/lua_modules/w3ts/system/base64.lua +108 -0
  36. package/dist/lua_modules/w3ts/system/binaryreader.lua +74 -0
  37. package/dist/lua_modules/w3ts/system/binarywriter.lua +88 -0
  38. package/dist/lua_modules/w3ts/system/file.lua +88 -0
  39. package/dist/lua_modules/w3ts/system/gametime.lua +27 -0
  40. package/dist/lua_modules/w3ts/system/host.lua +104 -0
  41. package/dist/lua_modules/w3ts/system/index.lua +58 -0
  42. package/dist/lua_modules/w3ts/system/sync.lua +239 -0
  43. package/dist/lua_modules/w3ts/utils/color.lua +189 -0
  44. package/dist/lua_modules/w3ts/utils/index.lua +38 -0
  45. package/dist/lualib_bundle.lua +2733 -0
  46. package/dist/package.json +41 -0
  47. package/dist/utils/abilities.lua +107 -0
  48. package/dist/utils/camera.lua +46 -0
  49. package/dist/utils/chat-command.lua +30 -0
  50. package/dist/utils/color.lua +41 -0
  51. package/dist/utils/index.lua +125 -0
  52. package/dist/utils/item.lua +173 -0
  53. package/dist/utils/math.lua +17 -0
  54. package/dist/utils/minimapIcons.lua +28 -0
  55. package/dist/utils/misc.lua +143 -0
  56. package/dist/utils/physics.lua +161 -0
  57. package/dist/utils/players.lua +234 -0
  58. package/dist/utils/point.lua +60 -0
  59. package/dist/utils/quests.lua +47 -0
  60. package/dist/utils/textTag.lua +110 -0
  61. package/dist/utils/timer.lua +21 -0
  62. package/dist/utils/units.lua +102 -0
  63. package/package.json +4 -6
  64. package/dist/index.js +0 -18
  65. package/dist/utils/abilities.js +0 -125
  66. package/dist/utils/camera.js +0 -37
  67. package/dist/utils/chat-command.js +0 -22
  68. package/dist/utils/color.js +0 -141
  69. package/dist/utils/index.js +0 -32
  70. package/dist/utils/item.js +0 -124
  71. package/dist/utils/math.js +0 -17
  72. package/dist/utils/minimapIcons.js +0 -27
  73. package/dist/utils/misc.js +0 -175
  74. package/dist/utils/physics.js +0 -194
  75. package/dist/utils/players.js +0 -189
  76. package/dist/utils/point.js +0 -74
  77. package/dist/utils/quests.js +0 -30
  78. package/dist/utils/textTag.js +0 -72
  79. package/dist/utils/timer.js +0 -16
  80. package/dist/utils/units.js +0 -81
  81. package/tsconfig.json +0 -37
@@ -0,0 +1,176 @@
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.QuestItem = __TS__Class()
10
+ local QuestItem = ____exports.QuestItem
11
+ QuestItem.name = "QuestItem"
12
+ __TS__ClassExtends(QuestItem, Handle)
13
+ function QuestItem.prototype.____constructor(self, whichQuest)
14
+ if Handle:initFromHandle() then
15
+ Handle.prototype.____constructor(self)
16
+ return
17
+ end
18
+ local handle = QuestCreateItem(whichQuest.handle)
19
+ if handle == nil then
20
+ error("w3ts failed to create questitem handle.", 3)
21
+ end
22
+ Handle.prototype.____constructor(self, handle)
23
+ self.quest = whichQuest
24
+ end
25
+ __TS__SetDescriptor(
26
+ QuestItem.prototype,
27
+ "completed",
28
+ {
29
+ get = function(self)
30
+ return IsQuestItemCompleted(self.handle)
31
+ end,
32
+ set = function(self, completed)
33
+ QuestItemSetCompleted(self.handle, completed)
34
+ end
35
+ },
36
+ true
37
+ )
38
+ function QuestItem.create(self, whichQuest)
39
+ local handle = QuestCreateItem(whichQuest.handle)
40
+ if handle then
41
+ local obj = self:getObject(handle)
42
+ local values = {}
43
+ values.handle = handle
44
+ values.quest = whichQuest
45
+ return __TS__ObjectAssign(obj, values)
46
+ end
47
+ return nil
48
+ end
49
+ function QuestItem.prototype.setDescription(self, description)
50
+ QuestItemSetDescription(self.handle, description)
51
+ end
52
+ ____exports.Quest = __TS__Class()
53
+ local Quest = ____exports.Quest
54
+ Quest.name = "Quest"
55
+ __TS__ClassExtends(Quest, Handle)
56
+ function Quest.prototype.____constructor(self)
57
+ if Handle:initFromHandle() then
58
+ Handle.prototype.____constructor(self)
59
+ return
60
+ end
61
+ local handle = CreateQuest()
62
+ if handle == nil then
63
+ error("w3ts failed to create quest handle.", 3)
64
+ end
65
+ Handle.prototype.____constructor(self, handle)
66
+ end
67
+ __TS__SetDescriptor(
68
+ Quest.prototype,
69
+ "completed",
70
+ {
71
+ get = function(self)
72
+ return IsQuestCompleted(self.handle)
73
+ end,
74
+ set = function(self, completed)
75
+ QuestSetCompleted(self.handle, completed)
76
+ end
77
+ },
78
+ true
79
+ )
80
+ __TS__SetDescriptor(
81
+ Quest.prototype,
82
+ "discovered",
83
+ {
84
+ get = function(self)
85
+ return IsQuestDiscovered(self.handle)
86
+ end,
87
+ set = function(self, discovered)
88
+ QuestSetDiscovered(self.handle, discovered)
89
+ end
90
+ },
91
+ true
92
+ )
93
+ __TS__SetDescriptor(
94
+ Quest.prototype,
95
+ "enabled",
96
+ {
97
+ get = function(self)
98
+ return IsQuestEnabled(self.handle)
99
+ end,
100
+ set = function(self, enabled)
101
+ QuestSetEnabled(self.handle, enabled)
102
+ end
103
+ },
104
+ true
105
+ )
106
+ __TS__SetDescriptor(
107
+ Quest.prototype,
108
+ "failed",
109
+ {
110
+ get = function(self)
111
+ return IsQuestFailed(self.handle)
112
+ end,
113
+ set = function(self, failed)
114
+ QuestSetFailed(self.handle, failed)
115
+ end
116
+ },
117
+ true
118
+ )
119
+ __TS__SetDescriptor(
120
+ Quest.prototype,
121
+ "required",
122
+ {
123
+ get = function(self)
124
+ return IsQuestRequired(self.handle)
125
+ end,
126
+ set = function(self, required)
127
+ QuestSetRequired(self.handle, required)
128
+ end
129
+ },
130
+ true
131
+ )
132
+ function Quest.create(self)
133
+ local handle = CreateQuest()
134
+ if handle then
135
+ local obj = self:getObject(handle)
136
+ local values = {}
137
+ values.handle = handle
138
+ return __TS__ObjectAssign(obj, values)
139
+ end
140
+ return nil
141
+ end
142
+ function Quest.prototype.addItem(self, description)
143
+ local questItem = ____exports.QuestItem:create(self)
144
+ if questItem ~= nil then
145
+ questItem:setDescription(description)
146
+ end
147
+ return questItem
148
+ end
149
+ function Quest.prototype.destroy(self)
150
+ DestroyQuest(self.handle)
151
+ end
152
+ function Quest.prototype.setDescription(self, description)
153
+ QuestSetDescription(self.handle, description)
154
+ end
155
+ function Quest.prototype.setIcon(self, iconPath)
156
+ QuestSetIconPath(self.handle, iconPath)
157
+ end
158
+ function Quest.prototype.setTitle(self, title)
159
+ QuestSetTitle(self.handle, title)
160
+ end
161
+ function Quest.flashQuestDialogButton(self)
162
+ FlashQuestDialogButton()
163
+ end
164
+ function Quest.forceQuestDialogUpdate(self)
165
+ ForceQuestDialogUpdate()
166
+ end
167
+ function Quest.fromHandle(self, handle)
168
+ local ____handle_2
169
+ if handle then
170
+ ____handle_2 = self:getObject(handle)
171
+ else
172
+ ____handle_2 = nil
173
+ end
174
+ return ____handle_2
175
+ end
176
+ return ____exports
@@ -0,0 +1,129 @@
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.Rectangle = __TS__Class()
10
+ local Rectangle = ____exports.Rectangle
11
+ Rectangle.name = "Rectangle"
12
+ __TS__ClassExtends(Rectangle, Handle)
13
+ function Rectangle.prototype.____constructor(self, minX, minY, maxX, maxY)
14
+ if Handle:initFromHandle() then
15
+ Handle.prototype.____constructor(self)
16
+ return
17
+ end
18
+ local handle = Rect(minX, minY, maxX, maxY)
19
+ if handle == nil then
20
+ error("w3ts failed to create rect handle.", 3)
21
+ end
22
+ Handle.prototype.____constructor(self, handle)
23
+ end
24
+ __TS__SetDescriptor(
25
+ Rectangle.prototype,
26
+ "centerX",
27
+ {get = function(self)
28
+ return GetRectCenterX(self.handle)
29
+ end},
30
+ true
31
+ )
32
+ __TS__SetDescriptor(
33
+ Rectangle.prototype,
34
+ "centerY",
35
+ {get = function(self)
36
+ return GetRectCenterY(self.handle)
37
+ end},
38
+ true
39
+ )
40
+ __TS__SetDescriptor(
41
+ Rectangle.prototype,
42
+ "maxX",
43
+ {get = function(self)
44
+ return GetRectMaxX(self.handle)
45
+ end},
46
+ true
47
+ )
48
+ __TS__SetDescriptor(
49
+ Rectangle.prototype,
50
+ "maxY",
51
+ {get = function(self)
52
+ return GetRectMaxY(self.handle)
53
+ end},
54
+ true
55
+ )
56
+ __TS__SetDescriptor(
57
+ Rectangle.prototype,
58
+ "minX",
59
+ {get = function(self)
60
+ return GetRectMinX(self.handle)
61
+ end},
62
+ true
63
+ )
64
+ __TS__SetDescriptor(
65
+ Rectangle.prototype,
66
+ "minY",
67
+ {get = function(self)
68
+ return GetRectMinY(self.handle)
69
+ end},
70
+ true
71
+ )
72
+ function Rectangle.create(self, minX, minY, maxX, maxY)
73
+ local handle = Rect(minX, minY, maxX, maxY)
74
+ local obj = self:getObject(handle)
75
+ local values = {}
76
+ values.handle = handle
77
+ return __TS__ObjectAssign(obj, values)
78
+ end
79
+ function Rectangle.prototype.destroy(self)
80
+ RemoveRect(self.handle)
81
+ end
82
+ function Rectangle.prototype.enumDestructables(self, filter, actionFunc)
83
+ EnumDestructablesInRect(
84
+ self.handle,
85
+ type(filter) == "function" and Filter(filter) or filter,
86
+ actionFunc
87
+ )
88
+ end
89
+ function Rectangle.prototype.enumItems(self, filter, actionFunc)
90
+ EnumItemsInRect(
91
+ self.handle,
92
+ type(filter) == "function" and Filter(filter) or filter,
93
+ actionFunc
94
+ )
95
+ end
96
+ function Rectangle.prototype.move(self, newCenterX, newCenterY)
97
+ MoveRectTo(self.handle, newCenterX, newCenterY)
98
+ end
99
+ function Rectangle.prototype.movePoint(self, newCenterPoint)
100
+ MoveRectToLoc(self.handle, newCenterPoint.handle)
101
+ end
102
+ function Rectangle.prototype.setRect(self, minX, minY, maxX, maxY)
103
+ SetRect(
104
+ self.handle,
105
+ minX,
106
+ minY,
107
+ maxX,
108
+ maxY
109
+ )
110
+ end
111
+ function Rectangle.prototype.setRectFromPoint(self, min, max)
112
+ SetRectFromLoc(self.handle, min.handle, max.handle)
113
+ end
114
+ function Rectangle.fromHandle(self, handle)
115
+ local ____handle_0
116
+ if handle then
117
+ ____handle_0 = self:getObject(handle)
118
+ else
119
+ ____handle_0 = nil
120
+ end
121
+ return ____handle_0
122
+ end
123
+ function Rectangle.fromPoint(self, min, max)
124
+ return self:fromHandle(RectFromLoc(min.handle, max.handle))
125
+ end
126
+ function Rectangle.getWorldBounds(self)
127
+ return ____exports.Rectangle:fromHandle(GetWorldBounds())
128
+ end
129
+ return ____exports
@@ -0,0 +1,72 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__Class = ____lualib.__TS__Class
3
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
4
+ local __TS__ObjectAssign = ____lualib.__TS__ObjectAssign
5
+ local ____exports = {}
6
+ local ____handle = require("lua_modules.w3ts.handles.handle")
7
+ local Handle = ____handle.Handle
8
+ ____exports.Region = __TS__Class()
9
+ local Region = ____exports.Region
10
+ Region.name = "Region"
11
+ __TS__ClassExtends(Region, Handle)
12
+ function Region.prototype.____constructor(self)
13
+ if Handle:initFromHandle() then
14
+ Handle.prototype.____constructor(self)
15
+ return
16
+ end
17
+ local handle = CreateRegion()
18
+ if handle == nil then
19
+ error("w3ts failed to create rect handle.", 3)
20
+ end
21
+ Handle.prototype.____constructor(self, handle)
22
+ end
23
+ function Region.create(self)
24
+ local handle = CreateRegion()
25
+ local obj = self:getObject(handle)
26
+ local values = {}
27
+ values.handle = handle
28
+ return __TS__ObjectAssign(obj, values)
29
+ end
30
+ function Region.prototype.addCell(self, x, y)
31
+ RegionAddCell(self.handle, x, y)
32
+ end
33
+ function Region.prototype.addCellPoint(self, whichPoint)
34
+ RegionAddCellAtLoc(self.handle, whichPoint.handle)
35
+ end
36
+ function Region.prototype.addRect(self, r)
37
+ RegionAddRect(self.handle, r.handle)
38
+ end
39
+ function Region.prototype.clearCell(self, x, y)
40
+ RegionClearCell(self.handle, x, y)
41
+ end
42
+ function Region.prototype.clearCellPoint(self, whichPoint)
43
+ RegionClearCellAtLoc(self.handle, whichPoint.handle)
44
+ end
45
+ function Region.prototype.clearRect(self, r)
46
+ RegionClearRect(self.handle, r.handle)
47
+ end
48
+ function Region.prototype.containsCoords(self, x, y)
49
+ return IsPointInRegion(self.handle, x, y)
50
+ end
51
+ function Region.prototype.containsPoint(self, whichPoint)
52
+ IsLocationInRegion(self.handle, whichPoint.handle)
53
+ end
54
+ function Region.prototype.containsUnit(self, whichUnit)
55
+ return IsUnitInRegion(self.handle, whichUnit.handle)
56
+ end
57
+ function Region.prototype.destroy(self)
58
+ RemoveRegion(self.handle)
59
+ end
60
+ function Region.fromEvent(self)
61
+ return self:fromHandle(GetTriggeringRegion())
62
+ end
63
+ function Region.fromHandle(self, handle)
64
+ local ____handle_0
65
+ if handle then
66
+ ____handle_0 = self:getObject(handle)
67
+ else
68
+ ____handle_0 = nil
69
+ end
70
+ return ____handle_0
71
+ end
72
+ return ____exports
@@ -0,0 +1,174 @@
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.Sound = __TS__Class()
10
+ local Sound = ____exports.Sound
11
+ Sound.name = "Sound"
12
+ __TS__ClassExtends(Sound, Handle)
13
+ function Sound.prototype.____constructor(self, fileName, looping, is3D, stopWhenOutOfRange, fadeInRate, fadeOutRate, eaxSetting)
14
+ if Handle:initFromHandle() then
15
+ Handle.prototype.____constructor(self)
16
+ return
17
+ end
18
+ local handle = CreateSound(
19
+ fileName,
20
+ looping,
21
+ is3D,
22
+ stopWhenOutOfRange,
23
+ fadeInRate,
24
+ fadeOutRate,
25
+ eaxSetting
26
+ )
27
+ if handle == nil then
28
+ error("w3ts failed to create sound handle.", 3)
29
+ end
30
+ Handle.prototype.____constructor(self, handle)
31
+ end
32
+ __TS__SetDescriptor(
33
+ Sound.prototype,
34
+ "dialogueSpeakerNameKey",
35
+ {
36
+ get = function(self)
37
+ return GetDialogueSpeakerNameKey(self.handle) or ""
38
+ end,
39
+ set = function(self, speakerName)
40
+ SetDialogueSpeakerNameKey(self.handle, speakerName)
41
+ end
42
+ },
43
+ true
44
+ )
45
+ __TS__SetDescriptor(
46
+ Sound.prototype,
47
+ "dialogueTextKey",
48
+ {
49
+ get = function(self)
50
+ return GetDialogueTextKey(self.handle) or ""
51
+ end,
52
+ set = function(self, dialogueText)
53
+ SetDialogueTextKey(self.handle, dialogueText)
54
+ end
55
+ },
56
+ true
57
+ )
58
+ __TS__SetDescriptor(
59
+ Sound.prototype,
60
+ "duration",
61
+ {
62
+ get = function(self)
63
+ return GetSoundDuration(self.handle)
64
+ end,
65
+ set = function(self, duration)
66
+ SetSoundDuration(self.handle, duration)
67
+ end
68
+ },
69
+ true
70
+ )
71
+ __TS__SetDescriptor(
72
+ Sound.prototype,
73
+ "loading",
74
+ {get = function(self)
75
+ return GetSoundIsLoading(self.handle)
76
+ end},
77
+ true
78
+ )
79
+ __TS__SetDescriptor(
80
+ Sound.prototype,
81
+ "playing",
82
+ {get = function(self)
83
+ return GetSoundIsPlaying(self.handle)
84
+ end},
85
+ true
86
+ )
87
+ function Sound.create(self, fileName, looping, is3D, stopWhenOutOfRange, fadeInRate, fadeOutRate, eaxSetting)
88
+ local handle = CreateSound(
89
+ fileName,
90
+ looping,
91
+ is3D,
92
+ stopWhenOutOfRange,
93
+ fadeInRate,
94
+ fadeOutRate,
95
+ eaxSetting
96
+ )
97
+ if handle then
98
+ local obj = self:getObject(handle)
99
+ local values = {}
100
+ values.handle = handle
101
+ return __TS__ObjectAssign(obj, values)
102
+ end
103
+ return nil
104
+ end
105
+ function Sound.prototype.killWhenDone(self)
106
+ KillSoundWhenDone(self.handle)
107
+ end
108
+ function Sound.prototype.registerStacked(self, byPosition, rectWidth, rectHeight)
109
+ RegisterStackedSound(self.handle, byPosition, rectWidth, rectHeight)
110
+ end
111
+ function Sound.prototype.setChannel(self, channel)
112
+ SetSoundDistanceCutoff(self.handle, channel)
113
+ end
114
+ function Sound.prototype.setConeAngles(self, inside, outside, outsideVolume)
115
+ SetSoundConeAngles(self.handle, inside, outside, outsideVolume)
116
+ end
117
+ function Sound.prototype.setConeOrientation(self, x, y, z)
118
+ SetSoundConeOrientation(self.handle, x, y, z)
119
+ end
120
+ function Sound.prototype.setDistanceCutoff(self, cutoff)
121
+ SetSoundDistanceCutoff(self.handle, cutoff)
122
+ end
123
+ function Sound.prototype.setDistances(self, minDist, maxDist)
124
+ SetSoundDistances(self.handle, minDist, maxDist)
125
+ end
126
+ function Sound.prototype.setFacialAnimationFilepath(self, animationSetFilepath)
127
+ SetSoundFacialAnimationSetFilepath(self.handle, animationSetFilepath)
128
+ end
129
+ function Sound.prototype.setFacialAnimationGroupLabel(self, groupLabel)
130
+ SetSoundFacialAnimationGroupLabel(self.handle, groupLabel)
131
+ end
132
+ function Sound.prototype.setFacialAnimationLabel(self, animationLabel)
133
+ SetSoundFacialAnimationLabel(self.handle, animationLabel)
134
+ end
135
+ function Sound.prototype.setParamsFromLabel(self, soundLabel)
136
+ SetSoundParamsFromLabel(self.handle, soundLabel)
137
+ end
138
+ function Sound.prototype.setPitch(self, pitch)
139
+ SetSoundPitch(self.handle, pitch)
140
+ end
141
+ function Sound.prototype.setPlayPosition(self, millisecs)
142
+ SetSoundPlayPosition(self.handle, millisecs)
143
+ end
144
+ function Sound.prototype.setPosition(self, x, y, z)
145
+ SetSoundPosition(self.handle, x, y, z)
146
+ end
147
+ function Sound.prototype.setVelocity(self, x, y, z)
148
+ SetSoundVelocity(self.handle, x, y, z)
149
+ end
150
+ function Sound.prototype.setVolume(self, volume)
151
+ SetSoundVolume(self.handle, volume)
152
+ end
153
+ function Sound.prototype.start(self)
154
+ StartSound(self.handle)
155
+ end
156
+ function Sound.prototype.stop(self, killWhenDone, fadeOut)
157
+ StopSound(self.handle, killWhenDone, fadeOut)
158
+ end
159
+ function Sound.prototype.unregisterStacked(self, byPosition, rectWidth, rectHeight)
160
+ UnregisterStackedSound(self.handle, byPosition, rectWidth, rectHeight)
161
+ end
162
+ function Sound.fromHandle(self, handle)
163
+ local ____handle_0
164
+ if handle then
165
+ ____handle_0 = self:getObject(handle)
166
+ else
167
+ ____handle_0 = nil
168
+ end
169
+ return ____handle_0
170
+ end
171
+ function Sound.getFileDuration(self, fileName)
172
+ return GetSoundFileDuration(fileName)
173
+ end
174
+ return ____exports
@@ -0,0 +1,97 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__Class = ____lualib.__TS__Class
3
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
4
+ local __TS__ObjectAssign = ____lualib.__TS__ObjectAssign
5
+ local ____exports = {}
6
+ local ____handle = require("lua_modules.w3ts.handles.handle")
7
+ local Handle = ____handle.Handle
8
+ ____exports.TextTag = __TS__Class()
9
+ local TextTag = ____exports.TextTag
10
+ TextTag.name = "TextTag"
11
+ __TS__ClassExtends(TextTag, Handle)
12
+ function TextTag.prototype.____constructor(self)
13
+ if Handle:initFromHandle() then
14
+ Handle.prototype.____constructor(self)
15
+ return
16
+ end
17
+ local handle = CreateTextTag()
18
+ if handle == nil then
19
+ error("w3ts failed to create texttag handle.", 3)
20
+ end
21
+ Handle.prototype.____constructor(self, handle)
22
+ end
23
+ function TextTag.create(self)
24
+ local handle = CreateTextTag()
25
+ if handle then
26
+ local obj = self:getObject(handle)
27
+ local values = {}
28
+ values.handle = handle
29
+ return __TS__ObjectAssign(obj, values)
30
+ end
31
+ return nil
32
+ end
33
+ function TextTag.prototype.destroy(self)
34
+ DestroyTextTag(self.handle)
35
+ end
36
+ function TextTag.prototype.setAge(self, age)
37
+ SetTextTagAge(self.handle, age)
38
+ end
39
+ function TextTag.prototype.setColor(self, red, green, blue, alpha)
40
+ SetTextTagColor(
41
+ self.handle,
42
+ red,
43
+ green,
44
+ blue,
45
+ alpha
46
+ )
47
+ end
48
+ function TextTag.prototype.setFadepoint(self, fadepoint)
49
+ SetTextTagFadepoint(self.handle, fadepoint)
50
+ end
51
+ function TextTag.prototype.setLifespan(self, lifespan)
52
+ SetTextTagLifespan(self.handle, lifespan)
53
+ end
54
+ function TextTag.prototype.setPermanent(self, flag)
55
+ SetTextTagPermanent(self.handle, flag)
56
+ end
57
+ function TextTag.prototype.setPos(self, x, y, heightOffset)
58
+ SetTextTagPos(self.handle, x, y, heightOffset)
59
+ end
60
+ function TextTag.prototype.setPosUnit(self, u, heightOffset)
61
+ SetTextTagPosUnit(self.handle, u.handle, heightOffset)
62
+ end
63
+ function TextTag.prototype.setSuspended(self, flag)
64
+ SetTextTagSuspended(self.handle, flag)
65
+ end
66
+ function TextTag.prototype.setText(self, s, height, adjustHeight)
67
+ if adjustHeight == nil then
68
+ adjustHeight = false
69
+ end
70
+ if adjustHeight then
71
+ height = height * 0.0023
72
+ end
73
+ SetTextTagText(self.handle, s, height)
74
+ end
75
+ function TextTag.prototype.setVelocity(self, xvel, yvel)
76
+ SetTextTagVelocity(self.handle, xvel, yvel)
77
+ end
78
+ function TextTag.prototype.setVelocityAngle(self, speed, angle)
79
+ local vel = speed * 0.071 / 128
80
+ self:setVelocity(
81
+ vel * Cos(angle * bj_DEGTORAD),
82
+ vel * Sin(angle * bj_DEGTORAD)
83
+ )
84
+ end
85
+ function TextTag.prototype.setVisible(self, flag)
86
+ SetTextTagVisibility(self.handle, flag)
87
+ end
88
+ function TextTag.fromHandle(self, handle)
89
+ local ____handle_0
90
+ if handle then
91
+ ____handle_0 = self:getObject(handle)
92
+ else
93
+ ____handle_0 = nil
94
+ end
95
+ return ____handle_0
96
+ end
97
+ return ____exports