From 2a03b5af7bc76ccf5cea46a3a1e38befb1bbc580 Mon Sep 17 00:00:00 2001 From: Tercio Date: Tue, 21 Mar 2017 13:17:47 -0300 Subject: [PATCH] - Fixed an issue on dynamic overall data where it wasn't showing DPS. - Fixed an issue with Apply, Save and Cancel buttons when editing a custom display. - Removed the Damage and Healing presets for custom displays, now is only possible create custom displays by scripting them. --- boot.lua | 11 +++++----- classes/classe_custom.lua | 45 +++++++++++++++++++++++++++++++-------- gumps/janela_custom.lua | 41 +++++++++++++++++++++++++++-------- 3 files changed, 74 insertions(+), 23 deletions(-) diff --git a/boot.lua b/boot.lua index 9b7f326f..90ce0eb5 100644 --- a/boot.lua +++ b/boot.lua @@ -3,7 +3,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 3431 + _detalhes.build_counter = 3459 _detalhes.userversion = "v7.1.5." .. _detalhes.build_counter _detalhes.realversion = 116 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" @@ -21,14 +21,15 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v7.1.5.3431.116 (|cFFFFCC00Mar 15th, 2016|r|cFFFFFF00)|r:\n\n -|cFFFFFF00-|r Fixed an issue with bar orientation right to left where fixed bar color isn't working.\n\n -|cFFFFFF00-|r The nickname field now use FrizQuadrataTT font and shall be compatible with Cyrillic.\n\n +|cFFFFFF00v7.1.5.3459.116 (|cFFFFCC00Mar 21th, 2016|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Fixed an issue on dynamic overall data where it wasn't showing DPS.\n\n +|cFFFFFF00-|r Fixed an issue with Apply, Save and Cancel buttons when editing a custom display.\n\n +|cFFFFFF00-|r Removed the Damage and Healing presets for custom displays, now is only possible create custom displays by scripting them.\n\n --]] -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v7.1.5.3431.116 (|cFFFFCC00Mar 15th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with bar orientation right to left where fixed bar color isn't working.\n\n|cFFFFFF00-|r The nickname field now use FrizQuadrataTT font and shall be compatible with Cyrillic.\n\n|cFFFFFF00v7.1.5.3418.116 (|cFFFFCC00Mar 1st, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #167 fix: Light of the Martyr self-damage now does reduce the healing done (following WCL method).\n\n|cFFFFFF00-|r Ticket #169 fix: Damage Prevented is now working for new segments.\n\n|cFFFFFF00-|r Fixed an issue where sometimes BeastMaster's Hati pet wasn't detected correctly.\n\n|cFFFFFF00v7.1.5.3369.116 (|cFFFFCC00Feb 07th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'Dynamic Overall Damage' for mythic dungeons.\n\n|cFFFFFF00-|r Fix for Ticket #168: 'Auto Hide While [Not] Inside Instance is broken'.\n\n|cFFFFFF00-|r The bar truncate frame 'DetailsLeftTextAntiTruncate' is now created on Details! load instead on demand.\n\n|cFFFFFF00v7.1.5.3315.116 (|cFFFFCC00Jan 23th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #162: 'no Monochrome font' available, added an experimental slash command: /run _detalhes:UseOutline ('MONOCHROME').\n\n|cFFFFFF00-|r Ticket #158: 'no elapsed time shown on report to chat', added the elapsed time when reporting a segment.\n\n|cFFFFFF00-|r Ticket #164: 'error when browsing segments', an attempt to fix the problem has been made.\n\n|cFFFFFF00v7.1.5.3305.116 (|cFFFFCC00Jan 15th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Another fix for mythic dungeons overall data reset (thanks Tharai @ Curseforge).\n\n|cFFFFFF00-|r Fix for spec detection on PvP Arenas (thanks Pas06 @ Curseforge).\n\n|cFFFFFF00v7.1.0.3276.115 (|cFFFFCC00Jan 08th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the overall data not reseting when starting a new mythic+ dungeon.\n\n|cFFFFFF00v7.1.0.3266.115 (|cFFFFCC00Dec 29th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data not updating correctly at the end of the combat.\n\n|cFFFFFF00-|r Added a tutorial line on the window when the user access overall data.\n\n|cFFFFFF00v7.1.0.3236.115 (|cFFFFCC00Dec 19th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Integration with BigWigs should be working okay now.\n\n|cFFFFFF00v7.1.0.3231.115 (|cFFFFCC00Dec 15th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Disabled the link with BigWigs to avoid the 'RegisterMessage' error on every login.\n\n|cFFFFFF00v7.1.0.3229.115 (|cFFFFCC00Dec 09th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r When a window is locked, resize grips shouldn't be enabled messing with bar mouse over.\n\n|cFFFFFF00v7.0.3.3222.115 (|cFFFFCC00November 28th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Unstable Affliction to common spells with the same name.\n\n|cFFFFFF00-|r Fixed few issues with built-in plugins.\n\n|cFFFFFF00v7.0.3.3202.115 (|cFFFFCC00November 08th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Weakauras creator from the Encounter Details plugin and '/details forge' shall work correctly now with Trials of Valor.\n\n|cFFFFFF00-|r Raid history should now be recording your Trials of Valor kills.\n\n|cFFFFFF00-|r Added Trials of Valor raid info, good luck and have fun!.\n\n|cFFFFFF00v7.0.3.3201.115 (|cFFFFCC00November 04th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for Paladin holy icon.\n\n|cFFFFFF00-|r Fix for Rogue outlaw icon.\n\n|cFFFFFF00-|r Fixed misc displays with bar sorted by ascending order.\n\n|cFFFFFF00-|r Fix for '/details show' command while the window is on auto hide.\n\n|cFFFFFF00v7.0.3.3114.115 (|cFFFFCC00October 26th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): tooltip tutorial is now clamped to screen and its close button should be visible.\n\n|cFFFFFF00-|r Raid Check (plugin): now also works on dungeons.\n\n|cFFFFFF00-|r Added Potion of the Prolongued Power to the tracker.\n\n|cFFFFFF00v7.1.0.3097.115 (|cFFFFCC00October 25th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r renamed 'report history' to 'latest reports'.\n\n|cFFFFFF00-|r attempt to make all Details! users on the party or raid to track rogue's akaari's soul.\n\n|cFFFFFF00v7.0.3.2994 (|cFFFFCC00September 25th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r |cFF0088EE[Devilsaur Shock-Baton]|r added to custom spells, its effect should be displayed: 'Devilsaur Shock Leash (trinket)'.\n\n|cFFFFFF00-|r More fixes for dungeon trash being tag as a dungeon boss.\n\n|cFFFFFF00-|r Fixed the item level calculation when the player is using a main hand and offhand artifact.\n\n|cFFFFFF00-|r Added option to auto erase world segments (outdoors, e.g. doing world quests).\n\n|cFFFFFF00-|r Fixed the avoidance tab on the player detail window for Demon Hunters.\n\n|cFFFFFF00-|r Added the tag {target} on custom text for the interrupt announcer.\n\n|cFFFFFF00-|r Merging Demon Hunter 'Fury of the Illidari' spell when the consolidade option is enabled under Spell Customization.\n\n|cFFFFFF00v7.0.3.2961 (|cFFFFCC00September 17th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for consolidade spells with the same name (isn't working with all spells yet).\nThe option is under Spell Customization on options panel.\n\n|cFFFFFF00v7.0.3.2955 (|cFFFFCC00September 14th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Built-in custom displays has been updated to Legion.\n\n|cFFFFFF00-|r Raid Check (plugin) now checks for Legion food, rune and flash.\n\n|cFFFFFF00-|r removed the config button from the Player Details Window.\n\n|cFFFFFF00-|r the alert for this news window won't popup for each characters after the player opened it once for the update.\n\n|cFFFFFF00-|r added tooltip information for the two new arenas added in Legion.\n\n|cFFFFFF00v7.0.3.2941 (|cFFFFCC00September 13th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r fix for total bar where sometimes it desappears.\n\n|cFFFFFF00-|r fix for overall data reseting its elapsed time making dps and hps goes to millions.\n\n|cFFFFFF00-|r fix for overall not reseting when entering in a new dungeon.\n\n|cFFFFFF00-|r fix for trash cleanup on dungeons.\n\n|cFFFFFF00-|r fix for item level detection on dungeons.\n\n|cFFFFFF00-|r fix for artifact offhand always being counter as 750 item level.\n\n|cFFFFFF00-|r fix for segments menu sometimes not opening at all after a dungeon boss.\n\n|cFFFFFF00-|r fix for segments menu not showing the boss icon above the sub panel.\n\n|cFFFFFF00-|r fix for the top left corner of the window be ignoring the 'hide icon' setting at a /reload.\n\n|cFFFFFF00v7.0.3.2927 (|cFFFFCC00September 3rd, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Attempt to fix an issue with total bar hidding the latest bar shown.\n\n|cFFFFFF00v7.0.3.2899 (|cFFFFCC00August 26, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a bug on tiny threat where it won't used the font set after a /reload.\n\n|cFFFFFF00-|r Bar spacing can now be set to -2 to 10 (from 0 to 10).\n\n|cFFFFFF00-|r Attempt to fix GBoM and Stormlash on dungeon boss fights.\n\n|cFFFFFF00v5.21 (|cFFFFCC00August 14, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for Monk's Soothing Mist on Streamer Plugin.\n\n|cFFFFFF00v5.20 (|cFFFFCC00August 13, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Warlock's Grimoire of Synergy buff uptime fix.\n\n|cFFFFFF00-|r Fix for the options panel background when using Classic panels.\n\n|cFFFFFF00-|r Tooltips are now slightly bigger.\n\n|cFFFFFF00-|r Fix for bookmark background where sometimes it has a light silver color.\n\n|cFFFFFF00-|r Fix for channel cast on Streamer Plugin.\n\n|cFFFFFF00-|r Legion followers fix.\n\n|cFFFFFF00-|r Boss detection for Legion dungeons.\n\n|cFFFFFF00-|r Priest spec detection review (thanks Yakumile-Azralon).\n\n|cFFFFFF00v5.15 (|cFFFFCC00August 5, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r fix for an error which happen sometimes during encounter start." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v7.1.5.3459.116 (|cFFFFCC00Mar 21th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue on dynamic overall data where it wasn't showing DPS.\n\n|cFFFFFF00-|r Fixed an issue with Apply, Save and Cancel buttons when editing a custom display.\n\n|cFFFFFF00-|r Removed the Damage and Healing presets for custom displays, now is only possible create custom displays by scripting them.\n\n|cFFFFFF00v7.1.5.3431.116 (|cFFFFCC00Mar 15th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with bar orientation right to left where fixed bar color isn't working.\n\n|cFFFFFF00-|r The nickname field now use FrizQuadrataTT font and shall be compatible with Cyrillic.\n\n|cFFFFFF00v7.1.5.3418.116 (|cFFFFCC00Mar 1st, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #167 fix: Light of the Martyr self-damage now does reduce the healing done (following WCL method).\n\n|cFFFFFF00-|r Ticket #169 fix: Damage Prevented is now working for new segments.\n\n|cFFFFFF00-|r Fixed an issue where sometimes BeastMaster's Hati pet wasn't detected correctly.\n\n|cFFFFFF00v7.1.5.3369.116 (|cFFFFCC00Feb 07th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'Dynamic Overall Damage' for mythic dungeons.\n\n|cFFFFFF00-|r Fix for Ticket #168: 'Auto Hide While [Not] Inside Instance is broken'.\n\n|cFFFFFF00-|r The bar truncate frame 'DetailsLeftTextAntiTruncate' is now created on Details! load instead on demand.\n\n|cFFFFFF00v7.1.5.3315.116 (|cFFFFCC00Jan 23th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #162: 'no Monochrome font' available, added an experimental slash command: /run _detalhes:UseOutline ('MONOCHROME').\n\n|cFFFFFF00-|r Ticket #158: 'no elapsed time shown on report to chat', added the elapsed time when reporting a segment.\n\n|cFFFFFF00-|r Ticket #164: 'error when browsing segments', an attempt to fix the problem has been made.\n\n|cFFFFFF00v7.1.5.3305.116 (|cFFFFCC00Jan 15th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Another fix for mythic dungeons overall data reset (thanks Tharai @ Curseforge).\n\n|cFFFFFF00-|r Fix for spec detection on PvP Arenas (thanks Pas06 @ Curseforge).\n\n|cFFFFFF00v7.1.0.3276.115 (|cFFFFCC00Jan 08th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the overall data not reseting when starting a new mythic+ dungeon.\n\n|cFFFFFF00v7.1.0.3266.115 (|cFFFFCC00Dec 29th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data not updating correctly at the end of the combat.\n\n|cFFFFFF00-|r Added a tutorial line on the window when the user access overall data.\n\n|cFFFFFF00v7.1.0.3236.115 (|cFFFFCC00Dec 19th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Integration with BigWigs should be working okay now.\n\n|cFFFFFF00v7.1.0.3231.115 (|cFFFFCC00Dec 15th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Disabled the link with BigWigs to avoid the 'RegisterMessage' error on every login.\n\n|cFFFFFF00v7.1.0.3229.115 (|cFFFFCC00Dec 09th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r When a window is locked, resize grips shouldn't be enabled messing with bar mouse over.\n\n|cFFFFFF00v7.0.3.3222.115 (|cFFFFCC00November 28th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Unstable Affliction to common spells with the same name.\n\n|cFFFFFF00-|r Fixed few issues with built-in plugins.\n\n|cFFFFFF00v7.0.3.3202.115 (|cFFFFCC00November 08th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Weakauras creator from the Encounter Details plugin and '/details forge' shall work correctly now with Trials of Valor.\n\n|cFFFFFF00-|r Raid history should now be recording your Trials of Valor kills.\n\n|cFFFFFF00-|r Added Trials of Valor raid info, good luck and have fun!.\n\n|cFFFFFF00v7.0.3.3201.115 (|cFFFFCC00November 04th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for Paladin holy icon.\n\n|cFFFFFF00-|r Fix for Rogue outlaw icon.\n\n|cFFFFFF00-|r Fixed misc displays with bar sorted by ascending order.\n\n|cFFFFFF00-|r Fix for '/details show' command while the window is on auto hide.\n\n|cFFFFFF00v7.0.3.3114.115 (|cFFFFCC00October 26th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): tooltip tutorial is now clamped to screen and its close button should be visible.\n\n|cFFFFFF00-|r Raid Check (plugin): now also works on dungeons.\n\n|cFFFFFF00-|r Added Potion of the Prolongued Power to the tracker.\n\n|cFFFFFF00v7.1.0.3097.115 (|cFFFFCC00October 25th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r renamed 'report history' to 'latest reports'.\n\n|cFFFFFF00-|r attempt to make all Details! users on the party or raid to track rogue's akaari's soul.\n\n|cFFFFFF00v7.0.3.2994 (|cFFFFCC00September 25th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r |cFF0088EE[Devilsaur Shock-Baton]|r added to custom spells, its effect should be displayed: 'Devilsaur Shock Leash (trinket)'.\n\n|cFFFFFF00-|r More fixes for dungeon trash being tag as a dungeon boss.\n\n|cFFFFFF00-|r Fixed the item level calculation when the player is using a main hand and offhand artifact.\n\n|cFFFFFF00-|r Added option to auto erase world segments (outdoors, e.g. doing world quests).\n\n|cFFFFFF00-|r Fixed the avoidance tab on the player detail window for Demon Hunters.\n\n|cFFFFFF00-|r Added the tag {target} on custom text for the interrupt announcer.\n\n|cFFFFFF00-|r Merging Demon Hunter 'Fury of the Illidari' spell when the consolidade option is enabled under Spell Customization.\n\n|cFFFFFF00v7.0.3.2961 (|cFFFFCC00September 17th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for consolidade spells with the same name (isn't working with all spells yet).\nThe option is under Spell Customization on options panel.\n\n|cFFFFFF00v7.0.3.2955 (|cFFFFCC00September 14th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Built-in custom displays has been updated to Legion.\n\n|cFFFFFF00-|r Raid Check (plugin) now checks for Legion food, rune and flash.\n\n|cFFFFFF00-|r removed the config button from the Player Details Window.\n\n|cFFFFFF00-|r the alert for this news window won't popup for each characters after the player opened it once for the update.\n\n|cFFFFFF00-|r added tooltip information for the two new arenas added in Legion.\n\n|cFFFFFF00v7.0.3.2941 (|cFFFFCC00September 13th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r fix for total bar where sometimes it desappears.\n\n|cFFFFFF00-|r fix for overall data reseting its elapsed time making dps and hps goes to millions.\n\n|cFFFFFF00-|r fix for overall not reseting when entering in a new dungeon.\n\n|cFFFFFF00-|r fix for trash cleanup on dungeons.\n\n|cFFFFFF00-|r fix for item level detection on dungeons.\n\n|cFFFFFF00-|r fix for artifact offhand always being counter as 750 item level.\n\n|cFFFFFF00-|r fix for segments menu sometimes not opening at all after a dungeon boss.\n\n|cFFFFFF00-|r fix for segments menu not showing the boss icon above the sub panel.\n\n|cFFFFFF00-|r fix for the top left corner of the window be ignoring the 'hide icon' setting at a /reload.\n\n|cFFFFFF00v7.0.3.2927 (|cFFFFCC00September 3rd, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Attempt to fix an issue with total bar hidding the latest bar shown.\n\n|cFFFFFF00v7.0.3.2899 (|cFFFFCC00August 26, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a bug on tiny threat where it won't used the font set after a /reload.\n\n|cFFFFFF00-|r Bar spacing can now be set to -2 to 10 (from 0 to 10).\n\n|cFFFFFF00-|r Attempt to fix GBoM and Stormlash on dungeon boss fights.\n\n|cFFFFFF00v5.21 (|cFFFFCC00August 14, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for Monk's Soothing Mist on Streamer Plugin.\n\n|cFFFFFF00v5.20 (|cFFFFCC00August 13, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Warlock's Grimoire of Synergy buff uptime fix.\n\n|cFFFFFF00-|r Fix for the options panel background when using Classic panels.\n\n|cFFFFFF00-|r Tooltips are now slightly bigger.\n\n|cFFFFFF00-|r Fix for bookmark background where sometimes it has a light silver color.\n\n|cFFFFFF00-|r Fix for channel cast on Streamer Plugin.\n\n|cFFFFFF00-|r Legion followers fix.\n\n|cFFFFFF00-|r Boss detection for Legion dungeons.\n\n|cFFFFFF00-|r Priest spec detection review (thanks Yakumile-Azralon).\n\n|cFFFFFF00v5.15 (|cFFFFCC00August 5, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r fix for an error which happen sometimes during encounter start." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_custom.lua b/classes/classe_custom.lua index 91e29242..a97a68c4 100644 --- a/classes/classe_custom.lua +++ b/classes/classe_custom.lua @@ -1,5 +1,5 @@ --> customized display script - + local _detalhes = _G._detalhes local gump = _detalhes.gump local _ @@ -8,7 +8,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> local pointers - + local _cstr = string.format --lua local local _math_floor = math.floor --lua local local _table_sort = table.sort --lua local @@ -2338,7 +2338,7 @@ desc = "Show overall damage done on the fly.", source = false, target = false, - script_version = 1, + script_version = 2, script = [[ --init: local combat, instance_container, instance = ... @@ -2349,10 +2349,14 @@ --get the current combat local CurrentCombat = Details:GetCombat (0) + if (not OverallCombat.GetActorList or not CurrentCombat.GetActorList) then + return 0, 0, 0 + end + --get the damage actor container for overall - local damage_container_overall = combat:GetActorList ( DETAILS_ATTRIBUTE_DAMAGE ) + local damage_container_overall = OverallCombat:GetActorList ( DETAILS_ATTRIBUTE_DAMAGE ) --get the damage actor container for current - local damage_container_current = combat:GetActorList ( DETAILS_ATTRIBUTE_DAMAGE ) + local damage_container_current = CurrentCombat:GetActorList ( DETAILS_ATTRIBUTE_DAMAGE ) --do the loop: for _, player in ipairs ( damage_container_overall ) do @@ -2362,10 +2366,12 @@ end end - for _, player in ipairs ( damage_container_current ) do - --only player in group - if (player:IsGroupPlayer()) then - instance_container:AddValue (player, player.total) + if (Details.in_combat) then + for _, player in ipairs ( damage_container_current ) do + --only player in group + if (player:IsGroupPlayer()) then + instance_container:AddValue (player, player.total) + end end end @@ -2424,6 +2430,27 @@ end end ]], + + total_script = [[ + local value, top, total, combat, instance = ... + + --get the time of overall combat + local OverallCombatTime = Details:GetCombat (-1):GetCombatTime() + + --get the time of current combat if the player is in combat + if (Details.in_combat) then + local CurrentCombatTime = Details:GetCombat (0):GetCombatTime() + OverallCombatTime = OverallCombatTime + CurrentCombatTime + end + + --build the string + local ToK = Details:GetCurrentToKFunction() + local s = ToK (_, total / OverallCombatTime) + s = ToK (_, total) .. " (" .. s .. ", " + + return s + ]], + } local have = false diff --git a/gumps/janela_custom.lua b/gumps/janela_custom.lua index feb5454b..fd94f473 100644 --- a/gumps/janela_custom.lua +++ b/gumps/janela_custom.lua @@ -875,8 +875,8 @@ } local attributes = { - {icon = [[Interface\ICONS\Spell_Fire_Fireball02]], label = Loc ["STRING_CUSTOM_ATTRIBUTE_DAMAGE"], box = 1, attribute = "damagedone", boxtype = 1}, - {icon = [[Interface\ICONS\SPELL_NATURE_HEALINGTOUCH]], label = Loc ["STRING_CUSTOM_ATTRIBUTE_HEAL"], box = 1, attribute = "healdone", boxtype = 1}, + --{icon = [[Interface\ICONS\Spell_Fire_Fireball02]], label = Loc ["STRING_CUSTOM_ATTRIBUTE_DAMAGE"], box = 1, attribute = "damagedone", boxtype = 1}, + --{icon = [[Interface\ICONS\SPELL_NATURE_HEALINGTOUCH]], label = Loc ["STRING_CUSTOM_ATTRIBUTE_HEAL"], box = 1, attribute = "healdone", boxtype = 1}, {icon = [[Interface\ICONS\INV_Inscription_Scroll]], label = Loc ["STRING_CUSTOM_ATTRIBUTE_SCRIPT"], box = 2, attribute = false, boxtype = 2}, --{icon = [[Interface\ICONS\INV_Inscription_Scroll]], label = "Custom Script", box = 2, attribute = false, boxtype = 2}, @@ -1042,7 +1042,8 @@ accept_button:SetPoint ("left", cancel_button, "right", 2, 0) accept_button:InstallCustomTexture() - + cancel_button:SetFrameLevel (500) + accept_button:SetFrameLevel (500) --> create box type 1 local box1 = _CreateFrame ("frame", "DetailsCustomPanelBox1", custom_window) @@ -1764,18 +1765,40 @@ return true end - local expand = gump:NewButton (code_editor, nil, "$parentExpand", "expandbutton", 8, 10, expand_func, 4, nil, nil, "^") + local supportFrame = CreateFrame ("frame", "$parentSupportFrame", custom_window) + supportFrame:SetFrameLevel (500) + + local expand = gump:NewButton (supportFrame, nil, "$parentExpand", "expandbutton", 8, 10, expand_func, 4, nil, nil, "^") expand:SetPoint ("bottomleft", code_editor, "topleft", 3, 0) - local font_size1 = gump:NewButton (code_editor, nil, "$parentFont1", "font1button", 8, 10, font_change, true, nil, nil, "+") + local font_size1 = gump:NewButton (supportFrame, nil, "$parentFont1", "font1button", 8, 10, font_change, true, nil, nil, "+") font_size1:SetPoint ("left", expand, "right", -4, 2) - local font_size2 = gump:NewButton (code_editor, nil, "$parentFont2", "font2button", 8, 10, font_change, nil, nil, nil, "-") + local font_size2 = gump:NewButton (supportFrame, nil, "$parentFont2", "font2button", 8, 10, font_change, nil, nil, nil, "-") font_size2:SetPoint ("left", font_size1, "right", -4, 2) - local apply1 = gump:NewButton (code_editor, nil, "$parentApply", "applybutton", 8, 10, apply_code, nil, nil, nil, "apply") + local apply1 = gump:NewButton (supportFrame, nil, "$parentApply", "applybutton", 8, 10, apply_code, nil, nil, nil, "apply") apply1:SetPoint ("left", font_size2, "right", -4, 1) - - local open_API = gump:NewButton (code_editor, nil, "$parentOpenAPI", "openAPIbutton", 8, 10, _detalhes.OpenAPI, nil, nil, nil, "Open Details! API") + local open_API = gump:NewButton (supportFrame, nil, "$parentOpenAPI", "openAPIbutton", 8, 10, _detalhes.OpenAPI, nil, nil, nil, "Open Details! API") open_API:SetPoint ("left", apply1, "right", -4, -1) + code_editor:SetScript ("OnShow", function() + expand:Show() + font_size1:Show() + font_size2:Show() + apply1:Show() + open_API:Show() + end) + code_editor:SetScript ("OnHide", function() + expand:Hide() + font_size1:Hide() + font_size2:Hide() + apply1:Hide() + open_API:Hide() + end) + + expand:Hide() + font_size1:Hide() + font_size2:Hide() + apply1:Hide() + open_API:Hide() --> select damage DetailsCustomPanelAttributeMenu1:Click()