diff --git a/boot.lua b/boot.lua index 73bbe9e9..17a540d6 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 = 570 --it's 570 for release - _detalhes.userversion = "v3.10.0" + _detalhes.userversion = "v3.10.1" _detalhes.realversion = 60 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" @@ -20,13 +20,17 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v3.10.0 (|cFFFFCC00Feb 17, 2015|r|cFFFFFF00)|r:\n\n -|cFFFFFF00-|r Several improvements on Encounter Details plugin.\n\n +|cFFFFFF00v3.10.1 (|cFFFFCC00Feb 19, 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 Player Details window now closes with right click on any bar.\n\n +|cFFFFFF00-|r Fixed Nature's Vigil cooldown.\n\n --]] --- |cFFFFFF00v3.10.0 (|cFFFFCC00Feb 17, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several improvements on Encounter Details plugin.\n\n +-- |cFFFFFF00v3.10.1 (|cFFFFCC00Feb 19, 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 the 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 Player Details window now closes with right click on any bar.\n\n|cFFFFFF00-|r Fixed Nature's Vigil cooldown.\n\n - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.10.0 (|cFFFFCC00Feb 17, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several improvements on Encounter Details plugin.\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.\n\n|cFFFFFF00-|r Improvements on Bookmark panel.\n\n|cFFFFFF00-|r Improvements on spec icons with transparency.\n\n|cFFFFFF00-|r Created custom spell for Living Bomb explosion.\n\n|cFFFFFF00-|r Fixed statusbar textures and mini displays.\n\n|cFFFFFF00-|r Fixed an issue with title bar buttons when toggling the titlebar anchor from bottom to top position.\n\n|cFFFFFF00-|r Fixed an issue with title bar text when toggling the statusbar position from bottom to top.\n\n|cFFFFFF00-|r Fixed yet another bug with avoidance tab on player detail window.\n\n|cFFFFFF00-|r Fixed the window ungroup button (above the resize one).\n\n|cFFFFFF00v3.8.13 (|cFFFFCC00Jan 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r RaidCheck (plugin): added an option to be able to use the report panel.\n\n|cFFFFFF00-|r You Are Not Prepared (plugin): added Auto Close the window, can be disabled through its options panel.\n\n|cFFFFFF00-|r Vanguard (plugin): Added Options Panel.\n\n|cFFFFFF00-|r Details! is now using 'LibWindow-1.1' to save and restore the positioning of the windows, bug might appear, please report if something weird happen.\n\n|cFFFFFF00-|r Improved specialization detection in order to try detect spec changes.\n\n|cFFFFFF00-|r Added options to change the brackets and the separator for dps/percent block.\n\n|cFFFFFF00-|r Added options for show (or hide) totals, dps and percent amount.\n\n|cFFFFFF00-|r Added Segments shortcut menu pressing Shift + Right click.\n\n|cFFFFFF00-|r Fixed positioning after reopen a window previously closed on last logon.\n\n|cFFFFFF00-|r Fixed enemies display where sometimes the bars were black instead of red.\n\n|cFFFFFF00-|r Fixed few places where spec icons wasn't being used on.\n\n|cFFFFFF00-|r Fixed avoidance panel on Player Details Window where sometimes was giving errors.\n\n|cFFFFFF00-|r Fixed priest shadow and holy detection.\n\n|cFFFFFF00-|r Fixed blood and unholy spec icons.\n\n|cFFFFFF00-|r Fixed an issue with 'Always Show me' feature where it was showing the player on Enemies display.\n\n|cFFFFFF00v3.8.1 (|cFFFFCC00Jan 17, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin Vanguard: got full rewrite and now it is more easy to use.\n\n|cFFFFFF00-|r Plugin TimeAttack: fixed problem where sometimes required a reload to start a new time.\n\n|cFFFFFF00-|r Plugin Damage the Game!: fixed a problem where sometimes the time didn't started after level 2.\n\n|cFFFFFF00-|r Added specialization icons.\n\n|cFFFFFF00-|r Fixed Auto-Hide where it wasn't hiding the wallpaper of the window.\n\n|cFFFFFF00-|r Added 'Editing Group' check box on option panel, when enabled, settings changed also are modified on all windows in the group.\n\n|cFFFFFF00-|r Changing window's skin, doesn't change any more settings not related with appearance, for example, Auto-Hide, Switches.\n\n|cFFFFFF00-|r Custom display 'Health Potion & Stone' now also track Healing Tonic.\n\n|cFFFFFF00-|r Custom display 'Damage Taken by Spell' now tracks more spells and also melee hits.\n\n|cFFFFFF00-|r Menus now uses 'Friz Quadrata TT' font as default, also added an option to change it on options panel -> miscellaneous.\n\n|cFFFFFF00-|r 'Switch to Current' feature now switches all windows which have this option enabled.\n\n|cFFFFFF00-|r The message telling to use '/details reinstall' now only shows if a problem happen during the addon load process.\n\n|cFFFFFF00-|r Segments Saved option now can be set to 25, up from 5.\n\n|cFFFFFF00-|r Attempt to fix the bug with the monk spell 'Storm, Earth, and Fire'.\n\n|cFFFFFF00-|r Fixed 'Icon Pick' panel.\n\n|cFFFFFF00-|r Fixed bug when reporting friendly fire through player detail window.\n\n|cFFFFFF00-|r Fixed bug with report window where sometimes it was reporting on a wrong channel.\n\n|cFFFFFF00v3.7.1 (|cFFFFCC00Jan 08, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin 'Damage Rank': is now called 'Damage, the Game!' and had its levels adjusted for WoD.\n\n|cFFFFFF00-|r Plugin 'Tiny Threat': fixed player name where it was showing the realm name too.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed frame details (clicking on a bar) shown behind the Vanguard panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed a problem when clicking with right button wasn't opening the bookmark panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': incoming heals now count shield amount on the player too.\n\n|cFFFFFF00-|r Plugin 'Vanguard' Known Bug: incoming damage and melee vs avoidance seems to be inaccurate by now, we need more time to study and fix it.\n\n|cFFFFFF00-|r Added Twins Ogron's Charge as custom spells, one for the charge by him self and other for the copies (mythic only).\n\n|cFFFFFF00-|r Added option panel for Raid Check plugin.\n\n|cFFFFFF00-|r Added key bindings for open a window, close a window and select a bookmark.\n\n|cFFFFFF00-|r Added 'CTRL + RightClick' closes a window.\n\n|cFFFFFF00-|r Fixed wallpaper transparency after releasing the window from a stretch.|cFFFFFF00-|r Fixed few issues when using class text colors.\n\n|cFFFFFF00-|r Fixed characters name outside instances, now it replaces the realm name with a * and show the complete name on tooltip.\n\n|cFFFFFF00-|r Fixed damage mitigation on damage taken, this affects only specific classes like monk tank.\n\n|cFFFFFF00-|r Fixed auto erase poping up when the player enters on its garrison.\n\n|cFFFFFF00-|r Fixed combat on garrison training dummies which was being marked as Trash Segment." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.10.1 (|cFFFFCC00Feb 19, 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 the 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 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.\n\n|cFFFFFF00-|r Improvements on Bookmark panel.\n\n|cFFFFFF00-|r Improvements on spec icons with transparency.\n\n|cFFFFFF00-|r Created custom spell for Living Bomb explosion.\n\n|cFFFFFF00-|r Fixed statusbar textures and mini displays.\n\n|cFFFFFF00-|r Fixed an issue with title bar buttons when toggling the titlebar anchor from bottom to top position.\n\n|cFFFFFF00-|r Fixed an issue with title bar text when toggling the statusbar position from bottom to top.\n\n|cFFFFFF00-|r Fixed yet another bug with avoidance tab on player detail window.\n\n|cFFFFFF00-|r Fixed the window ungroup button (above the resize one).\n\n|cFFFFFF00v3.8.13 (|cFFFFCC00Jan 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r RaidCheck (plugin): added an option to be able to use the report panel.\n\n|cFFFFFF00-|r You Are Not Prepared (plugin): added Auto Close the window, can be disabled through its options panel.\n\n|cFFFFFF00-|r Vanguard (plugin): Added Options Panel.\n\n|cFFFFFF00-|r Details! is now using 'LibWindow-1.1' to save and restore the positioning of the windows, bug might appear, please report if something weird happen.\n\n|cFFFFFF00-|r Improved specialization detection in order to try detect spec changes.\n\n|cFFFFFF00-|r Added options to change the brackets and the separator for dps/percent block.\n\n|cFFFFFF00-|r Added options for show (or hide) totals, dps and percent amount.\n\n|cFFFFFF00-|r Added Segments shortcut menu pressing Shift + Right click.\n\n|cFFFFFF00-|r Fixed positioning after reopen a window previously closed on last logon.\n\n|cFFFFFF00-|r Fixed enemies display where sometimes the bars were black instead of red.\n\n|cFFFFFF00-|r Fixed few places where spec icons wasn't being used on.\n\n|cFFFFFF00-|r Fixed avoidance panel on Player Details Window where sometimes was giving errors.\n\n|cFFFFFF00-|r Fixed priest shadow and holy detection.\n\n|cFFFFFF00-|r Fixed blood and unholy spec icons.\n\n|cFFFFFF00-|r Fixed an issue with 'Always Show me' feature where it was showing the player on Enemies display.\n\n|cFFFFFF00v3.8.1 (|cFFFFCC00Jan 17, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin Vanguard: got full rewrite and now it is more easy to use.\n\n|cFFFFFF00-|r Plugin TimeAttack: fixed problem where sometimes required a reload to start a new time.\n\n|cFFFFFF00-|r Plugin Damage the Game!: fixed a problem where sometimes the time didn't started after level 2.\n\n|cFFFFFF00-|r Added specialization icons.\n\n|cFFFFFF00-|r Fixed Auto-Hide where it wasn't hiding the wallpaper of the window.\n\n|cFFFFFF00-|r Added 'Editing Group' check box on option panel, when enabled, settings changed also are modified on all windows in the group.\n\n|cFFFFFF00-|r Changing window's skin, doesn't change any more settings not related with appearance, for example, Auto-Hide, Switches.\n\n|cFFFFFF00-|r Custom display 'Health Potion & Stone' now also track Healing Tonic.\n\n|cFFFFFF00-|r Custom display 'Damage Taken by Spell' now tracks more spells and also melee hits.\n\n|cFFFFFF00-|r Menus now uses 'Friz Quadrata TT' font as default, also added an option to change it on options panel -> miscellaneous.\n\n|cFFFFFF00-|r 'Switch to Current' feature now switches all windows which have this option enabled.\n\n|cFFFFFF00-|r The message telling to use '/details reinstall' now only shows if a problem happen during the addon load process.\n\n|cFFFFFF00-|r Segments Saved option now can be set to 25, up from 5.\n\n|cFFFFFF00-|r Attempt to fix the bug with the monk spell 'Storm, Earth, and Fire'.\n\n|cFFFFFF00-|r Fixed 'Icon Pick' panel.\n\n|cFFFFFF00-|r Fixed bug when reporting friendly fire through player detail window.\n\n|cFFFFFF00-|r Fixed bug with report window where sometimes it was reporting on a wrong channel.\n\n|cFFFFFF00v3.7.1 (|cFFFFCC00Jan 08, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin 'Damage Rank': is now called 'Damage, the Game!' and had its levels adjusted for WoD.\n\n|cFFFFFF00-|r Plugin 'Tiny Threat': fixed player name where it was showing the realm name too.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed frame details (clicking on a bar) shown behind the Vanguard panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed a problem when clicking with right button wasn't opening the bookmark panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': incoming heals now count shield amount on the player too.\n\n|cFFFFFF00-|r Plugin 'Vanguard' Known Bug: incoming damage and melee vs avoidance seems to be inaccurate by now, we need more time to study and fix it.\n\n|cFFFFFF00-|r Added Twins Ogron's Charge as custom spells, one for the charge by him self and other for the copies (mythic only).\n\n|cFFFFFF00-|r Added option panel for Raid Check plugin.\n\n|cFFFFFF00-|r Added key bindings for open a window, close a window and select a bookmark." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/core/control.lua b/core/control.lua index b135c835..8336cb4f 100644 --- a/core/control.lua +++ b/core/control.lua @@ -331,7 +331,7 @@ _detalhes:InstanceCall (_detalhes.CheckPsUpdate) - _detalhes:SendEvent ("COMBAT_PLAYER_ENTER", nil, _detalhes.tabela_vigente) + _detalhes:SendEvent ("COMBAT_PLAYER_ENTER", nil, _detalhes.tabela_vigente, _detalhes.encounter_table and _detalhes.encounter_table.id) _detalhes:CheckSwitchToCurrent() end diff --git a/functions/classes.lua b/functions/classes.lua index b326a3b0..fd972604 100644 --- a/functions/classes.lua +++ b/functions/classes.lua @@ -99,7 +99,10 @@ do CONTAINER_MISCTARGET_CLASS = 10, CONTAINER_ENEMYDEBUFFTARGET_CLASS = 11 } - + + function _detalhes:name (actor) + return self.nome or actor.nome + end function _detalhes:Name (actor) return self.nome or actor.nome end diff --git a/functions/events.lua b/functions/events.lua index e0c1e64a..fc107213 100644 --- a/functions/events.lua +++ b/functions/events.lua @@ -220,15 +220,15 @@ local common_events = { elseif (not object) then for _, PluginObject in ipairs (_detalhes.RegistredEvents[event]) do - if (PluginObject.__eventtable) then + if (PluginObject.__eventtable) then --if passed a function to callback if (PluginObject [1].Enabled and PluginObject [1].__enabled) then if (type (PluginObject [2]) == "function") then PluginObject [2] (event, ...) else - PluginObject [1] [PluginObject [2]] (event, ...) + PluginObject [1] [PluginObject [2]] (PluginObject, event, ...) end end - else + else --if no function (only registred the event) sent the event to OnDetailsEvent if (PluginObject.Enabled and PluginObject.__enabled) then PluginObject:OnDetailsEvent (event, ...) end diff --git a/functions/link.lua b/functions/link.lua index dcf8ec14..3e5748df 100644 --- a/functions/link.lua +++ b/functions/link.lua @@ -188,7 +188,67 @@ ["finish"] = {}, } - function _detalhes:CreateWeakAura (spellid, name, icon_texture, glow, sound) + local debuff_prototype = { + ["cooldown"] = true, + ["trigger"] = { + ["spellId"] = "0", + ["unit"] = "", + ["spellIds"] = {}, + ["debuffType"] = "HARMFUL", + }, + } + local buff_prototype = { + ["cooldown"] = true, + ["trigger"] = { + ["spellId"] = "0", + ["unit"] = "", + ["spellIds"] = {}, + ["debuffType"] = "HELPFUL", + }, + } + local cast_prototype = { + ["trigger"] = { + ["type"] = "event", + ["spellId"] = "0", + ["subeventSuffix"] = "_CAST_SUCCESS", + ["unevent"] = "timed", + ["duration"] = "4", + ["event"] = "Combat Log", + ["subeventPrefix"] = "SPELL", + ["use_spellId"] = true, + } + } + + local stack_prototype = { + ["trigger"] = { + ["countOperator"] = ">=", + ["count"] = "0", + ["useCount"] = true, + }, + } + + local sound_prototype = { + ["actions"] = { + ["start"] = { + ["do_sound"] = true, + ["sound"] = "Interface\\Quiet.ogg", + ["sound_channel"] = "Master", + }, + }, + } + + local chat_prototype = { + ["actions"] = { + ["start"] = { + ["message"] = "", + ["message_type"] = "SAY", + ["do_message"] = true, + }, + }, + } + + function _detalhes:CreateWeakAura (spellid, name, icon_texture, target, stacksize, sound, chat) + if (not WeakAuras or not WeakAurasSaved) then return end @@ -202,20 +262,105 @@ icon.id = name icon.displayIcon = icon_texture - icon.trigger.spellId = spellid + + if (target) then + if (target == 1) then --Debuff on Player + local add = _detalhes.table.copy ({}, debuff_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellIds[1] = spellid + add.trigger.unit = "player" + _detalhes.table.deploy (icon, add) + + elseif (target == 2) then --Debuff on Target + local add = _detalhes.table.copy ({}, debuff_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellIds[1] = spellid + add.trigger.unit = "target" + _detalhes.table.deploy (icon, add) + + elseif (target == 3) then --Debuff on Focus + local add = _detalhes.table.copy ({}, debuff_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellIds[1] = spellid + add.trigger.unit = "focus" + _detalhes.table.deploy (icon, add) + + elseif (target == 11) then --Buff on Player + local add = _detalhes.table.copy ({}, buff_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellIds[1] = spellid + add.trigger.unit = "player" + _detalhes.table.deploy (icon, add) + + elseif (target == 12) then --Buff on Target + local add = _detalhes.table.copy ({}, buff_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellIds[1] = spellid + add.trigger.unit = "target" + _detalhes.table.deploy (icon, add) + + elseif (target == 13) then --Buff on Focus + local add = _detalhes.table.copy ({}, buff_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellIds[1] = spellid + add.trigger.unit = "focus" + _detalhes.table.deploy (icon, add) + + elseif (target == 21) then --Spell Cast Started + local add = _detalhes.table.copy ({}, cast_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.subeventSuffix = "_CAST_START" + _detalhes.table.deploy (icon, add) + + elseif (target == 22) then --Spell Cast Successful + local add = _detalhes.table.copy ({}, cast_prototype) + add.trigger.spellId = tostring (spellid) + _detalhes.table.deploy (icon, add) + end + else + icon.trigger.spellId = tostring (spellid) + tinsert (icon.trigger.spellIds, spellid) + end + + if (stacksize and stacksize >= 1) then + stacksize = floor (stacksize) + local add = _detalhes.table.copy ({}, stack_prototype) + add.trigger.count = tostring (stacksize) + _detalhes.table.deploy (icon, add) + end - tinsert (icon.trigger.spellIds, spellid) + if (sound and sound ~= "" and sound ~= [[Interface\Quiet.ogg]]) then + local add = _detalhes.table.copy ({}, sound_prototype) + add.actions.start.sound = sound + _detalhes.table.deploy (icon, add) + end + + if (chat and chat ~= "") then + local add = _detalhes.table.copy ({}, sound_prototype) + add.actions.start.message = chat + _detalhes.table.deploy (icon, add) + end + + if (WeakAurasSaved.displays [icon.id]) then + -- already exists + for i = 2, 100 do + if (not WeakAurasSaved.displays [icon.id .. " (" .. i .. ")"]) then + icon.id = icon.id .. " (" .. i .. ")" + break + end + end + end + + tinsert (WeakAurasSaved.displays ["Details! Aura Group"].controlledChildren, icon.id) WeakAuras.Add (icon) - tinsert (WeakAurasSaved.displays ["Details! Aura Group"].controlledChildren, name) - local options_frame = WeakAuras.OptionsFrame and WeakAuras.OptionsFrame() if (options_frame and options_frame:IsShown()) then - WeakAuras.ToggleOptions() - WeakAuras.ToggleOptions() + --WeakAuras.ToggleOptions() + --WeakAuras.ToggleOptions() else - WeakAuras.OpenOptions() + --WeakAuras.OpenOptions() end end @@ -224,7 +369,7 @@ if (not DetailsAuraPanel) then local f = CreateFrame ("frame", "DetailsAuraPanel", UIParent, "ButtonFrameTemplate") - f:SetSize (300, 250) + f:SetSize (300, 350) f:SetPoint ("center", UIParent, "center") f:SetFrameStrata ("HIGH") f:SetToplevel (true) @@ -257,10 +402,15 @@ --aura name local name_label = fw:CreateLabel (f, "Name: ", nil, nil, "GameFontNormal") - local name_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20) + local name_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraName", "$parentAuraName") name_textentry:SetPoint ("left", name_label, "right", 2, 0) f.name = name_textentry + --spellid + local auraid_label = fw:CreateLabel (f, "Spell Id: ", nil, nil, "GameFontNormal") + local auraid_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraSpellId", "$parentAuraSpellId") + auraid_textentry:SetPoint ("left", auraid_label, "right", 2, 0) + --aura icon local icon_label = fw:CreateLabel (f, "Icon: ", nil, nil, "GameFontNormal") local icon_button_func = function (texture) @@ -275,13 +425,86 @@ f.icon = icon_button_icon + --target + local aura_on_icon = [[Interface\Buttons\UI-GroupLoot-DE-Down]] + local aura_on_table = { + {label = "Debuff on You", value = 1, icon = aura_on_icon}, + {label = "Debuff on Target", value = 2, icon = aura_on_icon}, + {label = "Debuff on Focus", value = 3, icon = aura_on_icon}, + + {label = "Buff on You", value = 11, icon = aura_on_icon}, + {label = "Buff on Target", value = 12, icon = aura_on_icon}, + {label = "Buff on Focus", value = 13, icon = aura_on_icon}, + + {label = "Spell Cast Started", value = 21, icon = aura_on_icon}, + {label = "Spell Cast successful", value = 22, icon = aura_on_icon}, + } + local aura_on_options = function() + return aura_on_table + end + local aura_on = fw:CreateDropDown (f, aura_on_options, 1, 150, 20, "AuraOnDropdown", "$parentAuraOnDropdown") + local aura_on_label = fw:CreateLabel (f, "Target: ", nil, nil, "GameFontNormal") + aura_on:SetPoint ("left", aura_on_label, "right", 2, 0) + + --stack + local stack_slider = fw:NewSlider (f, f, "$parentStackSlider", "StackSlider", 150, 20, 0, 30, 1, 0) + local stack_label = fw:CreateLabel (f, "Stack Size: ", nil, nil, "GameFontNormal") + stack_slider:SetPoint ("left", stack_label, "right", 2, 0) + + --sound effect + local play_sound = function (self, fixedParam, file) + print (file) + PlaySoundFile (file, "Master") + end + local sound_options = function() + local t = {{label = "No Sound", value = "", icon = [[Interface\Buttons\UI-GuildButton-MOTD-Disabled]]}} + for name, soundFile in pairs (LibStub:GetLibrary("LibSharedMedia-3.0"):HashTable ("sound")) do + tinsert (t, {label = name, value = soundFile, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], onclick = play_sound}) + end + return t + end + local sound_effect = fw:CreateDropDown (f, sound_options, 1, 150, 20, "SoundEffectDropdown", "$parentSoundEffectDropdown") + local sound_effect_label = fw:CreateLabel (f, "Play Sound: ", nil, nil, "GameFontNormal") + sound_effect:SetPoint ("left", sound_effect_label, "right", 2, 0) + + --say something + local say_something_label = fw:CreateLabel (f, "Chat Message: ", nil, nil, "GameFontNormal") + local say_something = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "SaySomething", "$parentSaySomething") + say_something:SetPoint ("left", say_something_label, "right", 2, 0) + + --aura addon + local addon_options = function() + local t = {} + if (WeakAuras) then + tinsert (t, {label = "Weak Auras 2", value = "WA", icon = [[Interface\AddOns\WeakAuras\icon]]}) + end + return t + end + local aura_addon = fw:CreateDropDown (f, addon_options, 1, 150, 20, "AuraAddonDropdown", "$parentAuraAddonDropdown") + local aura_addon_label = fw:CreateLabel (f, "Addon: ", nil, nil, "GameFontNormal") + aura_addon:SetPoint ("left", aura_addon_label, "right", 2, 0) + --create local create_func = function() - _detalhes:CreateWeakAura (f.spellid, f.name.text, DetailsAuraPanel.icon.texture, nil, nil) + local name = f.AuraName.text + local spellid = f.AuraSpellId.text + local icon = f.IconButton.icon.texture + local target = f.AuraOnDropdown.value + local stacksize = f.StackSlider.value + local sound = f.SoundEffectDropdown.value + local chat = f.SaySomething.text + local addon = f.AuraAddonDropdown.value + + if (addon == "WA") then + _detalhes:CreateWeakAura (spellid, name, icon, target, stacksize, sound, chat) + else + _detalhes:Msg ("No Aura Addon selected. Addons currently supported: WeakAuras 2.") + end f:Hide() end + local create_button = fw:CreateButton (f, create_func, 106, 16, "Create Aura") create_button:InstallCustomTexture() @@ -292,19 +515,26 @@ cancel_button:SetIcon ([[Interface\Buttons\UI-GroupLoot-Pass-Down]], nil, nil, nil, {0.125, 0.875, 0.125, 0.875}, nil, 4, 2) local x_start = 20 - local y_start = 20 + local y_start = 21 name_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*1) + (50)) * -1) - icon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*2) + (50)) * -1) + auraid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*2) + (50)) * -1) + icon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*3) + (50)) * -1) + aura_on_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*4) + (50)) * -1) + stack_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*5) + (50)) * -1) + sound_effect_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*6) + (50)) * -1) + say_something_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*7) + (50)) * -1) + aura_addon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*10) + (50)) * -1) - create_button:SetPoint ("topleft", f, "topleft", x_start, ((y_start*4) + (50)) * -1) - cancel_button:SetPoint ("left", create_button, "right", 20, 0) + create_button:SetPoint ("topleft", f, "topleft", x_start, ((y_start*12) + (50)) * -1) + cancel_button:SetPoint ("topright", f, "topright", x_start*-1, ((y_start*12) + (50)) * -1) end DetailsAuraPanel.spellid = spellid DetailsAuraPanel.name.text = spellname + DetailsAuraPanel.AuraSpellId.text = tostring (spellid) DetailsAuraPanel.icon.texture = spellicon DetailsAuraPanel:Show() @@ -426,4 +656,71 @@ BigWigs.RegisterMessage (_detalhes, "BigWigs_Message") end end + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> details auras + + local aura_prototype = { + name = "", + type = "DEBUFF", + target = "player", + boss = "0", + icon = "", + stack = 0, + sound = "", + sound_channel = "", + chat = "", + chat_where = "SAY", + chat_extra = "", + } + + function _detalhes:CreateDetailsAura (name, auratype, target, boss, icon, stack, sound, chat) + + local aura_container = _detalhes.details_auras + + --already exists + if (aura_container [name]) then + _detalhes:Msg ("Aura name already exists.") + return + end + + --create the new aura + local new_aura = _detalhes.table.copy ({}, aura_prototype) + new_aura.type = auratype or new_aura.type + new_aura.target = auratype or new_aura.target + new_aura.boss = boss or new_aura.boss + new_aura.icon = icon or new_aura.icon + new_aura.stack = math.max (stack or 0, new_aura.stack) + new_aura.sound = sound or new_aura.sound + new_aura.chat = chat or new_aura.chat + + _detalhes.details_auras [name] = new_aura + + return new_aura + end + + function _detalhes:CreateAuraListener() + + local listener = _detalhes:CreateEventListener() + + function listener:on_enter_combat (event, combat, encounterId) + + end + + function listener:on_leave_combat (event, combat) + + end + + listener:RegisterEvent ("COMBAT_PLAYER_ENTER", "on_enter_combat") + listener:RegisterEvent ("COMBAT_PLAYER_LEAVE", "on_leave_combat") + + end + + + + + + + + \ No newline at end of file diff --git a/functions/profiles.lua b/functions/profiles.lua index 6a260364..0a849179 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -1048,7 +1048,9 @@ local default_global_data = { ["Battleground40"] = {enabled = false, update_speed = 1, use_row_animations = false, damage = true, heal = true, aura = true, energy = false, miscdata = true}, ["Arena"] = {enabled = false, update_speed = 1, use_row_animations = false, damage = true, heal = true, aura = true, energy = false, miscdata = true}, ["Dungeon"] = {enabled = false, update_speed = 1, use_row_animations = false, damage = true, heal = true, aura = true, energy = false, miscdata = true}, - } + }, + --> auras + details_auras = {}, } _detalhes.default_global_data = default_global_data diff --git a/functions/spells.lua b/functions/spells.lua index 34b46ccd..5f3afdd3 100644 --- a/functions/spells.lua +++ b/functions/spells.lua @@ -1565,7 +1565,8 @@ do --["DRUID"] = {}, [740] = {480, 8, 0}, --Tranquility [22842] = {0, 0, 1}, --Frenzied Regeneration - [124988] = {90, 30, 0}, --Nature's Vigil + --[124988] = {90, 30, 0}, --Nature's Vigil + [124974] = {90, 30, 0}, --Nature's Vigil --["HUNTER"] = {}, [172106] = {180, 6}, -- "Aspect of the Fox" diff --git a/gumps/janela_info.lua b/gumps/janela_info.lua index 9dc7ae69..861dec3e 100644 --- a/gumps/janela_info.lua +++ b/gumps/janela_info.lua @@ -3363,7 +3363,7 @@ local row_on_leave = function (self) end end -local row_on_mousedown = function (self) +local row_on_mousedown = function (self, button) if (self.fading_in) then return end @@ -3373,18 +3373,21 @@ local row_on_mousedown = function (self) self.x = _math_floor (x) self.y = _math_floor (y) - if ((not info.isLocked) or (info.isLocked == 0)) then + if (button == "RightButton" and not info.isMoving) then + _detalhes:FechaJanelaInfo() + + elseif (not info.isMoving and button == "LeftButton" and not self.isDetalhe) then info:StartMoving() info.isMoving = true - end + end end -local row_on_mouseup = function (self) +local row_on_mouseup = function (self, button) if (self.fading_in) then return end - if (info.isMoving) then + if (info.isMoving and button == "LeftButton" and not self.isDetalhe) then info:StopMovingOrSizing() info.isMoving = false end @@ -3403,12 +3406,12 @@ local row_on_mouseup = function (self) barra_antiga.textura:SetStatusBarColor (1, 1, 1, 1) --> volta a textura normal barra_antiga.on_focus = false --> não esta mais no foco - --> CLICOU NA MESMA BARRA + --> clicou na mesma barra if (barra_antiga == self) then --> info.mostrando_mouse_over = true return - --> CLICOU EM OUTRA BARRA + --> clicou em outra barra else --> clicou em outra barra e trocou o foco barra_antiga:SetAlpha (.9) --> volta a alfa antiga @@ -3425,8 +3428,7 @@ local row_on_mouseup = function (self) end end - --> NÃO TINHA BARRAS PRECIONADAS - -- info.mostrando = self + --> nao tinha barras pressionadas info.mostrando_mouse_over = false self:SetAlpha (1) self.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1) @@ -3730,11 +3732,11 @@ function gump:CriaNovaBarraInfo3 (instancia, index) local janela = info.container_detalhes local esta_barra = CreateFrame ("Button", "Details_infobox3_bar_"..index, janela) - esta_barra:SetWidth (220) --> tamanho da barra de acordo com o tamanho da janela - esta_barra:SetHeight (16) --> altura determinada pela instância + esta_barra:SetWidth (220) + esta_barra:SetHeight (16) - local y = (index-1)*17 --> 17 é a altura da barra - y = y*-1 --> baixo + local y = (index-1) * 17 + y = y*-1 esta_barra:SetPoint ("LEFT", janela, "LEFT", x_start, 0) esta_barra:SetPoint ("RIGHT", janela, "RIGHT", 59, 0) @@ -3754,7 +3756,7 @@ function gump:CriaNovaBarraInfo3 (instancia, index) esta_barra.icone:SetAlpha (1) esta_barra.isDetalhe = true - + SetBarraScripts (esta_barra, instancia, index) info.barras3 [index] = esta_barra --> barra adicionada diff --git a/images/TrainerGossipIcon.tga b/images/TrainerGossipIcon.tga deleted file mode 100644 index 098ac927..00000000 Binary files a/images/TrainerGossipIcon.tga and /dev/null differ diff --git a/images/bar_down_left_snap.tga b/images/bar_down_left_snap.tga deleted file mode 100644 index 3ce5a458..00000000 Binary files a/images/bar_down_left_snap.tga and /dev/null differ diff --git a/images/bar_topdown_center.tga b/images/bar_topdown_center.tga deleted file mode 100644 index e34d1f96..00000000 Binary files a/images/bar_topdown_center.tga and /dev/null differ diff --git a/images/consolidate_frame.tga b/images/consolidate_frame.tga deleted file mode 100644 index 932f580c..00000000 Binary files a/images/consolidate_frame.tga and /dev/null differ diff --git a/images/modo_icone.tga b/images/modo_icone.tga deleted file mode 100644 index 476d5205..00000000 Binary files a/images/modo_icone.tga and /dev/null differ diff --git a/images/monster.tga b/images/monster.tga deleted file mode 100644 index 2204e785..00000000 Binary files a/images/monster.tga and /dev/null differ diff --git a/images/reset_button.tga b/images/reset_button.tga deleted file mode 100644 index 597ecc22..00000000 Binary files a/images/reset_button.tga and /dev/null differ diff --git a/images/segmentos_icone.tga b/images/segmentos_icone.tga deleted file mode 100644 index 7d618bdb..00000000 Binary files a/images/segmentos_icone.tga and /dev/null differ diff --git a/images/sword.tga b/images/sword.tga deleted file mode 100644 index 2c73a0de..00000000 Binary files a/images/sword.tga and /dev/null differ diff --git a/plugins/Details_DmgRank/solo_bgtimeattack.tga b/plugins/Details_DmgRank/solo_bgtimeattack.tga deleted file mode 100644 index a8601224..00000000 Binary files a/plugins/Details_DmgRank/solo_bgtimeattack.tga and /dev/null differ diff --git a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua index 34eb49ec..6ca032ae 100644 --- a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua +++ b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua @@ -768,11 +768,9 @@ function EncounterDetails:OpenAndRefresh (_, segment) local frame = EncounterDetailsFrame --alias if (segment) then - --get combat segment, 1 more recently ...25 oldest _combat_object = EncounterDetails:GetCombat (segment) EncounterDetails._segment = segment else - local historico = _detalhes.tabela_historico.tabelas for index, combate in ipairs (historico) do if (combate.is_boss and combate.is_boss.index) then @@ -782,7 +780,6 @@ function EncounterDetails:OpenAndRefresh (_, segment) break end end - end if (not _combat_object) then @@ -825,21 +822,19 @@ function EncounterDetails:OpenAndRefresh (_, segment) boss_id = _combat_object.is_boss.index map_id = _combat_object.is_boss.mapid boss_info = _detalhes:GetBossDetails (_combat_object.is_boss.mapid, _combat_object.is_boss.index) - - --[[ - if (not boss_info) then - if (EncounterDetails.LastSegmentShown) then - _combat_object = EncounterDetails.LastSegmentShown - else - return EncounterDetails:Msg (Loc ["STRING_BOSS_NOT_REGISTRED"]) - end - end - --]] if (EncounterDetailsFrame.ShowType == "graph") then EncounterDetails:BuildDpsGraphic() + elseif (EncounterDetailsFrame.ShowType == "spellsauras") then --refresh spells and auras + local actor = EncounterDetails.build_actor_menu() [1] + actor = actor and actor.value + if (actor) then + _G [EncounterDetailsFrame:GetName() .. "EnemyActorSpellsDropdown"].MyObject:Select (actor) + EncounterDetails.update_enemy_spells (actor) + end + EncounterDetails.update_enemy_spells() end EncounterDetails.LastSegmentShown = _combat_object diff --git a/plugins/Details_EncounterDetails/frames.lua b/plugins/Details_EncounterDetails/frames.lua index 32e5140c..28479045 100644 --- a/plugins/Details_EncounterDetails/frames.lua +++ b/plugins/Details_EncounterDetails/frames.lua @@ -975,9 +975,10 @@ do BossFrame.bg_main = BossFrame:CreateTexture (nil, "BORDER") BossFrame.bg_main:SetPoint ("TOPLEFT", BossFrame, "TOPLEFT", 0, 0) - BossFrame.bg_main:SetWidth (1024) + BossFrame.bg_main:SetWidth (700) BossFrame.bg_main:SetHeight (512) BossFrame.bg_main:SetTexture ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_bg") + BossFrame.bg_main:SetTexCoord (0, 700/1024, 0, 1) BossFrame.bg_main:SetDrawLayer ("BORDER", 3) BossFrame.bg_main:Show() @@ -1033,7 +1034,12 @@ do for _, widget in pairs (BossFrame.EmoteWidgets) do widget:Hide() end - + + --hide spells frames + for _, widget in pairs (BossFrame.EnemySpellsWidgets) do + widget:Hide() + end + BossFrame.ShowType = "main" mode_label.text = "Summary" BossFrame.segmentosDropdown:Enable() @@ -1064,6 +1070,11 @@ do widget:Hide() end + --show spells frames + for _, widget in pairs (BossFrame.EnemySpellsWidgets) do + widget:Show() + end + selected:SetPoint ("center", BossFrame.buttonSwitchSpellsAuras.widget, "center", 0, 1) u:SetAllPoints (BossFrame.buttonSwitchSpellsAuras.widget) @@ -1071,9 +1082,14 @@ do mode_label.text = "Spells and Auras" -- show spells box + local actor = EncounterDetails.build_actor_menu() [1] + actor = actor and actor.value + if (actor) then + _G [BossFrame:GetName() .. "EnemyActorSpellsDropdown"].MyObject:Select (actor) + EncounterDetails.update_enemy_spells (actor) + end - - BossFrame.segmentosDropdown:Disable() + BossFrame.segmentosDropdown:Enable() elseif (to == "emotes") then @@ -1099,6 +1115,11 @@ do for _, widget in pairs (BossFrame.EmoteWidgets) do widget:Show() end + + --hide spells frames + for _, widget in pairs (BossFrame.EnemySpellsWidgets) do + widget:Hide() + end selected:SetPoint ("center", BossFrame.buttonSwitchBossEmotes.widget, "center", 0, 1) u:SetAllPoints (BossFrame.buttonSwitchBossEmotes.widget) @@ -1145,8 +1166,12 @@ do widget:Hide() end + --hide spells frames + for _, widget in pairs (BossFrame.EnemySpellsWidgets) do + widget:Hide() + end + BossFrame.segmentosDropdown:Enable() - --BossFrame.segmentosDropdown:Disable() end end @@ -1208,8 +1233,6 @@ do support_frame:SetBackdropColor (1, 1, 1, 0.3) mode_label = DetailsFrameWork:CreateLabel (support_frame, "Summary", 13, color, "GameFontNormal") - --mode_label:SetPoint ("bottomright", BossFrame, "bottomright", -10, 16) - --mode_label:SetPoint ("left", BossFrame.buttonSwitchBossEmotes.widget, "right", 20, 0) mode_label:SetPoint ("center", support_frame, "center") local left = support_frame:CreateTexture (nil, "overlay") @@ -1268,7 +1291,10 @@ do _detalhes.popup:ShowMe (false); aa:SetBlendMode ("BLEND") end) - -- + +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> ~emotes + local emote_lines = {} local emote_search_table = {} @@ -1334,14 +1360,18 @@ do end end end + BossFrame.EmoteWidgets = {} + local bar_div_emotes = DetailsFrameWork:CreateImage (BossFrame, "Interface\\AddOns\\Details_EncounterDetails\\images\\boss_bg", 4, 240, "artwork", {724/1024, 728/1024, 0, 245/512}) + bar_div_emotes:SetPoint ("TOPLEFT", BossFrame, "TOPLEFT", 244, -74) + bar_div_emotes:Hide() + tinsert (BossFrame.EmoteWidgets, bar_div_emotes) + scrollframe = CreateFrame ("ScrollFrame", "EncounterDetails_EmoteScroll", BossFrame, "FauxScrollFrameTemplate") scrollframe:SetScript ("OnVerticalScroll", function (self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 14, refresh_emotes) end) - scrollframe:SetPoint ("topleft", BossFrame, "topleft", 200, -75) + scrollframe:SetPoint ("topleft", BossFrame, "topleft", 249, -75) scrollframe:SetPoint ("bottomright", BossFrame, "bottomright", -33, 42) - --scrollframe:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16}) - --scrollframe:SetBackdropColor (1, 0, 0, 1) scrollframe.Update = refresh_emotes scrollframe:Hide() -- @@ -1382,9 +1412,7 @@ do end -- remove the left space text = text:gsub ("^%s$", "") - --- |TINTERFACE\\ICONS\\ability_socererking_arcanewrath.blp:20|t You have been branded by |cFFF00000|Hspell:156238|h[Arcane Wrath]|h|r! - + EncounterDetails:SendReportLines ({"Details! Encounter Emote at " .. time, "\"" .. text .. "\""}) end @@ -1507,18 +1535,214 @@ do BossFrame.titulo:SetPoint ("top", BossFrame, "top", 0, -18) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + + BossFrame.EnemySpellsWidgets = {} + --> spells and auras + + -- actor dropdown - local segment = EncounterDetails._segment - local combat = EncounterDetails:GetCombat (segment) + local EnemyActorSpells_label = DetailsFrameWork:CreateLabel (BossFrame, "Enemy Actor:", 11, nil, "GameFontHighlightSmall") + EnemyActorSpells_label:SetPoint ("topleft", BossFrame, "topleft", 25, -85) + + local spell_blocks = {} + local on_focus_gain = function (self) + self:HighlightText() + end + local on_focus_lost = function (self) + self:HighlightText (0, 0) + end - --spell cast by enemy actor + local on_enter_spell = function (self) + + GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT") + GameTooltip:SetSpellByID (self.MyObject._spellid) + GameTooltip:Show() + + end + local on_leave_spell = function (self, capsule) + GameTooltip:Hide() + end - --debuff applied on players + local create_aura_func = function (spellid, _, self) + local name, _, icon = EncounterDetails.getspellinfo (spellid) + EncounterDetails:OpenAuraPanel (spellid, name, self and self.MyObject._icon.texture) + end + for i = 1, 10 do + local anchor_frame = CreateFrame ("frame", "BossFrameSpellAnchor" .. i, BossFrame) + + local icon_button_func = function (texture) + anchor_frame.icon.texture = texture + end + + local spellicon_button = DetailsFrameWork:NewButton (anchor_frame, nil, "$parentIconButton", "IconButton", 20, 20, function() DetailsFrameWork:IconPick (icon_button_func, true) end) + local spellicon = DetailsFrameWork:NewImage (spellicon_button, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon") + spellicon_button:InstallCustomTexture() + + local spellid = DetailsFrameWork:CreateTextEntry (anchor_frame, EncounterDetails.empty_function, 80, 20) + spellid:SetHook ("OnEditFocusGained", on_focus_gain) + spellid:SetHook ("OnEditFocusLost", on_focus_lost) + spellid:SetHook ("OnEnter", on_enter_spell) + spellid:SetHook ("OnLeave", on_leave_spell) + + local spellname = DetailsFrameWork:CreateTextEntry (anchor_frame, EncounterDetails.empty_function, 160, 20) + spellname:SetHook ("OnEditFocusGained", on_focus_gain) + spellname:SetHook ("OnEditFocusLost", on_focus_lost) + spellname:SetHook ("OnEnter", on_enter_spell) + spellname:SetHook ("OnLeave", on_leave_spell) + + spellicon_button:SetPoint ("topleft", BossFrame, "topleft", 255, -65 + (i * 21 * -1)) + spellicon:SetAllPoints() + spellid:SetPoint ("left", spellicon_button, "right", 4, 0) + spellname:SetPoint ("left", spellid, "right", 4, 0) + + local create_aura = DetailsFrameWork:NewButton (anchor_frame, nil, "$parentCreateAuraButton", "AuraButton", 105, 18, create_aura_func, nil, nil, nil, "Create Aura") + create_aura:SetPoint ("left", spellname, "right", 4, 0) + create_aura:InstallCustomTexture() + + anchor_frame.icon = spellicon + anchor_frame.spellid = spellid + anchor_frame.spellname = spellname + anchor_frame.aurabutton = create_aura + anchor_frame.aurabutton._icon = spellicon + + tinsert (spell_blocks, anchor_frame) + tinsert (BossFrame.EnemySpellsWidgets, anchor_frame) + + anchor_frame:Hide() + end + + local last_npc_name + + local update_enemy_spells = function (npc_name) + npc_name = npc_name or last_npc_name + last_npc_name = npc_name + + local combat = EncounterDetails:GetCombat (EncounterDetails._segment) + + if (combat and npc_name) then + + local spell_list = {} + + --damage + local npc = combat (1, npc_name) + if (npc) then + for spellid, spell in pairs (npc.spells._ActorTable) do + if (spellid > 10) then + local name, _, icon = EncounterDetails.getspellinfo (spellid) + tinsert (spell_list, {spellid, name, icon}) + end + end + end + + --heal + local npc = combat (2, npc_name) + if (npc) then + for spellid, spell in pairs (npc.spells._ActorTable) do + if (spellid > 10) then + local name, _, icon = EncounterDetails.getspellinfo (spellid) + tinsert (spell_list, {spellid, name, icon, true}) + end + end + end + + EncounterDetails_SpellAurasScroll.spell_pool = spell_list + EncounterDetails_SpellAurasScroll:Update() + end + end + + local refresh_spellauras = function (self) + + local pool = EncounterDetails_SpellAurasScroll.spell_pool + local offset = FauxScrollFrame_GetOffset (self) + + for bar_index = 1, 10 do + local data = pool [bar_index + offset] + local bar = spell_blocks [bar_index] + + if (data) then + bar:Show() + + bar.icon.texture = data [3] + bar.spellid.text = data [1] + bar.spellname.text = data [2] + + bar.spellid._spellid = data [1] + bar.spellname._spellid = data [1] + + local is_heal = data [4] + if (is_heal) then + bar.spellid:SetBackdropBorderColor (0, 1, 0) + bar.spellname:SetBackdropBorderColor (0, 1, 0) + else + bar.spellid:SetBackdropBorderColor (1, 1, 1) + bar.spellname:SetBackdropBorderColor (1, 1, 1) + end + + bar.aurabutton:SetClickFunction (create_aura_func, data [1]) + + else + bar:Hide() + end + end + + FauxScrollFrame_Update (self, #pool, 10, 20) + + end + + local spell_scrollframe = CreateFrame ("ScrollFrame", "EncounterDetails_SpellAurasScroll", BossFrame, "FauxScrollFrameTemplate") + spell_scrollframe:SetScript ("OnVerticalScroll", function (self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 14, refresh_spellauras) end) + spell_scrollframe:SetPoint ("topleft", BossFrame, "topleft", 200, -75) + spell_scrollframe:SetPoint ("bottomright", BossFrame, "bottomright", -33, 42) + spell_scrollframe.Update = refresh_spellauras + spell_scrollframe:Hide() + + tinsert (BossFrame.EnemySpellsWidgets, spell_scrollframe) + + EncounterDetails.update_enemy_spells = update_enemy_spells + + local on_select_actor_spell = function (self, fixedparam, option) + last_npc_name = option + update_enemy_spells (option) + end + + local build_actor_menu = function() + local t = {} + local combat = EncounterDetails:GetCombat (EncounterDetails._segment) + + if (combat) then + local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE) + for index, character in ipairs (AllDamageCharacters) do + if (character:IsEnemy()) then + tinsert (t, {label = character:name(), value = character:name(), icon = "Interface\\AddOns\\Details_EncounterDetails\\images\\icon", onclick = on_select_actor_spell, iconcolor = "silver"}) + end + end + return t + else + return t + end + end + EncounterDetails.build_actor_menu = build_actor_menu + + local EnemyActorSpells = DetailsFrameWork:NewDropDown (BossFrame, _, "$parentEnemyActorSpellsDropdown", "EnemyActorSpells", 160, 20, build_actor_menu, 1) + EnemyActorSpells:SetPoint ("topleft", EnemyActorSpells_label, "bottomleft", -1, -2) + + EnemyActorSpells:Hide() + EnemyActorSpells_label:Hide() + + local bar_div = DetailsFrameWork:CreateImage (BossFrame, "Interface\\AddOns\\Details_EncounterDetails\\images\\boss_bg", 4, 240, "artwork", {724/1024, 728/1024, 0, 245/512}) + bar_div:SetPoint ("TOPLEFT", BossFrame, "TOPLEFT", 244, -74) + bar_div:Hide() + + tinsert (BossFrame.EnemySpellsWidgets, EnemyActorSpells_label) + tinsert (BossFrame.EnemySpellsWidgets, EnemyActorSpells) + tinsert (BossFrame.EnemySpellsWidgets, bar_div) + + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ local frame = BossFrame diff --git a/plugins/Details_EncounterDetails/images/boss_bg.tga b/plugins/Details_EncounterDetails/images/boss_bg.tga index 857b93b2..a971ce8d 100644 Binary files a/plugins/Details_EncounterDetails/images/boss_bg.tga and b/plugins/Details_EncounterDetails/images/boss_bg.tga differ diff --git a/startup.lua b/startup.lua index 4a80ecc1..00b56bd5 100644 --- a/startup.lua +++ b/startup.lua @@ -453,6 +453,9 @@ function _G._detalhes:Start() --> start announcers _detalhes:StartAnnouncers() + --> start aura + _detalhes:CreateAuraListener() + --> open welcome if (self.is_first_run) then _detalhes:OpenWelcomeWindow()