Auto Hide Options Overhaul
This commit is contained in:
+19
-2
@@ -22,12 +22,29 @@ do
|
||||
WidgetType = "normal_bar",
|
||||
SetHook = DF.SetHook,
|
||||
RunHooksForWidget = DF.RunHooksForWidget,
|
||||
|
||||
dversion = DF.dversion,
|
||||
}
|
||||
|
||||
_G [DF.GlobalWidgetControlNames ["normal_bar"]] = _G [DF.GlobalWidgetControlNames ["normal_bar"]] or metaPrototype
|
||||
--check if there's a metaPrototype already existing
|
||||
if (_G[DF.GlobalWidgetControlNames["normal_bar"]]) then
|
||||
--get the already existing metaPrototype
|
||||
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
|
||||
--check if is older
|
||||
if ( (not oldMetaPrototype.dversion) or (oldMetaPrototype.dversion < DF.dversion) ) then
|
||||
--the version is older them the currently loading one
|
||||
--copy the new values into the old metatable
|
||||
for funcName, _ in pairs(metaPrototype) do
|
||||
oldMetaPrototype[funcName] = metaPrototype[funcName]
|
||||
end
|
||||
end
|
||||
else
|
||||
--first time loading the framework
|
||||
_G[DF.GlobalWidgetControlNames ["normal_bar"]] = metaPrototype
|
||||
end
|
||||
end
|
||||
|
||||
local BarMetaFunctions = _G [DF.GlobalWidgetControlNames ["normal_bar"]]
|
||||
local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> metatables
|
||||
|
||||
Reference in New Issue
Block a user