Skip to content

Commit

Permalink
v9.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Oct 16, 2020
1 parent 299fb53 commit 72f3ae8
Show file tree
Hide file tree
Showing 17 changed files with 1,891 additions and 400 deletions.
2 changes: 2 additions & 0 deletions libs/DF/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ cooltip_background.blp
feedback_sites.blp
icons.blp
mail.blp
*.json
CHANGES.txt
39 changes: 28 additions & 11 deletions libs/DF/auras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function DF:LoadAllSpells (hashMap, indexTable, allSpellsSameName)
--pre checking which tables to fill to avoid checking if the table exists during the gigantic loop for performance

if (not DF.LoadingAuraAlertFrame) then
DF.LoadingAuraAlertFrame = CreateFrame ("frame", "DetailsFrameworkLoadingAurasAlert", UIParent)
DF.LoadingAuraAlertFrame = CreateFrame ("frame", "DetailsFrameworkLoadingAurasAlert", UIParent, "BackdropTemplate")
DF.LoadingAuraAlertFrame:SetSize (340, 75)
DF.LoadingAuraAlertFrame:SetPoint ("center")
DF.LoadingAuraAlertFrame:SetFrameStrata ("TOOLTIP")
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -193,15 +210,15 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")
local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")

local f = CreateFrame ("frame", name, parent)
local f = CreateFrame ("frame", name, parent, "BackdropTemplate")
f.db = db
f.OnProfileChanged = on_profile_changed
f.LocTexts = texts
options = options or {}
self.table.deploy (options, aura_panel_defaultoptions)

local f_auto = CreateFrame ("frame", "$parent_Automatic", f)
local f_manual = CreateFrame ("frame", "$parent_Manual", f)
local f_auto = CreateFrame ("frame", "$parent_Automatic", f, "BackdropTemplate")
local f_manual = CreateFrame ("frame", "$parent_Manual", f, "BackdropTemplate")
f_auto:SetPoint ("topleft", f, "topleft", 0, -24)
f_manual:SetPoint ("topleft", f, "topleft", 0, -24)
f_auto:SetSize (600, 600)
Expand Down Expand Up @@ -239,7 +256,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
end
end

local background_method_selection = CreateFrame ("frame", nil, f)
local background_method_selection = CreateFrame ("frame", nil, f, "BackdropTemplate")
background_method_selection:SetHeight (82)
background_method_selection:SetPoint ("topleft", f, "topleft", 0, 0)
background_method_selection:SetPoint ("topright", f, "topright", 0, 0)
Expand Down Expand Up @@ -325,12 +342,12 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
local textEntryWidth = 120

--create the background
local background_add_blacklist = CreateFrame ("frame", nil, f_auto)
local background_add_blacklist = CreateFrame ("frame", nil, f_auto, "BackdropTemplate")
background_add_blacklist:SetSize (textEntryWidth + 10, 135)
DF:ApplyStandardBackdrop (background_add_blacklist)
background_add_blacklist.__background:SetVertexColor (0.47, 0.27, 0.27)

local background_add_tracklist = CreateFrame ("frame", nil, f_auto)
local background_add_tracklist = CreateFrame ("frame", nil, f_auto, "BackdropTemplate")
background_add_tracklist:SetSize (textEntryWidth + 10, 135)
DF:ApplyStandardBackdrop (background_add_tracklist)
background_add_tracklist.__background:SetVertexColor (0.27, 0.27, 0.47)
Expand Down Expand Up @@ -634,7 +651,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
end

local createLineFunc = function (self, index)
local line = CreateFrame ("button", "$parentLine" .. index, self)
local line = CreateFrame ("button", "$parentLine" .. index, self, "BackdropTemplate")
line:SetPoint ("topleft", self, "topleft", 1, - ((index - 1) * (lineHeight + 1)) - 1)
line:SetSize (scrollWidth - 2, lineHeight)
line:SetScript ("OnEnter", autoTrackList_LineOnEnter)
Expand Down Expand Up @@ -798,7 +815,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
end

