diff --git a/.pkgmeta b/.pkgmeta index 3a5d3bba..1e6ef0e7 100644 --- a/.pkgmeta +++ b/.pkgmeta @@ -10,4 +10,5 @@ move-folders: Details/plugins/Details_TimeAttack: Details_TimeAttack Details/plugins/Details_TinyThreat: Details_TinyThreat Details/plugins/Details_Vanguard: Details_Vanguard - Details/plugins/Details_YouAreNotPrepared: Details_YouAreNotPrepared \ No newline at end of file + Details/plugins/Details_YouAreNotPrepared: Details_YouAreNotPrepared + Details/plugins/Details_DpsTuning: Details_DpsTuning \ No newline at end of file diff --git a/boot.lua b/boot.lua index ae81e616..438c7884 100644 --- a/boot.lua +++ b/boot.lua @@ -3,8 +3,8 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 69 --it's 69 for release - _detalhes.userversion = "v1.25.0" + _detalhes.build_counter = 70 --it's 70 for release + _detalhes.userversion = "v1.25.1" _detalhes.realversion = 28 _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" @@ -19,9 +19,10 @@ do --[[ + --]] - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.25.0 (|cFFFFCC00Set 08, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Acitivity Time for Damage + Healing, tooltip show the activity separately.\n\n|cFFFFFF00-|r Major changes on Encounter Details Plugin making more easy to use.\n\n|cFFFFFF00-|r Removed Spell Details Plugin.\n\n|cFFFFFF00-|r Added new plugin for Solo Mode: Dps Tuning.\n\n|cFFFFFF00v1.24.5 (|cFFFFCC00Ago 31, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Raid Tools bracket on Options Panel.\n\n|cFFFFFF00-|r Added interrupt, cooldown and death announcers (raid tools).\n\n|cFFFFFF00-|r Added pre potion recognition, showing after the encounter on the chat only for you (raid tools).\n\n|cFFFFFF00-|r Added a Boss Emotes tab for Encounter Details plugin |cFF999999(thanks Bloodforce-Azralon)|r.\n\n|cFFFFFF00-|r Rework on Activity Time, now it is tuned to closely match warcraftlogs |cFF999999(thanks www.warcraftlogs.com)|r.\n\n|cFFFFFF00-|r Added two new customs: Damage Activity Time and Healing Activity Time.\n\n|cFFFFFF00-|r Time Attack Plugin now have six fixed time amount options for test your dps on training dummies.\n\n|cFFFFFF00-|r Time Attack Plugin can now also share results on your realm, between players with the same class.\n\n|cFFFFFF00v1.23.6 (|cFFFFCC00Ago 24, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 2 new bar textures and 6 new fonts.\n\n|cFFFFFF00-|r Swapped left and middle button for enemy bars, now left button open damage taken and middle button player detail window.\n\n|cFFFFFF00-|r Added new skin: Minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 is now the default skin.\n\n|cFFFFFF00-|r Few changes on both icon packs with transparency.\n\n|cFFFFFF00-|r Replaced the slash command '/d' with '/de' |cFF999999(thanks @kamuul-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added custom spells for Atonement, Power Word: Solance and Life Bloom |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00v1.22.4 (|cFFFFCC00Ago 15, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added new skin: ElvUI Frame Style (Black White).\n\n|cFFFFFF00-|r Align With Right Chat Window option now check if the window have statusbar enabled.\n\n|cFFFFFF00-|r Few improvements on report for Deaths and Spells over Player Detail Window.\n\n|cFFFFFF00-|r Added option to disable reset button (reset only using its tooltip menu).\n\n|cFFFFFF00-|r Added option for disable window groups.\n\n|cFFFFFF00-|r Added option for select the icon pack to use, also added black white icon pack.\n\n|cFFFFFF00-|r Fixed many bugs involving skins and profiles, thing should run more smooth now.\n\n|cFFFFFF00-|r Plugin Time Attack now correctly saves the attempt when pressing the big save button.\n\n|cFFFFFF00-|r Added support for hotcorners.\n\n|cFFFFFF00v1.21.4 (|cFFFFCC00Ago 9, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Shaman's Ancestral Guidance on cooldowns list |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added a profile selection screen when Details! are running for the first time on a character.\n\n|cFFFFFF00-|r Added Menu Text Size option over miscellaneous section on options panel |cFF999999(thanks @ Revi-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed a bug over Healing Player Details Window where pets wasn't being shown |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed issue with summoning pets with unknown owners where it was breaking the summon of all the others pets. |cFF999999(thanks @ThunderLost-curse website)|r.\n\n|cFFFFFF00-|r Hot Corners isn't no more a part of Details!, instead of that, Hot Corner is now a standalone addon which needs to be installed separately for who wants to use it.\n\n|cFFFFFF00-|r Skin data is now stored inside the profiles, many code parts got rewrite, still may have few bugs but it's more reliable then before.\n\n|cFFFFFF00-|r Rework on Auras and Voidzones: now shows damage, dps and percentage. Also its tooltip got fixes and now shows the correct damage done to players.\n\n|cFFFFFF00-|r Tooltip for Enemies now shows damage taken from players |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Right clicking a real-time enemy bar, makes it back to Enemies display instead of show Bookmark panel |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Tank comparison from previous segment now uses the same percentage method from player comparison panel.\n\n|cFFFFFF00-|r Fix bug with the slash command 'show' where was ignoring the window limit set on options panel |cFF999999(thanks @Castiel-US-Azralon realm)|r.\n\n|cFFFFFF00-|r Fixed few bugs with scroll bars, including scrolls on dropdown menu and player detail window |cFF999999(thanks @Revi-mmochampion forum)|r.\n\n|cFFFFFF00v1.20.2 (|cFFFFCC00Aug 1, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a option under Miscellaneous section to provide spell link instead of spell name for helpful spells when reporting a death |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Improvements done on how deaths are handled, now latest events before death will be more precise.\n\n|cFFFFFF00-|r Implemented Damage Taken from environment like lava, gravity, etc.\n\n|cFFFFFF00-|r Added Warlock's Fire and Brimstone spell on customized spells.\n\n|cFFFFFF00-|r Added dwarf racial Stone Form on cooldown list |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Bookmark now are shared between all characters.\n\n|cFFFFFF00-|r Fixed few inconsistencies with trash recognition.\n\n|cFFFFFF00-|r Fixed Cloud Capture where sometimes it wasn't sharing.\n\n|cFFFFFF00-|r Fixed report where it wasn't sharing for guild and raid when the player name box were empty.\n\n|cFFFFFF00-|r Report box now also saves the position and the last channel used to report |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r You Are Not Prepared plugin now have tooltips for spells and its window auto opens after a boss encounter.\n\n|cFFFFFF00-|r Advanced Death Logs plugin got full rewrite (and still are in development).\n\n|cFFFFFF00v1.19.0 - v1.19.1 - v1.19.2 (|cFFFFCC00Jul 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Details! is now able to be translated by its community for all supported languages through Curse Forge Web Site:\n\n|cFFFFFF00http://wow.curseforge.com/addons/details/localization/|r\n\n|cFFFFFF00-|r Slash commands now are multi language, accepting both english and the localized language.\n\n|cFFFFFF00-|r Added Data Broker for: Combat Time, Player Dps and Player Hps.\n\n|cFFFFFF00-|r Rework on plugins: Timeline, You Are Not Prepared, Tiny Threat, Encounter Details. All those plugins got a options panel and few improvaments.\n\n|cFFFFFF00-|r Trash segments won't be saved anymore.\n\n|cFFFFFF00-|r Added support for plugins options.\n\n|cFFFFFF00-|r Revamp on Deaths report lines, adding links for harmful spells and changing the text order |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Modified the percentage used on Comparison panel |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed the Raid Dps and Hps data exported by Data Broker |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00v1.18.4 - v1.18.5 - v1.18.6 (|cFFFFCC00Jul 13, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option to customize the bar left text.\n\n|cFFFFFF00-|r Added option for show or hide bar placement number.\n\n|cFFFFFF00-|r Spell icon is shown in the bar when the enemy character is a environment spell type.\n\n|cFFFFFF00-|r Changed the non-player enemy icon (monsters).\n\n|cFFFFFF00-|r Fixed bug on flex performance profile |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added new version tracker which should alert you when a newer Details! version is found.\n\n|cFFFFFF00-|r Added Enemy Damage Taken by clicking with middle mouse button over a enemy bar (enemies display).\n\n|cFFFFFF00-|r Added import/export for saved skins and custom displays created.\n\n|cFFFFFF00-|r Small changes on ElvUI Frame Style skin (need reaply).\n\n|cFFFFFF00-|r Fixed the death recognition for bosses, now it should show the correct color over segments menu.\n\n|cFFFFFF00-|r Fixed Dps inacuracy when plyaing solo (no party or raid group).\n\n|cFFFFFF00-|r Fixed the duration time of buffs applied before the pull, like pre-potions.\n\n|cFFFFFF00v1.17.5 (|cFFFFCC00Jun 30, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Shortcut panel is now known as Bookmarks and a revamp has done on its panel.\n\n|cFFFFFF00-|r NickTag now doesnt check anymore if a received nickname from other guild member is invalid.\n\n|cFFFFFF00-|r Healthstone now is considered a cooldown.\n\n|cFFFFFF00-|r Few improvements on Default Skin, Minimalistic Skin and ElvUI Frame Style Skin.\n\n|cFFFFFF00-|r Revamp on Image Editor, many bugs solves and now it is usable." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.25.1 (|cFFFFCC00Set 09, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added buttons to edit the total and percentage code for custom displays.\n\n|cFFFFFF00-|r Fixed a problem while report custom displays.\n\n|cFFFFFF00-|r Added Acitivity Time for Damage + Healing, tooltip show the activity separately.\n\n|cFFFFFF00-|r Major changes on Encounter Details Plugin making more easy to use.\n\n|cFFFFFF00-|r Removed Spell Details Plugin.\n\n|cFFFFFF00-|r Added new plugin for Solo Mode: Dps Tuning.\n\n|cFFFFFF00v1.24.5 (|cFFFFCC00Ago 31, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Raid Tools bracket on Options Panel.\n\n|cFFFFFF00-|r Added interrupt, cooldown and death announcers (raid tools).\n\n|cFFFFFF00-|r Added pre potion recognition, showing after the encounter on the chat only for you (raid tools).\n\n|cFFFFFF00-|r Added a Boss Emotes tab for Encounter Details plugin |cFF999999(thanks Bloodforce-Azralon)|r.\n\n|cFFFFFF00-|r Rework on Activity Time, now it is tuned to closely match warcraftlogs |cFF999999(thanks www.warcraftlogs.com)|r.\n\n|cFFFFFF00-|r Added two new customs: Damage Activity Time and Healing Activity Time.\n\n|cFFFFFF00-|r Time Attack Plugin now have six fixed time amount options for test your dps on training dummies.\n\n|cFFFFFF00-|r Time Attack Plugin can now also share results on your realm, between players with the same class.\n\n|cFFFFFF00v1.23.6 (|cFFFFCC00Ago 24, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 2 new bar textures and 6 new fonts.\n\n|cFFFFFF00-|r Swapped left and middle button for enemy bars, now left button open damage taken and middle button player detail window.\n\n|cFFFFFF00-|r Added new skin: Minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 is now the default skin.\n\n|cFFFFFF00-|r Few changes on both icon packs with transparency.\n\n|cFFFFFF00-|r Replaced the slash command '/d' with '/de' |cFF999999(thanks @kamuul-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added custom spells for Atonement, Power Word: Solance and Life Bloom |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00v1.22.4 (|cFFFFCC00Ago 15, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added new skin: ElvUI Frame Style (Black White).\n\n|cFFFFFF00-|r Align With Right Chat Window option now check if the window have statusbar enabled.\n\n|cFFFFFF00-|r Few improvements on report for Deaths and Spells over Player Detail Window.\n\n|cFFFFFF00-|r Added option to disable reset button (reset only using its tooltip menu).\n\n|cFFFFFF00-|r Added option for disable window groups.\n\n|cFFFFFF00-|r Added option for select the icon pack to use, also added black white icon pack.\n\n|cFFFFFF00-|r Fixed many bugs involving skins and profiles, thing should run more smooth now.\n\n|cFFFFFF00-|r Plugin Time Attack now correctly saves the attempt when pressing the big save button.\n\n|cFFFFFF00-|r Added support for hotcorners.\n\n|cFFFFFF00v1.21.4 (|cFFFFCC00Ago 9, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Shaman's Ancestral Guidance on cooldowns list |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added a profile selection screen when Details! are running for the first time on a character.\n\n|cFFFFFF00-|r Added Menu Text Size option over miscellaneous section on options panel |cFF999999(thanks @ Revi-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed a bug over Healing Player Details Window where pets wasn't being shown |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed issue with summoning pets with unknown owners where it was breaking the summon of all the others pets. |cFF999999(thanks @ThunderLost-curse website)|r.\n\n|cFFFFFF00-|r Hot Corners isn't no more a part of Details!, instead of that, Hot Corner is now a standalone addon which needs to be installed separately for who wants to use it.\n\n|cFFFFFF00-|r Skin data is now stored inside the profiles, many code parts got rewrite, still may have few bugs but it's more reliable then before.\n\n|cFFFFFF00-|r Rework on Auras and Voidzones: now shows damage, dps and percentage. Also its tooltip got fixes and now shows the correct damage done to players.\n\n|cFFFFFF00-|r Tooltip for Enemies now shows damage taken from players |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Right clicking a real-time enemy bar, makes it back to Enemies display instead of show Bookmark panel |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Tank comparison from previous segment now uses the same percentage method from player comparison panel.\n\n|cFFFFFF00-|r Fix bug with the slash command 'show' where was ignoring the window limit set on options panel |cFF999999(thanks @Castiel-US-Azralon realm)|r.\n\n|cFFFFFF00-|r Fixed few bugs with scroll bars, including scrolls on dropdown menu and player detail window |cFF999999(thanks @Revi-mmochampion forum)|r.\n\n|cFFFFFF00v1.20.2 (|cFFFFCC00Aug 1, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a option under Miscellaneous section to provide spell link instead of spell name for helpful spells when reporting a death |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Improvements done on how deaths are handled, now latest events before death will be more precise.\n\n|cFFFFFF00-|r Implemented Damage Taken from environment like lava, gravity, etc.\n\n|cFFFFFF00-|r Added Warlock's Fire and Brimstone spell on customized spells.\n\n|cFFFFFF00-|r Added dwarf racial Stone Form on cooldown list |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Bookmark now are shared between all characters.\n\n|cFFFFFF00-|r Fixed few inconsistencies with trash recognition.\n\n|cFFFFFF00-|r Fixed Cloud Capture where sometimes it wasn't sharing.\n\n|cFFFFFF00-|r Fixed report where it wasn't sharing for guild and raid when the player name box were empty.\n\n|cFFFFFF00-|r Report box now also saves the position and the last channel used to report |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r You Are Not Prepared plugin now have tooltips for spells and its window auto opens after a boss encounter.\n\n|cFFFFFF00-|r Advanced Death Logs plugin got full rewrite (and still are in development).\n\n|cFFFFFF00v1.19.0 - v1.19.1 - v1.19.2 (|cFFFFCC00Jul 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Details! is now able to be translated by its community for all supported languages through Curse Forge Web Site:\n\n|cFFFFFF00http://wow.curseforge.com/addons/details/localization/|r\n\n|cFFFFFF00-|r Slash commands now are multi language, accepting both english and the localized language.\n\n|cFFFFFF00-|r Added Data Broker for: Combat Time, Player Dps and Player Hps.\n\n|cFFFFFF00-|r Rework on plugins: Timeline, You Are Not Prepared, Tiny Threat, Encounter Details. All those plugins got a options panel and few improvaments.\n\n|cFFFFFF00-|r Trash segments won't be saved anymore.\n\n|cFFFFFF00-|r Added support for plugins options.\n\n|cFFFFFF00-|r Revamp on Deaths report lines, adding links for harmful spells and changing the text order |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Modified the percentage used on Comparison panel |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed the Raid Dps and Hps data exported by Data Broker |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00v1.18.4 - v1.18.5 - v1.18.6 (|cFFFFCC00Jul 13, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option to customize the bar left text.\n\n|cFFFFFF00-|r Added option for show or hide bar placement number.\n\n|cFFFFFF00-|r Spell icon is shown in the bar when the enemy character is a environment spell type.\n\n|cFFFFFF00-|r Changed the non-player enemy icon (monsters).\n\n|cFFFFFF00-|r Fixed bug on flex performance profile |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added new version tracker which should alert you when a newer Details! version is found.\n\n|cFFFFFF00-|r Added Enemy Damage Taken by clicking with middle mouse button over a enemy bar (enemies display).\n\n|cFFFFFF00-|r Added import/export for saved skins and custom displays created.\n\n|cFFFFFF00-|r Small changes on ElvUI Frame Style skin (need reaply).\n\n|cFFFFFF00-|r Fixed the death recognition for bosses, now it should show the correct color over segments menu.\n\n|cFFFFFF00-|r Fixed Dps inacuracy when plyaing solo (no party or raid group).\n\n|cFFFFFF00-|r Fixed the duration time of buffs applied before the pull, like pre-potions.\n\n|cFFFFFF00v1.17.5 (|cFFFFCC00Jun 30, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Shortcut panel is now known as Bookmarks and a revamp has done on its panel.\n\n|cFFFFFF00-|r NickTag now doesnt check anymore if a received nickname from other guild member is invalid.\n\n|cFFFFFF00-|r Healthstone now is considered a cooldown.\n\n|cFFFFFF00-|r Few improvements on Default Skin, Minimalistic Skin and ElvUI Frame Style Skin.\n\n|cFFFFFF00-|r Revamp on Image Editor, many bugs solves and now it is usable." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " --> startup diff --git a/classes/classe_custom.lua b/classes/classe_custom.lua index 51002ad7..b1e5d565 100644 --- a/classes/classe_custom.lua +++ b/classes/classe_custom.lua @@ -172,6 +172,36 @@ instance_container:Remap() if (export) then + -- key name value need to be formated + if (custom_object) then + + local percent_script = _detalhes.custom_function_cache [instance.customName .. "Percent"] + local total_script = _detalhes.custom_function_cache [instance.customName .. "Total"] + + for index, actor in _ipairs (instance_container._ActorTable) do + local percent, total + if (percent_script) then + percent = percent_script (actor.value, top, total, combat, instance) + else + percent = _cstr ("%.1f", self.value / total * 100) + end + + if (total_script) then + local value = total_script (actor.value, top, total, combat, instance) + if (type (value) == "number") then + total = SelectedToKFunction (_, value) + else + total = value + end + else + total = SelectedToKFunction (_, self.value) + end + + actor.report_value = total .. " (" .. percent .. "%)" + end + + end + return total, instance_container._ActorTable, top, amount end @@ -801,6 +831,12 @@ function atributo_custom:GetScriptToolip() return self.tooltip end + function atributo_custom:GetScriptTotal() + return self.total_script + end + function atributo_custom:GetScriptPercent() + return self.percent_script + end function atributo_custom:SetName (name) self.name = name diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index a7a0aa23..3582eccc 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -2481,14 +2481,13 @@ function _detalhes:monta_relatorio (este_relatorio, custom) if (custom) then --> shrink local report_lines = {} - for i = 1, _detalhes.report_lines+1, 1 do --#este_relatorio -- o +1 é pq ele conta o cabeçalho como uma linha report_lines [#report_lines+1] = este_relatorio[i] end return self:envia_relatorio (report_lines, true) end - + local amt = _detalhes.report_lines local report_lines = {} @@ -2573,7 +2572,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom) if (_detalhes.custom [self.sub_atributo]) then total, container, first, container_amount = _detalhes.atributo_custom:RefreshWindow (self, self.showing, true, true) - keyName = "value" + keyName = "report_value" else total, keyName, first, container_amount = _detalhes.atributo_damage:RefreshWindow (self, self.showing, true, true) total = 1 @@ -2590,7 +2589,12 @@ function _detalhes:monta_relatorio (este_relatorio, custom) if (_thisActor) then - local amount = _math_floor (_thisActor [keyName]) + local amount + if (type (_thisActor [keyName]) == "number") then + amount = _math_floor (_thisActor [keyName]) + else + amount = _thisActor [keyName] + end local name = _thisActor.nome.." " if (_detalhes.remove_realm_from_name and name:find ("-")) then @@ -2606,7 +2610,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom) stringlen = _detalhes.fontstring_len:GetStringWidth() end - if (_type (amount) == "number" and amount > 0) then --1236 + if (_type (amount) == "number" and amount > 0) then if (keyNameSec) then local dps = GetDpsHps (_thisActor, keyNameSec) report_lines [#report_lines+1] = i .. ". " .. name .. " " .. _cstr ("%.2f", amount/total*100) .. "% (" .. _detalhes:comma_value (_math_floor (dps)) .. ", " .. _detalhes:ToK ( _math_floor (amount) ) .. ")" @@ -2688,9 +2692,8 @@ function _detalhes:monta_relatorio (este_relatorio, custom) total, keyName, first, container_amount = _detalhes.atributo_misc:RefreshWindow (self, self.showing, true, true) end elseif (atributo == 5) then --> custom - total, keyName, first, container_amount = _detalhes.atributo_custom:RefreshWindow (self, self.showing, true, {key = "custom"}) - total = self.showing.totals [self.customName] - atributo = _detalhes.custom [self.sub_atributo].attribute + total, container, first, container_amount = _detalhes.atributo_custom:RefreshWindow (self, self.showing, true, true) + keyName = "report_value" end local this_amt = math.min (#container, container_amount or 0, amt) @@ -2699,40 +2702,47 @@ function _detalhes:monta_relatorio (este_relatorio, custom) for i = container_amount, this_amt, -1 do local _thisActor = container [i] - local amount = _math_floor (_thisActor [keyName]) + if (_thisActor) then - local name = _thisActor.nome.." " - - _detalhes.fontstring_len:SetText (name) - local stringlen = _detalhes.fontstring_len:GetStringWidth() - - while (stringlen < default_len) do - name = name .. "." - _detalhes.fontstring_len:SetText (name) - stringlen = _detalhes.fontstring_len:GetStringWidth() - end - - if (_type (amount) == "number") then - if (amount > 0) then - if (keyNameSec) then - local dps = GetDpsHps (_thisActor, keyNameSec) - report_lines [#report_lines+1] = i .. ". " .. name .. " " .. _cstr ("%.2f", amount/total*100) .. "% (" .. _detalhes:comma_value (_math_floor (dps)) .. ", " .. _detalhes:ToK ( _math_floor (amount) ) .. ")" - else - report_lines [#report_lines+1] = i .. "." .. name .. " " .. _detalhes:comma_value ( _math_floor (amount) ).." (".._cstr ("%.1f", amount/total*100).."%)" - end - - quantidade = quantidade + 1 - if (quantidade == amt) then - break - end + local amount + if (type (_thisActor [keyName]) == "number") then + amount = _math_floor (_thisActor [keyName]) + else + amount = _thisActor [keyName] + end + + local name = _thisActor.nome .. " " + + _detalhes.fontstring_len:SetText (name) + local stringlen = _detalhes.fontstring_len:GetStringWidth() + + while (stringlen < default_len) do + name = name .. "." + _detalhes.fontstring_len:SetText (name) + stringlen = _detalhes.fontstring_len:GetStringWidth() + end + + if (_type (amount) == "number") then + if (amount > 0) then + if (keyNameSec) then + local dps = GetDpsHps (_thisActor, keyNameSec) + report_lines [#report_lines+1] = i .. ". " .. name .. " " .. _cstr ("%.2f", amount/total*100) .. "% (" .. _detalhes:comma_value (_math_floor (dps)) .. ", " .. _detalhes:ToK ( _math_floor (amount) ) .. ")" + else + report_lines [#report_lines+1] = i .. "." .. name .. " " .. _detalhes:comma_value ( _math_floor (amount) ).." (".._cstr ("%.1f", amount/total*100).."%)" + end + + quantidade = quantidade + 1 + if (quantidade == amt) then + break + end + end + elseif (_type (amount) == "string") then + report_lines [#report_lines+1] = i .. ". " .. name .. " " .. amount + else + break end - elseif (_type (amount) == "string") then - report_lines [#report_lines+1] = i .. ". " .. name .. " " .. amount - else - break end end - else local nova_tabela = {} diff --git a/gumps/janela_custom.lua b/gumps/janela_custom.lua index 2826171b..f3a02e67 100644 --- a/gumps/janela_custom.lua +++ b/gumps/janela_custom.lua @@ -182,6 +182,18 @@ ]] DetailsCustomPanel.code2 = DetailsCustomPanel.code2_default + DetailsCustomPanel.code3_default = [[ + local value, top, total, combat, instance = ... + return math.floor (value) + ]] + DetailsCustomPanel.code3 = DetailsCustomPanel.code3_default + + DetailsCustomPanel.code4_default = [[ + local value, top, total, combat, instance = ... + return string.format ("%.1f", value/total*100) + ]] + DetailsCustomPanel.code4 = DetailsCustomPanel.code4_default + function DetailsCustomPanel:ClearFocus() custom_window.desc_field:ClearFocus() custom_window.name_field:ClearFocus() @@ -206,6 +218,8 @@ DetailsCustomPanel.code1 = DetailsCustomPanel.code1_default DetailsCustomPanel.code2 = DetailsCustomPanel.code2_default + DetailsCustomPanel.code3 = DetailsCustomPanel.code3_default + DetailsCustomPanel.code4 = DetailsCustomPanel.code4_default DetailsCustomPanel.current_attribute = "damagedone" DetailsCustomPanelAttributeMenu1:Click() @@ -252,6 +266,8 @@ DetailsCustomPanel.code1 = custom_object:GetScript() DetailsCustomPanel.code2 = custom_object:GetScriptToolip() + DetailsCustomPanel.code3 = custom_object:GetScriptTotal() + DetailsCustomPanel.code4 = custom_object:GetScriptPercent() else @@ -393,7 +409,7 @@ ["script"] = false, ["tooltip"] = false, } - + tinsert (_detalhes.custom, new_custom_object) _setmetatable (new_custom_object, _detalhes.atributo_custom) new_custom_object.__index = _detalhes.atributo_custom @@ -406,6 +422,8 @@ local main_code = DetailsCustomPanel.code1 local tooltip_code = DetailsCustomPanel.code2 + local total_code = DetailsCustomPanel.code3 + local percent_code = DetailsCustomPanel.code4 if (DetailsCustomPanel.IsEditing) then local object = DetailsCustomPanel.IsEditing @@ -420,6 +438,18 @@ object.script = main_code object.tooltip = tooltip_code + if (total_code ~= DetailsCustomPanel.code3_default) then + object.total_script = total_code + else + object.total_script = false + end + + if (percent_code ~= DetailsCustomPanel.code4_default) then + object.percent_script = percent_code + else + object.percent_script = false + end + if (DetailsCustomPanel.IsImporting) then _detalhes:Msg (Loc ["STRING_CUSTOM_IMPORTED"]) else @@ -448,6 +478,21 @@ ["tooltip"] = tooltip_code, } + local total_code = DetailsCustomPanel.code3 + local percent_code = DetailsCustomPanel.code4 + + if (total_code ~= DetailsCustomPanel.code3_default) then + new_custom_object.total_script = total_code + else + new_custom_object.total_script = false + end + + if (percent_code ~= DetailsCustomPanel.code4_default) then + new_custom_object.percent_script = percent_code + else + new_custom_object.percent_script = false + end + tinsert (_detalhes.custom, new_custom_object) _setmetatable (new_custom_object, _detalhes.atributo_custom) new_custom_object.__index = _detalhes.atributo_custom @@ -470,6 +515,10 @@ DetailsCustomPanel.code1 = custom_window.codeeditor:GetText() elseif (DetailsCustomPanel.CodeEditing == 2) then DetailsCustomPanel.code2 = custom_window.codeeditor:GetText() + elseif (DetailsCustomPanel.CodeEditing == 3) then + DetailsCustomPanel.code3 = custom_window.codeeditor:GetText() + elseif (DetailsCustomPanel.CodeEditing == 4) then + DetailsCustomPanel.code4 = custom_window.codeeditor:GetText() end DetailsCustomPanel.CodeEditing = false @@ -573,7 +622,15 @@ elseif (code == 2) then --> edit tooltip code custom_window.codeeditor:SetText (DetailsCustomPanel.code2) + + elseif (code == 3) then --> edit total code + + custom_window.codeeditor:SetText (DetailsCustomPanel.code3) + elseif (code == 4) then --> edit percent code + + custom_window.codeeditor:SetText (DetailsCustomPanel.code4) + end custom_window.codeeditor:Show() @@ -1606,15 +1663,27 @@ --edit main code local maincode_button = gump:NewButton (box2, nil, "$parentMainCodeButton", "maiccodebutton", 160, 20, DetailsCustomPanel.StartEditCode, 1, nil, nil, Loc ["STRING_CUSTOM_EDIT_SEARCH_CODE"]) - maincode_button:SetPoint ("topleft", box2, "topleft", 10, -25) + maincode_button:SetPoint ("topleft", box2, "topleft", 10, -15) maincode_button.tooltip = Loc ["STRING_CUSTOM_EDITCODE_DESC"] - maincode_button:InstallCustomTexture() + maincode_button:InstallCustomTexture (nil, nil, nil, nil, true) --edit tooltip code local tooltipcode_button = gump:NewButton (box2, nil, "$parentTooltipCodeButton", "tooltipcodebutton", 160, 20, DetailsCustomPanel.StartEditCode, 2, nil, nil, Loc ["STRING_CUSTOM_EDIT_TOOLTIP_CODE"]) - tooltipcode_button:SetPoint ("topleft", maincode_button, "bottomleft", 0, -10) + tooltipcode_button:SetPoint ("topleft", maincode_button, "bottomleft", 0, -8) tooltipcode_button.tooltip = Loc ["STRING_CUSTOM_EDITTOOLTIP_DESC"] - tooltipcode_button:InstallCustomTexture() + tooltipcode_button:InstallCustomTexture (nil, nil, nil, nil, true) + + --edit total code + local totalcode_button = gump:NewButton (box2, nil, "$parentTotalCodeButton", "totalcodebutton", 160, 20, DetailsCustomPanel.StartEditCode, 3, nil, nil, "Edit Total Code") + totalcode_button:SetPoint ("topleft", tooltipcode_button, "bottomleft", 0, -8) + totalcode_button.tooltip = "This code is responsible for edit the total number shown in the player bar.\n\nThis is not necessary if you want show exactly the value gotten in the search code." + totalcode_button:InstallCustomTexture (nil, nil, nil, nil, true) + + --edit percent code + local percentcode_button = gump:NewButton (box2, nil, "$parentPercentCodeButton", "percentcodebutton", 160, 20, DetailsCustomPanel.StartEditCode, 4, nil, nil, "Edit Percent Code") + percentcode_button:SetPoint ("topleft", totalcode_button, "bottomleft", 0, -8) + percentcode_button.tooltip = "Edit the code responsible for the percent number in the player bar.\n\nThis is not required if you want to use simple percentage (comparing with total)." + percentcode_button:InstallCustomTexture (nil, nil, nil, nil, true) box2:Hide()