diff --git a/Details-BCC.toc b/Details-BCC.toc
index 6d6ade4a..a4354dfb 100644
--- a/Details-BCC.toc
+++ b/Details-BCC.toc
@@ -41,6 +41,7 @@ functions\savedata.lua
functions\slash.lua
functions\playerclass.lua
functions\timedata.lua
+functions\currentdps.lua
functions\report.lua
functions\rowanimation.lua
functions\raidinfo.lua
diff --git a/Details.toc b/Details.toc
index 76d5b175..acb2cc2f 100644
--- a/Details.toc
+++ b/Details.toc
@@ -43,6 +43,7 @@ functions\savedata.lua
functions\slash.lua
functions\playerclass.lua
functions\timedata.lua
+functions\currentdps.lua
functions\report.lua
functions\rowanimation.lua
functions\raidinfo.lua
diff --git a/Libs/DF/button.lua b/Libs/DF/button.lua
index 7eede29a..bc74989d 100644
--- a/Libs/DF/button.lua
+++ b/Libs/DF/button.lua
@@ -1200,8 +1200,8 @@ end
local color_button_height = 16
local color_button_width = 16
-local set_colorpick_color = function (button, r, g, b, a)
- a = a or 1
+local setColorPickColor = function (button, r, g, b, a)
+ r, g, b, a = DF:ParseColors(r, g, b, a)
button.color_texture:SetVertexColor (r, g, b, a)
end
@@ -1209,20 +1209,24 @@ local colorpick_cancel = function (self)
ColorPickerFrame:Hide()
end
+local getColorPickColor = function(self)
+ return self.color_texture:GetVertexColor()
+end
+
function DF:CreateColorPickButton (parent, name, member, callback, alpha, button_template)
return DF:NewColorPickButton (parent, name, member, callback, alpha, button_template)
end
function DF:NewColorPickButton (parent, name, member, callback, alpha, button_template)
-
--button
local button = DF:NewButton (parent, _, name, member, color_button_width, color_button_height, pickcolor, alpha, "param2", nil, nil, nil, button_template)
button.color_callback = callback
button.Cancel = colorpick_cancel
- button.SetColor = set_colorpick_color
-
+ button.SetColor = setColorPickColor
+ button.GetColor = getColorPickColor
+
button.HookList.OnColorChanged = {}
-
+
if (not button_template) then
button:InstallCustomTexture()
button:SetBackdrop ({edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 6,
@@ -1242,7 +1246,6 @@ function DF:NewColorPickButton (parent, name, member, callback, alpha, button_te
img:SetPoint ("topleft", button.widget, "topleft", 0, 0)
img:SetPoint ("bottomright", button.widget, "bottomright", 0, 0)
img:SetDrawLayer ("background", 3)
-
+
return button
-
end
diff --git a/Libs/DF/dropdown.lua b/Libs/DF/dropdown.lua
index 6eaa8988..218546c6 100644
--- a/Libs/DF/dropdown.lua
+++ b/Libs/DF/dropdown.lua
@@ -1,20 +1,10 @@
local DF = _G ["DetailsFramework"]
if (not DF or not DetailsFrameworkCanLoad) then
- return
+ return
end
local _
-local _rawset = rawset --> lua local
-local _rawget = rawget --> lua local
-local _setmetatable = setmetatable --> lua local
-local _unpack = unpack --> lua local
-local _type = type --> lua local
-local _math_floor = math.floor --> lua local
-local loadstring = loadstring --> lua local
-local _string_len = string.len --> lua local
-
-local cleanfunction = function() end
local APIDropDownFunctions = false
do
@@ -24,14 +14,13 @@ do
HasHook = DF.HasHook,
ClearHooks = DF.ClearHooks,
RunHooksForWidget = DF.RunHooksForWidget,
-
dversion = DF.dversion,
}
--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"]]
+ 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
@@ -42,59 +31,59 @@ do
end
else
--first time loading the framework
- _G[DF.GlobalWidgetControlNames ["dropdown"]] = metaPrototype
+ _G[DF.GlobalWidgetControlNames["dropdown"]] = metaPrototype
end
end
-local DropDownMetaFunctions = _G[DF.GlobalWidgetControlNames ["dropdown"]]
+local DropDownMetaFunctions = _G[DF.GlobalWidgetControlNames["dropdown"]]
------------------------------------------------------------------------------------------------------------
---> metatables
+--metatables
- DropDownMetaFunctions.__call = function (_table, value)
- --> unknow
+ DropDownMetaFunctions.__call = function(_table, value)
+ --unknown
end
-
+
------------------------------------------------------------------------------------------------------------
--> members
- --> selected value
- local gmember_value = function (_object)
- return _object:GetValue()
+ --selected value
+ local gmember_value = function(object)
+ return object:GetValue()
end
- --> tooltip
- local gmember_tooltip = function (_object)
- return _object:GetTooltip()
+ --tooltip
+ local gmember_tooltip = function(object)
+ return object:GetTooltip()
end
- --> shown
- local gmember_shown = function (_object)
- return _object:IsShown()
+ --shown
+ local gmember_shown = function(object)
+ return object:IsShown()
end
- --> frame width
- local gmember_width = function (_object)
- return _object.button:GetWidth()
+ --frame width
+ local gmember_width = function(object)
+ return object.button:GetWidth()
end
- --> frame height
- local gmember_height = function (_object)
- return _object.button:GetHeight()
+ --frame height
+ local gmember_height = function(object)
+ return object.button:GetHeight()
end
- --> current text
- local gmember_text = function (_object)
- return _object.label:GetText()
+ --current text
+ local gmember_text = function(object)
+ return object.label:GetText()
end
- --> menu creation function
- local gmember_function = function (_object)
- return _object:GetFunction()
+ --menu creation function
+ local gmember_function = function(object)
+ return object:GetFunction()
end
- --> menu width
- local gmember_menuwidth = function (_object)
- return _rawget (self, "realsizeW")
+ --menu width
+ local gmember_menuwidth = function(object)
+ return rawget(object, "realsizeW")
end
- --> menu height
- local gmember_menuheight = function (_object)
- return _rawget (self, "realsizeH")
+ --menu height
+ local gmember_menuheight = function(object)
+ return rawget(object, "realsizeH")
end
-
+
DropDownMetaFunctions.GetMembers = DropDownMetaFunctions.GetMembers or {}
DropDownMetaFunctions.GetMembers ["value"] = gmember_value
DropDownMetaFunctions.GetMembers ["text"] = gmember_text
@@ -105,65 +94,64 @@ local DropDownMetaFunctions = _G[DF.GlobalWidgetControlNames ["dropdown"]]
DropDownMetaFunctions.GetMembers ["menuheight"] = gmember_menuheight
DropDownMetaFunctions.GetMembers ["tooltip"] = gmember_tooltip
DropDownMetaFunctions.GetMembers ["func"] = gmember_function
-
- DropDownMetaFunctions.__index = function (_table, _member_requested)
- local func = DropDownMetaFunctions.GetMembers [_member_requested]
+ DropDownMetaFunctions.__index = function(object, memberName)
+ local func = DropDownMetaFunctions.GetMembers[memberName]
if (func) then
- return func (_table, _member_requested)
+ return func(object, memberName)
end
-
- local fromMe = _rawget (_table, _member_requested)
+
+ local fromMe = rawget(object, memberName)
if (fromMe) then
return fromMe
end
-
- return DropDownMetaFunctions [_member_requested]
+
+ return DropDownMetaFunctions[memberName]
end
-
+
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- --> tooltip
- local smember_tooltip = function (_object, _value)
- return _object:SetTooltip (_value)
+ --tooltip
+ local smember_tooltip = function(object, value)
+ return object:SetTooltip(value)
end
- --> show
- local smember_show = function (_object, _value)
- if (_value) then
- return _object:Show()
+ --show
+ local smember_show = function(object, value)
+ if (value) then
+ return object:Show()
else
- return _object:Hide()
+ return object:Hide()
end
end
- --> hide
- local smember_hide = function (_object, _value)
- if (not _value) then
- return _object:Show()
+ --hide
+ local smember_hide = function(object, value)
+ if (not value) then
+ return object:Show()
else
- return _object:Hide()
+ return object:Hide()
end
end
- --> frame width
- local smember_width = function (_object, _value)
- return _object.dropdown:SetWidth (_value)
+ --frame width
+ local smember_width = function(object, value)
+ return object.dropdown:SetWidth(value)
end
- --> frame height
- local smember_height = function (_object, _value)
- return _object.dropdown:SetHeight (_value)
+ --frame height
+ local smember_height = function(object, value)
+ return object.dropdown:SetHeight(value)
end
- --> menu creation function
- local smember_function = function (_object, _value)
- return _object:SetFunction (_value)
+ --menu creation function
+ local smember_function = function(object, value)
+ return object:SetFunction(value)
end
- --> menu width
- local smember_menuwidth = function (_object, _value)
- _object:SetMenuSize (_value, nil)
+ --menu width
+ local smember_menuwidth = function(object, value)
+ object:SetMenuSize(value, nil)
end
- --> menu height
- local smember_menuheight = function (_object, _value)
- _object:SetMenuSize (nil, _value)
+ --menu height
+ local smember_menuheight = function(object, value)
+ object:SetMenuSize(nil, value)
end
-
+
DropDownMetaFunctions.SetMembers = DropDownMetaFunctions.SetMembers or {}
DropDownMetaFunctions.SetMembers ["tooltip"] = smember_tooltip
DropDownMetaFunctions.SetMembers ["show"] = smember_show
@@ -173,13 +161,13 @@ local DropDownMetaFunctions = _G[DF.GlobalWidgetControlNames ["dropdown"]]
DropDownMetaFunctions.SetMembers ["height"] = smember_height
DropDownMetaFunctions.SetMembers ["menuheight"] = smember_menuheight
DropDownMetaFunctions.SetMembers ["func"] = smember_function
-
- DropDownMetaFunctions.__newindex = function (_table, _key, _value)
- local func = DropDownMetaFunctions.SetMembers [_key]
+
+ DropDownMetaFunctions.__newindex = function(object, key, value)
+ local func = DropDownMetaFunctions.SetMembers[key]
if (func) then
- return func (_table, _value)
+ return func(object, value)
else
- return _rawset (_table, _key, _value)
+ return rawset(object, key, value)
end
end
@@ -209,76 +197,76 @@ end
end
--> menu width and height
- function DropDownMetaFunctions:SetMenuSize (w, h)
- if (w) then
- return _rawset (self, "realsizeW", w)
+ function DropDownMetaFunctions:SetMenuSize(width, height)
+ if (width) then
+ return rawset(self, "realsizeW", width)
end
- if (h) then
- return _rawset (self, "realsizeH", h)
+ if (height) then
+ return rawset(self, "realsizeH", height)
end
end
function DropDownMetaFunctions:GetMenuSize()
- return _rawget (self, "realsizeW"), _rawget (self, "realsizeH")
+ return rawget(self, "realsizeW"), rawget(self, "realsizeH")
end
-
+
--> function
- function DropDownMetaFunctions:SetFunction (func)
- return _rawset (self, "func", func)
+ function DropDownMetaFunctions:SetFunction(func)
+ return rawset(self, "func", func)
end
function DropDownMetaFunctions:GetFunction()
- return _rawget (self, "func")
+ return rawget(self, "func")
end
-
+
--> value
function DropDownMetaFunctions:GetValue()
- return _rawget (self, "myvalue")
+ return rawget(self, "myvalue")
end
- function DropDownMetaFunctions:SetValue (value)
- return _rawset (self, "myvalue", value)
+ function DropDownMetaFunctions:SetValue(value)
+ return rawset(self, "myvalue", value)
end
--> setpoint
- function DropDownMetaFunctions:SetPoint (v1, v2, v3, v4, v5)
- v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self)
+ function DropDownMetaFunctions:SetPoint(v1, v2, v3, v4, v5)
+ v1, v2, v3, v4, v5 = DF:CheckPoints(v1, v2, v3, v4, v5, self)
if (not v1) then
- print ("Invalid parameter for SetPoint")
+ print("Invalid parameter for SetPoint")
return
end
- return self.widget:SetPoint (v1, v2, v3, v4, v5)
+ return self.widget:SetPoint(v1, v2, v3, v4, v5)
end
--> sizes
- function DropDownMetaFunctions:SetSize (w, h)
- if (w) then
- self.dropdown:SetWidth (w)
+ function DropDownMetaFunctions:SetSize(width, height)
+ if (width) then
+ self.dropdown:SetWidth(width)
end
- if (h) then
- return self.dropdown:SetHeight (h)
+ if (height) then
+ return self.dropdown:SetHeight(height)
end
end
-
+
--> tooltip
- function DropDownMetaFunctions:SetTooltip (tooltip)
+ function DropDownMetaFunctions:SetTooltip(tooltip)
if (tooltip) then
- return _rawset (self, "have_tooltip", tooltip)
+ return rawset(self, "have_tooltip", tooltip)
else
- return _rawset (self, "have_tooltip", nil)
+ return rawset(self, "have_tooltip", nil)
end
end
function DropDownMetaFunctions:GetTooltip()
- return _rawget (self, "have_tooltip")
+ return rawget(self, "have_tooltip")
end
-
+
--> frame levels
function DropDownMetaFunctions:GetFrameLevel()
return self.dropdown:GetFrameLevel()
end
- function DropDownMetaFunctions:SetFrameLevel (level, frame)
+ function DropDownMetaFunctions:SetFrameLevel(level, frame)
if (not frame) then
- return self.dropdown:SetFrameLevel (level)
+ return self.dropdown:SetFrameLevel(level)
else
- local framelevel = frame:GetFrameLevel (frame) + level
- return self.dropdown:SetFrameLevel (framelevel)
+ local framelevel = frame:GetFrameLevel(frame) + level
+ return self.dropdown:SetFrameLevel(framelevel)
end
end
@@ -286,50 +274,47 @@ end
function DropDownMetaFunctions:GetFrameStrata()
return self.dropdown:GetFrameStrata()
end
- function DropDownMetaFunctions:SetFrameStrata (strata)
- if (_type (strata) == "table") then
- self.dropdown:SetFrameStrata (strata:GetFrameStrata())
+ function DropDownMetaFunctions:SetFrameStrata(strata)
+ if (type(strata) == "table") then
+ self.dropdown:SetFrameStrata(strata:GetFrameStrata())
else
- self.dropdown:SetFrameStrata (strata)
+ self.dropdown:SetFrameStrata(strata)
end
end
-
+
--> enabled
function DropDownMetaFunctions:IsEnabled()
return self.dropdown:IsEnabled()
end
-
+
function DropDownMetaFunctions:Enable()
-
- self:SetAlpha (1)
- _rawset (self, "lockdown", false)
-
+
+ self:SetAlpha(1)
+ rawset(self, "lockdown", false)
+
if (self.OnEnable) then
- self.OnEnable (self)
+ self.OnEnable(self)
end
- --return self.dropdown:Enable()
end
-
+
function DropDownMetaFunctions:Disable()
-
- self:SetAlpha (.4)
- _rawset (self, "lockdown", true)
-
+ self:SetAlpha(.4)
+ rawset(self, "lockdown", true)
+
if (self.OnDisable) then
- self.OnDisable (self)
+ self.OnDisable(self)
end
- --return self.dropdown:Disable()
end
--> fixed value
- function DropDownMetaFunctions:SetFixedParameter (value)
- _rawset (self, "FixedValue", value)
+ function DropDownMetaFunctions:SetFixedParameter(value)
+ rawset(self, "FixedValue", value)
end
-
+
------------------------------------------------------------------------------------------------------------
--> scripts
-local last_opened = false
+local lastOpened = false
local isOptionVisible = function(self, thisOption)
if (type(thisOption.shown) == "boolean") then
@@ -392,36 +377,36 @@ function DropDownMetaFunctions:NoOptionSelected()
return
end
- self.label:SetText (self.empty_text or "no option selected")
- self.label:SetPoint ("left", self.icon, "right", 2, 0)
- self.label:SetTextColor (1, 1, 1, 0.4)
+ self.label:SetText(self.empty_text or "no option selected")
+ self.label:SetPoint("left", self.icon, "right", 2, 0)
+ self.label:SetTextColor(1, 1, 1, 0.4)
if (self.empty_icon) then
- self.icon:SetTexture (self.empty_icon)
+ self.icon:SetTexture(self.empty_icon)
else
- self.icon:SetTexture ([[Interface\COMMON\UI-ModelControlPanel]])
- self.icon:SetTexCoord (0.625, 0.78125, 0.328125, 0.390625)
+ self.icon:SetTexture([[Interface\COMMON\UI-ModelControlPanel]])
+ self.icon:SetTexCoord(0.625, 0.78125, 0.328125, 0.390625)
end
- self.icon:SetVertexColor (1, 1, 1, 0.4)
+ self.icon:SetVertexColor(1, 1, 1, 0.4)
self.last_select = nil
end
function DropDownMetaFunctions:NoOption(state)
if (state) then
self:Disable()
- self:SetAlpha (0.5)
+ self:SetAlpha(0.5)
self.no_options = true
- self.label:SetText ("no options")
- self.label:SetPoint ("left", self.icon, "right", 2, 0)
- self.label:SetTextColor (1, 1, 1, 0.4)
- self.icon:SetTexture ([[Interface\CHARACTERFRAME\UI-Player-PlayTimeUnhealthy]])
- self.icon:SetTexCoord (0, 1, 0, 1)
- self.icon:SetVertexColor (1, 1, 1, 0.4)
+ self.label:SetText("no options")
+ self.label:SetPoint("left", self.icon, "right", 2, 0)
+ self.label:SetTextColor(1, 1, 1, 0.4)
+ self.icon:SetTexture([[Interface\CHARACTERFRAME\UI-Player-PlayTimeUnhealthy]])
+ self.icon:SetTexCoord(0, 1, 0, 1)
+ self.icon:SetVertexColor(1, 1, 1, 0.4)
else
self.no_options = false
self:Enable()
- self:SetAlpha (1)
+ self:SetAlpha(1)
end
end
@@ -458,7 +443,7 @@ end
--@onlyShown: the selected option index when selecting by option number must be visible
--@runCallback: run the callback (onclick) function after selecting the option
function DropDownMetaFunctions:Select(optionName, byOptionNumber, onlyShown, runCallback)
- if (type (optionName) == "boolean" and not optionName) then
+ if (type(optionName) == "boolean" and not optionName) then
self:NoOptionSelected()
return false
end
@@ -577,7 +562,7 @@ function DropDownMetaFunctions:Selected(thisOption)
self.icon:SetVertexColor(1, 1, 1, 1)
end
- self.icon:SetSize(self:GetHeight()-2, self:GetHeight()-2)
+ self.icon:SetSize(self:GetHeight()-4, self:GetHeight()-4)
else
self.label:SetPoint("left", self.label:GetParent(), "left", 4, 0)
end
@@ -626,10 +611,10 @@ function DropDownMetaFunctions:Open()
self.dropdown.dropdownframe:Show()
self.dropdown.dropdownborder:Show()
self.opened = true
- if (last_opened) then
- last_opened:Close()
+ if (lastOpened) then
+ lastOpened:Close()
end
- last_opened = self
+ lastOpened = self
end
function DropDownMetaFunctions:Close()
@@ -644,7 +629,7 @@ function DropDownMetaFunctions:Close()
selectedTexture:Hide()
self.opened = false
- last_opened = false
+ lastOpened = false
end
--close by escape key
@@ -756,7 +741,7 @@ function DetailsFrameworkDropDownOnMouseDown(button, buttontype)
if (thisOption.iconsize) then
thisOptionFrame.icon:SetSize(thisOption.iconsize[1], thisOption.iconsize[2])
else
- thisOptionFrame.icon:SetSize(20, 20)
+ thisOptionFrame.icon:SetSize(thisOptionFrame:GetHeight()-6, thisOptionFrame:GetHeight()-6)
end
if (thisOption.font) then
@@ -893,140 +878,137 @@ function DetailsFrameworkDropDownOnMouseDown(button, buttontype)
end
end
-function DetailsFrameworkDropDownOnEnter (self)
-
+function DetailsFrameworkDropDownOnEnter(self)
local capsule = self.MyObject
- local kill = capsule:RunHooksForWidget ("OnEnter", self, capsule)
+ local kill = capsule:RunHooksForWidget("OnEnter", self, capsule)
if (kill) then
return
end
if (self.MyObject.onenter_backdrop) then
- self:SetBackdropColor (unpack (self.MyObject.onenter_backdrop))
+ self:SetBackdropColor(unpack(self.MyObject.onenter_backdrop))
else
- self:SetBackdropColor (.2, .2, .2, .2)
+ self:SetBackdropColor(.2, .2, .2, .2)
end
-
+
if (self.MyObject.onenter_backdrop_border_color) then
- self:SetBackdropBorderColor (unpack (self.MyObject.onenter_backdrop_border_color))
+ self:SetBackdropBorderColor(unpack(self.MyObject.onenter_backdrop_border_color))
end
-
+
self.arrowTexture2:Show()
-
- if (self.MyObject.have_tooltip) then
- GameCooltip2:Preset (2)
-
- if (type (self.MyObject.have_tooltip) == "function") then
- GameCooltip2:AddLine (self.MyObject.have_tooltip() or "")
+ if (self.MyObject.have_tooltip) then
+ GameCooltip2:Preset(2)
+
+ if (type(self.MyObject.have_tooltip) == "function") then
+ GameCooltip2:AddLine(self.MyObject.have_tooltip() or "")
else
- GameCooltip2:AddLine (self.MyObject.have_tooltip)
+ GameCooltip2:AddLine(self.MyObject.have_tooltip)
end
- GameCooltip2:SetOwner (self)
+ GameCooltip2:SetOwner(self)
GameCooltip2:ShowCooltip()
end
-
end
-function DetailsFrameworkDropDownOnLeave (self)
+function DetailsFrameworkDropDownOnLeave(self)
local capsule = self.MyObject
- local kill = capsule:RunHooksForWidget ("OnLeave", self, capsule)
+ local kill = capsule:RunHooksForWidget("OnLeave", self, capsule)
if (kill) then
return
end
if (self.MyObject.onleave_backdrop) then
- self:SetBackdropColor (unpack (self.MyObject.onleave_backdrop))
+ self:SetBackdropColor(unpack(self.MyObject.onleave_backdrop))
else
- self:SetBackdropColor (1, 1, 1, .5)
+ self:SetBackdropColor(1, 1, 1, .5)
end
-
+
if (self.MyObject.onleave_backdrop_border_color) then
- self:SetBackdropBorderColor (unpack (self.MyObject.onleave_backdrop_border_color))
+ self:SetBackdropBorderColor(unpack(self.MyObject.onleave_backdrop_border_color))
end
-
+
self.arrowTexture2:Hide()
-
- if (self.MyObject.have_tooltip) then
- GameCooltip2:ShowMe (false)
+
+ if (self.MyObject.have_tooltip) then
+ GameCooltip2:ShowMe(false)
end
end
-function DetailsFrameworkDropDownOnSizeChanged (self, w, h)
- self.MyObject.label:SetSize (self:GetWidth()-40, 10)
+function DetailsFrameworkDropDownOnSizeChanged(self)
+ self.MyObject.label:SetSize(self:GetWidth()-40, 10)
end
-function DetailsFrameworkDropDownOnShow (self)
+function DetailsFrameworkDropDownOnShow(self)
local capsule = self.MyObject
- local kill = capsule:RunHooksForWidget ("OnShow", self, capsule)
+ local kill = capsule:RunHooksForWidget("OnShow", self, capsule)
if (kill) then
return
end
end
-function DetailsFrameworkDropDownOnHide (self)
+function DetailsFrameworkDropDownOnHide(self)
local capsule = self.MyObject
- local kill = capsule:RunHooksForWidget ("OnHide", self, capsule)
+ local kill = capsule:RunHooksForWidget("OnHide", self, capsule)
if (kill) then
return
end
-
self.MyObject:Close()
end
-function DF:BuildDropDownFontList (on_click, icon, icon_texcoord, icon_size)
+function DF:BuildDropDownFontList(onClick, icon, iconTexcoord, iconSize)
local t = {}
- local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
- for name, fontPath in pairs (SharedMedia:HashTable ("font")) do
- t[#t+1] = {value = name, label = name, onclick = on_click, icon = icon, iconsize = icon_size, texcoord = icon_texcoord, font = fontPath, descfont = "abcdefg ABCDEFG"}
+ local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
+ for name, fontPath in pairs(SharedMedia:HashTable("font")) do
+ t[#t+1] = {value = name, label = name, onclick = onClick, icon = icon, iconsize = iconSize, texcoord = iconTexcoord, font = fontPath, descfont = "abcdefg ABCDEFG"}
end
- table.sort (t, function (t1, t2) return t1.label < t2.label end)
+ table.sort(t, function(t1, t2) return t1.label < t2.label end)
return t
end
------------------------------------------------------------------------------------------------------------
-function DropDownMetaFunctions:SetTemplate (template)
+--> template
+function DropDownMetaFunctions:SetTemplate(template)
self.template = template
if (template.width) then
- self:SetWidth (template.width)
+ self:SetWidth(template.width)
end
if (template.height) then
- self:SetHeight (template.height)
+ self:SetHeight(template.height)
end
-
+
if (template.backdrop) then
- self:SetBackdrop (template.backdrop)
+ self:SetBackdrop(template.backdrop)
end
if (template.backdropcolor) then
- local r, g, b, a = DF:ParseColors (template.backdropcolor)
- self:SetBackdropColor (r, g, b, a)
+ local r, g, b, a = DF:ParseColors(template.backdropcolor)
+ self:SetBackdropColor(r, g, b, a)
self.onleave_backdrop = {r, g, b, a}
end
if (template.backdropbordercolor) then
- local r, g, b, a = DF:ParseColors (template.backdropbordercolor)
- self:SetBackdropBorderColor (r, g, b, a)
+ local r, g, b, a = DF:ParseColors(template.backdropbordercolor)
+ self:SetBackdropBorderColor(r, g, b, a)
self.onleave_backdrop_border_color = {r, g, b, a}
end
if (template.onentercolor) then
- local r, g, b, a = DF:ParseColors (template.onentercolor)
+ local r, g, b, a = DF:ParseColors(template.onentercolor)
self.onenter_backdrop = {r, g, b, a}
end
-
+
if (template.onleavecolor) then
- local r, g, b, a = DF:ParseColors (template.onleavecolor)
+ local r, g, b, a = DF:ParseColors(template.onleavecolor)
self.onleave_backdrop = {r, g, b, a}
end
-
+
if (template.onenterbordercolor) then
- local r, g, b, a = DF:ParseColors (template.onenterbordercolor)
+ local r, g, b, a = DF:ParseColors(template.onenterbordercolor)
self.onenter_backdrop_border_color = {r, g, b, a}
end
if (template.onleavebordercolor) then
- local r, g, b, a = DF:ParseColors (template.onleavebordercolor)
+ local r, g, b, a = DF:ParseColors(template.onleavebordercolor)
self.onleave_backdrop_border_color = {r, g, b, a}
end
@@ -1061,286 +1043,268 @@ function DropDownMetaFunctions:RefreshDropIcon()
self.dropdown.arrowTexture:SetPoint("right", self.dropdown, "right", unpack(template.dropiconpoints))
self.dropdown.arrowTexture2:SetPoint("right", self.dropdown, "right", unpack(template.dropiconpoints))
end
-
-
end
end
------------------------------------------------------------------------------------------------------------
--> object constructor
-function DF:CreateDropDown (parent, func, default, w, h, member, name, template)
- return DF:NewDropDown (parent, parent, name, member, w, h, func, default, template)
+function DF:CreateDropDown(parent, func, default, width, height, member, name, template)
+ return DF:NewDropDown(parent, parent, name, member, width, height, func, default, template)
end
-function DF:NewDropDown (parent, container, name, member, w, h, func, default, template)
-
+function DF:NewDropDown(parent, container, name, member, width, height, func, default, template)
if (not name) then
name = "DetailsFrameworkDropDownNumber" .. DF.DropDownCounter
DF.DropDownCounter = DF.DropDownCounter + 1
-
+
elseif (not parent) then
- return error ("Details! FrameWork: parent not found.", 2)
+ return error("Details! FrameWork: parent not found.", 2)
end
+
if (not container) then
container = parent
end
-
- if (name:find ("$parent")) then
- local parentName = DF.GetParentName (parent)
- name = name:gsub ("$parent", parentName)
+
+ if (name:find("$parent")) then
+ local parentName = DF.GetParentName(parent)
+ name = name:gsub("$parent", parentName)
end
-
- local DropDownObject = {type = "dropdown", dframework = true}
-
+
+ local dropDownObject = {type = "dropdown", dframework = true}
+
if (member) then
- parent [member] = DropDownObject
- end
-
+ parent[member] = dropDownObject
+ end
+
if (parent.dframework) then
parent = parent.widget
end
if (container.dframework) then
container = container.widget
- end
-
+ end
+
if (default == nil) then
default = 1
end
- --> default members:
- --> misc
- DropDownObject.container = container
-
- DropDownObject.dropdown = DF:CreateNewDropdownFrame (parent, name)
-
- DropDownObject.widget = DropDownObject.dropdown
-
- DropDownObject.__it = {nil, nil}
+ dropDownObject.dropdown = DF:CreateNewDropdownFrame(parent, name)
+ dropDownObject.dropdown:SetWidth(width)
+ dropDownObject.dropdown:SetHeight(height)
+
+ dropDownObject.container = container
+ dropDownObject.widget = dropDownObject.dropdown
+ dropDownObject.dropdown.MyObject = dropDownObject
if (not APIDropDownFunctions) then
APIDropDownFunctions = true
- local idx = getmetatable (DropDownObject.dropdown).__index
- for funcName, funcAddress in pairs (idx) do
- if (not DropDownMetaFunctions [funcName]) then
- DropDownMetaFunctions [funcName] = function (object, ...)
- local x = loadstring ( "return _G['"..object.dropdown:GetName().."']:"..funcName.."(...)")
- return x (...)
+ local idx = getmetatable(dropDownObject.dropdown).__index
+ for funcName, funcAddress in pairs(idx) do
+ if (not DropDownMetaFunctions[funcName]) then
+ DropDownMetaFunctions[funcName] = function(object, ...)
+ local x = loadstring( "return _G['"..object.dropdown:GetName().."']:"..funcName.."(...)")
+ return x(...)
end
end
end
end
-
- DropDownObject.dropdown.MyObject = DropDownObject
-
- DropDownObject.dropdown:SetWidth (w)
- DropDownObject.dropdown:SetHeight (h)
- DropDownObject.func = func
- DropDownObject.realsizeW = 150
- DropDownObject.realsizeH = 150
- DropDownObject.FixedValue = nil
- DropDownObject.opened = false
- DropDownObject.menus = {}
- DropDownObject.myvalue = nil
-
- DropDownObject.label = _G [name .. "_Text"]
-
- DropDownObject.icon = _G [name .. "_IconTexture"]
- DropDownObject.statusbar = _G [name .. "_StatusBarTexture"]
- DropDownObject.select = _G [name .. "_SelectedTexture"]
-
- local scroll = _G [DropDownObject.dropdown:GetName() .. "_ScrollFrame"]
+ dropDownObject.func = func
+ dropDownObject.realsizeW = 150
+ dropDownObject.realsizeH = 150
+ dropDownObject.FixedValue = nil
+ dropDownObject.opened = false
+ dropDownObject.menus = {}
+ dropDownObject.myvalue = nil
+ dropDownObject.label = _G[name .. "_Text"]
+ dropDownObject.icon = _G[name .. "_IconTexture"]
+ dropDownObject.statusbar = _G[name .. "_StatusBarTexture"]
+ dropDownObject.select = _G[name .. "_SelectedTexture"]
- DropDownObject.scroll = DF:NewScrollBar (scroll, _G [DropDownObject.dropdown:GetName() .. "_ScrollFrame".."_ScrollChild"], -18, -18)
- DF:ReskinSlider (scroll)
-
- function DropDownObject:HideScroll()
+ local scroll = _G[dropDownObject.dropdown:GetName() .. "_ScrollFrame"]
+ dropDownObject.scroll = DF:NewScrollBar(scroll, _G[dropDownObject.dropdown:GetName() .. "_ScrollFrame" .. "_ScrollChild"], -18, -18)
+ DF:ReskinSlider(scroll)
+
+ function dropDownObject:HideScroll()
scroll.baixo:Hide()
scroll.cima:Hide()
scroll.slider:Hide()
end
- function DropDownObject:ShowScroll()
+
+ function dropDownObject:ShowScroll()
scroll.baixo:Show()
scroll.cima:Show()
scroll.slider:Show()
end
-
- DropDownObject:HideScroll()
- DropDownObject.label:SetSize (DropDownObject.dropdown:GetWidth()-40, 10)
-
- DropDownObject.HookList = {
+
+ dropDownObject:HideScroll()
+ dropDownObject.label:SetSize(dropDownObject.dropdown:GetWidth()-40, 10)
+
+ --hook list
+ dropDownObject.HookList = {
OnEnter = {},
OnLeave = {},
OnHide = {},
OnShow = {},
OnOptionSelected = {},
- }
-
- DropDownObject.dropdown:SetScript ("OnShow", DetailsFrameworkDropDownOnShow)
- DropDownObject.dropdown:SetScript ("OnHide", DetailsFrameworkDropDownOnHide)
- DropDownObject.dropdown:SetScript ("OnEnter", DetailsFrameworkDropDownOnEnter)
- DropDownObject.dropdown:SetScript ("OnLeave", DetailsFrameworkDropDownOnLeave)
-
- --> setup class
- _setmetatable (DropDownObject, DropDownMetaFunctions)
+ }
- --> initialize first menu selected
- if (type (default) == "string") then
- DropDownObject:Select (default)
-
- elseif (type (default) == "number") then
- if (not DropDownObject:Select (default)) then
- DropDownObject:Select (default, true)
+ --set default scripts
+ dropDownObject.dropdown:SetScript("OnShow", DetailsFrameworkDropDownOnShow)
+ dropDownObject.dropdown:SetScript("OnHide", DetailsFrameworkDropDownOnHide)
+ dropDownObject.dropdown:SetScript("OnEnter", DetailsFrameworkDropDownOnEnter)
+ dropDownObject.dropdown:SetScript("OnLeave", DetailsFrameworkDropDownOnLeave)
+
+ setmetatable(dropDownObject, DropDownMetaFunctions)
+
+ --initialize first menu selected
+ if (type(default) == "string") then
+ dropDownObject:Select(default)
+ elseif (type(default) == "number") then
+ if (not dropDownObject:Select(default)) then
+ dropDownObject:Select(default, true)
end
end
if (template) then
- DropDownObject:SetTemplate(template)
+ dropDownObject:SetTemplate(template)
end
-
- return DropDownObject
+ return dropDownObject
end
-local default_backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]],
+local defaultBackdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]],
edgeSize = 1, tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}
-local border_backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, insets = {left = 0, right = 0, top = 0, bottom = 0}}
-local child_backdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 256, insets = {left = 0, right = 0, top = 0, bottom = 0}}
+local borderBackdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, insets = {left = 0, right = 0, top = 0, bottom = 0}}
+local childBackdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 256, insets = {left = 0, right = 0, top = 0, bottom = 0}}
-function DF:CreateNewDropdownFrame (parent, name)
- local f = CreateFrame ("button", name, parent,"BackdropTemplate")
- f:SetBackdrop (default_backdrop)
- f:SetSize (150, 20)
-
- local statusbar = f:CreateTexture ("$parent_StatusBarTexture", "BACKGROUND")
- statusbar:SetPoint ("topleft", f, "topleft", 0, 0)
- statusbar:SetPoint ("bottomright", f, "bottomright", 0, 0)
+function DF:CreateNewDropdownFrame(parent, name)
+ local f = CreateFrame("button", name, parent, "BackdropTemplate")
+ f:SetBackdrop(defaultBackdrop)
+ f:SetBackdropColor(1, 1, 1, .5)
+ f:SetSize(150, 20)
+
+ local statusbar = f:CreateTexture("$parent_StatusBarTexture", "BACKGROUND")
+ statusbar:SetPoint("topleft", f, "topleft", 0, 0)
+ statusbar:SetPoint("bottomright", f, "bottomright", 0, 0)
f.statusbar = statusbar
-
- local icon = f:CreateTexture ("$parent_IconTexture", "ARTWORK")
- icon:SetPoint ("left", f, "left", 2, 0)
- icon:SetSize (20, 20)
- icon:SetTexture ([[Interface\COMMON\UI-ModelControlPanel]])
- icon:SetTexCoord (0.625, 0.78125, 0.328125, 0.390625)
- icon:SetVertexColor (1, 1, 1, 0.4)
+
+ local icon = f:CreateTexture("$parent_IconTexture", "ARTWORK")
+ icon:SetPoint("left", f, "left", 2, 0)
+ icon:SetSize(20, 20)
+ icon:SetTexture([[Interface\COMMON\UI-ModelControlPanel]])
+ icon:SetTexCoord(0.625, 0.78125, 0.328125, 0.390625)
+ icon:SetVertexColor(1, 1, 1, 0.4)
f.icon = icon
-
- local text = f:CreateFontString ("$parent_Text", "ARTWORK", "GameFontHighlightSmall")
- text:SetPoint ("left", icon, "right", 5, 0)
- text:SetJustifyH ("left")
- text:SetText ("no option selected")
- text:SetTextColor (1, 1, 1, 0.4)
- DF:SetFontSize (text, 10)
+
+ local text = f:CreateFontString("$parent_Text", "ARTWORK", "GameFontHighlightSmall")
+ text:SetPoint("left", icon, "right", 5, 0)
+ text:SetJustifyH("left")
+ text:SetText("no option selected")
+ text:SetTextColor(1, 1, 1, 0.4)
+ DF:SetFontSize(text, 10)
f.text = text
-
- local arrow = f:CreateTexture ("$parent_ArrowTexture2", "OVERLAY")
- arrow:SetPoint ("right", f, "right", 5, -1)
- arrow:SetBlendMode ("ADD")
- arrow:SetTexture ([[Interface\Buttons\UI-ScrollBar-ScrollDownButton-Highlight]])
- arrow:Hide()
- arrow:SetSize (32, 28)
- f.arrowTexture2 = arrow
-
- local buttonTexture = f:CreateTexture ("$parent_ArrowTexture", "OVERLAY")
- buttonTexture:SetPoint ("right", f, "right", 5, -1)
- buttonTexture:SetTexture ([[Interface\Buttons\UI-ScrollBar-ScrollDownButton-Up]])
- buttonTexture:SetSize (32, 28)
- f.arrowTexture = buttonTexture
-
+
+ local arrowHightlight = f:CreateTexture ("$parent_ArrowTexture2", "OVERLAY", nil, 2)
+ arrowHightlight:SetPoint ("right", f, "right", 5, -1)
+ arrowHightlight:SetBlendMode ("ADD")
+ arrowHightlight:SetTexture ([[Interface\Buttons\UI-ScrollBar-ScrollDownButton-Highlight]])
+ arrowHightlight:Hide()
+ arrowHightlight:SetSize (32, 28)
+ f.arrowTexture2 = arrowHightlight
+
+ local arrowTexture = f:CreateTexture("$parent_ArrowTexture", "OVERLAY", nil, 1)
+ arrowTexture:SetPoint("right", f, "right", 5, -1)
+ arrowTexture:SetTexture([[Interface\Buttons\UI-ScrollBar-ScrollDownButton-Up]])
+ arrowTexture:SetSize(32, 28)
+ f.arrowTexture = arrowTexture
+
--scripts
f:SetScript ("OnSizeChanged", DetailsFrameworkDropDownOnSizeChanged)
f:SetScript ("OnMouseDown", DetailsFrameworkDropDownOnMouseDown)
-
- --on load
- f:SetBackdropColor (1, 1, 1, .5)
- f.arrowTexture:SetDrawLayer ("OVERLAY", 1)
- f.arrowTexture2:SetDrawLayer ("OVERLAY", 2)
-
+
--dropdown
- local border = CreateFrame ("frame", "$Parent_Border", f,"BackdropTemplate")
+ local border = CreateFrame("frame", "$Parent_Border", f, "BackdropTemplate")
border:Hide()
- border:SetFrameStrata ("FULLSCREEN")
- border:SetSize (150, 150)
- border:SetPoint ("topleft", f, "bottomleft")
- border:SetBackdrop (border_backdrop)
- border:SetScript ("OnHide", DetailsFrameworkDropDownOptionsFrameOnHide)
- border:SetBackdropColor (0, 0, 0, 0.92)
- border:SetBackdropBorderColor (0, 0, 0, 1)
+ border:SetFrameStrata("FULLSCREEN")
+ border:SetSize(150, 150)
+ border:SetPoint("topleft", f, "bottomleft", 0, 0)
+ border:SetBackdrop(borderBackdrop)
+ border:SetScript("OnHide", DetailsFrameworkDropDownOptionsFrameOnHide)
+ border:SetBackdropColor(0, 0, 0, 0.92)
+ border:SetBackdropBorderColor(0, 0, 0, 1)
f.dropdownborder = border
-
- local scroll = CreateFrame ("ScrollFrame", "$Parent_ScrollFrame", f,"BackdropTemplate")
+
+ local scroll = CreateFrame("ScrollFrame", "$Parent_ScrollFrame", f, "BackdropTemplate")
+ scroll:SetFrameStrata("FULLSCREEN")
+ scroll:SetSize(150, 150)
+ scroll:SetPoint("topleft", f, "bottomleft", 0, 0)
scroll:Hide()
- scroll:SetFrameStrata ("FULLSCREEN")
- scroll:SetSize (150, 150)
- scroll:SetPoint ("topleft", f, "bottomleft", 0, 0)
f.dropdownframe = scroll
- local child = CreateFrame ("frame", "$Parent_ScrollChild", scroll,"BackdropTemplate")
- child:SetSize (150, 150)
- child:SetPoint ("topleft", scroll, "topleft", 0, 0)
- child:SetBackdrop (child_backdrop)
+ local child = CreateFrame("frame", "$Parent_ScrollChild", scroll, "BackdropTemplate")
+ child:SetSize(150, 150)
+ child:SetPoint("topleft", scroll, "topleft", 0, 0)
+ child:SetBackdrop(childBackdrop)
child:SetBackdropColor (0, 0, 0, 1)
- local t = child:CreateTexture(nil, "background")
- t:SetAllPoints()
- t:SetColorTexture(0, 0, 0, 1)
-
- DF:ApplyStandardBackdrop (child)
-
- local selected = child:CreateTexture ("$parent_SelectedTexture", "BACKGROUND")
- selected:SetSize (150, 16)
+ local backgroundTexture = child:CreateTexture(nil, "background")
+ backgroundTexture:SetAllPoints()
+ backgroundTexture:SetColorTexture(0, 0, 0, 1)
+
+ DF:ApplyStandardBackdrop(child)
+
+ local selected = child:CreateTexture("$parent_SelectedTexture", "BACKGROUND")
+ selected:SetSize(150, 16)
+ selected:SetPoint("left", child, "left", 2, 0)
+ selected:SetTexture([[Interface\RAIDFRAME\Raid-Bar-Hp-Fill]])
selected:Hide()
- selected:SetPoint ("left", child, "left", 2, 0)
- selected:SetTexture ([[Interface\RAIDFRAME\Raid-Bar-Hp-Fill]])
child.selected = selected
-
- local mouseover = child:CreateTexture ("$parent_MouseOverTexture", "ARTWORK")
- mouseover:SetBlendMode ("ADD")
+
+ local mouseover = child:CreateTexture("$parent_MouseOverTexture", "ARTWORK")
+ mouseover:SetBlendMode("ADD")
+ mouseover:SetTexture([[Interface\Buttons\UI-Listbox-Highlight]])
+ mouseover:SetSize(150, 15)
+ mouseover:SetPoint("left", child, "left", 2, 0)
mouseover:Hide()
- mouseover:SetTexture ([[Interface\Buttons\UI-Listbox-Highlight]])
- mouseover:SetSize (150, 15)
- mouseover:SetPoint ("left", child, "left", 2, 0)
child.mouseover = mouseover
-
- scroll:SetScrollChild (child)
- tinsert (UISpecialFrames, f.dropdownborder:GetName())
- tinsert (UISpecialFrames, f.dropdownframe:GetName())
-
+
+ scroll:SetScrollChild(child)
+ tinsert(UISpecialFrames, f.dropdownborder:GetName())
+ tinsert(UISpecialFrames, f.dropdownframe:GetName())
+
return f
end
-function DF:CreateDropdownButton (parent, name)
+function DF:CreateDropdownButton(parent, name)
+ local f = CreateFrame("button", name, parent, "BackdropTemplate")
+ f:SetSize(150, 20)
- local f = CreateFrame ("button", name, parent,"BackdropTemplate")
- f:SetSize (150, 20)
-
- local statusbar = f:CreateTexture ("$parent_StatusBarTexture", "ARTWORK")
- statusbar:SetPoint ("topleft", f, "topleft", 0, 0)
- statusbar:SetPoint ("bottomright", f, "bottomright", 0, 0)
- statusbar:SetSize (150, 20)
- statusbar:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]])
+ local statusbar = f:CreateTexture("$parent_StatusBarTexture", "ARTWORK")
+ statusbar:SetPoint("topleft", f, "topleft", 0, 0)
+ statusbar:SetPoint("bottomright", f, "bottomright", 0, 0)
+ statusbar:SetTexture([[Interface\Tooltips\UI-Tooltip-Background]])
f.statusbar = statusbar
-
- local icon = f:CreateTexture ("$parent_IconTexture", "OVERLAY")
- icon:SetPoint ("left", f, "left", 2, 0)
- icon:SetSize (20, 20)
- icon:SetTexture ([[Interface\ICONS\Spell_ChargePositive]])
+
+ local icon = f:CreateTexture("$parent_IconTexture", "OVERLAY")
+ icon:SetPoint("left", f, "left", 2, 0)
+ icon:SetSize(20, 20)
+ icon:SetTexture([[Interface\ICONS\Spell_ChargePositive]])
f.icon = icon
-
- local text = f:CreateFontString ("$parent_Text", "OVERLAY", "GameFontHighlightSmall")
- text:SetPoint ("left", icon, "right", 5, 0)
- text:SetJustifyH ("left")
- DF:SetFontSize (text, 10)
+
+ local text = f:CreateFontString("$parent_Text", "OVERLAY", "GameFontHighlightSmall")
+ text:SetPoint("left", icon, "right", 5, 0)
+ text:SetJustifyH("left")
+ DF:SetFontSize(text, 10)
f.label = text
-
- local rightButton = DF:CreateButton(f, function()end, 16, 16, "", 0, 0, "", "rightButton", "$parentRightButton", nil, DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
+
+ local rightButton = DF:CreateButton(f, function()end, 16, 16, "", 0, 0, "", "rightButton", "$parentRightButton", nil, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
rightButton:SetPoint("right", f, "right", -2, 0)
rightButton:Hide()
- f:SetScript ("OnMouseDown", DetailsFrameworkDropDownOptionClick)
- f:SetScript ("OnEnter", DetailsFrameworkDropDownOptionOnEnter)
- f:SetScript ("OnLeave", DetailsFrameworkDropDownOptionOnLeave)
+ f:SetScript("OnMouseDown", DetailsFrameworkDropDownOptionClick)
+ f:SetScript("OnEnter", DetailsFrameworkDropDownOptionOnEnter)
+ f:SetScript("OnLeave", DetailsFrameworkDropDownOptionOnLeave)
return f
end
diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua
index 02211dbf..06199088 100644
--- a/Libs/DF/fw.lua
+++ b/Libs/DF/fw.lua
@@ -1,6 +1,6 @@
-local dversion = 324
+local dversion = 326
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
@@ -439,6 +439,26 @@ function DF.table.reverse (t)
return new
end
+function DF.table.duplicate(t1, t2)
+ for key, value in pairs(t2) do
+ if (key ~= "__index" and key ~= "__newindex") then
+ --preserve a wowObject passing it to the new table with copying it
+ if (type(value) == "table" and table.GetObjectType and table:GetObjectType()) then
+ t1[key] = value
+
+ elseif (type (value) == "table") then
+ t1[key] = t1[key] or {}
+ DF.table.copy(t1[key], t2[key])
+
+ else
+ t1[key] = value
+ end
+ end
+ end
+
+ return t1
+end
+
--> copy from table2 to table1 overwriting values
function DF.table.copy(t1, t2)
for key, value in pairs(t2) do
@@ -471,6 +491,14 @@ function DF.table.copytocompress(t1, t2)
return t1
end
+--add the indexes of table2 into table1
+function DF.table.append(t1, t2)
+ for i = 1, #t2 do
+ t1[#t1+1] = t2[i]
+ end
+ return t1
+end
+
--> copy values that does exist on table2 but not on table1
function DF.table.deploy (t1, t2)
for key, value in pairs (t2) do
@@ -774,10 +802,16 @@ local ValidOutlines = {
function DF:SetFontOutline (fontString, outline)
local fonte, size = fontString:GetFont()
if (outline) then
- if (ValidOutlines [outline]) then
+ if (type(outline) == "string") then
+ outline = outline:upper()
+ end
+
+ if (ValidOutlines[outline]) then
outline = outline
- elseif (_type (outline) == "boolean" and outline) then
+ elseif (type(outline) == "boolean" and outline) then
outline = "OUTLINE"
+ elseif (type(outline) == "boolean" and not outline) then
+ outline = "NONE"
elseif (outline == 1) then
outline = "OUTLINE"
elseif (outline == 2) then
@@ -850,6 +884,21 @@ function DF:CleanTruncateUTF8String(text)
return text
end
+--DF:TruncateNumber(number, fractionDigits): truncate the amount of numbers used to show fraction.
+function DF:TruncateNumber(number, fractionDigits)
+ fractionDigits = fractionDigits or 2
+ --local truncatedNumber = format("%." .. fractionDigits .. "f", number) --4x slower than:
+ --http://lua-users.org/wiki/SimpleRound
+ local mult = 10 ^ fractionDigits
+ if (number >= 0) then
+ truncatedNumber = floor(number * mult + 0.5) / mult
+ else
+ truncatedNumber = ceil(number * mult + 0.5) / mult
+ end
+
+ return truncatedNumber
+end
+
function DF:Msg (msg, ...)
print ("|cFFFFFFAA" .. (self.__name or "FW Msg:") .. "|r ", msg, ...)
end
@@ -1151,7 +1200,37 @@ end
IsColorTable = true,
}
-
+
+ --convert a any format of color to any other format of color
+ function DF:FormatColor(newFormat, r, g, b, a, decimalsAmount)
+ r, g, b, a = DF:ParseColors(r, g, b, a)
+ decimalsAmount = decimalsAmount or 4
+
+ r = DF:TruncateNumber(r, decimalsAmount)
+ g = DF:TruncateNumber(g, decimalsAmount)
+ b = DF:TruncateNumber(b, decimalsAmount)
+ a = DF:TruncateNumber(a, decimalsAmount)
+
+ if (newFormat == "commastring") then
+ return r .. ", " .. g .. ", " .. b .. ", " .. a
+
+ elseif (newFormat == "tablestring") then
+ return "{" .. r .. ", " .. g .. ", " .. b .. ", " .. a .. "}"
+
+ elseif (newFormat == "table") then
+ return {r, g, b, a}
+
+ elseif (newFormat == "tablemembers") then
+ return {["r"] = r, ["g"] = g, ["b"] = b, ["a"] = 1}
+
+ elseif (newFormat == "numbers") then
+ return r, g, b, a
+
+ elseif (newFormat == "hex") then
+ return format("%.2x%.2x%.2x%.2x", a * 255, r * 255, g * 255, b * 255)
+ end
+ end
+
function DF:CreateColorTable (r, g, b, a)
local t = {
r = r or 1,
@@ -1167,53 +1246,69 @@ end
return DF.alias_text_colors [color]
end
- local tn = tonumber
- function DF:ParseColors (_arg1, _arg2, _arg3, _arg4)
- if (_type (_arg1) == "table") then
- if (_arg1.IsColorTable) then
- return _arg1:GetColor()
-
- elseif (not _arg1[1] and _arg1.r) then
- _arg1, _arg2, _arg3, _arg4 = _arg1.r, _arg1.g, _arg1.b, _arg1.a
-
+ function DF:ParseColors (red, green, blue, alpha)
+ local firstParameter = red
+
+ --the first value passed is a table?
+ if (type(firstParameter) == "table") then
+ local colorTable = red
+
+ if (colorTable.IsColorTable) then
+ --using colorTable mixin
+ return colorTable:GetColor()
+
+ elseif (not colorTable[1] and colorTable.r) then
+ --{["r"] = 1, ["g"] = 1, ["b"] = 1}
+ red, green, blue, alpha = colorTable.r, colorTable.g, colorTable.b, colorTable.a
+
else
- _arg1, _arg2, _arg3, _arg4 = _unpack (_arg1)
+ --{1, .7, .2, 1}
+ red, green, blue, alpha = unpack(colorTable)
end
-
- elseif (_type (_arg1) == "string") then
-
- if (string.find (_arg1, "#")) then
- _arg1 = _arg1:gsub ("#","")
- if (string.len (_arg1) == 8) then --alpha
- _arg1, _arg2, _arg3, _arg4 = tn ("0x" .. _arg1:sub (3, 4))/255, tn ("0x" .. _arg1:sub (5, 6))/255, tn ("0x" .. _arg1:sub (7, 8))/255, tn ("0x" .. _arg1:sub (1, 2))/255
+
+ --the first value passed is a string?
+ elseif (type(firstParameter) == "string") then
+ local colorString = red
+ --hexadecimal
+ if (string.find(colorString, "#")) then
+ colorString = colorString:gsub("#","")
+ if (string.len(colorString) == 8) then --with alpha
+ red, green, blue, alpha = tonumber("0x" .. colorString:sub(3, 4))/255, tonumber("0x" .. colorString:sub(5, 6))/255, tonumber("0x" .. colorString:sub(7, 8))/255, tonumber("0x" .. colorString:sub(1, 2))/255
else
- _arg1, _arg2, _arg3, _arg4 = tn ("0x" .. _arg1:sub (1, 2))/255, tn ("0x" .. _arg1:sub (3, 4))/255, tn ("0x" .. _arg1:sub (5, 6))/255, 1
+ red, green, blue, alpha = tonumber("0x" .. colorString:sub(1, 2))/255, tonumber("0x" .. colorString:sub(3, 4))/255, tonumber("0x" .. colorString:sub(5, 6))/255, 1
end
-
else
- local color = DF.alias_text_colors [_arg1]
- if (color) then
- _arg1, _arg2, _arg3, _arg4 = _unpack (color)
+ --name of the color
+ local colorTable = DF.alias_text_colors[colorString]
+ if (colorTable) then
+ red, green, blue, alpha = unpack(colorTable)
+
+ --string with number separated by comma
+ elseif (colorString:find(",")) then
+ local r, g, b, a = strsplit(",", colorString)
+ red, green, blue, alpha = tonumber(r), tonumber(g), tonumber(b), tonumber(a)
+
else
- _arg1, _arg2, _arg3, _arg4 = _unpack (DF.alias_text_colors.none)
+ --no color found within the string, return default color
+ red, green, blue, alpha = unpack(DF.alias_text_colors.none)
end
end
end
-
- if (not _arg1) then
- _arg1 = 1
+
+ if (not red or type(red) ~= "number") then
+ red = 1
end
- if (not _arg2) then
- _arg2 = 1
+ if (not green) or type(green) ~= "number" then
+ green = 1
end
- if (not _arg3) then
- _arg3 = 1
+ if (not blue or type(blue) ~= "number") then
+ blue = 1
end
- if (not _arg4) then
- _arg4 = 1
+ if (not alpha or type(alpha) ~= "number") then
+ alpha = 1
end
-
- return _arg1, _arg2, _arg3, _arg4
+
+ return red, green, blue, alpha
end
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -2391,7 +2486,7 @@ function DF:GetBestFontForLanguage (language, western, cyrillic, china, korean,
end
if (language == "enUS" or language == "deDE" or language == "esES" or language == "esMX" or language == "frFR" or language == "itIT" or language == "ptBR") then
- return western or "Accidental Presidency"
+ return western or "Friz Quadrata TT"
elseif (language == "ruRU") then
return cyrillic or "Arial Narrow"
@@ -3152,6 +3247,7 @@ function DF:CreateGlowOverlay (parent, antsColor, glowColor)
glowFrame.GlowColor = {r, g, b, a}
glowFrame.outerGlow:SetScale (1.2)
+ glowFrame:EnableMouse(false)
return glowFrame
end
@@ -3693,6 +3789,10 @@ function DF:GetCurrentSpec()
end
end
+function DF:GetCurrentSpecId()
+ return DF:GetCurrentSpec()
+end
+
local specs_per_class = {
["DEMONHUNTER"] = {577, 581},
["DEATHKNIGHT"] = {250, 251, 252},
@@ -3733,18 +3833,21 @@ function DF:QuickDispatch (func, ...)
return true
end
-function DF:Dispatch (func, ...)
+function DF:Dispatch(func, ...)
if (type (func) ~= "function") then
- return dispatch_error (_, "Dispatch required a function.")
+ return dispatch_error (_, "DF:Dispatch expect a function as parameter 1.")
end
- local okay, result1, result2, result3, result4 = xpcall (func, geterrorhandler(), ...)
-
+ local dispatchResult = {xpcall (func, geterrorhandler(), ...)}
+ local okay = dispatchResult[1]
+
if (not okay) then
return nil
end
-
- return result1, result2, result3, result4
+
+ tremove(dispatchResult, 1)
+
+ return unpack(dispatchResult)
end
--[=[
@@ -3900,7 +4003,7 @@ end
--> store and return a list of character races, always return the non-localized value
DF.RaceCache = {}
-function DF:GetCharacterRaceList (fullList)
+function DF:GetCharacterRaceList()
if (next (DF.RaceCache)) then
return DF.RaceCache
end
@@ -3908,13 +4011,13 @@ function DF:GetCharacterRaceList (fullList)
for i = 1, 100 do
local raceInfo = C_CreatureInfo.GetRaceInfo (i)
if (raceInfo and DF.RaceList [raceInfo.raceID]) then
- tinsert (DF.RaceCache, {Name = raceInfo.raceName, FileString = raceInfo.clientFileString})
+ tinsert (DF.RaceCache, {Name = raceInfo.raceName, FileString = raceInfo.clientFileString, ID = raceInfo.raceID})
end
if IS_WOW_PROJECT_MAINLINE then
local alliedRaceInfo = C_AlliedRaces.GetRaceInfoByID (i)
if (alliedRaceInfo and DF.AlliedRaceList [alliedRaceInfo.raceID]) then
- tinsert (DF.RaceCache, {Name = alliedRaceInfo.maleName, FileString = alliedRaceInfo.raceFileString})
+ tinsert (DF.RaceCache, {Name = alliedRaceInfo.maleName, FileString = alliedRaceInfo.raceFileString, ID = alliedRaceInfo.raceID})
end
end
end
@@ -4046,6 +4149,11 @@ function DF:AddRoleIconToText(text, role, size)
return text
end
+function DF:GetRoleTCoordsAndTexture(roleID)
+ local texture, l, r, t, b = DF:GetRoleIconAndCoords(roleID)
+ return l, r, t, b, texture
+end
+
-- TODO: maybe make this auto-generaded some day?...
DF.CLEncounterID = {
{ID = 2423, Name = "The Tarragrue"},
@@ -4243,6 +4351,10 @@ DF.BattlegroundSizes = {
[1803] = 10, --Seething Shore
}
+function DF:GetBattlegroundSize(instanceInfoMapId)
+ return DF.BattlegroundSizes[instanceInfoMapId]
+end
+
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> execute range
@@ -4340,6 +4452,10 @@ function GetWorldDeltaSeconds()
return deltaTimeFrame.deltaTime
end
+function DF:GetWorldDeltaSeconds()
+ return deltaTimeFrame.deltaTime
+end
+
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> build the global script channel for scripts communication
--send and retrieve data sent by othe users in scripts
@@ -4368,6 +4484,7 @@ end
if (Ambiguate (sourceName, "none") == commSource) then
local func = DF.RegisteredScriptsComm [ID]
if (func) then
+ DF:MakeFunctionSecure(func)
DF:Dispatch (func, commSource, select (5, unpack (data))) --this use xpcall
end
end
@@ -4449,7 +4566,7 @@ do
if (object) then
tinsert(self.inUse, object)
if (self.onAcquire) then
- local result, errortext = pcall(self.onAcquire, object)
+ DF:QuickDispatch(self.onAcquire, object)
end
return object, false
else
@@ -4458,7 +4575,7 @@ do
if (newObject) then
tinsert(self.inUse, newObject)
if (self.onAcquire) then
- local result, errortext = pcall(self.onAcquire, object)
+ DF:QuickDispatch(self.onAcquire, object)
end
return newObject, true
end
@@ -4474,6 +4591,10 @@ do
if (self.inUse[i] == object) then
tremove(self.inUse, i)
tinsert(self.notUse, object)
+
+ if (self.onRelease) then
+ DF:QuickDispatch(self.onRelease, object)
+ end
break
end
end
@@ -4485,7 +4606,7 @@ do
tinsert(self.notUse, object)
if (self.onReset) then
- local result, errortext = pcall(self.onReset, object)
+ DF:QuickDispatch(self.onReset, object)
end
end
end
@@ -4519,12 +4640,24 @@ do
Hide = hide,
Show = show,
GetAmount = getamount,
+
+ SetCallbackOnRelease = function(self, func)
+ self.onRelease = func
+ end,
+
SetOnReset = function(self, func)
self.onReset = func
end,
+ SetCallbackOnReleaseAll = function(self, func)
+ self.onReset = func
+ end,
+
SetOnAcquire = function(self, func)
self.onAcquire = func
end,
+ SetCallbackOnGet = function(self, func)
+ self.onAcquire = func
+ end,
}
function DF:CreatePool(func, ...)
@@ -4573,7 +4706,7 @@ end
--block run code inside code
["RunScript"] = true,
["securecall"] = true,
- ["getfenv"] = true,
+ ["setfenv"] = true,
["getfenv"] = true,
["loadstring"] = true,
["pcall"] = true,
@@ -4662,6 +4795,10 @@ end
_G.setfenv(func, newEnvironment)
end
+ function DF:MakeFunctionSecure(func)
+ return DF:SetEnvironment(func)
+ end
+
-----------------------------------------------------------------------------------------------------------------------------------------------------------
diff --git a/Libs/DF/load.xml b/Libs/DF/load.xml
index 9f3ff11a..a1d04971 100644
--- a/Libs/DF/load.xml
+++ b/Libs/DF/load.xml
@@ -2,6 +2,7 @@
+
diff --git a/Libs/DF/mixins.lua b/Libs/DF/mixins.lua
new file mode 100644
index 00000000..e4aa4185
--- /dev/null
+++ b/Libs/DF/mixins.lua
@@ -0,0 +1,83 @@
+
+local DF = _G ["DetailsFramework"]
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
+local _
+
+--mixin for options functions
+DF.OptionsFunctions = {
+ SetOption = function (self, optionName, optionValue)
+ if (self.options) then
+ self.options [optionName] = optionValue
+ else
+ self.options = {}
+ self.options [optionName] = optionValue
+ end
+
+ if (self.OnOptionChanged) then
+ DF:Dispatch (self.OnOptionChanged, self, optionName, optionValue)
+ end
+ end,
+
+ GetOption = function (self, optionName)
+ return self.options and self.options [optionName]
+ end,
+
+ GetAllOptions = function (self)
+ if (self.options) then
+ local optionsTable = {}
+ for key, _ in pairs (self.options) do
+ optionsTable [#optionsTable + 1] = key
+ end
+ return optionsTable
+ else
+ return {}
+ end
+ end,
+
+ BuildOptionsTable = function (self, defaultOptions, userOptions)
+ self.options = self.options or {}
+ DF.table.deploy (self.options, userOptions or {})
+ DF.table.deploy (self.options, defaultOptions or {})
+ end
+}
+
+--payload mixin
+DF.PayloadMixin = {
+ ClearPayload = function(self)
+ self.payload = {}
+ end,
+
+ SetPayload = function(self, ...)
+ self.payload = {...}
+ return self.payload
+ end,
+
+ AddPayload = function(self, ...)
+ local currentPayload = self.payload or {}
+ self.payload = currentPayload
+
+ for i = 1, select("#", ...) do
+ local value = select(i, ...)
+ currentPayload[#currentPayload+1] = value
+ end
+
+ return self.payload
+ end,
+
+ GetPayload = function(self)
+ return self.payload
+ end,
+
+ DumpPayload = function(self)
+ return unpack(self.payload)
+ end,
+
+ --does not copy wow objects, just pass them to the new table, tables strings and numbers are copied entirely
+ DuplicatePayload = function(self)
+ local duplicatedPayload = DF.table.duplicate({}, self.payload)
+ return duplicatedPayload
+ end,
+}
\ No newline at end of file
diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua
index f015d002..abfcb63e 100644
--- a/Libs/DF/panel.lua
+++ b/Libs/DF/panel.lua
@@ -63,44 +63,6 @@ end
local PanelMetaFunctions = _G[DF.GlobalWidgetControlNames ["panel"]]
---> mixin for options functions
-DF.OptionsFunctions = {
- SetOption = function (self, optionName, optionValue)
- if (self.options) then
- self.options [optionName] = optionValue
- else
- self.options = {}
- self.options [optionName] = optionValue
- end
-
- if (self.OnOptionChanged) then
- DF:Dispatch (self.OnOptionChanged, self, optionName, optionValue)
- end
- end,
-
- GetOption = function (self, optionName)
- return self.options and self.options [optionName]
- end,
-
- GetAllOptions = function (self)
- if (self.options) then
- local optionsTable = {}
- for key, _ in pairs (self.options) do
- optionsTable [#optionsTable + 1] = key
- end
- return optionsTable
- else
- return {}
- end
- end,
-
- BuildOptionsTable = function (self, defaultOptions, userOptions)
- self.options = self.options or {}
- DF.table.deploy (self.options, userOptions or {})
- DF.table.deploy (self.options, defaultOptions or {})
- end
-}
-
--> default options for the frame layout
local default_framelayout_options = {
amount_per_line = 4,
@@ -2144,6 +2106,10 @@ function DF:CreateSimplePanel (parent, w, h, title, name, panel_options, db)
f.Title:SetPoint ("center", title_bar, "center")
f.Close:SetPoint ("right", title_bar, "right", -2, 0)
+
+ if (panel_options.NoCloseButton) then
+ f.Close:Hide()
+ end
f:SetScript ("OnMouseDown", simple_panel_mouse_down)
f:SetScript ("OnMouseUp", simple_panel_mouse_up)
@@ -8349,7 +8315,7 @@ DF.CastFrameFunctions = {
end,
HasScheduledHide = function (self)
- return self.scheduledHideTime and not self.scheduledHideTime._cancelled
+ return self.scheduledHideTime and not self.scheduledHideTime:IsCancelled()
end,
CancelScheduleToHide = function (self)
@@ -8361,7 +8327,7 @@ DF.CastFrameFunctions = {
--> after an interrupt, do not immediately hide the cast bar, let it up for short amount of time to give feedback to the player
ScheduleToHide = function (self, delay)
if (not delay) then
- if (self.scheduledHideTime and not self.scheduledHideTime._cancelled) then
+ if (self.scheduledHideTime and not self.scheduledHideTime:IsCancelled()) then
self.scheduledHideTime:Cancel()
end
@@ -8370,7 +8336,7 @@ DF.CastFrameFunctions = {
end
--> already have a scheduled timer?
- if (self.scheduledHideTime and not self.scheduledHideTime._cancelled) then
+ if (self.scheduledHideTime and not self.scheduledHideTime:IsCancelled()) then
self.scheduledHideTime:Cancel()
end
diff --git a/Libs/DF/slider.lua b/Libs/DF/slider.lua
index 679cd411..87c4508d 100644
--- a/Libs/DF/slider.lua
+++ b/Libs/DF/slider.lua
@@ -1285,3 +1285,195 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de
return SliderObject, with_label
end
+
+DF.AdjustmentSliderOptions = {
+ width = 120,
+ height = 20,
+ speed = 20, --speed is how many pixels the mouse has moved
+}
+
+DF.AdjustmentSliderFunctions = {
+ SetCallback = function(self, func)
+ self.callback = func
+ end,
+
+ SetPayload = function(self, ...)
+ self.payload = {...}
+ end,
+
+ RunCallback = function(adjustmentSlider, valueX, valueY, isLiteral)
+ local result, errorText = pcall(adjustmentSlider.callback, adjustmentSlider, valueX, valueY, isLiteral, adjustmentSlider:DumpPayload())
+ if (not result) then
+ DF:Msg("AdjustmentSlider callback Error:", errorText)
+ return false
+ end
+ end,
+
+ --calculate if the mouse has moved and call a callback
+ PressingOnUpdate = function(adjustmentSlider, deltaTime)
+ if (GetTime() > adjustmentSlider.NextTick) then
+ --get currentr mouse position
+ local mouseX, mouseY = GetCursorPosition()
+ local verticalValue
+ local horizontalValue
+
+ --find distance
+ local xDelta = adjustmentSlider.MouseX - mouseX --moving the mouse to right or up result in a negative delta
+ local yDelta = adjustmentSlider.MouseY - mouseY
+
+ if (adjustmentSlider.buttonPressed ~= "center") then
+ if (adjustmentSlider.buttonPressedTime+0.5 < GetTime()) then
+ if (adjustmentSlider.buttonPressed == "left") then
+ DF.AdjustmentSliderFunctions.RunCallback(adjustmentSlider, -1, 0, true)
+ elseif (adjustmentSlider.buttonPressed == "right") then
+ DF.AdjustmentSliderFunctions.RunCallback(adjustmentSlider, 1, 0, true)
+ end
+ end
+
+ elseif (xDelta ~= 0 or yDelta ~= 0) then
+ if (adjustmentSlider.buttonPressed == "center") then
+ --invert axis as left is positive and right is negative in the deltas
+ xDelta = xDelta * -1
+ yDelta = yDelta * -1
+
+ horizontalValue = DF:MapRangeClamped(-20, 20, -1, 1, xDelta)
+ verticalValue = DF:MapRangeClamped(-20, 20, -1, 1, yDelta)
+ end
+
+ DF.AdjustmentSliderFunctions.RunCallback(adjustmentSlider, horizontalValue, verticalValue, false)
+
+ adjustmentSlider.MouseX = mouseX
+ adjustmentSlider.MouseY = mouseY
+ end
+
+ adjustmentSlider.NextTick = GetTime() + 0.05
+ end
+ end,
+
+ --button can be the left or right button
+ OnButtonDownkHook = function(button)
+ button = button.MyObject
+
+ --change the icon
+ if (button.direction == "left") then
+ button:SetIcon([[Interface\BUTTONS\UI-SpellbookIcon-PrevPage-Down]])
+ elseif (button.direction == "right") then
+ button:SetIcon([[Interface\BUTTONS\UI-SpellbookIcon-NextPage-Down]])
+ end
+
+ local adjustmentSlider = button:GetParent()
+ adjustmentSlider.NextTick = GetTime() + 0.05
+
+ --save where the mouse is on the moment of the click
+ local mouseX, mouseY = GetCursorPosition()
+ adjustmentSlider.MouseX = mouseX
+ adjustmentSlider.MouseY = mouseY
+
+ adjustmentSlider.buttonPressed = button.direction
+
+ --start monitoring the mouse moviment
+ adjustmentSlider.buttonPressedTime = GetTime()
+ adjustmentSlider:SetScript("OnUpdate", DF.AdjustmentSliderFunctions.PressingOnUpdate)
+ end,
+
+ --button can be the left or right button
+ OnButtonUpHook = function(button)
+ button = button.MyObject
+
+ --change the icon
+ if (button.direction == "left") then
+ button:SetIcon([[Interface\BUTTONS\UI-SpellbookIcon-PrevPage-Up]])
+ elseif (button.direction == "right") then
+ button:SetIcon([[Interface\BUTTONS\UI-SpellbookIcon-NextPage-Up]])
+ end
+
+ local adjustmentSlider = button:GetParent()
+
+ --check if the mouse did not moved at all, if not send a callback with a value of 1
+ local mouseX, mouseY = GetCursorPosition()
+ if (mouseX == adjustmentSlider.MouseX and mouseY == adjustmentSlider.MouseY and adjustmentSlider.buttonPressedTime+0.5 > GetTime()) then
+ if (button.direction == "left") then
+ DF.AdjustmentSliderFunctions.RunCallback(adjustmentSlider, -1, 0, true)
+ elseif (button.direction == "right") then
+ DF.AdjustmentSliderFunctions.RunCallback(adjustmentSlider, 1, 0, true)
+ end
+ end
+
+ adjustmentSlider:SetScript("OnUpdate", nil)
+ end,
+
+ Disable = function(adjustmentSlider)
+ adjustmentSlider.leftButton:Disable()
+ adjustmentSlider.rightButton:Disable()
+ adjustmentSlider.centerButton:Disable()
+ end,
+
+ Enable = function(adjustmentSlider)
+ adjustmentSlider.leftButton:Enable()
+ adjustmentSlider.rightButton:Enable()
+ adjustmentSlider.centerButton:Enable()
+ end,
+}
+
+local createAdjustmentSliderFrames = function(parent, options, name)
+ --frame it self
+ local adjustmentSlider = CreateFrame("frame", name, parent, "BackdropTemplate")
+
+ DF:Mixin(adjustmentSlider, DF.OptionsFunctions)
+ DF:Mixin(adjustmentSlider, DF.AdjustmentSliderFunctions)
+ DF:Mixin(adjustmentSlider, DF.PayloadMixin)
+
+ adjustmentSlider:BuildOptionsTable(DF.AdjustmentSliderOptions, options)
+
+ adjustmentSlider:SetSize(adjustmentSlider.options.width, adjustmentSlider.options.height)
+
+ --two buttons
+ local leftButton = DF:CreateButton(adjustmentSlider, function()end, 20, 20, "", "left", -1, nil, nil, name .. "LeftButton")
+ local rightButton = DF:CreateButton(adjustmentSlider, function()end, 20, 20, "", "right", 1, nil, nil, name .. "RightButton")
+
+ leftButton:SetHook("OnMouseDown", DF.AdjustmentSliderFunctions.OnButtonDownkHook)
+ rightButton:SetHook("OnMouseDown", DF.AdjustmentSliderFunctions.OnButtonDownkHook)
+ leftButton:SetHook("OnMouseUp", DF.AdjustmentSliderFunctions.OnButtonUpHook)
+ rightButton:SetHook("OnMouseUp", DF.AdjustmentSliderFunctions.OnButtonUpHook)
+
+ leftButton:SetPoint("left", adjustmentSlider, "left", 0, 0)
+ rightButton:SetPoint("right", adjustmentSlider, "right", 0, 0)
+ leftButton:SetIcon([[Interface\BUTTONS\UI-SpellbookIcon-PrevPage-Up]])
+ rightButton:SetIcon([[Interface\BUTTONS\UI-SpellbookIcon-NextPage-Up]])
+ leftButton.direction = "left"
+ rightButton.direction = "right"
+
+ --center button
+ local centerButton = DF:CreateButton(adjustmentSlider, function()end, 20, 20, "", "center", 0, nil, nil, name .. "CenterButton")
+ centerButton:SetPoint("center", adjustmentSlider, "center", 0, 0)
+ centerButton:SetIcon([[Interface\BUTTONS\YellowOrange64_Radial]])
+ centerButton.direction = "center"
+ centerButton:SetHook("OnMouseDown", DF.AdjustmentSliderFunctions.OnButtonDownkHook)
+ centerButton:SetHook("OnMouseUp", DF.AdjustmentSliderFunctions.OnButtonUpHook)
+
+ adjustmentSlider.leftButton = leftButton
+ adjustmentSlider.rightButton = rightButton
+ adjustmentSlider.centerButton = centerButton
+
+ return adjustmentSlider
+end
+
+--creates a slider with left and right buttons and a center button, on click the hold, mouse moviments adjust the value and trigger a callback with a normallized x and y values of the mouse movement
+--@parent: who is the parent of this frame
+--@callback: run when there's a change in any of the two axis
+--@options: a table containing options for the frame, see /dump DetailsFramework.AdjustmentSliderOptions
+--@name: the name of the frame, if none a generic name is created
+function DF:CreateAdjustmentSlider(parent, callback, options, name, ...)
+ if (not name) then
+ name = "DetailsFrameworkAdjustmentSlider" .. DF.SliderCounter
+ DF.SliderCounter = DF.SliderCounter + 1
+
+ elseif (not parent) then
+ return error("Details! FrameWork: parent not found.", 2)
+ end
+
+ local ASFrame = createAdjustmentSliderFrames(parent, options, name)
+ ASFrame:SetPayload(...)
+ ASFrame.callback = callback
+ return ASFrame
+end
diff --git a/Libs/DF/textentry.lua b/Libs/DF/textentry.lua
index dfc9ae3e..007e1dc4 100644
--- a/Libs/DF/textentry.lua
+++ b/Libs/DF/textentry.lua
@@ -341,7 +341,11 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
self.func = func
end
end
-
+
+ function TextEntryMetaFunctions:IgnoreNextCallback()
+ self.ignoreNextCallback = true
+ end
+
------------------------------------------------------------------------------------------------------------
--> scripts and hooks
@@ -406,7 +410,12 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
local OnEnterPressed = function (textentry, byScript)
local capsule = textentry.MyObject
-
+
+ if (capsule.ignoreNextCallback) then
+ DF.Schedules.RunNextTick(function() capsule.ignoreNextCallback = nil end)
+ return
+ end
+
local kill = capsule:RunHooksForWidget ("OnEnterPressed", textentry, capsule, capsule.text)
if (kill) then
return
@@ -457,7 +466,12 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
local OnEditFocusLost = function (textentry)
local capsule = textentry.MyObject
-
+
+ if (capsule.ignoreNextCallback) then
+ DF.Schedules.RunNextTick(function() capsule.ignoreNextCallback = nil end)
+ return
+ end
+
if (textentry:IsShown()) then
local kill = capsule:RunHooksForWidget ("OnEditFocusLost", textentry, capsule, capsule.text)
diff --git a/boot.lua b/boot.lua
index 29272696..65f7eef6 100644
--- a/boot.lua
+++ b/boot.lua
@@ -9,7 +9,7 @@
_detalhes.build_counter = 9825
_detalhes.alpha_build_counter = 9825 --if this is higher than the regular counter, use it instead
_detalhes.bcc_counter = 41
- _detalhes.wotlk_counter = 3
+ _detalhes.wotlk_counter = 4
_detalhes.dont_open_news = true
_detalhes.game_version = version
_detalhes.userversion = version .. _detalhes.build_counter
@@ -33,6 +33,26 @@ do
local Loc = _G.LibStub("AceLocale-3.0"):GetLocale( "Details" )
+ --[=[
+ -New feature: Arena DPS Bar, can be enabled at the Broadcaster Tools section, shows a bar in 'kamehameha' style showing which team is doing more damage in the latest 3 seconds.
+ -Revamp on the options section for Broadcaster tools.
+ -Added 'Icon Size Offset' under Options > Bars: General, this new option allow to adjust the size of the class/spec icon shown on each bar.
+ -Added 'Show Faction Icon' under Options > Bars: General, with this new option, you can choose to not show the faction icon, this icon is usually shown during battlegrounds.
+ -Added 'Faction Icon Size Offset' under Options > Bars: General, new option to adjust the size of the faction icon.
+ -Added 'Show Arena Role Icon' under Options > Bars: General, new option to hide or show the role icon of players during an arena match.
+ -Added 'Arena Role Icon Size Offset' under Options > Bars: General, new option which allow to control the size of the arena role icon.
+ -Added 'Level' option to Wallpapers, the wallpaper can now be placed on different levels which solves issues where the wallpaper is too low of certain configuration.
+ -Streamer! plugin got updates, now it is more clear to pick which mode to use.
+ -WotLK classic compatibility (Flamanis, Daniel Henry).
+ -Fixed the title bar text not showing when using the Custom Title Bar feature.
+ -Role detection in classic versions got improvements.
+ -New API: Details:GetTop5Actors(attributeId), return the top 5 actors from the selected attribute.
+ -New API: Details:GetActorByRank(attributeId, rankIndex), return an actor from the selected attribute and rankIndex.
+ -Major cleanup and code improvements on dropdowns for library Details! Framework.
+ -Cleanup on NickTag library.
+ -Removed LibGroupInSpecT, LibItemUpgradeInfo and LibCompress. These libraries got replaced by OpenRaidLib and LibDeflate.
+ ]=]
+
local news = {
{"v9.2.0.9814.146", "May 15th, 2022"},
"Added slash command /keystone, this command show keystones of other users with addons using Open Raid library.",
diff --git a/classes/class_damage.lua b/classes/class_damage.lua
index ff896fca..20ef7afa 100644
--- a/classes/class_damage.lua
+++ b/classes/class_damage.lua
@@ -2527,6 +2527,11 @@ local actor_class_color_r, actor_class_color_g, actor_class_color_b
perSecondText = perSecondText or ""
percentText = percentText or ""
+-- local actorSerial = thisLine:GetActor().serial
+-- local currentDps = Details.CurrentDps.GetCurrentDps(actorSerial) or perSecondText
+-- perSecondText = currentDps
+-- end
+
--check if the instance is showing total, dps and percent
local instanceSettings = instance.row_info
if (not instanceSettings.textR_show_data[3]) then --percent text disabled on options panel
@@ -2914,11 +2919,12 @@ local InBarIconPadding = 6
if (enemy) then
if (arena_enemy) then
- if (Details.show_arena_role_icon) then
+ if (instance.row_info.show_arena_role_icon) then
--> show arena role icon
- local leftText = bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t " .. self.displayName
+ local sizeOffset = instance.row_info.arena_role_icon_size_offset
+ local leftText = bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t " .. self.displayName
if (UsingCustomLeftText) then
- bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing, instance, leftText))
+ bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing, instance, leftText))
else
bar.lineText1:SetText (leftText)
end
@@ -2932,27 +2938,39 @@ local InBarIconPadding = 6
end
end
else
- if (Details.faction_against == "Horde") then
- local leftText = bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:32:0:32:0:32|t"..self.displayName
- if (UsingCustomLeftText) then
- bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:32:0:32:0:32|t", self, instance.showing, instance, leftText))
- else
- bar.lineText1:SetText (leftText) --seta o texto da esqueda -- HORDA
+ if (instance.row_info.show_faction_icon) then
+ local sizeOffset = instance.row_info.faction_icon_size_offset
+ if (Details.faction_against == "Horde") then
+ local leftText = bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:0:32:0:32|t"..self.displayName
+ if (UsingCustomLeftText) then
+ bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:0:32:0:32|t", self, instance.showing, instance, leftText))
+ else
+ bar.lineText1:SetText (leftText) --seta o texto da esqueda -- HORDA
+ end
+ else --alliance
+ local leftText = bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:32:64:0:32|t"..self.displayName
+ if (UsingCustomLeftText) then
+ bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:32:64:0:32|t", self, instance.showing, instance, leftText))
+ else
+ bar.lineText1:SetText (leftText) --seta o texto da esqueda -- ALLY
+ end
end
- else --alliance
- local leftText = bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:32:32:64:0:32|t"..self.displayName
+ else
+ --don't show faction icon
+ local leftText = bar_number .. self.displayName
if (UsingCustomLeftText) then
- bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:32:32:64:0:32|t", self, instance.showing, instance, leftText))
+ bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, " ", self, instance.showing, instance, leftText))
else
- bar.lineText1:SetText (leftText) --seta o texto da esqueda -- ALLY
+ bar.lineText1:SetText (leftText)
end
end
end
else
- if (arena_ally and Details.show_arena_role_icon) then
- local leftText = bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t " .. self.displayName
+ if (arena_ally and instance.row_info.show_arena_role_icon) then
+ local sizeOffset = instance.row_info.arena_role_icon_size_offset
+ local leftText = bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t " .. self.displayName
if (UsingCustomLeftText) then
- bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing, instance, leftText))
+ bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing, instance, leftText))
else
bar.lineText1:SetText (leftText)
end
@@ -3004,6 +3022,7 @@ end
end
end
+--@self: actor object
--[[ exported]] function Details:SetClassIcon (texture, instance, classe) --self is the actorObject
@@ -3012,6 +3031,12 @@ end
customIcon = Details.Immersion.GetIcon(self.aID)
end
+ --set the size offset of the icon
+ local iconSizeOffset = instance.row_info.icon_size_offset
+ local iconSize = instance.row_info.height
+ local newIconSize = iconSize + iconSizeOffset
+ texture:SetSize(newIconSize, newIconSize)
+
if (customIcon) then
texture:SetTexture(customIcon[1])
texture:SetTexCoord(unpack(customIcon[2]))
diff --git a/classes/include_instance.lua b/classes/include_instance.lua
index 6c605554..21fed5d7 100644
--- a/classes/include_instance.lua
+++ b/classes/include_instance.lua
@@ -275,6 +275,7 @@ _detalhes.instance_defaults = {
--space between bars
space = {left = 3, right = -5, between = 1},
--icon file
+ icon_size_offset = 0,
icon_file = [[Interface\AddOns\Details\images\classes_small]],
no_icon = false,
start_after_icon = true,
@@ -304,6 +305,12 @@ _detalhes.instance_defaults = {
--show spec icons
use_spec_icons = false,
spec_file = [[Interface\AddOns\Details\images\spec_icons_normal]],
+ --show faction icon
+ show_faction_icon = true,
+ faction_icon_size_offset = -10,
+ --show arena role icon
+ show_arena_role_icon = false,
+ arena_role_icon_size_offset = -10,
},
--instance window color
color = {1, 1, 1, 1},
@@ -415,7 +422,8 @@ _detalhes.instance_defaults = {
texcoord = {0, 1, 0, 1},
width = 0,
height = 0,
- overlay = {1, 1, 1, 1}
+ overlay = {1, 1, 1, 1},
+ level = 2,
},
--tooltip amounts
tooltip = {
diff --git a/core/gears.lua b/core/gears.lua
index ad81a3be..dc7551cb 100644
--- a/core/gears.lua
+++ b/core/gears.lua
@@ -2372,7 +2372,7 @@ if (DetailsFramework.IsTBCWow()) then
end)
talentWatchClassic:SetScript("OnEvent", function(self, event, ...)
- if (talentWatchClassic.delayedUpdate and not talentWatchClassic.delayedUpdate._cancelled) then
+ if (talentWatchClassic.delayedUpdate and not talentWatchClassic.delayedUpdate:IsCancelled()) then
return
else
talentWatchClassic.delayedUpdate = C_Timer.NewTimer(5, Details.GetOldSchoolTalentInformation)
@@ -2381,7 +2381,7 @@ if (DetailsFramework.IsTBCWow()) then
function Details.GetOldSchoolTalentInformation()
--cancel any schedule
- if (talentWatchClassic.delayedUpdate and not talentWatchClassic.delayedUpdate._cancelled) then
+ if (talentWatchClassic.delayedUpdate and not talentWatchClassic.delayedUpdate:IsCancelled()) then
talentWatchClassic.delayedUpdate:Cancel()
end
talentWatchClassic.delayedUpdate = nil
diff --git a/core/parser.lua b/core/parser.lua
index 905ad4eb..d06407e9 100755
--- a/core/parser.lua
+++ b/core/parser.lua
@@ -5422,7 +5422,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
function _detalhes.parser_functions:PLAYER_TALENT_UPDATE()
if (IsInGroup() or IsInRaid()) then
- if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer._cancelled) then
+ if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer:IsCancelled()) then
_detalhes.SendTalentTimer:Cancel()
end
_detalhes.SendTalentTimer = C_Timer.NewTimer (11, function()
@@ -5450,7 +5450,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
if (IsInGroup() or IsInRaid()) then
- if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer._cancelled) then
+ if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer:IsCancelled()) then
_detalhes.SendTalentTimer:Cancel()
end
_detalhes.SendTalentTimer = C_Timer.NewTimer (11, function()
@@ -5568,7 +5568,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes:SchedulePetUpdate (2)
--> send char data
- if (_detalhes.SendCharDataOnGroupChange and not _detalhes.SendCharDataOnGroupChange._cancelled) then
+ if (_detalhes.SendCharDataOnGroupChange and not _detalhes.SendCharDataOnGroupChange:IsCancelled()) then
return
end
_detalhes.SendCharDataOnGroupChange = C_Timer.NewTimer (11, function()
@@ -6093,11 +6093,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
if (_in_combat) then
- if (not _auto_regen_thread or _auto_regen_thread._cancelled) then
+ if (not _auto_regen_thread or _auto_regen_thread:IsCancelled()) then
_auto_regen_thread = C_Timer.NewTicker (AUTO_REGEN_PRECISION / 10, regen_power_overflow_check)
end
else
- if (_auto_regen_thread and not _auto_regen_thread._cancelled) then
+ if (_auto_regen_thread and not _auto_regen_thread:IsCancelled()) then
_auto_regen_thread:Cancel()
_auto_regen_thread = nil
end
diff --git a/core/plugins.lua b/core/plugins.lua
index 0a4e0dac..bad51d2e 100644
--- a/core/plugins.lua
+++ b/core/plugins.lua
@@ -461,6 +461,9 @@
--> menu background
local menuBackground = CreateFrame ("frame", "$parentMenuFrame", f,"BackdropTemplate")
_detalhes:FormatBackground (menuBackground)
+ local menuBackgroundTexture = menuBackground:CreateTexture("$parentBackgroundTexture", "background", nil, -2)
+ menuBackgroundTexture:SetAllPoints()
+ menuBackgroundTexture:SetColorTexture(0.2, 0.2, 0.2, .5)
--> statusbar
local statusBar = CreateFrame ("frame", nil, menuBackground,"BackdropTemplate")
diff --git a/core/plugins_toolbar.lua b/core/plugins_toolbar.lua
index cd582b5f..b0a18b86 100644
--- a/core/plugins_toolbar.lua
+++ b/core/plugins_toolbar.lua
@@ -48,12 +48,12 @@
button.__name = pluginname
--> blizzard built-in animation
- local FourCornerAnimeFrame = CreateFrame ("frame", framename.."Blink", button, "IconIntroAnimTemplate")
- FourCornerAnimeFrame:SetPoint ("center", button)
- FourCornerAnimeFrame:SetWidth (w or 14)
- FourCornerAnimeFrame:SetHeight (w or 14)
- FourCornerAnimeFrame.glow:SetScript ("OnFinished", nil)
- button.blink = FourCornerAnimeFrame
+ --local FourCornerAnimeFrame = CreateFrame ("frame", framename.."Blink", button) --, "IconIntroAnimTemplate" --stop using 'IconIntroAnimTemplate' as older versions of the game doesn't have it
+ --FourCornerAnimeFrame:SetPoint ("center", button)
+ --FourCornerAnimeFrame:SetWidth (w or 14)
+ --FourCornerAnimeFrame:SetHeight (w or 14)
+ --FourCornerAnimeFrame.glow:SetScript ("OnFinished", nil)
+ --button.blink = FourCornerAnimeFrame
_detalhes.ToolBar.AllButtons [#_detalhes.ToolBar.AllButtons+1] = button
@@ -97,12 +97,12 @@
if (Effect) then
if (type (Effect) == "string") then
if (Effect == "blink") then
- Button.blink.glow:Play()
+ --Button.blink.glow:Play() --.blink and .glow doesn't exists anymore due to removal of the template 'IconIntroAnimTemplate'
elseif (Effect == "star") then
- Button.StarAnim:Play()
+ --Button.StarAnim:Play()
end
elseif (Effect) then
- Button.blink.glow:Play()
+ --Button.blink.glow:Play()
end
end
diff --git a/core/windows.lua b/core/windows.lua
index 23b31859..227b3b10 100644
--- a/core/windows.lua
+++ b/core/windows.lua
@@ -1380,7 +1380,7 @@
end
elseif (button == "RightButton") then
-
+ --minimap menu
GameTooltip:Hide()
local GameCooltip = GameCooltip
@@ -1599,7 +1599,7 @@ function Details:LoadFramesForBroadcastTools()
end
--> current dps
- local bIsEnabled = _detalhes.current_dps_meter.enabled and (_detalhes.current_dps_meter.arena_enabled or _detalhes.current_dps_meter.mythic_dungeon_enabled)
+ local bIsEnabled = _detalhes.realtime_dps_meter.enabled and (_detalhes.realtime_dps_meter.arena_enabled or _detalhes.realtime_dps_meter.mythic_dungeon_enabled)
--> if enabled and not loaded, load it
if (bIsEnabled and not _detalhes.Broadcaster_CurrentDpsLoaded) then
@@ -1608,7 +1608,7 @@ function Details:LoadFramesForBroadcastTools()
--> if enabled, check if can show
if (bIsEnabled and _detalhes.Broadcaster_CurrentDpsLoaded) then
- if (_detalhes.current_dps_meter.mythic_dungeon_enabled) then
+ if (_detalhes.realtime_dps_meter.mythic_dungeon_enabled) then
local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo()
if (difficultyID == 8) then
--> player is inside a mythic dungeon
@@ -1616,7 +1616,7 @@ function Details:LoadFramesForBroadcastTools()
end
end
- if (_detalhes.current_dps_meter.arena_enabled) then
+ if (_detalhes.realtime_dps_meter.arena_enabled) then
local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo()
if (instanceType == "arena") then
--> player is inside an arena
diff --git a/frames/window_currentdps.lua b/frames/window_currentdps.lua
index fdaa55d8..ca93cffc 100644
--- a/frames/window_currentdps.lua
+++ b/frames/window_currentdps.lua
@@ -16,12 +16,16 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
local DF = _detalhes.gump
- local f = DF:CreateSimplePanel (UIParent, 700, 400, "Details! The Current Real DPS Options", "DetailsCurrentRealDPSOptions")
+ local f = DF:CreateSimplePanel (UIParent, 700, 400, "Details! Arena Damage Bar Options", "DetailsCurrentRealDPSOptions")
f:SetPoint ("center", UIParent, "center")
f:SetScript ("OnMouseDown", nil)
f:SetScript ("OnMouseUp", nil)
+
+ --scale bar
+ local scaleBar = DF:CreateScaleBar(f, _detalhes.realtime_dps_meter.options_frame)
+
local LibWindow = LibStub ("LibWindow-1.1")
- LibWindow.RegisterConfig (f, _detalhes.current_dps_meter.options_frame)
+ LibWindow.RegisterConfig (f, _detalhes.realtime_dps_meter.options_frame)
LibWindow.MakeDraggable (f)
LibWindow.RestorePosition (f)
@@ -31,11 +35,25 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")
local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")
+ --status bar
+ local statusBar = DF:CreateStatusBar(f)
+ statusBar.text = statusBar:CreateFontString(nil, "overlay", "GameFontNormal")
+ statusBar.text:SetPoint("left", statusBar, "left", 5, 0)
+ statusBar.text:SetText("By Terciob | Part of Details! Damage Meter | Built with Details! Framework")
+ DF:SetFontSize(statusBar.text, 11)
+ DF:SetFontColor(statusBar.text, "gray")
+
+ --add an extra background
+ local backgroundTexture = f:CreateTexture("$parentBackgroundTexture", "background")
+ backgroundTexture:SetColorTexture(.2, .2, .2, .2)
+ backgroundTexture:SetAllPoints()
+
+
local testUsing = "arena" --mythicdungeon
--> frame strata options
local set_frame_strata = function (_, _, strata)
- Details.current_dps_meter.frame.strata = strata
+ Details.realtime_dps_meter.frame_settings.strata = strata
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end
local strataTable = {}
@@ -47,7 +65,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--> font options
local set_font_shadow= function (_, _, shadow)
- Details.current_dps_meter.font_shadow = shadow
+ Details.realtime_dps_meter.font_shadow = shadow
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end
local fontShadowTable = {}
@@ -56,13 +74,13 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
fontShadowTable [3] = {value = "THICKOUTLINE", label = "Thick Outline", onclick = set_font_shadow}
local on_select_text_font = function (self, fixed_value, value)
- Details.current_dps_meter.font_face = value
+ Details.realtime_dps_meter.font_face = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end
local lockCallback = function()
local f = _G.DetailsCurrentDpsMeter
- if (Details.current_dps_meter.frame.locked) then
+ if (Details.realtime_dps_meter.frame_settings.locked) then
f.movemeLabel:Hide()
f.lockButton:Hide()
f:SetBackdropColor(.2, .2, .2, 0)
@@ -80,9 +98,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--enabled
{
type = "toggle",
- get = function() return Details.current_dps_meter.enabled end,
+ get = function() return Details.realtime_dps_meter.enabled end,
set = function (self, fixedparam, value)
- Details.current_dps_meter.enabled = not Details.current_dps_meter.enabled
+ Details.realtime_dps_meter.enabled = not Details.realtime_dps_meter.enabled
Details:LoadFramesForBroadcastTools()
end,
desc = "Enabled",
@@ -92,9 +110,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--locked
{
type = "toggle",
- get = function() return Details.current_dps_meter.frame.locked end,
+ get = function() return Details.realtime_dps_meter.frame_settings.locked end,
set = function (self, fixedparam, value)
- Details.current_dps_meter.frame.locked = not Details.current_dps_meter.frame.locked
+ Details.realtime_dps_meter.frame_settings.locked = not Details.realtime_dps_meter.frame_settings.locked
Details:UpdateTheRealCurrentDPSFrame(testUsing)
lockCallback()
end,
@@ -105,9 +123,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--showtitle
{
type = "toggle",
- get = function() return Details.current_dps_meter.frame.show_title end,
+ get = function() return Details.realtime_dps_meter.frame_settings.show_title end,
set = function (self, fixedparam, value)
- Details.current_dps_meter.frame.show_title = not Details.current_dps_meter.frame.show_title
+ Details.realtime_dps_meter.frame_settings.show_title = not Details.realtime_dps_meter.frame_settings.show_title
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
desc = "Show Title",
@@ -118,10 +136,10 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
{
type = "color",
get = function()
- return {Details.current_dps_meter.frame.backdrop_color[1], Details.current_dps_meter.frame.backdrop_color[2], Details.current_dps_meter.frame.backdrop_color[3], Details.current_dps_meter.frame.backdrop_color[4]}
+ return {Details.realtime_dps_meter.frame_settings.backdrop_color[1], Details.realtime_dps_meter.frame_settings.backdrop_color[2], Details.realtime_dps_meter.frame_settings.backdrop_color[3], Details.realtime_dps_meter.frame_settings.backdrop_color[4]}
end,
set = function (self, r, g, b, a)
- local color = Details.current_dps_meter.frame.backdrop_color
+ local color = Details.realtime_dps_meter.frame_settings.backdrop_color
color[1], color[2], color[3], color[4] = r, g, b, a
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
@@ -132,16 +150,16 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--statra
{
type = "select",
- get = function() return Details.current_dps_meter.frame.strata end,
+ get = function() return Details.realtime_dps_meter.frame_settings.strata end,
values = function() return strataTable end,
name = "Frame Strata"
},
--speed
{
type = "range",
- get = function() return Details.current_dps_meter.sample_size end,
+ get = function() return Details.realtime_dps_meter.sample_size end,
set = function (self, fixedparam, value)
- Details.current_dps_meter.sample_size = value
+ Details.realtime_dps_meter.sample_size = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 1,
@@ -154,13 +172,13 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--width
{
type = "range",
- get = function() return Details.current_dps_meter.frame.width end,
+ get = function() return Details.realtime_dps_meter.frame_settings.width end,
set = function (self, fixedparam, value)
- Details.current_dps_meter.frame.width = value
+ Details.realtime_dps_meter.frame_settings.width = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 1,
- max = 300,
+ max = 500,
step = 1,
name = "Width",
text_template = options_text_template,
@@ -168,9 +186,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--height
{
type = "range",
- get = function() return Details.current_dps_meter.frame.height end,
+ get = function() return Details.realtime_dps_meter.frame_settings.height end,
set = function (self, fixedparam, value)
- Details.current_dps_meter.frame.height = value
+ Details.realtime_dps_meter.frame_settings.height = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 1,
@@ -178,16 +196,17 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
step = 1,
name = "Height",
text_template = options_text_template,
- },
-
+ },
+
+ --[=[
{type = "breakline"},
{type = "label", get = function() return "Enabled On:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")},
--arenas
{
type = "toggle",
- get = function() return Details.current_dps_meter.arena_enabled end,
+ get = function() return Details.realtime_dps_meter.arena_enabled end,
set = function (self, fixedparam, value)
- Details.current_dps_meter.arena_enabled = not Details.current_dps_meter.arena_enabled
+ Details.realtime_dps_meter.arena_enabled = not Details.realtime_dps_meter.arena_enabled
Details:LoadFramesForBroadcastTools()
end,
name = "Arena Matches",
@@ -196,23 +215,24 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--mythic dungeon
{
type = "toggle",
- get = function() return Details.current_dps_meter.mythic_dungeon_enabled end,
+ get = function() return Details.realtime_dps_meter.mythic_dungeon_enabled end,
set = function (self, fixedparam, value)
- Details.current_dps_meter.mythic_dungeon_enabled = not Details.current_dps_meter.mythic_dungeon_enabled
+ Details.realtime_dps_meter.mythic_dungeon_enabled = not Details.realtime_dps_meter.mythic_dungeon_enabled
Details:LoadFramesForBroadcastTools()
end,
name = "Mythic Dungeons",
text_template = options_text_template,
},
-
+ --]=]
+
{type = "breakline"},
{type = "label", get = function() return "Text Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")},
--font size
{
type = "range",
- get = function() return Details.current_dps_meter.font_size end,
+ get = function() return Details.realtime_dps_meter.font_size end,
set = function (self, fixedparam, value)
- Details.current_dps_meter.font_size = value
+ Details.realtime_dps_meter.font_size = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 4,
@@ -225,10 +245,10 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
{
type = "color",
get = function()
- return {Details.current_dps_meter.font_color[1], Details.current_dps_meter.font_color[2], Details.current_dps_meter.font_color[3], Details.current_dps_meter.font_color[4]}
+ return {Details.realtime_dps_meter.font_color[1], Details.realtime_dps_meter.font_color[2], Details.realtime_dps_meter.font_color[3], Details.realtime_dps_meter.font_color[4]}
end,
set = function (self, r, g, b, a)
- local color = Details.current_dps_meter.font_color
+ local color = Details.realtime_dps_meter.font_color
color[1], color[2], color[3], color[4] = r, g, b, a
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
@@ -239,20 +259,34 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--font shadow
{
type = "select",
- get = function() return Details.current_dps_meter.font_shadow end,
+ get = function() return Details.realtime_dps_meter.font_shadow end,
values = function() return fontShadowTable end,
name = "Font Shadow"
},
--font face
{
type = "select",
- get = function() return Details.current_dps_meter.font_face end,
+ get = function() return Details.realtime_dps_meter.font_face end,
values = function() return DF:BuildDropDownFontList (on_select_text_font) end,
name = "Font Face",
text_template = options_text_template,
},
+
+ {
+ type = "range",
+ get = function() return _detalhes.realtime_dps_meter.text_offset end,
+ set = function (self, fixedparam, value)
+ _detalhes.realtime_dps_meter.text_offset = value
+ Details:UpdateTheRealCurrentDPSFrame(testUsing)
+ end,
+ min = 0,
+ max = 150,
+ step = 1,
+ name = "Text Position",
+ text_template = options_text_template,
+ },
}
-
+
DF:BuildMenu (f, options, 7, -50, 500, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
f:SetScript ("OnHide" , function()
@@ -304,22 +338,21 @@ function Details:CreateCurrentDpsFrame(parent, name)
local spacing_vertical = -6 --vertical space between the group anchor and the group dps
--> main farame
- local f = CreateFrame ("frame", name, parent or UIParent,"BackdropTemplate")
- f:SetPoint ("center", UIParent, "center")
- f:SetSize (_detalhes.current_dps_meter.frame.width, _detalhes.current_dps_meter.frame.height)
+ local f = CreateFrame ("frame", name, parent or UIParent, "BackdropTemplate")
+ f:SetPoint ("top", UIParent, "top", 0, -110)
+ f:SetSize (_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height)
f:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}})
- f:SetBackdropColor (unpack (_detalhes.current_dps_meter.frame.backdrop_color))
+ f:SetBackdropColor (unpack (_detalhes.realtime_dps_meter.frame_settings.backdrop_color))
f:EnableMouse (true)
f:SetMovable (true)
f:SetClampedToScreen (true)
f.movemeLabel = f:CreateFontString(nil, "overlay", "GameFontNormal")
- f.movemeLabel:SetPoint("center", f, "center", 0, 20)
f.movemeLabel:SetText("Move-Me")
f.lockButton = DetailsFramework:CreateButton(f, function()
- Details.current_dps_meter.frame.locked = not Details.current_dps_meter.frame.locked
+ Details.realtime_dps_meter.frame_settings.locked = not Details.realtime_dps_meter.frame_settings.locked
Details:UpdateTheRealCurrentDPSFrame()
f.movemeLabel:Hide()
f.lockButton:Hide()
@@ -327,7 +360,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
f.lockButton:SetPoint("center", f, "center", 0, -20)
f.lockButton.text = "Lock"
- if (Details.current_dps_meter.frame.locked) then
+ if (Details.realtime_dps_meter.frame_settings.locked) then
f.movemeLabel:Hide()
f.lockButton:Hide()
end
@@ -335,13 +368,13 @@ function Details:CreateCurrentDpsFrame(parent, name)
f.PlayerTeam = 0
local LibWindow = LibStub ("LibWindow-1.1")
- LibWindow.RegisterConfig (f, _detalhes.current_dps_meter.frame)
+ LibWindow.RegisterConfig (f, _detalhes.realtime_dps_meter.frame_settings)
LibWindow.MakeDraggable (f)
LibWindow.RestorePosition (f)
local lockCallback = function()
local f = _G.DetailsCurrentDpsMeter
- if (Details.current_dps_meter.frame.locked) then
+ if (Details.realtime_dps_meter.frame_settings.locked) then
f.movemeLabel:Hide()
f.lockButton:Hide()
f:SetBackdropColor(.2, .2, .2, 0)
@@ -352,12 +385,31 @@ function Details:CreateCurrentDpsFrame(parent, name)
end
end
+ C_Timer.After(10, function()
+ --f:SetPoint("top", UIParent, "top", 0, -110)
+ --LibWindow.SavePosition(f)
+ end)
+
+ GhostFrame:HookScript("OnShow", function(ghostFrame)
+ if (f:IsShown()) then
+ local p1, p2, p3, p4, p5 = ghostFrame:GetPoint(1)
+ f.GhostFrameY = f.GhostFrameY or 0
+ if (DF:IsNearlyEqual(p5, f.GhostFrameY, 0.1)) then
+ return
+ end
+
+ local newY = p5-45
+ ghostFrame:SetPoint(p1, p2, p3, p4, newY)
+ f.GhostFrameY = newY
+ end
+ end)
+
--> arena dps bars
--code for the dps bars shown in arenas
--frame to support the two bars, one for the dps and another for heal
--the dps bar is wider and taller, hps is below it and smaller
- local barFrame = CreateFrame("frame", "DetailsArenaDpsBars", f)
+ local barFrame = CreateFrame("frame", "DetailsArenaDpsBars", f, "BackdropTemplate")
f.dpsBarFrame = barFrame
barFrame:SetSize(400, 80)
barFrame:SetPoint("center", f, "center", 0, 0)
@@ -372,26 +424,54 @@ function Details:CreateCurrentDpsFrame(parent, name)
barFrame.splitBar:SetBackgroundColor(1, 0, 0, 1)
barFrame.splitBar.SparkAlwaysShow = true
- barFrame.borderFrame = CreateFrame("frame", "DetailsArenaDpsBarsBorderFrame", barFrame, "BackdropTemplate")
+
+ --barFrame.splitBar.widget.righttext:SetPoint("RIGHT", barFrame.splitBar.widget.righticon, "LEFT", -15, 0)
+ --barFrame.splitBar.widget.righttext:ClearAllPoints()
+
+ barFrame.borderFrame = CreateFrame("frame", "DetailsArenaDpsBarsBorderFrame", barFrame.splitBar.widget, "BackdropTemplate")
barFrame.borderFrame:SetFrameLevel(barFrame.splitBar:GetFrameLevel()-1)
+ barFrame.borderFrame:SetPoint("topleft", barFrame.splitBar.widget, "topleft", -1, 1)
+ barFrame.borderFrame:SetPoint("bottomright", barFrame.splitBar.widget, "bottomright", 1, -1)
+
+ f.movemeLabel:SetParent(barFrame.splitBar.widget)
+ f.movemeLabel:SetPoint("center", barFrame.splitBar.widget, "center", 0, 0)
+
local backgroundText = barFrame.borderFrame:CreateTexture(nil, "background")
backgroundText:SetColorTexture(0, 0, 0, 0.5)
backgroundText:SetAllPoints()
- barFrame.borderFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
- barFrame.borderFrame:SetBackdropBorderColor(0, 0, 0, 1)
- barFrame.borderFrame:SetPoint("topleft", barFrame.splitBar.widget, "topleft", -1, 1)
- barFrame.borderFrame:SetPoint("bottomright", barFrame.splitBar.widget, "bottomright", 1, -1)
-
+ local fff = CreateFrame("frame", "nopnopnopnopnop", barFrame.splitBar.widget, "BackdropTemplate")
+ fff:SetSize(300, 20)
+ fff:SetPoint("topleft", barFrame.splitBar.widget, "topleft", -1, 1)
+ fff:SetPoint("bottomright", barFrame.splitBar.widget, "bottomright", 1, -1)
+ fff:SetBackdrop({edgeFile = [[Interface\DialogFrame\UI-DialogBox-Gold-Border]], edgeSize = 10}) --, insets = {left = 1, right = 1, top = -10, bottom = -10}
+ fff:SetBackdropBorderColor(1, 1, 1, 1)
+ --fff:Hide()
+
+
+ local leftOrnamentTexture = fff:CreateTexture(nil, "overlay")
+ leftOrnamentTexture:SetTexture([[Interface\PETBATTLES\PETJOURNAL]])
+ leftOrnamentTexture:SetTexCoord(124/512, 161/512, 71/1024, 99/1024)
+ leftOrnamentTexture:SetPoint("right", fff, "left", 11, 0)
+ leftOrnamentTexture:SetSize(32, 32)
+ leftOrnamentTexture:SetAlpha(0.6)
+
+ local rightOrnamentTexture = fff:CreateTexture(nil, "overlay")
+ rightOrnamentTexture:SetTexture([[Interface\PETBATTLES\PETJOURNAL]])
+ rightOrnamentTexture:SetTexCoord(119/512, 156/512, 29/1024, 57/1024)
+ rightOrnamentTexture:SetPoint("left", fff, "right", -11, 0)
+ rightOrnamentTexture:SetSize(32, 32)
+ rightOrnamentTexture:SetAlpha(0.6)
--> title bar
local TitleString = f:CreateFontString (nil, "overlay", "GameFontNormal")
- TitleString:SetPoint ("top", f, "top", 0, -1)
- TitleString:SetText ("Dps on Last 5 Seconds")
+ TitleString:SetPoint ("top", f, "top", 0, -5)
+ TitleString:SetText ("Details! Arena Real Time DPS Tracker")
DF:SetFontSize (TitleString, 9)
local TitleBackground = f:CreateTexture (nil, "artwork")
TitleBackground:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]])
TitleBackground:SetVertexColor (.1, .1, .1, .9)
+ TitleBackground:SetVertexColor (.1, .1, .1, 0)
TitleBackground:SetPoint ("topleft", f, "topleft")
TitleBackground:SetPoint ("topright", f, "topright")
TitleBackground:SetHeight (header_size)
@@ -403,7 +483,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
labelYellowTeam_DPS:SetText ("0")
labelPlayerTeam_DPS:SetPoint ("left", barFrame.splitBar.widget, "left", 4, 0)
labelYellowTeam_DPS:SetPoint ("right", barFrame.splitBar.widget, "right", -4, 0)
-
+
function f.SwapArenaTeamColors()
green_team_color = Details.class_colors.ARENA_GREEN
yellow_team_color = Details.class_colors.ARENA_YELLOW
@@ -435,7 +515,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
--> update
local time_fraction = 100/1000 --one tick per 100ms
f.NextUpdate = time_fraction --when the next tick occur
- f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval --when the labels on the frame receive update
+ f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval --when the labels on the frame receive update
--> arena
f.PlayerTeamBuffer = {}
@@ -451,7 +531,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
f.LastTickGroupDamage = 0
--> general
- f.SampleSize = _detalhes.current_dps_meter.sample_size
+ f.SampleSize = _detalhes.realtime_dps_meter.sample_size
f.MaxBufferIndex = 1
f.ShowingArena = false
@@ -461,36 +541,36 @@ function Details:CreateCurrentDpsFrame(parent, name)
return
end
- if (not _detalhes.current_dps_meter.enabled) then
+ if (not _detalhes.realtime_dps_meter.enabled) then
f:Hide()
- print("D! debug currentdps.lua > !current_dps_meter.enabled")
+ print("D! debug currentdps.lua > !realtime_dps_meter.enabled")
return
end
- if (not _detalhes.current_dps_meter.arena_enabled and not _detalhes.current_dps_meter.mythic_dungeon_enabled) then
+ if (not _detalhes.realtime_dps_meter.arena_enabled and not _detalhes.realtime_dps_meter.mythic_dungeon_enabled) then
f:Hide()
- print("D! debug currentdps.lua > not _detalhes.current_dps_meter.arena_enabled and not _detalhes.current_dps_meter.mythic_dungeon_enabled")
+ print("D! debug currentdps.lua > not _detalhes.realtime_dps_meter.arena_enabled and not _detalhes.realtime_dps_meter.mythic_dungeon_enabled")
return
end
--> where the player are
if (scenario == "arena") then
- f.SampleSize = _detalhes.current_dps_meter.sample_size
+ f.SampleSize = _detalhes.realtime_dps_meter.sample_size
labelPlayerTeam_DPS:Show()
labelYellowTeam_DPS:Show()
--> update arena labels
- DF:SetFontColor (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_color)
- DF:SetFontFace (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_face)
- DF:SetFontSize (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_size)
- DF:SetFontOutline (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_shadow)
+ DF:SetFontColor (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_color)
+ DF:SetFontFace (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_face)
+ DF:SetFontSize (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_size)
+ DF:SetFontOutline (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_shadow)
- DF:SetFontColor (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_color)
- DF:SetFontFace (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_face)
- DF:SetFontSize (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_size)
- DF:SetFontOutline (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_shadow)
+ DF:SetFontColor (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_color)
+ DF:SetFontFace (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_face)
+ DF:SetFontSize (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_size)
+ DF:SetFontOutline (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_shadow)
--> wipe current data for arena
wipe (f.PlayerTeamBuffer)
@@ -509,6 +589,14 @@ function Details:CreateCurrentDpsFrame(parent, name)
DetailsArenaDpsBars.splitBar:Show()
barFrame.splitBar:EnableAnimations()
+ DetailsArenaDpsBars.splitBar:SetSize(Details.realtime_dps_meter.frame_settings.width, Details.realtime_dps_meter.frame_settings.height)
+ DetailsArenaDpsBars:EnableMouse(false)
+ DetailsArenaDpsBars.splitBar:EnableMouse(false)
+
+ TitleString:SetPoint("bottom", DetailsArenaDpsBars.splitBar.widget, "top", 0, 15)
+ TitleBackground:SetPoint("bottomleft", DetailsArenaDpsBars.splitBar.widget, "topleft", 0, 15)
+ TitleBackground:SetPoint("bottomright", DetailsArenaDpsBars.splitBar.widget, "topright", 0, 15)
+
--hide group widgets
labelGroupDamage:Hide()
labelGroupDamage_DPS:Hide()
@@ -518,10 +606,10 @@ function Details:CreateCurrentDpsFrame(parent, name)
labelGroupDamage:Show()
labelGroupDamage_DPS:Show()
- DF:SetFontColor (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_color)
- DF:SetFontFace (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_face)
- DF:SetFontSize (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_size)
- DF:SetFontOutline (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_shadow)
+ DF:SetFontColor (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_color)
+ DF:SetFontFace (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_face)
+ DF:SetFontSize (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_size)
+ DF:SetFontOutline (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_shadow)
--> wipe current data for mythic dungeon
f.GroupBuffer = {}
@@ -543,25 +631,25 @@ function Details:CreateCurrentDpsFrame(parent, name)
end
--> frame position
- f:SetSize (_detalhes.current_dps_meter.frame.width, _detalhes.current_dps_meter.frame.height)
- LibWindow.RegisterConfig (f, _detalhes.current_dps_meter.frame)
+ f:SetSize (_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height)
+ LibWindow.RegisterConfig (f, _detalhes.realtime_dps_meter.frame_settings)
LibWindow.RestorePosition (f)
--> backdrop color
- f:SetBackdropColor (unpack (_detalhes.current_dps_meter.frame.backdrop_color))
+ f:SetBackdropColor (unpack (_detalhes.realtime_dps_meter.frame_settings.backdrop_color))
--> set frame size
- f:SetSize (_detalhes.current_dps_meter.frame.width, _detalhes.current_dps_meter.frame.height)
+ f:SetSize (_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height)
--> frame is locked
- if (_detalhes.current_dps_meter.frame.locked) then
+ if (_detalhes.realtime_dps_meter.frame_settings.locked) then
f:EnableMouse (false)
else
f:EnableMouse (true)
end
--> frame can show title
- if (_detalhes.current_dps_meter.frame.show_title) then
+ if (_detalhes.realtime_dps_meter.frame_settings.show_title) then
TitleString:Show()
TitleBackground:Show()
else
@@ -570,13 +658,17 @@ function Details:CreateCurrentDpsFrame(parent, name)
end
--> frame strata
- f:SetFrameStrata (_detalhes.current_dps_meter.frame.strata)
+ f:SetFrameStrata (_detalhes.realtime_dps_meter.frame_settings.strata)
--> calcule buffer size
f.MaxBufferIndex = f.SampleSize * time_fraction * 100 --sample size in seconds * fraction * tick milliseconds
--> interval to update the frame
- f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval
+ f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval
+
+
+ labelPlayerTeam_DPS:SetPoint("left", barFrame.splitBar.widget, "left", 4 + _detalhes.realtime_dps_meter.text_offset, 0)
+ labelYellowTeam_DPS:SetPoint("right", barFrame.splitBar.widget, "right", -4 - _detalhes.realtime_dps_meter.text_offset, 0)
end
_detalhes:UpdateTheRealCurrentDPSFrame()
@@ -684,7 +776,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
dpsBarFrame:SetRightColor(unpack (green_team_color))
end
- if (Details.current_dps_meter.frame.locked) then
+ if (Details.realtime_dps_meter.frame_settings.locked) then
f.movemeLabel:Hide()
f.lockButton:Hide()
f:SetBackdropColor(.2, .2, .2, 0)
@@ -698,7 +790,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
labelPlayerTeam_DPS:SetText (_detalhes:ToK2 (self.YellowDamage / self.SampleSize))
labelYellowTeam_DPS:SetText (_detalhes:ToK2 (self.PlayerTeamDamage / self.SampleSize))
end
- f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval
+ f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval
end
elseif (self.ShowingMythicDungeon) then
@@ -739,7 +831,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
self.NextScreenUpdate = self.NextScreenUpdate - time_fraction
if (self.NextScreenUpdate <= 0) then
labelGroupDamage_DPS:SetText (_detalhes:ToK2 (f.GroupTotalDamage / self.SampleSize))
- f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval
+ f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval
end
end
@@ -775,14 +867,14 @@ function Details:CreateCurrentDpsFrame(parent, name)
local eventListener = _detalhes:CreateEventListener()
function eventListener:ArenaStarted()
- if (_detalhes.current_dps_meter.arena_enabled) then
+ if (_detalhes.realtime_dps_meter.arena_enabled) then
--it is working here, f:StartForArenaMatch() is called but the frame is still now shown.
f:StartForArenaMatch()
end
end
function eventListener:MythicDungeonStarted()
- if (_detalhes.current_dps_meter.mythic_dungeon_enabled) then
+ if (_detalhes.realtime_dps_meter.mythic_dungeon_enabled) then
f:StartForMythicDungeon()
end
end
diff --git a/frames/window_main.lua b/frames/window_main.lua
index e3d8d283..8c6aeb24 100644
--- a/frames/window_main.lua
+++ b/frames/window_main.lua
@@ -12,6 +12,7 @@ local segmentos = _detalhes.segmentos
--lua locals
local _math_ceil = math.ceil
local _math_floor = math.floor
+local floor = _math_floor
local _math_max = math.max
local _ipairs = ipairs
local _pairs = pairs
@@ -4093,37 +4094,19 @@ function gump:CreateNewLine (instancia, index)
newLine:EnableMouse (true)
newLine:RegisterForClicks ("LeftButtonDown", "RightButtonDown")
- --> statusbar
+ --statusbar
newLine.statusbar = CreateFrame ("StatusBar", "DetailsBarra_Statusbar_"..instancia.meu_id.."_"..index, newLine)
newLine.statusbar.value = 0
- --[[ Deprecation of right_to_left_texture in favor of StatusBar:SetReverseFill 5/2/2022 - Flamanis
- --> right to left texture
- newLine.statusbar.right_to_left_texture = newLine.statusbar:CreateTexture (nil, "overlay")
- newLine.statusbar.right_to_left_texture:SetPoint ("topright", newLine.statusbar, "topright")
- newLine.statusbar.right_to_left_texture:SetPoint ("bottomright", newLine.statusbar, "bottomright")
- newLine.statusbar.right_to_left_texture:SetWidth (0.000000001)
- newLine.statusbar.right_to_left_texture:Hide()
- newLine.right_to_left_texture = newLine.statusbar.right_to_left_texture
- ]]
- --> frame for hold the backdrop border
- newLine.border = CreateFrame ("Frame", "DetailsBarra_Border_" .. instancia.meu_id .. "_" .. index, newLine.statusbar,"BackdropTemplate")
+
+ --frame for hold the backdrop border
+ newLine.border = CreateFrame ("Frame", "DetailsBarra_Border_" .. instancia.meu_id .. "_" .. index, newLine.statusbar, "BackdropTemplate")
newLine.border:SetFrameLevel (newLine.statusbar:GetFrameLevel()+2)
newLine.border:SetAllPoints (newLine)
-
+
--border
newLine.lineBorder = DetailsFramework:CreateFullBorder(newLine:GetName() .. "Border", newLine.border)
- --[=[
- if (DetailsFramework.IsTBCWow()) then
- lineBorder = DetailsFramework:CreateFullBorder(nil, newLine)
- --lineBorder = CreateFrame("frame", nil, newLine, "DFNamePlateFullBorderTemplate, BackdropTemplate")
- else
- lineBorder = CreateFrame("frame", nil, newLine, "NamePlateFullBorderTemplate, BackdropTemplate")
- end
- newLine.lineBorder = lineBorder
- --]=]
- -- search key: ~model
-
- --low 3d bar
+
+ --low 3d bar --search key: ~model
newLine.modelbox_low = CreateFrame ("playermodel", "DetailsBarra_ModelBarLow_" .. instancia.meu_id .. "_" .. index, newLine) --rowframe
newLine.modelbox_low:SetFrameLevel (newLine.statusbar:GetFrameLevel()-1)
newLine.modelbox_low:SetPoint ("topleft", newLine, "topleft")
@@ -4355,10 +4338,23 @@ function Details:RefreshTitleBar()
local texturePath = SharedMedia:Fetch("statusbar", texture)
- self.baseframe.titleBar:SetShown(shown)
- self.baseframe.titleBar:SetHeight(height)
- self.baseframe.titleBar.texture:SetTexture(texturePath)
- self.baseframe.titleBar.texture:SetVertexColor(DetailsFramework:ParseColors(color))
+ local titleBar = self.baseframe.titleBar
+ titleBar:SetShown(shown)
+
+ --menu_attribute_string is nil in tbc (20 jun 2022)
+ if (not self.menu_attribute_string) then
+ return
+ end
+
+ if (shown) then
+ titleBar:SetHeight(height)
+ titleBar.texture:SetTexture(texturePath)
+ titleBar.texture:SetVertexColor(DetailsFramework:ParseColors(color))
+
+ self.menu_attribute_string:SetParent(titleBar)
+ else
+ self.menu_attribute_string:SetParent(self.baseframe)
+ end
end
function _detalhes:SetBarModel (upper_enabled, upper_model, upper_alpha, lower_enabled, lower_model, lower_alpha)
@@ -4430,7 +4426,41 @@ function _detalhes:SetBarSpecIconSettings (enabled, iconfile, fulltrack)
self:ReajustaGump()
end
-function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, backgroundtexture, backgroundcolorclass, backgroundfixedcolor, alpha, iconfile, barstart, spacement, texture_custom)
+function Details:SetBarArenaRoleIconSettings(show_icon, icon_size_offset)
+ if (type(show_icon) ~= "boolean") then
+ show_icon = self.row_info.show_arena_role_icon
+ end
+
+ if (not icon_size_offset or type(icon_size_offset) ~= "number") then
+ icon_size_offset = self.row_info.arena_role_icon_size_offset
+ end
+
+ self.row_info.show_arena_role_icon = show_icon
+ self.row_info.arena_role_icon_size_offset = icon_size_offset
+
+ self:InstanceReset()
+ self:InstanceRefreshRows()
+ self:ReajustaGump()
+end
+
+function Details:SetBarFactionIconSettings(show_faction_icon, faction_icon_size_offset)
+ if (type(show_faction_icon) ~= "boolean") then
+ show_faction_icon = self.row_info.show_faction_icon
+ end
+
+ if (not faction_icon_size_offset or type(faction_icon_size_offset) ~= "number") then
+ faction_icon_size_offset = self.row_info.faction_icon_size_offset
+ end
+
+ self.row_info.show_faction_icon = show_faction_icon
+ self.row_info.faction_icon_size_offset = faction_icon_size_offset
+
+ self:InstanceReset()
+ self:InstanceRefreshRows()
+ self:ReajustaGump()
+end
+
+function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, backgroundtexture, backgroundcolorclass, backgroundfixedcolor, alpha, iconfile, barstart, spacement, texture_custom, icon_size_offset)
--> bar start
if (type (barstart) == "boolean") then
@@ -4505,6 +4535,10 @@ function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, back
c [1], c [2], c [3], c [4] = red, green, blue, alpha
end
+ if (icon_size_offset and type(icon_size_offset) == "number") then
+ self.row_info.icon_size_offset = icon_size_offset
+ end
+
self:InstanceReset()
self:InstanceRefreshRows()
self:ReajustaGump()
@@ -4564,7 +4598,7 @@ end
--/script _detalhes:InstanceRefreshRows (_detalhes.tabela_instancias[1])
---> on update function
+--onupdate function for 'Fast Updates' feature
local fast_ps_func = function (self)
local instance = self.instance
@@ -4572,8 +4606,16 @@ local fast_ps_func = function (self)
return
end
- local combat_time = instance.showing:GetCombatTime()
- local ps_type = _detalhes.ps_abbreviation
+ local combatTime = instance.showing:GetCombatTime()
+ local abbreviationType = _detalhes.ps_abbreviation
+ local abbreviationFunc = tok_functions[abbreviationType]
+
+ local isInLineTextEnabled = instance.use_multi_fontstrings
+ local instanceShowDataSettings = instance.row_info.textR_show_data
+
+ local showingAllData = instanceShowDataSettings[3] and instanceShowDataSettings[2] and instanceShowDataSettings[1]
+ local showingTotalAndPS = not instanceShowDataSettings[3] and instanceShowDataSettings[2] and instanceShowDataSettings[1]
+ local showingOnlyPS = not instanceShowDataSettings[3] and instanceShowDataSettings[2] and not instanceShowDataSettings[1]
if (instance.rows_fit_in_window) then
for i = 1, instance.rows_fit_in_window do --instance:GetNumRows()
@@ -4581,14 +4623,21 @@ local fast_ps_func = function (self)
if (row and row:IsShown()) then
local actor = row.minha_tabela
if (actor) then
- local dps_text = row.ps_text
- if (dps_text) then
- local new_dps = _math_floor (actor.total / combat_time)
- local formated_dps = tok_functions [ps_type] (_, new_dps)
- --row.lineText4:SetText (row.lineText4:GetText():gsub (dps_text, formated_dps))
- row.lineText4:SetText (( row.lineText4:GetText() or "" ):gsub (dps_text, formated_dps))
- row.ps_text = formated_dps
+ local currentDps = floor(actor.total / combatTime) --can also be hps
+ if (isInLineTextEnabled) then
+ if (showingAllData) then
+ row.lineText3:SetText(abbreviationFunc(nil, currentDps))
+ elseif (showingTotalAndPS or showingOnlyPS) then
+ row.lineText4:SetText(abbreviationFunc(nil, currentDps))
+ end
+ else
+ local dpsText = row.ps_text
+ if (dpsText) then
+ local formatedDps = abbreviationFunc(nil, currentDps)
+ row.lineText4:SetText((row.lineText4:GetText() or ""):gsub(dpsText, formatedDps))
+ row.ps_text = formatedDps
+ end
end
end
end
@@ -5005,6 +5054,35 @@ function Details:SetBarOverlaySettings(overlayTexture, overlayColor)
self:InstanceRefreshRows()
end
+--adjust to which frame the wallpaper texture is parented to
+--dependind on the frame it can be shown above or below background textures
+function Details:SetInstanceWallpaperLevel(wallpaperLevel)
+ if (type(wallpaperLevel) ~= "number") then
+ wallpaperLevel = self.wallpaper.level
+ end
+
+ self.wallpaper.level = wallpaperLevel
+
+ --refresh the wallpaper parent
+ local wallpaperTexture = self.baseframe.wallpaper
+
+ if (wallpaperLevel == 0) then
+ wallpaperTexture:SetParent(self.baseframe.titleBar) --framelevel +0 (parented to titleBar)
+
+ elseif (wallpaperLevel == 1) then
+ wallpaperTexture:SetParent(self.baseframe) --framelevel +0
+
+ elseif (wallpaperLevel == 2) then
+ wallpaperTexture:SetParent(self.rowframe) --framelevel +3
+
+ elseif (wallpaperLevel == 3) then
+ wallpaperTexture:SetParent(self.windowSwitchButton) --framelevel +4
+ end
+
+ --debug
+ --/run Details:GetWindow(1):SetInstanceWallpaperLevel(0)
+end
+
-- search key: ~wallpaper
function _detalhes:InstanceWallpaper (texture, anchor, alpha, texcoord, width, height, overlay)
@@ -7306,6 +7384,9 @@ function Details:ChangeSkin(skin_name)
--> update title bar
self:RefreshTitleBar()
+ --> update the wallpaper level
+ self:SetInstanceWallpaperLevel()
+
--> clear any control sscript running in this instance
self.bgframe:SetScript ("OnUpdate", nil)
self.bgframe.skin_script = nil
diff --git a/frames/window_options2.lua b/frames/window_options2.lua
index 3f7199cb..245d4a07 100644
--- a/frames/window_options2.lua
+++ b/frames/window_options2.lua
@@ -155,107 +155,109 @@ function Details.options.InitializeOptionsWindow(instance)
editingGroupLabel:SetPoint("bottomleft", instances_string, "topleft", 0, 5)
editingGroupCheckBox:SetPoint("left", editingGroupLabel, "right", 2, 0)
- --create bars
- DF:NewColor ("C_OptionsButtonOrange", 0.9999, 0.8196, 0, 1)
+ --> create test bars
+ DF:NewColor ("C_OptionsButtonOrange", 0.9999, 0.8196, 0, 1)
- local create_test_bars_func = function()
- _detalhes.CreateTestBars()
- if (not _detalhes.test_bar_update) then
- _detalhes:StartTestBarUpdate()
- else
- _detalhes:StopTestBarUpdate()
+ local create_test_bars_func = function()
+ _detalhes.CreateTestBars()
+ if (not _detalhes.test_bar_update) then
+ _detalhes:StartTestBarUpdate()
+ else
+ _detalhes:StopTestBarUpdate()
+ end
end
- end
- local fillbars = DF:NewButton (f, _, "$parentCreateExampleBarsButton", nil, 140, 20, create_test_bars_func, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1)
- fillbars:SetPoint ("bottomleft", f.widget, "bottomleft", 10, 10)
- fillbars:SetTemplate(options_button_template)
- fillbars:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {323/512, 365/512, 42/512, 78/512}, {1, 1, 1, 0.6}, 4, 2)
+ local fillbars = DF:NewButton (f, _, "$parentCreateExampleBarsButton", nil, 140, 20, create_test_bars_func, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1)
+ fillbars:SetPoint ("bottomleft", f.widget, "bottomleft", 10, 10)
+ fillbars:SetTemplate(options_button_template)
+ fillbars:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {323/512, 365/512, 42/512, 78/512}, {1, 1, 1, 0.6}, 4, 2)
- --change log
- local changelog = DF:NewButton (f, _, "$parentOpenChangeLogButton", nil, 140, 20, _detalhes.OpenNewsWindow, "change_log", nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1)
- changelog:SetPoint ("left", fillbars, "right", 10, 0)
- changelog:SetTemplate (options_button_template)
- changelog:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {367/512, 399/512, 43/512, 76/512}, {1, 1, 1, 0.8}, 4, 2)
+ --> change log
+ local changelog = DF:NewButton (f, _, "$parentOpenChangeLogButton", nil, 140, 20, _detalhes.OpenNewsWindow, "change_log", nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1)
+ changelog:SetPoint ("left", fillbars, "right", 10, 0)
+ changelog:SetTemplate (options_button_template)
+ changelog:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {367/512, 399/512, 43/512, 76/512}, {1, 1, 1, 0.8}, 4, 2)
- --search field
- local searchBox = DF:CreateTextEntry(f, function()end, 150, 20, _, _, _, options_dropdown_template)
- searchBox:SetPoint ("topright", f, "topright", -5, -30)
+ --> search field
+ local searchBox = DF:CreateTextEntry(f, function()end, 140, 20, _, _, _, options_dropdown_template)
+ searchBox:SetPoint ("bottomleft", fillbars, "topleft", 0, 5)
- local searchLabel = DF:CreateLabel(f, "Search:", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE"))
- searchLabel:SetPoint ("right", searchBox, "left", -2, 0)
+ local searchLabel = DF:CreateLabel(f, "Search:", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) --localize-me
+ searchLabel:SetPoint ("bottomleft", searchBox, "topleft", 0, 2)
+ searchLabel.fontface = "GameFontNormal"
+ searchLabel.fontsize = 12
- searchBox:SetHook("OnChar", function()
- if (searchBox.text ~= "") then
- local searchSection = f.sectionFramesContainer[19]
- searchSection.sectionButton:Enable()
- searchSection.sectionButton:Click()
+ searchBox:SetHook("OnChar", function()
+ if (searchBox.text ~= "") then
+ local searchSection = f.sectionFramesContainer[19]
+ searchSection.sectionButton:Enable()
+ searchSection.sectionButton:Click()
- local searchingFor = searchBox.text
- local allSectionFrames = f.sectionFramesContainer
+ local searchingFor = searchBox.text
+ local allSectionFrames = f.sectionFramesContainer
- local allSectionNames = {}
- local allSectionOptions = {}
+ local allSectionNames = {}
+ local allSectionOptions = {}
- for i = 1, #allSectionFrames do
- local sectionFrame = allSectionFrames[i]
- local sectionOptionsTable = sectionFrame.sectionOptions
+ for i = 1, #allSectionFrames do
+ local sectionFrame = allSectionFrames[i]
+ local sectionOptionsTable = sectionFrame.sectionOptions
- allSectionNames[#allSectionNames+1] = sectionFrame.name
- allSectionOptions[#allSectionOptions+1] = sectionOptionsTable
- end
-
- --this table will hold all options
- local allOptions = {}
- --start the fill process filling 'allOptions' with each individual option from each tab
- for i = 1, #allSectionOptions do
- local sectionOptions = allSectionOptions[i]
- local lastLabel = nil
- for k, setting in pairs(sectionOptions) do
- if (setting.type == "label") then
- lastLabel = setting
- end
- if (setting.name) then
- allOptions[#allOptions+1] = {setting = setting, label = lastLabel, header = allSectionNames[i]}
- end
+ allSectionNames[#allSectionNames+1] = sectionFrame.name
+ allSectionOptions[#allSectionOptions+1] = sectionOptionsTable
end
- end
- local searchingText = string.lower(searchingFor)
- searchBox:SetFocus()
-
- local options = {}
-
- local lastTab = nil
- local lastLabel = nil
- for i = 1, #allOptions do
- local optionData = allOptions[i]
- local optionName = string.lower(optionData.setting.name)
- if (optionName:find(searchingText)) then
- if optionData.header ~= lastTab then
- if lastTab ~= nil then
- options[#options+1] = {type = "label", get = function() return "" end, text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")} -- blank
+ --this table will hold all options
+ local allOptions = {}
+ --start the fill process filling 'allOptions' with each individual option from each tab
+ for i = 1, #allSectionOptions do
+ local sectionOptions = allSectionOptions[i]
+ local lastLabel = nil
+ for k, setting in pairs(sectionOptions) do
+ if (setting.type == "label") then
+ lastLabel = setting
+ end
+ if (setting.name) then
+ allOptions[#allOptions+1] = {setting = setting, label = lastLabel, header = allSectionNames[i]}
end
- options[#options+1] = {type = "label", get = function() return optionData.header end, text_template = {color = "silver", size = 14, font = DF:GetBestFontForLanguage()}}
- lastTab = optionData.header
- lastLabel = nil
end
- if optionData.label ~= lastLabel then
- options[#options+1] = optionData.label
- lastLabel = optionData.label
- end
- options[#options+1] = optionData.setting
end
+
+ local searchingText = string.lower(searchingFor)
+ searchBox:SetFocus()
+
+ local options = {}
+
+ local lastTab = nil
+ local lastLabel = nil
+ for i = 1, #allOptions do
+ local optionData = allOptions[i]
+ local optionName = string.lower(optionData.setting.name)
+ if (optionName:find(searchingText)) then
+ if optionData.header ~= lastTab then
+ if lastTab ~= nil then
+ options[#options+1] = {type = "label", get = function() return "" end, text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")} -- blank
+ end
+ options[#options+1] = {type = "label", get = function() return optionData.header end, text_template = {color = "silver", size = 14, font = DF:GetBestFontForLanguage()}}
+ lastTab = optionData.header
+ lastLabel = nil
+ end
+ if optionData.label ~= lastLabel then
+ options[#options+1] = optionData.label
+ lastLabel = optionData.label
+ end
+ options[#options+1] = optionData.setting
+ end
+ end
+
+ local startX = 200
+ local startY = -60
+
+ DF:BuildMenuVolatile(searchSection, options, startX, startY, 560, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template, globalCallback)
+
+ else
+ f.sectionFramesContainer[19].sectionButton:Disable()
end
-
- local startX = 200
- local startY = -40
-
- DF:BuildMenuVolatile(searchSection, options, startX, startY, 500, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template, globalCallback)
-
- else
- f.sectionFramesContainer[19].sectionButton:Disable()
- end
- end)
+ end)
local sectionsName = { --section names
[1] = Loc ["STRING_OPTIONSMENU_DISPLAY"],
@@ -316,8 +318,20 @@ function Details.options.InitializeOptionsWindow(instance)
if (type(sectionId) == "number") then
local sectionFrame = CreateFrame("frame", "$parentTab" .. sectionId, f, "BackdropTemplate")
- sectionFrame:SetAllPoints()
+ --sectionFrame:SetAllPoints()
+ --sectionFrame:ClearAllPoints()
+ sectionFrame:SetPoint("topleft", f, "topleft", -40, 22)
+ sectionFrame:SetSize(f:GetSize())
sectionFrame:EnableMouse(false)
+
+ local realBackdropAreaFrame = CreateFrame("frame", "$parentTab" .. sectionId .. "BackdropArea", f, "BackdropTemplate")
+ realBackdropAreaFrame:SetFrameLevel(f:GetFrameLevel()-1)
+ realBackdropAreaFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
+ realBackdropAreaFrame:SetBackdropColor(0, 0, 0, .1)
+ realBackdropAreaFrame:SetBackdropBorderColor(0.2, 0.2, 0.2, .05)
+ realBackdropAreaFrame:SetPoint("topleft", f, "topleft", 150, -27)
+ realBackdropAreaFrame:SetSize(770, 570)
+
sectionFrame.name = sectionsName[sectionId]
--tinsert(f.sectionFramesContainer, sectionFrame)
f.sectionFramesContainer[sectionId] = sectionFrame
diff --git a/frames/window_options2_sections.lua b/frames/window_options2_sections.lua
index b5ea2d20..e5547795 100644
--- a/frames/window_options2_sections.lua
+++ b/frames/window_options2_sections.lua
@@ -1405,39 +1405,6 @@ do
},
{type = "breakline"},
- {type = "label", get = function() return "Arena Team Color" end, text_template = subSectionTitleTextTemplate},
- {--team 1 color
- type = "color",
- get = function()
- local r, g, b = unpack(Details.class_colors.ARENA_GREEN)
- return {r, g, b, 1}
- end,
- set = function (self, r, g, b, a)
- Details.class_colors.ARENA_GREEN[1] = r
- Details.class_colors.ARENA_GREEN[2] = g
- Details.class_colors.ARENA_GREEN[3] = b
- afterUpdate()
- end,
- name = Loc ["STRING_COLOR"],
- desc = "Arena team color",
- },
- {--team 2 color
- type = "color",
- get = function()
- local r, g, b = unpack(Details.class_colors.ARENA_YELLOW)
- return {r, g, b, 1}
- end,
- set = function (self, r, g, b, a)
- Details.class_colors.ARENA_YELLOW[1] = r
- Details.class_colors.ARENA_YELLOW[2] = g
- Details.class_colors.ARENA_YELLOW[3] = b
- afterUpdate()
- end,
- name = Loc ["STRING_COLOR"],
- desc = "Arena team color",
- },
-
- {type = "blank"},
{type = "label", get = function() return Loc ["STRING_OPTIONS_TEXT_ROWICONS_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
{--select icon file
@@ -1486,7 +1453,7 @@ do
desc = Loc ["STRING_CUSTOM_TEXTURE_GUIDE"],
},
- {--bar start at
+ {--bar start after icon
type = "toggle",
get = function() return currentInstance.row_info.start_after_icon end,
set = function (self, fixedparam, value)
@@ -1497,61 +1464,83 @@ do
desc = Loc ["STRING_OPTIONS_BARSTART_DESC"],
},
- {type = "blank"},
- {type = "label", get = function() return Loc ["STRING_OPTIONS_BAR_BACKDROP_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
-
- {--border enabled
- type = "toggle",
- get = function() return currentInstance.row_info.backdrop.enabled end,
- set = function (self, fixedparam, value)
- editInstanceSetting(currentInstance, "SetBarBackdropSettings", value)
- afterUpdate()
- end,
- name = Loc ["STRING_ENABLED"],
- desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_ENABLED_DESC"],
- },
-
- {--border color
- type = "color",
- get = function()
- local r, g, b, a = unpack(currentInstance.row_info.backdrop.color)
- return {r, g, b, a}
- end,
- set = function (self, r, g, b, a)
- editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, {r, g, b, a})
- afterUpdate()
- end,
- name = Loc ["STRING_COLOR"],
- desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_COLOR_DESC"],
- },
-
- {--border size
+ {--icon size offset
type = "range",
- get = function() return tonumber (currentInstance.row_info.backdrop.size) end,
+ get = function() return tonumber (currentInstance.row_info.icon_size_offset) end,
set = function (self, fixedparam, value)
- editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, value)
+ editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value)
afterUpdate()
end,
- min = 0,
- max = 10,
- step = 1,
+ min = -20,
+ max = 20,
usedecimals = true,
- name = Loc ["STRING_OPTIONS_SIZE"],
- desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_SIZE_DESC"],
- },
-
- {--border uses class colors
- type = "toggle",
- get = function() return currentInstance.row_info.backdrop.use_class_colors end,
- set = function (self, fixedparam, value)
- editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, nil, value)
- afterUpdate()
- end,
- name = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"],
- desc = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS_DESC"],
+ step = 0.5,
+ name = "Icon Size Offset", --localize-me
+ desc = "Icon Size Offset",
+ thumbscale = 2.2,
},
{type = "blank"},
+
+ {--show faction icon
+ type = "toggle",
+ get = function() return currentInstance.row_info.show_faction_icon end,
+ set = function (self, fixedparam, value)
+ editInstanceSetting(currentInstance, "SetBarFactionIconSettings", value)
+ afterUpdate()
+ end,
+ name = "Show Faction Icon", --localize-me
+ desc = "When showing a player from the opposite faction, show the faction icon.",
+ },
+
+ {--faction icon size offset
+ type = "range",
+ get = function() return tonumber (currentInstance.row_info.faction_icon_size_offset) end,
+ set = function (self, fixedparam, value)
+ editInstanceSetting(currentInstance, "SetBarFactionIconSettings", nil, value)
+ afterUpdate()
+ end,
+ min = -20,
+ max = 20,
+ usedecimals = true,
+ step = 0.5,
+ name = "Faction Icon Size Offset", --localize-me
+ desc = "Faction Icon Size Offset",
+ thumbscale = 2.2,
+ },
+
+ {type = "blank"},
+
+ {--show role icon
+ type = "toggle",
+ get = function() return currentInstance.row_info.show_arena_role_icon end,
+ set = function (self, fixedparam, value)
+ editInstanceSetting(currentInstance, "SetBarArenaRoleIconSettings", value)
+ afterUpdate()
+ end,
+ name = "Show Arena Role Icon", --localize-me
+ desc = "When showing a player from arena, show the role icon.",
+ },
+
+ {--role icon size offset
+ type = "range",
+ get = function() return tonumber (currentInstance.row_info.arena_role_icon_size_offset) end,
+ set = function (self, fixedparam, value)
+ editInstanceSetting(currentInstance, "SetBarArenaRoleIconSettings", nil, value)
+ afterUpdate()
+ end,
+ min = -20,
+ max = 20,
+ usedecimals = true,
+ step = 0.5,
+ name = "Arena Role Icon Size Offset", --localize-me
+ desc = "Arena Role Icon Size Offset",
+ thumbscale = 2.2,
+ },
+
+
+ {type = "blank"},
+ --{type = "breakline"},
{type = "label", get = function() return Loc["STRING_OPTIONS_ALIGNED_TEXT_COLUMNS"] end, text_template = subSectionTitleTextTemplate},
{--inline text enabled
@@ -1643,6 +1632,7 @@ do
},
{type = "breakline"},
+
{type = "label", get = function() return Loc ["STRING_OPTIONS_TOTALBAR_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
{--total bar enabled
@@ -1679,6 +1669,94 @@ do
name = Loc ["STRING_COLOR"],
desc = Loc ["STRING_OPTIONS_SHOW_TOTALBAR_COLOR_DESC"],
},
+
+ {type = "blank"},
+ {type = "label", get = function() return "Arena Team Color" end, text_template = subSectionTitleTextTemplate}, --localize-me
+ {--team 1 color
+ type = "color",
+ get = function()
+ local r, g, b = unpack(Details.class_colors.ARENA_GREEN)
+ return {r, g, b, 1}
+ end,
+ set = function (self, r, g, b, a)
+ Details.class_colors.ARENA_GREEN[1] = r
+ Details.class_colors.ARENA_GREEN[2] = g
+ Details.class_colors.ARENA_GREEN[3] = b
+ afterUpdate()
+ end,
+ name = Loc ["STRING_COLOR"],
+ desc = "Arena team color", --localize-me
+ },
+ {--team 2 color
+ type = "color",
+ get = function()
+ local r, g, b = unpack(Details.class_colors.ARENA_YELLOW)
+ return {r, g, b, 1}
+ end,
+ set = function (self, r, g, b, a)
+ Details.class_colors.ARENA_YELLOW[1] = r
+ Details.class_colors.ARENA_YELLOW[2] = g
+ Details.class_colors.ARENA_YELLOW[3] = b
+ afterUpdate()
+ end,
+ name = Loc ["STRING_COLOR"],
+ desc = "Arena team color", --localize-me
+ },
+
+ {type = "blank"},
+ {type = "label", get = function() return Loc ["STRING_OPTIONS_BAR_BACKDROP_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
+
+ {--border enabled
+ type = "toggle",
+ get = function() return currentInstance.row_info.backdrop.enabled end,
+ set = function (self, fixedparam, value)
+ editInstanceSetting(currentInstance, "SetBarBackdropSettings", value)
+ afterUpdate()
+ end,
+ name = Loc ["STRING_ENABLED"],
+ desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_ENABLED_DESC"],
+ },
+
+ {--border color
+ type = "color",
+ get = function()
+ local r, g, b, a = unpack(currentInstance.row_info.backdrop.color)
+ return {r, g, b, a}
+ end,
+ set = function (self, r, g, b, a)
+ editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, {r, g, b, a})
+ afterUpdate()
+ end,
+ name = Loc ["STRING_COLOR"],
+ desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_COLOR_DESC"],
+ },
+
+ {--border size
+ type = "range",
+ get = function() return tonumber (currentInstance.row_info.backdrop.size) end,
+ set = function (self, fixedparam, value)
+ editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, value)
+ afterUpdate()
+ end,
+ min = 0,
+ max = 10,
+ step = 1,
+ usedecimals = true,
+ name = Loc ["STRING_OPTIONS_SIZE"],
+ desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_SIZE_DESC"],
+ thumbscale = 1.5,
+ },
+
+ {--border uses class colors
+ type = "toggle",
+ get = function() return currentInstance.row_info.backdrop.use_class_colors end,
+ set = function (self, fixedparam, value)
+ editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, nil, value)
+ afterUpdate()
+ end,
+ name = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"],
+ desc = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS_DESC"],
+ },
}
sectionFrame.sectionOptions = sectionOptions
@@ -4865,6 +4943,20 @@ do
desc = Loc ["STRING_OPTIONS_WP_ALIGN"],
},
+ {--wallpaper level
+ type = "range",
+ get = function() return currentInstance.wallpaper.level end, --default 2
+ set = function (self, fixedparam, value)
+ editInstanceSetting(currentInstance, "SetInstanceWallpaperLevel", value)
+ afterUpdate()
+ end,
+ min = 0,
+ max = 3,
+ step = 1,
+ name = "Level",
+ desc = "Change where the wallpaper is placed.", --localize-me
+ },
+
{--edit wallpaper
type = "execute",
func = function(self)
@@ -5819,7 +5911,7 @@ do
local button_width = 160
- --> streamer plugin - a.k.a. player spell tracker
+ --> streamer plugin - a.k.a. Action Tracker
--> title anchor
DF:NewLabel (sectionFrame, _, "$parentStreamerPluginAnchor", "streamerPluginAnchor", "Action Tracker", "GameFontNormal")
sectionFrame.streamerPluginAnchor:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 20)
@@ -5828,71 +5920,87 @@ do
streamerTitleDesc:SetSize (270, 40)
streamerTitleDesc:SetJustifyV ("top")
streamerTitleDesc:SetPoint ("topleft", sectionFrame.streamerPluginAnchor, "bottomleft", 0, -4)
-
- local streamerTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 256, 41, "overlay", {0.5, 1, 0.49, 0.57})
+
+ local streamerTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2.blp]], 268*0.75, 59*0.75, "overlay", {0, 268/512, 454/512, 1})
streamerTitleImage:SetPoint ("topleft", sectionFrame.streamerPluginAnchor, "bottomleft", 0, -40)
-
+
--> get the plugin object
- local StreamerPlugin = _detalhes:GetPlugin ("DETAILS_PLUGIN_STREAM_OVERLAY")
+ local StreamerPlugin = Details:GetPlugin("DETAILS_PLUGIN_STREAM_OVERLAY")
if (StreamerPlugin) then
- --> get the plugin settings table
- local tPluginSettings = _detalhes:GetPluginSavedTable ("DETAILS_PLUGIN_STREAM_OVERLAY")
+ --get the plugin settings table
+ local tPluginSettings = Details:GetPluginSavedTable("DETAILS_PLUGIN_STREAM_OVERLAY")
if (tPluginSettings) then
+ local enablePluginFunc = function()
+ tPluginSettings.enabled = not tPluginSettings.enabled
+ StreamerPlugin.__enabled = tPluginSettings.enabled
+
+ if (not tPluginSettings.enabled) then
+ sectionFrame.enableActionTrackerButtton:SetText("Enable")
+ Details:SendEvent("PLUGIN_DISABLED", StreamerPlugin)
+ else
+ sectionFrame.enableActionTrackerButtton:SetText("Disable") --enableButton is nil value
+ Details:SendEvent("PLUGIN_ENABLED", StreamerPlugin)
+ end
+ end
+
+ local openOptions = function()
+ StreamerPlugin.OpenOptionsPanel(true)
+ C_Timer.After(0.2, function()
+ _G.DetailsOptionsWindow:Hide()
+ end)
+ end
+
+ --create the enable, disable and options button
+ local enableActionTrackerButtton = DF:CreateButton(sectionFrame, enablePluginFunc, 100, 20, "Enable", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
+ enableActionTrackerButtton:SetPoint("topleft", streamerTitleImage, "bottomleft", 0, -7)
+
+ local actionTrackerOptionsButtton = DF:CreateButton(sectionFrame, openOptions, 100, 20, "Options", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
+ actionTrackerOptionsButtton:SetPoint("left", enableActionTrackerButtton, "right", 5, 0)
+
+ sectionFrame.enableActionTrackerButtton = enableActionTrackerButtton
+ sectionFrame.actionTrackerOptionsButtton = actionTrackerOptionsButtton
+
local bIsPluginEnabled = tPluginSettings.enabled
- --> plugin already enabled
+
+ --plugin already enabled
if (bIsPluginEnabled) then
- --> config button
- local configure_streamer_plugin = function()
- StreamerPlugin.OpenOptionsPanel (true)
- C_Timer.After (0.2, function()
- _G.DetailsOptionsWindow:Hide()
- end)
- end
- local configurePluginButton = DF:NewButton (sectionFrame, _, "$parentConfigureStreamerPluginButton", "configureStreamerPlugin", 100, 20, configure_streamer_plugin, nil, nil, nil, "Action Tracker Options", nil, options_button_template)
- configurePluginButton:SetWidth (button_width)
- configurePluginButton:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -7)
-
- --> text telling how to disable
- local pluginAlreadyEnabled = DF:NewLabel (sectionFrame, _, "$parentStreamerAlreadyEnabledText", "StreamerAlreadyEnabledTextLabel", "Plugin is enabled. You may disable it on Plugin Management section.", "GameFontNormal", 10, "white")
- pluginAlreadyEnabled:SetJustifyV ("top")
- pluginAlreadyEnabled:SetSize (270, 40)
- pluginAlreadyEnabled:SetPoint ("topleft", configurePluginButton, "bottomleft", 0, -7)
+ enableActionTrackerButtton:SetText("Disable")
else
- --> plugin isnt enabled, create the enable button
- local enable_streamer_plugin = function()
- tPluginSettings.enabled = true
- StreamerPlugin.__enabled = true
- _detalhes:SendEvent ("PLUGIN_ENABLED", StreamerPlugin)
-
- sectionFrame.enableStreamerPluginButton:Hide()
-
- --> config button
- local configure_streamer_plugin = function()
- StreamerPlugin.OpenOptionsPanel()
- end
- local configurePluginButton = DF:NewButton (sectionFrame, _, "$parentConfigureStreamerPluginButton", "configureStreamerPlugin", 100, 20, configure_streamer_plugin, nil, nil, nil, "Action Tracker Options", nil, options_button_template)
- configurePluginButton:SetWidth (button_width)
- configurePluginButton:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -7)
-
- --> text telling how to disable
- local pluginAlreadyEnabled = DF:NewLabel (sectionFrame, _, "$parentStreamerAlreadyEnabledText", "StreamerAlreadyEnabledTextLabel", "Plugin is enabled. You may disable it on Plugin Management section.", "GameFontNormal", 10, "white")
- pluginAlreadyEnabled:SetJustifyV ("top")
- pluginAlreadyEnabled:SetSize (270, 40)
- pluginAlreadyEnabled:SetPoint ("topleft", configurePluginButton, "bottomleft", 0, -7)
- end
-
- local enablePluginButton = DF:NewButton (sectionFrame, _, "$parentEnableStreamerPluginButton", "enableStreamerPluginButton", 100, 20, enable_streamer_plugin, nil, nil, nil, "Enable Plugin", nil, options_button_template)
- enablePluginButton:SetWidth (button_width)
- enablePluginButton:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -5)
+ enableActionTrackerButtton:SetText("Enable")
end
end
else
- --> plugin is disabled at the addon control panel
- local pluginDisabled = DF:NewLabel (sectionFrame, _, "$parentStreamerDisabledText", "StreamerDisabledTextLabel", "Details!: Streamer Plugin is disabled on the AddOns Control Panel.", "GameFontNormal", 10, "red")
- pluginDisabled:SetSize (270, 40)
- pluginDisabled:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -2)
+ --plugin is disabled at the addon control panel
+ local pluginDisabled = DF:NewLabel(sectionFrame, _, "$parentStreamerDisabledText", "StreamerDisabledTextLabel", "Enable 'Details!: Streamer' addon at the AddOns Control Panel.", "GameFontNormal", 10, "red")
+ pluginDisabled:SetSize(270, 40)
+ pluginDisabled:SetPoint("topleft", streamerTitleImage, "bottomleft", 0, -2)
end
-
+
+ sectionFrame:SetScript("OnShow", function()
+ local pluginStable = Details:GetPluginSavedTable("DETAILS_PLUGIN_STREAM_OVERLAY")
+ local pluginObject = Details:GetPlugin("DETAILS_PLUGIN_STREAM_OVERLAY")
+
+ if (pluginObject) then
+ if (pluginStable.enabled) then
+ sectionFrame.enableActionTrackerButtton:SetText("Disable")
+ else
+ sectionFrame.enableActionTrackerButtton:SetText("Enable")
+ end
+ end
+
+ if (Details.event_tracker.enabled) then
+ sectionFrame.enableEventTrackerButtton:SetText("Disable")
+ else
+ sectionFrame.enableEventTrackerButtton:SetText("Enable")
+ end
+
+ if (Details.realtime_dps_meter.enabled) then
+ sectionFrame.enableArenaDPSTrackerButtton:SetText("Disable")
+ else
+ sectionFrame.enableArenaDPSTrackerButtton:SetText("Enable")
+ end
+ end)
+
--> event tracker
DF:NewLabel (sectionFrame, _, "$parentEventTrackerAnchor", "eventTrackerAnchor", "Event Tracker", "GameFontNormal")
@@ -5906,72 +6014,96 @@ do
local eventTrackerTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 256, 50, "overlay", {0.5, 1, 134/512, 184/512})
eventTrackerTitleImage:SetPoint ("topleft", sectionFrame.eventTrackerAnchor, "bottomleft", 0, -40)
- --> enable feature checkbox
- DF:NewLabel (sectionFrame, _, "$parentEnableEventTrackerLabel", "EventTrackerLabel", "Enable Event Tracker", "GameFontHighlightLeft")
- DF:NewSwitch (sectionFrame, _, "$parentEventTrackerSlider", "EventTrackerSlider", 60, 20, _, _, _detalhes.event_tracker.enabled, nil, nil, nil, nil, options_switch_template)
+ local enableEventTracker = function()
+ Details.event_tracker.enabled = not Details.event_tracker.enabled
+ Details:LoadFramesForBroadcastTools()
+ afterUpdate()
- sectionFrame.EventTrackerSlider:SetPoint ("left", sectionFrame.EventTrackerLabel, "right", 2)
- sectionFrame.EventTrackerSlider:SetAsCheckBox()
- sectionFrame.EventTrackerSlider.OnSwitch = function (_, _, value)
- _detalhes.event_tracker.enabled = not _detalhes.event_tracker.enabled
- Details:LoadFramesForBroadcastTools()
- afterUpdate()
- end
- sectionFrame.EventTrackerLabel:SetPoint ("topleft", eventTrackerTitleImage, "bottomleft", 0, -20)
- sectionFrame.EventTrackerSlider:SetPoint ("left", sectionFrame.EventTrackerLabel, "right", 2, 0)
-
- --> configure feature button
- local configure_event_tracker = function()
- _detalhes:OpenEventTrackerOptions (true)
- C_Timer.After (0.2, function()
- _G.DetailsOptionsWindow:Hide()
- end)
- end
- local configureEventTrackerButton = DF:NewButton (sectionFrame, _, "$parentConfigureEventTrackerButton", "configureEventTracker", 100, 20, configure_event_tracker, nil, nil, nil, "Event Tracker Options", nil, options_button_template)
- configureEventTrackerButton:SetWidth (button_width)
- configureEventTrackerButton:SetPoint ("topleft", sectionFrame.EventTrackerLabel, "bottomleft", 0, -7)
+ if (Details.event_tracker.enabled) then
+ sectionFrame.enableEventTrackerButtton:SetText("Disable")
+ else
+ sectionFrame.enableEventTrackerButtton:SetText("Enable")
+ end
+ end
+
+ local openEventTrackerOptions = function()
+ Details:OpenEventTrackerOptions(true)
+ C_Timer.After(0.2, function()
+ _G.DetailsOptionsWindow:Hide()
+ end)
+ end
+
+ --create the enable, disable and options button
+ local enableEventTrackerButtton = DF:CreateButton(sectionFrame, enableEventTracker, 100, 20, "Enable", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
+ enableEventTrackerButtton:SetPoint("topleft", eventTrackerTitleImage, "bottomleft", 0, -7)
+
+ local actionTrackerOptionsButtton = DF:CreateButton(sectionFrame, openEventTrackerOptions, 100, 20, "Options", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
+ actionTrackerOptionsButtton:SetPoint("left", enableEventTrackerButtton, "right", 5, 0)
+
+ sectionFrame.enableEventTrackerButtton = enableEventTrackerButtton
+ sectionFrame.actionTrackerOptionsButtton = actionTrackerOptionsButtton
- --> current dps
- DF:NewLabel (sectionFrame, _, "$parentCurrentDPSAnchor", "currentDPSAnchor", "The Real Current DPS", "GameFontNormal")
- sectionFrame.currentDPSAnchor:SetPoint("topleft", sectionFrame, "topleft", startX + 350, startY - 20)
+ --> arena kamehameha bar
+ DF:NewLabel (sectionFrame, _, "$parentCurrentDPSAnchor", "currentDPSAnchor", "Arena DPS Bar", "GameFontNormal")
+ sectionFrame.currentDPSAnchor:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 340)
- local currentDPSTitleDesc = DF:NewLabel (sectionFrame, _, "$parentCurrentDPSTitleDescText", "CurrentDPSTitleDescTextLabel", "Show a frame with DPS done only in the last 5 seconds. Useful for arena matches and mythic dungeons.", "GameFontNormal", 10, "white")
+ local currentDPSTitleDesc = DF:NewLabel (sectionFrame, _, "$parentCurrentDPSTitleDescText", "CurrentDPSTitleDescTextLabel", "Show a bar which grows to the side of the team doing most damage in the last 5 seconds.", "GameFontNormal", 10, "white")
currentDPSTitleDesc:SetJustifyV ("top")
currentDPSTitleDesc:SetSize (270, 40)
currentDPSTitleDesc:SetPoint ("topleft", sectionFrame.currentDPSAnchor, "bottomleft", 0, -4)
- local currentDPSTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 250, 61, "overlay", {259/512, 509/512, 186/512, 247/512})
+ local currentDPSTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 256, 32, "overlay", {0/512, 256/512, 421/512, 453/512})
currentDPSTitleImage:SetPoint ("topleft", sectionFrame.currentDPSAnchor, "bottomleft", 0, -40)
- --> enable feature checkbox
- DF:NewLabel (sectionFrame, _, "$parentEnableCurrentDPSLabel", "CurrentDPSLabel", "Enable The Real Current Dps", "GameFontHighlightLeft")
- DF:NewSwitch (sectionFrame, _, "$parentCurrentDPSSlider", "CurrentDPSSlider", 60, 20, _, _, _detalhes.current_dps_meter.enabled, nil, nil, nil, nil, options_switch_template)
-
- sectionFrame.CurrentDPSSlider:SetPoint ("left", sectionFrame.CurrentDPSLabel, "right", 2)
- sectionFrame.CurrentDPSSlider:SetAsCheckBox()
- sectionFrame.CurrentDPSSlider.OnSwitch = function (_, _, value)
- _detalhes.current_dps_meter.enabled = not _detalhes.current_dps_meter.enabled
- Details:LoadFramesForBroadcastTools()
- afterUpdate()
- end
-
- sectionFrame.CurrentDPSLabel:SetPoint ("topleft", currentDPSTitleImage, "bottomleft", 0, -10)
- sectionFrame.CurrentDPSSlider:SetPoint ("left", sectionFrame.CurrentDPSLabel, "right", 2, 0)
-
- --> configure feature button
- local configure_current_dps = function()
- _detalhes:OpenCurrentRealDPSOptions (true)
- C_Timer.After (0.2, function()
- _G.DetailsOptionsWindow:Hide()
- end)
- end
- local configureCurrentDPSButton = DF:NewButton (sectionFrame, _, "$parentConfigureCurrentDPSButton", "configureCurrentDPS", 100, 20, configure_current_dps, nil, nil, nil, "Current Real DPS Options", nil, options_button_template)
- configureCurrentDPSButton:SetWidth (button_width)
- configureCurrentDPSButton:SetPoint ("topleft", sectionFrame.CurrentDPSLabel, "bottomleft", 0, -7)
+ local enableArenaDPS = function()
+ Details.realtime_dps_meter.enabled = not Details.realtime_dps_meter.enabled
+ Details:LoadFramesForBroadcastTools()
+ afterUpdate()
+ if (Details.realtime_dps_meter.enabled) then
+ sectionFrame.enableArenaDPSTrackerButtton:SetText("Disable")
+ else
+ sectionFrame.enableArenaDPSTrackerButtton:SetText("Enable")
+ end
+ end
+
+ local openArenaDPSOptions = function()
+ Details:OpenCurrentRealDPSOptions(true)
+ C_Timer.After(0.2, function()
+ _G.DetailsOptionsWindow:Hide()
+ end)
+ end
+
+ --create the enable, disable and options button
+ local enableArenaDPSTrackerButtton = DF:CreateButton(sectionFrame, enableArenaDPS, 100, 20, "Enable", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
+ enableArenaDPSTrackerButtton:SetPoint("topleft", currentDPSTitleImage, "bottomleft", 0, -7)
+
+ local arenaDPSTrackerOptionsButtton = DF:CreateButton(sectionFrame, openArenaDPSOptions, 100, 20, "Options", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
+ arenaDPSTrackerOptionsButtton:SetPoint("left", enableArenaDPSTrackerButtton, "right", 5, 0)
+
+ sectionFrame.enableArenaDPSTrackerButtton = enableArenaDPSTrackerButtton
+ sectionFrame.arenaDPSTrackerOptionsButtton = arenaDPSTrackerOptionsButtton
+
+ --create a gray texture below each plugin section
+ local createBackgroupTexture = function()
+ local texture = sectionFrame:CreateTexture(nil, "background")
+ texture:SetColorTexture(1, 1, 1, .1)
+ texture:SetSize(300, 150)
+ return texture
+ end
+
+ local backgroundTexture1 = createBackgroupTexture()
+ backgroundTexture1:SetPoint("topleft", sectionFrame.streamerPluginAnchor.widget, "topleft", -5, 5)
+
+ local backgroundTexture2 = createBackgroupTexture()
+ backgroundTexture2:SetPoint("topleft", sectionFrame.eventTrackerAnchor.widget, "topleft", -5, 5)
+
+ local backgroundTexture3 = createBackgroupTexture()
+ backgroundTexture3:SetPoint("topleft", sectionFrame.currentDPSAnchor.widget, "topleft", -5, 5)
+ --options
local sectionOptions = {
{type = "label", get = function() return Loc ["STRING_GERAL"] .. ":" end, text_template = subSectionTitleTextTemplate},
@@ -6045,7 +6177,7 @@ do
}
sectionFrame.sectionOptions = sectionOptions
- DF:BuildMenu(sectionFrame, sectionOptions, startX + 350, startY - 20 - 200, heightSize + 300, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
+ DF:BuildMenu(sectionFrame, sectionOptions, startX + 350, startY - 20, heightSize + 300, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
end
tinsert(Details.optionsSection, buildSection)
diff --git a/functions/autorun.lua b/functions/autorun.lua
index cb49096a..d4e5cc37 100644
--- a/functions/autorun.lua
+++ b/functions/autorun.lua
@@ -35,7 +35,7 @@ end
autoRunCodeEventFrame.OnEventFunc = function(self, event)
--> ignore events triggered more than once in a small time window
- if (autoRunCodeEventFrame [event] and not autoRunCodeEventFrame [event]._cancelled) then
+ if (autoRunCodeEventFrame [event] and not autoRunCodeEventFrame [event]:IsCancelled()) then
return
end
diff --git a/functions/currentdps.lua b/functions/currentdps.lua
new file mode 100644
index 00000000..9f2d7fa0
--- /dev/null
+++ b/functions/currentdps.lua
@@ -0,0 +1,100 @@
+
+
+local Details = _G.Details
+
+--namespace
+Details.CurrentDps = {
+ Dps = {},
+ Hps = {},
+}
+
+local currentDpsFrame = CreateFrame("frame", "DetailsCurrentDpsUpdaterFrame", UIParent)
+local delayTimeBetweenUpdates = 0.10
+local currentDelay = 0
+local cacheSize = 40 --4 seconds of data
+local dpsTime = delayTimeBetweenUpdates * cacheSize
+local cacheOverflowIndex = cacheSize + 1
+
+currentDpsFrame.OnUpdateFunc = function(self, deltaTime)
+ currentDelay = currentDelay + deltaTime
+ if (currentDelay < delayTimeBetweenUpdates) then
+ return
+ end
+
+ local combatObject = Details.CurrentDps.CombatObject
+
+ local damageContainer = combatObject:GetContainer(DETAILS_ATTRIBUTE_DAMAGE)
+ for index, actorObject in damageContainer:ListActors() do
+ if (actorObject:IsPlayer()) then
+ local actorTable = Details.CurrentDps.Dps[actorObject.serial]
+ if (not actorTable) then
+ actorTable = {
+ totalDamage = 0, --hold a sum of all dps done in the latest #cacheSize delayed OnUpdate ticks
+ currentDps = 0,
+ latestDamageAmount = 0,
+ cache = {},
+ }
+ Details.CurrentDps.Dps[actorObject.serial] = actorTable
+ end
+
+ --get the damage done on this tick
+ local totalDamageThisTick = actorObject.total - actorTable.latestDamageAmount
+ --add the damage to the cache
+ tinsert(actorTable.cache, 1, totalDamageThisTick)
+ --set the latest damage amount
+ actorTable.latestDamageAmount = actorObject.total
+ --sum the total damage the actor inflicted
+ actorTable.totalDamage = actorTable.totalDamage + totalDamageThisTick
+
+ --cut the damage
+ local damageRemoved = tremove(actorTable.cache, cacheOverflowIndex)
+ if (damageRemoved) then
+ actorTable.totalDamage = actorTable.totalDamage - damageRemoved
+ actorTable.totalDamage = max(0, actorTable.totalDamage) --safe guard
+ end
+
+ actorTable.currentDps = actorTable.totalDamage / dpsTime
+ if (actorObject.nome == "Ditador") then
+ local formatToKFunc = Details:GetCurrentToKFunction()
+ print(actorTable.totalDamage, #actorTable.cache, dpsTime, formatToKFunc(nil, actorTable.currentDps))
+ end
+
+ if (actorObject.nome == "Ditador") then
+ --print("Dps:", actorTable.currentDps)
+ end
+ end
+ end
+
+ currentDelay = 0
+end
+
+--start the proccess of updating the current dps and hps for each player
+function Details.CurrentDps.StartCurrentDpsTracker()
+ Details.CurrentDps.CombatObject = Details:GetCurrentCombat()
+ wipe(Details.CurrentDps.Dps)
+ wipe(Details.CurrentDps.Hps)
+ currentDpsFrame:SetScript("OnUpdate", currentDpsFrame.OnUpdateFunc)
+end
+--stop what the function above started
+function Details.CurrentDps.StopCurrentDpsTracker()
+ currentDpsFrame:SetScript("OnUpdate", nil)
+end
+
+--serial = guid
+function Details.CurrentDps.GetCurrentDps(serial)
+ local actorTable = Details.CurrentDps.Dps[serial]
+ if (actorTable) then
+ local currentDps = actorTable.currentDps
+ local formatToKFunc = Details:GetCurrentToKFunction()
+ return formatToKFunc(nil, currentDps)
+ end
+end
+
+--handle internal details! events
+local eventListener = Details:CreateEventListener()
+eventListener:RegisterEvent("COMBAT_PLAYER_ENTER", function()
+ --Details.CurrentDps.StartCurrentDpsTracker()
+end)
+eventListener:RegisterEvent("COMBAT_PLAYER_LEAVE", function()
+ --Details.CurrentDps.StopCurrentDpsTracker()
+end)
\ No newline at end of file
diff --git a/functions/plater.lua b/functions/plater.lua
index d1f1a723..bde9fb59 100644
--- a/functions/plater.lua
+++ b/functions/plater.lua
@@ -127,7 +127,7 @@ function Details:RefreshPlaterIntegration()
plater_integration_frame.PlayerGUID = UnitGUID ("player")
--> cancel the timer if already have one
- if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer._cancelled) then
+ if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer:IsCancelled()) then
plater_integration_frame.CleanUpTimer:Cancel()
end
@@ -149,7 +149,7 @@ function Details:RefreshPlaterIntegration()
plater_integration_frame.OnTickFrame:SetScript ("OnUpdate", nil)
--> stop the cleanup process
- if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer._cancelled) then
+ if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer:IsCancelled()) then
plater_integration_frame.CleanUpTimer:Cancel()
end
end
diff --git a/functions/profiles.lua b/functions/profiles.lua
index aefc9ccd..cdf10f6d 100644
--- a/functions/profiles.lua
+++ b/functions/profiles.lua
@@ -1033,27 +1033,34 @@ local default_profile = {
line_texture = "Details Serenity",
line_color = {.1, .1, .1, 0.3},
},
-
+
--> current damage
- current_dps_meter = {
- frame = {
- locked = false,
- width = 220,
- height = 65,
+ realtime_dps_meter = {
+ frame_settings = {
+ locked = true,
+ width = 300,
+ height = 23,
backdrop_color = {0, 0, 0, 0.2},
- show_title = false,
+ show_title = true,
strata = "LOW",
+
+ --libwindow
+ point = "TOP",
+ scale = 1,
+ y = -110,
+ x = 0,
},
options_frame = {},
enabled = false,
arena_enabled = true,
- mythic_dungeon_enabled = true,
+ mythic_dungeon_enabled = false,
font_size = 18,
font_color = {1, 1, 1, 1},
font_shadow = "NONE",
font_face = "Friz Quadrata TT",
+ text_offset = 2,
update_interval = 0.30,
- sample_size = 5, --in seconds
+ sample_size = 3, --in seconds
},
--> streamer
diff --git a/functions/slash.lua b/functions/slash.lua
index 6793123c..7f0c163a 100644
--- a/functions/slash.lua
+++ b/functions/slash.lua
@@ -2004,8 +2004,8 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
{text = "Class", width = 40, canSort = true, dataType = "number", order = "DESC", offset = 0},
{text = "Player Name", width = 140, canSort = true, dataType = "string", order = "DESC", offset = 0},
{text = "Level", width = 60, canSort = true, dataType = "number", order = "DESC", offset = 0, selected = true},
- {text = "Dungeon", width = 120, canSort = true, dataType = "string", order = "DESC", offset = 0},
- {text = "Classic Dungeon", width = 120, canSort = true, dataType = "string", order = "DESC", offset = 0},
+ {text = "Dungeon", width = 240, canSort = true, dataType = "string", order = "DESC", offset = 0},
+ --{text = "Classic Dungeon", width = 120, canSort = true, dataType = "string", order = "DESC", offset = 0},
{text = "Mythic+ Rating", width = 100, canSort = true, dataType = "number", order = "DESC", offset = 0},
}
@@ -2065,7 +2065,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
line.playerNameText.text = unitName
line.keystoneLevelText.text = level
line.dungeonNameText.text = mapName
- DetailsFramework:TruncateText(line.dungeonNameText, 120)
+ DetailsFramework:TruncateText(line.dungeonNameText, 240)
line.classicDungeonNameText.text = mapNameChallenge or ""
DetailsFramework:TruncateText(line.classicDungeonNameText, 120)
line.inMyParty = inMyParty > 0
@@ -2178,7 +2178,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
line:AddFrameToHeaderAlignment(playerNameText)
line:AddFrameToHeaderAlignment(keystoneLevelText)
line:AddFrameToHeaderAlignment(dungeonNameText)
- line:AddFrameToHeaderAlignment(classicDungeonNameText)
+ --line:AddFrameToHeaderAlignment(classicDungeonNameText)
line:AddFrameToHeaderAlignment(ratingText)
line:AlignWithHeader(f.Header, "left")
diff --git a/images/icons2.blp b/images/icons2.blp
index 84618773..274cc2b9 100644
Binary files a/images/icons2.blp and b/images/icons2.blp differ
diff --git a/plugins/Details_RaidCheck/Details_RaidCheck.lua b/plugins/Details_RaidCheck/Details_RaidCheck.lua
index 499c0265..5a44e9fb 100644
--- a/plugins/Details_RaidCheck/Details_RaidCheck.lua
+++ b/plugins/Details_RaidCheck/Details_RaidCheck.lua
@@ -751,7 +751,7 @@ end
else
DetailsRaidCheck:HideToolbarIcon (DetailsRaidCheck.ToolbarButton)
DetailsRaidCheck.on_raid = false
- if (DetailsRaidCheck.UpdateBuffsTick and not DetailsRaidCheck.UpdateBuffsTick._cancelled) then
+ if (DetailsRaidCheck.UpdateBuffsTick and not DetailsRaidCheck.UpdateBuffsTick:IsCancelled()) then
DetailsRaidCheck.UpdateBuffsTick:Cancel()
end
end
@@ -844,7 +844,7 @@ end
DetailsRaidCheck:BuffTrackTick()
- if (DetailsRaidCheck.UpdateBuffsTick and not DetailsRaidCheck.UpdateBuffsTick._cancelled) then
+ if (DetailsRaidCheck.UpdateBuffsTick and not DetailsRaidCheck.UpdateBuffsTick:IsCancelled()) then
DetailsRaidCheck.UpdateBuffsTick:Cancel()
end
@@ -859,7 +859,7 @@ end
function DetailsRaidCheck:StopTrackBuffs()
DetailsRaidCheck.tracking_buffs = false
- if (DetailsRaidCheck.UpdateBuffsTick and not DetailsRaidCheck.UpdateBuffsTick._cancelled) then
+ if (DetailsRaidCheck.UpdateBuffsTick and not DetailsRaidCheck.UpdateBuffsTick:IsCancelled()) then
DetailsRaidCheck.UpdateBuffsTick:Cancel()
end
end