local scroll_createline = function (self, index)
local line = CreateFrame ("button", "$parentLine" .. index, self)
local line = CreateFrame ("button", "$parentLine" .. index, self, "BackdropTemplate")
line:SetPoint ("topleft", self, "topleft", 1, -((index-1)*(scroll_line_height+1)) - 1)
line:SetSize (scroll_width - 2, scroll_line_height)
line:SetScript ("OnEnter", line_onenter)
Expand Down
37 changes: 34 additions & 3 deletions libs/DF/button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,32 @@ do
local metaPrototype = {
WidgetType = "button",
SetHook = DF.SetHook,
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
Expand Down Expand Up @@ -410,6 +429,18 @@ local ButtonMetaFunctions = _G [DF.GlobalWidgetControlNames ["button"]]
return self.icon:GetTexture()
end
end

function ButtonMetaFunctions:SetBackdrop(...)
return self.button:SetBackdrop(...)
end

function ButtonMetaFunctions:SetBackdropColor(...)
return self.button:SetBackdropColor(...)
end

function ButtonMetaFunctions:SetBackdropBorderColor(...)
return self.button:SetBackdropBorderColor(...)
end

function ButtonMetaFunctions:SetIcon (texture, width, height, layout, texcoord, overlay, textdistance, leftpadding, textheight, short_method)
if (not self.icon) then
Expand Down Expand Up @@ -1034,7 +1065,7 @@ function DF:NewButton (parent, container, name, member, w, h, func, param1, para
ButtonObject.container = container
ButtonObject.options = {OnGrab = false}

ButtonObject.button = CreateFrame ("button", name, parent)
ButtonObject.button = CreateFrame ("button", name, parent,"BackdropTemplate")
DF:Mixin (ButtonObject.button, DF.WidgetFunctions)

build_button (ButtonObject.button)
Expand Down
6 changes: 3 additions & 3 deletions libs/DF/cooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function DF:CreateCoolTip()
--> main frame
local frame1
if (not GameCooltipFrame1) then
frame1 = CreateFrame ("Frame", "GameCooltipFrame1", UIParent)
frame1 = CreateFrame ("Frame", "GameCooltipFrame1", UIParent,"TooltipBackdropTemplate")

tinsert (UISpecialFrames, "GameCooltipFrame1")
DF:CreateFlashAnimation (frame1)
Expand All @@ -299,7 +299,7 @@ function DF:CreateCoolTip()
--> secondary frame
local frame2
if (not GameCooltipFrame2) then
frame2 = CreateFrame ("Frame", "GameCooltipFrame2", UIParent)
frame2 = CreateFrame ("Frame", "GameCooltipFrame2", UIParent,"TooltipBackdropTemplate")

tinsert (UISpecialFrames, "GameCooltipFrame2")
DF:CreateFlashAnimation (frame2)
Expand Down Expand Up @@ -1621,7 +1621,7 @@ function DF:CreateCoolTip()

--> height
if (CoolTip.OptionsTable.AlignAsBlizzTooltip) then
local height = _math_max (8, menuButton.leftText:GetStringHeight(), menuButton.rightText:GetStringHeight(), menuButton.leftIcon:GetHeight(), menuButton.rightIcon:GetHeight())
local height = _math_max (2, menuButton.leftText:GetStringHeight(), menuButton.rightText:GetStringHeight(), menuButton.leftIcon:GetHeight(), menuButton.rightIcon:GetHeight(), CoolTip.OptionsTable.AlignAsBlizzTooltipForceHeight or 2)
menuButton:SetHeight (height)
menuButton:SetPoint ("top", frame1, "top", 0, temp)
temp = temp + ( height * -1)
Expand Down
Loading

0 comments on commit 72f3ae8

Please sign in to comment.