From c9f2e89b1bed93cb936c48cbb6075470ada413f5 Mon Sep 17 00:00:00 2001 From: tercio Date: Wed, 8 Oct 2014 18:53:23 -0300 Subject: [PATCH] - Fixed many issues with bar animations. - Fixed combat encounter start if the player already is in combat when the boss is pulled. - Fixed wheel scroll when sometimes it get doesn't scroll or scroll very slow. - Added option 'Always Show Me' which when enabled always show your bar at the bottom of the window. - Added option 'First Hit' which when enabled show who did the first struck in the combat. - Added a panel to change class colors. --- boot.lua | 18 +- classes/classe_damage.lua | 289 ++++++++++++++------------- classes/classe_energy.lua | 144 +++++++++---- classes/classe_heal.lua | 167 ++++++++++------ classes/classe_instancia_include.lua | 2 + classes/classe_others.lua | 59 +++--- core/parser.lua | 17 ++ core/windows.lua | 102 +++++++++- framework/button.lua | 4 +- functions/profiles.lua | 6 +- gumps/janela_options.lua | 66 ++++-- gumps/janela_principal.lua | 72 ++++++- images/icons.tga | Bin 535849 -> 539276 bytes 13 files changed, 643 insertions(+), 303 deletions(-) diff --git a/boot.lua b/boot.lua index 660a1a94..470a800f 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 = 93 --it's 93 for release - _detalhes.userversion = "v1.28.3" + _detalhes.build_counter = 93 --it's 97 for release + _detalhes.userversion = "v1.29.0" _detalhes.realversion = 28 _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" @@ -18,19 +18,13 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v1.28.0 (|cFFFFCC00Set 29, 2014|r|cFFFFFF00)|r:\n\n -|cFFFFFF00-|r Added a Change Log button on Options Panel.\n\n -|cFFFFFF00-|r Added option to use the same profile on all characters without asking.\n\n -|cFFFFFF00-|r Added a shortcut color button on main panel on Options Panel.\n\n -|cFFFFFF00-|r Added auto erase/ask to erase options.\n\n -|cFFFFFF00-|r Bars now highlight when hover over.\n\n -|cFFFFFF00-|r Fixed problem with drag the window when the toolbar is on the bottom side.\n\n -|cFFFFFF00-|r Added scale option.\n\n -|cFFFFFF00-|r Added support for plugin descriptions on options panel.\n\n + +|cFFFFFF00-|r .\n\n + --]] - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.28.3 (|cFFFFCC00Oct 04, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for plugin descriptions on options panel.\n\n|cFFFFFF00-|r Added scale option.\n\n|cFFFFFF00-|r Added a Change Log button on Options Panel.\n\n|cFFFFFF00-|r Added option to use the same profile on all characters without asking.\n\n|cFFFFFF00-|r Added a shortcut color button on main panel on Options Panel.\n\n|cFFFFFF00-|r Added auto erase/ask to erase options.\n\n|cFFFFFF00-|r Bars now highlight when hover over.\n\n|cFFFFFF00-|r Fixed problem with drag the window when the toolbar is on the bottom side.\n\n|cFFFFFF00v1.27.0 (|cFFFFCC00Set 27, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Minimalistic skin is now the old minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 got a new texture, little more darker.\n\n|cFFFFFF00-|r Few tweaks to make more easy making groups of windows.\n\n|cFFFFFF00-|r Bookmark now accepts more than two columns.\n\n|cFFFFFF00v1.26.3 (|cFFFFCC00Set 18, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Changed the way to set the broker text to be more customizable.\n\n|cFFFFFF00-|r Fixed the problem with custom display report.\n\n|cFFFFFF00-|r Added tutorial and a config panel for bookmarks.\n\n|cFFFFFF00-|r Added option for choose the format type of data broker's text.\n\n|cFFFFFF00-|r Changed few icons on damage done tooltip.\n\n|cFFFFFF00-|r Fixed the class color on texts for healing attribute.\n\n|cFFFFFF00-|r Added options for change the tooltip border's size, color and texture.\n\n|cFFFFFF00-|r Added buttons for test interrupt and cooldown announcers under raid tools section.\n\n|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." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.29.0 (|cFFFFCC00Oct 08, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed many issues with bar animations.\n\n|cFFFFFF00-|r Fixed combat encounter start if the player already is in combat when the boss is pulled.\n\n|cFFFFFF00-|r Fixed wheel scroll when sometimes it move very slow or doesn't move the bars at all.\n\n|cFFFFFF00-|r Added option 'Always Show Me' which when enabled and you aren't at the top ranked players shown in the window, it forces to show you in the last bar.\n\n|cFFFFFF00-|r Added option 'First Hit' which when enabled show who did the first struck in the combat (normally is who pulled the boss).\n\n|cFFFFFF00-|r Added a panel to change class colors.\n\n|cFFFFFF00v1.28.3 (|cFFFFCC00Oct 04, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for plugin descriptions on options panel.\n\n|cFFFFFF00-|r Added scale option.\n\n|cFFFFFF00-|r Added a Change Log button on Options Panel.\n\n|cFFFFFF00-|r Added option to use the same profile on all characters without asking.\n\n|cFFFFFF00-|r Added a shortcut color button on main panel on Options Panel.\n\n|cFFFFFF00-|r Added auto erase/ask to erase options.\n\n|cFFFFFF00-|r Bars now highlight when hover over.\n\n|cFFFFFF00-|r Fixed problem with drag the window when the toolbar is on the bottom side.\n\n|cFFFFFF00v1.27.0 (|cFFFFCC00Set 27, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Minimalistic skin is now the old minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 got a new texture, little more darker.\n\n|cFFFFFF00-|r Few tweaks to make more easy making groups of windows.\n\n|cFFFFFF00-|r Bookmark now accepts more than two columns.\n\n|cFFFFFF00v1.26.3 (|cFFFFCC00Set 18, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Changed the way to set the broker text to be more customizable.\n\n|cFFFFFF00-|r Fixed the problem with custom display report.\n\n|cFFFFFF00-|r Added tutorial and a config panel for bookmarks.\n\n|cFFFFFF00-|r Added option for choose the format type of data broker's text.\n\n|cFFFFFF00-|r Changed few icons on damage done tooltip.\n\n|cFFFFFF00-|r Fixed the class color on texts for healing attribute.\n\n|cFFFFFF00-|r Added options for change the tooltip border's size, color and texture.\n\n|cFFFFFF00-|r Added buttons for test interrupt and cooldown announcers under raid tools section.\n\n|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." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " --> startup diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index 82b04285..4fe95459 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -1045,152 +1045,170 @@ 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 percentage_type = instancia.row_info.percent_type + 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 total = 0.00000001 end - local myPos = showing._NameIndexTable [_detalhes.playername] + local myPos + local following = instancia.following.enabled - _detalhes.following_type = 0 - - if (_detalhes.following_type == 1 and myPos and myPos > instancia.rows_fit_in_window) then --> follow tests - - --> test - local top, bottom - - local cabe_quantas = instancia.rows_fit_in_window - local metade, eh_impar = floor (cabe_quantas / 2), cabe_quantas % 2 > 0 - if (eh_impar) then - metade = ceil (metade) + if (following) then + if (using_cache) then + local pname = _detalhes.playername + for i, actor in _ipairs (conteudo) do + if (actor.nome == pname) then + myPos = i + break + end + end + else + myPos = showing._NameIndexTable [_detalhes.playername] end - - local total_actors = amount - - local top = math.max (1, myPos-metade) -- 10 - 4 = 6 6 7 8 9 [10] 11 12 13 - local bottom = math.max (top + cabe_quantas -1, myPos) + end - for i = top, bottom, 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) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 - end + local combat_time = instancia.showing:GetCombatTime() - elseif (_detalhes.following_type == 2 and myPos and myPos > instancia.rows_fit_in_window and instancia.barraS[2] < myPos) then --> follow tests + UsingCustomLeftText = instancia.row_info.textL_enable_custom_text + UsingCustomRightText = instancia.row_info.textR_enable_custom_text - local cabe_quantas = instancia.rows_fit_in_window + local use_total_bar = false + if (instancia.total_bar.enabled) then + + use_total_bar = true - 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) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 + if (instancia.total_bar.only_in_group and (not _IsInGroup() and not _IsInRaid())) then + use_total_bar = false end - conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 - - else - - local combat_time = instancia.showing:GetCombatTime() - - UsingCustomLeftText = instancia.row_info.textL_enable_custom_text - UsingCustomRightText = instancia.row_info.textR_enable_custom_text - - local use_total_bar = false - if (instancia.total_bar.enabled) then - - use_total_bar = true - - if (instancia.total_bar.only_in_group and (not _IsInGroup() and not _IsInRaid())) then - use_total_bar = false - end - - if (sub_atributo > 4) then --enemies, frags, void zones - use_total_bar = false - end - - end - - if (instancia.bars_sort_direction == 1) then --top to bottom - - if (use_total_bar and instancia.barraS[1] == 1) then - - qual_barra = 2 - local iter_last = instancia.barraS[2] - if (iter_last == instancia.rows_fit_in_window) then - iter_last = iter_last - 1 - end - - local row1 = barras_container [1] - row1.minha_tabela = nil - row1.texto_esquerdo:SetText (Loc ["STRING_TOTAL"]) - row1.texto_direita:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") - - row1.statusbar:SetValue (100) - local r, b, g = unpack (instancia.total_bar.color) - row1.textura:SetVertexColor (r, b, g) - - row1.icone_classe:SetTexture (instancia.total_bar.icon) - row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) - - gump:Fade (row1, "out") - - 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) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 - end - - 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) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 - end - end - - elseif (instancia.bars_sort_direction == 2) then --bottom to top - - if (use_total_bar and instancia.barraS[1] == 1) then - - qual_barra = 2 - local iter_last = instancia.barraS[2] - if (iter_last == instancia.rows_fit_in_window) then - iter_last = iter_last - 1 - end - - local row1 = barras_container [1] - row1.minha_tabela = nil - row1.texto_esquerdo:SetText (Loc ["STRING_TOTAL"]) - row1.texto_direita:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") - - row1.statusbar:SetValue (100) - local r, b, g = unpack (instancia.total_bar.color) - row1.textura:SetVertexColor (r, b, g) - - row1.icone_classe:SetTexture (instancia.total_bar.icon) - row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) - - gump:Fade (row1, "out") - - 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) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 - end - - 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) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 - end - end - + if (sub_atributo > 4) then --enemies, frags, void zones + use_total_bar = false end end - if (_detalhes.is_using_row_animations) then + if (instancia.bars_sort_direction == 1) then --top to bottom + + if (use_total_bar and instancia.barraS[1] == 1) then + + qual_barra = 2 + local iter_last = instancia.barraS[2] + if (iter_last == instancia.rows_fit_in_window) then + iter_last = iter_last - 1 + end + + local row1 = barras_container [1] + row1.minha_tabela = nil + row1.texto_esquerdo:SetText (Loc ["STRING_TOTAL"]) + row1.texto_direita:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") + + row1.statusbar:SetValue (100) + local r, b, g = unpack (instancia.total_bar.color) + row1.textura:SetVertexColor (r, b, g) + + row1.icone_classe:SetTexture (instancia.total_bar.icon) + row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) + + gump:Fade (row1, "out") + + 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 + 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 + 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 + 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[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 + 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 + 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 + qual_barra = qual_barra+1 + end + end + end + + elseif (instancia.bars_sort_direction == 2) then --bottom to top + + if (use_total_bar and instancia.barraS[1] == 1) then + + qual_barra = 2 + local iter_last = instancia.barraS[2] + if (iter_last == instancia.rows_fit_in_window) then + iter_last = iter_last - 1 + end + + local row1 = barras_container [1] + row1.minha_tabela = nil + row1.texto_esquerdo:SetText (Loc ["STRING_TOTAL"]) + row1.texto_direita:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") + + row1.statusbar:SetValue (100) + local r, b, g = unpack (instancia.total_bar.color) + row1.textura:SetVertexColor (r, b, g) + + row1.icone_classe:SetTexture (instancia.total_bar.icon) + row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) + + gump:Fade (row1, "out") + + 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 + 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 + 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 + 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 + 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 + 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 + qual_barra = qual_barra+1 + end + end + end + + end + + if (use_animations) then instancia:fazer_animacoes() end @@ -1261,7 +1279,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) +function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra, lugar, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) -- 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 @@ -1405,11 +1423,11 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra, actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() - return self:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container) + return self:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container, use_animations) end ---[[ exported]] function _detalhes:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container) +--[[ exported]] function _detalhes:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container, use_animations) --> primeiro colocado if (esta_barra.colocacao == 1) then @@ -1430,7 +1448,7 @@ end --esta_barra.statusbar:SetValue (esta_porcentagem) - if (_detalhes.is_using_row_animations and not forcar) then + if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else esta_barra.statusbar:SetValue (esta_porcentagem) @@ -1452,7 +1470,7 @@ end --> agora esta comparando se a tabela da barra é diferente da tabela na atualização anterior if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then --> aqui diz se a barra do jogador mudou de posição ou se ela apenas será atualizada - if (_detalhes.is_using_row_animations and not forcar) then + if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else esta_barra.statusbar:SetValue (esta_porcentagem) @@ -1461,21 +1479,18 @@ end esta_barra.last_value = esta_porcentagem --> reseta o ultimo valor da barra - --if (_detalhes.is_using_row_animations and forcar) then - -- esta_barra.tem_animacao = false - -- esta_barra:SetScript ("OnUpdate", nil) - --end - return self:RefreshBarra (esta_barra, instancia) elseif (esta_porcentagem ~= esta_barra.last_value) then --> continua mostrando a mesma tabela então compara a porcentagem --> apenas atualizar - if (_detalhes.is_using_row_animations) then + if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else esta_barra.statusbar:SetValue (esta_porcentagem) end esta_barra.last_value = esta_porcentagem + + return self:RefreshBarra (esta_barra, instancia) end end @@ -1550,7 +1565,7 @@ end if (instancia.row_info.textL_show_number) then bar_number = esta_barra.colocacao .. ". " end - + if (self.enemy) then if (self.arena_enemy) then if (UsingCustomLeftText) then diff --git a/classes/classe_energy.lua b/classes/classe_energy.lua index 8b8c960e..df785685 100644 --- a/classes/classe_energy.lua +++ b/classes/classe_energy.lua @@ -286,27 +286,46 @@ 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 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 + total = 0.00000001 + end + + local myPos + local following = instancia.following.enabled + + if (following) then + if (using_cache) then + local pname = _detalhes.playername + for i, actor in _ipairs (conteudo) do + if (actor.nome == pname) then + myPos = i + break + end + end + else + myPos = showing._NameIndexTable [_detalhes.playername] + end + end + local combat_time = instancia.showing:GetCombatTime() UsingCustomLeftText = instancia.row_info.textL_enable_custom_text UsingCustomRightText = instancia.row_info.textR_enable_custom_text local use_total_bar = false if (instancia.total_bar.enabled) then - use_total_bar = true if (instancia.total_bar.only_in_group and (not _IsInGroup() and not _IsInRaid())) then use_total_bar = false end - - if (sub_atributo > 4) then --enemies, frags, void zones - use_total_bar = false - end - end if (instancia.bars_sort_direction == 1) then --top to bottom + if (use_total_bar and instancia.barraS[1] == 1) then qual_barra = 2 @@ -329,19 +348,40 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex gump:Fade (row1, "out") - 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) --> instância, index, total, valor da 1º barra + 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 + 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 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 + qual_barra = qual_barra+1 + end end - + 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) --> instância, index, total, valor da 1º barra + 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 + 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 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 + qual_barra = qual_barra+1 + end end end elseif (instancia.bars_sort_direction == 2) then --bottom to top + if (use_total_bar and instancia.barraS[1] == 1) then qual_barra = 2 @@ -364,17 +404,41 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex gump:Fade (row1, "out") - 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) --> instância, index, total, valor da 1º barra + 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 + 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 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 + qual_barra = qual_barra+1 + end end - 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) --> instância, index, total, valor da 1º barra + 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 + 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 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 + qual_barra = qual_barra+1 + end end end + + end + + if (use_animations) then + instancia:fazer_animacoes() end if (instancia.atributo == 5) then --> custom @@ -417,7 +481,7 @@ end local actor_class_color_r, actor_class_color_g, actor_class_color_b -function atributo_energy:AtualizaBarra (instancia, barras_container, qual_barra, lugar, total, sub_atributo, forcar, keyName, combat_time, percentage_type) +function atributo_energy:AtualizaBarra (instancia, barras_container, qual_barra, lugar, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) local esta_barra = instancia.barras[qual_barra] --> pega a referência da barra na janela @@ -460,10 +524,10 @@ function atributo_energy:AtualizaBarra (instancia, barras_container, qual_barra, actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() - return self:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container) + return self:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container, use_animations) end -function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container) +function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container, use_animations) --> primeiro colocado if (esta_barra.colocacao == 1) then @@ -482,7 +546,15 @@ function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior, if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then - esta_barra.statusbar:SetValue (esta_porcentagem) + --esta_barra.statusbar:SetValue (esta_porcentagem) + + if (use_animations) then + esta_barra.animacao_fim = esta_porcentagem + else + esta_barra.statusbar:SetValue (esta_porcentagem) + esta_barra.animacao_ignorar = true + end + gump:Fade (esta_barra, "out") if (instancia.row_info.texture_class_colors) then @@ -498,35 +570,27 @@ function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior, --> agora esta comparando se a tabela da barra é diferente da tabela na atualização anterior if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then --> aqui diz se a barra do jogador mudou de posição ou se ela apenas será atualizada - esta_barra.statusbar:SetValue (esta_porcentagem) + if (use_animations) then + esta_barra.animacao_fim = esta_porcentagem + else + esta_barra.statusbar:SetValue (esta_porcentagem) + esta_barra.animacao_ignorar = true + end esta_barra.last_value = esta_porcentagem --> reseta o ultimo valor da barra - - if (_detalhes.is_using_row_animations and forcar) then - esta_barra.tem_animacao = 0 - esta_barra:SetScript ("OnUpdate", nil) - end - + return self:RefreshBarra (esta_barra, instancia) elseif (esta_porcentagem ~= esta_barra.last_value) then --> continua mostrando a mesma tabela então compara a porcentagem --> apenas atualizar - if (_detalhes.is_using_row_animations) then - - local upRow = barras_container [qual_barra-1] - if (upRow) then - if (upRow.statusbar:GetValue() < esta_barra.statusbar:GetValue()) then - esta_barra.statusbar:SetValue (esta_porcentagem) - else - instancia:AnimarBarra (esta_barra, esta_porcentagem) - end - else - instancia:AnimarBarra (esta_barra, esta_porcentagem) - end + if (use_animations) then + esta_barra.animacao_fim = esta_porcentagem else esta_barra.statusbar:SetValue (esta_porcentagem) end esta_barra.last_value = esta_porcentagem + + return self:RefreshBarra (esta_barra, instancia) end end diff --git a/classes/classe_heal.lua b/classes/classe_heal.lua index 34d1bf06..e560ebf1 100644 --- a/classes/classe_heal.lua +++ b/classes/classe_heal.lua @@ -352,15 +352,36 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh end - --estra mostrando ALL então posso seguir o padrão correto? primeiro, atualiza a scroll bar... instancia:AtualizarScrollBar (amount) --depois faz a atualização normal dele através dos iterators 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 baseframe = instancia.baseframe - --print (sub_atributo, total, keyName) + local use_animations = _detalhes.is_using_row_animations and (not baseframe.isStretching and not forcar and not baseframe.isResizing) + + if (total == 0) then + total = 0.00000001 + end + + local myPos + local following = instancia.following.enabled + + if (following) then + if (using_cache) then + local pname = _detalhes.playername + for i, actor in _ipairs (conteudo) do + if (actor.nome == pname) then + myPos = i + break + end + end + else + myPos = showing._NameIndexTable [_detalhes.playername] + end + end local combat_time = instancia.showing:GetCombatTime() UsingCustomLeftText = instancia.row_info.textL_enable_custom_text @@ -368,22 +389,17 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo local use_total_bar = false if (instancia.total_bar.enabled) then - use_total_bar = true if (instancia.total_bar.only_in_group and (not _IsInGroup() and not _IsInRaid())) then use_total_bar = false end - - if (sub_atributo > 6) then --enemies, frags, void zones - use_total_bar = false - end - end if (instancia.bars_sort_direction == 1) then --top to bottom - + if (use_total_bar and instancia.barraS[1] == 1) then + qual_barra = 2 local iter_last = instancia.barraS[2] if (iter_last == instancia.rows_fit_in_window) then @@ -404,54 +420,96 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo gump:Fade (row1, "out") - 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) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 - end - else - - if (use_total_bar and instancia.barraS[1] == 1) then - - qual_barra = 2 - local iter_last = instancia.barraS[2] - if (iter_last == instancia.rows_fit_in_window) then - iter_last = iter_last - 1 - end - - local row1 = barras_container [1] - row1.minha_tabela = nil - row1.texto_esquerdo:SetText (Loc ["STRING_TOTAL"]) - row1.texto_direita:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") - - row1.statusbar:SetValue (100) - local r, b, g = unpack (instancia.total_bar.color) - row1.textura:SetVertexColor (r, b, g) - - row1.icone_classe:SetTexture (instancia.total_bar.icon) - row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) - - gump:Fade (row1, "out") - - 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) --> instância, index, total, valor da 1º barra + 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 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 + 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 + 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[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 + 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 + 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) --> 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) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 end end 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, combat_time, percentage_type) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 + + if (use_total_bar and instancia.barraS[1] == 1) then + + qual_barra = 2 + local iter_last = instancia.barraS[2] + if (iter_last == instancia.rows_fit_in_window) then + iter_last = iter_last - 1 + end + + local row1 = barras_container [1] + row1.minha_tabela = nil + row1.texto_esquerdo:SetText (Loc ["STRING_TOTAL"]) + row1.texto_direita:SetText (_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") + + row1.statusbar:SetValue (100) + local r, b, g = unpack (instancia.total_bar.color) + row1.textura:SetVertexColor (r, b, g) + + row1.icone_classe:SetTexture (instancia.total_bar.icon) + row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) + + gump:Fade (row1, "out") + + 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 + 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 + 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 + 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 + 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 + 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 + qual_barra = qual_barra+1 + end + end end + end - if (_detalhes.is_using_row_animations) then + if (use_animations) then instancia:fazer_animacoes() end @@ -499,7 +557,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) +function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, lugar, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations) local esta_barra = instancia.barras[qual_barra] --> pega a referência da barra na janela @@ -641,10 +699,10 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() - return self:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container) + return self:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container, use_animations) end -function atributo_heal:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container) +function atributo_heal:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container, use_animations) --> primeiro colocado if (esta_barra.colocacao == 1) then @@ -665,7 +723,7 @@ function atributo_heal:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo --esta_barra.statusbar:SetValue (esta_porcentagem) - if (_detalhes.is_using_row_animations and not forcar) then + if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else esta_barra.statusbar:SetValue (esta_porcentagem) @@ -687,7 +745,7 @@ function atributo_heal:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo --> agora esta comparando se a tabela da barra é diferente da tabela na atualização anterior if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then --> aqui diz se a barra do jogador mudou de posição ou se ela apenas será atualizada - if (_detalhes.is_using_row_animations and not forcar) then + if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else esta_barra.statusbar:SetValue (esta_porcentagem) @@ -695,22 +753,19 @@ function atributo_heal:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo end esta_barra.last_value = esta_porcentagem --> reseta o ultimo valor da barra - - --if (_detalhes.is_using_row_animations and forcar) then - -- esta_barra.tem_animacao = false - -- esta_barra:SetScript ("OnUpdate", nil) - --end - + return self:RefreshBarra (esta_barra, instancia) elseif (esta_porcentagem ~= esta_barra.last_value) then --> continua mostrando a mesma tabela então compara a porcentagem --> apenas atualizar - if (_detalhes.is_using_row_animations) then + if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else esta_barra.statusbar:SetValue (esta_porcentagem) end esta_barra.last_value = esta_porcentagem + + return self:RefreshBarra (esta_barra, instancia) end end diff --git a/classes/classe_instancia_include.lua b/classes/classe_instancia_include.lua index b0dfa574..0725d109 100644 --- a/classes/classe_instancia_include.lua +++ b/classes/classe_instancia_include.lua @@ -47,6 +47,8 @@ _detalhes.instance_defaults = { skin = "Minimalistic v2", --scale window_scale = 1.0, + --following + following = {enabled = false, bar_color = {1, 1, 1}, text_color = {1, 1, 1}}, --baseframe backdrop bg_alpha = 0.7, bg_r = 0.0941, diff --git a/classes/classe_others.lua b/classes/classe_others.lua index 3cb93641..8af028db 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -646,24 +646,33 @@ 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 use_animations = _detalhes.is_using_row_animations and (not instancia.baseframe.isStretching and not forcar) + + if (total == 0) then + total = 0.00000001 + end UsingCustomLeftText = instancia.row_info.textL_enable_custom_text UsingCustomRightText = instancia.row_info.textR_enable_custom_text 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) --> 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) --> instância, index, total, valor da 1º barra 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) --> 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) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 end end + if (use_animations) then + instancia:fazer_animacoes() + end + if (instancia.atributo == 5) then --> custom --> zerar o .custom dos Actors for index, player in _ipairs (conteudo) do @@ -706,7 +715,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) +function atributo_misc:AtualizaBarra (instancia, barras_container, qual_barra, lugar, total, sub_atributo, forcar, keyName, is_dead, percentage_type, use_animations) --print (self.ress) @@ -751,10 +760,10 @@ function atributo_misc:AtualizaBarra (instancia, barras_container, qual_barra, l actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() - return self:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container) + return self:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container, use_animations) end -function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container) +function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, qual_barra, barras_container, use_animations) --> primeiro colocado if (esta_barra.colocacao == 1) then @@ -773,7 +782,15 @@ function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then - esta_barra.statusbar:SetValue (esta_porcentagem) + --esta_barra.statusbar:SetValue (esta_porcentagem) + + if (use_animations) then + esta_barra.animacao_fim = esta_porcentagem + else + esta_barra.statusbar:SetValue (esta_porcentagem) + esta_barra.animacao_ignorar = true + end + gump:Fade (esta_barra, "out") if (instancia.row_info.texture_class_colors) then @@ -789,35 +806,27 @@ function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo --> agora esta comparando se a tabela da barra é diferente da tabela na atualização anterior if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then --> aqui diz se a barra do jogador mudou de posição ou se ela apenas será atualizada - esta_barra.statusbar:SetValue (esta_porcentagem) + if (use_animations) then + esta_barra.animacao_fim = esta_porcentagem + else + esta_barra.statusbar:SetValue (esta_porcentagem) + esta_barra.animacao_ignorar = true + end esta_barra.last_value = esta_porcentagem --> reseta o ultimo valor da barra - - if (_detalhes.is_using_row_animations and forcar) then - esta_barra.tem_animacao = 0 - esta_barra:SetScript ("OnUpdate", nil) - end - + return self:RefreshBarra (esta_barra, instancia) elseif (esta_porcentagem ~= esta_barra.last_value) then --> continua mostrando a mesma tabela então compara a porcentagem --> apenas atualizar - if (_detalhes.is_using_row_animations) then - - local upRow = barras_container [qual_barra-1] - if (upRow) then - if (upRow.statusbar:GetValue() < esta_barra.statusbar:GetValue()) then - esta_barra.statusbar:SetValue (esta_porcentagem) - else - instancia:AnimarBarra (esta_barra, esta_porcentagem) - end - else - instancia:AnimarBarra (esta_barra, esta_porcentagem) - end + if (use_animations) then + esta_barra.animacao_fim = esta_porcentagem else esta_barra.statusbar:SetValue (esta_porcentagem) end esta_barra.last_value = esta_porcentagem + + return self:RefreshBarra (esta_barra, instancia) end end diff --git a/core/parser.lua b/core/parser.lua index c86971c8..557f6119 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -174,6 +174,16 @@ ) ) then --> não entra em combate se for DOT + if (_detalhes.encounter_table.id and _detalhes.encounter_table ["start"] >= _G.time()-3 and _detalhes.announce_firsthit.enabled) then + local link + if (spellid <= 10) then + link = _GetSpellInfo (spellid) + else + link = GetSpellLink (spellid) + end + _detalhes:Msg ("First hit: " .. (link or "") .. " from " .. (who_name or "Unknown")) + end + _detalhes:EntrarEmCombate (who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags) end end @@ -2686,7 +2696,14 @@ return _detalhes.parser_functions:ZONE_CHANGED_NEW_AREA (...) end + -- ~encounter function _detalhes.parser_functions:ENCOUNTER_START (...) + + if (_in_combat) then + --print ("encounter start while in combat... finishing the combat...") + _detalhes:SairDoCombate() + end + _table_wipe (_detalhes.encounter_table) local encounterID, encounterName, difficultyID, raidSize = _select (1, ...) diff --git a/core/windows.lua b/core/windows.lua index 670a666c..eaf06463 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -68,7 +68,7 @@ local row = self.barras [i] local row_proxima = self.barras [i+1] - if (row_proxima) then + if (row_proxima and not row.animacao_ignorar) then local v = row.statusbar:GetValue() local v_proxima = row_proxima.statusbar:GetValue() @@ -761,6 +761,92 @@ _detalhes:GetFramework():ShowTutorialAlertFrame ("How to Use Bookmarks", "switch fast between displays", func) end +--> config class colors + function _detalhes:OpenClassColorsConfig() + if (not _G.DetailsClassColorManager) then + gump:CreateSimplePanel (UIParent, 300, 280, "Modify Class Colors", "DetailsClassColorManager") + local panel = _G.DetailsClassColorManager + local upper_panel = CreateFrame ("frame", nil, panel) + upper_panel:SetAllPoints (panel) + upper_panel:SetFrameLevel (panel:GetFrameLevel()+3) + + local y = -50 + + local callback = function (button, r, g, b, a, self) + self.MyObject.my_texture:SetVertexColor (r, g, b) + _detalhes.class_colors [self.MyObject.my_class][1] = r + _detalhes.class_colors [self.MyObject.my_class][2] = g + _detalhes.class_colors [self.MyObject.my_class][3] = b + _detalhes:AtualizaGumpPrincipal (-1, true) + end + local set_color = function (class, index, self, button) + local current_class_color = _detalhes.class_colors [class] + local r, g, b = unpack (current_class_color) + _detalhes.gump:ColorPick (self, r, g, b, 1, callback) + end + local reset_color = function (class, index, self, button) + local color_table = RAID_CLASS_COLORS [class] + local r, g, b = color_table.r, color_table.g, color_table.b + self.MyObject.my_texture:SetVertexColor (r, g, b) + _detalhes.class_colors [self.MyObject.my_class][1] = r + _detalhes.class_colors [self.MyObject.my_class][2] = g + _detalhes.class_colors [self.MyObject.my_class][3] = b + _detalhes:AtualizaGumpPrincipal (-1, true) + end + local on_enter = function (self, capsule) + --_detalhes:CooltipPreset (1) + --GameCooltip:AddLine ("right click to reset") + --GameCooltip:Show (self) + end + local on_leave = function (self, capsule) + --GameCooltip:Hide() + end + + local reset = gump:NewLabel (panel, _, nil, nil, "|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:" .. 20 .. ":" .. 20 .. ":0:1:512:512:8:70:328:409|t " .. "Right Click to Reset") + reset:SetPoint ("bottomright", panel, "bottomright", -23, 38) + local reset_texture = gump:CreateImage (panel, [[Interface\MONEYFRAME\UI-MONEYFRAME-BORDER]], 138, 45, "border") + reset_texture:SetPoint ("center", reset, "center", 0, -7) + reset_texture:SetDesaturated (true) + + panel.buttons = {} + + for index, class_name in ipairs (CLASS_SORT_ORDER) do + + local icon = gump:CreateImage (upper_panel, [[Interface\Glues\CHARACTERCREATE\UI-CHARACTERCREATE-CLASSES]], 32, 32, nil, CLASS_ICON_TCOORDS [class_name], "icon_" .. class_name) + + if (index%2 ~= 0) then + icon:SetPoint (10, y) + else + icon:SetPoint (150, y) + y = y - 33 + end + + local bg_texture = gump:CreateImage (panel, [[Interface\AddOns\Details\images\bar_skyline]], 135, 30, "artwork") + bg_texture:SetPoint ("left", icon, "right", -32, 0) + + local button = gump:CreateButton (panel, set_color, 135, 30, "set color", class_name, index) + button:SetPoint ("left", icon, "right", -32, 0) + button:InstallCustomTexture (nil, nil, nil, nil, true) + button:SetFrameLevel (panel:GetFrameLevel()+1) + button.my_icon = icon + button.my_texture = bg_texture + button.my_class = class_name + button:SetHook ("OnEnter", on_enter) + button:SetHook ("OnLeave", on_leave) + button:SetClickFunction (reset_color, nil, nil, "RightClick") + panel.buttons [class_name] = button + + end + + end + + for class, button in pairs (_G.DetailsClassColorManager.buttons) do + button.my_texture:SetVertexColor (unpack (_detalhes.class_colors [class])) + end + + _G.DetailsClassColorManager:Show() + end + --> config bookmarks function _detalhes:OpenBookmarkConfig() @@ -830,14 +916,20 @@ set:SetBackdropColor (0, 0, 0, 0.5) set:SetHook ("OnEnter", set_onenter) set:SetHook ("OnLeave", set_onleave) + + set:InstallCustomTexture (nil, nil, nil, nil, true) + + local bg_texture = gump:CreateImage (set, [[Interface\AddOns\Details\images\bar_skyline]], 135, 30, "background") + bg_texture:SetAllPoints() + set.bg = bg_texture local icon = gump:CreateImage (set, nil, 16, 16, nil, nil, "icon") - icon:SetPoint ("left", clear, "right", 2, 0) + icon:SetPoint ("left", clear, "right", 4, 0) local label = gump:CreateLabel (set, "") label:SetPoint ("left", icon, "right", 2, 0) - tinsert (panel.blocks, {icon = icon, label = label}) + tinsert (panel.blocks, {icon = icon, label = label, bg = set.bg}) end local normal_coords = {0, 1, 0, 1} @@ -855,20 +947,24 @@ this_block.label.text = "-- x -- x --" this_block.icon.texture = "Interface\\ICONS\\Ability_DualWield" this_block.icon.texcoord = normal_coords + this_block.bg:SetVertexColor (.4, .1, .1, .12) else this_block.label.text = CustomObject.name this_block.icon.texture = CustomObject.icon this_block.icon.texcoord = normal_coords + this_block.bg:SetVertexColor (.4, .4, .4, .6) end else this_block.label.text = _detalhes.sub_atributos [bookmark.atributo].lista [bookmark.sub_atributo] this_block.icon.texture = _detalhes.sub_atributos [bookmark.atributo].icones [bookmark.sub_atributo] [1] this_block.icon.texcoord = _detalhes.sub_atributos [bookmark.atributo].icones [bookmark.sub_atributo] [2] + this_block.bg:SetVertexColor (.4, .4, .4, .6) end else this_block.label.text = "-- x -- x --" this_block.icon.texture = [[Interface\AddOns\Details\images\icons]] this_block.icon.texcoord = unknown_coords + this_block.bg:SetVertexColor (.4, .1, .1, .12) end end end diff --git a/framework/button.lua b/framework/button.lua index 0243c648..a73d3894 100644 --- a/framework/button.lua +++ b/framework/button.lua @@ -826,9 +826,9 @@ local ButtonMetaFunctions = {} y = _math_floor (y) if ((button.mouse_down+0.4 > GetTime() and (x == button.x and y == button.y)) or (x == button.x and y == button.y)) then if (buttontype == "LeftButton") then - button.MyObject.func (button.MyObject.param1, button.MyObject.param2, button) + button.MyObject.func (button.MyObject.param1, button.MyObject.param2, button, buttontype) else - button.MyObject.funcright (button.MyObject.param1, button.MyObject.param2, button) + button.MyObject.funcright (button.MyObject.param1, button.MyObject.param2, button, buttontype) end end end diff --git a/functions/profiles.lua b/functions/profiles.lua index b2493723..808cd860 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -798,7 +798,7 @@ local default_profile = { fontcolor = {1, 1, 1, 1}, fontshadow = false, background = {.45, .45, .45, .28}, - abbreviation = 8, + abbreviation = 5, --ToK I Lower -- was 8 maximize_method = 1, show_amount = false, commands = {}, @@ -868,6 +868,10 @@ local default_player_data = { reverse = false, channel = "SELF", }, + announce_firsthit = { + enabled = true, + channel = "SELF", + }, } _detalhes.default_player_data = default_player_data diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index f14bcc1b..029a198d 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -3455,7 +3455,15 @@ function window:CreateFrame1() frame1.BookmarkButton:SetIcon ([[Interface\Glues\CharacterSelect\Glues-AddOn-Icons]], nil, nil, nil, {0.75, 1, 0, 1}) frame1.BookmarkButton:SetTextColor (button_color_rgb) - + + --config class colors + g:NewButton (frame1, _, "$parentClassColorsButton", "ClassColorsButton", buttons_width, 18, _detalhes.OpenClassColorsConfig, nil, nil, nil, Loc ["STRING_OPTIONS_CHANGE_CLASSCOLORS"], 1) + frame1.ClassColorsButton:InstallCustomTexture() + window:CreateLineBackground2 (frame1, "ClassColorsButton", "ClassColorsButton", Loc ["STRING_OPTIONS_CHANGE_CLASSCOLORS_DESC"], nil, {1, 0.8, 0}, button_color_rgb) + + frame1.ClassColorsButton:SetIcon ([[Interface\AddOns\Details\images\icons]], nil, nil, nil, {430/512, 459/512, 4/512, 30/512}) -- , "orange" + frame1.ClassColorsButton:SetTextColor (button_color_rgb) + --> anchors g:NewLabel (frame1, _, "$parentGeneralAnchor", "GeneralAnchorLabel", Loc ["STRING_OPTIONS_GENERAL_ANCHOR"], "GameFontNormal") @@ -3485,6 +3493,7 @@ function window:CreateFrame1() frame1.ToolsLabel:SetPoint (avatar_x_anchor, -265) frame1.EraseDataLabel:SetPoint (avatar_x_anchor, -290) frame1.BookmarkButton:SetPoint (avatar_x_anchor, -315) + frame1.ClassColorsButton:SetPoint (avatar_x_anchor, -340) local left_side = { {"GeneralAnchorLabel", 1, true}, @@ -4872,6 +4881,21 @@ function window:CreateFrame4() local background = window:CreateLineBackground2 (frame4, "BackdropColorPick", "BackdropColorLabel", Loc ["STRING_OPTIONS_BAR_BACKDROP_COLOR_DESC"]) + --player bar + + g:NewLabel (frame4, _, "$parentPlayerBarAnchor", "PlayerBarAnchor", Loc ["STRING_OPTIONS_BAR_FOLLOWING_ANCHOR"], "GameFontNormal") + + g:NewLabel (frame4, _, "$parentShowMeLabel", "ShowMeLabel", Loc ["STRING_OPTIONS_BAR_FOLLOWING"], "GameFontHighlightLeft") + g:NewSwitch (frame4, _, "$parentShowMeSlider", "ShowMeSlider", 60, 20, _, _, instance.following.enabled) + frame4.ShowMeSlider:SetPoint ("left", frame4.ShowMeLabel, "right", 2, -1) + frame4.ShowMeSlider.OnSwitch = function (self, instance, value) + instance.following.enabled = value + instance:RefreshBars() + instance:InstanceReset() + instance:ReajustaGump() + end + window:CreateLineBackground2 (frame4, "ShowMeSlider", "ShowMeLabel", Loc ["STRING_OPTIONS_BAR_FOLLOWING_DESC"]) + --> Anchors: local x = window.left_start_at @@ -4905,29 +4929,13 @@ function window:CreateFrame4() {frame4.rowLowerTextureLabel, 4, true}, {frame4.rowBackgroundLabel, 5}, {frame4.rowBackgroundPickLabel, 6}, + {"PlayerBarAnchor", 7, true}, + {"ShowMeLabel", 8}, } window:arrange_menu (frame4, left_side, x, -90) window:arrange_menu (frame4, right_side, 360, -90) - - --[[ - frame4.rowHeightLabel:SetPoint (x, -90) --bar height - frame4.barGrowDirectionLabel:SetPoint (x, -125) --grow direction - frame4.barSortDirectionLabel:SetPoint (x, -150) --sort direction - frame4.BarSpacementLabel:SetPoint (x, -175) --spacement - - frame4.rowUpperTextureLabel:SetPoint (x, -210) --anchor - frame4.textureLabel:SetPoint (x, -235) --bar texture - frame4.rowPickColorLabel:SetPoint (x, -260) --color pick - - frame4.rowLowerTextureLabel:SetPoint (x, -295) - frame4.rowBackgroundLabel:SetPoint (x, -320) --select background - frame4.rowBackgroundPickLabel:SetPoint (x, -345) --bar color background - - frame4.rowIconsLabel:SetPoint (x, -380) - frame4.iconFileLabel:SetPoint (x, -405) - frame4.barStartLabel:SetPoint (x, -430) - --]] + end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -7543,6 +7551,7 @@ function window:CreateFrame11() window:CreateLineBackground2 (frame11, "DeathChannelDropdown", "DeathChannelLabel", Loc ["STRING_OPTIONS_RT_DEATHS_WHERE_DESC"]) --> general tools + --> pre pots g:NewLabel (frame11, _, "$parentEnabledPrePotLabel", "EnabledPrePotLabel", Loc ["STRING_OPTIONS_RT_INFOS_PREPOTION"], "GameFontHighlightLeft") g:NewSwitch (frame11, _, "$parentEnabledPrePotSlider", "EnabledPrePotSlider", 60, 20, _, _, _detalhes.announce_prepots.enabled) @@ -7553,6 +7562,17 @@ function window:CreateFrame11() window:CreateLineBackground2 (frame11, "EnabledPrePotSlider", "EnabledPrePotLabel", Loc ["STRING_OPTIONS_RT_INFOS_PREPOTION_DESC"]) + --> first hit + g:NewLabel (frame11, _, "$parentEnabledFirstHitLabel", "EnabledFirstHitLabel", Loc ["STRING_OPTIONS_RT_FIRST_HIT"], "GameFontHighlightLeft") + g:NewSwitch (frame11, _, "$parentEnabledFirstHitSlider", "EnabledFirstHitSlider", 60, 20, _, _, _detalhes.announce_firsthit.enabled) + + frame11.EnabledFirstHitSlider:SetPoint ("left", frame11.EnabledFirstHitLabel, "right", 2) + frame11.EnabledFirstHitSlider.OnSwitch = function (_, _, value) + _detalhes.announce_firsthit.enabled = value + end + + window:CreateLineBackground2 (frame11, "EnabledFirstHitSlider", "EnabledFirstHitLabel", Loc ["STRING_OPTIONS_RT_FIRST_HIT_DESC"]) + --> anchors --announcers anchor @@ -7591,6 +7611,7 @@ function window:CreateFrame11() {"DeathsAmountLabel", 5}, {"AnnouncersOther", 6, true}, {"EnabledPrePotLabel", 7}, + {"EnabledFirstHitLabel", 8}, } window:arrange_menu (frame11, right_side, window.right_start_at, -90) @@ -8110,6 +8131,9 @@ function window:update_all (editing_instance) _G.DetailsOptionsWindow4BarStartSlider.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow4BarStartSlider.MyObject:SetValue (editing_instance.row_info.start_after_icon) + _G.DetailsOptionsWindow4ShowMeSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow4ShowMeSlider.MyObject:SetValue (editing_instance.following.enabled) + _G.DetailsOptionsWindow4BackdropBorderTextureDropdown.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow4BackdropEnabledSlider.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow4BackdropSizeHeight.MyObject:SetFixedParameter (editing_instance) @@ -8230,6 +8254,8 @@ function window:update_all (editing_instance) _G.DetailsOptionsWindow13SelectProfileDropdown.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow13PosAndSizeSlider.MyObject:SetValue (_detalhes.profile_save_pos) + + --_G.DetailsOptionsWindow13AlwaysUseSlider.MyObject:SetValue (_detalhes.always_use_profile) --> window 14 diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index 1bcc09d1..d58deba6 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -653,6 +653,7 @@ local function move_janela (baseframe, iniciando, instancia) local group = instancia:GetInstanceGroup() for _, this_instance in _ipairs (group) do this_instance.baseframe:SetClampRectInsets (0, 0, 0, 0) + this_instance.isMoving = true end local _, ClampLeft, ClampRight = instancia:InstanciasHorizontais() @@ -832,6 +833,11 @@ local function move_janela (baseframe, iniciando, instancia) end end + local group = instancia:GetInstanceGroup() + for _, this_instance in _ipairs (group) do + this_instance.isMoving = false + end + _detalhes.snap_alert.playing = false _detalhes.snap_alert.animIn:Stop() _detalhes.snap_alert.animOut:Play() @@ -1301,6 +1307,12 @@ local resize_scripts_onmousedown = function (self, button) _detalhes:SendEvent ("DETAILS_INSTANCE_STARTRESIZE", nil, self._instance) + if (_detalhes.update_speed > 0.3) then + _detalhes:CancelTimer (_detalhes.atualizador) + _detalhes.atualizador = _detalhes:ScheduleRepeatingTimer ("AtualizaGumpPrincipal", 0.3, -1) + _detalhes.resize_changed_update_speed = true + end + end end @@ -1324,10 +1336,16 @@ local resize_scripts_onmouseup = function (self, button) self:GetParent():StopMovingOrSizing() self:GetParent().isResizing = false + self._instance:RefreshBars() + self._instance:InstanceReset() + self._instance:ReajustaGump() + if (self._instance.stretchToo and #self._instance.stretchToo > 0) then for _, esta_instancia in ipairs (self._instance.stretchToo) do esta_instancia.baseframe:StopMovingOrSizing() esta_instancia.baseframe.isResizing = false + esta_instancia:RefreshBars() + esta_instancia:InstanceReset() esta_instancia:ReajustaGump() _detalhes:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, esta_instancia) end @@ -1363,6 +1381,8 @@ local resize_scripts_onmouseup = function (self, button) esta_instancia.baseframe:SetWidth (largura) esta_instancia.baseframe:SetHeight (altura) esta_instancia.auto_resize = true + esta_instancia:RefreshBars() + esta_instancia:InstanceReset() esta_instancia:ReajustaGump() esta_instancia.auto_resize = false _detalhes:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, esta_instancia) @@ -1380,6 +1400,13 @@ local resize_scripts_onmouseup = function (self, button) esta_instancia:RestoreMainWindowPosition() end end + + if (_detalhes.resize_changed_update_speed) then + _detalhes:CancelTimer (_detalhes.atualizador) + _detalhes.atualizador = _detalhes:ScheduleRepeatingTimer ("AtualizaGumpPrincipal", _detalhes.update_speed, -1) + _detalhes.resize_changed_update_speed = nil + end + end end @@ -1869,6 +1896,15 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) _detalhes:SnapTextures (true) _detalhes:SendEvent ("DETAILS_INSTANCE_STARTSTRETCH", nil, instancia) + + --> change the update speed + + if (_detalhes.update_speed > 0.3) then + _detalhes:CancelTimer (_detalhes.atualizador) + _detalhes.atualizador = _detalhes:ScheduleRepeatingTimer ("AtualizaGumpPrincipal", 0.3, -1) + _detalhes.stretch_changed_update_speed = true + end + end) button:SetScript ("OnMouseUp", function (self, button) @@ -1892,6 +1928,10 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) end _detalhes:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, instancia) + instancia:RefreshBars() + instancia:InstanceReset() + instancia:ReajustaGump() + if (instancia.stretchToo and #instancia.stretchToo > 0) then for _, esta_instancia in ipairs (instancia.stretchToo) do esta_instancia.baseframe:StopMovingOrSizing() @@ -1918,6 +1958,11 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) esta_instancia:StretchButtonAlwaysOnTop() _detalhes:SendEvent ("DETAILS_INSTANCE_ENDSTRETCH", nil, esta_instancia.baseframe) + + esta_instancia:RefreshBars() + esta_instancia:InstanceReset() + esta_instancia:ReajustaGump() + end instancia.stretchToo = nil end @@ -1939,6 +1984,13 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) _detalhes:SnapTextures (false) _detalhes:SendEvent ("DETAILS_INSTANCE_ENDSTRETCH", nil, instancia) + + if (_detalhes.stretch_changed_update_speed) then + _detalhes:CancelTimer (_detalhes.atualizador) + _detalhes.atualizador = _detalhes:ScheduleRepeatingTimer ("AtualizaGumpPrincipal", _detalhes.update_speed, -1) + _detalhes.stretch_changed_update_speed = nil + end + end) end @@ -2079,16 +2131,18 @@ local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, basef if (delta > 0) then --> rolou pra cima local A = instancia.barraS[1] if (A > 1) then - scrollbar:SetValue (scrollbar:GetValue() - instancia.row_height) + scrollbar:SetValue (scrollbar:GetValue() - instancia.row_height*2) else scrollbar:SetValue (0) scrollbar.ultimo = 0 baseframe.button_up:Disable() end elseif (delta < 0) then --> rolou pra baixo + local B = instancia.barraS[2] + if (B < instancia.rows_showing) then - scrollbar:SetValue (scrollbar:GetValue() + instancia.row_height) + scrollbar:SetValue (scrollbar:GetValue() + instancia.row_height*2) else local _, maxValue = scrollbar:GetMinMaxValues() scrollbar:SetValue (maxValue) @@ -2114,7 +2168,7 @@ local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, basef instancia:AtualizaGumpPrincipal (instancia, true) self.ultimo = meu_valor baseframe.button_up:Disable() - return + return elseif (maxValue == meu_valor) then local min = instancia.rows_showing -instancia.rows_fit_in_window min = min+1 @@ -2137,11 +2191,14 @@ local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, basef end if (meu_valor > ultimo) then --> scroll down - + local B = instancia.barraS[2] if (B < instancia.rows_showing) then --> se o valor maximo não for o máximo de barras a serem mostradas - local precisa_passar = ((B+1) * instancia.row_height) - (instancia.row_height*instancia.rows_fit_in_window) - if (meu_valor > precisa_passar) then --> o valor atual passou o valor que precisa passar pra locomover + + local precisa_passar = ((B+2) * instancia.row_height) - (instancia.row_height*instancia.rows_fit_in_window) + + -- if (meu_valor > precisa_passar) then --> o valor atual passou o valor que precisa passar pra locomover + if (true) then --> testing local diff = meu_valor - ultimo --> pega a diferença de H diff = diff / instancia.row_height --> calcula quantas barras ele pulou diff = _math_ceil (diff) --> arredonda para cima @@ -2159,7 +2216,8 @@ local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, basef local A = instancia.barraS[1] if (A > 1) then local precisa_passar = (A-1) * instancia.row_height - if (meu_valor < precisa_passar) then + --if (meu_valor < precisa_passar) then + if (true) then --> testing --> calcula quantas barras passou local diff = ultimo - meu_valor diff = diff / instancia.row_height diff --git a/images/icons.tga b/images/icons.tga index d96f17874d00af67712e80caf65c9fd5633bc3fd..fda721ddda4fea4cbe7b5f6edca3ef9030774fab 100644 GIT binary patch delta 3808 zcmY+H2Ut|c7RT@Ivh1Zd>7dk=wkTDKND-t+7X-wJ6kCFVi3OuRKtZrYi6~Jql9fDS zFp3*>jT)b5LSm1x`;5V8j3rTw8lKAT|DCz0A^Uy5nY%M*X8!lgnR2&Zb6WMxsj5a) zBd(Fu=+sDSboa=vJP$esfa58V5+;N*5lkcyDMSnrNcgUxgySd?9csGqTy{00krn9M z+S*EtjEpP@A0m->ihO?o<^!kb!8|F>TIzP!{0ZhHSAxCUG-464fS5tV5Eg`p<0%!? ztUtp4@lP=lsv1lbaT0@1b94XIou5^T;R<_jx`Pou>M!_(Z-$Ar6!A$Nn&8ky|1&Z) z=pp;t#ATwBcs*-V>6wYBBAD|I64%6HaR=q|3HH*`*J5~;dZ&mNiT){vP4ysRtmELJ z)oVXIdAKmI^G4x>h zI^sLj$5Em)(AV>)mSyj0w$;ti8u0vmDq|ihB`jZi$55p{B;j`ski(*e#heR~L{tzv z;-V`adC6n2WBp=0`e75~@|p1R0zyInZ@;hLudqRUm^DH@4dCy?AuZGx<#|4c9^vuK zYLLleb2HQ16EYHdlfqn3U78O|3v=edeZ(pvl*wW1*g~a#N6POTAjgWTM-meWCS^-p zY--omt$0>Z0c2&~hNFWW;$p(!>>dS2`-5<>{t{m_uLF8}arCoRtg0x+)ci<7 zG>40Gw5+vG!jTaCbL@g$0L}h81}B+pnmm4FpDb z{v3BMox|+urQoDG5E&R@@`QZg@ndXRxfByqBQ>Ex!+)jTzb2Xq-6=G5m`bgy$3GEO zE~8#Jw#Z9Hj~vl4x3s7`V7S*~eSNNX?}n8xH&;*7PE3o1si_P_*=e|PpdG(E^7(dXe!h-}S1uwcz6@f07x)GQqWf?=REJP1J>NG2sZbE$AY(#{nVW>wa(#EEsWKtAO zOep5e0c_k(LeF*^Oy#>^?ejH8hUFt*I0w0BECsPEZ3E+wnfo>5{#&)2UE=+>vNQJ` z`b^n+|KblH;mH%_JCENk zY5utV7zXA)!(}Mospx^efj5$q{L#_^xDLGssbxKeC_aL--_P(3Jp;LyFEUbxVPvo^ z23v8MlADE&9m;zP=gwnsa*Wul$Mf@jy?x%9G%lk^B9TNfIrb#SLD@udY}9ds_ zE57fQ96Ksur)&^W=c)kIbYZWaq3waKv(LXh{8ID*J|DXY6}~>rzVk4^AbZere0+ z4p1ScDq~`(z15)j4;RcT(AAZ_P5;Y@Dxx_dHu~_n1A8xAK7RD~?BWf*#WS~QS1;Lv zY56mdIC>P^+&CEMDKIL$3~x_eh&w-Ov=ehTc2nCfVi& zQEpCn67j?gD@)rN2Rp}4=FUpF_Nm%h2%d+Xez7d`(yi9Op-BW}!PNQ?vEkvlwL;2&RI~i#0Kfc#CM<)!cgZx3k~AxOil@1~+fs zL3j7%-7SsRN@wKVqEngOSBeM+Lh@#G@ql+%_y@zmr3IY09_{-NVD%RDaCg2*lp}1i zf-l&565>-rxjx}T6sO0>wBpY{uiQC%^1|u;9qQJG)y<8ybsG|0rsf0_nFf(JZ z$l^oiO&n3Lu^xP%LA|dXCwo0|G z7r#KH5DsCXd<8$a3p0|CR->Ab(#Z!$iguKb(*43KjA!+r%w zMgIj0HvVHj0pv~k&wh>Z`PAzizkr-DCXNq4>MS$ITgK3Q2GOSc9G@8(Z*E^N$Z?aA@%nat5ss6LjK{Xei*X!e0@BMRInFRK z9^L*+hT|NF_E+He1ENnTb3}pY`Dz?`%s|>p3&I!I<(SC`