@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.
- package/out/client/touch-button.luau +33 -17
- package/package.json +1 -1
|
@@ -241,27 +241,43 @@ do
|
|
|
241
241
|
effect(function()
|
|
242
242
|
local isEditing = TouchButton.configEditingMode()
|
|
243
243
|
if isEditing then
|
|
244
|
-
local
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|