- memory usage decreased in approximately 20%.
- small parser speed improvement, approximately 4%. - fixed some memory leaks. - fixed issues were details doesn't open with /details new. - added feedback options for details report.
This commit is contained in:
@@ -24,6 +24,7 @@ local _date = date --> lua api
|
||||
|
||||
--time hold
|
||||
local _tempo = time()
|
||||
local _
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ local _GetNumRaidMembers = GetNumRaidMembers or GetNumGroupMembers
|
||||
local _GetUnitName = GetUnitName
|
||||
|
||||
local gump = _detalhes.gump
|
||||
local _
|
||||
|
||||
local atributo_custom = _detalhes.atributo_custom
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ local AceLocale = LibStub ("AceLocale-3.0")
|
||||
local Loc = AceLocale:GetLocale ( "Details" )
|
||||
|
||||
local gump = _detalhes.gump
|
||||
local _
|
||||
|
||||
local alvo_da_habilidade = _detalhes.alvo_da_habilidade
|
||||
local container_habilidades = _detalhes.container_habilidades
|
||||
@@ -1057,7 +1058,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra)
|
||||
if (not quantidade [nome]) then
|
||||
quantidade [nome] = 1
|
||||
|
||||
local my_self = instancia.showing[class_type]:PegarCombatente (_, nome)
|
||||
local my_self = instancia.showing[class_type]:PegarCombatente (nil, nome)
|
||||
if (my_self) then
|
||||
local meu_total = my_self.total_without_pet
|
||||
local tabela = my_self.spell_tables._ActorTable
|
||||
@@ -2223,7 +2224,7 @@ function _detalhes.refresh:r_atributo_damage (este_jogador, shadow)
|
||||
|
||||
_setmetatable (friendlyfire, _detalhes)
|
||||
|
||||
local friendlyfire_shadow = shadow.friendlyfire:PegarCombatente (_, friendlyfire.nome) --> corrigido erro aqui, estava este_jogador.nome
|
||||
local friendlyfire_shadow = shadow.friendlyfire:PegarCombatente (nil, friendlyfire.nome) --> corrigido erro aqui, estava este_jogador.nome
|
||||
_detalhes.refresh:r_container_habilidades (friendlyfire.spell_tables, friendlyfire_shadow.spell_tables) -- acho que corrigi mais um bug, estava apenas 'friendlyfire_shadow'
|
||||
|
||||
end
|
||||
@@ -2293,7 +2294,7 @@ atributo_damage.__add = function (shadow, tabela2)
|
||||
|
||||
--> copia o container de alvos
|
||||
for index, alvo in _ipairs (tabela2.targets._ActorTable) do
|
||||
local alvo_shadow = shadow.targets:PegarCombatente (alvo.serial, alvo.nome, _, true)
|
||||
local alvo_shadow = shadow.targets:PegarCombatente (alvo.serial, alvo.nome, nil, true)
|
||||
alvo_shadow.total = alvo_shadow.total + alvo.total
|
||||
end
|
||||
--> copia o container de friendly fire
|
||||
|
||||
@@ -20,6 +20,7 @@ local container_damage_target = _detalhes.container_type.CONTAINER_DAMAGETARGET_
|
||||
local _setmetatable = setmetatable
|
||||
local _ipairs = ipairs
|
||||
local _pairs = pairs
|
||||
local _
|
||||
--api locals
|
||||
local _UnitAura = UnitAura
|
||||
--local _GetSpellInfo = _detalhes.getspellinfo
|
||||
@@ -36,7 +37,7 @@ function habilidade_dano:NovaTabela (id, link, token) --aqui eu n
|
||||
total = 0, --total de dano aplicado por esta habilidade
|
||||
counter = 0, --conta quantas vezes a habilidade foi chamada
|
||||
id = id,
|
||||
school = 0,
|
||||
--school = 0,
|
||||
|
||||
--> normal
|
||||
n_min = 0,
|
||||
@@ -51,30 +52,30 @@ function habilidade_dano:NovaTabela (id, link, token) --aqui eu n
|
||||
c_dmg = 0,
|
||||
|
||||
--> glacing
|
||||
g_min = 0, --not sure but, glancing min and max shouldn't be necessary
|
||||
g_max = 0, --
|
||||
--g_min = 0, --not sure but, glancing min and max shouldn't be necessary
|
||||
--g_max = 0, --
|
||||
g_amt = 0,
|
||||
g_dmg = 0,
|
||||
|
||||
--> resisted
|
||||
r_min = 0, --not sure but, resisted min and max shouldn't be necessary
|
||||
r_max = 0, --
|
||||
--r_min = 0, --not sure but, resisted min and max shouldn't be necessary
|
||||
--r_max = 0, --
|
||||
r_amt = 0,
|
||||
r_dmg = 0,
|
||||
|
||||
--> blocked
|
||||
b_min = 0, --not sure but, block min and max shouldn't be necessary
|
||||
b_max = 0, --
|
||||
--b_min = 0, --not sure but, block min and max shouldn't be necessary
|
||||
--b_max = 0, --
|
||||
b_amt = 0,
|
||||
b_dmg = 0,
|
||||
|
||||
--> obsorved
|
||||
a_min = 0, --not sure but, absorbed min and max shouldn't be necessary
|
||||
a_max = 0, --
|
||||
--a_min = 0, --not sure but, absorbed min and max shouldn't be necessary
|
||||
--a_max = 0, --
|
||||
a_amt = 0,
|
||||
a_dmg = 0,
|
||||
|
||||
crushing = 0, --> this still exists?
|
||||
--crushing = 0, --> this still exists?
|
||||
|
||||
targets = container_combatentes:NovoContainer (container_damage_target)
|
||||
}
|
||||
@@ -127,37 +128,38 @@ function habilidade_dano:Add (serial, nome, flag, amount, who_nome, resisted, bl
|
||||
if (resisted and resisted > 0) then
|
||||
self.r_dmg = self.r_dmg+amount --> tabela.total é o total de dano
|
||||
self.r_amt = self.r_amt+1 --> tabela.total é o total de dano
|
||||
if (amount > self.r_max) then
|
||||
self.r_max = amount
|
||||
end
|
||||
if (self.r_min > amount or self.r_min == 0) then
|
||||
self.r_min = amount
|
||||
end
|
||||
--if (amount > self.r_max) then
|
||||
-- self.r_max = amount
|
||||
--end
|
||||
--if (self.r_min > amount or self.r_min == 0) then
|
||||
-- self.r_min = amount
|
||||
--end
|
||||
end
|
||||
|
||||
if (blocked and blocked > 0) then
|
||||
self.b_dmg = self.b_dmg+amount --> amount é o total de dano
|
||||
self.b_amt = self.b_amt+1 --> amount é o total de dano
|
||||
if (amount > self.b_max) then
|
||||
self.b_max = amount
|
||||
end
|
||||
if (self.b_min > amount or self.b_min == 0) then
|
||||
self.b_min = amount
|
||||
end
|
||||
--if (amount > self.b_max) then
|
||||
-- self.b_max = amount
|
||||
--end
|
||||
--if (self.b_min > amount or self.b_min == 0) then
|
||||
-- self.b_min = amount
|
||||
--end
|
||||
end
|
||||
|
||||
if (absorbed and absorbed > 0) then
|
||||
self.a_dmg = self.a_dmg+amount --> amount é o total de dano
|
||||
self.a_amt = self.a_amt+1 --> amount é o total de dano
|
||||
if (amount > self.a_max) then
|
||||
self.a_max = amount
|
||||
end
|
||||
if (self.a_min > amount or self.a_min == 0) then
|
||||
self.a_min = amount
|
||||
end
|
||||
--if (amount > self.a_max) then
|
||||
-- self.a_max = amount
|
||||
--end
|
||||
--if (self.a_min > amount or self.a_min == 0) then
|
||||
-- self.a_min = amount
|
||||
--end
|
||||
end
|
||||
|
||||
if (amount and amount > 0) then
|
||||
--if (amount and amount > 0) then
|
||||
--if (amount and amount > 0) then
|
||||
|
||||
self.total = self.total + amount
|
||||
|
||||
@@ -168,12 +170,12 @@ function habilidade_dano:Add (serial, nome, flag, amount, who_nome, resisted, bl
|
||||
-- esta_tabela.glacing = {["mim"] = 0, ["max"] = 0, ["total"] = 0, ["dmg"] = 0}
|
||||
self.g_dmg = self.g_dmg+amount --> amount é o total de dano
|
||||
self.g_amt = self.g_amt+1 --> amount é o total de dano
|
||||
if (amount > self.g_max) then
|
||||
self.g_max = amount
|
||||
end
|
||||
if (self.g_min > amount or self.g_min == 0) then
|
||||
self.g_min = amount
|
||||
end
|
||||
--if (amount > self.g_max) then
|
||||
-- self.g_max = amount
|
||||
--end
|
||||
--if (self.g_min > amount or self.g_min == 0) then
|
||||
-- self.g_min = amount
|
||||
--end
|
||||
elseif (critical) then
|
||||
--esta_tabela.critico = {["mim"] = 0, ["max"] = 0, ["total"] = 0, ["dmg"] = 0}
|
||||
self.c_dmg = self.c_dmg+amount --> amount é o total de dano
|
||||
@@ -195,7 +197,7 @@ function habilidade_dano:Add (serial, nome, flag, amount, who_nome, resisted, bl
|
||||
self.n_min = amount
|
||||
end
|
||||
end
|
||||
end
|
||||
--end
|
||||
|
||||
if (self.shadow) then
|
||||
|
||||
@@ -288,27 +290,27 @@ habilidade_dano.__add = function (tabela1, tabela2)
|
||||
tabela1.c_amt = tabela1.c_amt + tabela2.c_amt
|
||||
tabela1.c_dmg = tabela1.c_dmg + tabela2.c_dmg
|
||||
|
||||
tabela1.g_min = tabela1.g_min + tabela2.g_min
|
||||
tabela1.g_max = tabela1.g_max + tabela2.g_max
|
||||
--tabela1.g_min = tabela1.g_min + tabela2.g_min
|
||||
--tabela1.g_max = tabela1.g_max + tabela2.g_max
|
||||
tabela1.g_amt = tabela1.g_amt + tabela2.g_amt
|
||||
tabela1.g_dmg = tabela1.g_dmg + tabela2.g_dmg
|
||||
|
||||
tabela1.r_min = tabela1.r_min + tabela2.r_min
|
||||
tabela1.r_max = tabela1.r_max + tabela2.r_max
|
||||
--tabela1.r_min = tabela1.r_min + tabela2.r_min
|
||||
--tabela1.r_max = tabela1.r_max + tabela2.r_max
|
||||
tabela1.r_amt = tabela1.r_amt + tabela2.r_amt
|
||||
tabela1.r_dmg = tabela1.r_dmg + tabela2.r_dmg
|
||||
|
||||
tabela1.b_min = tabela1.b_min + tabela2.b_min
|
||||
tabela1.b_max = tabela1.b_max + tabela2.b_max
|
||||
--tabela1.b_min = tabela1.b_min + tabela2.b_min
|
||||
--tabela1.b_max = tabela1.b_max + tabela2.b_max
|
||||
tabela1.b_amt = tabela1.b_amt + tabela2.b_amt
|
||||
tabela1.b_dmg = tabela1.b_dmg + tabela2.b_dmg
|
||||
|
||||
tabela1.a_min = tabela1.a_min + tabela2.a_min
|
||||
tabela1.a_max = tabela1.a_max + tabela2.a_max
|
||||
--tabela1.a_min = tabela1.a_min + tabela2.a_min
|
||||
--tabela1.a_max = tabela1.a_max + tabela2.a_max
|
||||
tabela1.a_amt = tabela1.a_amt + tabela2.a_amt
|
||||
tabela1.a_dmg = tabela1.a_dmg + tabela2.a_dmg
|
||||
|
||||
tabela1.crushing = tabela1.crushing + tabela2.crushing
|
||||
--tabela1.crushing = tabela1.crushing + tabela2.crushing
|
||||
|
||||
return tabela1
|
||||
end
|
||||
@@ -327,27 +329,27 @@ habilidade_dano.__sub = function (tabela1, tabela2)
|
||||
tabela1.c_amt = tabela1.c_amt - tabela2.c_amt
|
||||
tabela1.c_dmg = tabela1.c_dmg - tabela2.c_dmg
|
||||
|
||||
tabela1.g_min = tabela1.g_min - tabela2.g_min
|
||||
tabela1.g_max = tabela1.g_max - tabela2.g_max
|
||||
--tabela1.g_min = tabela1.g_min - tabela2.g_min
|
||||
--tabela1.g_max = tabela1.g_max - tabela2.g_max
|
||||
tabela1.g_amt = tabela1.g_amt - tabela2.g_amt
|
||||
tabela1.g_dmg = tabela1.g_dmg - tabela2.g_dmg
|
||||
|
||||
tabela1.r_min = tabela1.r_min - tabela2.r_min
|
||||
tabela1.r_max = tabela1.r_max - tabela2.r_max
|
||||
--tabela1.r_min = tabela1.r_min - tabela2.r_min
|
||||
--tabela1.r_max = tabela1.r_max - tabela2.r_max
|
||||
tabela1.r_amt = tabela1.r_amt - tabela2.r_amt
|
||||
tabela1.r_dmg = tabela1.r_dmg - tabela2.r_dmg
|
||||
|
||||
tabela1.b_min = tabela1.b_min - tabela2.b_min
|
||||
tabela1.b_max = tabela1.b_max - tabela2.b_max
|
||||
--tabela1.b_min = tabela1.b_min - tabela2.b_min
|
||||
--tabela1.b_max = tabela1.b_max - tabela2.b_max
|
||||
tabela1.b_amt = tabela1.b_amt - tabela2.b_amt
|
||||
tabela1.b_dmg = tabela1.b_dmg - tabela2.b_dmg
|
||||
|
||||
tabela1.a_min = tabela1.a_min - tabela2.a_min
|
||||
tabela1.a_max = tabela1.a_max - tabela2.a_max
|
||||
--tabela1.a_min = tabela1.a_min - tabela2.a_min
|
||||
--tabela1.a_max = tabela1.a_max - tabela2.a_max
|
||||
tabela1.a_amt = tabela1.a_amt - tabela2.a_amt
|
||||
tabela1.a_dmg = tabela1.a_dmg - tabela2.a_dmg
|
||||
|
||||
tabela1.crushing = tabela1.crushing - tabela2.crushing
|
||||
--tabela1.crushing = tabela1.crushing - tabela2.crushing
|
||||
|
||||
return tabela1
|
||||
end
|
||||
|
||||
@@ -25,6 +25,7 @@ local GameTooltip = GameTooltip
|
||||
local _detalhes = _G._detalhes
|
||||
local AceLocale = LibStub ("AceLocale-3.0")
|
||||
local Loc = AceLocale:GetLocale ( "Details" )
|
||||
local _
|
||||
|
||||
local gump = _detalhes.gump
|
||||
|
||||
@@ -918,7 +919,7 @@ atributo_energy.__add = function (shadow, tabela2)
|
||||
shadow.holypower_r = shadow.holypower_r + tabela2.holypower_r
|
||||
|
||||
for index, alvo in _ipairs (tabela2.targets._ActorTable) do
|
||||
local alvo_shadow = shadow.targets:PegarCombatente (alvo.serial, alvo.nome, _, true)
|
||||
local alvo_shadow = shadow.targets:PegarCombatente (alvo.serial, alvo.nome, nil, true)
|
||||
alvo_shadow.total = alvo_shadow.total + alvo.total
|
||||
end
|
||||
|
||||
@@ -927,7 +928,7 @@ atributo_energy.__add = function (shadow, tabela2)
|
||||
local habilidade_shadow = shadow.spell_tables:PegaHabilidade (spellid, true, nil, true)
|
||||
|
||||
for index, alvo in _ipairs (habilidade.targets._ActorTable) do
|
||||
local alvo_shadow = habilidade_shadow.targets:PegarCombatente (alvo.serial, alvo.nome, _, true)
|
||||
local alvo_shadow = habilidade_shadow.targets:PegarCombatente (alvo.serial, alvo.nome, nil, true)
|
||||
alvo_shadow.total = alvo_shadow.total + alvo.total
|
||||
end
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ local _setmetatable = setmetatable
|
||||
local _ipairs = ipairs
|
||||
--api locals
|
||||
local _UnitAura = UnitAura
|
||||
local _
|
||||
--local _GetSpellInfo = _detalhes.getspellinfo
|
||||
|
||||
local container_playernpc = _detalhes.container_type.CONTAINER_PLAYERNPC
|
||||
|
||||
@@ -22,6 +22,7 @@ local _GetSpellInfo = _detalhes.getspellinfo
|
||||
|
||||
|
||||
local _detalhes = _G._detalhes
|
||||
local _
|
||||
|
||||
local AceLocale = LibStub ("AceLocale-3.0")
|
||||
local Loc = AceLocale:GetLocale ( "Details" )
|
||||
@@ -790,7 +791,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra)
|
||||
GameCooltip:AddLine (ActorHealingTargets[i][1]..": ", _detalhes:comma_value (ActorHealingTargets[i][2]) .." (".._cstr ("%.1f", ActorHealingTargets[i][3]).."%)")
|
||||
GameCooltip:AddStatusBar (100, 1, .1, .1, .1, .3)
|
||||
|
||||
local targetActor = container:PegarCombatente (_, ActorHealingTargets[i][1])
|
||||
local targetActor = container:PegarCombatente (nil, ActorHealingTargets[i][1])
|
||||
|
||||
if (targetActor) then
|
||||
local classe = targetActor.classe
|
||||
@@ -820,7 +821,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra)
|
||||
if (not quantidade [nome]) then
|
||||
quantidade [nome] = 1
|
||||
|
||||
local my_self = instancia.showing [class_type]:PegarCombatente (_, nome)
|
||||
local my_self = instancia.showing [class_type]:PegarCombatente (nil, nome)
|
||||
if (my_self) then
|
||||
|
||||
local meu_total = my_self.total_without_pet
|
||||
|
||||
@@ -29,6 +29,8 @@ local modo_alone = _detalhes._detalhes_props["MODO_ALONE"]
|
||||
local modo_grupo = _detalhes._detalhes_props["MODO_GROUP"]
|
||||
local modo_all = _detalhes._detalhes_props["MODO_ALL"]
|
||||
|
||||
local _
|
||||
|
||||
local atributos = _detalhes.atributos
|
||||
local sub_atributos = _detalhes.sub_atributos
|
||||
local segmentos = _detalhes.segmentos
|
||||
@@ -44,7 +46,7 @@ local segmentos = _detalhes.segmentos
|
||||
if (instancia:IsAtiva()) then --> só reabre se ela estiver ativa
|
||||
instancia:RestauraJanela (index)
|
||||
if (not _detalhes.initializing) then
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_OPEN", _, instancia)
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_OPEN", nil, instancia)
|
||||
end
|
||||
else
|
||||
instancia.iniciada = false
|
||||
@@ -179,7 +181,7 @@ end
|
||||
|
||||
--print ("Abertas: " .. _detalhes.opened_windows)
|
||||
if (not _detalhes.initializing) then
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_CLOSE", _, self)
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_CLOSE", nil, self)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1285,7 +1287,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
|
||||
_detalhes.popup:Select (1, _detalhes.SoloTables.Mode+1)
|
||||
end
|
||||
end
|
||||
return _detalhes.SoloTables.switch (_, _, -1)
|
||||
return _detalhes.SoloTables.switch (nil, nil, -1)
|
||||
|
||||
elseif ( (instancia.modo == modo_raid) and not (_detalhes.initializing or iniciando_instancia) ) then --> raid
|
||||
if (_detalhes.RaidTables.Mode == #_detalhes.RaidTables.Plugins) then
|
||||
@@ -1296,7 +1298,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
|
||||
end
|
||||
|
||||
end
|
||||
return _detalhes.RaidTables.switch (_, _, -1)
|
||||
return _detalhes.RaidTables.switch (nil, nil, -1)
|
||||
end
|
||||
|
||||
atributo_changed = true
|
||||
@@ -1439,18 +1441,18 @@ function _detalhes:MontaAtributosOption (instancia, func)
|
||||
local p = 0.125 --> 32/256
|
||||
|
||||
for i = 1, atributos[0] do --> [0] armazena quantos atributos existem
|
||||
CoolTip:AddMenu (1, func, nil, i, nil, atributos.lista[i], _, true)
|
||||
CoolTip:AddMenu (1, func, nil, i, nil, atributos.lista[i], nil, true)
|
||||
CoolTip:AddIcon ("Interface\\AddOns\\Details\\images\\atributos_icones", 1, 1, 20, 20, p*(i-1), p*(i), 0, 1)
|
||||
local options = sub_atributos [i].lista
|
||||
for o = 1, atributos [i] do
|
||||
CoolTip:AddMenu (2, func, nil, i, o, options[o], _, true)
|
||||
CoolTip:AddMenu (2, func, nil, i, o, options[o], nil, true)
|
||||
CoolTip:AddIcon (icones[i], 2, 1, 20, 20, p*(o-1), p*(o), 0, 1)
|
||||
end
|
||||
CoolTip:SetLastSelected (2, i, instancia.m2_last [i])
|
||||
end
|
||||
|
||||
--> custom
|
||||
CoolTip:AddMenu (1, func, nil, 5, nil, atributos.lista[5], _, true)
|
||||
CoolTip:AddMenu (1, func, nil, 5, nil, atributos.lista[5], nil, true)
|
||||
CoolTip:AddIcon ("Interface\\AddOns\\Details\\images\\atributos_icones", 1, 1, 20, 20, p*(5-1), p*(5), 0, 1)
|
||||
CoolTip:AddMenu (2, _detalhes.OpenCustomWindow, nil, nil, nil, Loc ["STRING_CUSTOM_NEW"], "Interface\\PaperDollInfoFrame\\Character-Plus", true)
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ local AceLocale = LibStub ("AceLocale-3.0")
|
||||
local Loc = AceLocale:GetLocale ( "Details" )
|
||||
|
||||
local gump = _detalhes.gump
|
||||
|
||||
local _
|
||||
local alvo_da_habilidade = _detalhes.alvo_da_habilidade
|
||||
local container_habilidades = _detalhes.container_habilidades
|
||||
local container_combatentes = _detalhes.container_combatentes
|
||||
|
||||
@@ -7,6 +7,7 @@ local container_combatentes = _detalhes.container_combatentes
|
||||
local container_misc_target = _detalhes.container_type.CONTAINER_MISCTARGET_CLASS
|
||||
|
||||
--lua locals
|
||||
local _
|
||||
local _setmetatable = setmetatable
|
||||
local _ipairs = ipairs
|
||||
--api locals
|
||||
|
||||
@@ -30,6 +30,8 @@ local _bit_band = bit.band
|
||||
local _ipairs = ipairs
|
||||
local _pairs = pairs
|
||||
|
||||
local _
|
||||
|
||||
--local table_insert = table.insert
|
||||
|
||||
--> FLAGS <== qual o tipo do objeto
|
||||
@@ -113,19 +115,78 @@ function container_combatentes:GetAmount (actorName, key)
|
||||
end
|
||||
end
|
||||
|
||||
function container_combatentes:PegarCombatente (serial, nome, flag, criar, isOwner)
|
||||
local read_flag_ = function (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
|
||||
-- converte a flag do wow em flag do details
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
--> pega afiliação
|
||||
local details_flag = 0x00000000
|
||||
|
||||
--[[
|
||||
if (self.tipo == container_damage) then
|
||||
if (nome:find ("Lyl")) then
|
||||
if (nome:find ("-")) then
|
||||
print ("nome com -", isOwner)
|
||||
if (flag) then
|
||||
--print ("tem flag")
|
||||
|
||||
if (_bit_band (flag, 0x00000400) ~= 0) then --> é um player
|
||||
details_flag = details_flag+0x00000001
|
||||
|
||||
novo_objeto.displayName = _detalhes:GetNickname (serial, false, true) --> serial, default, silent
|
||||
if (not novo_objeto.displayName) then
|
||||
if (_IsInInstance() and _detalhes.remove_realm_from_name) then
|
||||
novo_objeto.displayName = nome:gsub (("%-.*"), "")
|
||||
--print (novo_objeto.displayName)
|
||||
else
|
||||
novo_objeto.displayName = nome
|
||||
end
|
||||
end
|
||||
|
||||
if (_bit_band (flag, EM_GRUPO) ~= 0) then --> faz parte do grupo
|
||||
details_flag = details_flag+0x00000100
|
||||
novo_objeto.grupo = true
|
||||
if (shadow_objeto) then
|
||||
shadow_objeto.grupo = true
|
||||
end
|
||||
end
|
||||
|
||||
elseif (dono_do_pet) then --> é um pet
|
||||
|
||||
details_flag = details_flag+0x00000002
|
||||
novo_objeto.owner = dono_do_pet
|
||||
novo_objeto.ownerName = dono_do_pet.nome
|
||||
|
||||
if (_IsInInstance() and _detalhes.remove_realm_from_name) then
|
||||
novo_objeto.displayName = nome:gsub (("%-.*"), ">")
|
||||
else
|
||||
novo_objeto.displayName = nome
|
||||
end
|
||||
|
||||
--if (not novo_objeto.displayName:find (">")) then
|
||||
-- novo_objeto.displayName = novo_objeto.displayName .. ">"
|
||||
--end
|
||||
|
||||
--print ("pet -> " .. nome)
|
||||
else
|
||||
--print ("nome okey", isOwner)
|
||||
novo_objeto.displayName = nome
|
||||
end
|
||||
|
||||
-- 0x00000060 --> inimigo neutro
|
||||
if (_bit_band (flag, 0x00000010) ~= 0) then --> é amigo
|
||||
details_flag = details_flag+0x00000010
|
||||
elseif (_bit_band (flag, 0x00000020) ~= 0) then --> é neutro
|
||||
details_flag = details_flag+0x00000020
|
||||
--print ("neutro -> " .. nome)
|
||||
elseif (_bit_band (flag, 0x00000040) ~= 0) then --> é inimigo
|
||||
details_flag = details_flag+0x00000040
|
||||
--print ("inimigos -> " .. nome)
|
||||
end
|
||||
else
|
||||
--print (flag)
|
||||
end
|
||||
|
||||
novo_objeto.flag = details_flag
|
||||
novo_objeto.flag_original = flag
|
||||
novo_objeto.serial = serial
|
||||
end
|
||||
--]]
|
||||
|
||||
function container_combatentes:PegarCombatente (serial, nome, flag, criar, isOwner)
|
||||
|
||||
--> antes de mais nada, vamos verificar se é um pet
|
||||
local dono_do_pet
|
||||
@@ -161,7 +222,7 @@ end
|
||||
-- rotinas de criação do objeto shadow
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
local shadow = self.shadow --> espelho do container no overall
|
||||
local shadow_objeto = nil
|
||||
local shadow_objeto
|
||||
|
||||
if (shadow) then --> se tiver o espelho (não for a tabela overall já)
|
||||
shadow_objeto = shadow:PegarCombatente (_, nome) --> apenas verifica se ele existe ou não
|
||||
@@ -176,76 +237,6 @@ end
|
||||
novo_objeto.nome = nome
|
||||
--print (nome)
|
||||
|
||||
-- converte a flag do wow em flag do details
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
--> pega afiliação
|
||||
local details_flag = 0x00000000
|
||||
|
||||
if (flag) then
|
||||
--print ("tem flag")
|
||||
|
||||
if (_bit_band (flag, 0x00000400) ~= 0) then --> é um player
|
||||
details_flag = details_flag+0x00000001
|
||||
|
||||
novo_objeto.displayName = _detalhes:GetNickname (serial, false, true) --> serial, default, silent
|
||||
if (not novo_objeto.displayName) then
|
||||
if (_IsInInstance() and _detalhes.remove_realm_from_name) then
|
||||
novo_objeto.displayName = nome:gsub (("%-.*"), "")
|
||||
--print (novo_objeto.displayName)
|
||||
else
|
||||
novo_objeto.displayName = nome
|
||||
end
|
||||
end
|
||||
|
||||
if (_bit_band (flag, EM_GRUPO) ~= 0) then --> faz parte do grupo
|
||||
details_flag = details_flag+0x00000100
|
||||
novo_objeto.grupo = true
|
||||
if (shadow_objeto) then
|
||||
shadow_objeto.grupo = true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
elseif (dono_do_pet) then --> é um pet
|
||||
|
||||
details_flag = details_flag+0x00000002
|
||||
novo_objeto.owner = dono_do_pet
|
||||
novo_objeto.ownerName = dono_do_pet.nome
|
||||
|
||||
if (_IsInInstance() and _detalhes.remove_realm_from_name) then
|
||||
novo_objeto.displayName = nome:gsub (("%-.*"), ">")
|
||||
else
|
||||
novo_objeto.displayName = nome
|
||||
end
|
||||
|
||||
--if (not novo_objeto.displayName:find (">")) then
|
||||
-- novo_objeto.displayName = novo_objeto.displayName .. ">"
|
||||
--end
|
||||
|
||||
--print ("pet -> " .. nome)
|
||||
else
|
||||
novo_objeto.displayName = nome
|
||||
end
|
||||
|
||||
-- 0x00000060 --> inimigo neutro
|
||||
if (_bit_band (flag, 0x00000010) ~= 0) then --> é amigo
|
||||
details_flag = details_flag+0x00000010
|
||||
elseif (_bit_band (flag, 0x00000020) ~= 0) then --> é neutro
|
||||
details_flag = details_flag+0x00000020
|
||||
--print ("neutro -> " .. nome)
|
||||
elseif (_bit_band (flag, 0x00000040) ~= 0) then --> é inimigo
|
||||
details_flag = details_flag+0x00000040
|
||||
--print ("inimigos -> " .. nome)
|
||||
end
|
||||
else
|
||||
--print (flag)
|
||||
end
|
||||
|
||||
novo_objeto.flag = details_flag
|
||||
novo_objeto.flag_original = flag
|
||||
novo_objeto.serial = serial
|
||||
|
||||
-- tipo do container
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -254,6 +245,7 @@ end
|
||||
if (self.tipo == container_damage) then --> CONTAINER DAMAGE
|
||||
|
||||
get_class_ (novo_objeto, nome, flag)
|
||||
read_flag_ (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
|
||||
|
||||
if (dono_do_pet) then
|
||||
dono_do_pet.pets [#dono_do_pet.pets+1] = nome
|
||||
@@ -283,6 +275,7 @@ end
|
||||
elseif (self.tipo == container_heal) then --> CONTAINER HEALING
|
||||
|
||||
get_class_ (novo_objeto, nome, flag)
|
||||
read_flag_ (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
|
||||
|
||||
if (dono_do_pet) then
|
||||
dono_do_pet.pets [#dono_do_pet.pets+1] = nome
|
||||
@@ -312,6 +305,7 @@ end
|
||||
elseif (self.tipo == container_energy) then --> CONTAINER ENERGY
|
||||
|
||||
get_class_ (novo_objeto, nome, flag)
|
||||
read_flag_ (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
|
||||
|
||||
if (dono_do_pet) then
|
||||
dono_do_pet.pets [#dono_do_pet.pets+1] = nome
|
||||
@@ -337,6 +331,7 @@ end
|
||||
elseif (self.tipo == container_misc) then --> CONTAINER MISC
|
||||
|
||||
get_class_ (novo_objeto, nome, flag)
|
||||
read_flag_ (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome)
|
||||
|
||||
--local teste_classe =
|
||||
|
||||
@@ -364,7 +359,7 @@ end
|
||||
elseif (self.tipo == container_damage_target) then --> CONTAINER ALVO DO DAMAGE
|
||||
if (shadow_objeto) then
|
||||
novo_objeto.shadow = shadow_objeto
|
||||
shadow_objeto.flag = details_flag
|
||||
--shadow_objeto.flag = details_flag
|
||||
end
|
||||
|
||||
elseif (self.tipo == container_heal_target) then --> CONTAINER ALVOS DO HEALING
|
||||
@@ -372,7 +367,7 @@ end
|
||||
novo_objeto.absorbed = 0
|
||||
if (shadow_objeto) then
|
||||
novo_objeto.shadow = shadow_objeto
|
||||
shadow_objeto.flag = details_flag
|
||||
--shadow_objeto.flag = details_flag
|
||||
end
|
||||
|
||||
elseif (self.tipo == container_energy_target) then --> CONTAINER ALVOS DO ENERGY
|
||||
@@ -384,14 +379,14 @@ end
|
||||
|
||||
if (shadow_objeto) then
|
||||
novo_objeto.shadow = shadow_objeto
|
||||
shadow_objeto.flag = details_flag
|
||||
--shadow_objeto.flag = details_flag
|
||||
end
|
||||
|
||||
elseif (self.tipo == container_misc_target) then --> CONTAINER ALVOS DO MISC
|
||||
|
||||
if (shadow_objeto) then
|
||||
novo_objeto.shadow = shadow_objeto
|
||||
shadow_objeto.flag = details_flag
|
||||
--shadow_objeto.flag = details_flag
|
||||
end
|
||||
|
||||
elseif (self.tipo == container_friendlyfire) then --> CONTAINER FRIENDLY FIRE
|
||||
|
||||
@@ -5,6 +5,7 @@ local _detalhes = _G._detalhes
|
||||
local gump = _detalhes.gump
|
||||
|
||||
local _setmetatable = setmetatable
|
||||
local _
|
||||
|
||||
local container_playernpc = _detalhes.container_type.CONTAINER_PLAYERNPC
|
||||
local container_damage = _detalhes.container_type.CONTAINER_DAMAGE_CLASS
|
||||
@@ -62,7 +63,7 @@ function container_habilidades:PegaHabilidade (id, criar, token, cria_shadow)
|
||||
if (criar) then
|
||||
|
||||
if (cria_shadow) then
|
||||
local novo_objeto = self.funcao_de_criacao (_, id, nil, "")
|
||||
local novo_objeto = self.funcao_de_criacao (nil, id, nil, "")
|
||||
self._ActorTable [id] = novo_objeto
|
||||
return novo_objeto
|
||||
end
|
||||
@@ -78,7 +79,7 @@ function container_habilidades:PegaHabilidade (id, criar, token, cria_shadow)
|
||||
end
|
||||
|
||||
--local novo_objeto = habilidade_dano:NovaTabela (id, shadow_objeto)
|
||||
local novo_objeto = self.funcao_de_criacao (_, id, shadow_objeto, token)
|
||||
local novo_objeto = self.funcao_de_criacao (nil, id, shadow_objeto, token)
|
||||
|
||||
if (shadow_objeto) then --> link é esta mesma tabela mas no container do overall
|
||||
novo_objeto.shadow = shadow_objeto --> diz ao objeto qual a shadow dele na tabela overall
|
||||
|
||||
@@ -150,6 +150,14 @@ function historico:resetar()
|
||||
--> fecha a janela de informações do jogador
|
||||
_detalhes:FechaJanelaInfo()
|
||||
|
||||
for _, combate in ipairs (_detalhes.tabela_historico.tabelas) do
|
||||
_table_wipe (combate)
|
||||
end
|
||||
_table_wipe (_detalhes.tabela_vigente)
|
||||
_table_wipe (_detalhes.tabela_overall)
|
||||
_table_wipe (_detalhes.tabela_pets.pets)
|
||||
_table_wipe (_detalhes.spellcache)
|
||||
|
||||
-- novo container de historico
|
||||
_detalhes.tabela_historico = historico:NovoHistorico() --joga fora a tabela antiga e cria uma nova
|
||||
--novo container para armazenar pets
|
||||
@@ -158,7 +166,7 @@ function historico:resetar()
|
||||
-- nova tabela do overall e current
|
||||
_detalhes.tabela_overall = combate:NovaTabela() --joga fora a tabela antiga e cria uma nova
|
||||
-- cria nova tabela do combate atual
|
||||
_detalhes.tabela_vigente = combate:NovaTabela (_, _detalhes.tabela_overall)
|
||||
_detalhes.tabela_vigente = combate:NovaTabela (nil, _detalhes.tabela_overall)
|
||||
|
||||
--marca o addon como fora de combate
|
||||
_detalhes.in_combat = false
|
||||
@@ -178,6 +186,8 @@ function historico:resetar()
|
||||
_table_wipe (_detalhes.cache_healing_group)
|
||||
_detalhes:UpdateParserGears()
|
||||
|
||||
collectgarbage()
|
||||
|
||||
_detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos) -- atualiza o instancia.showing para as novas tabelas criadas
|
||||
_detalhes:InstanciaCallFunction (_detalhes.AtualizaSoloMode_AfertReset) -- verifica se precisa zerar as tabela da janela solo mode
|
||||
_detalhes:InstanciaCallFunction (_detalhes.ResetaGump) --_detalhes:ResetaGump ("de todas as instancias")
|
||||
|
||||
Reference in New Issue
Block a user