21 lines
No EOL
608 B
Lua
21 lines
No EOL
608 B
Lua
local Parent = require "birb.modules.gui.elements.parent"
|
|
local LinkedElement = Parent:extend()
|
|
|
|
function LinkedElement:new(name, x, y, w, h, object, varName)
|
|
LinkedElement.super.new(self, name, x, y, w, h)
|
|
self.object = object
|
|
self.variables = {}
|
|
self:addVariable(varName, "main")
|
|
end
|
|
|
|
function LinkedElement:addVariable(varName, internalName)
|
|
internalName = internalName or varName
|
|
self.variables[internalName] = varName
|
|
end
|
|
|
|
function LinkedElement:getVariableContent(varName)
|
|
varName = varName or "main"
|
|
return self.object[self.variables[varName]]
|
|
end
|
|
|
|
return LinkedElement |