- Framework update.

- Fix for hunters spec detection.
- Spells panel can now be opened from outside Details!.
- Overall data will now track everything by default for new Details! instalation.
This commit is contained in:
Tercio
2018-07-30 14:02:20 -03:00
parent 720a95bc1b
commit 5f55045b15
10 changed files with 296 additions and 15 deletions
+13 -5
View File
@@ -486,7 +486,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
backdrop_color = {.8, .8, .8, 0.2},
panel_border_color = {.01, 0, 0, 1},
iconcoords = {.1, .9, .1, .9},
onenter = function(self, capsule, value) GameTooltip:SetOwner (self, "ANCHOR_RIGHT"); GameTooltip:SetSpellByID(value); GameTooltip:AddLine (" "); GameTooltip:Show() end,
onenter = function(self, capsule, value) GameTooltip:SetOwner (self, "ANCHOR_CURSOR"); GameTooltip:SetSpellByID(value); GameTooltip:AddLine (" "); GameTooltip:Show() end,
show_x_button = true,
x_button_func = function (spellId)
f.db.aura_tracker.debuff_banned [spellId] = nil; DF:QuickDispatch (change_callback);
@@ -507,7 +507,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
backdrop_color = {.8, .8, .8, 0.2},
panel_border_color = {.02, 0, 0, 1},
iconcoords = {.1, .9, .1, .9},
onenter = function(self, capsule, value) GameTooltip:SetOwner (self, "ANCHOR_RIGHT"); GameTooltip:SetSpellByID(value); GameTooltip:AddLine (" "); GameTooltip:Show() end,
onenter = function(self, capsule, value) GameTooltip:SetOwner (self, "ANCHOR_CURSOR"); GameTooltip:SetSpellByID(value); GameTooltip:AddLine (" "); GameTooltip:Show() end,
show_x_button = true,
x_button_func = function (spellId)
f.db.aura_tracker.buff_banned [spellId] = nil; DF:QuickDispatch (change_callback);
@@ -527,7 +527,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
backdrop_color = {.8, .8, .8, 0.2},
panel_border_color = {0, .02, 0, 1},
iconcoords = {.1, .9, .1, .9},
onenter = function(self, capsule, value) GameTooltip:SetOwner (self, "ANCHOR_RIGHT"); GameTooltip:SetSpellByID(value); GameTooltip:AddLine (" "); GameTooltip:Show() end,
onenter = function(self, capsule, value) GameTooltip:SetOwner (self, "ANCHOR_CURSOR"); GameTooltip:SetSpellByID(value); GameTooltip:AddLine (" "); GameTooltip:Show() end,
show_x_button = true,
x_button_func = function (spellId)
f.db.aura_tracker.debuff_tracked [spellId] = nil; DF:QuickDispatch (change_callback);
@@ -547,7 +547,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
backdrop_color = {.8, .8, .8, 0.2},
panel_border_color = {0, .01, 0, 1},
iconcoords = {.1, .9, .1, .9},
onenter = function(self, capsule, value) GameTooltip:SetOwner (self, "ANCHOR_RIGHT"); GameTooltip:SetSpellByID(value); GameTooltip:AddLine (" "); GameTooltip:Show() end,
onenter = function(self, capsule, value) GameTooltip:SetOwner (self, "ANCHOR_CURSOR"); GameTooltip:SetSpellByID(value); GameTooltip:AddLine (" "); GameTooltip:Show() end,
show_x_button = true,
x_button_func = function (spellId)
f.db.aura_tracker.buff_tracked [spellId] = nil; DF:QuickDispatch (change_callback);
@@ -610,7 +610,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
self:SetBackdropColor (unpack (backdrop_color_on_enter))
local spellid = select (7, GetSpellInfo (self.value))
if (spellid) then
GameTooltip:SetOwner (self, "ANCHOR_RIGHT");
GameTooltip:SetOwner (self, "ANCHOR_CURSOR")
GameTooltip:SetSpellByID (spellid)
GameTooltip:AddLine (" ")
GameTooltip:Show()
@@ -857,6 +857,14 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
buffs_added:Refresh()
debuffs_added:Refresh()
----------------------- ---------------------------------------------- ---------------------------------------------- -----------------------
f:SetScript ("OnShow", function()
buffs_added:Refresh()
debuffs_added:Refresh()
end)
return f
end
+2
View File
@@ -1031,6 +1031,8 @@ function DF:NewButton (parent, container, name, member, w, h, func, param1, para
ButtonObject.options = {OnGrab = false}
ButtonObject.button = CreateFrame ("button", name, parent)
DF:Mixin (ButtonObject.button, DF.WidgetFunctions)
build_button (ButtonObject.button)
ButtonObject.widget = ButtonObject.button
+3 -3
View File
@@ -311,7 +311,8 @@ local function isOptionVisible (thisOption)
end
function DropDownMetaFunctions:Refresh()
local menu = self.func()
--> do a safe call
local menu = DF:Dispatch (self.func, self)
if (#menu == 0) then
self:NoOption (true)
@@ -371,7 +372,7 @@ function DropDownMetaFunctions:Select (optionName, byOptionNumber)
return false
end
local menu = self.func()
local menu = DF:Dispatch (self.func, self)
if (#menu == 0) then
self:NoOption (true)
@@ -951,7 +952,6 @@ function DF:NewDropDown (parent, container, name, member, w, h, func, default, t
DropDownObject.widget = DropDownObject.dropdown
DropDownObject.__it = {nil, nil}
--_G [name] = DropDownObject
if (not APIDropDownFunctions) then
APIDropDownFunctions = true
+50 -1
View File
@@ -1,5 +1,5 @@
local dversion = 86
local dversion = 87
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
@@ -129,6 +129,12 @@ local embed_functions = {
"CreateFrameShake",
}
DF.WidgetFunctions = {
GetCapsule = function (self)
return self.MyObject
end,
}
DF.table = {}
function DF:GetFrameworkFolder()
@@ -158,6 +164,22 @@ function DF:FadeFrame (frame, t)
end
end
function DF.table.addunique (t, index, value)
if (not value) then
value = index
index = #t + 1
end
for i = 1, #t do
if (t[i] == value) then
return false
end
end
tinsert (t, index, value)
return true
end
function DF.table.reverse (t)
local new = {}
local index = 1
@@ -364,6 +386,18 @@ function DF:trim (s)
return from > #s and "" or s:match(".*%S", from)
end
function DF:TruncateText (fontString, maxWidth)
local text = fontString:GetText()
while (fontString:GetStringWidth() > maxWidth) do
text = strsub (text, 1, #text - 1)
fontString:SetText (text)
if (string.len (text) <= 1) then
break
end
end
end
function DF:Msg (msg)
print ("|cFFFFFFAA" .. (self.__name or "FW Msg:") .. "|r ", msg)
end
@@ -2093,6 +2127,21 @@ function DF:QuickDispatch (func, ...)
return true
end
function DF:Dispatch (func, ...)
if (type (func) ~= "function") then
return dispatch_error (_, "Dispatch required a function.")
end
local okay, result1, result2, result3, result4 = xpcall (func, geterrorhandler(), ...)
if (not okay) then
return nil
end
return result1, result2, result3, result4
end
--/run local a, b =32,3; local f=function(c,d) return c+d, 2, 3;end; print (xpcall(f,geterrorhandler(),a,b))
--doo elsee
+7 -1
View File
@@ -206,7 +206,13 @@ local LabelMetaFunctions = _G [DF.GlobalWidgetControlNames ["label"]]
function LabelMetaFunctions:Hide()
return self.label:Hide()
end
--text text
function LabelMetaFunctions:SetTextTruncated (text, maxWidth)
self.widget:SetText (text)
DF:TruncateText (self.widget, maxWidth)
end
-- textcolor
function LabelMetaFunctions:SetTextColor (color, arg2, arg3, arg4)
if (arg2) then
+214
View File
@@ -4939,3 +4939,217 @@ function DF:CreateIconRow (parent, name, options)
return f
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> ~header
DF.HeaderFunctions = {
AddFrameToHeaderAlignment = function (self, frame)
self.FramesToAlign = self.FramesToAlign or {}
tinsert (self.FramesToAlign, frame)
end,
AlignWithHeader = function (self, headerFrame, anchor)
local headerFrames = headerFrame.HeadersCreated
anchor = anchor or "topleft"
for i = 1, #self.FramesToAlign do
local frame = self.FramesToAlign [i]
frame:ClearAllPoints()
local headerFrame = headerFrames [i]
frame:SetPoint (anchor, self, anchor, headerFrame.XPosition, 0)
end
end,
}
DF.HeaderCoreFunctions = {
SetHeaderTable = function (self, newTable)
self.HeadersCreated = self.HeadersCreated or {}
self.HeaderTable = newTable
self.NextHeader = 1
self.HeaderWidth = 0
self.HeaderHeight = 0
self:Refresh()
end,
Refresh = function (self)
--> refresh background frame
self:SetBackdrop (self.options.backdrop)
self:SetBackdropColor (unpack (self.options.backdrop_color))
self:SetBackdropBorderColor (unpack (self.options.backdrop_border_color))
--> reset all header frames
for i = 1, #self.HeadersCreated do
self.HeadersCreated [i].InUse = false
self.HeadersCreated [i]:Hide()
end
local previousHeaderFrame
local growDirection = string.lower (self.options.grow_direction)
--> update header frames
local headerSize = #self.HeaderTable
for i = 1, headerSize do
local headerFrame = self:GetNextHeader()
self:UpdateHeaderFrame (headerFrame, i)
--> grow direction
if (not previousHeaderFrame) then
headerFrame:SetPoint ("topleft", self, "topleft", 0, 0)
else
if (growDirection == "right") then
headerFrame:SetPoint ("topleft", previousHeaderFrame, "topright", self.options.padding, 0)
elseif (growDirection == "left") then
headerFrame:SetPoint ("topright", previousHeaderFrame, "topleft", -self.options.padding, 0)
elseif (growDirection == "bottom") then
headerFrame:SetPoint ("topleft", previousHeaderFrame, "bottomleft", 0, -self.options.padding)
elseif (growDirection == "top") then
headerFrame:SetPoint ("bottomleft", previousHeaderFrame, "topleft", 0, self.options.padding)
end
end
previousHeaderFrame = headerFrame
end
self:SetSize (self.HeaderWidth, self.HeaderHeight)
end,
UpdateHeaderFrame = function (self, headerFrame, headerIndex)
local headerData = self.HeaderTable [headerIndex]
if (headerData.icon) then
headerFrame.Icon:SetTexture (headerData.icon)
if (headerData.texcoord) then
headerFrame.Icon:SetTexCoord (unpack (headerData.texcoord))
else
headerFrame.Icon:SetTexCoord (0, 1, 0, 1)
end
headerFrame.Icon:SetPoint ("left", headerFrame, "left", self.options.padding, 0)
headerFrame.Icon:Show()
end
if (headerData.text) then
headerFrame.Text:SetText (headerData.text)
--> text options
DF:SetFontColor (headerFrame.Text, self.options.text_color)
DF:SetFontSize (headerFrame.Text, self.options.text_size)
DF:SetFontOutline (headerFrame.Text, self.options.text_shadow)
--> point
if (not headerData.icon) then
headerFrame.Text:SetPoint ("left", headerFrame, "left", self.options.padding, 0)
else
headerFrame.Text:SetPoint ("left", headerFrame.Icon, "right", self.options.padding, 0)
end
headerFrame.Text:Show()
end
--> size
if (headerData.width) then
headerFrame:SetWidth (headerData.width)
end
if (headerData.height) then
headerFrame:SetHeight (headerData.height)
end
headerFrame.XPosition = self.HeaderWidth-- + self.options.padding
headerFrame.YPosition = self.HeaderHeight-- + self.options.padding
--> add the header piece size to the total header size
local growDirection = string.lower (self.options.grow_direction)
if (growDirection == "right" or growDirection == "left") then
self.HeaderWidth = self.HeaderWidth + headerFrame:GetWidth() + self.options.padding
self.HeaderHeight = math.max (self.HeaderHeight, headerFrame:GetHeight())
elseif (growDirection == "top" or growDirection == "bottom") then
self.HeaderWidth = math.max (self.HeaderWidth, headerFrame:GetWidth())
self.HeaderHeight = self.HeaderHeight + headerFrame:GetHeight() + self.options.padding
end
headerFrame:Show()
headerFrame.InUse = true
end,
RefreshHeader = function (self, headerFrame)
headerFrame:SetSize (self.options.header_width, self.options.header_height)
headerFrame:SetBackdrop (self.options.header_backdrop)
headerFrame:SetBackdropColor (unpack (self.options.header_backdrop_color))
headerFrame:SetBackdropBorderColor (unpack (self.options.header_backdrop_border_color))
headerFrame:ClearAllPoints()
headerFrame.Icon:SetTexture ("")
headerFrame.Icon:Hide()
headerFrame.Text:SetText ("")
headerFrame.Text:Hide()
end,
GetNextHeader = function (self)
local nextHeader = self.NextHeader
local headerFrame = self.HeadersCreated [nextHeader]
if (not headerFrame) then
local newHeader = CreateFrame ("frame", "$parentHeaderIndex" .. nextHeader, self)
DF:CreateImage (newHeader, "", self.options.header_height, self.options.header_height, "ARTWORK", nil, "Icon", "$parentIcon")
DF:CreateLabel (newHeader, "", self.options.text_size, self.options.text_color, "GameFontNormal", "Text", "$parentText", "ARTWORK")
tinsert (self.HeadersCreated, newHeader)
headerFrame = newHeader
end
self:RefreshHeader (headerFrame)
self.NextHeader = self.NextHeader + 1
return headerFrame
end,
NextHeader = 1,
HeaderWidth = 0,
HeaderHeight = 0,
}
local default_header_options = {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdrop_color = {0, 0, 0, 0.2},
backdrop_border_color = {0.1, 0.1, 0.1, .2},
text_color = {1, 1, 1, 1},
text_size = 10,
text_shadow = false,
grow_direction = "RIGHT",
padding = 2,
--each piece of the header
header_backdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
header_backdrop_color = {0, 0, 0, 0.5},
header_backdrop_border_color = {0, 0, 0, 0},
header_width = 120,
header_height = 20,
}
function DF:CreateHeader (parent, headerTable, options)
local f = CreateFrame ("frame", "$parentHeaderLine", parent)
DF:Mixin (f, DF.OptionsFunctions)
DF:Mixin (f, DF.HeaderCoreFunctions)
f:BuildOptionsTable (default_header_options, options)
f:SetBackdrop (f.options.backdrop)
f:SetBackdropColor (unpack (f.options.backdrop_color))
f:SetBackdropBorderColor (unpack (f.options.backdrop_border_color))
f:SetHeaderTable (headerTable)
return f
end
+1 -1
View File
@@ -3,7 +3,7 @@
_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")
_detalhes.build_counter = 6027
_detalhes.build_counter = 6035
_detalhes.userversion = "v8.0.1." .. _detalhes.build_counter
_detalhes.realversion = 132 --core version
_detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")"
+4 -1
View File
@@ -1985,7 +1985,7 @@
{name = "Buff on You", value = 11}, --4
{name = "Buff on Target", value = 12},
{name = "Buff on Focus", value = 13},
{name = "Spell Cast Started", value = 21},
{name = "Spell Cast Started", value = 21}, --7
{name = "Spell Cast Successful", value = 22},
{name = "DBM Time Bar", value = 31},
{name = "BigWigs Time Bar", value = 32},
@@ -3914,6 +3914,9 @@
function f:refresh()
select_module (nil, nil, current_module)
end
f.SelectModule = select_module
f.AllModules = all_modules
f:InstallModule (encounter_spells_module)
f:InstallModule (all_spells_module)
+2 -2
View File
@@ -1014,10 +1014,10 @@ local default_profile = {
--> cloud capture
cloud_capture = true,
--> combat
minimum_combat_time = 5,
overall_flag = 0xD,
overall_flag = 0x10,
overall_clear_newboss = true,
overall_clear_newchallenge = true,
overall_clear_logout = false,
-1
View File
@@ -162,7 +162,6 @@ do
-- Survival Hunter:
[190925] = 255, --Harpoon
[186289] = 255, --Aspect of the Eagle
[259491] = 255, --Serpent Sting
[187708] = 255, --Carve
[259495] = 255, --Wildfire Bomb
[195645] = 255, --Wing Clip