diff --git a/boot.lua b/boot.lua index cb088c94..1f90fae1 100644 --- a/boot.lua +++ b/boot.lua @@ -3,7 +3,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 6256 + _detalhes.build_counter = 6272 _detalhes.userversion = "v8.0.1." .. _detalhes.build_counter _detalhes.realversion = 134 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" diff --git a/classes/container_habilidades.lua b/classes/container_habilidades.lua index af36e3b9..ea2b966c 100644 --- a/classes/container_habilidades.lua +++ b/classes/container_habilidades.lua @@ -56,7 +56,7 @@ local _ end function container_habilidades:ListActors() - return _pairs (self._ActorTable) + return pairs (self._ActorTable) end function container_habilidades:PegaHabilidade (id, criar, token, cria_shadow) diff --git a/functions/classes.lua b/functions/classes.lua index 05724bf9..d363e523 100644 --- a/functions/classes.lua +++ b/functions/classes.lua @@ -115,6 +115,14 @@ do end return self.nome:gsub (("%-.*"), "") end + + function _detalhes:RemoveOwnerName (string) + if (string) then + return string:gsub ((" <.*"), "") + end + return self.nome:gsub ((" <.*"), "") + end + function _detalhes:GetCLName (id) local name, realm = UnitName (id) if (name) then diff --git a/gumps/janela_info.lua b/gumps/janela_info.lua index a7aa80ec..1c83e4b4 100644 --- a/gumps/janela_info.lua +++ b/gumps/janela_info.lua @@ -2082,7 +2082,7 @@ function gump:CriaJanelaInfo() local spellsBox = CreateFrame ("frame", nil, frame) _detalhes.gump:ApplyStandardBackdrop (spellsBox) spellsBox:SetPoint ("topleft", absorbsBox, "topright", 10, 0) - spellsBox:SetSize (300, 160 * 2 + 5) + spellsBox:SetSize (346, 160 * 2 + 5) local spells_text = spellsBox:CreateFontString (nil, "artwork", "GameFontNormal") spells_text:SetText ("Spells") @@ -2106,13 +2106,15 @@ function gump:CriaJanelaInfo() y = y - padding - for i = 1, 18 do + for i = 1, 40 do local frame_tooltip = CreateFrame ("frame", nil, spellsBox) - frame_tooltip:SetPoint ("topleft", spellsBox, "topleft", 20, y + ((i-1)*16)*-1) - frame_tooltip:SetSize (150, 14) + frame_tooltip:SetPoint ("topleft", spellsBox, "topleft", 5, y + ((i-1)*17)*-1) + frame_tooltip:SetSize (spellsBox:GetWidth()-10, 16) frame_tooltip:SetScript ("OnEnter", frame_tooltip_onenter) frame_tooltip:SetScript ("OnLeave", frame_tooltip_onleave) + frame_tooltip:Hide() + frame_tooltip:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 512}) frame_tooltip:SetBackdropColor (.5, .5, .5, .1) local icon = frame_tooltip:CreateTexture (nil, "artwork") @@ -2333,9 +2335,10 @@ function gump:CriaJanelaInfo() local label1, label2 = unpack (tab ["healer" .. i]) if (myReceivedHeal [i]) then local name = myReceivedHeal [i][1] - if (name:find ("-")) then - name = name:gsub (("-.*"), "") - end + + name = _detalhes:GetOnlyName (name) + --name = _detalhes:RemoveOwnerName (name) + label1:SetText (name .. ":") local class = myReceivedHeal [i][3] if (class) then @@ -2378,29 +2381,30 @@ function gump:CriaJanelaInfo() --> cooldowns local index_used = 1 local misc_player = combat (4, player.nome) + local encounter_time = combat:GetCombatTime() if (misc_player) then if (misc_player.cooldowns_defensive_spells) then local minha_tabela = misc_player.cooldowns_defensive_spells._ActorTable local buffUpdateSpells = misc_player.buff_uptime_spells -- ._ActorTable - local encounter_time = combat:GetCombatTime() - + local cooldowns_usados = {} for _spellid, _tabela in pairs (minha_tabela) do cooldowns_usados [#cooldowns_usados+1] = {_spellid, _tabela.counter} end - if (#cooldowns_usados > 1) then - + if (#cooldowns_usados > 0) then + table.sort (cooldowns_usados, _detalhes.Sort2) for i = 1, #cooldowns_usados do local esta_habilidade = cooldowns_usados[i] local nome_magia, _, icone_magia = _GetSpellInfo (esta_habilidade[1]) - local label1, label2, icon1, framebg = unpack (tab ["spell" .. i]) + local label1, label2, icon1, framebg = unpack (tab ["spell" .. index_used]) framebg.spellid = esta_habilidade[1] + framebg:Show() --> attempt to get the buff update local spellInfo = buffUpdateSpells:GetSpell (framebg.spellid) @@ -2409,7 +2413,7 @@ function gump:CriaJanelaInfo() else label2:SetText (esta_habilidade[2]) end - + --> update the line label1:SetText (nome_magia .. ":") @@ -2422,11 +2426,58 @@ function gump:CriaJanelaInfo() end end - for i = index_used, 18 do + local cooldownInfo = DetailsFramework.CooldownsInfo + + --> see cooldowns that other players used in this actor + for playerName, _ in pairs (combat.raid_roster) do + if (playerName ~= player.nome) then + local miscPlayer = combat (4, playerName) + if (miscPlayer) then + if (miscPlayer.cooldowns_defensive_spells) then + local cooldowns = miscPlayer.cooldowns_defensive_spells + for spellID, spellTable in cooldowns:ListActors() do + local targets = spellTable.targets + if (targets) then + for targetName, amountCasted in pairs (targets) do + if (targetName == player.nome) then + local spellName, _, spellIcon = _GetSpellInfo (spellID) + local label1, label2, icon1, framebg = unpack (tab ["spell" .. index_used]) + framebg.spellid = spellID + framebg:Show() + + --> attempt to get the buff update + local info = cooldownInfo [spellID] + local cooldownDuration = info and info.duration or 0 + + if (cooldownDuration > 0) then + label2:SetText (amountCasted .. " (" .. "|cFFFFFF00" .. miscPlayer.nome .. "|r " .. floor (cooldownDuration / encounter_time * 100) .. "% uptime)") + else + label2:SetText (amountCasted) + end + + --> update the line + label1:SetText (spellName .. ":") + + icon1:SetTexture (spellIcon) + icon1:SetTexCoord (0.0625, 0.953125, 0.0625, 0.953125) + + index_used = index_used + 1 + end + end + end + end + end + end + end + end + + + for i = index_used, 40 do local label1, label2, icon1, framebg = unpack (tab ["spell" .. i]) framebg.spellid = nil - label1:SetText ("-- -- -- --") + framebg:Hide() + label1:SetText ("") label2:SetText ("") icon1:SetTexture (nil) end diff --git a/startup.lua b/startup.lua index fd81f012..f9680555 100644 --- a/startup.lua +++ b/startup.lua @@ -1317,9 +1317,10 @@ function _G._detalhes:Start() if (instance:IsEnabled()) then local lineHeight = instance.row_info.height local textSize = instance.row_info.font_size - if (lineHeight <= textSize) then - instance.row_info.height = textSize + 2 - instance.row_info.font_size = textSize - 1 + if (lineHeight-1 <= textSize) then + instance.row_info.height = 21 + instance.row_info.font_size = 16 + instance:ChangeSkin() end end end