- added support to skins, change over options panel.

This commit is contained in:
Tercio
2013-12-03 01:33:43 -02:00
parent 2de7f3aaa5
commit 3cd5a901df
30 changed files with 538 additions and 227 deletions
+43 -36
View File
@@ -445,8 +445,8 @@ function _detalhes:agrupar_janelas (lados)
self.snap [4] = esta_instancia.meu_id
esta_instancia.snap [2] = self.meu_id
esta_instancia.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", esta_instancia.baseframe.rodape.top_bg, "left", 25, 10)
esta_instancia.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", esta_instancia.baseframe.rodape.top_bg, "center", 20, 10)
esta_instancia.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", esta_instancia.baseframe.rodape.top_bg, "left", 25, 58)
esta_instancia.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", esta_instancia.baseframe.rodape.top_bg, "center", 20, 58)
esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left_snap")
esta_instancia.baseframe.rodape.esquerdo.have_snap = true
@@ -476,9 +476,9 @@ function _detalhes:agrupar_janelas (lados)
self.snap [2] = esta_instancia.meu_id
esta_instancia.snap [4] = self.meu_id
self.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", self.baseframe.rodape.top_bg, "left", 25, 10)
self.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", self.baseframe.rodape.top_bg, "center", 20, 10)
self.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left_snap")
self.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", self.baseframe.rodape.top_bg, "left", 25, 58)
self.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", self.baseframe.rodape.top_bg, "center", 20, 58)
self.baseframe.rodape.esquerdo:SetTexture ([[Interface\AddOns\Details\images\bar_down_left_snap]])
self.baseframe.rodape.esquerdo.have_snap = true
end
@@ -558,8 +558,8 @@ function _detalhes:Desagrupar (instancia, lado)
end
if (index == 2) then -- index é o codigo do snap
esta_instancia.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", esta_instancia.baseframe.rodape.top_bg, "left", 5, 10)
esta_instancia.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", esta_instancia.baseframe.rodape.top_bg, "center", 0, 10)
esta_instancia.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", esta_instancia.baseframe.rodape.top_bg, "left", 5, 58)
esta_instancia.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", esta_instancia.baseframe.rodape.top_bg, "center", 0, 58)
esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left")
esta_instancia.baseframe.rodape.esquerdo.have_snap = nil
end
@@ -569,6 +569,7 @@ function _detalhes:Desagrupar (instancia, lado)
end
gump:Fade (instancia.botao_separar, 1)
instancia.verticalSnap = false
instancia.horizontalSnap = false
return
@@ -635,6 +636,8 @@ end
nova_instancia.meu_id = ID
nova_instancia.skin = "Default Skin"
nova_instancia.barras = {} --container que irá armazenar todas as barras
nova_instancia.barraS = {nil, nil} --de x até x são as barras que estão sendo mostradas na tela
nova_instancia.rolagem = false --barra de rolagem não esta sendo mostrada
@@ -785,6 +788,8 @@ end
--> search key: ~restaura
function _detalhes:RestauraJanela (index, temp)
self.skin = self.skin or "Default Skin"
self.bg_alpha = self.bg_alpha or _detalhes.default_bg_alpha
self.bg_r = self.bg_r or _detalhes.default_bg_color
self.bg_g = self.bg_g or _detalhes.default_bg_color
@@ -954,6 +959,8 @@ function _detalhes:RestauraJanela (index, temp)
self.iniciada = true
self:AtivarInstancia (temp)
self:ChangeSkin()
end
------------------------------------------------------------------------------------------------------------------------
@@ -1506,53 +1513,53 @@ end
-- o modo é apenas afetado na hora de mostrar o que na tabela
function _detalhes:ChangeIcon (icon)
local skin = _detalhes.skins [self.skin]
if (icon) then
--> plugin chamou uma troca de icone
self.baseframe.cabecalho.atributo_icon:SetTexture (icon)
self.baseframe.cabecalho.atributo_icon:SetTexCoord (5/64, 60/64, 3/64, 62/64)
self.baseframe.cabecalho.atributo_icon:SetWidth (19)
self.baseframe.cabecalho.atributo_icon:SetHeight (20)
self.baseframe.cabecalho.atributo_icon:SetPoint ("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", -11, -6)
local icon_size = skin.icon_plugins_size
self.baseframe.cabecalho.atributo_icon:SetWidth (icon_size[1])
self.baseframe.cabecalho.atributo_icon:SetHeight (icon_size[2])
local icon_anchor = skin.icon_anchor_plugins
self.baseframe.cabecalho.atributo_icon:SetPoint ("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", icon_anchor[1], icon_anchor[2])
elseif (self.modo == modo_alone) then --> solo
-- o icone é alterado pelo próprio plugin
--[[
self.baseframe.cabecalho.atributo_icon:SetTexture ("Interface\\AddOns\\Details\\images\\icon_mainwindow2")
self.baseframe.cabecalho.atributo_icon:SetTexCoord (32/256 * (1-1), 32/256 * 1, 0, 1) --> solo é o primeiro icone
self.baseframe.cabecalho.atributo_icon:SetPoint ("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", -1, 1)
self.baseframe.cabecalho.atributo_icon:SetWidth (30)
self.baseframe.cabecalho.atributo_icon:SetHeight (30)
--]]
--print ("Icon Changed 1")
--_detalhes.SoloTables.Menu [INDEX] [2]
elseif (self.modo == modo_grupo or self.modo == modo_all) then --> grupo
if (self.atributo == 5) then
--> custom
local icon = _detalhes.custom [self.sub_atributo].icon
self.baseframe.cabecalho.atributo_icon:SetTexture (icon)
self.baseframe.cabecalho.atributo_icon:SetTexCoord (5/64, 60/64, 3/64, 62/64)
self.baseframe.cabecalho.atributo_icon:SetWidth (20)
self.baseframe.cabecalho.atributo_icon:SetHeight (20)
self.baseframe.cabecalho.atributo_icon:SetPoint ("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", -10, -5)
local icon_size = skin.icon_plugins_size
self.baseframe.cabecalho.atributo_icon:SetWidth (icon_size[1])
self.baseframe.cabecalho.atributo_icon:SetHeight (icon_size[2])
local icon_anchor = skin.icon_anchor_plugins
self.baseframe.cabecalho.atributo_icon:SetPoint ("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", icon_anchor[1], icon_anchor[2])
else
self.baseframe.cabecalho.atributo_icon:SetTexture ("Interface\\AddOns\\Details\\images\\icon_mainwindow")
self.baseframe.cabecalho.atributo_icon:SetTexCoord (32/256 * (self.atributo-1), 32/256 * self.atributo, 0, 1)
self.baseframe.cabecalho.atributo_icon:SetPoint ("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", -1, 1)
self.baseframe.cabecalho.atributo_icon:SetWidth (30)
self.baseframe.cabecalho.atributo_icon:SetHeight (30)
--> normal
local half = 0.00048828125
local size = 0.03125
self.baseframe.cabecalho.atributo_icon:SetTexture (_detalhes.skin_path .. skin.file)
self.baseframe.cabecalho.atributo_icon:SetTexCoord ( (0.03125 * (self.atributo-1)) + half, (0.03125 * self.atributo) - half, 0.35693359375, 0.38720703125)
local icon_anchor = skin.icon_anchor_main
self.baseframe.cabecalho.atributo_icon:SetPoint ("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", icon_anchor[1], icon_anchor[2])
self.baseframe.cabecalho.atributo_icon:SetWidth (32)
self.baseframe.cabecalho.atributo_icon:SetHeight (32)
end
elseif (self.modo == modo_raid) then --> raid
--[[
self.baseframe.cabecalho.atributo_icon:SetTexture ("Interface\\AddOns\\Details\\images\\icon_mainwindow2")
self.baseframe.cabecalho.atributo_icon:SetTexCoord (32/256 * (2-1), 32/256 * 2, 0, 1) --> solo é o primeiro icone
self.baseframe.cabecalho.atributo_icon:SetPoint ("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", -1, 1)
self.baseframe.cabecalho.atributo_icon:SetWidth (30)
self.baseframe.cabecalho.atributo_icon:SetHeight (30)
--]]
-- o icone é alterado pelo próprio plugin
end
end
+40 -4
View File
@@ -977,6 +977,26 @@ end
local UnitReaction = UnitReaction
function _detalhes:CloseEnemyDebuffsUptime()
local combat = _detalhes.tabela_vigente
local misc_container = combat [4]._ActorTable
for _, actor in _ipairs (misc_container) do
if (actor.boss_debuff) then
for index, target in _ipairs (actor.debuff_uptime_targets._ActorTable) do
if (target.actived and target.actived_at) then
target.uptime = target.uptime + _detalhes._tempo - target.actived_at
actor.debuff_uptime = actor.debuff_uptime + _detalhes._tempo - target.actived_at
target.actived = false
target.actived_at = nil
end
end
end
end
return
end
function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN"
if (in_or_out == "DEBUFF_UPTIME_OUT") then
@@ -988,7 +1008,7 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN"
for spellid, spell in _pairs (actor.debuff_uptime_spell_tables._ActorTable) do
if (spell.actived and spell.actived_at) then
spell.uptime = spell.uptime + _detalhes._tempo - spell.actived_at
actor.debuff_uptime = actor.debuff_uptime + _detalhes._tempo - spell.actived_at --> token = actor misc object
actor.debuff_uptime = actor.debuff_uptime + _detalhes._tempo - spell.actived_at
spell.actived = false
spell.actived_at = nil
end
@@ -1030,7 +1050,8 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN"
for raidIndex = 1, _GetNumGroupMembers()-1 do
local his_target = _UnitGUID ("party"..raidIndex.."target")
if (his_target and not checked [his_target] and UnitReaction ("party"..raidIndex.."target", "player") <= 4) then
local rect = UnitReaction ("party"..raidIndex.."target", "player")
if (his_target and not checked [his_target] and rect and rect <= 4) then
checked [his_target] = true
@@ -1049,8 +1070,8 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN"
end
local his_target = _UnitGUID ("playertarget")
if (his_target and not checked [his_target] and UnitReaction ("playertarget", "player") <= 4) then
local rect = UnitReaction ("playertarget", "player")
if (his_target and not checked [his_target] and rect and rect <= 4) then
for debuffIndex = 1, 40 do
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff ("playertarget", debuffIndex)
if (name and unitCaster) then
@@ -1862,6 +1883,10 @@ local sub_list = {"cc_break", "ress", "interrupt", "cooldowns_defensive", "dispe
--> cria e soma o valor do total
local alvo_shadow = shadow [container]:PegarCombatente (nil, alvo.nome, nil, true)
alvo_shadow.total = alvo_shadow.total + alvo.total
if (alvo.uptime) then --> boss debuff
alvo_shadow.uptime = alvo_shadow.uptime + alvo.uptime
alvo_shadow.activedamt = alvo_shadow.activedamt + alvo.activedamt
end
--> refresh no alvo
_detalhes.refresh:r_alvo_da_habilidade (alvo, shadow [container])
end
@@ -1916,6 +1941,9 @@ local sub_list = {"cc_break", "ress", "interrupt", "cooldowns_defensive", "dispe
--> soma o total (captura de dados)
shadow.debuff_uptime = shadow.debuff_uptime + actor.debuff_uptime
--> copia o container de alvos (captura de dados)
if (actor.boss_debuff) then
actor.debuff_uptime_targets.tipo = _detalhes.container_type.CONTAINER_ENEMYDEBUFFTARGET_CLASS
end
somar_alvos ("debuff_uptime_targets", shadow)
--> copia o container de habilidades (captura de dados)
somar_habilidades ("debuff_uptime_spell_tables", shadow)
@@ -2306,6 +2334,10 @@ atributo_misc.__add = function (tabela1, tabela2)
for index, alvo in _ipairs (tabela2.debuff_uptime_targets._ActorTable) do
local alvo_tabela1 = tabela1.debuff_uptime_targets:PegarCombatente (nil, alvo.nome, nil, true)
alvo_tabela1.total = alvo_tabela1.total + alvo.total
if (alvo.uptime) then --> boss debuff
alvo_tabela1.uptime = alvo_tabela1.uptime + alvo.uptime
alvo_tabela1.activedamt = alvo_tabela1.activedamt + alvo.activedamt
end
end
for spellid, habilidade in _pairs (tabela2.debuff_uptime_spell_tables._ActorTable) do
@@ -2557,6 +2589,10 @@ atributo_misc.__sub = function (tabela1, tabela2)
for index, alvo in _ipairs (tabela2.debuff_uptime_targets._ActorTable) do
local alvo_tabela1 = tabela1.debuff_uptime_targets:PegarCombatente (nil, alvo.nome, nil, true)
alvo_tabela1.total = alvo_tabela1.total - alvo.total
if (alvo.uptime) then --> boss debuff
alvo_tabela1.uptime = alvo_tabela1.uptime - alvo.uptime
alvo_tabela1.activedamt = alvo_tabela1.activedamt - alvo.activedamt
end
end
for spellid, habilidade in _pairs (tabela2.debuff_uptime_spell_tables._ActorTable) do
+14 -1
View File
@@ -19,6 +19,7 @@ local container_energy = _detalhes.container_type.CONTAINER_ENERGY_CLASS
local container_energy_target = _detalhes.container_type.CONTAINER_ENERGYTARGET_CLASS
local container_misc = _detalhes.container_type.CONTAINER_MISC_CLASS
local container_misc_target = _detalhes.container_type.CONTAINER_MISCTARGET_CLASS
local container_enemydebufftarget_target = _detalhes.container_type.CONTAINER_ENEMYDEBUFFTARGET_CLASS
--api locals
local _UnitClass = UnitClass
@@ -386,7 +387,16 @@ function container_combatentes:PegarCombatente (serial, nome, flag, criar, isOwn
if (shadow_objeto) then
novo_objeto.shadow = shadow_objeto
--shadow_objeto.flag = details_flag
end
elseif (self.tipo == container_enemydebufftarget_target) then
novo_objeto.uptime = 0
novo_objeto.actived = false
novo_objeto.activedamt = 0
if (shadow_objeto) then
novo_objeto.shadow = shadow_objeto
end
elseif (self.tipo == container_misc_target) then --> CONTAINER ALVOS DO MISC
@@ -447,6 +457,9 @@ function container_combatentes:FuncaoDeCriacao (tipo)
elseif (tipo == container_friendlyfire) then
return atributo_damage.FF_funcao_de_criacao
elseif (tipo == container_enemydebufftarget_target) then
return alvo_da_habilidade.NovaTabela
elseif (tipo == container_energy) then
return atributo_energy.NovaTabela