diff --git a/boot.lua b/boot.lua index 52ac1a04..9d928e86 100644 --- a/boot.lua +++ b/boot.lua @@ -1,10 +1,10 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> global name declaration - + _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 439 --it's 439 for release - _detalhes.userversion = "v3.8.6" + _detalhes.userversion = "v3.8.8" _detalhes.realversion = 58 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" @@ -20,7 +20,9 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v3.8.6 (|cFFFFCC00Jan 23, 2015|r|cFFFFFF00)|r:\n\n +|cFFFFFF00v3.8.8 (|cFFFFCC00Jan 23, 2015|r|cFFFFFF00)|r:\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 Options Panel for Vanguard Plugin.\n\n |cFFFFFF00-|r Added Segments shortcut menu pressing Shift + Right click.\n\n |cFFFFFF00-|r Fixed avoidance panel on Player Details Window where sometimes was giving errors.\n\n @@ -32,7 +34,7 @@ do --]] -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.8.6 (|cFFFFCC00Jan 23, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Options Panel for Vanguard Plugin.\n\n|cFFFFFF00-|r Added Segments shortcut menu pressing Shift + Right click .\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 Improved specialization detection in order to try detect spec changes.\n\n|cFFFFFF00-|r Fixed an issue with 'Always Show Me' feature where it was showing the player on Enemies display.\n\n|cFFFFFF00-|r Testing LibWindow-1.1.\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.\n\n|cFFFFFF00-|r Fixed command /details disable, wasn't disabling the capture of cooldowns.\n\n|cFFFFFF00-|r Fixed a problem with fast dps/hps when the window is in a empty segment.\n\n|cFFFFFF00-|r Fixed an issue using bookmark panel where it wasn't changing the display when the window is in a plugin mode.\n\n|cFFFFFF00-|r Fixed a bug when bars isn't using class colors on Frags, Auras & Void Zones, Resources and Deaths.\n\n|cFFFFFF00-|r Fixed bar animations when 'Sort Direction' is set to bottom.\n\n|cFFFFFF00-|r Fixed the spam 'you are not in a guild' when checking for new versions.\n\n|cFFFFFF00-|r Fixed translations for Auto Hide Settings bracket under options panel.\n\n|cFFFFFF00-|r Fixed Auto Hide -> Mouse Interaction tool where wans't able to work okey during combat.\n\n|cFFFFFF00v3.6.14b (|cFFFFCC00Jan 01, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'My Spells' which shows your spells in the window.\n\n|cFFFFFF00-|r Added new custom display: Health Potion & Stone.\n\n|cFFFFFF00-|r Added overkill on death's tooltip.\n\n|cFFFFFF00-|r Created custom spells for Twin Ogron's Pulverize. Now it has 3 spells one for each wave.\n\n|cFFFFFF00-|r Created custom spells for Ko'ragh Overflowing Energy. Now it has 2 spells one for when the ball is catched and other when it reaches the ground and explodes.\n\n|cFFFFFF00-|r Changed healing multistrike to use the same format as damage done.\n\n|cFFFFFF00-|r Few improvements on Tiny Threat plugin: color gradient green-red is fixed, texts and bar texture now correctly uses the window settings.\n\n|cFFFFFF00-|r Damage Taken by Spell won't show pets in its tooltip any more.\n\n|cFFFFFF00-|r Enemies display won't show any more mirror images and spirit link totems.\n\n|cFFFFFF00-|r Enemies's tooltip now only show players and show all players instead of only 6.\n\n|cFFFFFF00-|r Few cooldowns shown as raid wide now shows as personal cooldowns.\n\n|cFFFFFF00-|r Fixed dispell tagets on dispell's tooltip.\n\n|cFFFFFF00-|r Fixed 'First Hit' raid tool.\n\n|cFFFFFF00-|r Fixed 'Open Options Panel' from interface panel.\n\n|cFFFFFF00v3.6.8 (|cFFFFCC00Dec 24, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Fast (i mean, really fast) Dps/Hps update rate, its option is under Rows: Advanced -> Fast Updates.\n\n|cFFFFFF00-|r Created a custom spell for Mirror Image's Fireball and Frostbolt, with that Player Detail window distinguishes spells from the player and images.\n\n|cFFFFFF00-|r Added new skin: 'ElvUI Style II'.\n\n|cFFFFFF00-|r Added Observer mode for Raid Tools: report cooldown/interrupt/death of entire raid only to you in your chat window.\n\n|cFFFFFF00-|r Added new plugin 'Raid Check': tracks raid members checking food, flask and pre-potions usage.\n\n|cFFFFFF00-|r Changed DPS display, now it shows onyl the player's Dps and the Dps difference between him and the top ranked.\n\n|cFFFFFF00-|r Changed Overheal display, now its percentage shows the player's overheal percent.\n\n|cFFFFFF00-|r Player Detail Window now shows the amount of multistrike on normal and critical hits.\n\n|cFFFFFF00-|r Removed skin: 'ElvUI Frame Style BW'.\n\n|cFFFFFF00-|r The tooltip for Scale option under options panel, now shows the real value for the scale.\n\n|cFFFFFF00-|r Fixed Imperator Mar'gok's adds damage taken.\n\n|cFFFFFF00-|r Fixed a problem where multistrike was counting towards critical strike amount.\n\n|cFFFFFF00-|r Fixed death display's report where it was't showing any death.\n\n|cFFFFFF00-|r Fixed a small issue with Encounter Details plugin where sometimes gets a error right after a boss encounter.\n\n|cFFFFFF00-|r Fixed bugs on sending messages to chat for Raid Tools.\n\n\n\n|cFFFFFF00v3.5.1 (|cFFFFCC00Dec 16, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed few accuracy on miss spells.\n\n|cFFFFFF00v3.5.0 (|cFFFFCC00Dec 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltip for Auras and Voidzones, now shows sorted by damage and time.\n\n|cFFFFFF00-|r More fixes for Korgath encounter on Highmaul.\n\n|cFFFFFF00-|r Added slash commands: 'reset' 'config'.\n\n|cFFFFFF00-|r Spell bars on Player Details Window now is painted with the spell spellschool color." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.8.8 (|cFFFFCC00Jan 23, 2015|r|cFFFFFF00)|r:\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 Options Panel for Vanguard Plugin.\n\n|cFFFFFF00-|r Added Segments shortcut menu pressing Shift + Right click .\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 Improved specialization detection in order to try detect spec changes.\n\n|cFFFFFF00-|r Fixed an issue with 'Always Show Me' feature where it was showing the player on Enemies display.\n\n|cFFFFFF00-|r Testing LibWindow-1.1.\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.\n\n|cFFFFFF00-|r Fixed command /details disable, wasn't disabling the capture of cooldowns.\n\n|cFFFFFF00-|r Fixed a problem with fast dps/hps when the window is in a empty segment.\n\n|cFFFFFF00-|r Fixed an issue using bookmark panel where it wasn't changing the display when the window is in a plugin mode.\n\n|cFFFFFF00-|r Fixed a bug when bars isn't using class colors on Frags, Auras & Void Zones, Resources and Deaths.\n\n|cFFFFFF00-|r Fixed bar animations when 'Sort Direction' is set to bottom.\n\n|cFFFFFF00-|r Fixed the spam 'you are not in a guild' when checking for new versions.\n\n|cFFFFFF00-|r Fixed translations for Auto Hide Settings bracket under options panel.\n\n|cFFFFFF00-|r Fixed Auto Hide -> Mouse Interaction tool where wans't able to work okey during combat.\n\n|cFFFFFF00v3.6.14b (|cFFFFCC00Jan 01, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'My Spells' which shows your spells in the window.\n\n|cFFFFFF00-|r Added new custom display: Health Potion & Stone.\n\n|cFFFFFF00-|r Added overkill on death's tooltip.\n\n|cFFFFFF00-|r Created custom spells for Twin Ogron's Pulverize. Now it has 3 spells one for each wave.\n\n|cFFFFFF00-|r Created custom spells for Ko'ragh Overflowing Energy. Now it has 2 spells one for when the ball is catched and other when it reaches the ground and explodes.\n\n|cFFFFFF00-|r Changed healing multistrike to use the same format as damage done.\n\n|cFFFFFF00-|r Few improvements on Tiny Threat plugin: color gradient green-red is fixed, texts and bar texture now correctly uses the window settings.\n\n|cFFFFFF00-|r Damage Taken by Spell won't show pets in its tooltip any more.\n\n|cFFFFFF00-|r Enemies display won't show any more mirror images and spirit link totems.\n\n|cFFFFFF00-|r Enemies's tooltip now only show players and show all players instead of only 6.\n\n|cFFFFFF00-|r Few cooldowns shown as raid wide now shows as personal cooldowns.\n\n|cFFFFFF00-|r Fixed dispell tagets on dispell's tooltip.\n\n|cFFFFFF00-|r Fixed 'First Hit' raid tool.\n\n|cFFFFFF00-|r Fixed 'Open Options Panel' from interface panel.\n\n|cFFFFFF00v3.6.8 (|cFFFFCC00Dec 24, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Fast (i mean, really fast) Dps/Hps update rate, its option is under Rows: Advanced -> Fast Updates.\n\n|cFFFFFF00-|r Created a custom spell for Mirror Image's Fireball and Frostbolt, with that Player Detail window distinguishes spells from the player and images.\n\n|cFFFFFF00-|r Added new skin: 'ElvUI Style II'.\n\n|cFFFFFF00-|r Added Observer mode for Raid Tools: report cooldown/interrupt/death of entire raid only to you in your chat window.\n\n|cFFFFFF00-|r Added new plugin 'Raid Check': tracks raid members checking food, flask and pre-potions usage.\n\n|cFFFFFF00-|r Changed DPS display, now it shows onyl the player's Dps and the Dps difference between him and the top ranked.\n\n|cFFFFFF00-|r Changed Overheal display, now its percentage shows the player's overheal percent.\n\n|cFFFFFF00-|r Player Detail Window now shows the amount of multistrike on normal and critical hits.\n\n|cFFFFFF00-|r Removed skin: 'ElvUI Frame Style BW'.\n\n|cFFFFFF00-|r The tooltip for Scale option under options panel, now shows the real value for the scale.\n\n|cFFFFFF00-|r Fixed Imperator Mar'gok's adds damage taken.\n\n|cFFFFFF00-|r Fixed a problem where multistrike was counting towards critical strike amount.\n\n|cFFFFFF00-|r Fixed death display's report where it was't showing any death.\n\n|cFFFFFF00-|r Fixed a small issue with Encounter Details plugin where sometimes gets a error right after a boss encounter.\n\n|cFFFFFF00-|r Fixed bugs on sending messages to chat for Raid Tools.\n\n\n\n|cFFFFFF00v3.5.1 (|cFFFFCC00Dec 16, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed few accuracy on miss spells.\n\n|cFFFFFF00v3.5.0 (|cFFFFCC00Dec 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltip for Auras and Voidzones, now shows sorted by damage and time.\n\n|cFFFFFF00-|r More fixes for Korgath encounter on Highmaul.\n\n|cFFFFFF00-|r Added slash commands: 'reset' 'config'.\n\n|cFFFFFF00-|r Spell bars on Player Details Window now is painted with the spell spellschool color." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_custom.lua b/classes/classe_custom.lua index 6eed61bc..52d8c145 100644 --- a/classes/classe_custom.lua +++ b/classes/classe_custom.lua @@ -356,6 +356,10 @@ local percent_script = _detalhes.custom_function_cache [instance.customName .. "Percent"] local total_script = _detalhes.custom_function_cache [instance.customName .. "Total"] + + local bars_show_data = instance.row_info.textR_show_data + local bars_brackets = instance:GetBarBracket() + local bars_separator = instance:GetBarSeparator() if (instance.bars_sort_direction == 1) then --top to bottom @@ -382,13 +386,13 @@ gump:Fade (row1, "out") for i = instance.barraS[1], iter_last, 1 do - instance_container._ActorTable[i]:UpdateBar (barras_container, qual_barra, percentage_type, i, total, top, instance, force, percent_script, total_script, combat) + instance_container._ActorTable[i]:UpdateBar (barras_container, qual_barra, percentage_type, i, total, top, instance, force, percent_script, total_script, combat, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end else for i = instance.barraS[1], instance.barraS[2], 1 do - instance_container._ActorTable[i]:UpdateBar (barras_container, qual_barra, percentage_type, i, total, top, instance, force, percent_script, total_script, combat) + instance_container._ActorTable[i]:UpdateBar (barras_container, qual_barra, percentage_type, i, total, top, instance, force, percent_script, total_script, combat, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end end @@ -418,13 +422,13 @@ gump:Fade (row1, "out") for i = iter_last, instance.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - instance_container._ActorTable[i]:UpdateBar (barras_container, qual_barra, percentage_type, i, total, top, instance, force, percent_script, total_script, combat) + instance_container._ActorTable[i]:UpdateBar (barras_container, qual_barra, percentage_type, i, total, top, instance, force, percent_script, total_script, combat, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end else for i = instance.barraS[2], instance.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - instance_container._ActorTable[i]:UpdateBar (barras_container, qual_barra, percentage_type, i, total, top, instance, force, percent_script, total_script, combat) + instance_container._ActorTable[i]:UpdateBar (barras_container, qual_barra, percentage_type, i, total, top, instance, force, percent_script, total_script, combat, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end end @@ -445,7 +449,7 @@ local actor_class_color_r, actor_class_color_g, actor_class_color_b - function atributo_custom:UpdateBar (row_container, index, percentage_type, rank, total, top, instance, is_forced, percent_script, total_script, combat) + function atributo_custom:UpdateBar (row_container, index, percentage_type, rank, total, top, instance, is_forced, percent_script, total_script, combat, bars_show_data, bars_brackets, bars_separator) local row = row_container [index] @@ -466,20 +470,26 @@ percent = _cstr ("%.1f", self.value / top * 100) end end - + + if (not bars_show_data [3]) then + percent = "" + else + percent = percent .. "%" + end + if (total_script) then local value = total_script (self.value, top, total, combat, instance) if (type (value) == "number") then - row.texto_direita:SetText (SelectedToKFunction (_, value) .. " (" .. percent .. "%)") + row.texto_direita:SetText (SelectedToKFunction (_, value) .. bars_brackets[1] .. percent .. bars_brackets[2]) else - row.texto_direita:SetText (value .. " (" .. percent .. "%)") + row.texto_direita:SetText (value .. bars_brackets[1] .. percent .. bars_brackets[2]) end else local formated_value = SelectedToKFunction (_, self.value) if (UsingCustomRightText) then row.texto_direita:SetText (_string_replace (instance.row_info.textR_custom_text, formated_value, "", percent, self)) else - row.texto_direita:SetText (formated_value .. " (" .. percent .. "%)") + row.texto_direita:SetText (formated_value .. bars_brackets[1] .. percent .. bars_brackets[2]) end end diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index ac8cefdb..83b6b215 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -282,11 +282,11 @@ --[[exported]] function _detalhes:GetBarColor (actor) actor = actor or self - if (actor.owner) then - return _unpack (_detalhes.class_colors [actor.owner.classe]) - - elseif (actor.monster) then + if (actor.monster) then return _unpack (_detalhes.class_colors.ENEMY) + + elseif (actor.owner) then + return _unpack (_detalhes.class_colors [actor.owner.classe]) elseif (actor.arena_enemy) then return _unpack (_detalhes.class_colors.ARENA_ENEMY) @@ -518,7 +518,21 @@ end esta_barra.texto_esquerdo:SetText (colocacao .. ". " .. tabela [1]) - esta_barra.texto_direita:SetText (tabela [2] .. " (" .. porcentagem .. "%)") + + local bars_show_data = instancia.row_info.textR_show_data + local bars_brackets = instancia:GetBarBracket() + + local total_frags = tabela [2] + if (not bars_show_data [1]) then + total_frags = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + + esta_barra.texto_direita:SetText (total_frags .. bars_brackets[1] .. porcentagem .. bars_brackets[2]) esta_barra.texto_esquerdo:SetTextColor (1, 1, 1, 1) esta_barra.texto_direita:SetTextColor (1, 1, 1, 1) @@ -728,7 +742,25 @@ if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_damage, formated_dps, porcentagem, self)) else - esta_barra.texto_direita:SetText (formated_damage .. " (" .. formated_dps .. ", " .. porcentagem .. "%)") + + local bars_show_data = instancia.row_info.textR_show_data + local bars_brackets = instancia:GetBarBracket() + local bars_separator = instancia:GetBarSeparator() + + if (not bars_show_data [1]) then + formated_damage = "" + end + if (not bars_show_data [2]) then + formated_dps = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + + esta_barra.texto_direita:SetText (formated_damage .. bars_brackets[1] .. formated_dps .. bars_separator .. porcentagem .. bars_brackets[2]) + end esta_barra.texto_esquerdo:SetText (colocacao .. ". " .. self.nome) @@ -1124,14 +1156,15 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh end - --print ("AMOUT: " .. amount) instancia:AtualizarScrollBar (amount) local qual_barra = 1 - local barras_container = instancia.barras --> evita buscar N vezes a key .barras dentro da instância + local barras_container = instancia.barras local percentage_type = instancia.row_info.percent_type + local bars_show_data = instancia.row_info.textR_show_data + local bars_brackets = instancia:GetBarBracket() + local bars_separator = instancia:GetBarSeparator() local baseframe = instancia.baseframe - local use_animations = _detalhes.is_using_row_animations and (not baseframe.isStretching and not forcar and not baseframe.isResizing) if (total == 0) then @@ -1206,15 +1239,15 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = instancia.barraS[1], iter_last-1, 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end - conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 else for i = instancia.barraS[1], iter_last, 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end end @@ -1222,15 +1255,15 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex else if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = instancia.barraS[1], instancia.barraS[2]-1, 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end - conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 else for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end end @@ -1262,31 +1295,31 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = iter_last-1, instancia.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end - conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 else for i = iter_last, instancia.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end end else if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = instancia.barraS[2]-1, instancia.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end - conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 else -- /run print (_detalhes:GetInstance(1).barraS[2]) -- vai do 5 ao 1 -- qual barra começa no 1 -- i = 5 até 1 -- player 5 atualiza na barra 1 / player 1 atualiza na barra 5 for i = instancia.barraS[2], instancia.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end end @@ -1320,7 +1353,7 @@ end local actor_class_color_r, actor_class_color_g, actor_class_color_b --self = esta classe de dano -function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra, lugar, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) +function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra, lugar, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) -- instância, container das barras, qual barra, colocação, total?, sub atributo, forçar refresh, key local esta_barra = barras_container [qual_barra] --> pega a referência da barra na janela @@ -1393,9 +1426,21 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra, if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_damage, formated_dps, porcentagem, self, instancia.showing)) else - esta_barra.texto_direita:SetText (formated_damage .. " (" .. formated_dps .. ", " .. porcentagem .. "%)") --seta o texto da direita + if (not bars_show_data [1]) then + formated_damage = "" + end + if (not bars_show_data [2]) then + formated_dps = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + esta_barra.texto_direita:SetText (formated_damage .. bars_brackets[1] .. formated_dps .. bars_separator .. porcentagem .. bars_brackets[2]) end - esta_porcentagem = _math_floor ((damage_total/instancia.top) * 100) --> determina qual o tamanho da barra + + esta_porcentagem = _math_floor ((damage_total/instancia.top) * 100) elseif (sub_atributo == 2) then --> mostrando dps @@ -1429,12 +1474,30 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra, rr, gg, bb = _detalhes:hex (_math_floor (rr*255)), _detalhes:hex (_math_floor (gg*255)), "28" local color_percent = "" .. rr .. gg .. bb .. "" - esta_barra.texto_direita:SetText (formated_dps .. " (|cFFFF4444-|r|cFF" .. color_percent .. SelectedToKFunction (_, _math_floor (diff_from_topdps)) .. "|r)") --seta o texto da direita + if (not bars_show_data [1]) then + formated_dps = "" + end + if (not bars_show_data [2]) then + color_percent = "" + else + color_percent = bars_brackets[1] .. "|cFFFF4444-|r|cFF" .. color_percent .. SelectedToKFunction (_, _math_floor (diff_from_topdps)) .. "|r" .. bars_brackets[2] + end + + esta_barra.texto_direita:SetText (formated_dps .. color_percent) else - esta_barra.texto_direita:SetText (formated_dps .. " |TInterface\\GROUPFRAME\\UI-Group-LeaderIcon:14:14:0:0:16:16:0:16:0:16|t ") --seta o texto da direita + + local icon = " |TInterface\\GROUPFRAME\\UI-Group-LeaderIcon:14:14:0:0:16:16:0:16:0:16|t " + if (not bars_show_data [1]) then + formated_dps = "" + end + if (not bars_show_data [2]) then + icon = "" + end + + esta_barra.texto_direita:SetText (formated_dps .. icon) end end - esta_porcentagem = _math_floor ((dps/instancia.top) * 100) --> determina qual o tamanho da barra + esta_porcentagem = _math_floor ((dps/instancia.top) * 100) elseif (sub_atributo == 3) then --> mostrando damage taken @@ -1447,9 +1510,21 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra, if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_damage_taken, formated_dtps, porcentagem, self, instancia.showing)) else - esta_barra.texto_direita:SetText (formated_damage_taken .." (" .. formated_dtps .. ", " .. porcentagem .. "%)") --seta o texto da direita -- + if (not bars_show_data [1]) then + formated_damage_taken = "" + end + if (not bars_show_data [2]) then + formated_dtps = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + esta_barra.texto_direita:SetText (formated_damage_taken .. bars_brackets[1] .. formated_dtps .. bars_separator .. porcentagem .. bars_brackets[2]) end - esta_porcentagem = _math_floor ((self.damage_taken/instancia.top) * 100) --> determina qual o tamanho da barra + + esta_porcentagem = _math_floor ((self.damage_taken/instancia.top) * 100) elseif (sub_atributo == 4) then --> mostrando friendly fire @@ -1457,10 +1532,20 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra, if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_friendly_fire, "", porcentagem, self, instancia.showing)) - else - esta_barra.texto_direita:SetText (formated_friendly_fire .. " (" .. porcentagem .. "%)") --seta o texto da direita -- + else + + if (not bars_show_data [1]) then + formated_friendly_fire = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + + esta_barra.texto_direita:SetText (formated_friendly_fire .. bars_brackets[1] .. porcentagem .. bars_brackets[2]) end - esta_porcentagem = _math_floor ((self.friendlyfire_total/instancia.top) * 100) --> determina qual o tamanho da barra + esta_porcentagem = _math_floor ((self.friendlyfire_total/instancia.top) * 100) elseif (sub_atributo == 6) then --> mostrando enemies @@ -1471,10 +1556,23 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra, if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_damage, formated_dps, porcentagem, self, instancia.showing)) - else - esta_barra.texto_direita:SetText (formated_damage .. " (" .. formated_dps .. ", " .. porcentagem .. "%)") --seta o texto da direita + else + + if (not bars_show_data [1]) then + formated_damage = "" + end + if (not bars_show_data [2]) then + formated_dps = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + esta_barra.texto_direita:SetText (formated_damage .. bars_brackets[1] .. formated_dps .. bars_separator .. porcentagem .. bars_brackets[2]) + end - esta_porcentagem = _math_floor ((damage_total/instancia.top) * 100) --> determina qual o tamanho da barra + esta_porcentagem = _math_floor ((damage_total/instancia.top) * 100) end @@ -1585,12 +1683,6 @@ end esta_barra.icone_classe:SetVertexColor (1, 1, 1) elseif (self.classe == "UNKNOW") then - --esta_barra.icone_classe:SetTexture ("Interface\\LFGFRAME\\LFGROLE") - --esta_barra.icone_classe:SetTexCoord (.25, .5, 0, 1) - - --esta_barra.icone_classe:SetTexture ([[Interface\TARGETINGFRAME\PetBadge-Undead]]) - --esta_barra.icone_classe:SetTexCoord (0.09375, 0.90625, 0.09375, 0.90625) - esta_barra.icone_classe:SetTexture ([[Interface\AddOns\Details\images\classes_plus]]) esta_barra.icone_classe:SetTexCoord (0.50390625, 0.62890625, 0, 0.125) diff --git a/classes/classe_energy.lua b/classes/classe_energy.lua index 44d627e7..a74ae67d 100644 --- a/classes/classe_energy.lua +++ b/classes/classe_energy.lua @@ -197,7 +197,6 @@ function atributo_energy:AtualizarResources (qual_barra, colocacao, instancia) local rps = _math_floor (self.resource / combat_time) local formated_resource = SelectedToKFunction (_, self.resource) - --local formated_rps = SelectedToKFunction (_, rps) local formated_rps = _cstr ("%.2f", self.resource / combat_time) local porcentagem @@ -211,7 +210,24 @@ function atributo_energy:AtualizarResources (qual_barra, colocacao, instancia) if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_resource, formated_rps, porcentagem, self)) else - esta_barra.texto_direita:SetText (formated_resource .. " (" .. formated_rps .. ", " .. porcentagem .. "%)") + + local bars_show_data = instancia.row_info.textR_show_data + local bars_brackets = instancia:GetBarBracket() + local bars_separator = instancia:GetBarSeparator() + + if (not bars_show_data [1]) then + formated_resource = "" + end + if (not bars_show_data [2]) then + formated_rps = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + + esta_barra.texto_direita:SetText (formated_resource .. bars_brackets[1] .. formated_rps .. bars_separator .. porcentagem .. bars_brackets[2]) end esta_barra.texto_esquerdo:SetText (colocacao .. ". " .. self.nome) @@ -438,6 +454,9 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex local qual_barra = 1 local barras_container = instancia.barras local percentage_type = instancia.row_info.percent_type + local bars_show_data = instancia.row_info.textR_show_data + local bars_brackets = instancia:GetBarBracket() + local bars_separator = instancia:GetBarSeparator() local baseframe = instancia.baseframe local use_animations = _detalhes.is_using_row_animations and (not baseframe.isStretching and not forcar and not baseframe.isResizing) @@ -502,15 +521,15 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = instancia.barraS[1], iter_last-1, 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 end - conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 else for i = instancia.barraS[1], iter_last, 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 end end @@ -518,15 +537,15 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex else if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = instancia.barraS[1], instancia.barraS[2]-1, 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 end - conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 else for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 end end @@ -558,30 +577,30 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = iter_last-1, instancia.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 end - conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 else for i = iter_last, instancia.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 end end else if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = instancia.barraS[2]-1, instancia.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 end - conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 else for i = instancia.barraS[2], instancia.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 end end @@ -605,7 +624,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex end -function atributo_energy:AtualizaBarra (instancia, barras_container, qual_barra, lugar, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) +function atributo_energy:AtualizaBarra (instancia, barras_container, qual_barra, lugar, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) local esta_barra = instancia.barras[qual_barra] --> pega a referência da barra na janela @@ -639,7 +658,16 @@ function atributo_energy:AtualizaBarra (instancia, barras_container, qual_barra, if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_energy, "", porcentagem, self, instancia.showing)) else - esta_barra.texto_direita:SetText (formated_energy .. " (" .. porcentagem .. "%)") --seta o texto da direita + if (not bars_show_data [1]) then + formated_energy = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + + esta_barra.texto_direita:SetText (formated_energy .. bars_brackets[1] .. porcentagem .. bars_brackets[2]) end if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip diff --git a/classes/classe_heal.lua b/classes/classe_heal.lua index 99a8bc5f..24971fe1 100644 --- a/classes/classe_heal.lua +++ b/classes/classe_heal.lua @@ -359,6 +359,9 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo local qual_barra = 1 local barras_container = instancia.barras --> evita buscar N vezes a key .barras dentro da instância local percentage_type = instancia.row_info.percent_type + local bars_show_data = instancia.row_info.textR_show_data + local bars_brackets = instancia:GetBarBracket() + local bars_separator = instancia:GetBarSeparator() local baseframe = instancia.baseframe local use_animations = _detalhes.is_using_row_animations and (not baseframe.isStretching and not forcar and not baseframe.isResizing) @@ -423,15 +426,15 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = instancia.barraS[1], iter_last-1, 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end - conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 else for i = instancia.barraS[1], iter_last, 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end end @@ -439,15 +442,15 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo else if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = instancia.barraS[1], instancia.barraS[2]-1, 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end - conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 else for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end end @@ -479,30 +482,30 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = iter_last-1, instancia.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end - conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 else for i = iter_last, instancia.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end end else if (following and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then for i = instancia.barraS[2]-1, instancia.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end - conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 else for i = instancia.barraS[2], instancia.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end end @@ -542,7 +545,7 @@ end local actor_class_color_r, actor_class_color_g, actor_class_color_b --function atributo_heal:AtualizaBarra (instancia, qual_barra, lugar, total, sub_atributo, forcar) -function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, lugar, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) +function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, lugar, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) local esta_barra = instancia.barras[qual_barra] --> pega a referência da barra na janela @@ -603,8 +606,9 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l -- >>>>>>>>>>>>>>> texto da direita if (instancia.atributo == 5) then --> custom - esta_barra.texto_direita:SetText (_detalhes:ToK (self.custom) .. " (" .. porcentagem .. "%)") --seta o texto da direita - esta_porcentagem = _math_floor ((self.custom/instancia.top) * 100) --> determina qual o tamanho da barra + esta_barra.texto_direita:SetText (_detalhes:ToK (self.custom) .. " (" .. porcentagem .. "%)") + esta_porcentagem = _math_floor ((self.custom/instancia.top) * 100) + else if (sub_atributo == 1) then --> mostrando healing done @@ -616,9 +620,22 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_heal, formated_hps, porcentagem, self, instancia.showing)) else - esta_barra.texto_direita:SetText (formated_heal .." (" .. formated_hps .. ", " .. porcentagem .. "%)") --seta o texto da direita + + if (not bars_show_data [1]) then + formated_heal = "" + end + if (not bars_show_data [2]) then + formated_hps = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + + esta_barra.texto_direita:SetText (formated_heal .. bars_brackets[1] .. formated_hps .. bars_separator .. porcentagem .. bars_brackets[2]) end - esta_porcentagem = _math_floor ((healing_total/instancia.top) * 100) --> determina qual o tamanho da barra + esta_porcentagem = _math_floor ((healing_total/instancia.top) * 100) elseif (sub_atributo == 2) then --> mostrando hps @@ -629,10 +646,23 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_hps, formated_heal, porcentagem, self, instancia.showing)) - else - esta_barra.texto_direita:SetText (formated_hps .. " (" .. formated_heal .. ", " .. porcentagem .. "%)") --seta o texto da direita + else + + if (not bars_show_data [1]) then + formated_hps = "" + end + if (not bars_show_data [2]) then + formated_heal = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + + esta_barra.texto_direita:SetText (formated_hps .. bars_brackets[1] .. formated_heal .. bars_separator .. porcentagem .. bars_brackets[2]) end - esta_porcentagem = _math_floor ((hps/instancia.top) * 100) --> determina qual o tamanho da barra + esta_porcentagem = _math_floor ((hps/instancia.top) * 100) elseif (sub_atributo == 3) then --> mostrando overall @@ -648,20 +678,40 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_overheal, "", overheal_percent, self, instancia.showing)) else - esta_barra.texto_direita:SetText (formated_overheal .." (" .. overheal_percent .. "%)") --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto? - end - esta_porcentagem = _math_floor ((self.totalover/instancia.top) * 100) --> determina qual o tamanho da barra - elseif (sub_atributo == 4) then --> mostrando healing take + if (not bars_show_data [1]) then + formated_overheal = "" + end + if (not bars_show_data [3]) then + overheal_percent = "" + else + overheal_percent = overheal_percent .. "%" + end + + esta_barra.texto_direita:SetText (formated_overheal .. bars_brackets[1] .. overheal_percent .. bars_brackets[2]) + end + esta_porcentagem = _math_floor ((self.totalover/instancia.top) * 100) + + elseif (sub_atributo == 4) then --> mostrando healing taken local formated_healtaken = SelectedToKFunction (_, self.healing_taken) if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_healtaken, "", porcentagem, self, instancia.showing)) - else - esta_barra.texto_direita:SetText (formated_healtaken .. " (" .. porcentagem .. "%)") --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto? + else + + if (not bars_show_data [1]) then + formated_healtaken = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + + esta_barra.texto_direita:SetText (formated_healtaken .. bars_brackets[1] .. porcentagem .. bars_brackets[2]) end - esta_porcentagem = _math_floor ((self.healing_taken/instancia.top) * 100) --> determina qual o tamanho da barra + esta_porcentagem = _math_floor ((self.healing_taken/instancia.top) * 100) elseif (sub_atributo == 5) then --> mostrando enemy heal @@ -670,9 +720,19 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_enemyheal, "", porcentagem, self, instancia.showing)) else - esta_barra.texto_direita:SetText (formated_enemyheal .. " (" .. porcentagem .. "%)") --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto? + + if (not bars_show_data [1]) then + formated_enemyheal = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + + esta_barra.texto_direita:SetText (formated_enemyheal .. bars_brackets[1] .. porcentagem .. bars_brackets[2]) end - esta_porcentagem = _math_floor ((self.heal_enemy_amt/instancia.top) * 100) --> determina qual o tamanho da barra + esta_porcentagem = _math_floor ((self.heal_enemy_amt/instancia.top) * 100) elseif (sub_atributo == 6) then --> mostrando damage prevented @@ -681,9 +741,19 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_absorbs, "", porcentagem, self, instancia.showing)) else - esta_barra.texto_direita:SetText (formated_absorbs .. " (" .. porcentagem .. "%)") --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto? + + if (not bars_show_data [1]) then + formated_absorbs = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + + esta_barra.texto_direita:SetText (formated_absorbs .. bars_brackets[1] .. porcentagem .. bars_brackets[2]) end - esta_porcentagem = _math_floor ((self.totalabsorb/instancia.top) * 100) --> determina qual o tamanho da barra + esta_porcentagem = _math_floor ((self.totalabsorb/instancia.top) * 100) end end @@ -1435,7 +1505,7 @@ function atributo_heal:MontaInfoOverHealing() end barra.texto_esquerdo:SetText (index..instancia.divisores.colocacao..tabela[4]) --seta o texto da esqueda - barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) --seta o texto da direita + barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) barra.icone:SetTexture (tabela[5]) @@ -1483,7 +1553,7 @@ function atributo_heal:MontaInfoOverHealing() end barra.texto_esquerdo:SetText (index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda - barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. instancia.divisores.fecha) --seta o texto da direita + barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. instancia.divisores.fecha) barra.texto_esquerdo:SetWidth (barra:GetWidth() - barra.texto_direita:GetStringWidth() - 30) -- icon @@ -1608,9 +1678,9 @@ function atributo_heal:MontaInfoHealingDone() barra.texto_esquerdo:SetText (index..instancia.divisores.colocacao..tabela[1]) --seta o texto da esqueda if (info.sub_atributo == 2) then - barra.texto_direita:SetText (_detalhes:comma_value (_math_floor (tabela[2]/meu_tempo)) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. instancia.divisores.fecha) --seta o texto da direita + barra.texto_direita:SetText (_detalhes:comma_value (_math_floor (tabela[2]/meu_tempo)) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. instancia.divisores.fecha) else - barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. instancia.divisores.fecha) --seta o texto da direita + barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .. _cstr ("%.1f", tabela[3]) .. instancia.divisores.fecha) end barra.minha_tabela = self @@ -1769,7 +1839,7 @@ function atributo_heal:MontaDetalhesHealingTaken (nome, barra) end barra.texto_esquerdo:SetText (index..instancia.divisores.colocacao..tabela[4]) --seta o texto da esqueda - barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) --seta o texto da direita + barra.texto_direita:SetText (_detalhes:comma_value (tabela[2]) .." ".. instancia.divisores.abre .._cstr("%.1f", tabela[3]) .."%".. instancia.divisores.fecha) barra.icone:SetTexture (tabela[5]) diff --git a/classes/classe_instancia_include.lua b/classes/classe_instancia_include.lua index c4e8a55c..a3b6eba7 100644 --- a/classes/classe_instancia_include.lua +++ b/classes/classe_instancia_include.lua @@ -173,9 +173,12 @@ _detalhes.instance_defaults = { --right text customization textR_enable_custom_text = false, textR_custom_text = "{data1} ({data2}, {data3}%)", + --right text show which infos + textR_show_data = {true, true, true}, + textR_bracket = "(", + textR_separator = ",", --left text bar number textL_show_number = true, - --if text class color are false, this color will be used fixed_text_color = {1, 1, 1}, --left text outline effect diff --git a/classes/classe_others.lua b/classes/classe_others.lua index 7e4ea891..d69fa6af 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -691,6 +691,9 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo local qual_barra = 1 local barras_container = instancia.barras local percentage_type = instancia.row_info.percent_type + local bars_show_data = instancia.row_info.textR_show_data + local bars_brackets = instancia:GetBarBracket() + local bars_separator = instancia:GetBarSeparator() local use_animations = _detalhes.is_using_row_animations and (not instancia.baseframe.isStretching and not forcar) if (total == 0) then @@ -702,13 +705,13 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo if (instancia.bars_sort_direction == 1) then --top to bottom for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, nil, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, nil, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end elseif (instancia.bars_sort_direction == 2) then --bottom to top for i = instancia.barraS[2], instancia.barraS[1], 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, nil, percentage_type, use_animations) --> instância, index, total, valor da 1º barra + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, nil, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) qual_barra = qual_barra+1 end @@ -744,7 +747,7 @@ end local actor_class_color_r, actor_class_color_g, actor_class_color_b -function atributo_misc:AtualizaBarra (instancia, barras_container, qual_barra, lugar, total, sub_atributo, forcar, keyName, is_dead, percentage_type, use_animations) +function atributo_misc:AtualizaBarra (instancia, barras_container, qual_barra, lugar, total, sub_atributo, forcar, keyName, is_dead, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator) local esta_barra = instancia.barras[qual_barra] --> pega a referência da barra na janela @@ -778,7 +781,18 @@ function atributo_misc:AtualizaBarra (instancia, barras_container, qual_barra, l if (UsingCustomRightText) then esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, meu_total, "", porcentagem, self, instancia.showing)) else - esta_barra.texto_direita:SetText (meu_total .." (" .. porcentagem .. "%)") --seta o texto da direita + + if (not bars_show_data [1]) then + meu_total = "" + end + if (not bars_show_data [3]) then + porcentagem = "" + else + porcentagem = porcentagem .. "%" + end + + esta_barra.texto_direita:SetText (meu_total .. bars_brackets[1] .. porcentagem .. bars_brackets[2]) + end if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 43ae9641..facacc32 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -6044,6 +6044,150 @@ function window:CreateFrame5() frame5.customLeftTextButton:GetNormalTexture():SetDesaturated (true) frame5.customLeftTextButton.tooltip = Loc ["STRING_OPTIONS_RESET_TO_DEFAULT"] + --> total dps percent bracket separator + + -- total + g:NewSwitch (frame5, _, "$parentRightTextShowTotalSlider", "RightTextShowTotalSlider", 60, 20, _, _, instance.row_info.textR_show_data [1]) + g:NewLabel (frame5, _, "$parentRightTextShowTotalLabel", "RightTextShowTotalLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_TOTAL"], "GameFontHighlightLeft") + + frame5.RightTextShowTotalSlider:SetPoint ("left", frame5.RightTextShowTotalLabel, "right", 2) + frame5.RightTextShowTotalSlider.OnSwitch = function (self, instance, value) + instance:SetBarRightTextSettings (value) + + if (_detalhes.options_group_edit and not DetailsOptionsWindow.loading_settings) then + for _, this_instance in ipairs (instance:GetInstanceGroup()) do + if (this_instance ~= instance) then + instance:SetBarRightTextSettings (value) + end + end + end + + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame5, "RightTextShowTotalSlider", "RightTextShowTotalLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_TOTAL_DESC"]) + + -- ps + g:NewSwitch (frame5, _, "$parentRightTextShowPSSlider", "RightTextShowPSSlider", 60, 20, _, _, instance.row_info.textR_show_data [2]) + g:NewLabel (frame5, _, "$parentRightTextShowPSLabel", "RightTextShowPSLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_PS"], "GameFontHighlightLeft") + + frame5.RightTextShowPSSlider:SetPoint ("left", frame5.RightTextShowPSLabel, "right", 2) + frame5.RightTextShowPSSlider.OnSwitch = function (self, instance, value) + instance:SetBarRightTextSettings (nil, value) + + if (_detalhes.options_group_edit and not DetailsOptionsWindow.loading_settings) then + for _, this_instance in ipairs (instance:GetInstanceGroup()) do + if (this_instance ~= instance) then + instance:SetBarRightTextSettings (nil, value) + end + end + end + + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame5, "RightTextShowPSSlider", "RightTextShowPSLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_PS_DESC"]) + + -- percent + + g:NewSwitch (frame5, _, "$parentRightTextShowPercentSlider", "RightTextShowPercentSlider", 60, 20, _, _, instance.row_info.textR_show_data [3]) + g:NewLabel (frame5, _, "$parentRightTextShowPercentLabel", "RightTextShowPercentLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_PERCENT"], "GameFontHighlightLeft") + + frame5.RightTextShowPercentSlider:SetPoint ("left", frame5.RightTextShowPercentLabel, "right", 2) + frame5.RightTextShowPercentSlider.OnSwitch = function (self, instance, value) + instance:SetBarRightTextSettings (nil, nil, value) + + if (_detalhes.options_group_edit and not DetailsOptionsWindow.loading_settings) then + for _, this_instance in ipairs (instance:GetInstanceGroup()) do + if (this_instance ~= instance) then + instance:SetBarRightTextSettings (nil, nil, value) + end + end + end + + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame5, "RightTextShowPercentSlider", "RightTextShowPercentLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_PERCENT_DESC"]) + + --brackets + local onSelectBracket = function (_, instance, value) + instance:SetBarRightTextSettings (nil, nil, nil, value) + + if (_detalhes.options_group_edit and not DetailsOptionsWindow.loading_settings) then + for _, this_instance in ipairs (instance:GetInstanceGroup()) do + if (this_instance ~= instance) then + instance:SetBarRightTextSettings (nil, nil, nil, value) + end + end + end + + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + local BracketTable = { + {value = "(", label = "(", onclick = onSelectBracket, icon = ""}, + {value = "{", label = "{", onclick = onSelectBracket, icon = ""}, + {value = "[", label = "[", onclick = onSelectBracket, icon = ""}, + {value = "<", label = "<", onclick = onSelectBracket, icon = ""}, + {value = "NONE", label = "no bracket", onclick = onSelectBracket, icon = [[Interface\Glues\LOGIN\Glues-CheckBox-Check]]}, + } + local buildBracketMenu = function() + return BracketTable + end + + local d = g:NewDropDown (frame5, _, "$parentBracketDropdown", "BracketDropdown", 60, 20, buildBracketMenu, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + + g:NewLabel (frame5, _, "$parentBracketLabel", "BracketLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_BRACKET"], "GameFontHighlightLeft") + frame5.BracketDropdown:SetPoint ("left", frame5.BracketLabel, "right", 2) + + window:CreateLineBackground2 (frame5, "BracketDropdown", "BracketLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_BRACKET_DESC"]) + + --separators + local onSelectSeparator = function (_, instance, value) + instance:SetBarRightTextSettings (nil, nil, nil, nil, value) + + if (_detalhes.options_group_edit and not DetailsOptionsWindow.loading_settings) then + for _, this_instance in ipairs (instance:GetInstanceGroup()) do + if (this_instance ~= instance) then + instance:SetBarRightTextSettings (nil, nil, nil, nil, value) + end + end + end + + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + local SeparatorTable = { + {value = ",", label = ",", onclick = onSelectSeparator, icon = ""}, + {value = ".", label = ".", onclick = onSelectSeparator, icon = ""}, + {value = ";", label = ";", onclick = onSelectSeparator, icon = ""}, + {value = "-", label = "-", onclick = onSelectSeparator, icon = ""}, + {value = "|", label = "|", onclick = onSelectSeparator, icon = ""}, + {value = "/", label = "/", onclick = onSelectSeparator, icon = ""}, + {value = "\\", label = "\\", onclick = onSelectSeparator, icon = ""}, + {value = "~", label = "~", onclick = onSelectSeparator, icon = ""}, + {value = "NONE", label = "no separator", onclick = onSelectSeparator, icon = [[Interface\Glues\LOGIN\Glues-CheckBox-Check]]}, + } + local buildSeparatorMenu = function() + return SeparatorTable + end + + local d = g:NewDropDown (frame5, _, "$parentSeparatorDropdown", "SeparatorDropdown", 60, 20, buildSeparatorMenu, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + + g:NewLabel (frame5, _, "$parentSeparatorLabel", "SeparatorLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_SEPARATOR"], "GameFontHighlightLeft") + frame5.SeparatorDropdown:SetPoint ("left", frame5.SeparatorLabel, "right", 2) + + window:CreateLineBackground2 (frame5, "SeparatorDropdown", "SeparatorLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_SEPARATOR_DESC"]) + --> anchors --general anchor @@ -6064,24 +6208,31 @@ function window:CreateFrame5() {"textLeftOutlineLabel", 2}, {"classColorsLeftTextLabel", 3}, {"PositionNumberLabel", 4}, - {"cutomLeftTextLabel", 5}, + {"cutomLeftTextLabel", 5, true}, {"cutomLeftTextEntryLabel", 6}, - {"RightTextAnchorLabel", 7, true}, - {"textRightOutlineLabel", 8}, - {"classColorsRightTextLabel", 9}, - {"cutomRightTextLabel", 10}, - {"cutomRightTextEntryLabel", 11}, + {"RowGeneralAnchorLabel", 7, true}, + {frame5.fonsizeLabel, 8}, --text size + {frame5.fontLabel, 9},--text fontface + {frame5.fixedTextColorLabel, 10}, + {frame5.percentLabel, 11, true}, } window:arrange_menu (frame5, left_side, x, window.top_start_at) local right_side = { - {"RowGeneralAnchorLabel", 1, true}, - {frame5.fonsizeLabel, 2}, --text size - {frame5.fontLabel, 3},--text fontface - {frame5.fixedTextColorLabel, 4}, - {frame5.percentLabel, 5}, + {"RightTextAnchorLabel", 1, true}, + {"textRightOutlineLabel", 2}, + {"classColorsRightTextLabel", 3}, + + {"RightTextShowTotalLabel", 4, true}, + {"RightTextShowPSLabel", 5}, + {"RightTextShowPercentLabel", 6}, + {"SeparatorLabel", 7, true}, + {"BracketLabel", 8}, + + {"cutomRightTextLabel", 9, true}, + {"cutomRightTextEntryLabel", 10}, } window:arrange_menu (frame5, right_side, window.right_start_at, window.top_start_at) @@ -9683,7 +9834,19 @@ end --> if not window _G.DetailsOptionsWindow5PositionNumberSlider.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow5PositionNumberSlider.MyObject:SetValue (editing_instance.row_info.textL_show_number) + + _G.DetailsOptionsWindow5BracketDropdown.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow5SeparatorDropdown.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow5RightTextShowTotalSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow5RightTextShowPSSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow5RightTextShowPercentSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow5BracketDropdown.MyObject:Select (editing_instance.row_info.textR_bracket) + _G.DetailsOptionsWindow5SeparatorDropdown.MyObject:Select (editing_instance.row_info.textR_separator) + _G.DetailsOptionsWindow5RightTextShowTotalSlider.MyObject:SetValue (editing_instance.row_info.textR_show_data [1]) + _G.DetailsOptionsWindow5RightTextShowPSSlider.MyObject:SetValue (editing_instance.row_info.textR_show_data [2]) + _G.DetailsOptionsWindow5RightTextShowPercentSlider.MyObject:SetValue (editing_instance.row_info.textR_show_data [3]) + --> window 6 _G.DetailsOptionsWindow6BackdropDropdown.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow6BackdropDropdown.MyObject:Select (editing_instance.backdrop_texture) diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index fc5368f7..9e5abf05 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -3592,6 +3592,57 @@ function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, back end +local brackets = { + ["("] = {" (", ")"}, + ["{"] = {" {", "}"}, + ["["] = {" [", "]"}, + ["<"] = {" <", ">"}, + ["NONE"] = {" ", ""}, +} + +local separators = { + [","] = ", ", + ["."] = ". ", + [";"] = "; ", + ["-"] = " - ", + ["|"] = " | ", + ["/"] = " / ", + ["\\"] = " \\ ", + ["~"] = " ~ ", + ["NONE"] = "", +} + +function _detalhes:GetBarBracket() + return brackets [self.row_info.textR_bracket] +end + +function _detalhes:GetBarSeparator() + return separators [self.row_info.textR_separator] +end + +function _detalhes:SetBarRightTextSettings (total, persecond, percent, bracket, separator) + + if (type (total) == "boolean") then + self.row_info.textR_show_data [1] = total + end + if (type (persecond) == "boolean") then + self.row_info.textR_show_data [2] = persecond + end + if (type (percent) == "boolean") then + self.row_info.textR_show_data [3] = percent + end + + if (bracket) then + self.row_info.textR_bracket = bracket + end + if (separator) then + self.row_info.textR_separator = separator + end + + self:InstanceReset() + +end + --/script _detalhes:InstanceRefreshRows (_detalhes.tabela_instancias[1]) --> on update function @@ -5472,6 +5523,7 @@ function _detalhes:ChangeSkin (skin_name) self:SetBarSettings (self.row_info.height) self:SetBarBackdropSettings() self:SetBarSpecIconSettings() + self:SetBarRightTextSettings() --> update toolbar self:ToolbarSide() diff --git a/images/spec_icons_normal_alpha.tga b/images/spec_icons_normal_alpha.tga index 97d0f379..4340b921 100644 Binary files a/images/spec_icons_normal_alpha.tga and b/images/spec_icons_normal_alpha.tga differ