- More improvements on parser and custom displays.

- Create Details! Forge, /details forge.
This commit is contained in:
Tercio
2015-05-05 17:40:14 -03:00
parent a50dad165a
commit f7fc5dfec3
9 changed files with 675 additions and 157 deletions
+2 -2
View File
File diff suppressed because one or more lines are too long
+190 -106
View File
@@ -758,7 +758,7 @@
local actor_table = self:GetActorTable (actor)
return actor_table.value
end
-- ~add
function atributo_custom:AddValue (actor, actortotal, checktop, name_complement)
local actor_table = self:GetActorTable (actor, name_complement)
actor_table.my_actor = actor
@@ -801,6 +801,12 @@
actor.nome = spellname
actor.classe = actor.spellschool
class = actor.spellschool
local index = self._NameIndexTable [actor.nome]
if (index) then
return self._ActorTable [index]
end
else
class = actor.classe
if (class == "UNKNOW") then
@@ -813,9 +819,9 @@
end
local new_actor = _setmetatable ({
nome = actor.nome,
classe = class,
value = _detalhes:GetOrderNumber (actor.nome),
nome = actor.nome,
classe = class,
value = _detalhes:GetOrderNumber (actor.nome),
}, atributo_custom.mt)
new_actor.name_complement = name_complement
@@ -1556,91 +1562,92 @@
desc = Loc ["STRING_CUSTOM_DTBS_DESC"],
source = false,
target = false,
script_version = 27,
script_version = 29,
on_shift_click = [[
local row, object, instance = ...
local spellname, _, spellicon = _detalhes.GetSpellInfo (object.id)
_detalhes:OpenAuraPanel (object.id, spellname, spellicon)
]],
script = [[
--> get the parameters passed
local combat, instance_container, instance = ...
--> declade the values to return
local total, top, amount = 0, 0, 0
--> get a list of all damage actors
local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE)
--> get the parameters passed
local combat, instance_container, instance = ...
--> declade the values to return
local total, top, amount = 0, 0, 0
--> get a list of all damage actors
local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE)
--> no amount increase for repeated spells
local NoRepeat = {}
--> no amount increase for repeated spells
local NoRepeat = {}
--> do a loop amoung the actors
for index, character in ipairs (AllDamageCharacters) do
--> is the actor a player?
if (character:IsPlayer()) then
local taken_from = character.damage_from
for source_name, _ in pairs (taken_from) do
--> do a loop amoung the actors
for index, character in ipairs (AllDamageCharacters) do
local source = combat (1, source_name)
if (source) then
--> came from an enemy
if (not source:IsPlayer()) then
--> is the actor a player?
if (character:IsPlayer()) then
local taken_from = character.damage_from
for source_name, _ in pairs (taken_from) do
local AllSpells = source:GetSpellList()
for spellid, spell in pairs (AllSpells) do
local on_player = spell.targets [character.nome]
if (on_player and on_player >= 1) then
instance_container:AddValue (spell, on_player)
total = total + on_player
local value = instance_container:GetValue (spell)
if (value > top) then
top = value
local source = combat (1, source_name)
if (source) then
--> came from an enemy
if (not source:IsPlayer()) then
local AllSpells = source:GetSpellList()
for spellid, spell in pairs (AllSpells) do
local on_player = spell.targets [character.nome]
if (on_player and on_player >= 1) then
instance_container:AddValue (spell, on_player)
total = total + on_player
local value = instance_container:GetValue (spell)
if (value > top) then
top = value
end
if (not NoRepeat [spellid]) then
amount = amount + 1
NoRepeat [spellid] = true
end
end
end
if (not NoRepeat [spellid]) then
amount = amount + 1
NoRepeat [spellid] = true
elseif (source:IsGroupPlayer()) then -- friendly fire
local AllSpells = source.friendlyfire [character.nome] and source.friendlyfire [character.nome].spells
for spellid, on_player in pairs (AllSpells) do
if (on_player and on_player >= 1) then
local spellname = select (1, GetSpellInfo(spellid))
local TEMP_SPELL_OBJECT = _G ["DetailsDamageTakenBySpellTemp"..spellid]
if (not TEMP_SPELL_OBJECT) then
TEMP_SPELL_OBJECT = {}
_G ["DetailsDamageTakenBySpellTemp"..spellid] = TEMP_SPELL_OBJECT
end
TEMP_SPELL_OBJECT.id = spellid
TEMP_SPELL_OBJECT.spellschool = 1
instance_container:AddValue (TEMP_SPELL_OBJECT, on_player)
total = total + on_player
local value = instance_container:GetValue (TEMP_SPELL_OBJECT)
if (value > top) then
top = value
end
if (not NoRepeat [spellid]) then
amount = amount + 1
NoRepeat [spellid] = true
end
end
end
end
end
end
elseif (source:IsGroupPlayer()) then -- friendly fire
local AllSpells = source.friendlyfire [character.nome] and source.friendlyfire [character.nome].spells
for spellid, on_player in pairs (AllSpells) do
if (on_player and on_player >= 1) then
local TEMP_SPELL_OBJECT = _G ["DetailsDamageTakenBySpellTemp"..spellid]
if (not TEMP_SPELL_OBJECT) then
TEMP_SPELL_OBJECT = {}
_G ["DetailsDamageTakenBySpellTemp"..spellid] = TEMP_SPELL_OBJECT
end
TEMP_SPELL_OBJECT.id = spellid
TEMP_SPELL_OBJECT.spellschool = 1
instance_container:AddValue (TEMP_SPELL_OBJECT, on_player)
total = total + on_player
local value = instance_container:GetValue (TEMP_SPELL_OBJECT)
if (value > top) then
top = value
end
if (not NoRepeat [spellid]) then
amount = amount + 1
NoRepeat [spellid] = true
end
end
end
end
end
end
end
end
end
end
return total, top, amount
return total, top, amount
]],
tooltip = [[
@@ -1649,6 +1656,10 @@
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
local GameCooltip = GameCooltip
local from_spell = actor.id
local from_spellname
if (from_spell) then
from_spellname = select (1, GetSpellInfo (actor.id))
end
--> get a list of all damage actors
local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE)
@@ -1658,42 +1669,77 @@
local total = 0
local top = 0
local is_custom_spell = false
for _, spellcustom in ipairs (_detalhes.savedCustomSpells) do
if (spellcustom[1] == from_spell) then
is_custom_spell = true
end
end
for index, character in ipairs (AllDamageCharacters) do
for playername, ff_table in pairs (character.friendlyfire) do
if (ff_table.spells [from_spell]) then
--> playername = target which suffered the damage
--> character = who dealt the damage
--> ff_table.spells [from_spell] = total done
local damage_actor = combat (1, playername)
local heal_actor = combat (2, playername)
if ((damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()))) then
if (is_custom_spell) then
for playername, ff_table in pairs (character.friendlyfire) do
if (ff_table.spells [from_spell]) then
local damage_actor = combat (1, playername)
local heal_actor = combat (2, playername)
local got
for index, t in ipairs (Targets) do
if (t[1] == playername) then
t[2] = t[2] + ff_table.spells [from_spell]
if (t[2] > top) then
top = t[2]
end
got = true
break
end
end
if (not got) then
if ((damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()))) then
Targets [#Targets+1] = {playername, ff_table.spells [from_spell]}
if (ff_table.spells [from_spell] > top) then
top = ff_table.spells [from_spell]
local got
for index, t in ipairs (Targets) do
if (t[1] == playername) then
t[2] = t[2] + ff_table.spells [from_spell]
if (t[2] > top) then
top = t[2]
end
got = true
break
end
end
if (not got) then
Targets [#Targets+1] = {playername, ff_table.spells [from_spell]}
if (ff_table.spells [from_spell] > top) then
top = ff_table.spells [from_spell]
end
end
end
end
end
else
for playername, ff_table in pairs (character.friendlyfire) do
for spellid, amount in pairs (ff_table.spells) do
local spellname = select (1, GetSpellInfo (spellid))
if (spellname == from_spellname) then
local damage_actor = combat (1, playername)
local heal_actor = combat (2, playername)
if ((damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()))) then
local got
for index, t in ipairs (Targets) do
if (t[1] == playername) then
t[2] = t[2] + amount
if (t[2] > top) then
top = t[2]
end
got = true
break
end
end
if (not got) then
Targets [#Targets+1] = {playername, amount}
if (amount > top) then
top = amount
end
end
end
end
end
end
end
--> search actors which used the spell shown in the bar
@@ -1739,19 +1785,57 @@
end
end
end
if (not is_custom_spell) then
for spellid, spell in pairs (character.spells._ActorTable) do
if (spellid ~= from_spell) then
local spellname = select (1, GetSpellInfo (spellid))
if (spellname == from_spellname) then
for targetname, amount in pairs (spell.targets) do
local got = false
local damage_actor = combat (1, targetname)
local heal_actor = combat (2, targetname)
if ( (damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()) ) ) then
for index, t in ipairs (Targets) do
if (t[1] == targetname) then
t[2] = t[2] + amount
if (t[2] > top) then
top = t[2]
end
got = true
break
end
end
if (not got) then
Targets [#Targets+1] = {targetname, amount}
if (amount > top) then
top = amount
end
end
end
end
end
end
end
end
end
table.sort (Targets, _detalhes.Sort2)
GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity")
local bar_background = {value = 100, color = {0, 0, 0, 0.7}, texture = "Interface\\AddOns\\Details\\images\\bar4"}
--local bar_background = {value = 100, color = {0.1, 0.1, 0.1, 0.9}, texture = "Interface\\AddOns\\Details\\images\\bar_background"}
local bar_background = {value = 100, color = {0.1, 0.1, 0.15, 1}, texture = "Interface\\AddOns\\Details\\images\\bar_background2"}
for index, t in ipairs (Targets) do
GameCooltip:AddLine (_detalhes:GetOnlyName(t[1]), _detalhes:ToK (t[2]))
local class, _, _, _, _, r, g, b = _detalhes:GetClass (t[1])
GameCooltip:AddStatusBar (t[2]/top*100, 1, r, g, b, 0.6, true, bar_background)
GameCooltip:AddStatusBar (t[2]/top*100, 1, r, g, b, 0.8, false, bar_background)
if (class) then
local texture, l, r, t, b = _detalhes:GetClassIcon (class)
@@ -1768,8 +1852,8 @@
GameCooltip:AddLine (" ")
GameCooltip:AddLine ("|cFFffa200Click|r: Report Results", aura, 1, "white", "white")
GameCooltip:AddStatusBar (100, 1, 0, 0, 0, 0.6, false, bar_background)
]],
GameCooltip:AddStatusBar (100, 1, 0, 0, 0, 0.7, false, bar_background)
]],
}
local have = false
+11 -3
View File
@@ -2109,6 +2109,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
return true
end
local enemies_background = {value = 100, color = {0.1, 0.1, 0.15, 1}, texture = "Interface\\AddOns\\Details\\images\\bar_background2"}
function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown)
local owner = self.owner
@@ -2153,6 +2154,8 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown)
GameCooltip:AddStatusBar (100, 1, 0.7, g, b, 1)
--> build the tooltip
local top = (tooltip_temp_table [1] and tooltip_temp_table [1][2]) or 0
for o = 1, i-1 do
local player = tooltip_temp_table [o][1]
@@ -2160,9 +2163,9 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown)
local player_name = _detalhes:GetOnlyName (player:name())
if (player_name:find (_detalhes.playername)) then
GameCooltip:AddLine (player_name .. ": ", FormatTooltipNumber (_, total) .. " (" .. _cstr ("%.1f", (total / damage_taken) * 100) .. "%)", nil, "yellow")
GameCooltip:AddLine (player_name .. " ", FormatTooltipNumber (_, total) .. " (" .. _cstr ("%.1f", (total / damage_taken) * 100) .. "%)", nil, "yellow")
else
GameCooltip:AddLine (player_name .. ": ", FormatTooltipNumber (_, total) .." (" .. _cstr ("%.1f", (total / damage_taken) * 100) .. "%)")
GameCooltip:AddLine (player_name .. " ", FormatTooltipNumber (_, total) .." (" .. _cstr ("%.1f", (total / damage_taken) * 100) .. "%)")
end
local classe = player:class()
@@ -2174,7 +2177,12 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown)
else
GameCooltip:AddIcon (instancia.row_info.icon_file, nil, nil, 14, 14, _unpack (_detalhes.class_coords [classe]))
end
_detalhes:AddTooltipBackgroundStatusbar()
local r, g, b = unpack (_detalhes.class_colors [classe])
GameCooltip:AddStatusBar (total/top*100, 1, r, g, b, 1, false, enemies_background)
GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity")
--_detalhes:AddTooltipBackgroundStatusbar()
end
+12 -24
View File
@@ -784,6 +784,13 @@
return
end
--4/22 18:07:54.369 SPELL_SUMMON,Player-3296-009371B2,"Façade-Anasterian(US)",0x514,0x0,Creature-0-3198-1448-2131-90477-0000380DAA,"Blood Globule",0xa28,0x0,180410,"Heart Seeker",0x1
--5/4 15:45:24.222 SPELL_SUMMON,Player-3296-009576DD,"Àlëx-Brill(EU)",0x40514,0x0,Creature-0-2083-1448-25606-90513-000047BE44,"Fel Blood Globule",0xa28,0x0,180413,"Heart Seeker",0x1
if (spellid and (spellid == 180410 or spellid == 180413)) then -- Heart Seeker
return
end
if (not who_name) then
who_name = "[*] " .. spellName
end
@@ -1082,6 +1089,9 @@
if (is_shield) then
spell.is_shield = true
end
if (_current_combat.is_boss and who_flags and _bit_band (who_flags, OBJECT_TYPE_ENEMY) ~= 0) then
_detalhes.spell_school_cache [spellname] = spelltype or school
end
end
if (is_shield) then
@@ -1167,25 +1177,16 @@
--> handle shields
if (tipo == "BUFF") then
--if (who_name == _detalhes.playername) then
-- print (spellid, spellname)
--end
------------------------------------------------------------------------------------------------
--> buff uptime
--if (arg1 or arg2 or arg3) then
-- print (spellname, arg1, arg2, arg3)
--end
if (_recording_buffs_and_debuffs) then
-- jade spirit doesn't send who_name, that's a shame.
if (who_name == alvo_name and raid_members_cache [who_serial] and _in_combat) then
--> call record buffs uptime
parser:add_buff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "BUFF_UPTIME_IN")
end
end
------------------------------------------------------------------------------------------------
--> healing done absorbs
if (absorb_spell_list [spellid] and _recording_healing and amount) then
@@ -1205,19 +1206,6 @@
elseif (defensive_cooldown_spell_list [spellid]) then
--> usou cooldown
return parser:add_defensive_cooldown (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname)
------------------------------------------------------------------------------------------------
--> recording buffs
elseif (_recording_self_buffs) then
--> or alvo_name needded, seems jade spirit not send who_name correctly
if (who_name == _detalhes.playername or alvo_name == _detalhes.playername) then
local bufftable = _detalhes.Buffs.BuffsTable [spellname]
if (bufftable) then
return bufftable:UpdateBuff ("new")
else
return false
end
end
end
+15 -16
View File
@@ -625,17 +625,16 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
local refresh_fillbox = function (self)
local offset = FauxScrollFrame_GetOffset (self)
local filled_lines = total_lines()
local filled_lines = total_lines (panel)
for index = 1, #self.lines do
local row = self.lines [index]
if (index <= filled_lines) then
local real_index = index + offset
local results = fill_row (real_index)
local results = fill_row (real_index, panel)
if (results [1]) then
row:Show()
@@ -670,9 +669,11 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
end
else
--< text
--> text
row.row_widgets [i]:SetText (results [i])
if (panel.rows [i].type == "entry") then
row.row_widgets [i]:SetCursorPosition (0)
end
end
end
@@ -698,12 +699,11 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
end
function panel:Refresh()
local filled_lines = total_lines()
local scroll_total_lines = #panel.scrollframe
local filled_lines = total_lines (panel)
local scroll_total_lines = #panel.scrollframe.lines
local line_height = options.rowheight
FauxScrollFrame_Update (panel.scrollframe, filled_lines, scroll_total_lines, line_height)
refresh_fillbox (panel.scrollframe)
FauxScrollFrame_Update (panel.scrollframe, filled_lines, scroll_total_lines, line_height)
end
local scrollframe = CreateFrame ("scrollframe", name .. "Scroll", panel.widget, "FauxScrollFrameTemplate")
@@ -719,11 +719,10 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
--create lines
local size = options.rowheight
local amount = math.floor (((h-21) / size))
for i = 1, amount do
local row = gump:NewPanel (parent, nil, "$parentRow_" .. i, nil, 1, size)
local row = gump:NewPanel (panel, nil, "$parentRow_" .. i, nil, 1, size)
row.backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]]}
row.color = {1, 1, 1, .2}
row:SetPoint ("topleft", scrollframe, "topleft", 0, (i-1) * size * -1)
@@ -748,8 +747,9 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
elseif (_type == "entry") then
--> create editbox
local editbox = gump:NewTextEntry (row, nil, "$parentEntry" .. o, "entry", panel.rows [o].width, 20, panel.rows [o].func, i, o)
local editbox = gump:NewTextEntry (row, nil, "$parentEntry" .. i .. o .. math.random(100), "entry", panel.rows [o].width, 20, panel.rows [o].func, i, o)
editbox.align = "left"
editbox:SetHook ("OnEnterPressed", function()
editbox.widget.focuslost = true
editbox:ClearFocus()
@@ -761,7 +761,6 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
editbox:SetBackdropColor (1, 1, 1, 0.1)
editbox:SetBackdropBorderColor (1, 1, 1, 0.1)
editbox.editbox.current_bordercolor = {1, 1, 1, 0.1}
--> insert in the table
tinsert (row.row_widgets, editbox)
+441 -5
View File
@@ -875,10 +875,446 @@
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> forge
function _detalhes:OpenForge()
if (not DetailsForge) then
local fw = _detalhes:GetFramework()
local lower = string.lower
--main frame
local f = CreateFrame ("frame", "DetailsForge", UIParent, "ButtonFrameTemplate")
f:SetSize (900, 600)
f.TitleText:SetText ("Details! Forge")
--f.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-BLOODELF]])
f.portrait:SetTexture ([[Interface\ICONS\INV_Misc_ReforgedArchstone_01]])
f:SetPoint ("center", UIParent, "center")
f:SetFrameStrata ("HIGH")
f:SetToplevel (true)
f:SetMovable (true)
tinsert (UISpecialFrames, "DetailsAuraPanel")
f:SetScript ("OnMouseDown", function(self, button)
if (self.isMoving) then
return
end
if (button == "RightButton") then
self:Hide()
else
self:StartMoving()
self.isMoving = true
end
end)
f:SetScript ("OnMouseUp", function(self, button)
if (self.isMoving and button == "LeftButton") then
self:StopMovingOrSizing()
self.isMoving = nil
end
end)
--modules
local all_modules = {}
local spell_already_added = {}
f:SetScript ("OnHide", function()
for _, module in ipairs (all_modules) do
if (module.data) then
wipe (module.data)
end
end
wipe (spell_already_added)
end)
local no_func = function()end
local nothing_to_show = {}
local current_module
local buttons = {}
function f:InstallModule (module)
if (module and type (module) == "table") then
tinsert (all_modules, module)
end
end
local all_players_module = {
name = "All Players",
desc = "Show a list of all player actors",
filters_widgets = function()
if (not DetailsForgeAllPlayersFilterPanel) then
local w = CreateFrame ("frame", "DetailsForgeAllPlayersFilterPanel", f)
w:SetSize (600, 20)
w:SetPoint ("topleft", f, "topleft", 120, -40)
local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
label:SetText ("Player Name: ")
label:SetPoint ("left", w, "left", 5, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllPlayersNameFilter")
entry:SetHook ("OnTextChanged", function() f:refresh() end)
entry:SetPoint ("left", label, "right", 2, 0)
end
return DetailsForgeAllPlayersFilterPanel
end,
search = function()
local t = {}
local filter = DetailsForgeAllPlayersNameFilter:GetText()
for _, actor in ipairs (_detalhes:GetCombat("current"):GetActorList (DETAILS_ATTRIBUTE_DAMAGE)) do
if (actor:IsGroupPlayer()) then
if (filter ~= "") then
filter = lower (filter)
local actor_name = lower (actor:name())
if (actor_name:find (filter)) then
t [#t+1] = actor
end
else
t [#t+1] = actor
end
end
end
return t
end,
header = {
{name = "Index", width = 40, type = "text", func = no_func},
{name = "Name", width = 150, type = "entry", func = no_func},
{name = "Class", width = 100, type = "entry", func = no_func},
{name = "GUID", width = 230, type = "entry", func = no_func},
{name = "Flag", width = 100, type = "entry", func = no_func},
},
fill_panel = false,
fill_gettotal = function (self) return #self.module.data end,
fill_fillrows = function (index, self)
local data = self.module.data [index]
if (data) then
return {
index,
data:name() or "",
data:class() or "",
data.serial or "",
"0x" .. _detalhes:hex (data.flag_original)
}
else
return nothing_to_show
end
end,
fill_name = "DetailsForgeAllPlayersFillPanel",
}
f:InstallModule (all_players_module)
-----------------------------------------------
local all_pets_module = {
name = "All Pets",
desc = "Show a list of all pet actors",
filters_widgets = function()
if (not DetailsForgeAllPetsFilterPanel) then
local w = CreateFrame ("frame", "DetailsForgeAllPetsFilterPanel", f)
w:SetSize (600, 20)
w:SetPoint ("topleft", f, "topleft", 120, -40)
--
local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
label:SetText ("Pet Name: ")
label:SetPoint ("left", w, "left", 5, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllPetsNameFilter")
entry:SetHook ("OnTextChanged", function() f:refresh() end)
entry:SetPoint ("left", label, "right", 2, 0)
--
local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
label:SetText ("Owner Name: ")
label:SetPoint ("left", entry.widget, "right", 20, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllPetsOwnerFilter")
entry:SetHook ("OnTextChanged", function() f:refresh() end)
entry:SetPoint ("left", label, "right", 2, 0)
end
return DetailsForgeAllPetsFilterPanel
end,
search = function()
local t = {}
local filter_petname = DetailsForgeAllPetsNameFilter:GetText()
local filter_ownername = DetailsForgeAllPetsOwnerFilter:GetText()
for _, actor in ipairs (_detalhes:GetCombat("current"):GetActorList (DETAILS_ATTRIBUTE_DAMAGE)) do
if (actor.owner) then
local can_add = true
if (filter_petname ~= "") then
filter_petname = lower (filter_petname)
local actor_name = lower (actor:name())
if (not actor_name:find (filter_petname)) then
can_add = false
end
end
if (filter_ownername ~= "") then
filter_ownername = lower (filter_ownername)
local actor_name = lower (actor.ownerName)
if (not actor_name:find (filter_ownername)) then
can_add = false
end
end
if (can_add) then
t [#t+1] = actor
end
end
end
return t
end,
header = {
{name = "Index", width = 40, type = "text", func = no_func},
{name = "Name", width = 150, type = "entry", func = no_func},
{name = "Owner", width = 150, type = "entry", func = no_func},
{name = "NpcID", width = 60, type = "entry", func = no_func},
{name = "GUID", width = 100, type = "entry", func = no_func},
{name = "Flag", width = 100, type = "entry", func = no_func},
},
fill_panel = false,
fill_gettotal = function (self) return #self.module.data end,
fill_fillrows = function (index, self)
local data = self.module.data [index]
if (data) then
return {
index,
data:name():gsub ("(<).*(>)", "") or "",
data.ownerName or "",
_detalhes:GetNpcIdFromGuid (data.serial),
data.serial or "",
"0x" .. _detalhes:hex (data.flag_original)
}
else
return nothing_to_show
end
end,
fill_name = "DetailsForgeAllPetsFillPanel",
}
f:InstallModule (all_pets_module)
-----------------------------------------------
local all_enemies_module = {
name = "All Enemies",
desc = "Show a list of all enemies actors",
filters_widgets = function()
if (not DetailsForgeAllEnemiesFilterPanel) then
local w = CreateFrame ("frame", "DetailsForgeAllEnemiesFilterPanel", f)
w:SetSize (600, 20)
w:SetPoint ("topleft", f, "topleft", 120, -40)
--
local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
label:SetText ("Enemy Name: ")
label:SetPoint ("left", w, "left", 5, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllEnemiesNameFilter")
entry:SetHook ("OnTextChanged", function() f:refresh() end)
entry:SetPoint ("left", label, "right", 2, 0)
end
return DetailsForgeAllEnemiesFilterPanel
end,
search = function()
local t = {}
local filter = DetailsForgeAllEnemiesNameFilter:GetText()
for _, actor in ipairs (_detalhes:GetCombat("current"):GetActorList (DETAILS_ATTRIBUTE_DAMAGE)) do
if (actor:IsNeutralOrEnemy()) then
if (filter ~= "") then
filter = lower (filter)
local actor_name = lower (actor:name())
if (actor_name:find (filter)) then
t [#t+1] = actor
end
else
t [#t+1] = actor
end
end
end
return t
end,
header = {
{name = "Index", width = 40, type = "text", func = no_func},
{name = "Name", width = 150, type = "entry", func = no_func},
{name = "NpcID", width = 60, type = "entry", func = no_func},
{name = "GUID", width = 230, type = "entry", func = no_func},
{name = "Flag", width = 100, type = "entry", func = no_func},
},
fill_panel = false,
fill_gettotal = function (self) return #self.module.data end,
fill_fillrows = function (index, self)
local data = self.module.data [index]
if (data) then
return {
index,
data:name(),
_detalhes:GetNpcIdFromGuid (data.serial),
data.serial or "",
"0x" .. _detalhes:hex (data.flag_original)
}
else
return nothing_to_show
end
end,
fill_name = "DetailsForgeAllEnemiesFillPanel",
}
f:InstallModule (all_enemies_module)
-----------------------------------------------
local EncounterSpellEvents = EncounterDetailsDB and EncounterDetailsDB.encounter_spells
local all_spells_module = {
name = "All Spells",
desc = "Show a list of all spells used",
filters_widgets = function()
if (not DetailsForgeAllSpellsFilterPanel) then
local w = CreateFrame ("frame", "DetailsForgeAllSpellsFilterPanel", f)
w:SetSize (600, 20)
w:SetPoint ("topleft", f, "topleft", 120, -40)
--
local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
label:SetText ("Spell Name: ")
label:SetPoint ("left", w, "left", 5, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllSpellsNameFilter")
entry:SetHook ("OnTextChanged", function() f:refresh() end)
entry:SetPoint ("left", label, "right", 2, 0)
--
local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
label:SetText ("Caster Name: ")
label:SetPoint ("left", entry.widget, "right", 20, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllSpellsCasterFilter")
entry:SetHook ("OnTextChanged", function() f:refresh() end)
entry:SetPoint ("left", label, "right", 2, 0)
end
return DetailsForgeAllSpellsFilterPanel
end,
search = function()
local t = {}
local filter_name = DetailsForgeAllSpellsNameFilter:GetText()
local filter_caster = DetailsForgeAllSpellsCasterFilter:GetText()
local combat = _detalhes:GetCombat("current")
local containers = {combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE), combat:GetActorList (DETAILS_ATTRIBUTE_HEAL),
combat:GetActorList (DETAILS_ATTRIBUTE_ENERGY)}
wipe (spell_already_added)
for _, container in ipairs (containers) do
for _, actor in ipairs (container) do
local can_add = true
if (filter_caster ~= "") then
filter_caster = lower (filter_caster)
local actor_name = lower (actor:name())
if (not actor_name:find (filter_caster)) then
can_add = false
end
end
if (can_add) then
for spellid, spell in pairs (actor:GetSpellList()) do
can_add = true
if (filter_name ~= "") then
filter_name = lower (filter_name)
local spellname = lower (select (1, GetSpellInfo (spellid)) or "-")
if (not spellname:find (filter_name)) then
can_add = false
end
end
if (can_add and not spell_already_added [spellid]) then
spell_already_added [spellid] = true
tinsert (t, {spell, actor})
end
end
end
end
end
return t
end,
header = {
{name = "Index", width = 40, type = "text", func = no_func},
{name = "Name", width = 150, type = "entry", func = no_func},
{name = "SpellID", width = 60, type = "entry", func = no_func},
{name = "School", width = 60, type = "entry", func = no_func},
{name = "Caster", width = 100, type = "entry", func = no_func},
{name = "Event", width = 300, type = "entry", func = no_func},
},
fill_panel = false,
fill_gettotal = function (self) return #self.module.data end,
fill_fillrows = function (index, self)
local data = self.module.data [index]
if (data) then
local events = ""
if (EncounterSpellEvents and EncounterSpellEvents [data[1].id]) then
for token, _ in pairs (EncounterSpellEvents [data[1].id].token) do
token = token:gsub ("SPELL_", "")
events = events .. token .. ", "
end
events = events:sub (1, #events - 3)
end
return {
index,
select (1, GetSpellInfo (data[1].id)) or "",
data[1].id or "",
_detalhes:GetSpellSchoolFormatedName (data[1].spellschool) or "",
data[2]:name(),
events
}
else
return nothing_to_show
end
end,
fill_name = "DetailsForgeAllSpellsFillPanel",
}
f:InstallModule (all_spells_module)
-----------------------------------------------
local select_module = function (module_number)
if (current_module ~= module_number) then
local module = all_modules [current_module]
if (module) then
local filters = module.filters_widgets()
filters:Hide()
local fill_panel = module.fill_panel
fill_panel:Hide()
end
end
for index, button in ipairs (buttons) do
button.textcolor = "white"
end
buttons[module_number].textcolor = "orange"
local module = all_modules [module_number]
if (module) then
current_module = module_number
local fillpanel = module.fill_panel
if (not fillpanel) then
fillpanel = fw:NewFillPanel (f, module.header, module.fill_name, nil, 740, 480, module.fill_gettotal, module.fill_fillrows, false)
fillpanel:SetPoint (120, -80)
fillpanel.module = module
module.fill_panel = fillpanel
end
local filters = module.filters_widgets()
filters:Show()
local data = module.search()
module.data = data
fillpanel:Show()
fillpanel:Refresh()
end
end
function f:refresh()
select_module (current_module)
end
for i = 1, #all_modules do
local module = all_modules [i]
local b = fw:CreateButton (f, select_module, 120, 12, module.name, i)
b.tooltip = module.desc
b.textalign = "<"
b:SetPoint ("topleft", f, "topleft", 10, (i*16*-1) - 67)
tinsert (buttons, b)
end
select_module (1)
end
DetailsForge:Show()
end
--_detalhes:ScheduleTimer ("OpenForge", 3)
+3
View File
@@ -1013,6 +1013,9 @@ function SlashCmdList.DETAILS (msg, editbox)
local average = item_level / item_amount
print ("your item lvl:", average)
elseif (msg == "forge") then
_detalhes:OpenForge()
elseif (msg == "parser") then
_detalhes:OnParserEvent (
Binary file not shown.
+1 -1
View File
@@ -1632,7 +1632,7 @@ do
BossFrame.EnemySpellsWidgets = {}
--> spells and auras ~auras
--> spells and auras ~auras ~spell
-- actor dropdown