Update Button to Modern V2
This commit is contained in:
parent
bf2709874a
commit
0c0b71d20a
1 changed files with 11 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue