mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-28 08:54:43 +00:00
load StateDriver libraries & update files as needed (Needs more testing)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
--[[
|
||||
Classy.lua
|
||||
A wrapper for defining classes that inherit from widgets
|
||||
--]]
|
||||
|
||||
local Classy = LibStub:NewLibrary('Classy-1.0', 0)
|
||||
if not Classy then return end
|
||||
|
||||
function Classy:New(frameType, parentClass)
|
||||
local class = CreateFrame(frameType)
|
||||
class.mt = {__index = class}
|
||||
|
||||
if parentClass then
|
||||
class = setmetatable(class, {__index = parentClass})
|
||||
|
||||
class.super = function(self, method, ...)
|
||||
parentClass[method](self, unpack(arg))
|
||||
end
|
||||
end
|
||||
|
||||
class.Bind = function(self, obj)
|
||||
return setmetatable(obj, self.mt)
|
||||
end
|
||||
|
||||
return class
|
||||
end
|
||||
Reference in New Issue
Block a user