@rbxts/touch-button 1.0.6 → 1.0.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.
@@ -241,27 +241,43 @@ do
241
241
  effect(function()
242
242
  local isEditing = TouchButton.configEditingMode()
243
243
  if isEditing then
244
- local resetBtn = Instance.new("TextButton")
245
- resetBtn.Name = "Reset"
246
- resetBtn.AnchorPoint = Vector2.new(0.5, 0.5)
247
- resetBtn.BackgroundColor3 = Color3.new()
248
- resetBtn.BackgroundTransparency = 0.25
249
- resetBtn.FontFace = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Medium, Enum.FontStyle.Normal)
250
- resetBtn.Position = UDim2.fromScale(0.5, 0.5)
251
- resetBtn.Size = UDim2.fromOffset(120, 32)
252
- resetBtn.Text = "Reset Buttons"
253
- resetBtn.TextColor3 = Color3.new(1, 1, 1)
254
- resetBtn.TextSize = 16
255
- resetBtn.Parent = touchGui
256
- editingTrove:add(resetBtn)
257
- local UICorner = Instance.new("UICorner")
258
- UICorner.CornerRadius = UDim.new(0, 5)
259
- UICorner.Parent = resetBtn
260
- resetBtn.MouseButton1Click:Connect(function()
244
+ local createButton = function(props)
245
+ local btn = Instance.new("TextButton")
246
+ btn.Name = props.name
247
+ btn.AnchorPoint = Vector2.new(0.5, 0.5)
248
+ btn.BackgroundColor3 = props.backgroundColor
249
+ btn.BackgroundTransparency = 0.25
250
+ btn.FontFace = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Medium, Enum.FontStyle.Normal)
251
+ btn.Position = UDim2.new(0.5, 0, 0.5, props.offsetY)
252
+ btn.Size = UDim2.fromOffset(120, 32)
253
+ btn.Text = props.text
254
+ btn.TextColor3 = Color3.new(1, 1, 1)
255
+ btn.TextSize = 16
256
+ btn.Parent = touchGui
257
+ editingTrove:add(btn)
258
+ local UICorner = Instance.new("UICorner")
259
+ UICorner.CornerRadius = UDim.new(0, 5)
260
+ UICorner.Parent = btn
261
+ return btn
262
+ end
263
+ createButton({
264
+ name = "Reset",
265
+ text = "Reset Buttons",
266
+ backgroundColor = Color3.new(),
267
+ offsetY = -19,
268
+ }).MouseButton1Click:Connect(function()
261
269
  for _, touchBtn in TouchButton.touchButtons do
262
270
  touchBtn:resetConfigToDefault()
263
271
  end
264
272
  end)
273
+ createButton({
274
+ name = "Finish",
275
+ text = "Finish Editing",
276
+ backgroundColor = Color3.fromRGB(30, 175, 30),
277
+ offsetY = 19,
278
+ }).MouseButton1Click:Connect(function()
279
+ self.configEditingMode(false)
280
+ end)
265
281
  else
266
282
  editingTrove:clean()
267
283
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/touch-button",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
5
  "main": "out/init.lua",
6
6
  "scripts": {