Auto Hide Options Overhaul

This commit is contained in:
Tercio Jose
2020-06-27 18:13:07 -03:00
parent 2d40243d25
commit e6dec35beb
12 changed files with 220 additions and 33 deletions
+19 -2
View File
@@ -130,12 +130,29 @@ do
WidgetType = "aura_tracker",
SetHook = DF.SetHook,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
_G [DF.GlobalWidgetControlNames ["aura_tracker"]] = _G [DF.GlobalWidgetControlNames ["aura_tracker"]] or metaPrototype
--check if there's a metaPrototype already existing
if (_G[DF.GlobalWidgetControlNames["aura_tracker"]]) then
--get the already existing metaPrototype
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames ["aura_tracker"]]
--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 ["aura_tracker"]] = metaPrototype
end
end
local AuraTrackerMetaFunctions = _G [DF.GlobalWidgetControlNames ["aura_tracker"]]
local AuraTrackerMetaFunctions = _G[DF.GlobalWidgetControlNames ["aura_tracker"]]
--create panels
local on_profile_changed = function (self, newdb)
+19 -2
View File
@@ -24,12 +24,29 @@ do
HasHook = DF.HasHook,
ClearHooks = DF.ClearHooks,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion
}
_G [DF.GlobalWidgetControlNames ["button"]] = _G [DF.GlobalWidgetControlNames ["button"]] or metaPrototype
--check if there's a metaPrototype already existing
if (_G[DF.GlobalWidgetControlNames["button"]]) then
--get the already existing metaPrototype
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames ["button"]]
--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 ["button"]] = metaPrototype
end
end
local ButtonMetaFunctions = _G [DF.GlobalWidgetControlNames ["button"]]
local ButtonMetaFunctions = _G[DF.GlobalWidgetControlNames ["button"]]
------------------------------------------------------------------------------------------------------------
--> metatables
+19 -2
View File
@@ -24,12 +24,29 @@ do
HasHook = DF.HasHook,
ClearHooks = DF.ClearHooks,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
_G [DF.GlobalWidgetControlNames ["dropdown"]] = _G [DF.GlobalWidgetControlNames ["dropdown"]] or metaPrototype
--check if there's a metaPrototype already existing
if (_G[DF.GlobalWidgetControlNames["dropdown"]]) then
--get the already existing metaPrototype
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames ["dropdown"]]
--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 ["dropdown"]] = metaPrototype
end
end
local DropDownMetaFunctions = _G [DF.GlobalWidgetControlNames ["dropdown"]]
local DropDownMetaFunctions = _G[DF.GlobalWidgetControlNames ["dropdown"]]
------------------------------------------------------------------------------------------------------------
--> metatables
+6 -5
View File
@@ -1,5 +1,5 @@
local dversion = 187
local dversion = 190
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
@@ -27,6 +27,8 @@ local UnitIsTapDenied = UnitIsTapDenied
SMALL_NUMBER = 0.000001
ALPHA_BLEND_AMOUNT = 0.8400251
DF.dversion = dversion
DF.AuthorInfo = {
Name = "Terciob",
Discord = "https://discord.gg/AGSzAZX",
@@ -3901,16 +3903,15 @@ end
do
local get = function(self)
local object = tremove(self.notUse, #self.notUse)
if (object) then
if (object) then
tinsert(self.inUse, object)
return object, false
else
--need to create the new object
local newObject = self.newObjectFunc(self, unpack(self.payload))
local newObject = self.newObjectFunc(self, unpack(self.payload))
if (newObject) then
tinsert(self.inUse, newObject)
return object, true
return newObject, true
end
end
end
+19 -2
View File
@@ -21,12 +21,29 @@ do
WidgetType = "label",
SetHook = DF.SetHook,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
_G [DF.GlobalWidgetControlNames ["label"]] = _G [DF.GlobalWidgetControlNames ["label"]] or metaPrototype
--check if there's a metaPrototype already existing
if (_G[DF.GlobalWidgetControlNames["label"]]) then
--get the already existing metaPrototype
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames ["label"]]
--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 ["label"]] = metaPrototype
end
end
local LabelMetaFunctions = _G [DF.GlobalWidgetControlNames ["label"]]
local LabelMetaFunctions = _G[DF.GlobalWidgetControlNames ["label"]]
------------------------------------------------------------------------------------------------------------
--> metatables
+19 -2
View File
@@ -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
+39 -5
View File
@@ -24,12 +24,29 @@ do
WidgetType = "panel",
SetHook = DF.SetHook,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
_G [DF.GlobalWidgetControlNames ["panel"]] = _G [DF.GlobalWidgetControlNames ["panel"]] or metaPrototype
--check if there's a metaPrototype already existing
if (_G[DF.GlobalWidgetControlNames["panel"]]) then
--get the already existing metaPrototype
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames ["panel"]]
--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 ["panel"]] = metaPrototype
end
end
local PanelMetaFunctions = _G [DF.GlobalWidgetControlNames ["panel"]]
local PanelMetaFunctions = _G[DF.GlobalWidgetControlNames ["panel"]]
--> mixin for options functions
DF.OptionsFunctions = {
@@ -7087,10 +7104,27 @@ DF.StatusBarFunctions = {
WidgetType = "healthBar",
SetHook = DF.SetHook,
RunHooksForWidget = DF.RunHooksForWidget,
}
_G [DF.GlobalWidgetControlNames ["healthBar"]] = _G [DF.GlobalWidgetControlNames ["healthBar"]] or healthBarMetaPrototype
local healthBarMetaFunctions = _G [DF.GlobalWidgetControlNames ["healthBar"]]
dversion = DF.dversion,
}
--check if there's a metaPrototype already existing
if (_G[DF.GlobalWidgetControlNames["healthBar"]]) then
--get the already existing metaPrototype
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames ["healthBar"]]
--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(healthBarMetaPrototype) do
oldMetaPrototype[funcName] = healthBarMetaPrototype[funcName]
end
end
else
--first time loading the framework
_G[DF.GlobalWidgetControlNames ["healthBar"]] = healthBarMetaPrototype
end
local healthBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["healthBar"]]
--hook list
local defaultHooksForHealthBar = {
+19 -2
View File
@@ -21,12 +21,29 @@ do
WidgetType = "image",
SetHook = DF.SetHook,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
_G [DF.GlobalWidgetControlNames ["image"]] = _G [DF.GlobalWidgetControlNames ["image"]] or metaPrototype
--check if there's a metaPrototype already existing
if (_G[DF.GlobalWidgetControlNames["image"]]) then
--get the already existing metaPrototype
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames ["image"]]
--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 ["image"]] = metaPrototype
end
end
local ImageMetaFunctions = _G [DF.GlobalWidgetControlNames ["image"]]
local ImageMetaFunctions = _G[DF.GlobalWidgetControlNames ["image"]]
------------------------------------------------------------------------------------------------------------
--> metatables
+18 -2
View File
@@ -26,12 +26,28 @@ do
ClearHooks = DF.ClearHooks,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
_G [DF.GlobalWidgetControlNames ["slider"]] = _G [DF.GlobalWidgetControlNames ["slider"]] or metaPrototype
--check if there's a metaPrototype already existing
if (_G[DF.GlobalWidgetControlNames["slider"]]) then
--get the already existing metaPrototype
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames ["slider"]]
--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 ["slider"]] = metaPrototype
end
end
local DFSliderMetaFunctions = _G [DF.GlobalWidgetControlNames ["slider"]]
local DFSliderMetaFunctions = _G[DF.GlobalWidgetControlNames ["slider"]]
------------------------------------------------------------------------------------------------------------
--> metatables
+19 -2
View File
@@ -20,12 +20,29 @@ do
WidgetType = "split_bar",
SetHook = DF.SetHook,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
_G [DF.GlobalWidgetControlNames ["split_bar"]] = _G [DF.GlobalWidgetControlNames ["split_bar"]] or metaPrototype
--check if there's a metaPrototype already existing
if (_G[DF.GlobalWidgetControlNames["split_bar"]]) then
--get the already existing metaPrototype
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames ["split_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 ["split_bar"]] = metaPrototype
end
end
local SplitBarMetaFunctions = _G [DF.GlobalWidgetControlNames ["split_bar"]]
local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
------------------------------------------------------------------------------------------------------------
--> metatables
+19 -2
View File
@@ -25,12 +25,29 @@ do
HasHook = DF.HasHook,
ClearHooks = DF.ClearHooks,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
_G [DF.GlobalWidgetControlNames ["textentry"]] = _G [DF.GlobalWidgetControlNames ["textentry"]] or metaPrototype
--check if there's a metaPrototype already existing
if (_G[DF.GlobalWidgetControlNames["textentry"]]) then
--get the already existing metaPrototype
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames ["textentry"]]
--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 ["textentry"]] = metaPrototype
end
end
local TextEntryMetaFunctions = _G [DF.GlobalWidgetControlNames ["textentry"]]
local TextEntryMetaFunctions = _G[DF.GlobalWidgetControlNames ["textentry"]]
DF.TextEntryCounter = DF.TextEntryCounter or 1
------------------------------------------------------------------------------------------------------------
+5 -5
View File
File diff suppressed because one or more lines are too long