- merging more updates from the beta version.

This commit is contained in:
Tercio
2016-07-26 19:27:36 -03:00
parent da2d6b9bf4
commit bd0bb3b7d2
9 changed files with 886 additions and 23 deletions
+425
View File
@@ -0,0 +1,425 @@
local DF = _G ["DetailsFramework"]
if (not DF or not DetailsFrameworkCanLoad) then
return
end
local _
local tinsert = tinsert
local GetSpellInfo = GetSpellInfo
local lower = string.lower
local GetSpellBookItemInfo = GetSpellBookItemInfo
local cleanfunction = function() end
do
local metaPrototype = {
WidgetType = "aura_tracker",
SetHook = DF.SetHook,
RunHooksForWidget = DF.RunHooksForWidget,
}
_G [DF.GlobalWidgetControlNames ["aura_tracker"]] = _G [DF.GlobalWidgetControlNames ["aura_tracker"]] or metaPrototype
end
local AuraTrackerMetaFunctions = _G [DF.GlobalWidgetControlNames ["aura_tracker"]]
--create panels
local on_profile_changed = function (self, newdb)
self.db = newdb
self.tracking_method:Select (newdb.aura_tracker.track_method)
--automatic
self.buff_ignored:SetData (newdb.aura_tracker.buff_banned)
self.debuff_ignored:SetData (newdb.aura_tracker.debuff_banned)
self.buff_available:Refresh()
self.buff_ignored:Refresh()
self.debuff_available:Refresh()
self.debuff_ignored:Refresh()
--manual
self.buffs_added:SetData (newdb.aura_tracker.buff)
self.debuffs_added:SetData (newdb.aura_tracker.debuff)
self.buffs_added:Refresh()
self.debuffs_added:Refresh()
--method
if (newdb.aura_tracker.track_method == 0x1) then
self.f_auto:Show()
self.f_manual:Hide()
elseif (newdb.aura_tracker.track_method == 0x2) then
self.f_auto:Hide()
self.f_manual:Show()
end
end
local aura_panel_defaultoptions = {
height = 400,
row_height = 16,
width = 230,
}
function DF:CreateAuraConfigPanel (parent, name, db, method_change_callback, options)
local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")
local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")
local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")
local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")
local f = CreateFrame ("frame", name, parent)
f.db = db
f.OnProfileChanged = on_profile_changed
options = options or {}
self.table.deploy (options, aura_panel_defaultoptions)
local f_auto = CreateFrame ("frame", "$parent_Automatic", f)
local f_manual = CreateFrame ("frame", "$parent_Manual", f)
f_auto:SetPoint ("topleft", f, "topleft", 0, -24)
f_manual:SetPoint ("topleft", f, "topleft", 0, -24)
f_auto:SetSize (600, 600)
f_manual:SetSize (600, 600)
f.f_auto = f_auto
f.f_manual = f_manual
local on_select_tracking_option = function (_, _, method)
f.db.aura_tracker.track_method = method
if (method_change_callback) then
method_change_callback (self, method)
end
if (method == 0x1) then
f_auto:Show()
f_manual:Hide()
elseif (method == 0x2) then
f_auto:Hide()
f_manual:Show()
end
end
local tracking_options = function()
return {
{label = "Automatic", value = 0x1, onclick = on_select_tracking_option, desc = "Show all your auras by default, you can exclude those you don't want to show."},
{label = "Manual", value = 0x2, onclick = on_select_tracking_option, desc = "Do not show any aura by default, you need to manually add each aura you want to track."},
}
end
local tracking_method_label = self:CreateLabel (f, "Tracking Aura Method:", 12, "orange")
local tracking_method = self:CreateDropDown (f, tracking_options, f.db.aura_tracker.track_method, 120, 20, "dropdown_tracking_method", _, self:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
tracking_method_label:SetPoint ("topleft", f, "topleft", 10, -10)
tracking_method:SetPoint ("left", tracking_method_label, "right", 2, 0)
tracking_method:SetFrameStrata ("tooltip")
tracking_method.tooltip = "Choose which aura tracking method you want to use."
f.tracking_method = tracking_method
--------automatic
local ALL_BUFFS = {}
local ALL_DEBUFFS = {}
local width, height, row_height = options.width, options.height, options.row_height
local buff_ignored = self:CreateSimpleListBox (f_auto, "$parentBuffIgnored", "Buffs Ignored", "The list is empty, select a spell from the buff list to ignore it.", f.db.aura_tracker.buff_banned,
function (spellid)
f.db.aura_tracker.buff_banned [spellid] = nil;
end,
{
icon = function(spellid) return select (3, GetSpellInfo (spellid)) end,
text = function(spellid) return select (1, GetSpellInfo (spellid)) end,
height = height,
row_height = row_height,
width = width,
onenter = function(self, capsule, value) GameTooltip:SetOwner (self, "ANCHOR_RIGHT"); GameTooltip:SetSpellByID(value); GameTooltip:AddLine (" "); GameTooltip:AddLine ("Click to un-ignore this aura", .2, 1, .2); GameTooltip:Show() end,
})
local buff_available = self:CreateSimpleListBox (f_auto, "$parentBuffAvailable", "Buffs Available", "The list is empty, cast spells to fill it", ALL_BUFFS, function (spellid)
f.db.aura_tracker.buff_banned [spellid] = true; buff_ignored:Refresh()
end,
{
icon = function(spellid) return select (3, GetSpellInfo (spellid)) end,
text = function(spellid) return select (1, GetSpellInfo (spellid)) end,
height = height,
row_height = row_height,
width = width,
onenter = function(self, capsule, value) GameTooltip:SetOwner (self, "ANCHOR_RIGHT"); GameTooltip:SetSpellByID(value); GameTooltip:AddLine (" "); GameTooltip:AddLine ("Click to ignore this aura", .2, 1, .2); GameTooltip:Show() end,
})
local debuff_ignored = self:CreateSimpleListBox (f_auto, "$parentDebuffIgnored", "Debuffs Ignored", "The list is empty, select a spell from the debuff list to ignore it.", f.db.aura_tracker.debuff_banned, function (spellid)
f.db.aura_tracker.debuff_banned [spellid] = nil;
end,
{
icon = function(spellid) return select (3, GetSpellInfo (spellid)) end,
text = function(spellid) return select (1, GetSpellInfo (spellid)) end,
height = height,
row_height = row_height,
width = width,
onenter = function(self, capsule, value) GameTooltip:SetOwner (self, "ANCHOR_RIGHT"); GameTooltip:SetSpellByID(value); GameTooltip:AddLine (" "); GameTooltip:AddLine ("Click to un-ignore this aura", .2, 1, .2); GameTooltip:Show() end,
})
local debuff_available = self:CreateSimpleListBox (f_auto, "$parentDebuffAvailable", "Debuffs Available", "The list is empty, cast spells to fill it", ALL_DEBUFFS, function (spellid)
f.db.aura_tracker.debuff_banned [spellid] = true; debuff_ignored:Refresh()
end, {
icon = function(spellid) return select (3, GetSpellInfo (spellid)) end,
text = function(spellid) return select (1, GetSpellInfo (spellid)) end,
height = height,
row_height = row_height,
width = width,
onenter = function(self, capsule, value) GameTooltip:SetOwner (self, "ANCHOR_RIGHT"); GameTooltip:SetSpellByID(value); GameTooltip:AddLine (" "); GameTooltip:AddLine ("Click to ignore this aura", .2, 1, .2); GameTooltip:Show() end,
})
--como ira preencher ela no inicio e como ficara o lance dos profiles
local y = -30
buff_available:SetPoint ("topleft", f_auto, "topleft", 0, y)
buff_ignored:SetPoint ("topleft", f_auto, "topleft", 6 + width, y)
debuff_available:SetPoint ("topleft", f_auto, "topleft", 12 + (width*2), y)
debuff_ignored:SetPoint ("topleft", f_auto, "topleft", 18 + (width*3), y)
f.buff_available = buff_available
f.buff_ignored = buff_ignored
f.debuff_available = debuff_available
f.debuff_ignored = debuff_ignored
local readCombatLog = CreateFrame ("frame", nil, f_auto)
readCombatLog:SetScript ("OnEvent", function (self, event, time, token, hidding, sourceGUID, sourceName, sourceFlag, sourceFlag2, targetGUID, targetName, targetFlag, targetFlag2, spellid, spellname, spellschool, auraType, amount)
if (auraType == "BUFF" and sourceGUID == readCombatLog.playerGUID) then
if (not ALL_BUFFS [spellid]) then
ALL_BUFFS [spellid] = true
buff_available:Refresh()
end
elseif (auraType == "DEBUFF" and sourceGUID == readCombatLog.playerGUID) then
if (not ALL_DEBUFFS [spellid]) then
ALL_DEBUFFS [spellid] = true
debuff_available:Refresh()
end
end
end)
f_auto:SetScript ("OnShow", function()
for i = 1, BUFF_MAX_DISPLAY do
local name, rank, texture, count, debuffType, duration, expirationTime, caster, _, nameplateShowPersonal, spellId, _, _, _, nameplateShowAll = UnitAura ("player", i, "HELPFUL")
if (name) then
ALL_BUFFS [spellId] = true
end
local name, rank, texture, count, debuffType, duration, expirationTime, caster, _, nameplateShowPersonal, spellId, _, _, _, nameplateShowAll = UnitAura ("player", i, "HARMFUL")
if (name) then
ALL_DEBUFFS [spellId] = true
end
end
buff_available:Refresh()
buff_ignored:Refresh()
debuff_available:Refresh()
debuff_ignored:Refresh()
readCombatLog.playerGUID = UnitGUID ("player")
readCombatLog:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
end)
f_auto:SetScript ("OnHide", function()
readCombatLog:UnregisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
end)
--show the frame selecton on the f.db
on_select_tracking_option (_, _, f.db.aura_tracker.track_method)
-------manual
--> build the two aura scrolls for buff and debuff
local scroll_width = width
local scroll_height = height
local scroll_lines = 15
local scroll_line_height = 20
local line_onenter = function (self)
self:SetBackdropColor (.3, .3, .3, 0.4)
local spellid = select (7, GetSpellInfo (self.value))
if (spellid) then
GameTooltip:SetOwner (self, "ANCHOR_RIGHT");
GameTooltip:SetSpellByID (spellid)
GameTooltip:AddLine (" ")
GameTooltip:AddLine ("Click to untrack this aura", .2, 1, .2)
GameTooltip:Show()
end
end
local line_onleave = function (self)
self:SetBackdropColor (0, 0, 0, 0.2)
GameTooltip:Hide()
end
local line_onclick = function (self)
local spell = self.value
local data = self:GetParent():GetData()
for i = 1, #data do
if (data[i] == spell) then
tremove (data, i)
break
end
end
self:GetParent():Refresh()
end
local scroll_createline = function (self, index)
local line = CreateFrame ("button", "$parentLine" .. index, self)
line:SetPoint ("topleft", self, "topleft", 0, -((index-1)*(scroll_line_height+1)))
line:SetSize (scroll_width, scroll_line_height)
line:SetScript ("OnEnter", line_onenter)
line:SetScript ("OnLeave", line_onleave)
line:SetScript ("OnClick", line_onclick)
line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
line:SetBackdropColor (0, 0, 0, 0.2)
local icon = line:CreateTexture ("$parentIcon", "overlay")
icon:SetSize (scroll_line_height, scroll_line_height)
local name = line:CreateFontString ("$parentName", "overlay", "GameFontNormal")
icon:SetPoint ("left", line, "left", 2, 0)
name:SetPoint ("left", icon, "right", 2, 0)
line.icon = icon
line.name = name
return line
end
local scroll_refresh = function (self, data, offset, total_lines)
for i = 1, total_lines do
local index = i + offset
local aura = data [index]
if (aura) then
local line = self:GetLine (i)
local name, _, icon = GetSpellInfo (aura)
line.value = aura
if (name) then
line.name:SetText (name)
line.icon:SetTexture (icon)
else
line.name:SetText (aura)
line.icon:SetTexture ([[Interface\InventoryItems\WoWUnknownItem01]])
end
end
end
end
local buffs_added = self:CreateScrollBox (f_manual, "$parentBuffsAdded", scroll_refresh, f.db.aura_tracker.buff, scroll_width, scroll_height, scroll_lines, scroll_line_height)
buffs_added:SetPoint ("topleft", f_manual, "topleft", 0, y)
buffs_added:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
buffs_added:SetBackdropColor (0, 0, 0, 0.2)
buffs_added:SetBackdropBorderColor (0, 0, 0, 1)
for i = 1, scroll_lines do
buffs_added:CreateLine (scroll_createline)
end
local debuffs_added = self:CreateScrollBox (f_manual, "$parentDebuffsAdded", scroll_refresh, f.db.aura_tracker.debuff, scroll_width, scroll_height, scroll_lines, scroll_line_height)
debuffs_added:SetPoint ("topleft", f_manual, "topleft", width+30, y)
debuffs_added:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
debuffs_added:SetBackdropColor (0, 0, 0, 0.2)
debuffs_added:SetBackdropBorderColor (0, 0, 0, 1)
for i = 1, scroll_lines do
debuffs_added:CreateLine (scroll_createline)
end
f.buffs_added = buffs_added
f.debuffs_added = debuffs_added
local buffs_added_name = DF:CreateLabel (buffs_added, "Buffs", 12, "silver")
buffs_added_name:SetTemplate (DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE"))
buffs_added_name:SetPoint ("bottomleft", buffs_added, "topleft", 0, 2)
buffs_added.Title = buffs_added_name
local debuffs_added_name = DF:CreateLabel (debuffs_added, "Debuffs", 12, "silver")
debuffs_added_name:SetTemplate (DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE"))
debuffs_added_name:SetPoint ("bottomleft", debuffs_added, "topleft", 0, 2)
debuffs_added.Title = debuffs_added_name
--> build the text entry to type the spellname
local new_buff_string = self:CreateLabel (f_manual, "Add Buff")
local new_debuff_string = self:CreateLabel (f_manual, "Add Debuff")
local new_buff_entry = self:CreateTextEntry (f_manual, function()end, 200, 20, "NewBuffTextBox", _, _, options_dropdown_template)
local new_debuff_entry = self:CreateTextEntry (f_manual, function()end, 200, 20, "NewDebuffTextBox", _, _, options_dropdown_template)
new_buff_entry:SetJustifyH ("left")
new_debuff_entry:SetJustifyH ("left")
DF:SetAutoCompleteWithSpells (new_buff_entry)
DF:SetAutoCompleteWithSpells (new_debuff_entry)
local add_buff_button = self:CreateButton (f_manual, function()
local text = new_buff_entry.text
new_buff_entry:SetText ("")
new_buff_entry:ClearFocus()
if (text ~= "") then
tinsert (f.db.aura_tracker.buff, text)
buffs_added:Refresh()
end
end, 100, 20, "Add Buff", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"))
local add_debuff_button = self:CreateButton (f_manual, function()
local text = new_debuff_entry.text
new_debuff_entry:SetText ("")
new_debuff_entry:ClearFocus()
if (text ~= "") then
tinsert (f.db.aura_tracker.debuff, text)
debuffs_added:Refresh()
end
end, 100, 20, "Add Debuff", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"))
new_buff_string:SetPoint ("topleft", f_manual, "topleft", 480, -40)
new_buff_entry:SetPoint ("topleft", new_buff_string, "bottomleft", 0, -2)
add_buff_button:SetPoint ("left", new_buff_entry, "right", 2, 0)
add_buff_button.tooltip = "Add the aura to be tracked.\n\nClick an aura on the list to remove it."
new_debuff_string:SetPoint ("topleft", f_manual, "topleft", 480, -200)
new_debuff_entry:SetPoint ("topleft", new_debuff_string, "bottomleft", 0, -2)
add_debuff_button:SetPoint ("left", new_debuff_entry, "right", 2, 0)
add_debuff_button.tooltip = "Add the aura to be tracked.\n\nClick an aura on the list to remove it."
buffs_added:Refresh()
debuffs_added:Refresh()
return f
end
function DF:GetAllPlayerSpells (include_lower_case)
local playerSpells = {}
local tab, tabTex, offset, numSpells = GetSpellTabInfo (2)
for i = 1, numSpells do
local index = offset + i
local spellType, spellId = GetSpellBookItemInfo (index, "player")
if (spellType == "SPELL") then
local spellName = GetSpellInfo (spellId)
tinsert (playerSpells, spellName)
if (include_lower_case) then
tinsert (playerSpells, lower (spellName))
end
end
end
return playerSpells
end
function DF:SetAutoCompleteWithSpells (textentry)
textentry:SetHook ("OnEditFocusGained", function()
local playerSpells = DF:GetAllPlayerSpells (true)
textentry.WordList = playerSpells
end)
textentry:SetAsAutoComplete ("WordList")
end
--check for aura
-- add aura
--handle savedvariables
--remove a aura
--handle UNIT_AURA event
+35 -1
View File
@@ -1,5 +1,5 @@
local dversion = 24
local dversion = 27
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
@@ -110,6 +110,7 @@ local embed_functions = {
"SetFrameworkDebugState",
"FindHighestParent",
"OpenInterfaceProfile",
"CreateInCombatTexture",
}
DF.table = {}
@@ -562,6 +563,10 @@ end
slider.widget_type = "range"
slider:SetHook ("OnValueChange", widget_table.set)
if (widget_table.thumbscale) then
slider:SetThumbSize (slider.thumb:GetWidth()*widget_table.thumbscale, nil)
end
local label = DF:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name .. (use_two_points and ": " or ""), "GameFontNormal", widget_table.text_template or text_template or 12)
slider:SetPoint ("left", label, "right", 2)
label:SetPoint (cur_x, cur_y)
@@ -683,6 +688,34 @@ end
end
end)
function DF:CreateInCombatTexture (frame)
if (DF.debug and not frame) then
error ("Details! Framework: CreateInCombatTexture invalid frame on parameter 1.")
end
local in_combat_background = DF:CreateImage (frame)
in_combat_background:SetColorTexture (.6, 0, 0, .1)
in_combat_background:Hide()
local in_combat_label = Plater:CreateLabel (frame, "you are in combat", 24, "silver")
in_combat_label:SetPoint ("right", in_combat_background, "right", -10, 0)
in_combat_label:Hide()
frame:RegisterEvent ("PLAYER_REGEN_DISABLED")
frame:RegisterEvent ("PLAYER_REGEN_ENABLED")
frame:SetScript ("OnEvent", function (self, event)
if (event == "PLAYER_REGEN_DISABLED") then
in_combat_background:Show()
in_combat_label:Show()
elseif (event == "PLAYER_REGEN_ENABLED") then
in_combat_background:Hide()
in_combat_label:Hide()
end
end)
return in_combat_background
end
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> tutorials
@@ -1051,6 +1084,7 @@ DF.GlobalWidgetControlNames = {
image = "DF_ImageMetaFunctions",
slider = "DF_SliderMetaFunctions",
split_bar = "DF_SplitBarMetaFunctions",
aura_tracker = "DF_AuraTracker",
}
function DF:AddMemberForWidget (widgetName, memberType, memberName, func)
+1
View File
@@ -20,4 +20,5 @@
<Include file="panel.xml"/>
<Script file="pictureedit.lua"/>
<Script file="auras.lua"/>
</Ui>
+2 -2
View File
@@ -510,11 +510,11 @@ local BarMetaFunctions = _G [DF.GlobalWidgetControlNames ["normal_bar"]]
function BarMetaFunctions:OnTimerEnd()
local capsule = self
local kill = capsule:RunHooksForWidget ("OnTimerEnd", self.widget, button, capsule)
local kill = capsule:RunHooksForWidget ("OnTimerEnd", self.widget, capsule)
if (kill) then
return
end
self.timer_texture:Hide()
self.timer_textureR:Hide()
self.div_timer:Hide()
+257 -4
View File
@@ -3330,10 +3330,263 @@ end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ~listbox
local simple_list_box_ResetWidgets = function (self)
for _, widget in ipairs (self.widgets) do
widget:Hide()
end
self.nextWidget = 1
end
local simple_list_box_onenter = function (self, capsule)
self:GetParent().options.onenter (self, capsule, capsule.value)
end
local simple_list_box_onleave = function (self, capsule)
self:GetParent().options.onleave (self, capsule, capsule.value)
GameTooltip:Hide()
end
local simple_list_box_GetOrCreateWidget = function (self)
local index = self.nextWidget
local widget = self.widgets [index]
if (not widget) then
widget = DF:CreateButton (self, function()end, self.options.width, self.options.row_height, "", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"))
widget:SetHook ("OnEnter", simple_list_box_onenter)
widget:SetHook ("OnLeave", simple_list_box_onleave)
widget.textcolor = self.options.textcolor
tinsert (self.widgets, widget)
end
self.nextWidget = self.nextWidget + 1
return widget
end
local simple_list_box_RefreshWidgets = function (self)
self:ResetWidgets()
local amt = 0
for value, _ in pairs (self.list_table) do
local widget = self:GetOrCreateWidget()
widget:SetPoint ("topleft", self, "topleft", 1, -self.options.row_height * (self.nextWidget-2) - 4)
widget:SetPoint ("topright", self, "topright", -1, -self.options.row_height * (self.nextWidget-2) - 4)
widget:SetClickFunction (self.func, value)
widget.value = value
if (self.options.icon) then
if (type (self.options.icon) == "string" or type (self.options.icon) == "number") then
widget:SetIcon (self.options.icon, self.options.row_height, self.options.row_height)
elseif (type (self.options.icon) == "function") then
local icon = self.options.icon (value)
if (icon) then
widget:SetIcon (icon, self.options.row_height, self.options.row_height)
end
end
else
widget:SetIcon ("", self.options.row_height, self.options.row_height)
end
if (self.options.text) then
if (type (self.options.text) == "function") then
local text = self.options.text (value)
if (text) then
widget:SetText (text)
else
widget:SetText ("")
end
else
widget:SetText (self.options.text or "")
end
else
widget:SetText ("")
end
widget.value = value
widget:Show()
amt = amt + 1
end
if (amt == 0) then
self.EmptyLabel:Show()
else
self.EmptyLabel:Hide()
end
end
local backdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}
local default_options = {
height = 400,
row_height = 16,
width = 230,
icon = false,
text = "",
textcolor = "wheat",
onenter = function (self, capsule)
if (capsule) then
capsule.textcolor = "white"
end
end,
onleave = function (self, capsule)
if (capsule) then
capsule.textcolor = self:GetParent().options.textcolor
end
GameTooltip:Hide()
end,
}
local simple_list_box_SetData = function (self, t)
self.list_table = t
end
function DF:CreateSimpleListBox (parent, name, title, empty_text, list_table, onclick, options)
local f = CreateFrame ("frame", name, parent)
f.ResetWidgets = simple_list_box_ResetWidgets
f.GetOrCreateWidget = simple_list_box_GetOrCreateWidget
f.Refresh = simple_list_box_RefreshWidgets
f.SetData = simple_list_box_SetData
f.nextWidget = 1
f.list_table = list_table
f.func = function (self, button, value)
onclick (value)
f:Refresh()
end
f.widgets = {}
f:SetBackdrop (backdrop)
f:SetBackdropColor (0, 0, 0, 0.3)
f:SetBackdropBorderColor (0, 0, 0, 0.5)
f.options = options or {}
self.table.deploy (f.options, default_options)
f:SetSize (f.options.width + 2, f.options.height)
local name = DF:CreateLabel (f, title, 12, "silver")
name:SetTemplate (DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE"))
name:SetPoint ("bottomleft", f, "topleft", 0, 2)
f.Title = name
local emptyLabel = DF:CreateLabel (f, empty_text, 12, "gray")
emptyLabel:SetAlpha (.6)
emptyLabel:SetSize (f.options.width-10, f.options.height)
emptyLabel:SetPoint ("center", 0, 0)
emptyLabel:Hide()
emptyLabel.align = "center"
f.EmptyLabel = emptyLabel
return f
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ~scrollbox
-- preciso de uma fauxscroll que seja facil de lidar
-- ele cria scroll aqui, preciso falar a função que cria a linha e a função que atualiza
-- precisa passsar o tamanho em height width quantas barras vai mostrar
-- search box incluso opcionalmente
DF.SortFunctions = {}
local SortMember = ""
local SortByMember = function (t1, t2)
return t1[SortMember] > t2[SortMember]
end
local SortByMemberReverse = function (t1, t2)
return t1[SortMember] < t2[SortMember]
end
DF.SortFunctions.Sort = function (self, t, by, is_reverse)
SortMember = by
if (not is_reverse) then
table.sort (t, SortByMember)
else
table.sort (t, SortByMemberReverse)
end
end
DF.ScrollBoxFunctions = {}
DF.ScrollBoxFunctions.Refresh = function (self)
for _, frame in ipairs (self.Frames) do
frame:Hide()
frame._InUse = nil
end
local offset = 0
if (self.IsFauxScroll) then
FauxScrollFrame_Update (self, #self.data, self.LineAmount, self.LineHeight+1)
offset = FauxScrollFrame_GetOffset (self)
end
local okay, totalLines = pcall (self.refresh_func, self, self.data, offset, #self.Frames)
if (not okay) then
error ("Details! FrameWork: Refresh(): " .. result)
end
for _, frame in ipairs (self.Frames) do
if (not frame._InUse) then
frame:Hide()
else
frame:Show()
end
end
self:Show()
return self.Frames
end
DF.ScrollBoxFunctions.OnVerticalScroll = function (self, offset)
FauxScrollFrame_OnVerticalScroll (self, offset, self.LineHeight, self.Refresh)
return true
end
DF.ScrollBoxFunctions.CreateLine = function (self, func)
local okay, newLine = pcall (func, self, #self.Frames+1)
if (okay) then
tinsert (self.Frames, newLine)
return newLine
else
error ("Details! FrameWork: CreateLine(): " .. newLine)
end
end
DF.ScrollBoxFunctions.GetLine = function (self, line_index)
local line = self.Frames [line_index]
if (line) then
line._InUse = true
end
return line
end
DF.ScrollBoxFunctions.SetData = function (self, data)
self.data = data
end
DF.ScrollBoxFunctions.GetData = function (self)
return self.data
end
function DF:CreateScrollBox (parent, name, refresh_func, data, width, height, line_amount, line_height)
local scroll = CreateFrame ("scrollframe", name, parent, "FauxScrollFrameTemplate")
scroll:SetSize (width, height)
scroll.LineAmount = line_amount
scroll.LineHeight = line_height
scroll.IsFauxScroll = true
scroll.Frames = {}
DF:Mixin (scroll, DF.SortFunctions)
DF:Mixin (scroll, DF.ScrollBoxFunctions)
scroll.refresh_func = refresh_func
scroll.data = data
scroll:SetScript ("OnVerticalScroll", scroll.OnVerticalScroll)
return scroll
end
+8 -5
View File
@@ -4,8 +4,8 @@
_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")
_detalhes.build_counter = 2698 --it's 2697 for release
_detalhes.userversion = "v5.10c"
_detalhes.realversion = 109 --core version
_detalhes.userversion = "v5.11"
_detalhes.realversion = 110 --core version
_detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")"
Details = _detalhes
@@ -21,12 +21,15 @@ do
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
--[[
|cFFFFFF00v5.10c (|cFFFFCC00July 22, 2016|r|cFFFFFF00)|r:\n\n
|cFFFFFF00-|r Trying a workaround for the wow client image cache bug, please delete the file 'spec_icons_normal.TGA' from details/image folder.\n\n
|cFFFFFF00v5.11 (|cFFFFCC00July 26, 2016|r|cFFFFFF00)|r:\n\n
|cFFFFFF00-|r fixed the spam of 'segment not added to overall'.\n\n
|cFFFFFF00-|r stormlash and blessing of might workarouds.\n\n
|cFFFFFF00-|r warrior rampage fix.\n\n
|cFFFFFF00-|r hunter throw axe fix.\n\n
--]]
--
Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v5.10c (|cFFFFCC00July 22, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Trying a workaround for the wow client's texture cache bug which causes FPS drops, please delete the file 'spec_icons_normal.TGA' from details/image folder.\n\n|cFFFFFF00v5.10b (|cFFFFCC00July 21, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed warlock's Soul Effigy.\n\n|cFFFFFF00v5.10a (|cFFFFCC00July 20, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with Calc Leech plugin.\n\n|cFFFFFF00v5.10 (|cFFFFCC00July 19, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Using .BLP format for images. If you have FPS drops caused by Details!, delete ALL .TGA files inside the folder Details/Images/\n\n|cFFFFFF00v5.8 (|cFFFFCC00July 11, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Big framework update. May have some bugs, please report to us if you find any.\n\n|cFFFFFF00v5.8 (|cFFFFCC00June 27, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Energy and Resources are working properly now.\n\n|cFFFFFF00-|r Added raid information for The Emerald Nightmare.\n\n|cFFFFFF00v5.7 (|cFFFFCC00June 16, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Most of the raid plugins got added on this version.\n\n|cFFFFFF00-|r Plugin 'Damage, The Game!' also got damage goals updated.\n\n|cFFFFFF00v5.5 (|cFFFFCC00June 03, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Default skin is now 'Safe Skin Legion Beta' which helps a little with the disabled texture issue.\n|cFFFFFF00-|r If you're using another skin, you may change at the options panel /details options > Skin Selection.\n|cFFFFFF00-|r You also can disable the class icons at Bars: General > Icon File.\n\n|cFFFFFF00v5.4 (|cFFFFCC00May 19, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Tracking spec for Demon Hunters is now implemented, you may see spec icons for demon hunters now.\n\n|cFFFFFF00-|r Fix some issues with Healing display.\n\n|cFFFFFF00v5.3a (|cFFFFCC00May 16, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltip spell icons.\n\n|cFFFFFF00-|r Fixed some issues with demon hunter class icons."
Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v5.11 (|cFFFFCC00July 26, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r fixed the spam of 'segment not added to overall'.\n\n|cFFFFFF00-|r stormlash and blessing of might workarouds.\n\n|cFFFFFF00-|r warrior rampage fix.\n\n|cFFFFFF00-|r hunter throw axe fix.\n\n|cFFFFFF00v5.10c (|cFFFFCC00July 22, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Trying a workaround for the wow client's texture cache bug which causes FPS drops, please delete the file 'spec_icons_normal.TGA' from details/image folder.\n\n|cFFFFFF00v5.10b (|cFFFFCC00July 21, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed warlock's Soul Effigy.\n\n|cFFFFFF00v5.10a (|cFFFFCC00July 20, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with Calc Leech plugin.\n\n|cFFFFFF00v5.10 (|cFFFFCC00July 19, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Using .BLP format for images. If you have FPS drops caused by Details!, delete ALL .TGA files inside the folder Details/Images/\n\n|cFFFFFF00v5.8 (|cFFFFCC00July 11, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Big framework update. May have some bugs, please report to us if you find any.\n\n|cFFFFFF00v5.8 (|cFFFFCC00June 27, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Energy and Resources are working properly now.\n\n|cFFFFFF00-|r Added raid information for The Emerald Nightmare.\n\n|cFFFFFF00v5.7 (|cFFFFCC00June 16, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Most of the raid plugins got added on this version.\n\n|cFFFFFF00-|r Plugin 'Damage, The Game!' also got damage goals updated.\n\n|cFFFFFF00v5.5 (|cFFFFCC00June 03, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Default skin is now 'Safe Skin Legion Beta' which helps a little with the disabled texture issue.\n|cFFFFFF00-|r If you're using another skin, you may change at the options panel /details options > Skin Selection.\n|cFFFFFF00-|r You also can disable the class icons at Bars: General > Icon File."
Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r "
+4 -2
View File
@@ -161,10 +161,12 @@ function historico:adicionar (tabela)
overall_added = true
--print ("0x10")
end
if (overall_added) then
if (tabela.is_boss and tabela:InstanceType() == "raid" and tabela:GetCombatTime() < 30) then
_detalhes:Msg ("segment not added to overall (less than 30 seconds of combat time).")
if (_detalhes.debug) then
_detalhes:Msg ("segment not added to overall (less than 30 seconds of combat time).")
end
else
if (_detalhes.debug) then
_detalhes:Msg ("(debug) overall data flag match with the current combat.")
+154 -9
View File
@@ -87,7 +87,10 @@
local ignore_death = {}
--> special items
local soul_capacitor = {} --> trinket from Socrethar the Eternal
local paladin_gbom = {} --greater blessing of might
local shaman_slash = {} --storm lash
local source_cache = {} --store the source's guid, name and flag
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> constants
@@ -118,6 +121,19 @@
[1] = true, --0x1 star
}
local WARRIOR_RAMPAGE = {
[184707] = true,
[184709] = true,
[201364] = true,
[201363] = true,
}
local SPELLID_WARRIOR_RAMPAGE = 218617
local SPELLID_SHAMAN_SLASH_AURA = 195222
local SPELLID_SHAMAN_SLASH_DAMAGE = 195256
local SPELLID_PALADIN_GBOM_AURA = 203528
local SPELLID_PALADIN_GBOM_DAMAGE = 205729
--> recording data options flags
local _recording_self_buffs = false
local _recording_ability_with_buffs = false
@@ -152,8 +168,7 @@
end
function parser:range (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, 2, "Tiro-Automático", 00000001, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) --> localize-me
--spellid, spellname, spelltype
return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) --> localize-me
end
-- /run local f=CreateFrame("frame");f:RegisterAllEvents();f:SetScript("OnEvent", function(self, ...)print (...);end)
@@ -162,7 +177,6 @@
-- /run local f=CreateFrame("frame");f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");f:SetScript("OnEvent", function(self, ...)print (...);end)
-- /run local f=CreateFrame("frame");f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");f:SetScript("OnEvent",function(self, ...) local a = select(6, ...);if (a=="<chr name>")then print (...) end end)
-- /run local f=CreateFrame("frame");f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");f:SetScript("OnEvent",function(self, ...) local a = select(3, ...);print (a);if (a=="SPELL_CAST_SUCCESS")then print (...) end end)
function parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
@@ -212,6 +226,17 @@
return parser:SLT_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
end
if (WARRIOR_RAMPAGE [spellid]) then
spellid = SPELLID_WARRIOR_RAMPAGE
end
if (spellid == SPELLID_PALADIN_GBOM_DAMAGE) then
who_serial, who_name, who_flags = parser:GetRealHitSourceFromBuffOwner (paladin_gbom, who_serial, who_name, who_flags)
elseif (spellid == SPELLID_SHAMAN_SLASH_DAMAGE) then
who_serial, who_name, who_flags = parser:GetRealHitSourceFromBuffOwner (shaman_slash, who_serial, who_name, who_flags)
end
--> REMOVE AFTER LEGION LAUNCH
if (soul_capacitor [who_serial]) then
if (soul_capacitor [who_serial]+12 < _tempo) then
--> something went wrong, debuff didn't expired or we didn't saw it going out.
@@ -225,7 +250,7 @@
--> check if need start an combat
if (not _in_combat) then
if ( token ~= "SPELL_PERIODIC_DAMAGE" and
if ( token ~= "SPELL_PERIODIC_DAMAGE" and spellid ~= SPELLID_PALADIN_GBOM_DAMAGE and
(
(who_flags and _bit_band (who_flags, AFFILIATION_GROUP) ~= 0 and _UnitAffectingCombat (who_name) )
or
@@ -1233,7 +1258,7 @@
end
-----------------------------------------------------------------------------------------------------------------------------------------
--> BUFFS & DEBUFFS serach key: ~buff ~aura ~shield |
--> BUFFS & DEBUFFS search key: ~buff ~aura ~shield |
-----------------------------------------------------------------------------------------------------------------------------------------
function parser:buff (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spellschool, tipo, amount, arg1, arg2, arg3)
@@ -1254,13 +1279,23 @@
if (tipo == "BUFF") then
------------------------------------------------------------------------------------------------
--> buff uptime
if (spellid == 27827) then --> spirit of redemption (holy priest)
parser:dead ("UNIT_DIED", time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags)
ignore_death [who_name] = true
return
elseif (spellid == 184293) then --> WOD trinket: Soul Capacitor T18 (soul eruption 184559)
elseif (spellid == 184293) then --> WOD trinket: Soul Capacitor T18 (soul eruption 184559) --REMOVE ON LEGION LAUNCH
soul_capacitor [who_serial] = _tempo
elseif (spellid == SPELLID_SHAMAN_SLASH_AURA) then --shaman slash
--> handle the bugg on parser time
parser:Handle3rdPartyBuff (shaman_slash, who_serial, alvo_serial, true, who_name, who_flags)
elseif (spellid == SPELLID_PALADIN_GBOM_AURA) then --paladin gbom
--> handle the buff on parser time
parser:Handle3rdPartyBuff (paladin_gbom, who_serial, alvo_serial, true, who_name, who_flags)
end
if (_recording_buffs_and_debuffs) then
@@ -1622,8 +1657,15 @@
end
end
if (spellid == 184293) then --> WOD trinket: Soul Capacitor T18
if (spellid == 184293) then --> WOD trinket: Soul Capacitor T18 REMOVE ON LEGION LAUNCH
soul_capacitor [who_serial] = nil
elseif (spellid == SPELLID_SHAMAN_SLASH_AURA) then --shaman slash
parser:Handle3rdPartyBuff (shaman_slash, who_serial, alvo_serial)
elseif (spellid == SPELLID_PALADIN_GBOM_AURA) then --paladin gbom
parser:Handle3rdPartyBuff (paladin_gbom, who_serial, alvo_serial)
end
------------------------------------------------------------------------------------------------
@@ -2797,6 +2839,106 @@ SPELL_POWER_OBSOLETE2 = 15;
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> core
local shaman_slash = {} --storm lash
--[[
paladin buffs = {}
player = paladin buffs [ target GUID ]
paladin buffs [ GUID ] = {sourceGUID, sourceGUID, sourceGUID, offset = X}
it's a table with a indexed side and a hash side
on index side, there is GUIDs of all paladins that buffed the player
on the hash side, there is a member 'offset' which points the index of the next paladin to attribute the damage to
--]]
function parser:WipeSourceCache()
wipe (source_cache)
wipe (paladin_gbom)
wipe (shaman_slash)
end
function parser:Handle3rdPartyBuffs_OnEncounterStart()
--> wipe and rebuild the list
parser:WipeSourceCache()
local get_name = _detalhes.GetCLName
for i = 1, _GetNumGroupMembers() do
for auraIndex = 1, 40 do
--gbom
local name, rank, texture, count, debuffType, duration, expirationTime, caster, canStealOrPurge, nameplateShowPersonal, spellId = UnitAura ("raid" .. i, auraIndex, "HELPFUL")
if (spellId == SPELLID_SHAMAN_SLASH_AURA) then
local source_serial = UnitGUID (caster)
local target_serial = UnitGUID ("raid" .. i)
local name, flag = get_name (_, caster), 0x514
parser:Handle3rdPartyBuff (shaman_slash, source_serial, target_serial, true, name, flag)
elseif (spellId == SPELLID_PALADIN_GBOM_AURA) then
local source_serial = UnitGUID (caster)
local target_serial = UnitGUID ("raid" .. i)
local name, flag = get_name (_, caster), 0x514
parser:Handle3rdPartyBuff (paladin_gbom, source_serial, target_serial, true, name, flag)
end
end
end
end
function parser:GetRealHitSourceFromBuffOwner (container, actor_serial, acter_name, acter_flags) --actor can be anything, a player, pet, etc
local target_buffs = container [actor_serial]
if (target_buffs) then
local real_source = source_cache [target_buffs [target_buffs.offset]]
--> set the next source
target_buffs.offset = (target_buffs.offset % #target_buffs) + 1
if (real_source) then
return unpack (real_source)
else
print ("Details! Debug: buff real source not found.")
end
end
return actor_serial, acter_name, acter_flags
end
function parser:Handle3rdPartyBuff (container, source, target, is_applying, name, flags) --source/target are GUIDs/is_applying bool/name and flag are from the caster
if (is_applying) then
local target_buffs = container [target]
if (not target_buffs) then
--> create the source pool
container [target] = {source, ["offset"] = 1}
--> add the source to source cache
if (not source_cache [source]) then
source_cache [source] = {source, name, flags}
end
else
--> is already on the pool
for i = 1, #target_buffs do
if (target_buffs [i] == source) then
--target_buffs.offset = i
return
end
end
target_buffs [#target_buffs+1] = source
--target_buffs.offset = #target_buffs
end
else
local target_buffs = container [target]
if (target_buffs) then
for i = 1, #target_buffs do
if (target_buffs [i] == source) then
tremove (target_buffs, i)
if (#target_buffs == 0) then
--> drop the table
container [target] = nil
else
--> if the target was the last index, the offset is nil
if (not target_buffs [i]) then
target_buffs.offset = target_buffs.offset - 1
end
end
return
end
end
end
end
end
local token_list = {
-- neutral
["SPELL_SUMMON"] = parser.summon,
@@ -3171,6 +3313,8 @@ SPELL_POWER_OBSOLETE2 = 15;
_detalhes.zone_id = zoneMapID
_detalhes.zone_name = zoneName
parser:WipeSourceCache()
if (_detalhes.last_zone_type ~= zoneType) then
_detalhes:SendEvent ("ZONE_TYPE_CHANGED", nil, zoneType)
_detalhes.last_zone_type = zoneType
@@ -3331,6 +3475,7 @@ SPELL_POWER_OBSOLETE2 = 15;
_detalhes.encounter_table.index = boss_index
end
parser:Handle3rdPartyBuffs_OnEncounterStart()
end
function _detalhes.parser_functions:ENCOUNTER_END (...)
Binary file not shown.