From f7fc5dfec332027f65839f283b6e432ef54089ac Mon Sep 17 00:00:00 2001 From: Tercio Date: Tue, 5 May 2015 17:40:14 -0300 Subject: [PATCH] - More improvements on parser and custom displays. - Create Details! Forge, /details forge. --- boot.lua | 4 +- classes/classe_custom.lua | 296 ++++++++----- classes/classe_damage.lua | 14 +- core/parser.lua | 36 +- framework/panel.lua | 31 +- functions/link.lua | 446 +++++++++++++++++++- functions/slash.lua | 3 + images/bar_background2.tga | Bin 0 -> 6135 bytes plugins/Details_EncounterDetails/frames.lua | 2 +- 9 files changed, 675 insertions(+), 157 deletions(-) create mode 100644 images/bar_background2.tga diff --git a/boot.lua b/boot.lua index 298dc5a1..96cc78b8 100644 --- a/boot.lua +++ b/boot.lua @@ -4,7 +4,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 831 --it's 831 for release - _detalhes.userversion = "v3.13.2" + _detalhes.userversion = "v3.13.3" _detalhes.realversion = 67 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -30,7 +30,7 @@ do --|cFFFFFF00v3.13.2 (|cFFFFCC00May 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several improvements on combatlog reader and custom displays.\n\n|cFFFFFF00-|r Improvements on enemies damage taken tooltip.\n\n -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.13.2 (|cFFFFCC00May 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several improvements on combatlog reader and custom displays.\n\n|cFFFFFF00-|r Improvements on enemies damage taken tooltip.\n\n|cFFFFFF00v3.13.1 (|cFFFFCC00April 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added casted amount for healing and damage spells. The result is shown on Player Detail Window and Comparison Panel.\n\n|cFFFFFF00-|r Added uptime amount for healing spells on Player Detail Window.\n\n|cFFFFFF00-|r Added an option to disable lock/resize/ungroup buttons. It's under miscellaneous bracket on Options Panel.\n\n|cFFFFFF00-|r Wallpaper for menus on title bar got a customization option under tooltips bracket on Options Panel.\n\n|cFFFFFF00-|r Updated spell list for Crowd Control and class detection.\n\n|cFFFFFF00-|r Improved Weakaura creation tool under Encounter Details Plugin.\n\n|cFFFFFF00v3.12.10 (|cFFFFCC00April 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added the spell uptime on damage player detail window.\n\n|cFFFFFF00-|r Added Rune Tap as cooldown.\n\n|cFFFFFF00-|r Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore.\n\n|cFFFFFF00-|r Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window.\n\n|cFFFFFF00v3.12.7 (|cFFFFCC00April 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added slash command /details profile .\n\n|cFFFFFF00v3.12.6 (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): added a report button on Emotes tab.\n\n|cFFFFFF00-|r Encounter Details (plugin): improved Weakauras creation.\n\n|cFFFFFF00-|r Encounter Details (plugin): fixed the report text for interrupts and dispells.\n\n|cFFFFFF00-|r Crowd control by Pets now is merged with its owner.\n\n|cFFFFFF00-|r Truncated left text on bars now shows the entire text when hover over the bar.\n\n|cFFFFFF00-|r Added an extra option on minimap menu to disable the minimap icon.\n\n|cFFFFFF00-|r Fixed a problem when disabling the minimap icon through options panel.\n\n|cFFFFFF00-|r Fixed an issue with item level tracker feature.\n\n|cFFFFFF00v3.12.2 (|cFFFFCC00Mar 30, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Raid Check (plugin): added item level.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): bug fixes, it's important to update it.\n\n|cFFFFFF00-|r Time Line (plugin): bug fixes.\n\n|cFFFFFF00-|r Added option to disabled th eitem level tracker.\n\n|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n|cFFFFFF00-|r Added more spells for crowd control.\n\n|cFFFFFF00-|r Added scroll on bookmark panel.\n\n|cFFFFFF00-|r Fixed issue with Dps/Hps data broker which wasn't respecting the type of time (effective/activity) selected.\n\n|cFFFFFF00-|r Fixed few bugs when using the key bind to toggle windows.\n\n|cFFFFFF00v3.11.5 (|cFFFFCC00Mar 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data where max/min amount for spells was being calculated wrong.\n\n|cFFFFFF00-|r Fixed a problem while reporting enemy damage taken.\n\n|cFFFFFF00-|r Fixed an issue with damage taken by spell where some spells wasn't shown.\n\n|cFFFFFF00-|r Few improvements on tooltips.\n\n|cFFFFFF00-|r Fixed a accuracy problem with shaman's spirit link toten where its life exchange was considered healing done.\n\n|cFFFFFF00-|r Boss segments now need to have at least 30 seconds to be added on the overall data.\n\n|cFFFFFF00-|r When the segment limit is reach, segments with less combat time will be erased instead of the olders.\n\n|cFFFFFF00-|r Added item level tracker.\n\n|cFFFFFF00-|r Fixed window positioning when changing from Solo mode to Group mode.\n\n|cFFFFFF00-|r Added an option for change the amount of lines on death log.\n\n|cFFFFFF00-|r Added custom display for CC done.\n\n|cFFFFFF00v3.10.10 (|cFFFFCC00Mar 10, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): done a calibration on endurance calculation.\n\n|cFFFFFF00-|r Raid Check (plugin): now also show information for 50+ stats runes.\n\n|cFFFFFF00-|r Fixed cooldowns spell targets on overall data.\n\n|cFFFFFF00-|r Fixed report custom displays where sometimes it didn't report spell links.\n\n|cFFFFFF00-|r Replaced old report line saying 'for the last X segments' with 'overall data'.\n\n|cFFFFFF00-|r Mini-displays on statusbar are now more responsible to right button click.\n\n|cFFFFFF00-|r Added Mage's Greater Invisibility as cooldown.\n\n|cFFFFFF00v3.10.8 (|cFFFFCC00Mar 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improved aura creation.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show your pets.\n\n|cFFFFFF00-|r Fixed 'Raid Check' plugin food detection.\n\n|cFFFFFF00v3.10.6 (|cFFFFCC00Feb 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): several bug fixes and improvements.\n\n|cFFFFFF00-|r Encounter Details (plugin): added new tab showing enemy spells from the encounter with an aura creation panel.\n\n|cFFFFFF00-|r Encounter Details (plugin): added phase indicators on graphic tab, hovering over shows the damage and heal for that specific phase.\n\n|cFFFFFF00-|r Segments menu now also show the encounter try number plus the elapsed combat time.\n\n|cFFFFFF00-|r Several improvements on Overall Data, also, now it has an option to not save it when the character logoff.\n\n|cFFFFFF00-|r Player Details window now closes with right click on any bar.\n\n|cFFFFFF00-|r Fixed Nature's Vigil cooldown.\n\n|cFFFFFF00v3.9.12a (|cFFFFCC00Feb 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Roll back on combat detection after reset data, might be causing problems.\n\n|cFFFFFF00v3.9.12 (|cFFFFCC00Feb 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): got report buttons for Endurance and Deaths Overall Damage.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): the Deaths and Endurance limits can now be changed under the plugin options.\n\n|cFFFFFF00-|r Chart Viewer (plugin): has been revamped and now it's less complicated to use.\n\n|cFFFFFF00-|r Time Line (plugin): added options to change the background color and scale.\n\n|cFFFFFF00-|r Raid Check (plugin): its window is now 'always on top'.\n\n|cFFFFFF00-|r Accuracy adjustments on overheal of Divine Aegis and Illuminated Healing.\n\n|cFFFFFF00-|r Removed healthstone from cooldown list, added Nature's Vigil.\n\n|cFFFFFF00-|r Enemies display now shows damage taken instead of damage done.\n\n|cFFFFFF00-|r Tooltip for enemies display now also show damage and healing done by the enemy.\n\n|cFFFFFF00-|r Added an option under miscellaneous to show neutral and hostile creatures on damage taken display.\n\n|cFFFFFF00-|r Added an option to ignore nicknames and always use character names.\n\n|cFFFFFF00-|r Enabling the display icon on title bar now makes the title text automatically move slightly to right.\n\n|cFFFFFF00-|r Fixed issue with skin changing when the window has the statusbar enabled.\n\n|cFFFFFF00v3.9.4 (|cFFFFCC00Feb 03, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option 'Ignore Mass Toggle', when enabled the window won't be affected when hiding, showing or toggling all windows.\n\n|cFFFFFF00-|r Added window number for slash commands 'hide', 'show' and 'toggle'. Usage: '/details hide 1' to hide window 1.\n\n|cFFFFFF00-|r Removed keybinds for Open and Close, added toggle instead.\n\n|cFFFFFF00-|r Added slash command 'toggle'.\n\n|cFFFFFF00-|r Added display icons for all skins which still didn't have they.\n\n|cFFFFFF00-|r Improved 'Align with right chat' tool, now it also supports Forced Square skin." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.13.3 (|cFFFFCC00May 05, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created 'Details! Forge' but is still under development: /details forge.\n\n|cFFFFFF00-|r Several improvements on combatlog reader and custom displays.\n\n|cFFFFFF00-|r Improvements on enemies damage taken tooltip.\n\n|cFFFFFF00v3.13.1 (|cFFFFCC00April 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added casted amount for healing and damage spells. The result is shown on Player Detail Window and Comparison Panel.\n\n|cFFFFFF00-|r Added uptime amount for healing spells on Player Detail Window.\n\n|cFFFFFF00-|r Added an option to disable lock/resize/ungroup buttons. It's under miscellaneous bracket on Options Panel.\n\n|cFFFFFF00-|r Wallpaper for menus on title bar got a customization option under tooltips bracket on Options Panel.\n\n|cFFFFFF00-|r Updated spell list for Crowd Control and class detection.\n\n|cFFFFFF00-|r Improved Weakaura creation tool under Encounter Details Plugin.\n\n|cFFFFFF00v3.12.10 (|cFFFFCC00April 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added the spell uptime on damage player detail window.\n\n|cFFFFFF00-|r Added Rune Tap as cooldown.\n\n|cFFFFFF00-|r Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore.\n\n|cFFFFFF00-|r Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window.\n\n|cFFFFFF00v3.12.7 (|cFFFFCC00April 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added slash command /details profile .\n\n|cFFFFFF00v3.12.6 (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): added a report button on Emotes tab.\n\n|cFFFFFF00-|r Encounter Details (plugin): improved Weakauras creation.\n\n|cFFFFFF00-|r Encounter Details (plugin): fixed the report text for interrupts and dispells.\n\n|cFFFFFF00-|r Crowd control by Pets now is merged with its owner.\n\n|cFFFFFF00-|r Truncated left text on bars now shows the entire text when hover over the bar.\n\n|cFFFFFF00-|r Added an extra option on minimap menu to disable the minimap icon.\n\n|cFFFFFF00-|r Fixed a problem when disabling the minimap icon through options panel.\n\n|cFFFFFF00-|r Fixed an issue with item level tracker feature.\n\n|cFFFFFF00v3.12.2 (|cFFFFCC00Mar 30, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Raid Check (plugin): added item level.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): bug fixes, it's important to update it.\n\n|cFFFFFF00-|r Time Line (plugin): bug fixes.\n\n|cFFFFFF00-|r Added option to disabled th eitem level tracker.\n\n|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n|cFFFFFF00-|r Added more spells for crowd control.\n\n|cFFFFFF00-|r Added scroll on bookmark panel.\n\n|cFFFFFF00-|r Fixed issue with Dps/Hps data broker which wasn't respecting the type of time (effective/activity) selected.\n\n|cFFFFFF00-|r Fixed few bugs when using the key bind to toggle windows.\n\n|cFFFFFF00v3.11.5 (|cFFFFCC00Mar 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data where max/min amount for spells was being calculated wrong.\n\n|cFFFFFF00-|r Fixed a problem while reporting enemy damage taken.\n\n|cFFFFFF00-|r Fixed an issue with damage taken by spell where some spells wasn't shown.\n\n|cFFFFFF00-|r Few improvements on tooltips.\n\n|cFFFFFF00-|r Fixed a accuracy problem with shaman's spirit link toten where its life exchange was considered healing done.\n\n|cFFFFFF00-|r Boss segments now need to have at least 30 seconds to be added on the overall data.\n\n|cFFFFFF00-|r When the segment limit is reach, segments with less combat time will be erased instead of the olders.\n\n|cFFFFFF00-|r Added item level tracker.\n\n|cFFFFFF00-|r Fixed window positioning when changing from Solo mode to Group mode.\n\n|cFFFFFF00-|r Added an option for change the amount of lines on death log.\n\n|cFFFFFF00-|r Added custom display for CC done.\n\n|cFFFFFF00v3.10.10 (|cFFFFCC00Mar 10, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): done a calibration on endurance calculation.\n\n|cFFFFFF00-|r Raid Check (plugin): now also show information for 50+ stats runes.\n\n|cFFFFFF00-|r Fixed cooldowns spell targets on overall data.\n\n|cFFFFFF00-|r Fixed report custom displays where sometimes it didn't report spell links.\n\n|cFFFFFF00-|r Replaced old report line saying 'for the last X segments' with 'overall data'.\n\n|cFFFFFF00-|r Mini-displays on statusbar are now more responsible to right button click.\n\n|cFFFFFF00-|r Added Mage's Greater Invisibility as cooldown.\n\n|cFFFFFF00v3.10.8 (|cFFFFCC00Mar 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improved aura creation.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show your pets.\n\n|cFFFFFF00-|r Fixed 'Raid Check' plugin food detection.\n\n|cFFFFFF00v3.10.6 (|cFFFFCC00Feb 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): several bug fixes and improvements.\n\n|cFFFFFF00-|r Encounter Details (plugin): added new tab showing enemy spells from the encounter with an aura creation panel.\n\n|cFFFFFF00-|r Encounter Details (plugin): added phase indicators on graphic tab, hovering over shows the damage and heal for that specific phase.\n\n|cFFFFFF00-|r Segments menu now also show the encounter try number plus the elapsed combat time.\n\n|cFFFFFF00-|r Several improvements on Overall Data, also, now it has an option to not save it when the character logoff.\n\n|cFFFFFF00-|r Player Details window now closes with right click on any bar.\n\n|cFFFFFF00-|r Fixed Nature's Vigil cooldown.\n\n|cFFFFFF00v3.9.12a (|cFFFFCC00Feb 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Roll back on combat detection after reset data, might be causing problems.\n\n|cFFFFFF00v3.9.12 (|cFFFFCC00Feb 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): got report buttons for Endurance and Deaths Overall Damage.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): the Deaths and Endurance limits can now be changed under the plugin options.\n\n|cFFFFFF00-|r Chart Viewer (plugin): has been revamped and now it's less complicated to use.\n\n|cFFFFFF00-|r Time Line (plugin): added options to change the background color and scale.\n\n|cFFFFFF00-|r Raid Check (plugin): its window is now 'always on top'.\n\n|cFFFFFF00-|r Accuracy adjustments on overheal of Divine Aegis and Illuminated Healing.\n\n|cFFFFFF00-|r Removed healthstone from cooldown list, added Nature's Vigil.\n\n|cFFFFFF00-|r Enemies display now shows damage taken instead of damage done.\n\n|cFFFFFF00-|r Tooltip for enemies display now also show damage and healing done by the enemy.\n\n|cFFFFFF00-|r Added an option under miscellaneous to show neutral and hostile creatures on damage taken display.\n\n|cFFFFFF00-|r Added an option to ignore nicknames and always use character names.\n\n|cFFFFFF00-|r Enabling the display icon on title bar now makes the title text automatically move slightly to right.\n\n|cFFFFFF00-|r Fixed issue with skin changing when the window has the statusbar enabled.\n\n|cFFFFFF00v3.9.4 (|cFFFFCC00Feb 03, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option 'Ignore Mass Toggle', when enabled the window won't be affected when hiding, showing or toggling all windows.\n\n|cFFFFFF00-|r Added window number for slash commands 'hide', 'show' and 'toggle'. Usage: '/details hide 1' to hide window 1.\n\n|cFFFFFF00-|r Removed keybinds for Open and Close, added toggle instead.\n\n|cFFFFFF00-|r Added slash command 'toggle'.\n\n|cFFFFFF00-|r Added display icons for all skins which still didn't have they.\n\n|cFFFFFF00-|r Improved 'Align with right chat' tool, now it also supports Forced Square skin." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_custom.lua b/classes/classe_custom.lua index 51bc9689..ee79804c 100644 --- a/classes/classe_custom.lua +++ b/classes/classe_custom.lua @@ -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 diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index bb4d6b70..a5cb3491 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -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 diff --git a/core/parser.lua b/core/parser.lua index d5e50b1b..4dab3f0f 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -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 diff --git a/framework/panel.lua b/framework/panel.lua index 317122ce..ba403fbc 100644 --- a/framework/panel.lua +++ b/framework/panel.lua @@ -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) diff --git a/functions/link.lua b/functions/link.lua index 6c18aa38..3907d371 100644 --- a/functions/link.lua +++ b/functions/link.lua @@ -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) \ No newline at end of file diff --git a/functions/slash.lua b/functions/slash.lua index 106d731d..9d53573f 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -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 ( diff --git a/images/bar_background2.tga b/images/bar_background2.tga new file mode 100644 index 0000000000000000000000000000000000000000..4e3b9d4cdcfd84c15d6105abb8279dad83c4c118 GIT binary patch literal 6135 zcmd^@%Z?;R6^45*J$O7CdoU70SQziT0(OWMJ0n>_AaN5CFX67rOL?X*lWoCUbaz!{ zW=-s7VRhGK{BFtjoyhC~UI9xn5pgd6`Ok@y<>)v%`ta!fzXzWmeg46-v(wY`>g+U~ zG0soVm>K5|WasDU{NgN~pI@X4*RRi0bAEA=Ubs4cjnw(#b$X4*>oct`@M4^ur_)!b zj8}}8>D9~A^z!8*)iq;Lr?RS2Q`Kd9QWf(wFN#!_MJim+9Ww?N#k@#Ao1M&4F=Mb% zGgHfcHa|(l39{KNot$Ku^9gn*$Yztx>?F;R7hh-puhD&dauPNX3H^+HfjqGAb8hAU zJ)9Rt%$|*qpD8Y9C9KO-l<=)Juyb9kMzY5%1>}rvkvZ~Y51&A3HZ>`W)poKLab@@$1XoUaBS{HSVMIBPP z7%MzDi&{C}@~;{nHhQ!O~q5)0ck4&L-V?8;*0L)SB>&kT!7y~x_i zOr}P64TB=qGGS2s+Ga76h1D=CO3$n;Y|H>(mRmw7kAaH_Yy@SzkL}<@MEn?U7-pzPUm1>GchsS4+H?Xl_7SrX?0PSU9`CS)yC6 z(rUd*Yew5TTJ~%9ZMuoMOYN#n>vo;mb;sPM4xRJ5L+8M*Y1=M+s&|XF4QnjcJ?k!Y zSoK|>I@W#c`_%V%_S!PgFOjd2b&gIP^kKh_eQzY}#b~=MyL5A`RYV-4_skv9nii;! zgC#uHSZUrxJaM!FhgnW*Vs`zSwQ>-N-!U2uexu|+^X^)*(F#wQb!IH_?uk1=wvUgerun>Z(W*$h zrkl;1)Ne+c-ik8%P4q@ooV|K`Vsqac`f+BRcAK9E_S-EN=u`+aH-{Bx{@i~W8Z^A4-+0qqXq2l^fK-yg8Z z^E?5^%H2d%0rQ6$EBJR@`g)n;}-rn8DyeHo6?HzKMjq8Z@G+W)J zJG5Gha(6fGk?ptp&|NBga;Jq_Mz+Kn53w5sk6kG-Us;G7nrFs6AXO`l+RW)N;=N~~ zzA?z-$OI1A+H7{@4$KpA#EdA|2Pe5958vb9F-9@+#JrId3EifjXkyws3K?oN5z-!!H*{TbXiHyYxse7g09jo5^D(5f8fwE9|3YkL(W}vx>ar z7-!}wXQ+H4lZAu@)hnv-<9mN=6ZMgvr=8Q9!fH3^owtndzWWZ@Hf;CwsPZh+cbghF zM_NXIJaTon9c`GKE&n`L@*a&f(ZAI*2p+v(S@D284l<;oPO{d~;Bj=%rc;aR`Eil( zl(e(f(SXr7(J;Go?Ac7^(Zj^G9^Srv`~UvW^JsPoY}xE93!}_Fvz*i3qFFq3+C{S- z=@q{x;Eac5hs7BCal&NYja}`5YAta?fjw6I?!# zm8esXPuWD%pfjT_pZou2y4&WK&_0@n*n!AzTK+P&Q(Ns0`8Vy@Z#ZydV^y$pZWJEN zRSW&(I@Ke7zh07h%Qt-k`DaDlr4G;S;y5#+>_jmdb9^Cqs-KW2#4SHa(Hoaq#n1cH zG73KC`Y>=s8@QqkTko{`l$~|yNWgrKPi)-Ly z8`ne{@iViQr~o~TOywCoFnefjVT0t-#bY@diOYV@W7WyI8=g&e#IMLzOkM84{X&cz!$ZQOIxDqnOh8ay|kc=QU}s79`={VvmxuVk%Ft}0jhu#KL1 zre$>LILGOFJ~6Dfr*Aj2Ms{gS{4k{UHyV31dd0qU?P-UHa@We}AG)NAKC-v-_t)@u zz;Lw0BEGaI{Gm0hWTIX4dG;6Y6P_~$Ua1Bi9|j&F1|A9q-eiWVW+3D3h`GAg^C~s) zU@`EhfDGU8tMIJ{-jb@}vqFo>i#2atXdR%`S~@antm}Hbb`Zum?nCT5ltP8xxJVD~2C72Yf zgRQJ#bSd567Ud$UGY^jf4FmLC9oBlw#faw5h{)InZ}tm(wCA}fa}PGMaxW{Yx~PT) z818ws0}p+@2wd4m{_gS7j|Z}BBU>>T1vs8eoT5DBiZAbr!6{ckj^N9QEQ`4(Iu8t< zhT?=hJL}6EUpf5RtVHsJqdx9Y*gMuv6!kUUyaA4KdSosd`+1hxZ#lB%0?XeT;IlE&m&5l7g8ff zW@7}9qkbc+U<%58eV#L{rRgu{^1vY|J_%=|MHhd F{|4~fAYcFh literal 0 HcmV?d00001 diff --git a/plugins/Details_EncounterDetails/frames.lua b/plugins/Details_EncounterDetails/frames.lua index d4291561..53318946 100644 --- a/plugins/Details_EncounterDetails/frames.lua +++ b/plugins/Details_EncounterDetails/frames.lua @@ -1632,7 +1632,7 @@ do BossFrame.EnemySpellsWidgets = {} - --> spells and auras ~auras + --> spells and auras ~auras ~spell -- actor dropdown