@rbxts/touch-button 1.0.0 → 1.0.2

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.
@@ -73,6 +73,11 @@ do
73
73
  end
74
74
  function TouchButton:constructor(options)
75
75
  self.configUpdateScheduled = false
76
+ for _1, otherTouchBtn in TouchButton.touchButtons do
77
+ local _arg0 = otherTouchBtn.name ~= options.name
78
+ local _arg1 = `A TouchButton with the name {options.name} already exists`
79
+ assert(_arg0, _arg1)
80
+ end
76
81
  self.name = options.name
77
82
  self.defaultConfig = {
78
83
  position = options.position,
@@ -283,6 +288,11 @@ do
283
288
  end
284
289
  function TouchButton:destroy()
285
290
  self.touchBtn:Destroy()
291
+ local _touchButtons = TouchButton.touchButtons
292
+ local _touchButtons_1 = TouchButton.touchButtons
293
+ local _self = self
294
+ local _arg0 = (table.find(_touchButtons_1, _self) or 0) - 1
295
+ table.remove(_touchButtons, _arg0 + 1)
286
296
  end
287
297
  TouchButton.configEditingMode = atom(false)
288
298
  TouchButton.touchButtons = {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/touch-button",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "main": "out/init.lua",
6
6
  "scripts": {