mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-31 04:51:40 +09:00
Remove anchor
This commit is contained in:
@@ -14,10 +14,6 @@ local ExpElement = {
|
|||||||
--- @alias ExpElement.PostDrawCallbackAdder fun(self: ExpElement, definition: table | ExpElement.PostDrawCallback): ExpElement
|
--- @alias ExpElement.PostDrawCallbackAdder fun(self: ExpElement, definition: table | ExpElement.PostDrawCallback): ExpElement
|
||||||
--- @alias ExpElement.OnEventAdder<E> fun(self: ExpElement, handler: fun(def: ExpElement, event: E)): ExpElement
|
--- @alias ExpElement.OnEventAdder<E> fun(self: ExpElement, handler: fun(def: ExpElement, event: E)): ExpElement
|
||||||
|
|
||||||
--- @class ExpElement.anchor: GuiAnchor
|
|
||||||
--- @field _def ExpElement
|
|
||||||
--- @overload fun(anchor: GuiAnchor): ExpElement
|
|
||||||
|
|
||||||
--- @class ExpElement._debug
|
--- @class ExpElement._debug
|
||||||
--- @field defined_at string
|
--- @field defined_at string
|
||||||
--- @field draw_definition table?
|
--- @field draw_definition table?
|
||||||
@@ -36,7 +32,6 @@ local ExpElement = {
|
|||||||
--- @class ExpElement
|
--- @class ExpElement
|
||||||
--- @field name string
|
--- @field name string
|
||||||
--- @field data ExpGui.GuiData
|
--- @field data ExpGui.GuiData
|
||||||
--- @field anchor ExpElement.anchor?
|
|
||||||
--- @field _debug ExpElement._debug
|
--- @field _debug ExpElement._debug
|
||||||
--- @field _draw ExpElement.DrawCallback?
|
--- @field _draw ExpElement.DrawCallback?
|
||||||
--- @field _style ExpElement.PostDrawCallback?
|
--- @field _style ExpElement.PostDrawCallback?
|
||||||
@@ -57,16 +52,6 @@ ExpElement._metatable = {
|
|||||||
__class = "ExpGui",
|
__class = "ExpGui",
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpElement._anchor_metatable = {
|
|
||||||
__call = function(self, anchor)
|
|
||||||
assert(type(table) == "table", "Anchor must be a table")
|
|
||||||
for k, v in pairs(anchor) do
|
|
||||||
self[k] = v
|
|
||||||
end
|
|
||||||
return self._def
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
--- Used to signal that a property should be taken from the arguments
|
--- Used to signal that a property should be taken from the arguments
|
||||||
--- @param arg_number number?
|
--- @param arg_number number?
|
||||||
--- @return [function, number?]
|
--- @return [function, number?]
|
||||||
@@ -98,6 +83,7 @@ function ExpElement.create(name)
|
|||||||
|
|
||||||
local instance = {
|
local instance = {
|
||||||
name = name,
|
name = name,
|
||||||
|
data = GuiData.create(name),
|
||||||
_events = {},
|
_events = {},
|
||||||
_debug = {
|
_debug = {
|
||||||
defined_at = ExpUtil.safe_file_path(2),
|
defined_at = ExpUtil.safe_file_path(2),
|
||||||
@@ -105,8 +91,6 @@ function ExpElement.create(name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ExpElement._elements[name] = instance
|
ExpElement._elements[name] = instance
|
||||||
instance.data = GuiData.create(name)
|
|
||||||
instance.anchor = setmetatable({ _def = instance }, ExpElement._anchor_metatable)
|
|
||||||
return setmetatable(instance, ExpElement._metatable)
|
return setmetatable(instance, ExpElement._metatable)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user