Update Button to Modern V2

This commit is contained in:
Clint 2024-06-28 15:50:28 +02:00 committed by GitHub
parent bf2709874a
commit 0c0b71d20a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,12 +1,13 @@
local types = require(script.Parent.Types) local types = require(script.Parent.Types)
local button: types.ButtonClass = {} :: types.ButtonClass local button = {} :: types.ButtonClass
button["__index"] = button button["__index"] = button
local module = {} local module = {}
function module.new(name: string): types.Button function module.new(name: string): types.Button
local self = setmetatable({ local self = setmetatable({
Status = "Stored",
Name= name, Name= name,
_ = {}, _ = {},
}, button) }, button)
@ -34,6 +35,14 @@ function button:Build(parent: types.Page | types.Component)
end end
end end
function button:GetStatus(): "Built" | "Stored"
return self._.Status
end
function button:StatusIs(status: "Built" | "Stored")
return status == self._.Status
end
function button:Open() function button:Open()
if self.ButtonGui then if self.ButtonGui then
self.ButtonGui.Active = true self.ButtonGui.Active = true
@ -104,4 +113,4 @@ function button:Remove()
end end
end end
return module return module