- Added four more abbreviation types.

- Abbreviations now are applied on all numbers in the bar.
- Minimum amount of instances was lowered to 3.
- Fixed issue where the instance menu wasn't respecting the amount limit of instances.
- Added options for cutomize the right text of a row.
- Added a option to be able to chance the framestrata of an window.
- Added shift, ctrl, alt interaction for rows which shows all spells, targets or pets when pressed.
- Fixed a issue where changing the alpha of a window makes it disappear on the next logon.
- Added a option for auto transparency to ignore rows.
- Added option to be able to set shadow on the attribute text.
- Fixed a issue with window snap where disabled statusbar makes a gap between the windows.
- Fixed issue where mini displayes wasn't saved and back to default values on every logon.
- Mini display 'instance segment' now have a option to show the encounter name instead the number of the segment.
- Added a new experimental library called hotcorners, this library create a menu hidden on the top left corner.
- New API: instance:GetId() return the id of the instance.
This commit is contained in:
tercio
2014-04-23 21:37:34 -03:00
parent 4384da2654
commit a56db81297
39 changed files with 1636 additions and 601 deletions
+179 -114
View File
@@ -21,11 +21,12 @@ local _GetSpellInfo = _detalhes.getspellinfo
local GameTooltip = GameTooltip
local _IsInRaid = IsInRaid
local _IsInGroup = IsInGroup
local _detalhes = _G._detalhes
local AceLocale = LibStub ("AceLocale-3.0")
local Loc = AceLocale:GetLocale ( "Details" )
--constants
local gump = _detalhes.gump
local _
@@ -59,6 +60,11 @@ local div_abre = _detalhes.divisores.abre
local div_fecha = _detalhes.divisores.fecha
local div_lugar = _detalhes.divisores.colocacao
local ToKFunctions = _detalhes.ToKFunctions
local SelectedToKFunction = ToKFunctions [1]
local UsingCustomRightText = false
local CLASS_ICON_TCOORDS = _G.CLASS_ICON_TCOORDS
local info = _detalhes.janela_info
@@ -907,6 +913,7 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
end
local combat_time = instancia.showing:GetCombatTime()
UsingCustomRightText = instancia.row_info.textR_enable_custom_text
local use_total_bar = false
if (instancia.total_bar.enabled) then
@@ -1124,38 +1131,68 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra,
esta_barra.texto_direita:SetText (_detalhes:ToK (self.custom) .." ".. div_abre .. _cstr ("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita
esta_porcentagem = _math_floor ((self.custom/instancia.top) * 100) --> determina qual o tamanho da barra
else
if (sub_atributo == 1) then --> mostrando damage done
dps = _math_floor (dps)
if (_detalhes.ps_abbreviation == 2) then
dps = _detalhes:ToK (dps)
elseif (_detalhes.ps_abbreviation == 3) then
dps = _detalhes:ToK2 (dps)
end
esta_barra.texto_direita:SetText (_detalhes:ToK (damage_total) .." ".. div_abre .. dps .. ", ".. _cstr ("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita
esta_porcentagem = _math_floor ((damage_total/instancia.top) * 100) --> determina qual o tamanho da barra
elseif (sub_atributo == 2) then --> mostrando dps
dps = _math_floor (dps)
if (_detalhes.ps_abbreviation == 2) then
esta_barra.texto_direita:SetText (_detalhes:ToK2 (dps) .. " " .. div_abre .. _detalhes:ToK (damage_total) .. ", " .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita
elseif (_detalhes.ps_abbreviation == 3) then
esta_barra.texto_direita:SetText (_detalhes:ToK2 (dps) .. " " .. div_abre .. _detalhes:ToK2 (damage_total) .. ", " .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita
local formated_damage = SelectedToKFunction (_, damage_total)
local formated_dps = SelectedToKFunction (_, dps)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_damage, formated_dps, _cstr ("%.1f", porcentagem)))
else
esta_barra.texto_direita:SetText (_detalhes:ToK2 (dps) .. " " .. div_abre .. damage_total .. ", " .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita
esta_barra.texto_direita:SetText (formated_damage .." ".. div_abre .. formated_dps .. ", ".. _cstr ("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita
end
esta_porcentagem = _math_floor ((damage_total/instancia.top) * 100) --> determina qual o tamanho da barra
elseif (sub_atributo == 2) then --> mostrando dps
dps = _math_floor (dps)
local formated_damage = SelectedToKFunction (_, damage_total)
local formated_dps = SelectedToKFunction (_, dps)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_dps, formated_damage, _cstr ("%.1f", porcentagem)))
else
esta_barra.texto_direita:SetText (formated_dps .. " " .. div_abre .. formated_damage .. ", " .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita
end
esta_porcentagem = _math_floor ((dps/instancia.top) * 100) --> determina qual o tamanho da barra
elseif (sub_atributo == 3) then --> mostrando damage taken
esta_barra.texto_direita:SetText (_detalhes:ToK (self.damage_taken) .." ".. div_abre .._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto?
local formated_damage_taken = SelectedToKFunction (_, self.damage_taken)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_damage_taken, "", _cstr ("%.1f", porcentagem)))
else
esta_barra.texto_direita:SetText (formated_damage_taken .." ".. div_abre .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita --
end
esta_porcentagem = _math_floor ((self.damage_taken/instancia.top) * 100) --> determina qual o tamanho da barra
elseif (sub_atributo == 4) then --> mostrando friendly fire
esta_barra.texto_direita:SetText (_detalhes:ToK (self.friendlyfire_total) .." ".. div_abre .._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto?
local formated_friendly_fire = SelectedToKFunction (_, self.friendlyfire_total)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_friendly_fire, "", _cstr ("%.1f", porcentagem)))
else
esta_barra.texto_direita:SetText (formated_friendly_fire .. " " .. div_abre .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita --
end
esta_porcentagem = _math_floor ((self.friendlyfire_total/instancia.top) * 100) --> determina qual o tamanho da barra
elseif (sub_atributo == 6) then --> mostrando friendly fire
esta_barra.texto_direita:SetText (_detalhes:ToK (damage_total) .." ".. div_abre .. _math_floor (dps) .. ", ".. _cstr ("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita
elseif (sub_atributo == 6) then --> mostrando enemies
dps = _math_floor (dps)
local formated_damage = SelectedToKFunction (_, damage_total)
local formated_dps = SelectedToKFunction (_, dps)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_damage, formated_dps, _cstr ("%.1f", porcentagem)))
else
esta_barra.texto_direita:SetText (formated_damage .. " " .. div_abre .. formated_dps .. ", " .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita
end
esta_porcentagem = _math_floor ((damage_total/instancia.top) * 100) --> determina qual o tamanho da barra
end
end
@@ -1341,18 +1378,18 @@ end
---------> TOOLTIPS BIFURCAÇÃO
function atributo_damage:ToolTip (instancia, numero, barra)
function atributo_damage:ToolTip (instancia, numero, barra, keydown)
--> seria possivel aqui colocar o icone da classe dele?
if (instancia.atributo == 5) then --> custom
return self:TooltipForCustom (barra)
else
if (instancia.sub_atributo == 1 or instancia.sub_atributo == 2 or instancia.sub_atributo == 6) then --> damage done or Dps or enemy
return self:ToolTip_DamageDone (instancia, numero, barra)
return self:ToolTip_DamageDone (instancia, numero, barra, keydown)
elseif (instancia.sub_atributo == 3) then --> damage taken
return self:ToolTip_DamageTaken (instancia, numero, barra)
return self:ToolTip_DamageTaken (instancia, numero, barra, keydown)
elseif (instancia.sub_atributo == 4) then --> friendly fire
return self:ToolTip_FriendlyFire (instancia, numero, barra)
return self:ToolTip_FriendlyFire (instancia, numero, barra, keydown)
end
end
end
@@ -1375,7 +1412,10 @@ local barAlha = .6
end
---------> DAMAGE DONE & DPS
function atributo_damage:ToolTip_DamageDone (instancia, numero, barra)
local key_overlay = {1, 1, 1, .1}
local key_overlay_press = {1, 1, 1, .2}
function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
local owner = self.owner
if (owner and owner.classe) then
@@ -1416,18 +1456,29 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra)
ActorTargetsSortTable [#ActorTargetsSortTable+1] = {_target.nome, _target.total}
end
_table_sort (ActorTargetsSortTable, _detalhes.Sort2)
--> MOSTRA HABILIDADES
GameCooltip:AddLine (Loc ["STRING_SPELLS"].."", nil, nil, headerColor, nil, 12)
--GameCooltip:AddIcon ([[Interface\HELPFRAME\HotIssueIcon]], 1, 1, 14, 14, 0.0625, 0.90625, 0, 1)
GameCooltip:AddIcon ([[Interface\ICONS\Spell_Shaman_BlessingOfTheEternals]], 1, 1, 14, 14, 0.90625, 0.109375, 0.15625, 0.875)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
local tooltip_max_abilities = _detalhes.tooltip_max_abilities
if (instancia.sub_atributo == 2) then
tooltip_max_abilities = 6
end
if (keydown == "shift") then
tooltip_max_abilities = 99
end
--> MOSTRA HABILIDADES
GameCooltip:AddLine (Loc ["STRING_SPELLS"].."", nil, nil, headerColor, nil, 12)
GameCooltip:AddIcon ([[Interface\ICONS\Spell_Shaman_BlessingOfTheEternals]], 1, 1, 14, 14, 0.90625, 0.109375, 0.15625, 0.875)
if (tooltip_max_abilities == 99) then
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay_press)
GameCooltip:AddStatusBar (100, 1, r, g, b, 1)
else
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
end
--habilidades
if (#ActorSkillsSortTable > 0) then
for i = 1, _math_min (tooltip_max_abilities, #ActorSkillsSortTable) do
@@ -1448,10 +1499,22 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra)
--> MOSTRA INIMIGOS
if (instancia.sub_atributo == 1 or instancia.sub_atributo == 6) then
GameCooltip:AddLine (Loc ["STRING_TARGETS"].."", nil, nil, headerColor, nil, 12)
GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0, 0.03125, 0.126953125, 0.15625)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
local max_targets = _detalhes.tooltip_max_targets
if (keydown == "ctrl") then
max_targets = 99
end
for i = 1, _math_min (_detalhes.tooltip_max_targets, #ActorTargetsSortTable) do
GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0, 0.03125, 0.126953125, 0.15625)
if (max_targets == 99) then
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_ctrl]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay_press)
GameCooltip:AddStatusBar (100, 1, r, g, b, 1)
else
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_ctrl]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
end
for i = 1, _math_min (max_targets, #ActorTargetsSortTable) do
local este_inimigo = ActorTargetsSortTable [i]
GameCooltip:AddLine (este_inimigo[1]..": ", _detalhes:comma_value (este_inimigo[2]) .." (".._cstr("%.1f", este_inimigo[2]/ActorDamageWithPet*100).."%)")
GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\espadas", nil, nil, 14, 14)
@@ -1516,85 +1579,44 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra)
local added_logo = false
_table_sort (totais, _detalhes.Sort2)
if (true) then
for index, _table in _ipairs (totais) do
for _, _table in _ipairs (totais) do
if (_table [2] > 0) then
if (not added_logo) then
added_logo = true
GameCooltip:AddLine (Loc ["STRING_PETS"].."", nil, nil, headerColor, nil, 12)
--GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0.03515625, 0.087890625, 0.0234375, 0.09765625, _detalhes.class_colors [self.classe])
GameCooltip:AddIcon ([[Interface\COMMON\friendship-heart]], 1, 1, 14, 14, 0.21875, 0.78125, 0.09375, 0.6875)
if (_table [2] > 0 and (index < 3 or keydown == "alt")) then
if (not added_logo) then
added_logo = true
GameCooltip:AddLine (Loc ["STRING_PETS"].."", nil, nil, headerColor, nil, 12)
GameCooltip:AddIcon ([[Interface\COMMON\friendship-heart]], 1, 1, 14, 14, 0.21875, 0.78125, 0.09375, 0.6875)
if (keydown == "alt") then
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_alt]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay_press)
GameCooltip:AddStatusBar (100, 1, r, g, b, 1)
else
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_alt]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
end
local n = _table [1]:gsub (("%s%<.*"), "")
if (instancia.sub_atributo == 1) then
GameCooltip:AddLine (n, _detalhes:comma_value (_table [2]) .. " (" .. _math_floor (_table [2]/self.total*100) .. "%)")
else
GameCooltip:AddLine (n, _detalhes:comma_value ( _math_floor (_table [3])) .. " (" .. _math_floor (_table [2]/self.total*100) .. "%)")
end
GameCooltip:AddStatusBar (100, 1, .1, .1, .1, .3)
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1)
end
end
else
--> old pet display mode
for nome, meus_danos in _pairs (danos) do --> um pet de cada vez
local n = nome:gsub (("%s%<.*"), "")
--GameTooltip:AddDoubleLine ("Ajudante: ", "x"..quantidade[nome].." "..n.." (".._math_floor (totais [nome]/self.total*100).."%)", nil, nil, nil, 1, 1, 1)
--> pintar o nome do pet com a cor da classe do jogador
local cor = self.cor
GameCooltip:AddLine (Loc ["STRING_PET"]..":", n.." (".._math_floor (totais [nome]/self.total*100).."%)", 1, 1, 1, 1, _unpack (_detalhes.class_colors [self.classe])) --> removido a quantidade
--GameCooltip:AddLine (Loc ["STRING_SPELLS"])
--GameTooltip:AddDoubleLine (Loc ["STRING_PET"]..":", n.." (".._math_floor (totais [nome]/self.total*100).."%)", nil, nil, nil, _unpack (_detalhes.class_colors [self.classe])) --> removido a quantidade
--GameTooltip:AddLine (Loc ["STRING_SPELLS"])
for i = 1, 3 do
if (meus_danos[i]) then
--> meus_danos = { [1] = spellid [2] = total [3] = % [4] = { [1] = nome [2] = rank [3] = icone } }
GameCooltip:AddLine (meus_danos[i][4][1]..": ", _detalhes:comma_value (meus_danos[i][2]).." (".._cstr("%.1f", meus_danos[i][3]).."%)")
GameCooltip:AddIcon (meus_danos[i][4][3], nil, nil, 14, 14)
GameCooltip:AddStatusBar (100, 1, .1, .1, .1, .2)
--GameTooltip:AddDoubleLine (meus_danos[i][4][1]..": ", _detalhes:comma_value (meus_danos[i][2]).." (".._cstr("%.1f", meus_danos[i][3]).."%)", 1, 1, 1, 1, 1, 1)
--GameTooltip:AddTexture (meus_danos[i][4][3])
end
end
GameTooltip:AddLine (Loc ["STRING_TARGETS"])
for i = 1, 3 do
local meus_inimigos = alvos [nome]
if (meus_inimigos[i]) then
GameTooltip:AddLine (meus_inimigos[i][1]..": ", _detalhes:comma_value (meus_inimigos[i][2]).." (".._cstr("%.1f", meus_inimigos[i][3]).."%)")
--GameTooltip:AddDoubleLine (meus_inimigos[i][1]..": ", _detalhes:comma_value (meus_inimigos[i][2]).." (".._cstr("%.1f", meus_inimigos[i][3]).."%)", 1, 1, 1, 1, 1, 1)
--GameTooltip:AddTexture ("Interface\\GossipFrame\\BattleMasterGossipIcon.blp")
GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\espadas", nil, nil, 14, 14)
GameCooltip:AddStatusBar (100, 1, .1, .1, .1, .2)
--GameTooltip:AddTexture ("Interface\\AddOns\\Details\\images\\espadas")
end
end
--GameTooltip:AddLine (" ")
_quantidade = _quantidade + 1
if (_quantidade >= _detalhes.tooltip_max_pets) then
return true
local n = _table [1]:gsub (("%s%<.*"), "")
if (instancia.sub_atributo == 1) then
GameCooltip:AddLine (n, _detalhes:comma_value (_table [2]) .. " (" .. _math_floor (_table [2]/self.total*100) .. "%)")
else
GameCooltip:AddLine (n, _detalhes:comma_value ( _math_floor (_table [3])) .. " (" .. _math_floor (_table [2]/self.total*100) .. "%)")
end
GameCooltip:AddStatusBar (100, 1, .1, .1, .1, .3)
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1)
end
end
end
return true
end
---------> DAMAGE TAKEN
function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra)
function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown)
local owner = self.owner
if (owner and owner.classe) then
@@ -1623,17 +1645,28 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra)
end
_table_sort (meus_agressores, function (a, b) return a[2] > b[2] end)
GameCooltip:AddLine (Loc ["STRING_FROM"], nil, nil, headerColor, nil, 12)
--GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0.03515625, 0.087890625, 0.0234375, 0.09765625, _detalhes.class_colors [self.classe])
GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0.126953125, 0.1796875, 0, 0.0546875)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
local max = #meus_agressores
if (max > 6) then
max = 6
end
if (keydown == "shift") then
max = #meus_agressores
end
GameCooltip:AddLine (Loc ["STRING_FROM"], nil, nil, headerColor, nil, 12)
GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0.126953125, 0.1796875, 0, 0.0546875)
if (keydown == "shift") then
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay_press)
GameCooltip:AddStatusBar (100, 1, r, g, b, 1)
else
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
end
for i = 1, max do
GameCooltip:AddLine (meus_agressores[i][1]..": ", _detalhes:comma_value (meus_agressores[i][2]).." (".._cstr("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)")
local classe = meus_agressores[i][3]
@@ -1654,7 +1687,7 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra)
end
---------> FRIENDLY FIRE
function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra)
function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra, keydown)
local owner = self.owner
if (owner and owner.classe) then
@@ -1686,11 +1719,23 @@ function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra)
_table_sort (Skills, _detalhes.Sort2)
GameCooltip:AddLine (Loc ["STRING_TARGETS"].."", nil, nil, headerColor, nil, 12)
--GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0.03515625, 0.087890625, 0.0234375, 0.09765625, _detalhes.class_colors [self.classe])
GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0.126953125, 0.224609375, 0.056640625, 0.140625)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
for i = 1, _math_min (_detalhes.tooltip_max_abilities, #DamagedPlayers) do
if (keydown == "shift") then
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay_press)
GameCooltip:AddStatusBar (100, 1, r, g, b, 1)
else
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
end
local max_abilities = _detalhes.tooltip_max_abilities
if (keydown == "shift") then
max_abilities = 99
end
for i = 1, _math_min (max_abilities, #DamagedPlayers) do
local classe = DamagedPlayers[i][3]
if (not classe) then
classe = "UNKNOW"
@@ -1709,11 +1754,23 @@ function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra)
end
GameCooltip:AddLine (Loc ["STRING_SPELLS"].."", nil, nil, headerColor, nil, 12)
--GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0.03515625, 0.087890625, 0.0234375, 0.09765625, _detalhes.class_colors [self.classe])
GameCooltip:AddIcon ([[Interface\PVPFrame\bg-down-on]], 1, 1, 14, 14, 0, 1, 0, 1)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
for i = 1, _math_min (_detalhes.tooltip_max_abilities, #Skills) do
if (keydown == "ctrl") then
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_ctrl]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay_press)
GameCooltip:AddStatusBar (100, 1, r, g, b, 1)
else
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_ctrl]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
end
local max_abilities2 = _detalhes.tooltip_max_abilities
if (keydown == "ctrl") then
max_abilities2 = 99
end
for i = 1, _math_min (max_abilities2, #Skills) do
local nome, _, icone = _GetSpellInfo (Skills[i][1])
GameCooltip:AddLine (nome.." (x".. Skills[i][3].."): ", _detalhes:comma_value (Skills[i][2]).." (".._cstr("%.1f", Skills[i][2]/FriendlyFireTotal*100).."%)")
GameCooltip:AddIcon (icone, nil, nil, 14, 14)
@@ -2717,6 +2774,11 @@ end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> core functions
--> atualize a funcao de abreviacao
function atributo_damage:UpdateSelectedToKFunction()
SelectedToKFunction = ToKFunctions [_detalhes.ps_abbreviation]
end
--> diminui o total das tabelas do combate
function atributo_damage:subtract_total (combat_table)
combat_table.totals [class_type] = combat_table.totals [class_type] - self.total
@@ -3047,3 +3109,6 @@ end
-- local grayscale = (_math_max (cor[1], cor[2], cor[3]) + _math_min (cor[1], cor[2], cor[3])) / 2 -- average
-- local grayscale = cor[1]*0.21 + cor[2]*0.71 + cor[3]*0.07
--(max(R, G, B) + min(R, G, B)) / 2
+17 -1
View File
@@ -61,6 +61,10 @@ local div_abre = _detalhes.divisores.abre
local div_fecha = _detalhes.divisores.fecha
local div_lugar = _detalhes.divisores.colocacao
local ToKFunctions = _detalhes.ToKFunctions
local SelectedToKFunction = ToKFunctions [1]
local UsingCustomRightText = false
local info = _detalhes.janela_info
local keyName
@@ -281,6 +285,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex
local barras_container = instancia.barras
local combat_time = instancia.showing:GetCombatTime()
UsingCustomRightText = instancia.row_info.textR_enable_custom_text
local use_total_bar = false
if (instancia.total_bar.enabled) then
@@ -429,7 +434,13 @@ function atributo_energy:AtualizaBarra (instancia, barras_container, qual_barra,
local porcentagem = esta_e_energy_total / total * 100
local esta_porcentagem = _math_floor ((esta_e_energy_total/instancia.top) * 100)
esta_barra.texto_direita:SetText (_detalhes:ToK (esta_e_energy_total) .. " " .. div_abre .. _cstr ("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita
local formated_energy = SelectedToKFunction (_, esta_e_energy_total)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_energy, "", _cstr ("%.1f", porcentagem)))
else
esta_barra.texto_direita:SetText (formated_energy .. " " .. div_abre .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita
end
if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip
gump:UpdateTooltip (qual_barra, esta_barra, instancia)
@@ -946,6 +957,11 @@ end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> core functions
--> atualize a funcao de abreviacao
function atributo_energy:UpdateSelectedToKFunction()
SelectedToKFunction = ToKFunctions [_detalhes.ps_abbreviation]
end
--> subtract total from a combat table
function atributo_energy:subtract_total (combat_table)
combat_table.totals [class_type].mana = combat_table.totals [class_type].mana - self.mana
+125 -35
View File
@@ -57,6 +57,10 @@ local div_abre = _detalhes.divisores.abre
local div_fecha = _detalhes.divisores.fecha
local div_lugar = _detalhes.divisores.colocacao
local ToKFunctions = _detalhes.ToKFunctions
local SelectedToKFunction = ToKFunctions [1]
local UsingCustomRightText = false
local info = _detalhes.janela_info
local keyName
@@ -362,6 +366,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo
--print (sub_atributo, total, keyName)
local combat_time = instancia.showing:GetCombatTime()
UsingCustomRightText = instancia.row_info.textR_enable_custom_text
local use_total_bar = false
if (instancia.total_bar.enabled) then
@@ -553,41 +558,71 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l
if (sub_atributo == 1) then --> mostrando healing done
hps = _math_floor (hps)
if (_detalhes.ps_abbreviation == 2) then
hps = _detalhes:ToK (hps)
elseif (_detalhes.ps_abbreviation == 3) then
hps = _detalhes:ToK2 (hps)
end
local formated_heal = SelectedToKFunction (_, healing_total)
local formated_hps = SelectedToKFunction (_, hps)
esta_barra.texto_direita:SetText (_detalhes:ToK (healing_total) .." ".. div_abre .. hps .. ", ".. _cstr ("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_heal, formated_hps, _cstr ("%.1f", porcentagem)))
else
esta_barra.texto_direita:SetText (formated_heal .." ".. div_abre .. formated_hps .. ", " .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita
end
esta_porcentagem = _math_floor ((healing_total/instancia.top) * 100) --> determina qual o tamanho da barra
elseif (sub_atributo == 2) then --> mostrando hps
hps = _math_floor (hps)
if (_detalhes.ps_abbreviation == 2) then
esta_barra.texto_direita:SetText (_detalhes:ToK2 (hps) .." ".. div_abre .. _detalhes:ToK (healing_total) .. ", ".._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita
elseif (_detalhes.ps_abbreviation == 3) then
esta_barra.texto_direita:SetText (_detalhes:ToK2 (hps) .." ".. div_abre .. _detalhes:ToK2 (healing_total) .. ", ".._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita
else
esta_barra.texto_direita:SetText (_detalhes:ToK2 (hps) .." ".. div_abre .. healing_total .. ", ".._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita
local formated_heal = SelectedToKFunction (_, healing_total)
local formated_hps = SelectedToKFunction (_, hps)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_hps, formated_heal, _cstr ("%.1f", porcentagem)))
else
esta_barra.texto_direita:SetText (formated_hps .. " " .. div_abre .. formated_heal .. ", " .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita
end
esta_porcentagem = _math_floor ((hps/instancia.top) * 100) --> determina qual o tamanho da barra
elseif (sub_atributo == 3) then --> mostrando overall
esta_barra.texto_direita:SetText (_detalhes:ToK (self.totalover) .." ".. div_abre .._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto?
local formated_overheal = SelectedToKFunction (_, self.totalover)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_overheal, "", _cstr ("%.1f", porcentagem)))
else
esta_barra.texto_direita:SetText (formated_overheal .." " .. div_abre .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --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
esta_barra.texto_direita:SetText (_detalhes:ToK (self.healing_taken) .." ".. div_abre .._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto?
local formated_healtaken = SelectedToKFunction (_, self.healing_taken)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_healtaken, "", _cstr ("%.1f", porcentagem)))
else
esta_barra.texto_direita:SetText (formated_healtaken .. " " .. div_abre .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto?
end
esta_porcentagem = _math_floor ((self.healing_taken/instancia.top) * 100) --> determina qual o tamanho da barra
elseif (sub_atributo == 5) then --> mostrando enemy heal
esta_barra.texto_direita:SetText (_detalhes:ToK (self.heal_enemy_amt) .." ".. div_abre .._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto?
local formated_enemyheal = SelectedToKFunction (_, self.heal_enemy_amt)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_enemyheal, "", _cstr ("%.1f", porcentagem)))
else
esta_barra.texto_direita:SetText (formated_enemyheal .. " " .. div_abre .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto?
end
esta_porcentagem = _math_floor ((self.heal_enemy_amt/instancia.top) * 100) --> determina qual o tamanho da barra
elseif (sub_atributo == 6) then --> mostrando enemy heal
esta_barra.texto_direita:SetText (_detalhes:ToK (self.totalabsorb) .." ".. div_abre .._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto?
elseif (sub_atributo == 6) then --> mostrando damage prevented
local formated_absorbs = SelectedToKFunction (_, self.totalabsorb)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_absorbs, "", _cstr ("%.1f", porcentagem)))
else
esta_barra.texto_direita:SetText (formated_absorbs .. " " .. div_abre .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto?
end
esta_porcentagem = _math_floor ((self.totalabsorb/instancia.top) * 100) --> determina qual o tamanho da barra
end
end
@@ -758,7 +793,7 @@ end
---------> TOOLTIPS BIFURCAÇÃO
function atributo_heal:ToolTip (instancia, numero, barra)
function atributo_heal:ToolTip (instancia, numero, barra, keydown)
--> seria possivel aqui colocar o icone da classe dele?
if (instancia.atributo == 5) then --> custom
@@ -767,11 +802,11 @@ function atributo_heal:ToolTip (instancia, numero, barra)
--GameTooltip:ClearLines()
--GameTooltip:AddLine (barra.colocacao..". "..self.nome)
if (instancia.sub_atributo <= 3) then --> healing done, HPS or Overheal
return self:ToolTip_HealingDone (instancia, numero, barra)
return self:ToolTip_HealingDone (instancia, numero, barra, keydown)
elseif (instancia.sub_atributo == 6) then --> healing done, HPS or Overheal
return self:ToolTip_HealingDone (instancia, numero, barra)
return self:ToolTip_HealingDone (instancia, numero, barra, keydown)
elseif (instancia.sub_atributo == 4) then --> healing taken
return self:ToolTip_HealingTaken (instancia, numero, barra)
return self:ToolTip_HealingTaken (instancia, numero, barra, keydown)
end
end
end
@@ -779,9 +814,11 @@ end
local r, g, b
local headerColor = "yellow"
local barAlha = .6
local key_overlay = {1, 1, 1, .1}
local key_overlay_press = {1, 1, 1, .2}
---------> HEALING TAKEN
function atributo_heal:ToolTip_HealingTaken (instancia, numero, barra)
function atributo_heal:ToolTip_HealingTaken (instancia, numero, barra, keydown)
local owner = self.owner
if (owner and owner.classe) then
@@ -810,17 +847,30 @@ function atributo_heal:ToolTip_HealingTaken (instancia, numero, barra)
end
GameCooltip:AddLine (Loc ["STRING_FROM"], nil, nil, headerColor, nil, 12)
--GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0.03515625, 0.087890625, 0.0234375, 0.09765625, _detalhes.class_colors [self.classe])
GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TutorialFrame-LevelUp]], 1, 1, 14, 14, 0.10546875, 0.89453125, 0.05859375, 0.6796875)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
if (keydown == "shift") then
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay_press)
GameCooltip:AddStatusBar (100, 1, r, g, b, 1)
else
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
end
_table_sort (meus_curadores, function (a, b) return a[2] > b[2] end)
local max = #meus_curadores
if (max > 6) then
max = 6
end
if (keydown == "shift") then
max = 99
end
for i = 1, max do
for i = 1, _math_min (max, #meus_curadores) do
GameCooltip:AddLine (meus_curadores[i][1]..": ", _detalhes:comma_value (meus_curadores[i][2]).." (".._cstr ("%.1f", (meus_curadores[i][2]/total_curado) * 100).."%)")
local classe = meus_curadores[i][3]
if (not classe) then
@@ -839,7 +889,7 @@ end
---------> HEALING DONE / HPS / OVERHEAL
local background_heal_vs_absorbs = {value = 100, color = {1, 1, 0, .25}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar4_glass]]}
function atributo_heal:ToolTip_HealingDone (instancia, numero, barra)
function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
local owner = self.owner
if (owner and owner.classe) then
@@ -884,13 +934,23 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra)
--> Mostra as habilidades no tooltip
GameCooltip:AddLine (Loc ["STRING_SPELLS"], nil, nil, headerColor, nil, 12) --> localiza-me
GameCooltip:AddIcon ([[Interface\RAIDFRAME\Raid-Icon-Rez]], 1, 1, 14, 14, 0.109375, 0.890625, 0.0625, 0.90625)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
if (keydown == "shift") then
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay_press)
GameCooltip:AddStatusBar (100, 1, r, g, b, 1)
else
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
end
local tooltip_max_abilities = _detalhes.tooltip_max_abilities
if (instancia.sub_atributo == 3 or instancia.sub_atributo == 2) then
tooltip_max_abilities = 6
end
if (keydown == "shift") then
tooltip_max_abilities = 99
end
for i = 1, _math_min (tooltip_max_abilities, #ActorHealingTable) do
if (ActorHealingTable[i][2] < 1) then
@@ -921,15 +981,32 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra)
GameCooltip:AddLine (Loc ["STRING_TARGETS"].."", nil, nil, headerColor, nil, 12)
GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TutorialFrame-LevelUp]], 1, 1, 14, 14, 0.10546875, 0.89453125, 0.05859375, 0.6796875)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
if (keydown == "ctrl") then
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_ctrl]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay_press)
GameCooltip:AddStatusBar (100, 1, r, g, b, 1)
else
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_ctrl]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
end
for i = 1, _math_min (tooltip_max_abilities, #ActorHealingTargets) do
local tooltip_max_abilities2 = _detalhes.tooltip_max_abilities
if (keydown == "ctrl") then
tooltip_max_abilities2 = 99
end
for i = 1, _math_min (tooltip_max_abilities2, #ActorHealingTargets) do
if (ActorHealingTargets[i][2] < 1) then
break
end
GameCooltip:AddLine (ActorHealingTargets[i][1]..": ", _detalhes:comma_value (ActorHealingTargets[i][2]) .." (".._cstr ("%.1f", ActorHealingTargets[i][3]).."%)")
GameCooltip:AddStatusBar (100, 1, .1, .1, .1, .3)
if (tooltip_max_abilities2 == 99 and ActorHealingTargets[i][1]:find (_detalhes.playername)) then
GameCooltip:AddLine (ActorHealingTargets[i][1]..": ", _detalhes:comma_value (ActorHealingTargets[i][2]) .." (".._cstr ("%.1f", ActorHealingTargets[i][3]).."%)", nil, "yellow")
GameCooltip:AddStatusBar (100, 1, .5, .5, .5, .7)
else
GameCooltip:AddLine (ActorHealingTargets[i][1]..": ", _detalhes:comma_value (ActorHealingTargets[i][2]) .." (".._cstr ("%.1f", ActorHealingTargets[i][3]).."%)")
GameCooltip:AddStatusBar (100, 1, .1, .1, .1, .3)
end
local targetActor = container:PegarCombatente (nil, ActorHealingTargets[i][1])
@@ -1002,16 +1079,24 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra)
_table_sort (totais, _detalhes.Sort2)
for _, _table in _ipairs (totais) do
for index, _table in _ipairs (totais) do
if (_table [2] > 0) then
if (_table [2] > 0 and (index < 3 or keydown == "alt")) then
if (not added_logo) then
added_logo = true
GameCooltip:AddLine (Loc ["STRING_PETS"].."", nil, nil, headerColor, nil, 12)
--GameCooltip:AddIcon ([[Interface\Addons\Details\images\icons]], 1, 1, 14, 14, 0.03515625, 0.087890625, 0.0234375, 0.09765625, _detalhes.class_colors [self.classe])
GameCooltip:AddIcon ([[Interface\COMMON\friendship-heart]], 1, 1, 14, 14, 0.21875, 0.78125, 0.09375, 0.6875)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
if (keydown == "alt") then
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_alt]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay_press)
GameCooltip:AddStatusBar (100, 1, r, g, b, 1)
else
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_alt]], 1, 2, 24, 12, 0, 1, 0, 0.640625, key_overlay)
GameCooltip:AddStatusBar (100, 1, r, g, b, barAlha)
end
end
local n = _table [1]:gsub (("%s%<.*"), "")
@@ -1720,6 +1805,11 @@ end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> core functions
--> atualize a funcao de abreviacao
function atributo_heal:UpdateSelectedToKFunction()
SelectedToKFunction = ToKFunctions [_detalhes.ps_abbreviation]
end
--> subtract total from a combat table
function atributo_heal:subtract_total (combat_table)
combat_table.totals [class_type] = combat_table.totals [class_type] - self.total
+118 -15
View File
@@ -115,6 +115,9 @@ function _detalhes:GetInstance (id)
return _detalhes.tabela_instancias [id]
end
function _detalhes:GetId()
return self.meu_id
end
function _detalhes:GetInstanceId()
return self.meu_id
end
@@ -191,9 +194,12 @@ end
_detalhes.opened_windows = _detalhes.opened_windows-1
self:ResetaGump()
gump:Fade (self.baseframe.cabecalho.atributo_icon, _unpack (_detalhes.windows_fade_in))
--gump:Fade (self.baseframe.cabecalho.atributo_icon, _unpack (_detalhes.windows_fade_in))
gump:Fade (self.baseframe.cabecalho.ball, _unpack (_detalhes.windows_fade_in))
gump:Fade (self.baseframe, _unpack (_detalhes.windows_fade_in))
gump:Fade (self.rowframe, _unpack (_detalhes.windows_fade_in))
self:Desagrupar (-1)
if (self.modo == modo_raid) then
@@ -307,6 +313,7 @@ end
gump:Fade (self.baseframe.cabecalho.ball, 0)
gump:Fade (self.baseframe, 0)
gump:Fade (self.rowframe, 0)
self:SetMenuAlpha()
@@ -431,15 +438,27 @@ function _detalhes:BaseFrameSnap()
for lado, snap_to in _pairs (self.snap) do
--print ("DEBUG instancia " .. snap_to .. " lado "..lado)
local instancia_alvo = _detalhes.tabela_instancias [snap_to]
if (lado == 1) then --> a esquerda
instancia_alvo.baseframe:SetPoint ("TOPRIGHT", my_baseframe, "TOPLEFT")
elseif (lado == 2) then --> em baixo
instancia_alvo.baseframe:SetPoint ("TOPLEFT", my_baseframe, "BOTTOMLEFT", 0, -34)
local statusbar_y_mod = 0
if (not self.show_statusbar) then
statusbar_y_mod = 14
end
instancia_alvo.baseframe:SetPoint ("TOPLEFT", my_baseframe, "BOTTOMLEFT", 0, -34 + statusbar_y_mod)
elseif (lado == 3) then --> a direita
instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", my_baseframe, "BOTTOMRIGHT")
elseif (lado == 4) then --> em cima
instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", my_baseframe, "TOPLEFT", 0, 34)
local statusbar_y_mod = 0
if (not instancia_alvo.show_statusbar) then
statusbar_y_mod = -14
end
instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", my_baseframe, "TOPLEFT", 0, 34 + statusbar_y_mod)
end
end
@@ -467,16 +486,32 @@ function _detalhes:BaseFrameSnap()
elseif (lado == 4) then
lado_reverso = 2
end
--> fazer os setpoints
if (lado_reverso == 1) then --> a esquerda
instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", instancia.baseframe, "BOTTOMRIGHT")
elseif (lado_reverso == 2) then --> em baixo
instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", instancia.baseframe, "TOPLEFT", 0, 34)
local statusbar_y_mod = 0
if (not instancia_alvo.show_statusbar) then
statusbar_y_mod = -14
end
instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", instancia.baseframe, "TOPLEFT", 0, 34 + statusbar_y_mod) -- + (statusbar_y_mod*-1)
elseif (lado_reverso == 3) then --> a direita
instancia_alvo.baseframe:SetPoint ("TOPRIGHT", instancia.baseframe, "TOPLEFT")
elseif (lado_reverso == 4) then --> em cima
instancia_alvo.baseframe:SetPoint ("TOPLEFT", instancia.baseframe, "BOTTOMLEFT", 0, -34)
local statusbar_y_mod = 0
if (not instancia.show_statusbar) then
statusbar_y_mod = 14
end
instancia_alvo.baseframe:SetPoint ("TOPLEFT", instancia.baseframe, "BOTTOMLEFT", 0, -34 + statusbar_y_mod)
end
end
end
@@ -492,12 +527,26 @@ function _detalhes:BaseFrameSnap()
if (lado == 1) then --> a esquerda
instancia_alvo.baseframe:SetPoint ("TOPRIGHT", instancia.baseframe, "TOPLEFT")
elseif (lado == 2) then --> em baixo
instancia_alvo.baseframe:SetPoint ("TOPLEFT", instancia.baseframe, "BOTTOMLEFT", 0, -34)
local statusbar_y_mod = 0
if (not instancia.show_statusbar) then
statusbar_y_mod = 14
end
instancia_alvo.baseframe:SetPoint ("TOPLEFT", instancia.baseframe, "BOTTOMLEFT", 0, -34 + statusbar_y_mod)
elseif (lado == 3) then --> a direita
instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", instancia.baseframe, "BOTTOMRIGHT")
elseif (lado == 4) then --> em cima
instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", instancia.baseframe, "TOPLEFT", 0, 34)
local statusbar_y_mod = 0
if (not instancia_alvo.show_statusbar) then
statusbar_y_mod = -14
end
instancia_alvo.baseframe:SetPoint ("BOTTOMLEFT", instancia.baseframe, "TOPLEFT", 0, 34 + statusbar_y_mod)
end
end
end
@@ -529,9 +578,15 @@ function _detalhes:agrupar_janelas (lados)
elseif (lado == 4) then --> cima
--> mover frame
instancia.baseframe:SetPoint ("TOPLEFT", esta_instancia.baseframe, "BOTTOMLEFT", 0, -34)
instancia.baseframe:SetPoint ("TOP", esta_instancia.baseframe, "BOTTOM", 0, -34)
instancia.baseframe:SetPoint ("TOPRIGHT", esta_instancia.baseframe, "BOTTOMRIGHT", 0, -34)
local statusbar_y_mod = 0
if (not esta_instancia.show_statusbar) then
statusbar_y_mod = 14
end
instancia.baseframe:SetPoint ("TOPLEFT", esta_instancia.baseframe, "BOTTOMLEFT", 0, -34 + statusbar_y_mod)
instancia.baseframe:SetPoint ("TOP", esta_instancia.baseframe, "BOTTOM", 0, -34 + statusbar_y_mod)
instancia.baseframe:SetPoint ("TOPRIGHT", esta_instancia.baseframe, "BOTTOMRIGHT", 0, -34 + statusbar_y_mod)
local _, height = esta_instancia:GetSize()
instancia:SetSize (nil, height)
@@ -560,9 +615,15 @@ function _detalhes:agrupar_janelas (lados)
elseif (lado == 2) then --> baixo
--> mover frame
instancia.baseframe:SetPoint ("BOTTOMLEFT", esta_instancia.baseframe, "TOPLEFT", 0, 34)
instancia.baseframe:SetPoint ("BOTTOM", esta_instancia.baseframe, "TOP", 0, 34)
instancia.baseframe:SetPoint ("BOTTOMRIGHT", esta_instancia.baseframe, "TOPRIGHT", 0, 34)
local statusbar_y_mod = 0
if (not instancia.show_statusbar) then
statusbar_y_mod = -14
end
instancia.baseframe:SetPoint ("BOTTOMLEFT", esta_instancia.baseframe, "TOPLEFT", 0, 34 + statusbar_y_mod)
instancia.baseframe:SetPoint ("BOTTOM", esta_instancia.baseframe, "TOP", 0, 34 + statusbar_y_mod)
instancia.baseframe:SetPoint ("BOTTOMRIGHT", esta_instancia.baseframe, "TOPRIGHT", 0, 34 + statusbar_y_mod)
local _, height = esta_instancia:GetSize()
instancia:SetSize (nil, height)
@@ -979,6 +1040,7 @@ function _detalhes:RestauraJanela (index, temp)
self:DefaultIcons (true, true, true, true)
self.iniciada = true
self:AtivarInstancia (temp)
@@ -990,10 +1052,12 @@ end
function _detalhes:ExportSkin()
--create the table
local exported = {
version = _detalhes.preset_version --skin version
}
--export the keys
for key, value in pairs (self) do
if (_detalhes.instance_defaults [key] ~= nil) then
if (type (value) == "table") then
@@ -1003,6 +1067,24 @@ function _detalhes:ExportSkin()
end
end
end
--export mini displays
if (self.StatusBar and self.StatusBar.left) then
exported.StatusBarSaved = {
["left"] = self.StatusBar.left.real_name or "NONE",
["center"] = self.StatusBar.center.real_name or "NONE",
["right"] = self.StatusBar.right.real_name or "NONE",
}
exported.StatusBarSaved.options = {
[self.StatusBarSaved.left] = table_deepcopy (self.StatusBar.left.options),
[self.StatusBarSaved.center] = table_deepcopy (self.StatusBar.center.options),
[self.StatusBarSaved.right] = table_deepcopy (self.StatusBar.right.options)
}
elseif (self.StatusBarSaved) then
exported.StatusBarSaved = table_deepcopy (self.StatusBarSaved)
end
return exported
@@ -1019,6 +1101,8 @@ function _detalhes:ApplySavedSkin (style)
self.skin = ""
self:ChangeSkin (skin)
-- /script print (_detalhes.tabela_instancias[1].baseframe:GetAlpha())
--> overwrite all instance parameters with saved ones
for key, value in pairs (style) do
if (key ~= "skin") then
@@ -1030,6 +1114,25 @@ function _detalhes:ApplySavedSkin (style)
end
end
--> check for new keys inside tables
for key, value in pairs (_detalhes.instance_defaults) do
if (type (value) == "table") then
for key2, value2 in pairs (value) do
if (self [key] [key2] == nil) then
if (type (value2) == "table") then
self [key] [key2] = table_deepcopy (_detalhes.instance_defaults [key] [key2])
else
self [key] [key2] = value2
end
end
end
end
end
self.StatusBarSaved = style.StatusBarSaved and table_deepcopy (style.StatusBarSaved) or {options = {}}
self.StatusBar.options = self.StatusBarSaved.options
_detalhes.StatusBar:UpdateChilds (self)
--> apply all changed attributes
self:ChangeSkin()
end
+9 -3
View File
@@ -72,16 +72,17 @@ _detalhes.instance_defaults = {
--anchor store the anchor point of main menu
menu_anchor = {5, 1, side = 1},
--auto hide window borders
menu_alpha = {enabled = false, iconstoo = true, onenter = 1, onleave = 1},
menu_alpha = {enabled = false, iconstoo = true, onenter = 1, onleave = 1, ignorebars = false},
--auto hide menu
auto_hide_menu = {left = false, right = false},
--attribute text
attribute_text = {enabled = false, anchor = {5, 1}, text_face = "Friz Quadrata TT", text_size = 12, text_color = {1, 1, 1, 1}, side = 1},
attribute_text = {enabled = false, anchor = {5, 1}, text_face = "Friz Quadrata TT", text_size = 12, text_color = {1, 1, 1, 1}, side = 1, shadow = false},
--instance button anchor store the anchor point of instance and delete button
instance_button_anchor = {-27, 1},
--total bar
total_bar = {enabled = false, color = {1, 1, 1}, only_in_group = true, icon = [[Interface\ICONS\INV_Sigil_Thorim]]},
--row animation when show
row_show_animation = {anim = "Fade", options = {}},
--row info
row_info = {
--if true the texture of the bars will have the color of his actor class
@@ -94,6 +95,9 @@ _detalhes.instance_defaults = {
textL_class_colors = false,
--right text class color
textR_class_colors = false,
--right text informations
textR_enable_custom_text = false,
textR_custom_text = "{data1} ({data2}, {data3}%)",
--if text class color are false, this color will be used
fixed_text_color = {1, 1, 1},
--left text outline effect
@@ -136,6 +140,8 @@ _detalhes.instance_defaults = {
--hide in combat
hide_in_combat = false,
hide_in_combat_alpha = 0,
--strata
strata = "LOW",
--wallpaper
wallpaper = {
enabled = false,
+18 -2
View File
@@ -61,6 +61,10 @@ local div_abre = _detalhes.divisores.abre
local div_fecha = _detalhes.divisores.fecha
local div_lugar = _detalhes.divisores.colocacao
local ToKFunctions = _detalhes.ToKFunctions
local SelectedToKFunction = ToKFunctions [1]
local UsingCustomRightText = false
local info = _detalhes.janela_info
local keyName
@@ -566,6 +570,8 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo
local qual_barra = 1
local barras_container = instancia.barras
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) --> instância, index, total, valor da 1º barra
@@ -648,7 +654,11 @@ function atributo_misc:AtualizaBarra (instancia, barras_container, qual_barra, l
local porcentagem = meu_total / total * 100
local esta_porcentagem = _math_floor ((meu_total/instancia.top) * 100)
esta_barra.texto_direita:SetText (meu_total .." ".. div_abre .. _cstr ("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (meu_total, "", _cstr ("%.1f", porcentagem)))
else
esta_barra.texto_direita:SetText (meu_total .." ".. div_abre .. _cstr ("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita
end
if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip
gump:UpdateTooltip (qual_barra, esta_barra, instancia)
@@ -1841,7 +1851,13 @@ end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> core functions
local sub_list = {"cc_break", "ress", "interrupt", "cooldowns_defensive", "dispell", "dead"}
--> atualize a funcao de abreviacao
function atributo_misc:UpdateSelectedToKFunction()
SelectedToKFunction = ToKFunctions [_detalhes.ps_abbreviation]
end
local sub_list = {"cc_break", "ress", "interrupt", "cooldowns_defensive", "dispell", "dead"}
--> subtract total from a combat table
function atributo_misc:subtract_total (combat_table)