diff --git a/Definitions.lua b/Definitions.lua index 19d3a34b..dc8b8429 100644 --- a/Definitions.lua +++ b/Definitions.lua @@ -157,7 +157,10 @@ ---@field BuildSpellTargetFromBreakdownSpellData fun(actor: actor, bkSpellData: spelltableadv) : table ---@field BuildSpellTargetFromSpellTable fun(actor: actor, spellTable: spelltable) : table ---@field raid_targets table ----@field GetSpellContainer fun(actor: actor, containerType: "debuff"|"buff"|"spell"|"cooldowns") : spellcontainer +---@field IsPlayer fun(actor: actor) : boolean return true if the actor is controlled by a player +---@field IsPetOrGuardian fun(actor: actor) : boolean return true if the actor is a pet or guardian +---@field IsGroupPlayer fun(actor: actor) : boolean return true if the actor is a player in the group (or was in the group during the combat) +---@field GetSpellContainer fun(actor: actor, containerType: "debuff"|"buff"|"spell"|"cooldowns"|"dispel") : spellcontainer ---@field Class fun(actor: actor) : string get the ingame class of the actor ---@field Spec fun(actor: actor) : string get the ingame spec of the actor ---@field Name fun(actor: actor) : string get the name of the actor diff --git a/boot.lua b/boot.lua index 2f67c9bd..3f4e242c 100644 --- a/boot.lua +++ b/boot.lua @@ -422,6 +422,13 @@ do --"LoadScreenOrgrimmarArena", --Ring of Valor } + Details.IgnoredEnemyNpcsTable = { + [31216] = true, --mirror image + [53006] = true, --spirit link totem + [63508] = true, --xuen + [73967] = true, --xuen + } + function _detalhes:GetArenaInfo (mapid) local t = _detalhes.arena_info [mapid] if (t) then @@ -1055,7 +1062,7 @@ do _detalhes:Msg("you can always reset the addon running the command |cFFFFFF00'/details reinstall'|r if it does fail to load after being updated.") function _detalhes:wipe_combat_after_failed_load() - _detalhes.tabela_historico = _detalhes.historico:NovoHistorico() + _detalhes.tabela_historico = _detalhes.historico:CreateNewSegmentDatabase() _detalhes.tabela_overall = _detalhes.combate:NovaTabela() _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() diff --git a/classes/class_damage.lua b/classes/class_damage.lua index 3c385a8f..96438607 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -95,12 +95,7 @@ local OBJECT_TYPE_FRIENDLY_NPC = 0x00000A18 - local ignoredEnemyNpcsTable = { - [31216] = true, --mirror image - [53006] = true, --spirit link totem - [63508] = true, --xuen - [73967] = true, --xuen - } + local ignoredEnemyNpcsTable = Details.IgnoredEnemyNpcsTable --damage mixin local damageClassMixin = {} @@ -183,45 +178,6 @@ function Details:ContainerSort (container, amount, keyName2) --[[exported]] end end ----return true if the actor is or was in the player group ----@param self table ----@return boolean|nil -function Details:IsGroupPlayer() --[[exported]] - return self.grupo -end - ----return true if the player is a pet or guardian ----@return boolean -function Details:IsPetOrGuardian() --[[exported]] - return self.owner and true or false -end - ----return true if the actor is a player ----@return boolean -function Details:IsPlayer() --[[exported]] - if (self.flag_original) then - if (bitBand(self.flag_original, OBJECT_TYPE_PLAYER) ~= 0) then - return true - end - end - return false -end - ----return true if the actor is an enemy of neutral npc ----@return boolean -function Details:IsNeutralOrEnemy() --[[exported]] - if (self.flag_original) then - if (bitBand(self.flag_original, 0x00000060) ~= 0) then - local npcid1 = Details:GetNpcIdFromGuid(self.serial) - if (ignoredEnemyNpcsTable[npcid1]) then - return false - end - return true - end - end - return false -end - ---return true if the actor is a friendly npc ---@return boolean function Details:IsFriendlyNpc() --[[exported]] diff --git a/classes/container_segments.lua b/classes/container_segments.lua index eebe53ca..2108bb4a 100644 --- a/classes/container_segments.lua +++ b/classes/container_segments.lua @@ -1,8 +1,3 @@ -local Loc = LibStub("AceLocale-3.0"):GetLocale( "Details" ) - ---lua api -local tremove = table.remove -local tinsert = table.insert local Details = _G.Details local _ @@ -68,13 +63,13 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --internal -function segmentClass:NovoHistorico() - local esta_tabela = {tabelas = {}} - setmetatable(esta_tabela, segmentClass) - return esta_tabela +function segmentClass:CreateNewSegmentDatabase() + local newSegmentDatabase = {tabelas = {}} + setmetatable(newSegmentDatabase, segmentClass) + return newSegmentDatabase end -function segmentClass:adicionar_overall(combatObject) +function segmentClass:AddToOverallData(combatObject) local zoneName, zoneType = GetInstanceInfo() if (zoneType ~= "none" and combatObject:GetCombatTime() <= Details.minimum_overall_combat_time) then return @@ -96,7 +91,7 @@ function segmentClass:adicionar_overall(combatObject) end if (combatObject.overall_added) then - Details:Msg("error > attempt to add a segment already added > func historico:adicionar_overall()") + Details:Msg("error > attempt to add a segment already added > func historico:AddToOverallData()") return end @@ -104,27 +99,27 @@ function segmentClass:adicionar_overall(combatObject) if (mythicInfo) then --do not add overall mythic+ dungeon segments if (mythicInfo.TrashOverallSegment) then - Details:Msg("error > attempt to add a TrashOverallSegment > func historico:adicionar_overall()") + Details:Msg("error > attempt to add a TrashOverallSegment > func historico:AddToOverallData()") return elseif (mythicInfo.OverallSegment) then - Details:Msg("error > attempt to add a OverallSegment > func historico:adicionar_overall()") + Details:Msg("error > attempt to add a OverallSegment > func historico:AddToOverallData()") return end end --store the segments added to the overall data Details.tabela_overall.segments_added = Details.tabela_overall.segments_added or {} - local this_clock = combatObject.data_inicio + local startDate = combatObject.data_inicio local combatName = combatObject:GetCombatName(true) local combatTime = combatObject:GetCombatTime() local combatType = combatObject:GetCombatType() - tinsert(Details.tabela_overall.segments_added, 1, {name = combatName, elapsed = combatTime, clock = this_clock, type = combatType}) + table.insert(Details.tabela_overall.segments_added, 1, {name = combatName, elapsed = combatTime, clock = startDate, type = combatType}) if (#Details.tabela_overall.segments_added > 40) then - tremove(Details.tabela_overall.segments_added, 41) + table.remove(Details.tabela_overall.segments_added, 41) end if (Details.debug) then @@ -143,18 +138,18 @@ function segmentClass:adicionar_overall(combatObject) end if (Details.tabela_overall.start_time == 0) then - Details.tabela_overall:SetStartTime (combatObject.start_time) - Details.tabela_overall:SetEndTime (combatObject.end_time) + Details.tabela_overall:SetStartTime(combatObject.start_time) + Details.tabela_overall:SetEndTime(combatObject.end_time) else - Details.tabela_overall:SetStartTime (combatObject.start_time - Details.tabela_overall:GetCombatTime()) - Details.tabela_overall:SetEndTime (combatObject.end_time) + Details.tabela_overall:SetStartTime(combatObject.start_time - Details.tabela_overall:GetCombatTime()) + Details.tabela_overall:SetEndTime(combatObject.end_time) end if (Details.tabela_overall.data_inicio == 0) then Details.tabela_overall.data_inicio = Details.tabela_vigente.data_inicio or 0 end - Details.tabela_overall:seta_data (Details._detalhes_props.DATA_TYPE_END) + Details.tabela_overall:seta_data(Details._detalhes_props.DATA_TYPE_END) Details:ClockPluginTickOnSegment() for id, instance in Details:ListInstances() do @@ -166,31 +161,27 @@ function segmentClass:adicionar_overall(combatObject) end end -function Details:ScheduleAddCombatToOverall (combat) --deprecated (15/03/2019) - local canAdd = Details:CanAddCombatToOverall (combat) - if (canAdd) then - Details.schedule_add_to_overall = Details.schedule_add_to_overall or {} - tinsert(Details.schedule_add_to_overall, combat) - end -end - -function Details:CanAddCombatToOverall (tabela) +---return true if the combatObject can be added to the overall data +---@param self details +---@param combatObject table +---@return boolean canAdd +function Details:CanAddCombatToOverall(combatObject) --already added - if (tabela.overall_added) then + if (combatObject.overall_added) then return false end --already scheduled to add if (Details.schedule_add_to_overall) then --deprecated for _, combat in ipairs(Details.schedule_add_to_overall) do - if (combat == tabela) then + if (combat == combatObject) then return false end end end --special cases - local mythicInfo = tabela.is_mythic_dungeon + local mythicInfo = combatObject.is_mythic_dungeon if (mythicInfo) then --do not add overall mythic+ dungeon segments if (mythicInfo.TrashOverallSegment) then @@ -203,8 +194,8 @@ function Details:CanAddCombatToOverall (tabela) --raid boss - flag 0x1 if (bitBand(Details.overall_flag, 0x1) ~= 0) then - if (tabela.is_boss and tabela.instance_type == "raid" and not tabela.is_pvp) then - if (tabela:GetCombatTime() >= 30) then + if (combatObject.is_boss and combatObject.instance_type == "raid" and not combatObject.is_pvp) then + if (combatObject:GetCombatTime() >= 30) then return true end end @@ -212,21 +203,21 @@ function Details:CanAddCombatToOverall (tabela) --raid trash - flag 0x2 if (bitBand(Details.overall_flag, 0x2) ~= 0) then - if (tabela.is_trash and tabela.instance_type == "raid") then + if (combatObject.is_trash and combatObject.instance_type == "raid") then return true end end --dungeon boss - flag 0x4 if (bitBand(Details.overall_flag, 0x4) ~= 0) then - if (tabela.is_boss and tabela.instance_type == "party" and not tabela.is_pvp) then + if (combatObject.is_boss and combatObject.instance_type == "party" and not combatObject.is_pvp) then return true end end --dungeon trash - flag 0x8 if (bitBand(Details.overall_flag, 0x8) ~= 0) then - if ((tabela.is_trash or tabela.is_mythic_dungeon_trash) and tabela.instance_type == "party") then + if ((combatObject.is_trash or combatObject.is_mythic_dungeon_trash) and combatObject.instance_type == "party") then return true end end @@ -237,7 +228,7 @@ function Details:CanAddCombatToOverall (tabela) end --is a PvP combat - if (tabela.is_pvp or tabela.is_arena) then + if (combatObject.is_pvp or combatObject.is_arena) then return true end @@ -301,7 +292,7 @@ function segmentClass:AddCombat(combatObject) if (Details.debug) then Details:Msg("(debug) overall data flag match addind the combat to overall data.") end - segmentClass:adicionar_overall(combatObject) + segmentClass:AddToOverallData(combatObject) end --erase trash segments @@ -341,7 +332,7 @@ function segmentClass:AddCombat(combatObject) local thirdCombat = segmentTable[3] if (thirdCombat and not thirdCombat.is_mythic_dungeon_segment) then - if ((thirdCombat.is_trash and not thirdCombat.is_boss) or (thirdCombat.is_temporary)) then + if ((thirdCombat.is_trash and not thirdCombat.is_boss) or(thirdCombat.is_temporary)) then --verify again the time machine for _, actorObject in thirdCombat:GetContainer(DETAILS_ATTRIBUTE_DAMAGE):ListActors() do if (actorObject.timeMachine) then @@ -540,7 +531,7 @@ function segmentClass:ResetAllCombatData() Details:ResetSpecCache(true) -- novo container de historico - Details.tabela_historico = segmentClass:NovoHistorico() --joga fora a tabela antiga e cria uma nova + Details.tabela_historico = segmentClass:CreateNewSegmentDatabase() --joga fora a tabela antiga e cria uma nova --novo container para armazenar pets Details.tabela_pets = Details.container_pets:NovoContainer() Details:UpdateContainerCombatentes() @@ -580,7 +571,7 @@ function segmentClass:ResetAllCombatData() Details:InstanciaCallFunction(Details.AtualizaSegmentos) -- atualiza o instancia.showing para as novas tabelas criadas Details:InstanciaCallFunction(Details.AtualizaSoloMode_AfertReset) -- verifica se precisa zerar as tabela da janela solo mode - Details:InstanciaCallFunction(Details.ResetaGump) --_detalhes:ResetaGump ("de todas as instancias") + Details:InstanciaCallFunction(Details.ResetaGump) --_detalhes:ResetaGump("de todas as instancias") Details:InstanciaCallFunction(Details.FadeHandler.Fader, "IN", nil, "barras") Details:RefreshMainWindow(-1) --atualiza todas as instancias @@ -588,7 +579,7 @@ function segmentClass:ResetAllCombatData() Details:SendEvent("DETAILS_DATA_RESET", nil, nil) end -function Details.refresh:r_historico (este_historico) +function Details.refresh:r_historico(este_historico) setmetatable(este_historico, segmentClass) --este_historico.__index = historico end diff --git a/core/meta.lua b/core/meta.lua index 49402c5a..87bb4463 100644 --- a/core/meta.lua +++ b/core/meta.lua @@ -600,13 +600,13 @@ local classTypeUtility = Details.atributos.misc --panic mode (in case the player disconnets during a boss encounter, drop all tables to speedup the login and login back process) if (Details.segments_panic_mode and Details.can_panic_mode) then if (Details.tabela_vigente.is_boss) then - Details.tabela_historico = Details.historico:NovoHistorico() + Details.tabela_historico = Details.historico:CreateNewSegmentDatabase() end end --clear all segments on logoff if (Details.data_cleanup_logout) then - Details.tabela_historico = Details.historico:NovoHistorico() + Details.tabela_historico = Details.historico:CreateNewSegmentDatabase() Details.tabela_overall = nil _detalhes_database.tabela_overall = nil end diff --git a/core/parser.lua b/core/parser.lua index e3da7ded..4a76af95 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -1,8 +1,8 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - local _detalhes = _G.Details - local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) - local DetailsFramework = DetailsFramework + local Details = _G.Details + local Loc = LibStub("AceLocale-3.0"):GetLocale("Details") + local detailsFramework = DetailsFramework ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --local pointers @@ -24,19 +24,19 @@ local meleeString = _G["MELEE"] - local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned - local _GetSpellInfo = _detalhes.getspellinfo - local isWOTLK = DetailsFramework.IsWotLKWow() - local isERA = DetailsFramework.IsClassicWow() + local _UnitGroupRolesAssigned = detailsFramework.UnitGroupRolesAssigned + local _GetSpellInfo = Details.getspellinfo + local isWOTLK = detailsFramework.IsWotLKWow() + local isERA = detailsFramework.IsClassicWow() local _tempo = time() local _, Details222 = ... _ = nil - local shield_cache = _detalhes.ShieldCache --details local - local parser = _detalhes.parser --details local + local shield_cache = Details.ShieldCache --details local + local parser = Details.parser --details local - local cc_spell_list = DetailsFramework.CrowdControlSpells - local container_habilidades = _detalhes.container_habilidades --details local + local cc_spell_list = detailsFramework.CrowdControlSpells + local container_habilidades = Details.container_habilidades --details local --localize the cooldown table from the framework local defensive_cooldowns = {} @@ -51,14 +51,14 @@ end --cache the addition functions for each attribute - local _spell_damage_func = _detalhes.habilidade_dano.Add - local _spell_damageMiss_func = _detalhes.habilidade_dano.AddMiss - local _spell_heal_func = _detalhes.habilidade_cura.Add - local _spell_energy_func = _detalhes.habilidade_e_energy.Add - local _spell_utility_func = _detalhes.habilidade_misc.Add + local _spell_damage_func = Details.habilidade_dano.Add + local _spell_damageMiss_func = Details.habilidade_dano.AddMiss + local _spell_heal_func = Details.habilidade_cura.Add + local _spell_energy_func = Details.habilidade_e_energy.Add + local _spell_utility_func = Details.habilidade_misc.Add --current combat and overall pointers - local _current_combat = _detalhes.tabela_vigente or {} --placeholder table + local _current_combat = Details.tabela_vigente or {} --placeholder table --total container pointers local _current_total = _current_combat.totals @@ -74,26 +74,26 @@ --cache local names_cache = {} --damage - local damage_cache = setmetatable({}, _detalhes.weaktable) - local damage_cache_pets = setmetatable({}, _detalhes.weaktable) - local damage_cache_petsOwners = setmetatable({}, _detalhes.weaktable) + local damage_cache = setmetatable({}, Details.weaktable) + local damage_cache_pets = setmetatable({}, Details.weaktable) + local damage_cache_petsOwners = setmetatable({}, Details.weaktable) --heaing - local healing_cache = setmetatable({}, _detalhes.weaktable) + local healing_cache = setmetatable({}, Details.weaktable) local banned_healing_spells = { [326514] = true, --remove on 10.0 - Forgeborne Reveries - necrolords ability } --energy - local energy_cache = setmetatable({}, _detalhes.weaktable) + local energy_cache = setmetatable({}, Details.weaktable) --misc - local misc_cache = setmetatable({}, _detalhes.weaktable) - local misc_cache_pets = setmetatable({}, _detalhes.weaktable) - local misc_cache_petsOwners = setmetatable({}, _detalhes.weaktable) + local misc_cache = setmetatable({}, Details.weaktable) + local misc_cache_pets = setmetatable({}, Details.weaktable) + local misc_cache_petsOwners = setmetatable({}, Details.weaktable) --party & raid members - local raid_members_cache = setmetatable({}, _detalhes.weaktable) + local raid_members_cache = setmetatable({}, Details.weaktable) --tanks - local tanks_members_cache = setmetatable({}, _detalhes.weaktable) + local tanks_members_cache = setmetatable({}, Details.weaktable) --auto regen - local auto_regen_cache = setmetatable({}, _detalhes.weaktable) + local auto_regen_cache = setmetatable({}, Details.weaktable) --bitfield swap cache local bitfield_swap_cache = {} --damage and heal last events @@ -174,7 +174,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --constants - local container_misc = _detalhes.container_type.CONTAINER_MISC_CLASS + local container_misc = Details.container_type.CONTAINER_MISC_CLASS local OBJECT_TYPE_ENEMY = 0x00000040 local OBJECT_TYPE_PLAYER = 0x00000400 @@ -335,7 +335,7 @@ end local bitfield_debuffs = {} - for _, spellid in ipairs(_detalhes.BitfieldSwapDebuffsIDs) do + for _, spellid in ipairs(Details.BitfieldSwapDebuffsIDs) do local spellname = GetSpellInfo(spellid) if (spellname) then bitfield_debuffs[spellname] = true @@ -344,7 +344,7 @@ end end - for spellId in pairs(_detalhes.BitfieldSwapDebuffsSpellIDs) do + for spellId in pairs(Details.BitfieldSwapDebuffsSpellIDs) do bitfield_debuffs [spellId] = true end @@ -358,10 +358,10 @@ } --expose the override spells table to external scripts - _detalhes.OverridedSpellIds = override_spellId + Details.OverridedSpellIds = override_spellId --list of ignored npcs by the user - _detalhes.default_ignored_npcs = { + Details.default_ignored_npcs = { --DH Havoc Talent Fodder to the Flame [169421] = true, [169425] = true, @@ -415,7 +415,7 @@ } --expose the ignore spells table to external scripts - _detalhes.SpellsToIgnore = damage_spells_to_ignore + Details.SpellsToIgnore = damage_spells_to_ignore --is parser allowed to replace spellIDs? local is_using_spellId_override = false @@ -443,10 +443,10 @@ local _hook_battleress = false local _hook_interrupt = false - local _hook_cooldowns_container = _detalhes.hooks ["HOOK_COOLDOWN"] - local _hook_deaths_container = _detalhes.hooks ["HOOK_DEATH"] - local _hook_battleress_container = _detalhes.hooks ["HOOK_BATTLERESS"] - local _hook_interrupt_container = _detalhes.hooks ["HOOK_INTERRUPT"] + local _hook_cooldowns_container = Details.hooks ["HOOK_COOLDOWN"] + local _hook_deaths_container = Details.hooks ["HOOK_DEATH"] + local _hook_battleress_container = Details.hooks ["HOOK_BATTLERESS"] + local _hook_interrupt_container = Details.hooks ["HOOK_INTERRUPT"] --regen overflow local auto_regen_power_specs = { @@ -494,11 +494,11 @@ --end local who_aggro = function(self) - if ((_detalhes.LastPullMsg or 0) + 30 > time()) then - _detalhes.WhoAggroTimer = nil + if ((Details.LastPullMsg or 0) + 30 > time()) then + Details.WhoAggroTimer = nil return end - _detalhes.LastPullMsg = time() + Details.LastPullMsg = time() local hitLine = self.HitBy or "|cFFFFBB00First Hit|r: *?*" local targetLine = "" @@ -518,14 +518,14 @@ end end - _detalhes:Msg(hitLine .. targetLine) - _detalhes.WhoAggroTimer = nil + Details:Msg(hitLine .. targetLine) + Details.WhoAggroTimer = nil Details.bossTargetAtPull = nil end local lastRecordFound = {id = 0, diff = 0, combatTime = 0} - _detalhes.PrintEncounterRecord = function(self) + Details.PrintEncounterRecord = function(self) --this block won't execute if the storage isn't loaded --self is a timer reference from C_Timer @@ -540,14 +540,14 @@ --is the same encounter, no need to find the value again. value, rank, combatTime = lastRecordFound.value, lastRecordFound.rank, lastRecordFound.combatTime else - local db = _detalhes.GetStorage() + local db = Details.GetStorage() local role = _UnitGroupRolesAssigned("player") local isDamage = (role == "DAMAGER") or (role == "TANK") --or true - local bestRank, encounterTable = _detalhes.storage:GetBestFromPlayer (diff, encounterID, isDamage and "damage" or "healing", _detalhes.playername, true) + local bestRank, encounterTable = Details.storage:GetBestFromPlayer (diff, encounterID, isDamage and "damage" or "healing", Details.playername, true) if (bestRank) then - local playerTable, onEncounter, rankPosition = _detalhes.storage:GetPlayerGuildRank (diff, encounterID, isDamage and "damage" or "healing", _detalhes.playername, true) + local playerTable, onEncounter, rankPosition = Details.storage:GetPlayerGuildRank (diff, encounterID, isDamage and "damage" or "healing", Details.playername, true) value = bestRank[1] or 0 rank = rankPosition or 0 @@ -570,12 +570,12 @@ end if (value and combatTime and value > 0 and combatTime > 0) then - _detalhes:Msg("|cFFFFBB00Your Best Score|r:", _detalhes:ToK2 ((value) / combatTime) .. " [|cFFFFFF00Guild Rank: " .. rank .. "|r]") --localize-me + Details:Msg("|cFFFFBB00Your Best Score|r:", Details:ToK2 ((value) / combatTime) .. " [|cFFFFFF00Guild Rank: " .. rank .. "|r]") --localize-me end - if ((not combatTime or combatTime == 0) and not _detalhes.SyncWarning) then - _detalhes:Msg("|cFFFF3300you may need sync the rank within the guild, type '|cFFFFFF00/details rank|r'|r") --localize-me - _detalhes.SyncWarning = true + if ((not combatTime or combatTime == 0) and not Details.SyncWarning) then + Details:Msg("|cFFFF3300you may need sync the rank within the guild, type '|cFFFFFF00/details rank|r'|r") --localize-me + Details.SyncWarning = true end end @@ -766,15 +766,15 @@ or (targetFlags and bitBand(targetFlags, AFFILIATION_GROUP) ~= 0 and UnitAffectingCombat(targetName) ) or - (not _detalhes.in_group and sourceFlags and bitBand(sourceFlags, AFFILIATION_GROUP) ~= 0) + (not Details.in_group and sourceFlags and bitBand(sourceFlags, AFFILIATION_GROUP) ~= 0) ) ) then --avoid Fel Armor and Undulating Maneuvers to start a combat - if ((spellId == 387846 or spellId == 352561) and sourceName == _detalhes.playername) then + if ((spellId == 387846 or spellId == 352561) and sourceName == Details.playername) then return end - if (_detalhes.encounter_table.id and _detalhes.encounter_table["start"] >= GetTime() - 3 and _detalhes.announce_firsthit.enabled) then + if (Details.encounter_table.id and Details.encounter_table["start"] >= GetTime() - 3 and Details.announce_firsthit.enabled) then local link if (spellId <= 10) then link = _GetSpellInfo(spellId) @@ -782,19 +782,19 @@ link = _GetSpellInfo(spellId) end - if (_detalhes.WhoAggroTimer) then - _detalhes.WhoAggroTimer:Cancel() + if (Details.WhoAggroTimer) then + Details.WhoAggroTimer:Cancel() end - _detalhes.WhoAggroTimer = C_Timer.NewTimer(0.1, who_aggro) - _detalhes.WhoAggroTimer.HitBy = "|cFFFFFF00First Hit|r: " .. (link or "") .. " from " .. (sourceName or "Unknown") - print("debug:", _detalhes.WhoAggroTimer.HitBy) + Details.WhoAggroTimer = C_Timer.NewTimer(0.1, who_aggro) + Details.WhoAggroTimer.HitBy = "|cFFFFFF00First Hit|r: " .. (link or "") .. " from " .. (sourceName or "Unknown") + print("debug:", Details.WhoAggroTimer.HitBy) end - _detalhes:EntrarEmCombate(sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags) + Details:EntrarEmCombate(sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags) else --entrar em combate se for dot e for do jogador e o ultimo combate ter sido a mais de 10 segundos atr�s - if (token == "SPELL_PERIODIC_DAMAGE" and sourceName == _detalhes.playername) then + if (token == "SPELL_PERIODIC_DAMAGE" and sourceName == Details.playername) then --ignora burning rush se o jogador estiver fora de combate --111400 warlock's burning rush --368637 is buff from trinket "Scars of Fraternal Strife" which make the player bleed even out-of-combat @@ -809,8 +809,8 @@ end --faz o calculo dos 10 segundos - if (_detalhes.last_combat_time + 10 < _tempo) then - _detalhes:EntrarEmCombate(sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags) + if (Details.last_combat_time + 10 < _tempo) then + Details:EntrarEmCombate(sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags) end end end @@ -951,7 +951,7 @@ else --advanced damage taken --if advanced damage taken is enabled, the damage taken to tanks acts like the monk stuff above - if (_detalhes.damage_taken_everything) then + if (Details.damage_taken_everything) then if (absorbed) then amount = (amount or 0) - absorbed end @@ -961,7 +961,7 @@ --avoidance local avoidance = targetActor.avoidance if (not avoidance) then - targetActor.avoidance = _detalhes:CreateActorAvoidanceTable() + targetActor.avoidance = Details:CreateActorAvoidanceTable() avoidance = targetActor.avoidance end @@ -969,7 +969,7 @@ local mob = avoidance [sourceName] if (not mob) then --if isn't in the table, build on the fly - mob = _detalhes:CreateActorAvoidanceTable (true) + mob = Details:CreateActorAvoidanceTable (true) avoidance [sourceName] = mob end @@ -1027,7 +1027,7 @@ --current unit heal if (targetActor.arena_enemy) then --this is an arena enemy, get the heal with the unit Id - local unitId = _detalhes.arena_enemies[targetName] + local unitId = Details.arena_enemies[targetName] if (not unitId) then unitId = Details:GuessArenaEnemyUnitId(targetName) end @@ -1081,9 +1081,9 @@ end --'player' - if (sourceActor.nome == _detalhes.playername and token ~= "SPELL_PERIODIC_DAMAGE") then + if (sourceActor.nome == Details.playername and token ~= "SPELL_PERIODIC_DAMAGE") then if (UnitAffectingCombat("player")) then - _detalhes:SendEvent("COMBAT_PLAYER_TIMESTARTED", nil, _current_combat, sourceActor) + Details:SendEvent("COMBAT_PLAYER_TIMESTARTED", nil, _current_combat, sourceActor) end end end @@ -1218,7 +1218,7 @@ spellTable = sourceActor.spells:PegaHabilidade(spellId, true, token) spellTable.spellschool = spellType or school if (_current_combat.is_boss and sourceFlags and bitBand(sourceFlags, OBJECT_TYPE_ENEMY) ~= 0) then - _detalhes.spell_school_cache[spellName] = spellType or school + Details.spell_school_cache[spellName] = spellType or school end if (isreflected) then @@ -1394,7 +1394,7 @@ --avoidance local avoidance = sourceActor.avoidance if (not avoidance) then - sourceActor.avoidance = _detalhes:CreateActorAvoidanceTable() + sourceActor.avoidance = Details:CreateActorAvoidanceTable() avoidance = sourceActor.avoidance end @@ -1402,7 +1402,7 @@ local mob = avoidance [sourceName] if (not mob) then --if isn't in the table, build on the fly - mob = _detalhes:CreateActorAvoidanceTable (true) + mob = Details:CreateActorAvoidanceTable (true) avoidance [sourceName] = mob end @@ -1685,7 +1685,7 @@ local avoidance = TargetActor.avoidance if (not avoidance) then - TargetActor.avoidance = _detalhes:CreateActorAvoidanceTable() + TargetActor.avoidance = Details:CreateActorAvoidanceTable() avoidance = TargetActor.avoidance end @@ -1699,7 +1699,7 @@ --from this mob local mob = avoidance [who_name] if (not mob) then --if isn't in the table, build on the fly - mob = _detalhes:CreateActorAvoidanceTable (true) + mob = Details:CreateActorAvoidanceTable (true) avoidance [who_name] = mob end @@ -1802,7 +1802,7 @@ spell = este_jogador.spells:PegaHabilidade (spellid, true, token) spell.spellschool = spelltype if (_current_combat.is_boss and who_flags and bitBand(who_flags, OBJECT_TYPE_ENEMY) ~= 0) then - _detalhes.spell_school_cache [spellname] = spelltype + Details.spell_school_cache [spellname] = spelltype end end return _spell_damageMiss_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, missType) @@ -1896,7 +1896,7 @@ if (isWOTLK) then if (npcId == 15439) then - _detalhes.tabela_pets:Adicionar(petSerial:gsub("%-15439%-", "%-15438%-"), "Greater Fire Elemental", petFlags, sourceSerial, sourceName, sourceFlags) + Details.tabela_pets:Adicionar(petSerial:gsub("%-15439%-", "%-15438%-"), "Greater Fire Elemental", petFlags, sourceSerial, sourceName, sourceFlags) elseif (npcId == 15438) then return end @@ -1913,7 +1913,7 @@ sourceName, sourceSerial, sourceFlags = petTable[1], petTable[2], petTable[3] end - _detalhes.tabela_pets:Adicionar(petSerial, petName, petFlags, sourceSerial, sourceName, sourceFlags) + Details.tabela_pets:Adicionar(petSerial, petName, petFlags, sourceSerial, sourceName, sourceFlags) end ----------------------------------------------------------------------------------------------------------------------------------------- @@ -2000,7 +2000,7 @@ if (not spell) then spell = este_jogador.spells:PegaHabilidade (spellidAbsorb, true, token) if (_current_combat.is_boss and who_flags and bitBand(who_flags, OBJECT_TYPE_ENEMY) ~= 0) then - _detalhes.spell_school_cache [spellnameAbsorb] = spellschoolAbsorb or 1 + Details.spell_school_cache [spellnameAbsorb] = spellschoolAbsorb or 1 end end @@ -2180,7 +2180,7 @@ if (spellId == SPELLID_SANGUINE_HEAL) then --sanguine ichor (heal enemies) sourceActor.grupo = true - elseif (bitBand(targetFlags, REACTION_FRIENDLY) == 0 and not _detalhes.is_in_arena and not _detalhes.is_in_battleground) then + elseif (bitBand(targetFlags, REACTION_FRIENDLY) == 0 and not Details.is_in_arena and not Details.is_in_battleground) then if (not sourceActor.heal_enemy[spellId]) then sourceActor.heal_enemy[spellId] = effectiveHeal else @@ -2233,7 +2233,7 @@ --current unit heal if (targetActor.arena_enemy) then --this is an arena enemy, get the heal with the unit Id - local unitId = _detalhes.arena_enemies[targetName] + local unitId = Details.arena_enemies[targetName] if (not unitId) then unitId = Details:GuessArenaEnemyUnitId(targetName) end @@ -2339,7 +2339,7 @@ spellTable.spellschool = spellType if (_current_combat.is_boss and sourceFlags and bitBand(sourceFlags, OBJECT_TYPE_ENEMY) ~= 0) then - _detalhes.spell_school_cache[spellName] = spellType + Details.spell_school_cache[spellName] = spellType end end @@ -2467,7 +2467,7 @@ if (auraType == "BUFF") then if (LIB_OPEN_RAID_BLOODLUST[spellId]) then --~bloodlust - if (_detalhes.playername == targetName) then + if (Details.playername == targetName) then _current_combat.bloodlust = _current_combat.bloodlust or {} _current_combat.bloodlust[#_current_combat.bloodlust+1] = _current_combat:GetCombatTime() end @@ -2520,16 +2520,16 @@ elseif (spellId == 272790 and cacheAnything.track_hunter_frenzy) then --hunter pet Frenzy quick fix for show the Frenzy uptime if (pet_frenzy_cache[sourceName]) then - if (DetailsFramework:IsNearlyEqual(pet_frenzy_cache[sourceName], time, 0.2)) then + if (detailsFramework:IsNearlyEqual(pet_frenzy_cache[sourceName], time, 0.2)) then return end end - if (not _detalhes.in_combat) then + if (not Details.in_combat) then C_Timer.After(1, function() - if (_detalhes.in_combat) then + if (Details.in_combat) then if (pet_frenzy_cache[sourceName]) then - if (DetailsFramework:IsNearlyEqual(pet_frenzy_cache[sourceName], time, 0.2)) then + if (detailsFramework:IsNearlyEqual(pet_frenzy_cache[sourceName], time, 0.2)) then return end end @@ -2721,7 +2721,7 @@ local spellTable = miscActorObject.buff_uptime_spells and miscActorObject.buff_uptime_spells._ActorTable[spellid] if (spellTable) then if (spellTable.actived and pet_frenzy_cache[sourceName]) then - if (DetailsFramework:IsNearlyEqual(pet_frenzy_cache[sourceName], time, 0.2)) then + if (detailsFramework:IsNearlyEqual(pet_frenzy_cache[sourceName], time, 0.2)) then return end end @@ -2963,7 +2963,7 @@ --actor target local este_alvo = este_jogador.debuff_uptime_targets [alvo_name] if (not este_alvo) then - este_alvo = _detalhes.atributo_misc:CreateBuffTargetObject() + este_alvo = Details.atributo_misc:CreateBuffTargetObject() este_jogador.debuff_uptime_targets [alvo_name] = este_alvo end @@ -3060,7 +3060,7 @@ elseif (in_out == "DEBUFF_UPTIME_OUT") then if (este_alvo.actived_at and este_alvo.actived) then - este_alvo.uptime = este_alvo.uptime + _detalhes._tempo - este_alvo.actived_at + este_alvo.uptime = este_alvo.uptime + Details._tempo - este_alvo.actived_at este_jogador.debuff_uptime = este_jogador.debuff_uptime + _tempo - este_alvo.actived_at --token = actor misc object end @@ -3214,7 +3214,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 [SPELL_POWER_FURY] = SPELL_POWER_RAGE, --warrior } - _detalhes.resource_strings = { + Details.resource_strings = { [SPELL_POWER_COMBO_POINTS2] = "Combo Point", [SPELL_POWER_SOUL_SHARDS] = "Soul Shard", [SPELL_POWER_LUNAR_POWER] = "Lunar Power", @@ -3228,7 +3228,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 [SPELL_POWER_FURY] = "Rage", } - _detalhes.resource_icons = { + Details.resource_icons = { [SPELL_POWER_COMBO_POINTS2] = {file = [[Interface\PLAYERFRAME\ClassOverlayComboPoints]], coords = {58/128, 74/128, 25/64, 39/64}}, [SPELL_POWER_SOUL_SHARDS] = {file = [[Interface\PLAYERFRAME\UI-WARLOCKSHARD]], coords = {3/64, 17/64, 2/128, 16/128}}, [SPELL_POWER_LUNAR_POWER] = {file = [[Interface\PLAYERFRAME\DruidEclipse]], coords = {117/256, 140/256, 83/128, 115/128}}, @@ -3262,7 +3262,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local onUnitPowerUpdate = function(self, event, unitID, powerType) if (powerType == "ALTERNATE") then - local actorName = _detalhes:GetCLName(unitID) + local actorName = Details:GetCLName(unitID) if (actorName) then local power = _current_combat.alternate_power[actorName] if (not power) then @@ -3444,7 +3444,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ------------------------------------------------------------------------------------------------ --build containers on the fly if (not sourceActor.cooldowns_defensive) then - sourceActor.cooldowns_defensive = _detalhes:GetOrderNumber(sourceName) + sourceActor.cooldowns_defensive = Details:GetOrderNumber(sourceName) sourceActor.cooldowns_defensive_targets = {} sourceActor.cooldowns_defensive_spells = container_habilidades:NovoContainer(container_misc) end @@ -3520,7 +3520,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 for i = 1, #_hook_cooldowns_container do local successful, errorText = pcall(_hook_cooldowns_container[i], nil, token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, spellId, spellName) if (not successful) then - _detalhes:Msg("error occurred on a cooldown hook function:", errorText) + Details:Msg("error occurred on a cooldown hook function:", errorText) end end end @@ -3612,7 +3612,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --verifica se tem dono e adiciona o interrupt para o dono if (ownerActor) then if (not ownerActor.interrupt) then - ownerActor.interrupt = _detalhes:GetOrderNumber(sourceName) + ownerActor.interrupt = Details:GetOrderNumber(sourceName) ownerActor.interrupt_targets = {} ownerActor.interrupt_spells = container_habilidades:NovoContainer(container_misc) ownerActor.interrompeu_oque = {} @@ -3798,7 +3798,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not este_jogador.dispell) then --constr�i aqui a tabela dele - este_jogador.dispell = _detalhes:GetOrderNumber(who_name) + este_jogador.dispell = Details:GetOrderNumber(who_name) este_jogador.dispell_targets = {} este_jogador.dispell_spells = container_habilidades:NovoContainer (container_misc) este_jogador.dispell_oque = {} @@ -3854,7 +3854,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --verifica se tem dono e adiciona o interrupt para o dono if (meu_dono) then if (not meu_dono.dispell) then - meu_dono.dispell = _detalhes:GetOrderNumber(who_name) + meu_dono.dispell = Details:GetOrderNumber(who_name) meu_dono.dispell_targets = {} meu_dono.dispell_spells = container_habilidades:NovoContainer (container_misc) meu_dono.dispell_oque = {} @@ -3905,7 +3905,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --build containers on the fly if (not este_jogador.ress) then - este_jogador.ress = _detalhes:GetOrderNumber(who_name) + este_jogador.ress = Details:GetOrderNumber(who_name) este_jogador.ress_targets = {} este_jogador.ress_spells = container_habilidades:NovoContainer (container_misc) --cria o container das habilidades usadas para interromper end @@ -4071,7 +4071,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --check if the dead actor is an actor outside the player group, for instance a pvp player or a npc if (_in_combat and targetFlags and (not damageActor or (bitBand(targetFlags, 0x00000008) ~= 0 and not damageActor.grupo))) then --frags - if (_detalhes.only_pvp_frags and (bitBand(targetFlags, 0x00000400) == 0 or (bitBand(targetFlags, 0x00000040) == 0 and bitBand(targetFlags, 0x00000020) == 0))) then --byte 2 = 4 (HOSTILE) byte 3 = 4 (OBJECT_TYPE_PLAYER) + if (Details.only_pvp_frags and (bitBand(targetFlags, 0x00000400) == 0 or (bitBand(targetFlags, 0x00000040) == 0 and bitBand(targetFlags, 0x00000020) == 0))) then --byte 2 = 4 (HOSTILE) byte 3 = 4 (OBJECT_TYPE_PLAYER) return end @@ -4277,7 +4277,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local maxHealth if (thisPlayer.arena_enemy) then --this is an arena enemy, get the heal with the unit Id - local unitId = _detalhes.arena_enemies[thisPlayer.nome] + local unitId = Details.arena_enemies[thisPlayer.nome] if (not unitId) then unitId = Details:GuessArenaEnemyUnitId(thisPlayer.nome) end @@ -4316,14 +4316,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --check if this is a mythic+ run for overall deaths if (bIsMythicRun) then --more checks for integrity - if (_detalhes.tabela_overall and _detalhes.tabela_overall.last_events_tables) then + if (Details.tabela_overall and Details.tabela_overall.last_events_tables) then --this is a mythic dungeon run, add the death to overall data --need to adjust the time of death, since this will show all deaths in the mythic run --first copy the table - local overallDeathTable = DetailsFramework.table.copy({}, playerDeathTable) + local overallDeathTable = detailsFramework.table.copy({}, playerDeathTable) --get the elapsed time - local mythicPlusElapsedTime = GetTime() - _detalhes.tabela_overall:GetStartTime() + local mythicPlusElapsedTime = GetTime() - Details.tabela_overall:GetStartTime() local minutes, seconds = floor(mythicPlusElapsedTime/60), floor(mythicPlusElapsedTime % 60) overallDeathTable[6] = minutes .. "m " .. seconds .. "s" @@ -4336,7 +4336,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 playerDeathTable["mythic_plus_dead_at_string"] = overallDeathTable[6] --now add the death table into the overall data (this is the regular overall data, not the mythic plus overall data) - tinsert(_detalhes.tabela_overall.last_events_tables, #_detalhes.tabela_overall.last_events_tables + 1, overallDeathTable) + tinsert(Details.tabela_overall.last_events_tables, #Details.tabela_overall.last_events_tables + 1, overallDeathTable) end end @@ -4345,7 +4345,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 for _, func in ipairs(_hook_deaths_container) do local successful, errortext = pcall(func, nil, token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, playerDeathTable, thisPlayer.last_cooldown, combatElapsedTime, maxHealth, playerDeathTable["mythic_plus_dead_at"] or 0) if (not successful) then - _detalhes:Msg("error occurred on a death hook function:", errortext) + Details:Msg("error occurred on a death hook function:", errortext) end end end @@ -4547,7 +4547,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --SPELL_BUILDING_HEAL --need research - function _detalhes:CaptureEnable (capture_type) + function Details:CaptureEnable (capture_type) capture_type = string.lower(capture_type) --retail @@ -4643,7 +4643,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end parser:RefreshFunctions() else - return _detalhes:Msg("Invalid Token for SetParserFunction.") + return Details:Msg("Invalid Token for SetParserFunction.") end end @@ -4695,56 +4695,56 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - function _detalhes:CallWipe (from_slash) + function Details:CallWipe (from_slash) Details:Msg("Wipe has been called by your raid leader.") - if (_detalhes.wipe_called) then + if (Details.wipe_called) then if (from_slash) then - return _detalhes:Msg(Loc ["STRING_WIPE_ERROR1"]) + return Details:Msg(Loc ["STRING_WIPE_ERROR1"]) else return end - elseif (not _detalhes.encounter_table.id) then + elseif (not Details.encounter_table.id) then if (from_slash) then - return _detalhes:Msg(Loc ["STRING_WIPE_ERROR2"]) + return Details:Msg(Loc ["STRING_WIPE_ERROR2"]) else return end end - local eTable = _detalhes.encounter_table + local eTable = Details.encounter_table --finish the encounter - local successful_ended = _detalhes.parser_functions:ENCOUNTER_END (eTable.id, eTable.name, eTable.diff, eTable.size, 0) + local successful_ended = Details.parser_functions:ENCOUNTER_END (eTable.id, eTable.name, eTable.diff, eTable.size, 0) if (successful_ended) then --we wiped - _detalhes.wipe_called = true + Details.wipe_called = true --cancel the on going captures schedules - _detalhes:CancelAllCaptureSchedules() + Details:CancelAllCaptureSchedules() --disable it - _detalhes:CaptureSet (false, "damage", false) - _detalhes:CaptureSet (false, "energy", false) - _detalhes:CaptureSet (false, "aura", false) - _detalhes:CaptureSet (false, "energy", false) - _detalhes:CaptureSet (false, "spellcast", false) + Details:CaptureSet (false, "damage", false) + Details:CaptureSet (false, "energy", false) + Details:CaptureSet (false, "aura", false) + Details:CaptureSet (false, "energy", false) + Details:CaptureSet (false, "spellcast", false) if (from_slash) then if (UnitIsGroupLeader ("player")) then - _detalhes:SendHomeRaidData ("WI") + Details:SendHomeRaidData ("WI") end end - local lower_instance = _detalhes:GetLowerInstanceNumber() + local lower_instance = Details:GetLowerInstanceNumber() if (lower_instance) then - lower_instance = _detalhes:GetInstance(lower_instance) + lower_instance = Details:GetInstance(lower_instance) lower_instance:InstanceAlert (Loc ["STRING_WIPE_ALERT"], {[[Interface\CHARACTERFRAME\UI-StateIcon]], 18, 18, false, 0.5, 1, 0, 0.5}, 4) end else if (from_slash) then - return _detalhes:Msg(Loc ["STRING_WIPE_ERROR3"]) + return Details:Msg(Loc ["STRING_WIPE_ERROR3"]) else return end @@ -4754,32 +4754,32 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 -- PARSER --serach key: ~parser ~events ~start ~inicio - function _detalhes:FlagCurrentCombat() - if (_detalhes.is_in_battleground) then - _detalhes.tabela_vigente.pvp = true - _detalhes.tabela_vigente.is_pvp = {name = _detalhes.zone_name, mapid = _detalhes.zone_id} + function Details:FlagCurrentCombat() + if (Details.is_in_battleground) then + Details.tabela_vigente.pvp = true + Details.tabela_vigente.is_pvp = {name = Details.zone_name, mapid = Details.zone_id} - elseif (_detalhes.is_in_arena) then - _detalhes.tabela_vigente.arena = true - _detalhes.tabela_vigente.is_arena = {name = _detalhes.zone_name, zone = _detalhes.zone_name, mapid = _detalhes.zone_id} + elseif (Details.is_in_arena) then + Details.tabela_vigente.arena = true + Details.tabela_vigente.is_arena = {name = Details.zone_name, zone = Details.zone_name, mapid = Details.zone_id} end end - function _detalhes:GetZoneType() - return _detalhes.zone_type + function Details:GetZoneType() + return Details.zone_type end - function _detalhes.parser_functions:ZONE_CHANGED_NEW_AREA(...) + function Details.parser_functions:ZONE_CHANGED_NEW_AREA(...) return Details.Schedules.After(1, Details.Check_ZONE_CHANGED_NEW_AREA) end --~zone ~area - function _detalhes:Check_ZONE_CHANGED_NEW_AREA() + function Details:Check_ZONE_CHANGED_NEW_AREA() local zoneName, zoneType, _, _, _, _, _, zoneMapID = GetInstanceInfo() - _detalhes.zone_type = zoneType - _detalhes.zone_id = zoneMapID - _detalhes.zone_name = zoneName + Details.zone_type = zoneType + Details.zone_id = zoneMapID + Details.zone_name = zoneName _in_resting_zone = IsResting() @@ -4791,109 +4791,109 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _is_in_instance = true end - if (_detalhes.last_zone_type ~= zoneType) then - _detalhes:SendEvent("ZONE_TYPE_CHANGED", nil, zoneType) - _detalhes.last_zone_type = zoneType + if (Details.last_zone_type ~= zoneType) then + Details:SendEvent("ZONE_TYPE_CHANGED", nil, zoneType) + Details.last_zone_type = zoneType - for index, instancia in ipairs(_detalhes.tabela_instancias) do + for index, instancia in ipairs(Details.tabela_instancias) do if (instancia.ativa) then instancia:AdjustAlphaByContext(true) end end end - _detalhes.time_type = _detalhes.time_type_original + Details.time_type = Details.time_type_original - if (_detalhes.debug) then - _detalhes:Msg("(debug) zone change:", _detalhes.zone_name, "is a", _detalhes.zone_type, "zone.") + if (Details.debug) then + Details:Msg("(debug) zone change:", Details.zone_name, "is a", Details.zone_type, "zone.") end - if (_detalhes.is_in_arena and zoneType ~= "arena") then - _detalhes:LeftArena() + if (Details.is_in_arena and zoneType ~= "arena") then + Details:LeftArena() end --check if the player left a battleground - if (_detalhes.is_in_battleground and zoneType ~= "pvp") then - _detalhes.pvp_parser_frame:StopBgUpdater() - _detalhes.is_in_battleground = nil - _detalhes.time_type = _detalhes.time_type_original + if (Details.is_in_battleground and zoneType ~= "pvp") then + Details.pvp_parser_frame:StopBgUpdater() + Details.is_in_battleground = nil + Details.time_type = Details.time_type_original end if (zoneType == "pvp") then --battlegrounds - if (_detalhes.debug) then - _detalhes:Msg("(debug) zone type is now 'pvp'.") + if (Details.debug) then + Details:Msg("(debug) zone type is now 'pvp'.") end - if(not _detalhes.is_in_battleground and _detalhes.overall_clear_pvp) then - _detalhes.tabela_historico:ResetOverallData() + if(not Details.is_in_battleground and Details.overall_clear_pvp) then + Details.tabela_historico:ResetOverallData() end - _detalhes.is_in_battleground = true + Details.is_in_battleground = true if (_in_combat and not _current_combat.pvp) then - _detalhes:SairDoCombate() + Details:SairDoCombate() end if (not _in_combat) then - _detalhes:EntrarEmCombate() + Details:EntrarEmCombate() end _current_combat.pvp = true _current_combat.is_pvp = {name = zoneName, mapid = zoneMapID} - if (_detalhes.use_battleground_server_parser) then - if (_detalhes.time_type == 1) then - _detalhes.time_type_original = 1 - _detalhes.time_type = 2 + if (Details.use_battleground_server_parser) then + if (Details.time_type == 1) then + Details.time_type_original = 1 + Details.time_type = 2 end - _detalhes.pvp_parser_frame:StartBgUpdater() + Details.pvp_parser_frame:StartBgUpdater() else - if (_detalhes.force_activity_time_pvp) then - _detalhes.time_type_original = _detalhes.time_type - _detalhes.time_type = 1 + if (Details.force_activity_time_pvp) then + Details.time_type_original = Details.time_type + Details.time_type = 1 end end Details.lastBattlegroundStartTime = GetTime() elseif (zoneType == "arena") then - if (_detalhes.debug) then - _detalhes:Msg("(debug) zone type is now 'arena'.") + if (Details.debug) then + Details:Msg("(debug) zone type is now 'arena'.") end - if (_detalhes.force_activity_time_pvp) then - _detalhes.time_type_original = _detalhes.time_type - _detalhes.time_type = 1 + if (Details.force_activity_time_pvp) then + Details.time_type_original = Details.time_type + Details.time_type = 1 end - if (not _detalhes.is_in_arena) then - if (_detalhes.overall_clear_pvp) then - _detalhes.tabela_historico:ResetOverallData() + if (not Details.is_in_arena) then + if (Details.overall_clear_pvp) then + Details.tabela_historico:ResetOverallData() end --reset spec cache if broadcaster requested - if (_detalhes.streamer_config.reset_spec_cache) then - Details:Destroy(_detalhes.cached_specs) + if (Details.streamer_config.reset_spec_cache) then + Details:Destroy(Details.cached_specs) end end - _detalhes.is_in_arena = true - _detalhes:EnteredInArena() + Details.is_in_arena = true + Details:EnteredInArena() else local inInstance = IsInInstance() if ((zoneType == "raid" or zoneType == "party") and inInstance) then - _detalhes:CheckForAutoErase (zoneMapID) + Details:CheckForAutoErase (zoneMapID) --if the current raid is current tier raid, pre-load the storage database if (zoneType == "raid") then - if (_detalhes.InstancesToStoreData [zoneMapID]) then - _detalhes.ScheduleLoadStorage() + if (Details.InstancesToStoreData [zoneMapID]) then + Details.ScheduleLoadStorage() end end end - if (_detalhes:IsInInstance()) then - _detalhes.last_instance = zoneMapID + if (Details:IsInInstance()) then + Details.last_instance = zoneMapID end --if (_current_combat.pvp) then @@ -4901,22 +4901,22 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --end end - _is_activity_time = _detalhes.time_type == 1 + _is_activity_time = Details.time_type == 1 - _detalhes:DispatchAutoRunCode("on_zonechanged") - _detalhes:SchedulePetUpdate(7) - _detalhes:CheckForPerformanceProfile() + Details:DispatchAutoRunCode("on_zonechanged") + Details:SchedulePetUpdate(7) + Details:CheckForPerformanceProfile() end - function _detalhes.parser_functions:PLAYER_ENTERING_WORLD () - return _detalhes.parser_functions:ZONE_CHANGED_NEW_AREA() + function Details.parser_functions:PLAYER_ENTERING_WORLD () + return Details.parser_functions:ZONE_CHANGED_NEW_AREA() end -- ~encounter --ENCOUNTER START - function _detalhes.parser_functions:ENCOUNTER_START(...) - if (_detalhes.debug) then - _detalhes:Msg("(debug) |cFFFFFF00ENCOUNTER_START|r event triggered.") + function Details.parser_functions:ENCOUNTER_START(...) + if (Details.debug) then + Details:Msg("(debug) |cFFFFFF00ENCOUNTER_START|r event triggered.") end if (not isWOTLK) then @@ -4933,25 +4933,25 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 Details222.Perf.WindowUpdate = 0 Details222.Perf.WindowUpdateC = true - _detalhes.latest_ENCOUNTER_END = _detalhes.latest_ENCOUNTER_END or 0 - if (_detalhes.latest_ENCOUNTER_END + 10 > GetTime()) then + Details.latest_ENCOUNTER_END = Details.latest_ENCOUNTER_END or 0 + if (Details.latest_ENCOUNTER_END + 10 > GetTime()) then return end --leave the current combat when the encounter start, if is doing a mythic plus dungeons, check if the options allows to create a dedicated segment for the boss fight - if ((_in_combat and not _detalhes.tabela_vigente.is_boss) and (not _detalhes.MythicPlus.Started or _detalhes.mythic_plus.boss_dedicated_segment)) then - _detalhes:SairDoCombate() + if ((_in_combat and not Details.tabela_vigente.is_boss) and (not Details.MythicPlus.Started or Details.mythic_plus.boss_dedicated_segment)) then + Details:SairDoCombate() end local encounterID, encounterName, difficultyID, raidSize = select(1, ...) local zoneName, _, _, _, _, _, _, zoneMapID = GetInstanceInfo() - if (_detalhes.InstancesToStoreData[zoneMapID]) then + if (Details.InstancesToStoreData[zoneMapID]) then Details.current_exp_raid_encounters[encounterID] = true end - if (not _detalhes.WhoAggroTimer and _detalhes.announce_firsthit.enabled) then - _detalhes.WhoAggroTimer = C_Timer.NewTimer(0.1, who_aggro) + if (not Details.WhoAggroTimer and Details.announce_firsthit.enabled) then + Details.WhoAggroTimer = C_Timer.NewTimer(0.1, who_aggro) for i = 1, 5 do local boss = UnitExists("boss" .. i) if (boss) then @@ -4964,47 +4964,47 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - if (IsInGuild() and IsInRaid() and _detalhes.announce_damagerecord.enabled and _detalhes.StorageLoaded) then - _detalhes.TellDamageRecord = C_Timer.NewTimer(0.6, _detalhes.PrintEncounterRecord) - _detalhes.TellDamageRecord.Boss = encounterID - _detalhes.TellDamageRecord.Diff = difficultyID + if (IsInGuild() and IsInRaid() and Details.announce_damagerecord.enabled and Details.StorageLoaded) then + Details.TellDamageRecord = C_Timer.NewTimer(0.6, Details.PrintEncounterRecord) + Details.TellDamageRecord.Boss = encounterID + Details.TellDamageRecord.Diff = difficultyID end _current_encounter_id = encounterID - _detalhes.boss1_health_percent = 1 + Details.boss1_health_percent = 1 - local dbm_mod, dbm_time = _detalhes.encounter_table.DBM_Mod, _detalhes.encounter_table.DBM_ModTime - Details:Destroy(_detalhes.encounter_table) + local dbm_mod, dbm_time = Details.encounter_table.DBM_Mod, Details.encounter_table.DBM_ModTime + Details:Destroy(Details.encounter_table) - _detalhes.encounter_table.phase = 1 + Details.encounter_table.phase = 1 --store the encounter time inside the encounter table for the encounter plugin - _detalhes.encounter_table.start = GetTime() - _detalhes.encounter_table ["end"] = nil + Details.encounter_table.start = GetTime() + Details.encounter_table ["end"] = nil -- local encounterID = Details.encounter_table.id - _detalhes.encounter_table.id = encounterID - _detalhes.encounter_table.name = encounterName - _detalhes.encounter_table.diff = difficultyID - _detalhes.encounter_table.size = raidSize - _detalhes.encounter_table.zone = zoneName - _detalhes.encounter_table.mapid = zoneMapID + Details.encounter_table.id = encounterID + Details.encounter_table.name = encounterName + Details.encounter_table.diff = difficultyID + Details.encounter_table.size = raidSize + Details.encounter_table.zone = zoneName + Details.encounter_table.mapid = zoneMapID if (dbm_mod and dbm_time == time()) then --pode ser time() � usado no start pra saber se foi no mesmo segundo. - _detalhes.encounter_table.DBM_Mod = dbm_mod + Details.encounter_table.DBM_Mod = dbm_mod end - local encounter_start_table = _detalhes:GetEncounterStartInfo (zoneMapID, encounterID) + local encounter_start_table = Details:GetEncounterStartInfo (zoneMapID, encounterID) if (encounter_start_table) then if (encounter_start_table.delay) then if (type(encounter_start_table.delay) == "function") then local delay = encounter_start_table.delay() if (delay) then --_detalhes.encounter_table ["start"] = time() + delay - _detalhes.encounter_table ["start"] = GetTime() + delay + Details.encounter_table ["start"] = GetTime() + delay end else --_detalhes.encounter_table ["start"] = time() + encounter_start_table.delay - _detalhes.encounter_table ["start"] = GetTime() + encounter_start_table.delay + Details.encounter_table ["start"] = GetTime() + encounter_start_table.delay end end if (encounter_start_table.func) then @@ -5012,20 +5012,20 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - local encounter_table, boss_index = _detalhes:GetBossEncounterDetailsFromEncounterId (zoneMapID, encounterID) + local encounter_table, boss_index = Details:GetBossEncounterDetailsFromEncounterId (zoneMapID, encounterID) if (encounter_table) then - _detalhes.encounter_table.index = boss_index + Details.encounter_table.index = boss_index end - _detalhes:SendEvent("COMBAT_ENCOUNTER_START", nil, ...) + Details:SendEvent("COMBAT_ENCOUNTER_START", nil, ...) end --ENCOUNRTER_END - function _detalhes.parser_functions:ENCOUNTER_END(...) - if (_detalhes.debug) then - _detalhes:Msg("(debug) |cFFFFFF00ENCOUNTER_END|r event triggered.") + function Details.parser_functions:ENCOUNTER_END(...) + if (Details.debug) then + Details:Msg("(debug) |cFFFFFF00ENCOUNTER_END|r event triggered.") end Details222.Perf.WindowUpdateC = false @@ -5044,42 +5044,42 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _current_encounter_id = nil local _, instanceType = GetInstanceInfo() --let's make sure it isn't a dungeon - if (_detalhes.zone_type == "party" or instanceType == "party") then - if (_detalhes.debug) then - _detalhes:Msg("(debug) the zone type is 'party', ignoring ENCOUNTER_END.") + if (Details.zone_type == "party" or instanceType == "party") then + if (Details.debug) then + Details:Msg("(debug) the zone type is 'party', ignoring ENCOUNTER_END.") end end local encounterID, encounterName, difficultyID, raidSize, endStatus = select(1, ...) - if (not _detalhes.encounter_table.start) then + if (not Details.encounter_table.start) then Details:Msg("encounter table without start time.") return end - _detalhes.latest_ENCOUNTER_END = _detalhes.latest_ENCOUNTER_END or 0 - if (_detalhes.latest_ENCOUNTER_END + 15 > GetTime()) then + Details.latest_ENCOUNTER_END = Details.latest_ENCOUNTER_END or 0 + if (Details.latest_ENCOUNTER_END + 15 > GetTime()) then return end - _detalhes.latest_ENCOUNTER_END = GetTime() - _detalhes.encounter_table ["end"] = GetTime() -- 0.351 + Details.latest_ENCOUNTER_END = GetTime() + Details.encounter_table ["end"] = GetTime() -- 0.351 local _, _, _, _, _, _, _, zoneMapID = GetInstanceInfo() if (_in_combat) then if (endStatus == 1) then - _detalhes.encounter_table.kill = true - _detalhes:SairDoCombate (true, {encounterID, encounterName, difficultyID, raidSize, endStatus}) --killed + Details.encounter_table.kill = true + Details:SairDoCombate (true, {encounterID, encounterName, difficultyID, raidSize, endStatus}) --killed else - _detalhes.encounter_table.kill = false - _detalhes:SairDoCombate (false, {encounterID, encounterName, difficultyID, raidSize, endStatus}) --wipe + Details.encounter_table.kill = false + Details:SairDoCombate (false, {encounterID, encounterName, difficultyID, raidSize, endStatus}) --wipe end else - if ((_detalhes.tabela_vigente:GetEndTime() or 0) + 2 >= _detalhes.encounter_table ["end"]) then - _detalhes.tabela_vigente:SetStartTime (_detalhes.encounter_table ["start"]) - _detalhes.tabela_vigente:SetEndTime (_detalhes.encounter_table ["end"]) - _detalhes:RefreshMainWindow(-1, true) + if ((Details.tabela_vigente:GetEndTime() or 0) + 2 >= Details.encounter_table ["end"]) then + Details.tabela_vigente:SetStartTime (Details.encounter_table ["start"]) + Details.tabela_vigente:SetEndTime (Details.encounter_table ["end"]) + Details:RefreshMainWindow(-1, true) end end @@ -5100,9 +5100,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 Details:Msg("ilvl error:", status) end - _detalhes:SendEvent("COMBAT_ENCOUNTER_END", nil, ...) + Details:SendEvent("COMBAT_ENCOUNTER_END", nil, ...) - Details:Destroy(_detalhes.encounter_table) + Details:Destroy(Details.encounter_table) Details:Destroy(dk_pets_cache.army) Details:Destroy(dk_pets_cache.apoc) Details:Destroy(empower_cache) @@ -5110,9 +5110,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 return true end - function _detalhes.parser_functions:UNIT_PET(...) - _detalhes.container_pets:Unpet(...) - _detalhes:SchedulePetUpdate(1) + function Details.parser_functions:UNIT_PET(...) + Details.container_pets:Unpet(...) + Details:SchedulePetUpdate(1) end local autoSwapDynamicOverallData = function(instance, inCombat) @@ -5144,7 +5144,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end - function _detalhes.parser_functions:PLAYER_REGEN_DISABLED(...) + function Details.parser_functions:PLAYER_REGEN_DISABLED(...) C_Timer.After(0, function() if (not Details.bossTargetAtPull) then if (UnitExists("boss1")) then @@ -5165,32 +5165,32 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _trinket_data_cache = Details:GetTrinketData() - if (_detalhes.zone_type == "pvp" and not _detalhes.use_battleground_server_parser) then + if (Details.zone_type == "pvp" and not Details.use_battleground_server_parser) then if (_in_combat) then - _detalhes:SairDoCombate() + Details:SairDoCombate() end - _detalhes:EntrarEmCombate() + Details:EntrarEmCombate() end - if (not _detalhes:CaptureGet("damage")) then - _detalhes:EntrarEmCombate() + if (not Details:CaptureGet("damage")) then + Details:EntrarEmCombate() end --essa parte do solo mode ainda sera usada? - if (_detalhes.solo and _detalhes.PluginCount.SOLO > 0) then --solo mode - local esta_instancia = _detalhes.tabela_instancias[_detalhes.solo] + if (Details.solo and Details.PluginCount.SOLO > 0) then --solo mode + local esta_instancia = Details.tabela_instancias[Details.solo] esta_instancia.atualizando = true end - for index, instancia in ipairs(_detalhes.tabela_instancias) do + for index, instancia in ipairs(Details.tabela_instancias) do if (instancia.ativa) then --1 = none, we doesn't need to call instancia:AdjustAlphaByContext(true) end end - _detalhes:DispatchAutoRunCode("on_entercombat") + Details:DispatchAutoRunCode("on_entercombat") - _detalhes.tabela_vigente.CombatStartedAt = GetTime() + Details.tabela_vigente.CombatStartedAt = GetTime() end --in case the player left the raid during the encounter @@ -5235,9 +5235,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --this function is guaranteed to run after a combat is done --can also run when the player leaves combat state (regen enabled) - function _detalhes:RunScheduledEventsAfterCombat(OnRegenEnabled) - if (_detalhes.debug) then - _detalhes:Msg("(debug) running scheduled events after combat end.") + function Details:RunScheduledEventsAfterCombat(OnRegenEnabled) + if (Details.debug) then + Details:Msg("(debug) running scheduled events after combat end.") end TBC_JudgementOfLightCache = { @@ -5245,42 +5245,42 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 } --when the user requested data from the storage but is in combat lockdown - if (_detalhes.schedule_storage_load) then - _detalhes.schedule_storage_load = nil - _detalhes.ScheduleLoadStorage() + if (Details.schedule_storage_load) then + Details.schedule_storage_load = nil + Details.ScheduleLoadStorage() end --store a boss encounter when out of combat since it might need to load the storage - if (_detalhes.schedule_store_boss_encounter) then - if (not _detalhes.logoff_saving_data) then + if (Details.schedule_store_boss_encounter) then + if (not Details.logoff_saving_data) then local successful, errortext = pcall(Details.Database.StoreEncounter) if (not successful) then - _detalhes:Msg("error occurred on Details.Database.StoreEncounter():", errortext) + Details:Msg("error occurred on Details.Database.StoreEncounter():", errortext) end end - _detalhes.schedule_store_boss_encounter = nil + Details.schedule_store_boss_encounter = nil end if (Details.schedule_store_boss_encounter_wipe) then - if (not _detalhes.logoff_saving_data) then + if (not Details.logoff_saving_data) then local successful, errortext = pcall(Details.Database.StoreWipe) if (not successful) then - _detalhes:Msg("error occurred on Details.Database.StoreWipe():", errortext) + Details:Msg("error occurred on Details.Database.StoreWipe():", errortext) end end Details.schedule_store_boss_encounter_wipe = nil end --when a large amount of data has been removed and the player is in combat, schedule to run the hard garbage collector (the blizzard one, not the details! internal) - if (_detalhes.schedule_hard_garbage_collect) then - if (_detalhes.debug) then - _detalhes:Msg("(debug) found schedule collectgarbage().") + if (Details.schedule_hard_garbage_collect) then + if (Details.debug) then + Details:Msg("(debug) found schedule collectgarbage().") end - _detalhes.schedule_hard_garbage_collect = false + Details.schedule_hard_garbage_collect = false collectgarbage() end - for index, instancia in ipairs(_detalhes.tabela_instancias) do + for index, instancia in ipairs(Details.tabela_instancias) do if (instancia.ativa) then --1 = none, we doesn't need to call instancia:AdjustAlphaByContext(true) end @@ -5289,12 +5289,12 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not OnRegenEnabled) then Details:Destroy(bitfield_swap_cache) Details:Destroy(empower_cache) - _detalhes:DispatchAutoRunCode("on_leavecombat") + Details:DispatchAutoRunCode("on_leavecombat") end - if (_detalhes.solo and _detalhes.PluginCount.SOLO > 0) then --code too old and I don't have documentation for it - if (_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Stop) then - _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Stop() + if (Details.solo and Details.PluginCount.SOLO > 0) then --code too old and I don't have documentation for it + if (Details.SoloTables.Plugins [Details.SoloTables.Mode].Stop) then + Details.SoloTables.Plugins [Details.SoloTables.Mode].Stop() end end @@ -5310,7 +5310,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 for i = #_detalhes.schedule_add_to_overall, 1, -1 do local CombatToAdd = tremove(_detalhes.schedule_add_to_overall, i) if (CombatToAdd) then - _detalhes.historico:adicionar_overall (CombatToAdd) + _detalhes.historico:AddToOverallData (CombatToAdd) end end end @@ -5364,23 +5364,23 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end - function _detalhes.parser_functions:CHALLENGE_MODE_START(...) + function Details.parser_functions:CHALLENGE_MODE_START(...) --send mythic dungeon start event - if (_detalhes.debug) then + if (Details.debug) then print("parser event", "CHALLENGE_MODE_START", ...) end local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() if (difficultyID == 8) then - _detalhes:SendEvent("COMBAT_MYTHICDUNGEON_START") + Details:SendEvent("COMBAT_MYTHICDUNGEON_START") end end - function _detalhes.parser_functions:CHALLENGE_MODE_COMPLETED(...) + function Details.parser_functions:CHALLENGE_MODE_COMPLETED(...) --send mythic dungeon end event local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() if (difficultyID == 8) then - _detalhes:SendEvent("COMBAT_MYTHICDUNGEON_END") + Details:SendEvent("COMBAT_MYTHICDUNGEON_END") end local okay, errorText = pcall(function() @@ -5410,13 +5410,13 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end) if (not okay) then - _detalhes:Msg("something went wrong (0x7878):", errorText) + Details:Msg("something went wrong (0x7878):", errorText) end end - function _detalhes.parser_functions:PLAYER_REGEN_ENABLED(...) - if (_detalhes.debug) then - _detalhes:Msg("(debug) |cFFFFFF00PLAYER_REGEN_ENABLED|r event triggered.") + function Details.parser_functions:PLAYER_REGEN_ENABLED(...) + if (Details.debug) then + Details:Msg("(debug) |cFFFFFF00PLAYER_REGEN_ENABLED|r event triggered.") --print("combat lockdown:", InCombatLockdown()) --print("affecting combat:", UnitAffectingCombat("player")) @@ -5477,46 +5477,46 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - function _detalhes.parser_functions:PLAYER_TALENT_UPDATE() + function Details.parser_functions:PLAYER_TALENT_UPDATE() if (IsInGroup() or IsInRaid()) then - if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer:IsCancelled()) then - _detalhes.SendTalentTimer:Cancel() + if (Details.SendTalentTimer and not Details.SendTalentTimer:IsCancelled()) then + Details.SendTalentTimer:Cancel() end - _detalhes.SendTalentTimer = C_Timer.NewTimer(11, function() - _detalhes:SendCharacterData() + Details.SendTalentTimer = C_Timer.NewTimer(11, function() + Details:SendCharacterData() end) end end - function _detalhes.parser_functions:PLAYER_SPECIALIZATION_CHANGED() + function Details.parser_functions:PLAYER_SPECIALIZATION_CHANGED() --some parts of details! does call this function, check first for past expansions - if (DetailsFramework.IsTimewalkWoW()) then + if (detailsFramework.IsTimewalkWoW()) then return end - local specIndex = DetailsFramework.GetSpecialization() + local specIndex = detailsFramework.GetSpecialization() if (specIndex) then - local specID = DetailsFramework.GetSpecializationInfo(specIndex) + local specID = detailsFramework.GetSpecializationInfo(specIndex) if (specID and specID ~= 0) then local guid = UnitGUID("player") if (guid) then - _detalhes.cached_specs [guid] = specID + Details.cached_specs [guid] = specID end end end if (IsInGroup() or IsInRaid()) then - if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer:IsCancelled()) then - _detalhes.SendTalentTimer:Cancel() + if (Details.SendTalentTimer and not Details.SendTalentTimer:IsCancelled()) then + Details.SendTalentTimer:Cancel() end - _detalhes.SendTalentTimer = C_Timer.NewTimer(11, function() - _detalhes:SendCharacterData() + Details.SendTalentTimer = C_Timer.NewTimer(11, function() + Details:SendCharacterData() end) end end --this is mostly triggered when the player enters in a dual against another player - function _detalhes.parser_functions:UNIT_FACTION(unit) + function Details.parser_functions:UNIT_FACTION(unit) if (true) then --disable until figure out how to make this work properlly --at the moment this event is firing at bgs, arenas, etc making horde icons to show at random @@ -5525,13 +5525,13 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --check if outdoors --unit was nil, nameplate might bug here, it should track after the event - if (_detalhes.zone_type == "none" and unit) then + if (Details.zone_type == "none" and unit) then local serial = UnitGUID(unit) --the serial is valid and isn't THE player and the serial is from a player? if (serial and serial ~= UnitGUID("player") and serial:find("Player")) then - _detalhes.duel_candidates[serial] = GetTime() + Details.duel_candidates[serial] = GetTime() - local playerName = _detalhes:GetCLName(unit) + local playerName = Details:GetCLName(unit) --check if the player is inside the current combat and flag the objects if (playerName and _current_combat) then @@ -5568,29 +5568,29 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - function _detalhes.parser_functions:ROLE_CHANGED_INFORM(...) - if (_detalhes.last_assigned_role ~= _UnitGroupRolesAssigned("player")) then - _detalhes:CheckSwitchOnLogon (true) - _detalhes.last_assigned_role = _UnitGroupRolesAssigned("player") + function Details.parser_functions:ROLE_CHANGED_INFORM(...) + if (Details.last_assigned_role ~= _UnitGroupRolesAssigned("player")) then + Details:CheckSwitchOnLogon (true) + Details.last_assigned_role = _UnitGroupRolesAssigned("player") end end - function _detalhes.parser_functions:PLAYER_ROLES_ASSIGNED(...) - if (_detalhes.last_assigned_role ~= _UnitGroupRolesAssigned("player")) then - _detalhes:CheckSwitchOnLogon (true) - _detalhes.last_assigned_role = _UnitGroupRolesAssigned("player") + function Details.parser_functions:PLAYER_ROLES_ASSIGNED(...) + if (Details.last_assigned_role ~= _UnitGroupRolesAssigned("player")) then + Details:CheckSwitchOnLogon (true) + Details.last_assigned_role = _UnitGroupRolesAssigned("player") end end - function _detalhes:InGroup() - return _detalhes.in_group + function Details:InGroup() + return Details.in_group end - function _detalhes.parser_functions:GROUP_ROSTER_UPDATE(...) - if (not _detalhes.in_group) then - _detalhes.in_group = IsInGroup() or IsInRaid() + function Details.parser_functions:GROUP_ROSTER_UPDATE(...) + if (not Details.in_group) then + Details.in_group = IsInGroup() or IsInRaid() - if (_detalhes.in_group) then + if (Details.in_group) then --player entered in a group, cleanup and set the new enviromnent Details222.GarbageCollector.RestartInternalGarbageCollector(true) Details:WipePets() @@ -5608,9 +5608,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end else - _detalhes.in_group = IsInGroup() or IsInRaid() + Details.in_group = IsInGroup() or IsInRaid() - if (not _detalhes.in_group) then + if (not Details.in_group) then --player left the group, run routines to cleanup the environment Details222.GarbageCollector.RestartInternalGarbageCollector(true) Details:WipePets() @@ -5623,37 +5623,37 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 Details:Destroy(Details.trusted_characters) else --player is still in a group - _detalhes:SchedulePetUpdate(2) + Details:SchedulePetUpdate(2) --send char data - if (_detalhes.SendCharDataOnGroupChange and not _detalhes.SendCharDataOnGroupChange:IsCancelled()) then + if (Details.SendCharDataOnGroupChange and not Details.SendCharDataOnGroupChange:IsCancelled()) then return end - _detalhes.SendCharDataOnGroupChange = C_Timer.NewTimer(11, function() - _detalhes:SendCharacterData() - _detalhes.SendCharDataOnGroupChange = nil + Details.SendCharDataOnGroupChange = C_Timer.NewTimer(11, function() + Details:SendCharacterData() + Details.SendCharDataOnGroupChange = nil end) end end - _detalhes:SchedulePetUpdate(6) + Details:SchedulePetUpdate(6) end - function _detalhes.parser_functions:START_TIMER(...) --~timer - if (_detalhes.debug) then - _detalhes:Msg("(debug) found a timer.") + function Details.parser_functions:START_TIMER(...) --~timer + if (Details.debug) then + Details:Msg("(debug) found a timer.") end local _, zoneType = GetInstanceInfo() --check if the player is inside an arena if (zoneType == "arena") then - if (_detalhes.debug) then - _detalhes:Msg("(debug) timer is an arena countdown.") + if (Details.debug) then + Details:Msg("(debug) timer is an arena countdown.") end - _detalhes:StartArenaSegment(...) + Details:StartArenaSegment(...) --check if the player is inside a battleground elseif (zoneType == "battleground") then @@ -5675,7 +5675,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function Details:CreateBattlegroundSegment() if (_in_combat) then - _detalhes.tabela_vigente.discard_segment = true + Details.tabela_vigente.discard_segment = true Details:EndCombat() end @@ -5745,7 +5745,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 return Details.isLoaded end - function _detalhes.parser_functions:ADDON_LOADED(...) + function Details.parser_functions:ADDON_LOADED(...) local addonName = select(1, ...) if (addonName == "Details") then TurnTheSpeakersOn() @@ -5758,48 +5758,48 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 Details:StartMeUp() end) - function _detalhes.parser_functions:PET_BATTLE_OPENING_START(...) - _detalhes.pet_battle = true - for index, instance in ipairs(_detalhes.tabela_instancias) do + function Details.parser_functions:PET_BATTLE_OPENING_START(...) + Details.pet_battle = true + for index, instance in ipairs(Details.tabela_instancias) do if (instance.ativa) then - if (_detalhes.debug) then - _detalhes:Msg("(debug) hidding windows for Pet Battle.") + if (Details.debug) then + Details:Msg("(debug) hidding windows for Pet Battle.") end instance:SetWindowAlphaForCombat(true, true, 0) end end end - function _detalhes.parser_functions:PET_BATTLE_CLOSE(...) - _detalhes.pet_battle = false - for index, instance in ipairs(_detalhes.tabela_instancias) do + function Details.parser_functions:PET_BATTLE_CLOSE(...) + Details.pet_battle = false + for index, instance in ipairs(Details.tabela_instancias) do if (instance.ativa) then - if (_detalhes.debug) then - _detalhes:Msg("(debug) Pet Battle finished, calling AdjustAlphaByContext().") + if (Details.debug) then + Details:Msg("(debug) Pet Battle finished, calling AdjustAlphaByContext().") end instance:AdjustAlphaByContext(true) end end end - function _detalhes.parser_functions:UNIT_NAME_UPDATE(...) - _detalhes:SchedulePetUpdate(5) + function Details.parser_functions:UNIT_NAME_UPDATE(...) + Details:SchedulePetUpdate(5) end function Details.parser_functions:PLAYER_TARGET_CHANGED(...) Details:SendEvent("PLAYER_TARGET") end - local parser_functions = _detalhes.parser_functions + local parser_functions = Details.parser_functions - function _detalhes:OnEvent(event, ...) + function Details:OnEvent(event, ...) local func = parser_functions[event] if (func) then return func(nil, ...) end end - _detalhes.listener:SetScript("OnEvent", _detalhes.OnEvent) + Details.listener:SetScript("OnEvent", Details.OnEvent) ---return the backup table with regular logs, error and backups /dumpt __details_backup._general_logs function Details222.SaveVariables.GetBackupLogs() @@ -5876,39 +5876,39 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 currentStep = "Checking the framework integrity" - if (not _detalhes.gump) then + if (not Details.gump) then --failed to load the framework tinsert(_detalhes_global.exit_log, "The framework wasn't in Details member 'gump'.") - tinsert(_detalhes_global.exit_errors, 1, currentStep .. "|" .. Details222.Date.GetDateForLogs() .. "|" .. _detalhes.userversion .. "|Framework wasn't loaded|") + tinsert(_detalhes_global.exit_errors, 1, currentStep .. "|" .. Details222.Date.GetDateForLogs() .. "|" .. Details.userversion .. "|Framework wasn't loaded|") return end local logSaverError = function(errortext) local writeLog = function() _detalhes_global = _detalhes_global or {} - tinsert(_detalhes_global.exit_errors, 1, currentStep .. "|" .. Details222.Date.GetDateForLogs() .. "|" .. _detalhes.userversion .. "|" .. errortext .. "|" .. debugstack()) + tinsert(_detalhes_global.exit_errors, 1, currentStep .. "|" .. Details222.Date.GetDateForLogs() .. "|" .. Details.userversion .. "|" .. errortext .. "|" .. debugstack()) tremove(_detalhes_global.exit_errors, exitErrorsMaxSize) - addToExitErrors(currentStep .. "|" .. Details222.Date.GetDateForLogs() .. "|" .. _detalhes.userversion .. "|" .. errortext .. "|" .. debugstack()) + addToExitErrors(currentStep .. "|" .. Details222.Date.GetDateForLogs() .. "|" .. Details.userversion .. "|" .. errortext .. "|" .. debugstack()) end xpcall(writeLog, addToExitErrors) end - _detalhes.saver_error_func = logSaverError - _detalhes.logoff_saving_data = true + Details.saver_error_func = logSaverError + Details.logoff_saving_data = true --close breakdown window - if (_detalhes.CloseBreakdownWindow) then + if (Details.CloseBreakdownWindow) then tinsert(_detalhes_global.exit_log, "1 - Closing Breakdown Window.") currentStep = "Closing Breakdown Window" - xpcall(_detalhes.CloseBreakdownWindow, logSaverError) + xpcall(Details.CloseBreakdownWindow, logSaverError) end --do not save window pos - if (_detalhes.tabela_instancias) then + if (Details.tabela_instancias) then local clearInstances = function() currentStep = "Dealing With Instances" tinsert(_detalhes_global.exit_log, "2 - Clearing user placed position from instance windows.") - for id, instance in _detalhes:ListInstances() do + for id, instance in Details:ListInstances() do if (id) then tinsert(_detalhes_global.exit_log, " - " .. id .. " has baseFrame: " .. (instance.baseframe and "yes" or "no") .. ".") if (instance.baseframe) then @@ -5926,22 +5926,22 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end --if is in combat during the logout, stop the combat - if (_detalhes.in_combat and _detalhes.tabela_vigente) then + if (Details.in_combat and Details.tabela_vigente) then tinsert(_detalhes_global.exit_log, "3 - Leaving current combat.") currentStep = "Leaving Current Combat" - xpcall(_detalhes.SairDoCombate, logSaverError) - _detalhes.can_panic_mode = true + xpcall(Details.SairDoCombate, logSaverError) + Details.can_panic_mode = true end --switch back to default, settings changed by automation - if (_detalhes.CheckSwitchOnLogon and _detalhes.tabela_instancias and _detalhes.tabela_instancias[1] and getmetatable(_detalhes.tabela_instancias[1])) then + if (Details.CheckSwitchOnLogon and Details.tabela_instancias and Details.tabela_instancias[1] and getmetatable(Details.tabela_instancias[1])) then tinsert(_detalhes_global.exit_log, "4 - Reversing switches.") currentStep = "Check Switch on Logon" - xpcall(_detalhes.CheckSwitchOnLogon, logSaverError) + xpcall(Details.CheckSwitchOnLogon, logSaverError) end --user requested a wipe of the full configuration - if (_detalhes.wipe_full_config) then + if (Details.wipe_full_config) then tinsert(_detalhes_global.exit_log, "5 - Is a full config wipe.") addToExitErrors("true: _detalhes.wipe_full_config") _detalhes_global = nil @@ -5952,11 +5952,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --save the config tinsert(_detalhes_global.exit_log, "6 - Saving Config.") currentStep = "Saving Config" - xpcall(_detalhes.SaveConfig, logSaverError) + xpcall(Details.SaveConfig, logSaverError) tinsert(_detalhes_global.exit_log, "7 - Saving Profiles.") currentStep = "Saving Profile" - xpcall(_detalhes.SaveProfile, logSaverError) + xpcall(Details.SaveProfile, logSaverError) --save the nicktag cache tinsert(_detalhes_global.exit_log, "8 - Saving nicktag cache.") @@ -5972,7 +5972,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local eraNamedSpellsToID = {} -- ~parserstart ~startparser ~cleu ~parser - function _detalhes.OnParserEvent() + function Details.OnParserEvent() local time, token, hidding, who_serial, who_name, who_flags, who_flags2, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12 = CombatLogGetCurrentEventInfo() local func = token_list[token] @@ -5981,7 +5981,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - function _detalhes.OnParserEventClassicEra() + function Details.OnParserEventClassicEra() local time, token, hidding, who_serial, who_name, who_flags, who_flags2, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12 = CombatLogGetCurrentEventInfo() local func = token_list[token] @@ -6025,24 +6025,24 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ["SPELL_RESURRECT"] = true, ["SPELL_INTERRUPT"] = true, } - _detalhes.parser_frame:SetScript("OnEvent", _detalhes.OnParserEventClassicEra) + Details.parser_frame:SetScript("OnEvent", Details.OnParserEventClassicEra) else - _detalhes.parser_frame:SetScript("OnEvent", _detalhes.OnParserEvent) + Details.parser_frame:SetScript("OnEvent", Details.OnParserEvent) end - function _detalhes:UpdateParser() - _tempo = _detalhes._tempo + function Details:UpdateParser() + _tempo = Details._tempo end - function _detalhes:UpdatePetsOnParser() - container_pets = _detalhes.tabela_pets.pets + function Details:UpdatePetsOnParser() + container_pets = Details.tabela_pets.pets end function Details:GetActorFromCache(value) return damage_cache[value] or damage_cache_pets[value] or damage_cache_petsOwners[value] end - function _detalhes:PrintParserCacheIndexes() + function Details:PrintParserCacheIndexes() local amount = 0 for n, nn in pairs(damage_cache) do amount = amount + 1 @@ -6078,19 +6078,19 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 amount = amount + 1 end print("parser misc_cache", amount) - print("group damage", #_detalhes.cache_damage_group) - print("group damage", #_detalhes.cache_healing_group) + print("group damage", #Details.cache_damage_group) + print("group damage", #Details.cache_healing_group) end - function _detalhes:GetActorsOnDamageCache() - return _detalhes.cache_damage_group + function Details:GetActorsOnDamageCache() + return Details.cache_damage_group end - function _detalhes:GetActorsOnHealingCache() - return _detalhes.cache_healing_group + function Details:GetActorsOnHealingCache() + return Details.cache_healing_group end - function _detalhes:ClearParserCache() --~wipe + function Details:ClearParserCache() --~wipe Details:Destroy(damage_cache) Details:Destroy(damage_cache_pets) Details:Destroy(damage_cache_petsOwners) @@ -6177,17 +6177,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end - damage_cache = setmetatable({}, _detalhes.weaktable) - damage_cache_pets = setmetatable({}, _detalhes.weaktable) - damage_cache_petsOwners = setmetatable({}, _detalhes.weaktable) + damage_cache = setmetatable({}, Details.weaktable) + damage_cache_pets = setmetatable({}, Details.weaktable) + damage_cache_petsOwners = setmetatable({}, Details.weaktable) - healing_cache = setmetatable({}, _detalhes.weaktable) + healing_cache = setmetatable({}, Details.weaktable) - energy_cache = setmetatable({}, _detalhes.weaktable) + energy_cache = setmetatable({}, Details.weaktable) - misc_cache = setmetatable({}, _detalhes.weaktable) - misc_cache_pets = setmetatable({}, _detalhes.weaktable) - misc_cache_petsOwners = setmetatable({}, _detalhes.weaktable) + misc_cache = setmetatable({}, Details.weaktable) + misc_cache_pets = setmetatable({}, Details.weaktable) + misc_cache_petsOwners = setmetatable({}, Details.weaktable) end function parser:RevomeActorFromCache(actor_serial, actor_name) @@ -6214,14 +6214,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - function _detalhes:UptadeRaidMembersCache() + function Details:UptadeRaidMembersCache() Details:Destroy(raid_members_cache) Details:Destroy(tanks_members_cache) Details:Destroy(auto_regen_cache) Details:Destroy(bitfield_swap_cache) Details:Destroy(empower_cache) - local groupRoster = _detalhes.tabela_vigente.raid_roster + local groupRoster = Details.tabela_vigente.raid_roster if (IsInRaid()) then local unitIdCache = Details222.UnitIdCache.Raid @@ -6243,8 +6243,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 tanks_members_cache[unitGUID] = true end - if (auto_regen_power_specs[_detalhes.cached_specs[unitGUID]]) then - auto_regen_cache[unitName] = auto_regen_power_specs[_detalhes.cached_specs[unitGUID]] + if (auto_regen_power_specs[Details.cached_specs[unitGUID]]) then + auto_regen_cache[unitName] = auto_regen_power_specs[Details.cached_specs[unitGUID]] end end @@ -6264,8 +6264,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 tanks_members_cache[unitGUID] = true end - if (auto_regen_power_specs[_detalhes.cached_specs[unitGUID]]) then - auto_regen_cache[unitName] = auto_regen_power_specs[_detalhes.cached_specs[unitGUID]] + if (auto_regen_power_specs[Details.cached_specs[unitGUID]]) then + auto_regen_cache[unitName] = auto_regen_power_specs[Details.cached_specs[unitGUID]] end end @@ -6281,8 +6281,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 tanks_members_cache[playerGUID] = true end - if (auto_regen_power_specs[_detalhes.cached_specs[playerGUID]]) then - auto_regen_cache[playerName] = auto_regen_power_specs[_detalhes.cached_specs[playerGUID]] + if (auto_regen_power_specs[Details.cached_specs[playerGUID]]) then + auto_regen_cache[playerName] = auto_regen_power_specs[Details.cached_specs[playerGUID]] end else local playerName = GetUnitName("player", true) @@ -6295,16 +6295,16 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (role == "TANK") then tanks_members_cache[playerGUID] = true else - local spec = DetailsFramework.GetSpecialization() + local spec = detailsFramework.GetSpecialization() if (spec and spec ~= 0) then - if (DetailsFramework.GetSpecializationRole (spec) == "TANK") then + if (detailsFramework.GetSpecializationRole (spec) == "TANK") then tanks_members_cache[playerGUID] = true end end end - if (auto_regen_power_specs[_detalhes.cached_specs[playerGUID]]) then - auto_regen_cache[playerName] = auto_regen_power_specs[_detalhes.cached_specs[playerGUID]] + if (auto_regen_power_specs[Details.cached_specs[playerGUID]]) then + auto_regen_cache[playerName] = auto_regen_power_specs[Details.cached_specs[playerGUID]] end end @@ -6315,9 +6315,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 table.sort(orderNames, function(name1, name2) return string.len(name1) > string.len(name2) end) - _detalhes.tabela_vigente.raid_roster_indexed = orderNames + Details.tabela_vigente.raid_roster_indexed = orderNames - if (_detalhes.iam_a_tank) then + if (Details.iam_a_tank) then tanks_members_cache[UnitGUID("player")] = true end end @@ -6343,17 +6343,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end --serach key: ~cache - function _detalhes:UpdateParserGears() + function Details:UpdateParserGears() --refresh combat tables - _current_combat = _detalhes.tabela_vigente + _current_combat = Details.tabela_vigente --last events pointer last_events_cache = _current_combat.player_last_events - _amount_of_last_events = _detalhes.deadlog_events + _amount_of_last_events = Details.deadlog_events - _use_shield_overheal = _detalhes.parser_options.shield_overheal - _is_activity_time = _detalhes.time_type == 1 - shield_spellid_cache = _detalhes.shield_spellid_cache + _use_shield_overheal = Details.parser_options.shield_overheal + _is_activity_time = Details.time_type == 1 + shield_spellid_cache = Details.shield_spellid_cache --refresh total containers _current_total = _current_combat.totals @@ -6370,17 +6370,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --_recording_healing = _detalhes.RecordHealingDone --can be deprecated --_recording_took_damage = _detalhes.RecordRealTimeTookDamage --_recording_ability_with_buffs = _detalhes.RecordPlayerAbilityWithBuffs --can be deprecated - _in_combat = _detalhes.in_combat + _in_combat = Details.in_combat Details:Destroy(ignored_npcids) --fill it with the default npcs ignored - for npcId in pairs(_detalhes.default_ignored_npcs) do + for npcId in pairs(Details.default_ignored_npcs) do ignored_npcids[npcId] = true end --fill it with the npcs the user ignored - for npcId in pairs(_detalhes.npcid_ignored) do + for npcId in pairs(Details.npcid_ignored) do ignored_npcids[npcId] = true end ignored_npcids[0] = nil @@ -6398,36 +6398,36 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - if (_detalhes.hooks["HOOK_COOLDOWN"].enabled) then + if (Details.hooks["HOOK_COOLDOWN"].enabled) then _hook_cooldowns = true else _hook_cooldowns = false end - if (_detalhes.hooks["HOOK_DEATH"].enabled) then + if (Details.hooks["HOOK_DEATH"].enabled) then _hook_deaths = true else _hook_deaths = false end - if (_detalhes.hooks["HOOK_BATTLERESS"].enabled) then + if (Details.hooks["HOOK_BATTLERESS"].enabled) then _hook_battleress = true else _hook_battleress = false end - if (_detalhes.hooks["HOOK_INTERRUPT"].enabled) then + if (Details.hooks["HOOK_INTERRUPT"].enabled) then _hook_interrupt = true else _hook_interrupt = false end - is_using_spellId_override = _detalhes.override_spellids + is_using_spellId_override = Details.override_spellids - return _detalhes:ClearParserCache() + return Details:ClearParserCache() end - function _detalhes.DumpIgnoredNpcs() + function Details.DumpIgnoredNpcs() return ignored_npcids end @@ -6542,34 +6542,34 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --battleground parser - _detalhes.pvp_parser_frame:SetScript("OnEvent", function(self, event) + Details.pvp_parser_frame:SetScript("OnEvent", function(self, event) self:ReadPvPData() end) - function _detalhes:BgScoreUpdate() + function Details:BgScoreUpdate() RequestBattlefieldScoreData() end --start the virtual parser - function _detalhes.pvp_parser_frame:StartBgUpdater() - _detalhes.pvp_parser_frame:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") + function Details.pvp_parser_frame:StartBgUpdater() + Details.pvp_parser_frame:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") - if (_detalhes.pvp_parser_frame.ticker) then - Details.Schedules.Cancel(_detalhes.pvp_parser_frame.ticker) + if (Details.pvp_parser_frame.ticker) then + Details.Schedules.Cancel(Details.pvp_parser_frame.ticker) end - _detalhes.pvp_parser_frame.ticker = Details.Schedules.NewTicker(10, Details.BgScoreUpdate) - Details.Schedules.SetName(_detalhes.pvp_parser_frame.ticker, "Battleground Updater") + Details.pvp_parser_frame.ticker = Details.Schedules.NewTicker(10, Details.BgScoreUpdate) + Details.Schedules.SetName(Details.pvp_parser_frame.ticker, "Battleground Updater") end --stop the virtual parser - function _detalhes.pvp_parser_frame:StopBgUpdater() - _detalhes.pvp_parser_frame:UnregisterEvent("UPDATE_BATTLEFIELD_SCORE") - Details.Schedules.Cancel(_detalhes.pvp_parser_frame.ticker) - _detalhes.pvp_parser_frame.ticker = nil + function Details.pvp_parser_frame:StopBgUpdater() + Details.pvp_parser_frame:UnregisterEvent("UPDATE_BATTLEFIELD_SCORE") + Details.Schedules.Cancel(Details.pvp_parser_frame.ticker) + Details.pvp_parser_frame.ticker = nil end - function _detalhes.pvp_parser_frame:ReadPvPData() + function Details.pvp_parser_frame:ReadPvPData() local players = GetNumBattlefieldScores() for i = 1, players do @@ -6581,10 +6581,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end --damage done - local actor = _detalhes.tabela_vigente(1, name) + local actor = Details.tabela_vigente(1, name) if (actor) then if (damageDone == 0) then - damageDone = damageDone + _detalhes:GetOrderNumber() + damageDone = damageDone + Details:GetOrderNumber() end actor.total = damageDone actor.classe = classToken or "UNKNOW" @@ -6593,14 +6593,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local guid = UnitGUID(name) if (guid) then local flag - if (_detalhes.faction_id == faction) then --is from the same faction + if (Details.faction_id == faction) then --is from the same faction flag = 0x514 else flag = 0x548 end actor = _current_damage_container:PegarCombatente (guid, name, flag, true) - actor.total = _detalhes:GetOrderNumber() + actor.total = Details:GetOrderNumber() actor.classe = classToken or "UNKNOW" if (flag == 0x548) then @@ -6611,10 +6611,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end --healing done - local actor = _detalhes.tabela_vigente(2, name) + local actor = Details.tabela_vigente(2, name) if (actor) then if (healingDone == 0) then - healingDone = healingDone + _detalhes:GetOrderNumber() + healingDone = healingDone + Details:GetOrderNumber() end actor.total = healingDone actor.classe = classToken or "UNKNOW" @@ -6623,14 +6623,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local guid = UnitGUID(name) if (guid) then local flag - if (_detalhes.faction_id == faction) then --is from the same faction + if (Details.faction_id == faction) then --is from the same faction flag = 0x514 else flag = 0x548 end actor = _current_heal_container:PegarCombatente (guid, name, flag, true) - actor.total = _detalhes:GetOrderNumber() + actor.total = Details:GetOrderNumber() actor.classe = classToken or "UNKNOW" if (flag == 0x548) then diff --git a/functions/loaddata.lua b/functions/loaddata.lua index 809b067b..f6c07710 100644 --- a/functions/loaddata.lua +++ b/functions/loaddata.lua @@ -132,7 +132,7 @@ function Details222.LoadSavedVariables.CombatSegments() --if can just clear all data and exit if (bShouldClearAndExit) then - Details.tabela_historico = Details.historico:NovoHistorico() + Details.tabela_historico = Details.historico:CreateNewSegmentDatabase() Details.tabela_overall = Details.combate:NovaTabela() Details.tabela_vigente = Details.combate:NovaTabela(_, Details.tabela_overall) Details.tabela_pets = Details.container_pets:NovoContainer() diff --git a/functions/mixin.lua b/functions/mixin.lua index dd1b08ac..4252d375 100644 --- a/functions/mixin.lua +++ b/functions/mixin.lua @@ -4,8 +4,13 @@ local detailsFramework = _G.DetailsFramework local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0", true) local addonName, Details222 = ... +local bitBand = bit.band + +local CONST_OBJECT_TYPE_PLAYER = 0x00000400 +local CONST_OBJECT_TYPE_NEUTRAL_OR_ENEMY = 0x00000060 + local actorSpellContainers = { - "debuff", "buff", "spell", "cooldowns", "crowdcontrol" + "debuff", "buff", "spell", "cooldowns", "crowdcontrol", "dispel" } Details222.Mixins.ActorMixin = { @@ -145,6 +150,45 @@ Details222.Mixins.ActorMixin = { return result end, + ---return true if the actor is controlled by a player + ---@param actorObject actor + ---@return boolean + IsPlayer = function(actorObject) + if (actorObject.flag_original) then + if (bitBand(actorObject.flag_original, CONST_OBJECT_TYPE_PLAYER) ~= 0) then + return true + end + end + return false + end, + ---return true if the actor is a pet or guardian + ---@param actorObject actor + ---@return boolean + IsPetOrGuardian = function(actorObject) + return actorObject.owner and true or false + end, + ---return true if the actor is or was in the player group + ---@param actorObject table + ---@return boolean + IsGroupPlayer = function(actorObject) + return actorObject.grupo and true or false + end, + + ---return true if the actor is an enemy of neutral npc + ---@param actorObject actor + ---@return boolean + IsNeutralOrEnemy = function(actorObject) + if (actorObject.flag_original) then + if (bitBand(actorObject.flag_original, CONST_OBJECT_TYPE_NEUTRAL_OR_ENEMY) ~= 0) then + local npcId = Details:GetNpcIdFromGuid(actorObject.serial) + if (Details.IgnoredEnemyNpcsTable[npcId]) then + return false + end + return true + end + end + return false + end, } \ No newline at end of file diff --git a/locales/Details-enUSS.lua b/locales/Details-enUSS.lua deleted file mode 100644 index f2cdbe82..00000000 --- a/locales/Details-enUSS.lua +++ /dev/null @@ -1,6 +0,0 @@ -local L = LibStub("AceLocale-3.0"):NewLocale ("Details", "enUS", true) -if not L then return end - --------------------------------------------------------------------------------------------------------------------------------------------- - -@localization(locale="enUS", format="lua_additive_table")@ \ No newline at end of file