- Many internal improvaments and bug fixes.

- Fixed target names on custom displays.
- Fixed plugins icons being shown when auto hide menu is on.
- Slash command '/details worldboss' is now updated to show Draenor world bosses.
This commit is contained in:
tercio
2014-11-29 19:47:42 -02:00
parent 81498bafb9
commit b2126cc50b
29 changed files with 455 additions and 411 deletions
+24 -18
View File
@@ -1275,9 +1275,9 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra,
porcentagem = _cstr ("%.1f", self [keyName] / instancia.top * 100)
end
--tempo da shadow não é mais calculado pela timemachine
if ((_detalhes.time_type == 2 and self.grupo) or not _detalhes:CaptureGet ("damage") or not self.shadow) then --not self.shadow is overall but...
if (not self.shadow and combat_time == 0) then
--> tempo da shadow não é calculado pela timemachine
if ( (_detalhes.time_type == 2 and self.grupo) or not _detalhes:CaptureGet ("damage") or instancia.segmento == -1) then
if (instancia.segmento == -1 and combat_time == 0) then
local p = _detalhes.tabela_vigente (1, self.nome)
if (p) then
local t = p:Tempo()
@@ -3055,24 +3055,16 @@ function atributo_damage:MontaTooltipAlvos (esta_barra, index, instancia)
end
--controla se o dps do jogador esta travado ou destravado
--> controla se o dps do jogador esta travado ou destravado
function atributo_damage:Iniciar (iniciar)
if (iniciar == nil) then
return self.dps_started --retorna se o dps esta aberto ou fechado para este jogador
return self.dps_started --> retorna se o dps esta aberto ou fechado para este jogador
elseif (iniciar) then
self.dps_started = true
self:RegistrarNaTimeMachine() --coloca ele da timeMachine
if (self.shadow) then
self.shadow.dps_started = true --> isso foi posto recentemente
--self.shadow:RegistrarNaTimeMachine()
end
else
self.dps_started = false
self:DesregistrarNaTimeMachine() --retira ele da timeMachine
if (self.shadow) then
--self.shadow:DesregistrarNaTimeMachine()
self.shadow.dps_started = false --> isso foi posto recentemente
end
end
end
@@ -3127,8 +3119,14 @@ end
if (not shadow) then
shadow = overall_dano:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true)
shadow.classe = actor.classe
shadow.grupo = actor.grupo
shadow.isTank = actor.isTank
shadow.boss = actor.boss
shadow.boss_fight_component = actor.boss_fight_component
shadow.fight_component = actor.fight_component
shadow.start_time = time() - 3
shadow.end_time = time()
end
@@ -3179,8 +3177,14 @@ end
if (not shadow) then
shadow = overall_dano:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true)
shadow.classe = actor.classe
shadow.isTank = actor.isTank
shadow.grupo = actor.grupo
shadow.boss = actor.boss
shadow.boss_fight_component = actor.boss_fight_component
shadow.fight_component = actor.fight_component
shadow.start_time = time() - 3
shadow.end_time = time()
end
@@ -3189,12 +3193,16 @@ end
if (not no_refresh) then
_detalhes.refresh:r_atributo_damage (actor, shadow)
end
--> tempo decorrido (captura de dados)
if (actor.end_time) then
local tempo = (actor.end_time or time()) - actor.start_time
shadow.start_time = shadow.start_time - tempo
local end_time = actor.end_time
if (not actor.end_time) then
end_time = time()
end
local tempo = end_time - actor.start_time
shadow.start_time = shadow.start_time - tempo
--> total de dano (captura de dados)
shadow.total = shadow.total + actor.total
--> total de dano sem o pet (captura de dados)
@@ -3390,8 +3398,6 @@ function _detalhes.refresh:r_atributo_damage (este_jogador, shadow)
--> restaura metas do ator
_setmetatable (este_jogador, _detalhes.atributo_damage)
este_jogador.__index = _detalhes.atributo_damage
--> atribui a shadow a ele
este_jogador.shadow = shadow
--> restaura as metas dos containers
_detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow.spells)
end
+14 -4
View File
@@ -1388,8 +1388,14 @@ end
if (not shadow) then
shadow = overall_energy:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true)
shadow.classe = actor.classe
shadow.grupo = actor.grupo
shadow.isTank = actor.isTank
shadow.boss = actor.boss
shadow.boss_fight_component = actor.boss_fight_component
shadow.fight_component = actor.fight_component
end
--> restaura a meta e indexes ao ator
@@ -1421,8 +1427,14 @@ end
if (not shadow) then
shadow = overall_energy:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true)
shadow.classe = actor.classe
shadow.grupo = actor.grupo
shadow.isTank = actor.isTank
shadow.boss = actor.boss
shadow.boss_fight_component = actor.boss_fight_component
shadow.fight_component = actor.fight_component
end
--> restaura a meta e indexes ao ator
@@ -1477,11 +1489,9 @@ end
function _detalhes.refresh:r_atributo_energy (este_jogador, shadow)
_setmetatable (este_jogador, _detalhes.atributo_energy)
este_jogador.__index = _detalhes.atributo_energy
este_jogador.shadow = shadow
_detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow.spells)
if (not shadow.powertype) then
shadow.powertype = este_jogador.powertype
end
+21 -23
View File
@@ -113,15 +113,7 @@ function atributo_heal:NovaTabela (serial, nome, link)
}
_setmetatable (_new_healActor, atributo_heal)
--if (link) then --> se não for a shadow
--_new_healActor.last_events_table = _detalhes:CreateActorLastEventTable()
--_new_healActor.last_events_table.original = true
--_new_healActor.targets.shadow = link.targets
--_new_healActor.spells.shadow = link.spells
--end
return _new_healActor
end
@@ -580,8 +572,8 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l
porcentagem = _cstr ("%.1f", self [keyName] / instancia.top * 100)
end
if ((_detalhes.time_type == 2 and self.grupo) or (not _detalhes:CaptureGet ("heal") and not _detalhes:CaptureGet ("aura")) or not self.shadow) then
if (not self.shadow and combat_time == 0) then
if ((_detalhes.time_type == 2 and self.grupo) or (not _detalhes:CaptureGet ("heal") and not _detalhes:CaptureGet ("aura")) or instancia.segmento == -1) then
if (instancia.segmento == -1 and combat_time == 0) then
local p = _detalhes.tabela_vigente (2, self.nome)
if (p) then
local t = p:Tempo()
@@ -1992,17 +1984,9 @@ function atributo_heal:Iniciar (iniciar)
elseif (iniciar) then
self.iniciar_hps = true
self:RegistrarNaTimeMachine() --coloca ele da timeMachine
if (self.shadow) then
self.shadow.iniciar_hps = true --> isso foi posto recentemente
--self.shadow:RegistrarNaTimeMachine()
end
else
self.iniciar_hps = false
self:DesregistrarNaTimeMachine() --retira ele da timeMachine
if (self.shadow) then
self.shadow.iniciar_hps = false --> isso foi posto recentemente
--self.shadow:DesregistrarNaTimeMachine()
end
end
end
@@ -2048,8 +2032,14 @@ end
if (not shadow) then
shadow = overall_cura:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true)
shadow.classe = actor.classe
shadow.grupo = actor.grupo
shadow.isTank = actor.isTank
shadow.boss = actor.boss
shadow.boss_fight_component = actor.boss_fight_component
shadow.fight_component = actor.fight_component
shadow.start_time = time() - 3
shadow.end_time = time()
end
@@ -2103,8 +2093,14 @@ end
if (not shadow) then
shadow = overall_cura:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true)
shadow.classe = actor.classe
shadow.grupo = actor.grupo
shadow.isTank = actor.isTank
shadow.boss = actor.boss
shadow.boss_fight_component = actor.boss_fight_component
shadow.fight_component = actor.fight_component
shadow.start_time = time() - 3
shadow.end_time = time()
end
@@ -2115,10 +2111,13 @@ end
end
--> tempo decorrido (captura de dados)
if (actor.end_time) then
local tempo = (actor.end_time or time()) - actor.start_time
shadow.start_time = shadow.start_time - tempo
local end_time = actor.end_time
if (not actor.end_time) then
end_time = time()
end
local tempo = end_time - actor.start_time
shadow.start_time = shadow.start_time - tempo
--> total de cura (captura de dados)
shadow.total = shadow.total + actor.total
@@ -2364,7 +2363,6 @@ function _detalhes.refresh:r_atributo_heal (este_jogador, shadow)
_setmetatable (este_jogador, atributo_heal)
este_jogador.__index = atributo_heal
este_jogador.shadow = shadow
_detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow.spells)
end
+33 -3
View File
@@ -593,6 +593,30 @@ end
end
end
new_instance:ChangeSkin()
else
--> se não tiver um padrão, criar de outra instância já aberta.
local copy_from
for i = 1, next_id-1 do
local opened_instance = _detalhes:GetInstance (i)
if (opened_instance and opened_instance:IsEnabled() and opened_instance.baseframe) then
copy_from = opened_instance
break
end
end
if (copy_from) then
for key, value in pairs (copy_from) do
if (_detalhes.instance_defaults [key] ~= nil) then
if (type (value) == "table") then
new_instance [key] = table_deepcopy (value)
else
new_instance [key] = value
end
end
end
new_instance:ChangeSkin()
end
end
return new_instance
@@ -2419,7 +2443,7 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu)
instancia.atributo = instancia.atributo or 1
instancia.showing[instancia.atributo].need_refresh = true
end
if (qual == modo_alone) then
instancia.LastModo = instancia.modo
@@ -2496,7 +2520,7 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu)
_detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_all)
_detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instancia, instancia.atributo, instancia.sub_atributo)
end
local checked
if (instancia.modo == 1) then
checked = 4
@@ -2507,14 +2531,20 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu)
elseif (instancia.modo == 4) then
checked = 3
end
_detalhes.popup:Select (1, checked)
if (from_mode_menu) then
instancia.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(instancia.baseframe.cabecalho.modo_selecao)
--> running OnEnter does also trigger an instance enter event, so we need to manually leave the instance:
_detalhes.OnLeaveMainWindow (instancia, instancia.baseframe.cabecalho.modo_selecao)
if (instancia.desaturated_menu) then
instancia.baseframe.cabecalho.modo_selecao:GetNormalTexture():SetDesaturated (true)
end
end
end
local function GetDpsHps (_thisActor, key)
+91 -50
View File
@@ -1245,11 +1245,15 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN"
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff ("raid"..raidIndex.."target", debuffIndex)
if (name and unitCaster) then
local playerName, realmName = _UnitName (unitCaster)
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
local playerGUID = _UnitGUID (unitCaster)
if (playerGUID) then
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
end
_detalhes.parser:add_debuff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, his_target, _UnitName ("raid"..raidIndex.."target"), 0x842, spellid, name, in_or_out)
end
_detalhes.parser:add_debuff_uptime (nil, GetTime(), _UnitGUID (unitCaster), playerName, 0x00000417, his_target, _UnitName ("raid"..raidIndex.."target"), 0x842, spellid, name, in_or_out)
end
end
end
@@ -1270,11 +1274,14 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN"
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff ("party"..raidIndex.."target", debuffIndex)
if (name and unitCaster) then
local playerName, realmName = _UnitName (unitCaster)
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
local playerGUID = _UnitGUID (unitCaster)
if (playerGUID) then
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
end
_detalhes.parser:add_debuff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, his_target, _UnitName ("party"..raidIndex.."target"), 0x842, spellid, name, in_or_out)
end
_detalhes.parser:add_debuff_uptime (nil, GetTime(), _UnitGUID (unitCaster), playerName, 0x00000417, his_target, _UnitName ("party"..raidIndex.."target"), 0x842, spellid, name, in_or_out)
end
end
end
@@ -1287,10 +1294,13 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN"
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff ("playertarget", debuffIndex)
if (name and unitCaster) then
local playerName, realmName = _UnitName (unitCaster)
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
local playerGUID = _UnitGUID (unitCaster)
if (playerGUID) then
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
end
_detalhes.parser:add_debuff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, his_target, _UnitName ("playertarget"), 0x842, spellid, name, in_or_out)
end
_detalhes.parser:add_debuff_uptime (nil, GetTime(), _UnitGUID (unitCaster), playerName, 0x00000417, his_target, _UnitName ("playertarget"), 0x842, spellid, name, in_or_out)
end
end
end
@@ -1303,10 +1313,13 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN"
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff ("playertarget", debuffIndex)
if (name and unitCaster) then
local playerName, realmName = _UnitName (unitCaster)
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
local playerGUID = _UnitGUID (unitCaster)
if (playerGUID) then
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
end
_detalhes.parser:add_debuff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, his_target, _UnitName ("playertarget"), 0x842, spellid, name, in_or_out)
end
_detalhes.parser:add_debuff_uptime (nil, GetTime(), _UnitGUID (unitCaster), playerName, 0x00000417, his_target, _UnitName ("playertarget"), 0x842, spellid, name, in_or_out)
end
end
end
@@ -1328,15 +1341,18 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
if (name and unitCaster == "raid"..raidIndex) then
local playerName, realmName = _UnitName ("raid"..raidIndex)
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
end
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("raid"..raidIndex), playerName, 0x00000514, _UnitGUID ("raid"..raidIndex), playerName, 0x00000514, spellid, name, in_or_out)
if (in_or_out == "BUFF_UPTIME_IN") then
if (_detalhes.PotionList [spellid]) then
pot_usage [playerName] = spellid
local playerGUID = _UnitGUID ("raid"..raidIndex)
if (playerGUID) then
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
end
_detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000514, playerGUID, playerName, 0x00000514, spellid, name, in_or_out)
if (in_or_out == "BUFF_UPTIME_IN") then
if (_detalhes.PotionList [spellid]) then
pot_usage [playerName] = spellid
end
end
end
end
@@ -1352,15 +1368,18 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
if (name and unitCaster == "party"..partyIndex) then
local playerName, realmName = _UnitName ("party"..partyIndex)
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
end
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("party"..partyIndex), playerName, 0x00000514, _UnitGUID ("party"..partyIndex), playerName, 0x00000514, spellid, name, in_or_out)
if (in_or_out == "BUFF_UPTIME_IN") then
if (_detalhes.PotionList [spellid]) then
pot_usage [playerName] = spellid
local playerGUID = _UnitGUID ("party" .. partyIndex)
if (playerGUID) then
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
end
_detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000514, playerGUID, playerName, 0x00000514, spellid, name, in_or_out)
if (in_or_out == "BUFF_UPTIME_IN") then
if (_detalhes.PotionList [spellid]) then
pot_usage [playerName] = spellid
end
end
end
end
@@ -1372,15 +1391,17 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL")
if (name and unitCaster == "player") then
local playerName = _UnitName ("player")
local playerGUID = _UnitGUID ("player")
if (in_or_out == "BUFF_UPTIME_IN") then
if (_detalhes.PotionList [spellid]) then
pot_usage [playerName] = spellid
if (playerGUID) then
if (in_or_out == "BUFF_UPTIME_IN") then
if (_detalhes.PotionList [spellid]) then
pot_usage [playerName] = spellid
end
end
_detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000514, playerGUID, playerName, 0x00000514, spellid, name, in_or_out)
end
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("player"), playerName, 0x00000514, _UnitGUID ("player"), playerName, 0x00000514, spellid, name, in_or_out)
end
end
@@ -1402,12 +1423,15 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
if (name and unitCaster == "party"..groupIndex) then
local playerName, realmName = _UnitName ("party"..groupIndex)
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
local playerGUID = _UnitGUID ("party"..groupIndex)
if (playerGUID) then
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
end
_detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, playerGUID, playerName, 0x00000417, spellid, name, in_or_out)
end
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("party"..groupIndex), playerName, 0x00000417, _UnitGUID ("party"..groupIndex), playerName, 0x00000417, spellid, name, in_or_out)
end
end
end
@@ -1416,7 +1440,10 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL")
if (name and unitCaster == "player") then
local playerName = _UnitName ("player")
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("player"), playerName, 0x00000417, _UnitGUID ("player"), playerName, 0x00000417, spellid, name, in_or_out)
local playerGUID = _UnitGUID ("player")
if (playerGUID) then
_detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, playerGUID, playerName, 0x00000417, spellid, name, in_or_out)
end
end
end
@@ -1428,14 +1455,17 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL")
if (name and unitCaster == "player") then
local playerName = _UnitName ("player")
local playerGUID = _UnitGUID ("player")
if (in_or_out == "BUFF_UPTIME_IN") then
if (_detalhes.PotionList [spellid]) then
pot_usage [playerName] = spellid
if (playerGUID) then
if (in_or_out == "BUFF_UPTIME_IN") then
if (_detalhes.PotionList [spellid]) then
pot_usage [playerName] = spellid
end
end
_detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, playerGUID, playerName, 0x00000417, spellid, name, in_or_out)
end
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("player"), playerName, 0x00000417, _UnitGUID ("player"), playerName, 0x00000417, spellid, name, in_or_out)
end
end
@@ -2171,8 +2201,14 @@ function atributo_misc:r_onlyrefresh_shadow (actor)
if (not shadow) then
shadow = overall_misc:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true)
shadow.classe = actor.classe
shadow.grupo = actor.grupo
shadow.isTank = actor.isTank
shadow.boss = actor.boss
shadow.boss_fight_component = actor.boss_fight_component
shadow.fight_component = actor.fight_component
end
_detalhes.refresh:r_atributo_misc (actor, shadow)
@@ -2274,8 +2310,14 @@ function atributo_misc:r_connect_shadow (actor, no_refresh)
if (not shadow) then
shadow = overall_misc:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true)
shadow.classe = actor.classe
shadow.grupo = actor.grupo
shadow.isTank = actor.isTank
shadow.boss = actor.boss
shadow.boss_fight_component = actor.boss_fight_component
shadow.fight_component = actor.fight_component
end
--> aplica a meta e indexes
@@ -2469,7 +2511,6 @@ end
function _detalhes.refresh:r_atributo_misc (este_jogador, shadow)
_setmetatable (este_jogador, _detalhes.atributo_misc)
este_jogador.__index = _detalhes.atributo_misc
este_jogador.shadow = shadow
--> refresh interrupts
if (este_jogador.interrupt_targets) then
+95 -76
View File
@@ -8,6 +8,8 @@
local _UnitClass = UnitClass --api local
local _IsInInstance = IsInInstance --api local
local _UnitGUID = UnitGUID --api local
local strsplit = strsplit --api local
local _setmetatable = setmetatable --lua local
local _getmetatable = getmetatable --lua local
@@ -39,9 +41,12 @@
local container_misc_target = _detalhes.container_type.CONTAINER_MISCTARGET_CLASS
local container_enemydebufftarget_target = _detalhes.container_type.CONTAINER_ENEMYDEBUFFTARGET_CLASS
local container_pets = {}
--> flags
local REACTION_HOSTILE = 0x00000040
local IS_GROUP_OBJECT = 0x00000007
local REACTION_FRIENDLY = 0x00000010
local OBJECT_TYPE_MASK = 0x0000FC00
local OBJECT_TYPE_OBJECT = 0x00004000
local OBJECT_TYPE_PETGUARDIAN = 0x00003000
@@ -136,7 +141,7 @@
end
--> read the actor flag
local read_actor_flag = function (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome, container_type)
local read_actor_flag = function (novo_objeto, dono_do_pet, serial, flag, nome, container_type)
if (flag) then
@@ -154,16 +159,9 @@
if ( (_bit_band (flag, IS_GROUP_OBJECT) ~= 0 and novo_objeto.classe ~= "UNGROUPPLAYER")) then --> faz parte do grupo
novo_objeto.grupo = true
if (shadow_objeto) then
shadow_objeto.grupo = true
end
if (_detalhes:IsATank (serial)) then
novo_objeto.isTank = true
if (shadow_objeto) then
shadow_objeto.isTank = true
end
end
end
@@ -251,23 +249,77 @@
novo_objeto.serial = serial
end
function container_combatentes:PegarCombatente (serial, nome, flag, criar, isOwner)
--> verifica se é um pet, se for confere se tem o nome do dono, se não tiver, precisa por
local dono_do_pet
local pet_blacklist = {}
local pet_tooltip_frame = _G.DetailsPetOwnerFinder
local pet_text_object = _G ["DetailsPetOwnerFinderTextLeft2"]
local find_pet_owner = function (serial, nome, flag, self)
pet_tooltip_frame:SetOwner (WorldFrame, "ANCHOR_NONE")
pet_tooltip_frame:SetHyperlink ("unit:" .. serial or "")
--if (flag and _bit_band (flag, OBJECT_TYPE_PETS) ~= 0) then --> é um pet
if (_detalhes.tabela_pets.pets [serial]) then --> é um pet
--> aqui ele precisaria achar as tag < > pra saber se o nome passado já não veio com o dono imbutido, se não tiver as tags, terá que ser posto aqui
if (not nome:find ("<") or not nome:find (">")) then --> find é lento, não teria outra forma de fazer isso?
local nome_dele, dono_nome, dono_serial, dono_flag = _detalhes.tabela_pets:PegaDono (serial, nome, flag)
if (nome_dele and dono_nome) then
nome = nome_dele
dono_do_pet = self:PegarCombatente (dono_serial, dono_nome, dono_flag, true, nome)
local text = pet_text_object:GetText()
--print ("Unknow Owner:", nome, "ToolTip Text:", text)
if (text and text ~= "") then
text = text:gsub ("'s", "") --> enUS
for _, ownerName in _ipairs ({strsplit (" ", text)}) do
local cur_combat = _detalhes.tabela_vigente
if (cur_combat and cur_combat.raid_roster [ownerName]) then
local ownerGuid = _UnitGUID (ownerName)
if (ownerGuid) then
_detalhes.tabela_pets:Adicionar (serial, nome, flag, ownerGuid, ownerName, 0x00000417)
local nome_dele, dono_nome, dono_serial, dono_flag = _detalhes.tabela_pets:PegaDono (serial, nome, flag)
local dono_do_pet
if (nome_dele and dono_nome) then
nome = nome_dele
dono_do_pet = self:PegarCombatente (dono_serial, dono_nome, dono_flag, true, nome)
end
--print ("Owner Found:", ownerName, nome)
return nome, dono_do_pet
end
end
end
end
end
function container_combatentes:PegarCombatente (serial, nome, flag, criar)
--[[statistics]]-- _detalhes.statistics.container_calls = _detalhes.statistics.container_calls + 1
--> verifica se é um pet, se for confere se tem o nome do dono, se não tiver, precisa por
local dono_do_pet
serial = serial or "ns"
if (container_pets [serial]) then --> é um pet reconhecido
--[[statistics]]-- _detalhes.statistics.container_pet_calls = _detalhes.statistics.container_pet_calls + 1
local nome_dele, dono_nome, dono_serial, dono_flag = _detalhes.tabela_pets:PegaDono (serial, nome, flag)
if (nome_dele and dono_nome) then
nome = nome_dele
dono_do_pet = self:PegarCombatente (dono_serial, dono_nome, dono_flag, true)
end
elseif (not pet_blacklist [serial]) then --> verifica se é um pet
pet_blacklist [serial] = true
--> try to find the owner
if (flag and _bit_band (flag, OBJECT_TYPE_PETGUARDIAN) ~= 0) then
--[[statistics]]-- _detalhes.statistics.container_unknow_pet = _detalhes.statistics.container_unknow_pet + 1
local find_nome, find_owner = find_pet_owner (serial, nome, flag, self)
if (find_nome and find_owner) then
nome, dono_do_pet = find_nome, find_owner
end
end
end
--> pega o index no mapa
local index = self._NameIndexTable [nome]
--> retorna o actor
@@ -277,24 +329,7 @@
--> não achou, criar
elseif (criar) then
--> espelho do container no overall
local shadow = self.shadow
local shadow_objeto
--> se tiver o espelho (não for a tabela overall já)
if (shadow) then
--> apenas verifica se ele existe ou não
shadow_objeto = shadow:PegarCombatente (_, nome)
--> se não existir, cria-lo
if (not shadow_objeto) then
--> tira o nome do pet
local novo_nome = nome:gsub ((" <.*"), "")
--> cria o objeto
shadow_objeto = shadow:PegarCombatente (serial, novo_nome, flag, true)
end
end
local novo_objeto = self.funcao_de_criacao (_, serial, nome, shadow_objeto) --> shadow_objeto passa para o classe_damage gravar no .targets e .spells, mas não grava nele mesmo
local novo_objeto = self.funcao_de_criacao (_, serial, nome)
novo_objeto.nome = nome
-- tipo do container
@@ -303,14 +338,13 @@
if (self.tipo == container_damage) then --> CONTAINER DAMAGE
get_actor_class (novo_objeto, nome, flag)
read_actor_flag (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome, "damage")
read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "damage")
if (dono_do_pet) then
dono_do_pet.pets [#dono_do_pet.pets+1] = nome
end
if (shadow_objeto) then
novo_objeto.shadow = shadow_objeto
if (self.shadow) then
if (novo_objeto.grupo and _detalhes.in_combat) then
_detalhes.cache_damage_group [#_detalhes.cache_damage_group+1] = novo_objeto
end
@@ -322,7 +356,7 @@
end
--> try to guess his class
if (shadow) then --> não executar 2x
if (self.shadow) then --> não executar 2x
_detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1})
end
end
@@ -334,14 +368,13 @@
elseif (self.tipo == container_heal) then --> CONTAINER HEALING
get_actor_class (novo_objeto, nome, flag)
read_actor_flag (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome, "heal")
read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "heal")
if (dono_do_pet) then
dono_do_pet.pets [#dono_do_pet.pets+1] = nome
end
if (shadow_objeto) then
novo_objeto.shadow = shadow_objeto
if (self.shadow) then
if (novo_objeto.grupo and _detalhes.in_combat) then
_detalhes.cache_healing_group [#_detalhes.cache_healing_group+1] = novo_objeto
end
@@ -353,7 +386,7 @@
end
--> try to guess his class
if (shadow) then --> não executar 2x
if (self.shadow) then --> não executar 2x
_detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1})
end
end
@@ -362,23 +395,19 @@
elseif (self.tipo == container_energy) then --> CONTAINER ENERGY
get_actor_class (novo_objeto, nome, flag)
read_actor_flag (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome, "energy")
read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "energy")
if (dono_do_pet) then
dono_do_pet.pets [#dono_do_pet.pets+1] = nome
end
if (shadow_objeto) then
novo_objeto.shadow = shadow_objeto
end
if (novo_objeto.classe == "UNGROUPPLAYER") then --> is a player
if (_bit_band (flag, REACTION_HOSTILE ) ~= 0) then --> is hostile
novo_objeto.enemy = true
end
--> try to guess his class
if (shadow) then --> não executar 2x
if (self.shadow) then --> não executar 2x
_detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1})
end
end
@@ -386,25 +415,21 @@
elseif (self.tipo == container_misc) then --> CONTAINER MISC
get_actor_class (novo_objeto, nome, flag)
read_actor_flag (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome, "misc")
read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "misc")
--local teste_classe =
if (dono_do_pet) then
dono_do_pet.pets [#dono_do_pet.pets+1] = nome
end
if (shadow_objeto) then
novo_objeto.shadow = shadow_objeto
end
if (novo_objeto.classe == "UNGROUPPLAYER") then --> is a player
if (_bit_band (flag, REACTION_HOSTILE ) ~= 0) then --> is hostile
novo_objeto.enemy = true
end
--> try to guess his class
if (shadow) then --> não executar 2x
if (self.shadow) then --> não executar 2x
_detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1})
end
end
@@ -417,34 +442,20 @@
novo_objeto.e_rage = 0
novo_objeto.e_energy = 0
novo_objeto.runepower = 0
if (shadow_objeto) then
novo_objeto.shadow = shadow_objeto
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
if (shadow_objeto) then
novo_objeto.shadow = shadow_objeto
end
elseif (self.tipo == container_friendlyfire) then --> CONTAINER FRIENDLY FIRE
get_actor_class (novo_objeto, nome)
if (shadow_objeto) then
novo_objeto.shadow = shadow_objeto
end
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -462,6 +473,14 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> core
function _detalhes:UpdateContainerCombatentes()
container_pets = _detalhes.tabela_pets.pets
_detalhes:UpdatePetsOnParser()
end
function _detalhes:ClearCCPetsBlackList()
table.wipe (pet_blacklist)
end
function container_combatentes:FuncaoDeCriacao (tipo)
if (tipo == container_damage_target) then
return alvo_da_habilidade.NovaTabela
-2
View File
@@ -90,8 +90,6 @@ local _
container.__index = _detalhes.container_habilidades
local func_criacao = container_habilidades:FuncaoDeCriacao (container.tipo)
container.funcao_de_criacao = func_criacao
--> seta a shadow
container.shadow = shadow
end
function _detalhes.clear:c_container_habilidades (container)
+1
View File
@@ -284,6 +284,7 @@ function historico:resetar()
_detalhes.tabela_historico = historico:NovoHistorico() --joga fora a tabela antiga e cria uma nova
--novo container para armazenar pets
_detalhes.tabela_pets = _detalhes.container_pets:NovoContainer()
_detalhes:UpdateContainerCombatentes()
_detalhes.container_pets:BuscarPets()
-- nova tabela do overall e current
_detalhes.tabela_overall = combate:NovaTabela() --joga fora a tabela antiga e cria uma nova
+10 -14
View File
@@ -121,14 +121,10 @@ function container_pets:BuscarPets()
if (pet_serial) then
if (not _detalhes.tabela_pets.pets [pet_serial]) then
local nome, realm = _UnitName ("raid"..i)
if (nome == "Unknown Entity") then
_detalhes:SchedulePetUpdate (1)
else
if (realm and realm ~= "") then
nome = nome.."-"..realm
end
_detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("raidpet"..i), 0x1114, _UnitGUID ("raid"..i), nome, 0x514)
if (realm and realm ~= "") then
nome = nome.."-"..realm
end
_detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("raidpet"..i), 0x1114, _UnitGUID ("raid"..i), nome, 0x514)
end
end
end
@@ -139,14 +135,12 @@ function container_pets:BuscarPets()
if (pet_serial) then
if (not _detalhes.tabela_pets.pets [pet_serial]) then
local nome, realm = _UnitName ("party"..i)
if (nome == "Unknown Entity") then
_detalhes:SchedulePetUpdate (1)
else
if (realm and realm ~= "") then
nome = nome.."-"..realm
end
_detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("partypet"..i), 0x1114, _UnitGUID ("party"..i), nome, 0x514)
if (realm and realm ~= "") then
nome = nome.."-"..realm
end
_detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("partypet"..i), 0x1114, _UnitGUID ("party"..i), nome, 0x514)
end
end
end
@@ -201,6 +195,8 @@ function _detalhes:LimparPets()
--a tabela antiga será descartada pelo garbage collector.
--_table_wipe (_detalhes.tabela_pets.pets)
_detalhes.tabela_pets.pets = _new_PetTable
_detalhes:UpdateContainerCombatentes()
end
local have_schedule = false
+1 -1
View File
@@ -294,7 +294,7 @@
return actor.targets [_detalhes.playername] or 0
else
return actor.targets [targetactor] or 0
return actor.targets [target] or 0
end
else