Replacing table.wipe with Details:Destroy()

This commit is contained in:
Tercio Jose
2023-05-22 15:31:29 -03:00
parent fa0d1e1d08
commit 0cdfa2b900
40 changed files with 1205 additions and 1322 deletions
+3
View File
@@ -159,6 +159,7 @@
---@field EnableMouseWheel fun(self: frame, enable: boolean)
---@field RegisterForDrag fun(self: frame, button: string)
---@field SetResizeBounds fun(self: frame, minWidth: number, minHeight: number, maxWidth: number, maxHeight: number)
---@field RegisterEvent fun(self: frame, event: string)
---@class button : frame
---@field Click fun(self: button)
@@ -357,6 +358,8 @@
---@field GetTotalOnRaid fun(container: actorcontainer, key: string, combat: combat) get the total amount of actor[key] only for the actors which are in the raid
---@field GetActorTable fun(container: actorcontainer) get the table<actorIndex, actorObject> which contains the actors
---@field ListActors fun(container: actorcontainer) usage: for index, actorObject in container:ListActors() do
---@field RemoveActor fun(container: actorcontainer, actor: actor) remove an actor from the container
---@field GetType fun(container: actorcontainer) : number get the container type, 1 for damage, 2 for heal, 3 for energy, 4 for utility
---@class spellcontainer : table
---@field _ActorTable table store [spellId] = spelltable
+101 -117
View File
@@ -20,7 +20,7 @@
Details.dont_open_news = true
Details.game_version = version
Details.userversion = version .. " " .. Details.build_counter
Details.realversion = 151 --core version, this is used to check API version for scripts and plugins (see alias below)
Details.realversion = 152 --core version, this is used to check API version for scripts and plugins (see alias below)
Details.APIVersion = Details.realversion --core version
Details.version = Details.userversion .. " (core " .. Details.realversion .. ")" --simple stirng to show to players
@@ -1218,8 +1218,6 @@ function Details222.PlayerStats:SetStat(statName, value)
Details.player_stats[statName] = value
end
---destroy a table and remove it from the object, if the key isn't passed, the object itself is destroyed
---@param object any
---@param key string|nil
@@ -1240,133 +1238,119 @@ function Details:Destroy(object, key)
end
end
---destroy an actor within a combat object, this call will
---destroy the actor, also calls container:RemoveActor(actor)
---@param self details
---@param actorObject actor
---@param actorContainer actorcontainer
---@param combatObject combat
function Details:DestroyActor(actorObject, combatObject)
--using low level api here for performance
---@type actor[]
local allActors = {}
function Details:DestroyActor(actorObject, actorContainer, combatObject)
local containerType = actorContainer:GetType()
local combatTotalsTable = combatObject.totals[containerType] --without group
local combatTotalsTableInGroup = combatObject.totals_grupo[containerType] --with group
for containerType = 1, 4 do
local index = combatObject[containerType]._NameIndexTable[actorObject.nome]
if (index) then
---@type actor
local actor = combatObject[containerType]._ActorTable[index]
if (containerType == 1 or containerType == 2) then --damage|healing done
combatTotalsTable = combatTotalsTable - actorObject.total
if (actorObject.grupo) then
combatTotalsTableInGroup = combatTotalsTableInGroup - actorObject.total
end
if (actor) then
allActors[#allActors+1] = actor
elseif (containerType == 3) then
if (actorObject.total and actorObject.total > 0) then
if (actorObject.powertype) then
combatTotalsTable[actorObject.powertype] = combatTotalsTable[actorObject.powertype] - actorObject.total
combatTotalsTableInGroup[actorObject.powertype] = combatTotalsTableInGroup[actorObject.powertype] - actorObject.total
end
end
if (actorObject.alternatepower and actorObject.alternatepower > 0) then
combatTotalsTable.alternatepower = combatTotalsTable.alternatepower - actorObject.alternatepower
combatTotalsTableInGroup.alternatepower = combatTotalsTableInGroup.alternatepower - actorObject.alternatepower
end
--need to reduce the amount done by the actor from the combatObject
local combatTotalsTable = combatObject.totals --without group
local combatTotalsTableInGroup = combatObject.totals_grupo --with group
elseif (containerType == 4) then
--decrease the amount of CC break from the combat totals
if (actorObject.cc_break and actorObject.cc_break > 0) then
if (combatTotalsTable.cc_break) then
combatTotalsTable.cc_break = combatTotalsTable.cc_break - actorObject.cc_break
end
if (combatTotalsTableInGroup.cc_break) then
combatTotalsTableInGroup.cc_break = combatTotalsTableInGroup.cc_break - actorObject.cc_break
end
end
if (containerType == 1 or containerType == 2) then --damage|healing done
combatTotalsTable[containerType] = combatTotalsTable[containerType] - actor.total
if (actor.grupo) then
combatTotalsTableInGroup[containerType] = combatTotalsTableInGroup[containerType] - actor.total
end
--decrease the amount of dispell from the combat totals
if (actorObject.dispell and actorObject.dispell > 0) then
if (combatTotalsTable.dispell) then
combatTotalsTable.dispell = combatTotalsTable.dispell - actorObject.dispell
end
if (combatTotalsTableInGroup.dispell) then
combatTotalsTableInGroup.dispell = combatTotalsTableInGroup.dispell - actorObject.dispell
end
end
elseif (containerType == 3) then
if (actor.total and actor.total > 0) then
combatTotalsTable[containerType][actor.powertype] = combatTotalsTable[containerType][actor.powertype] - actor.total
combatTotalsTableInGroup[containerType][actor.powertype] = combatTotalsTableInGroup[containerType][actor.powertype] - actor.total
end
if (actor.alternatepower and actor.alternatepower > 0) then
combatTotalsTable[containerType].alternatepower = combatTotalsTable[containerType].alternatepower - actor.alternatepower
combatTotalsTableInGroup[containerType].alternatepower = combatTotalsTableInGroup[containerType].alternatepower - actor.alternatepower
end
--decrease the amount of interrupt from the combat totals
if (actorObject.interrupt and actorObject.interrupt > 0) then
if (combatTotalsTable.interrupt) then
combatTotalsTable.interrupt = combatTotalsTable.interrupt - actorObject.interrupt
end
if (combatTotalsTableInGroup.interrupt) then
combatTotalsTableInGroup.interrupt = combatTotalsTableInGroup.interrupt - actorObject.interrupt
end
end
elseif (containerType == 4) then
--decrease the amount of CC break from the combat totals
if (actor.cc_break and actor.cc_break > 0) then
if (combatTotalsTable[containerType].cc_break) then
combatTotalsTable[containerType].cc_break = combatTotalsTable[containerType].cc_break - actor.cc_break
end
if (combatTotalsTableInGroup[containerType].cc_break) then
combatTotalsTableInGroup[containerType].cc_break = combatTotalsTableInGroup[containerType].cc_break - actor.cc_break
end
end
--decrease the amount of ress from the combat totals
if (actorObject.ress and actorObject.ress > 0) then
if (combatTotalsTable.ress) then
combatTotalsTable.ress = combatTotalsTable.ress - actorObject.ress
end
if (combatTotalsTableInGroup.ress) then
combatTotalsTableInGroup.ress = combatTotalsTableInGroup.ress - actorObject.ress
end
end
--decrease the amount of dispell from the combat totals
if (actor.dispell and actor.dispell > 0) then
if (combatTotalsTable[containerType].dispell) then
combatTotalsTable[containerType].dispell = combatTotalsTable[containerType].dispell - actor.dispell
end
if (combatTotalsTableInGroup[containerType].dispell) then
combatTotalsTableInGroup[containerType].dispell = combatTotalsTableInGroup[containerType].dispell - actor.dispell
end
end
--decrease the amount of dead from the combat totals
if (actorObject.dead and actorObject.dead > 0) then
if (combatTotalsTable.dead) then
combatTotalsTable.dead = combatTotalsTable.dead - actorObject.dead
end
if (combatTotalsTableInGroup.dead) then
combatTotalsTableInGroup.dead = combatTotalsTableInGroup.dead - actorObject.dead
end
end
--decrease the amount of interrupt from the combat totals
if (actor.interrupt and actor.interrupt > 0) then
if (combatTotalsTable[containerType].interrupt) then
combatTotalsTable[containerType].interrupt = combatTotalsTable[containerType].interrupt - actor.interrupt
end
if (combatTotalsTableInGroup[containerType].interrupt) then
combatTotalsTableInGroup[containerType].interrupt = combatTotalsTableInGroup[containerType].interrupt - actor.interrupt
end
end
--decreate the amount of cooldowns used from the combat totals
if (actorObject.cooldowns_defensive and actorObject.cooldowns_defensive > 0) then
if (combatTotalsTable.cooldowns_defensive) then
combatTotalsTable.cooldowns_defensive = combatTotalsTable.cooldowns_defensive - actorObject.cooldowns_defensive
end
if (combatTotalsTableInGroup.cooldowns_defensive) then
combatTotalsTableInGroup.cooldowns_defensive = combatTotalsTableInGroup.cooldowns_defensive - actorObject.cooldowns_defensive
end
end
--decrease the amount of ress from the combat totals
if (actor.ress and actor.ress > 0) then
if (combatTotalsTable[containerType].ress) then
combatTotalsTable[containerType].ress = combatTotalsTable[containerType].ress - actor.ress
end
if (combatTotalsTableInGroup[containerType].ress) then
combatTotalsTableInGroup[containerType].ress = combatTotalsTableInGroup[containerType].ress - actor.ress
end
end
--decrease the amount of buff uptime from the combat totals
if (actorObject.buff_uptime and actorObject.buff_uptime > 0) then
if (combatTotalsTable.buff_uptime) then
combatTotalsTable.buff_uptime = combatTotalsTable.buff_uptime - actorObject.buff_uptime
end
if (combatTotalsTableInGroup.buff_uptime) then
combatTotalsTableInGroup.buff_uptime = combatTotalsTableInGroup.buff_uptime - actorObject.buff_uptime
end
end
--decrease the amount of dead from the combat totals
if (actor.dead and actor.dead > 0) then
if (combatTotalsTable[containerType].dead) then
combatTotalsTable[containerType].dead = combatTotalsTable[containerType].dead - actor.dead
end
if (combatTotalsTableInGroup[containerType].dead) then
combatTotalsTableInGroup[containerType].dead = combatTotalsTableInGroup[containerType].dead - actor.dead
end
end
--decreate the amount of cooldowns used from the combat totals
if (actor.cooldowns_defensive and actor.cooldowns_defensive > 0) then
if (combatTotalsTable[containerType].cooldowns_defensive) then
combatTotalsTable[containerType].cooldowns_defensive = combatTotalsTable[containerType].cooldowns_defensive - actor.cooldowns_defensive
end
if (combatTotalsTableInGroup[containerType].cooldowns_defensive) then
combatTotalsTableInGroup[containerType].cooldowns_defensive = combatTotalsTableInGroup[containerType].cooldowns_defensive - actor.cooldowns_defensive
end
end
--decrease the amount of buff uptime from the combat totals
if (actor.buff_uptime and actor.buff_uptime > 0) then
if (combatTotalsTable[containerType].buff_uptime) then
combatTotalsTable[containerType].buff_uptime = combatTotalsTable[containerType].buff_uptime - actor.buff_uptime
end
if (combatTotalsTableInGroup[containerType].buff_uptime) then
combatTotalsTableInGroup[containerType].buff_uptime = combatTotalsTableInGroup[containerType].buff_uptime - actor.buff_uptime
end
end
--decrease the amount of debuff uptime from the combat totals
if (actor.debuff_uptime and actor.debuff_uptime > 0) then
if (combatTotalsTable[containerType].debuff_uptime) then
combatTotalsTable[containerType].debuff_uptime = combatTotalsTable[containerType].debuff_uptime - actor.debuff_uptime
end
if (combatTotalsTableInGroup[containerType].debuff_uptime) then
combatTotalsTableInGroup[containerType].debuff_uptime = combatTotalsTableInGroup[containerType].debuff_uptime - actor.debuff_uptime
end
end
end
for i = 1, #allActors do
local thisActor = allActors[i]
setmetatable(thisActor, nil)
thisActor.__index = nil
thisActor.__newindex = nil
Details:Destroy(thisActor)
end
--decrease the amount of debuff uptime from the combat totals
if (actorObject.debuff_uptime and actorObject.debuff_uptime > 0) then
if (combatTotalsTable.debuff_uptime) then
combatTotalsTable.debuff_uptime = combatTotalsTable.debuff_uptime - actorObject.debuff_uptime
end
if (combatTotalsTableInGroup.debuff_uptime) then
combatTotalsTableInGroup.debuff_uptime = combatTotalsTableInGroup.debuff_uptime - actorObject.debuff_uptime
end
end
end
setmetatable(actorObject, nil)
actorObject.__index = nil
actorObject.__newindex = nil
actorContainer:RemoveActor(actorObject)
Details:Destroy(actorObject)
end
+4 -4
View File
@@ -263,7 +263,7 @@
--check if is a spell target custom
if (custom_object:IsSpellTarget()) then
table.wipe(classCustom._TargetActorsProcessed)
Details:Destroy(classCustom._TargetActorsProcessed)
classCustom._TargetActorsProcessedAmt = 0
classCustom._TargetActorsProcessedTotal = 0
classCustom._TargetActorsProcessedTop = 0
@@ -736,8 +736,8 @@
end
function classCustom:WipeCustomActorContainer()
table.wipe(self._ActorTable)
table.wipe(self._NameIndexTable)
Details:Destroy(self._ActorTable)
Details:Destroy(self._NameIndexTable)
end
function classCustom:GetValue (actor)
@@ -1071,7 +1071,7 @@
end
function _detalhes:ResetCustomFunctionsCache()
table.wipe(_detalhes.custom_function_cache)
Details:Destroy(_detalhes.custom_function_cache)
end
function _detalhes.refresh:r_atributo_custom()
+14 -14
View File
@@ -1874,7 +1874,7 @@ function damageClass:RefreshWindow(instancia, combatObject, forcar, exportar, re
elseif (keyName == "damage_taken_by_spells") then
local bs_index, total = 0, 0
wipe (bs_index_table)
Details:Destroy (bs_index_table)
local combat = combatObject
local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE)
@@ -2590,11 +2590,11 @@ end
local eventListener = Details:CreateEventListener()
eventListener:RegisterEvent("COMBAT_PLAYER_ENTER", function()
if (Details.CacheInLineMaxDistance) then
wipe(Details.CacheInLineMaxDistance)
Details:Destroy(Details.CacheInLineMaxDistance)
for i = 1, 10 do
C_Timer.After(i, function()
wipe(Details.CacheInLineMaxDistance)
Details:Destroy(Details.CacheInLineMaxDistance)
end)
end
end
@@ -4467,7 +4467,7 @@ end
end
local wipeSpellCache = function() --deprecated
table.wipe(Details222.PlayerBreakdown.DamageSpellsCache)
Details:Destroy(Details222.PlayerBreakdown.DamageSpellsCache)
end
local addToSpellCache = function(unitGUID, spellName, spellTable) --deprecated
@@ -5582,11 +5582,11 @@ function damageClass:MontaDetalhesDamageDone (spellId, spellLine, instance) --th
local index = 1
local data = data_table
table.wipe(t1)
table.wipe(t2)
table.wipe(t3)
table.wipe(t4)
table.wipe(data)
Details:Destroy(t1)
Details:Destroy(t2)
Details:Destroy(t3)
Details:Destroy(t4)
Details:Destroy(data)
--GERAL
local media = 0
@@ -6213,14 +6213,14 @@ end
end
if (bs_tooltip_table) then
wipe (bs_tooltip_table)
Details:Destroy (bs_tooltip_table)
end
if (frags_tooltip_table) then
wipe (frags_tooltip_table)
Details:Destroy (frags_tooltip_table)
end
wipe (bs_index_table)
wipe (tooltip_temp_table)
wipe (tooltip_void_zone_temp)
Details:Destroy (bs_index_table)
Details:Destroy (tooltip_temp_table)
Details:Destroy (tooltip_void_zone_temp)
end
--atualize a funcao de abreviacao
+5 -5
View File
@@ -2536,11 +2536,11 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra)
local index = 1
local data = data_table
table.wipe(t1)
table.wipe(t2)
table.wipe(t3)
table.wipe(t4)
table.wipe(data)
Details:Destroy(t1)
Details:Destroy(t2)
Details:Destroy(t3)
Details:Destroy(t4)
Details:Destroy(data)
if (esta_magia.total > 0) then
+1 -1
View File
@@ -547,7 +547,7 @@ local instanceMixins = {
}
---get the table with all instances, these instance could be not initialized yet, some might be open, some not in use
---@return table
---@return instance[]
function Details:GetAllInstances()
return Details.tabela_instancias
end
+1 -1
View File
@@ -417,7 +417,7 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia)
end
local default_len = _detalhes.fontstring_len:GetStringWidth()
wipe (report_table)
Details:Destroy (report_table)
local report_array = report_table
report_array[1] = {"Details! " .. Loc ["STRING_REPORT_SINGLE_DEATH"] .. " " .. morte [3] .. " " .. Loc ["STRING_ACTORFRAME_REPORTAT"] .. " " .. morte [6], "", "", ""}
+19 -1
View File
@@ -371,6 +371,13 @@ end
end
end
---return the actor type which is containing on this container
---@self actorcontainer
---@return number
function actorContainer:GetType()
return self.tipo
end
---return the actor object for a given actor name
---@param actorName string
---@return table|nil
@@ -1087,7 +1094,7 @@ end
Details:UpdatePetsOnParser()
end
function Details:ClearCCPetsBlackList()
table.wipe(petBlackList)
Details:Destroy(petBlackList)
end
function actorContainer:FuncaoDeCriacao (tipo)
@@ -1144,6 +1151,17 @@ end
return self:remapear()
end
---remove an actor from the container, by removing this way, the container does not need to be remapped
---@param self actorcontainer
---@param actorObject actor
function actorContainer:RemoveActor(actorObject)
local nameMap = self._NameIndexTable
local actorList = self._ActorTable
local actorIndex = nameMap[actorObject.nome]
nameMap[actorObject.nome] = nil --actorObject.nome a nil value | Details/boot.lua"]:1374: in function `DestroyActor' | meta.lua"]:590: in function `PrepareTablesForSave' | savedata.lua"]:86
table.remove(actorList, actorIndex)
end
function actorContainer:remapear()
local namingMap = self._NameIndexTable
local actorList = self._ActorTable
+2 -3
View File
@@ -16,7 +16,6 @@ local GetNumGroupMembers = _G.GetNumGroupMembers
local setmetatable = setmetatable
local _bit_band = bit.band --lua local
local pairs = pairs
local wipe = table.wipe
--details locals
local is_ignored = _detalhes.pets_ignored
@@ -210,7 +209,7 @@ end
function container_pets:Remover (pet_serial)
if (_detalhes.tabela_pets.pets [pet_serial]) then
table.wipe(_detalhes.tabela_pets.pets [pet_serial])
Details:Destroy(_detalhes.tabela_pets.pets [pet_serial])
end
_detalhes.tabela_pets.pets [pet_serial] = nil
end
@@ -224,7 +223,7 @@ function container_pets:Adicionar (pet_serial, pet_nome, pet_flags, dono_serial,
end
function _detalhes:WipePets()
return wipe(_detalhes.tabela_pets.pets)
return Details:Destroy(_detalhes.tabela_pets.pets)
end
function _detalhes:PetContainerCleanup()
+174 -161
View File
@@ -3,7 +3,6 @@ local Loc = LibStub("AceLocale-3.0"):GetLocale( "Details" )
--lua api
local tremove = table.remove
local tinsert = table.insert
local wipe = table.wipe
local Details = _G.Details
local _
@@ -74,7 +73,7 @@ function segmentClass:NovoHistorico()
return esta_tabela
end
function segmentClass:adicionar_overall (combatObject)
function segmentClass:adicionar_overall(combatObject)
local zoneName, zoneType = GetInstanceInfo()
if (zoneType ~= "none" and combatObject:GetCombatTime() <= Details.minimum_overall_combat_time) then
return
@@ -106,6 +105,7 @@ function segmentClass:adicionar_overall (combatObject)
if (mythicInfo.TrashOverallSegment) then
Details:Msg("error > attempt to add a TrashOverallSegment > func historico:adicionar_overall()")
return
elseif (mythicInfo.OverallSegment) then
Details:Msg("error > attempt to add a OverallSegment > func historico:adicionar_overall()")
return
@@ -158,7 +158,7 @@ function segmentClass:adicionar_overall (combatObject)
for id, instance in Details:ListInstances() do
if (instance:IsEnabled()) then
if (instance:GetSegment() == -1) then
if (instance:GetSegment() == DETAILS_SEGMENTID_OVERALL) then
instance:ForceRefresh()
end
end
@@ -243,233 +243,247 @@ function Details:CanAddCombatToOverall (tabela)
return false
end
--sai do combate, chamou adicionar a tabela ao histrico
function segmentClass:adicionar(tabela)
---add the combat to the segment table, check adding to overall
---@param combatObject combat
function segmentClass:adicionar(combatObject)
---@type combat[]
local segmentTable = self.tabelas
---@type number
local maxSegmentsAllowed = Details.segments_amount
local tamanho = #self.tabelas
--verifica se precisa dar UnFreeze()
if (tamanho < Details.segments_amount) then --vai preencher um novo index vazio
local ultima_tabela = self.tabelas[tamanho]
if (not ultima_tabela) then --no ha tabelas no historico, esta ser a #1
--pega a tabela do combate atual
ultima_tabela = tabela
--check all instances for freeze state
if (#segmentTable < maxSegmentsAllowed) then
---@type combat
local oldestCombatObject = segmentTable[#segmentTable]
--if there's no segment stored, then this as the first segment
if (not oldestCombatObject) then
oldestCombatObject = combatObject
end
Details:InstanciaCallFunction(Details.CheckFreeze, tamanho+1, ultima_tabela)
Details:InstanciaCallFunction(Details.CheckFreeze, #segmentTable + 1, oldestCombatObject)
end
--add to history table
tinsert(self.tabelas, 1, tabela)
--add to the first index of the segment table
tinsert(segmentTable, 1, combatObject)
--count boss tries
local boss = tabela.is_boss and tabela.is_boss.name
if (boss) then
local try_number = Details.encounter_counter [boss]
---@type string
local bossName = combatObject.is_boss and combatObject.is_boss.name
if (bossName) then
local tryNumber = Details.encounter_counter[bossName]
if (not try_number) then
local previous_combat
for i = 2, #self.tabelas do
previous_combat = self.tabelas [i]
if (previous_combat and previous_combat.is_boss and previous_combat.is_boss.name and previous_combat.is_boss.try_number and previous_combat.is_boss.name == boss and not previous_combat.is_boss.killed) then
try_number = previous_combat.is_boss.try_number + 1
if (not tryNumber) then
---@type combat
local previousCombatObject
for i = 2, #segmentTable do
previousCombatObject = segmentTable[i]
if (previousCombatObject and previousCombatObject.is_boss and previousCombatObject.is_boss.name and previousCombatObject.is_boss.try_number and previousCombatObject.is_boss.name == bossName and not previousCombatObject.is_boss.killed) then
tryNumber = previousCombatObject.is_boss.try_number + 1
break
end
end
if (not try_number) then
try_number = 1
if (not tryNumber) then
tryNumber = 1
end
else
try_number = Details.encounter_counter [boss] + 1
tryNumber = Details.encounter_counter[bossName] + 1
end
Details.encounter_counter [boss] = try_number
tabela.is_boss.try_number = try_number
Details.encounter_counter[bossName] = tryNumber
combatObject.is_boss.try_number = tryNumber
end
--see if can add the encounter to overall data
local canAddToOverall = Details:CanAddCombatToOverall(tabela)
local canAddToOverall = Details:CanAddCombatToOverall(combatObject)
if (canAddToOverall) then
--if (InCombatLockdown()) then
-- _detalhes:ScheduleAddCombatToOverall (tabela)
-- if (_detalhes.debug) then
-- _detalhes:Msg("(debug) overall data flag match > in combat scheduling overall addition.")
-- end
--else
if (Details.debug) then
Details:Msg("(debug) overall data flag match addind the combat to overall data.")
end
segmentClass:adicionar_overall (tabela)
--end
if (Details.debug) then
Details:Msg("(debug) overall data flag match addind the combat to overall data.")
end
segmentClass:adicionar_overall(combatObject)
end
--erase trash segments
if (self.tabelas[2]) then
local _segundo_combate = self.tabelas[2]
local container_damage = _segundo_combate [1]
local container_heal = _segundo_combate [2]
if (segmentTable[2]) then
---@type combat
local previousCombatObject = segmentTable[2]
---@type actorcontainer
local containerDamage = previousCombatObject:GetContainer(DETAILS_ATTRIBUTE_DAMAGE)
---@type actorcontainer
local containerHeal = previousCombatObject:GetContainer(DETAILS_ATTRIBUTE_HEAL)
--regular cleanup
for _, jogador in ipairs(container_damage._ActorTable) do
--remover a tabela de last events
jogador.last_events_table = nil
--verifica se ele ainda esta registrado na time machine
if (jogador.timeMachine) then
jogador:DesregistrarNaTimeMachine()
for _, actorObject in containerDamage:ListActors() do
---@cast actorObject actor
--clear last events table
actorObject.last_events_table = nil
--unregister from time machine
if (actorObject.timeMachine) then
actorObject:DesregistrarNaTimeMachine()
end
end
for _, jogador in ipairs(container_heal._ActorTable) do
--remover a tabela de last events
jogador.last_events_table = nil
--verifica se ele ainda esta registrado na time machine
if (jogador.timeMachine) then
jogador:DesregistrarNaTimeMachine()
for _, actorObject in containerHeal:ListActors() do
---@cast actorObject actor
--clear last events table
actorObject.last_events_table = nil
--unregister from time machine
if (actorObject.timeMachine) then
actorObject:DesregistrarNaTimeMachine()
end
end
if (Details.trash_auto_remove) then
local _terceiro_combate = self.tabelas[3]
---@type combat
local thirdCombat = segmentTable[3]
if (_terceiro_combate and not _terceiro_combate.is_mythic_dungeon_segment) then
if ((_terceiro_combate.is_trash and not _terceiro_combate.is_boss) or (_terceiro_combate.is_temporary)) then
--verificar novamente a time machine
for _, jogador in ipairs(_terceiro_combate [1]._ActorTable) do --damage
if (jogador.timeMachine) then
jogador:DesregistrarNaTimeMachine()
if (thirdCombat and not thirdCombat.is_mythic_dungeon_segment) 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
actorObject:DesregistrarNaTimeMachine()
end
end
for _, jogador in ipairs(_terceiro_combate [2]._ActorTable) do --heal
if (jogador.timeMachine) then
jogador:DesregistrarNaTimeMachine()
for _, actorObject in thirdCombat:GetContainer(DETAILS_ATTRIBUTE_HEAL):ListActors() do
if (actorObject.timeMachine) then
actorObject:DesregistrarNaTimeMachine()
end
end
--remover
tremove(self.tabelas, 3)
Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED", nil, nil)
--remove
tremove(segmentTable, 3)
Details:Destroy(thirdCombat)
Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED")
end
end
end
end
--verifica se precisa apagar a ltima tabela do histrico
if (#self.tabelas > Details.segments_amount) then
--check if the segment table is full
if (#segmentTable > maxSegmentsAllowed) then
---@type combat
local combatObjectRemoved
---@type number
local segmentIdRemoved
local combat_removed, combat_index
--verify if the last combat is a boss and if there's more bosses with the same bossId in the segment table
--then check which combat has the least amount of elapsed time and remove it
--won't remove the latest 3 segments as they are fresh and the player may still look into them
local bossId = combatObject.is_boss and combatObject.is_boss.id
--verifica se esto dando try em um boss e remove o combate menos relevante
local bossid = tabela.is_boss and tabela.is_boss.id
---@type combat
local oldestSegment = segmentTable[#segmentTable]
local oldestBossId = oldestSegment.is_boss and oldestSegment.is_boss.id
local last_segment = self.tabelas [#self.tabelas]
local last_bossid = last_segment.is_boss and last_segment.is_boss.id
if (Details.zone_type == "raid" and bossId and oldestBossId and bossId == oldestBossId) then
---@type combat
local shorterCombatObject
---@type number
local shorterSegmentId
local minTime = 99999
if (Details.zone_type == "raid" and bossid and last_bossid and bossid == last_bossid) then
local shorter_combat
local shorter_id
local min_time = 99999
for i = 4, #self.tabelas do
local combat = self.tabelas [i]
if (combat.is_boss and combat.is_boss.id == bossid and combat:GetCombatTime() < min_time and not combat.is_boss.killed) then
shorter_combat = combat
shorter_id = i
min_time = combat:GetCombatTime()
for segmentId = 4, #segmentTable do
---@type combat
local thisCombatObject = segmentTable[segmentId]
if (thisCombatObject.is_boss and thisCombatObject.is_boss.id == bossId and thisCombatObject:GetCombatTime() < minTime and not thisCombatObject.is_boss.killed) then
shorterCombatObject = thisCombatObject
shorterSegmentId = segmentId
minTime = thisCombatObject:GetCombatTime()
end
end
if (shorter_combat) then
combat_removed = shorter_combat
combat_index = shorter_id
if (shorterCombatObject) then
combatObjectRemoved = shorterCombatObject
segmentIdRemoved = shorterSegmentId
end
end
if (not combat_removed) then
combat_removed = self.tabelas [#self.tabelas]
combat_index = #self.tabelas
--if couldn't find a boss to remove, then remove the oldest segment
if (not combatObjectRemoved) then
combatObjectRemoved = segmentTable[#segmentTable]
segmentIdRemoved = #segmentTable
end
--verificar novamente a time machine
for _, jogador in ipairs(combat_removed [1]._ActorTable) do --damage
if (jogador.timeMachine) then
jogador:DesregistrarNaTimeMachine()
--check time machine
for _, actorObject in combatObjectRemoved:GetContainer(DETAILS_ATTRIBUTE_DAMAGE):ListActors() do
if (actorObject.timeMachine) then
actorObject:DesregistrarNaTimeMachine()
end
end
for _, jogador in ipairs(combat_removed [2]._ActorTable) do --heal
if (jogador.timeMachine) then
jogador:DesregistrarNaTimeMachine()
for _, actorObject in combatObjectRemoved:GetContainer(DETAILS_ATTRIBUTE_HEAL):ListActors() do
if (actorObject.timeMachine) then
actorObject:DesregistrarNaTimeMachine()
end
end
--remover
tremove(self.tabelas, combat_index)
--remove it
tremove(segmentTable, segmentIdRemoved)
Details:Destroy(combatObjectRemoved)
Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED")
end
--chama a funo que ir atualizar as instncias com segmentos no histrico
--update the combat shown on all instances
Details:InstanciaCallFunction(Details.AtualizaSegmentos_AfterCombat, self)
--_detalhes:InstanciaCallFunction(_detalhes.AtualizarJanela)
end
--verifica se tem alguma instancia congelada mostrando o segmento recm liberado
function Details:CheckFreeze (instancia, index_liberado, tabela)
if (instancia.freezed) then --esta congelada
if (instancia.segmento == index_liberado) then
instancia.showing = tabela
instancia:UnFreeze()
---verify if the instance is freezed, if true unfreeze it
---@param instanceObject instance
---@param segmentId number
---@param combatObject combat
function Details:CheckFreeze(instanceObject, segmentId, combatObject)
if (instanceObject.freezed) then
if (instanceObject:GetSegmentId() == segmentId) then
instanceObject:RefreshCombat()
instanceObject:UnFreeze()
end
end
end
function Details:SetOverallResetOptions (reset_new_boss, reset_new_challenge, reset_on_logoff, reset_new_pvp)
if (reset_new_boss == nil) then
reset_new_boss = Details.overall_clear_newboss
function Details:SetOverallResetOptions(resetOnNewBoss, resetOnNewChallenge, resetOnLogoff, resetOnNewPVP)
if (resetOnNewBoss == nil) then
resetOnNewBoss = Details.overall_clear_newboss
end
if (reset_new_challenge == nil) then
reset_new_challenge = Details.overall_clear_newchallenge
if (resetOnNewChallenge == nil) then
resetOnNewChallenge = Details.overall_clear_newchallenge
end
if (reset_on_logoff == nil) then
reset_on_logoff = Details.overall_clear_logout
if (resetOnLogoff == nil) then
resetOnLogoff = Details.overall_clear_logout
end
if (reset_new_pvp == nil) then
reset_new_pvp = Details.overall_clear_pvp
if (resetOnNewPVP == nil) then
resetOnNewPVP = Details.overall_clear_pvp
end
Details.overall_clear_newboss = reset_new_boss
Details.overall_clear_newchallenge = reset_new_challenge
Details.overall_clear_logout = reset_on_logoff
Details.overall_clear_pvp = reset_new_pvp
Details.overall_clear_newboss = resetOnNewBoss
Details.overall_clear_newchallenge = resetOnNewChallenge
Details.overall_clear_logout = resetOnLogoff
Details.overall_clear_pvp = resetOnNewPVP
end
function segmentClass:resetar_overall()
--if (InCombatLockdown()) then
-- _detalhes:Msg(Loc ["STRING_ERASE_IN_COMBAT"])
-- _detalhes.schedule_remove_overall = true
--else
--fecha a janela de informaes do jogador
Details:CloseBreakdownWindow()
Details:CloseBreakdownWindow()
Details.tabela_overall = combatClass:NovaTabela()
Details:Destroy(Details.tabela_overall)
Details.tabela_overall = combatClass:NovaTabela()
for index, instancia in ipairs(Details.tabela_instancias) do
if (instancia.ativa and instancia.segmento == -1) then
instancia:InstanceReset()
instancia:ReajustaGump()
for index, instanceObject in ipairs(Details:GetAllInstances()) do
if (instanceObject:IsEnabled()) then
local segmentId = instanceObject:GetSegmentId()
if (segmentId == DETAILS_SEGMENTID_OVERALL) then
instanceObject:InstanceReset()
instanceObject:ReajustaGump()
end
end
end
if (Details.schedule_add_to_overall) then --deprecated
wipe (Details.schedule_add_to_overall)
end
--end
if (Details.schedule_add_to_overall) then --deprecated
Details:Destroy(Details.schedule_add_to_overall)
end
--stop bar testing if any
Details:StopTestBarUpdate()
Details:ClockPluginTickOnSegment()
end
@@ -503,19 +517,21 @@ function segmentClass:resetar()
--empty temporary tables
Details.atributo_damage:ClearTempTables()
for _, combate in ipairs(Details.tabela_historico.tabelas) do
wipe(combate)
for _, combatObject in ipairs(Details.tabela_historico.tabelas) do
---@cast combatObject combat
Details:Destroy(combatObject)
end
wipe(Details.tabela_vigente)
wipe(Details.tabela_overall)
wipe(Details.spellcache)
Details:Destroy(Details.tabela_vigente)
Details:Destroy(Details.tabela_overall)
Details:Destroy(Details.spellcache)
if (Details.schedule_add_to_overall) then --deprecated
wipe (Details.schedule_add_to_overall)
Details:Destroy(Details.schedule_add_to_overall)
end
Details:PetContainerCleanup()
Details:ResetSpecCache (true) --forar
Details:ResetSpecCache(true)
-- novo container de historico
Details.tabela_historico = segmentClass:NovoHistorico() --joga fora a tabela antiga e cria uma nova
@@ -531,19 +547,16 @@ function segmentClass:resetar()
--marca o addon como fora de combate
Details.in_combat = false
--zera o contador de combates
Details:NumeroCombate (0)
Details:NumeroCombate(0)
--limpa o cache de magias
--clear caches
Details:ClearSpellCache()
--limpa a tabela de ShieldCache
wipe(Details.ShieldCache)
Details:Destroy(Details.ShieldCache)
Details:Destroy(Details.cache_damage_group)
Details:Destroy(Details.cache_healing_group)
--reinicia a time machine
timeMachine:Reiniciar()
wipe(Details.cache_damage_group)
wipe(Details.cache_healing_group)
Details:UpdateParserGears()
if (not InCombatLockdown() and not UnitAffectingCombat("player")) then
+12 -13
View File
@@ -12,7 +12,6 @@
local _math_max = math.max --lua local
local ipairs = ipairs --lua local
local pairs = pairs --lua local
local wipe = table.wipe --lua local
local bitBand = bit.band --lua local
local GetInstanceInfo = GetInstanceInfo --wow api local
@@ -358,14 +357,14 @@
Details:ClearCCPetsBlackList()
wipe(Details.encounter_end_table)
Details:Destroy(Details.encounter_end_table)
wipe(Details.pets_ignored)
wipe(Details.pets_no_owner)
Details:Destroy(Details.pets_ignored)
Details:Destroy(Details.pets_no_owner)
Details.container_pets:BuscarPets()
wipe(Details.cache_damage_group)
wipe(Details.cache_healing_group)
Details:Destroy(Details.cache_damage_group)
Details:Destroy(Details.cache_healing_group)
Details:UpdateParserGears()
--get all buff already applied before the combat start
@@ -878,11 +877,11 @@
Details.leaving_combat = false
Details:OnCombatPhaseChanged()
wipe(Details.tabela_vigente.PhaseData.damage_section)
wipe(Details.tabela_vigente.PhaseData.heal_section)
Details:Destroy(Details.tabela_vigente.PhaseData.damage_section)
Details:Destroy(Details.tabela_vigente.PhaseData.heal_section)
wipe(Details.cache_damage_group)
wipe(Details.cache_healing_group)
Details:Destroy(Details.cache_damage_group)
Details:Destroy(Details.cache_healing_group)
Details:UpdateParserGears()
@@ -899,7 +898,7 @@
--do not wipe the encounter table if is in the argus encounter ~REMOVE on 8.0
if (Details.encounter_table and Details.encounter_table.id ~= 2092) then
wipe(Details.encounter_table)
Details:Destroy(Details.encounter_table)
else
if (Details.debug) then
Details:Msg("(debug) in argus encounter, cannot wipe the encounter table.")
@@ -938,7 +937,7 @@
--enemies
local enemiesAmount = GetNumArenaOpponentSpecs and GetNumArenaOpponentSpecs() or 5
table.wipe(_detalhes.arena_enemies)
Details:Destroy(_detalhes.arena_enemies)
for i = 1, enemiesAmount do
local enemyName = _G.GetUnitName("arena" .. i, true)
@@ -1330,7 +1329,7 @@
--store pets sent through 'needpetowner'
Details.sent_pets = Details.sent_pets or {n = time()}
if (Details.sent_pets.n+20 < time()) then
wipe(Details.sent_pets)
Details:Destroy(Details.sent_pets)
Details.sent_pets.n = time()
end
+17 -18
View File
@@ -232,7 +232,8 @@ end
local statusbar_enabled1 = window1.show_statusbar
local statusbar_enabled2 = window2.show_statusbar
table.wipe(window1.snap); table.wipe(window2.snap)
Details:Destroy(window1.snap)
Details:Destroy(window2.snap)
window1.snap [3] = 2; window2.snap [1] = 1;
window1.horizontalSnap = true; window2.horizontalSnap = true
@@ -345,15 +346,13 @@ end
------------------------------------------------------------------------------------------------------------
function _detalhes:SetDeathLogLimit (limit)
function _detalhes:SetDeathLogLimit(limit)
if (limit and type(limit) == "number" and limit >= 8) then
_detalhes.deadlog_events = limit
local combat = _detalhes.tabela_vigente
local combatObject = Details:GetCurrentCombat()
local wipe = table.wipe
for player_name, event_table in pairs(combat.player_last_events) do
for player_name, event_table in pairs(combatObject.player_last_events) do
if (limit > #event_table) then
for i = #event_table + 1, limit do
event_table [i] = {}
@@ -361,7 +360,7 @@ function _detalhes:SetDeathLogLimit (limit)
else
event_table.n = 1
for _, t in ipairs(event_table) do
wipe (t)
Details:Destroy(t)
end
end
end
@@ -442,7 +441,7 @@ function _detalhes:ResetSpecCache (forced)
local isininstance = IsInInstance()
if (forced or (not isininstance and not _detalhes.in_group)) then
table.wipe(_detalhes.cached_specs)
Details:Destroy(_detalhes.cached_specs)
if (_detalhes.track_specs) then
local my_spec = DetailsFramework.GetSpecialization()
@@ -458,7 +457,7 @@ function _detalhes:ResetSpecCache (forced)
end
elseif (_detalhes.in_group and not isininstance) then
table.wipe(_detalhes.cached_specs)
Details:Destroy(_detalhes.cached_specs)
if (_detalhes.track_specs) then
if (IsInRaid()) then
@@ -1913,7 +1912,7 @@ end
--test
--/run _detalhes.ilevel:CalcItemLevel ("player", UnitGUID("player"), true)
--/run wipe (_detalhes.item_level_pool)
--/run wipe(_detalhes.item_level_pool)
function ilvl_core:CalcItemLevel (unitid, guid, shout)
@@ -2176,7 +2175,7 @@ function ilvl_core:QueryInspect (unitName, callback, param1)
end
function ilvl_core:ClearQueryInspectQueue()
wipe (ilvl_core.forced_inspects)
Details:Destroy (ilvl_core.forced_inspects)
ilvl_core.clear_queued_list = nil
end
@@ -3288,7 +3287,7 @@ function Details222.Cache.DoMaintenance()
if (currentTime > Details.latest_spell_pool_access + delay) then
local spellIdPoolBackup = DetailsFramework.table.copy({}, Details.spell_pool)
wipe(Details.spell_pool)
Details:Destroy(Details.spell_pool)
--preserve ignored spells spellId
for spellId in pairs(Details.spellid_ignored) do
@@ -3296,31 +3295,31 @@ function Details222.Cache.DoMaintenance()
end
Details.latest_spell_pool_access = currentTime
wipe(spellIdPoolBackup)
Details:Destroy(spellIdPoolBackup)
end
if (currentTime > Details.latest_npcid_pool_access + delay) then
local npcIdPoolBackup = DetailsFramework.table.copy({}, Details.npcid_pool)
wipe(Details.npcid_pool)
Details:Destroy(Details.npcid_pool)
--preserve ignored npcs npcId
for npcId in pairs (Details.npcid_ignored) do
Details.npcid_pool[npcId] = npcIdPoolBackup[npcId]
end
Details.latest_npcid_pool_access = currentTime
wipe(npcIdPoolBackup)
Details:Destroy(npcIdPoolBackup)
end
if (currentTime > Details.latest_encounter_spell_pool_access + delay) then
wipe(Details.encounter_spell_pool)
Details:Destroy(Details.encounter_spell_pool)
Details.latest_encounter_spell_pool_access = currentTime
end
if (Details.boss_mods_timers and Details.boss_mods_timers.latest_boss_mods_access) then
if (currentTime > Details.boss_mods_timers.latest_boss_mods_access + delay) then
wipe(Details.boss_mods_timers.encounter_timers_bw)
wipe(Details.boss_mods_timers.encounter_timers_dbm)
Details:Destroy(Details.boss_mods_timers.encounter_timers_bw)
Details:Destroy(Details.boss_mods_timers.encounter_timers_dbm)
Details.boss_mods_timers.latest_boss_mods_access = currentTime
end
end
+215 -228
View File
@@ -12,7 +12,6 @@
local setmetatable = setmetatable --lua local
local _table_remove = table.remove --lua local
local _bit_band = bit.band --lua local
local wipe = table.wipe --lua local
local _time = time --lua local
local _InCombatLockdown = InCombatLockdown --wow api local
@@ -21,21 +20,14 @@
local classHeal = Details.atributo_heal --details local
local classEnergy = Details.atributo_energy --details local
local classUtility = Details.atributo_misc --details local
local alvo_da_habilidade = Details.alvo_da_habilidade --details local
local habilidade_dano = Details.habilidade_dano --details local
local habilidade_cura = Details.habilidade_cura --details local
local container_habilidades = Details.container_habilidades --details local
local container_combatentes = Details.container_combatentes --details local
local container_damage_target = Details.container_type.CONTAINER_DAMAGETARGET_CLASS
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--constants
local class_type_dano = Details.atributos.dano
local class_type_cura = Details.atributos.cura
local class_type_e_energy = Details.atributos.e_energy
local class_type_misc = Details.atributos.misc
local classTypeDamage = Details.atributos.dano
local classTypeHeal = Details.atributos.cura
local classTypeEnergy = Details.atributos.e_energy
local classTypeUtility = Details.atributos.misc
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--core
@@ -44,9 +36,9 @@
---@param actorContainer actorcontainer
local fullRemap = function(actorContainer)
local namingMap = actorContainer._NameIndexTable
wipe(namingMap)
Details:Destroy(namingMap)
for i = 1, #actorContainer._ActorTable do
local actorName = actorContainer._ActorTable[i].nome
local actorName = actorContainer._ActorTable[i].nome --so the actor got wiped, but the actor table is still there but without any members
namingMap[actorName] = i
end
end
@@ -63,14 +55,14 @@
Details.refresh:r_combate (combate)
Details.refresh:r_container_combatentes (combate [class_type_dano])
Details.refresh:r_container_combatentes (combate [class_type_cura])
Details.refresh:r_container_combatentes (combate [class_type_e_energy])
Details.refresh:r_container_combatentes (combate [class_type_misc])
Details.refresh:r_container_combatentes (combate [classTypeDamage])
Details.refresh:r_container_combatentes (combate [classTypeHeal])
Details.refresh:r_container_combatentes (combate [classTypeEnergy])
Details.refresh:r_container_combatentes (combate [classTypeUtility])
Details.refresh:r_container_combatentes (combate [5]) --ghost container
local todos_atributos = {combate [class_type_dano]._ActorTable, combate [class_type_cura]._ActorTable, combate [class_type_e_energy]._ActorTable, combate [class_type_misc]._ActorTable}
local todos_atributos = {combate [classTypeDamage]._ActorTable, combate [classTypeHeal]._ActorTable, combate [classTypeEnergy]._ActorTable, combate [classTypeUtility]._ActorTable}
for class_type, atributo in ipairs(todos_atributos) do
for _, esta_classe in ipairs(atributo) do
@@ -84,16 +76,16 @@
esta_classe.displayName = nome
end
if (class_type == class_type_dano) then
if (class_type == classTypeDamage) then
Details.refresh:r_atributo_damage (esta_classe)
elseif (class_type == class_type_cura) then
elseif (class_type == classTypeHeal) then
Details.refresh:r_atributo_heal (esta_classe)
elseif (class_type == class_type_e_energy) then
elseif (class_type == classTypeEnergy) then
Details.refresh:r_atributo_energy (esta_classe)
elseif (class_type == class_type_misc) then
elseif (class_type == classTypeUtility) then
Details.refresh:r_atributo_misc (esta_classe)
end
end
@@ -110,19 +102,16 @@
--reaplica indexes e metatables
function Details:RestoreMetatables()
Details.refresh:r_atributo_custom()
--container de pets e histrico
Details.refresh:r_container_pets (Details.tabela_pets)
Details.refresh:r_historico (Details.tabela_historico)
--tabelas dos combates
local combate_overall = Details.tabela_overall
local overall_dano = combate_overall [class_type_dano] --damage atalho
local overall_cura = combate_overall [class_type_cura] --heal atalho
local overall_energy = combate_overall [class_type_e_energy] --energy atalho
local overall_misc = combate_overall [class_type_misc] --misc atalho
local overall_dano = combate_overall [classTypeDamage] --damage atalho
local overall_cura = combate_overall [classTypeHeal] --heal atalho
local overall_energy = combate_overall [classTypeEnergy] --energy atalho
local overall_misc = combate_overall [classTypeUtility] --misc atalho
local tabelas_do_historico = Details.tabela_historico.tabelas --atalho
@@ -183,10 +172,10 @@
end
--recupera a meta e indexes dos 4 container
Details.refresh:r_container_combatentes (combate [class_type_dano], overall_dano)
Details.refresh:r_container_combatentes (combate [class_type_cura], overall_cura)
Details.refresh:r_container_combatentes (combate [class_type_e_energy], overall_energy)
Details.refresh:r_container_combatentes (combate [class_type_misc], overall_misc)
Details.refresh:r_container_combatentes (combate [classTypeDamage], overall_dano)
Details.refresh:r_container_combatentes (combate [classTypeHeal], overall_cura)
Details.refresh:r_container_combatentes (combate [classTypeEnergy], overall_energy)
Details.refresh:r_container_combatentes (combate [classTypeUtility], overall_misc)
--ghost container
if (combate[5]) then
@@ -194,7 +183,7 @@
end
--tabela com os 4 tabelas de jogadores
local todos_atributos = {combate [class_type_dano]._ActorTable, combate [class_type_cura]._ActorTable, combate [class_type_e_energy]._ActorTable, combate [class_type_misc]._ActorTable}
local todos_atributos = {combate [classTypeDamage]._ActorTable, combate [classTypeHeal]._ActorTable, combate [classTypeEnergy]._ActorTable, combate [classTypeUtility]._ActorTable}
for class_type, atributo in ipairs(todos_atributos) do
for _, esta_classe in ipairs(atributo) do
@@ -211,28 +200,28 @@
local shadow
if (class_type == class_type_dano) then
if (class_type == classTypeDamage) then
if (combate.overall_added and not overall_saved) then
shadow = classDamage:r_connect_shadow (esta_classe)
else
shadow = classDamage:r_onlyrefresh_shadow (esta_classe)
end
elseif (class_type == class_type_cura) then
elseif (class_type == classTypeHeal) then
if (combate.overall_added and not overall_saved) then
shadow = classHeal:r_connect_shadow (esta_classe)
else
shadow = classHeal:r_onlyrefresh_shadow (esta_classe)
end
elseif (class_type == class_type_e_energy) then
elseif (class_type == classTypeEnergy) then
if (combate.overall_added and not overall_saved) then
shadow = classEnergy:r_connect_shadow (esta_classe)
else
shadow = classEnergy:r_onlyrefresh_shadow (esta_classe)
end
elseif (class_type == class_type_misc) then
elseif (class_type == classTypeUtility) then
if (combate.overall_added and not overall_saved) then
shadow = classUtility:r_connect_shadow (esta_classe)
else
@@ -370,18 +359,18 @@
function Details:DoOwnerCleanup()
---@type combat[]
local combats = Details.tabela_historico.tabelas or {}
local combatTables = Details.tabela_historico.tabelas or {}
local bOverallAdded
if (not Details.overall_clear_logout) then
tinsert(combats, Details.tabela_overall)
tinsert(combatTables, Details.tabela_overall)
bOverallAdded = true
end
for index, combat in ipairs(combats) do
for _, combat in ipairs(combatTables) do
---@cast combat combat
for index, actorContainer in ipairs(combat) do
for _, actorContainer in ipairs(combat) do
---@cast actorContainer actorcontainer
for index, actorObject in ipairs(actorContainer._ActorTable) do
for _, actorObject in ipairs(actorContainer._ActorTable) do
---@cast actorObject actor
actorObject.owner = nil
end
@@ -389,38 +378,41 @@
end
if (bOverallAdded) then
tremove(combats, #combats)
tremove(combatTables, #combatTables)
end
end
function Details:DoClassesCleanup()
---@type combat[]
local combats = Details.tabela_historico.tabelas or {}
local bOverallAdded
local combatTables = Details.tabela_historico.tabelas or {}
local bOverallAdded = false
if (not Details.overall_clear_logout) then
tinsert(combats, Details.tabela_overall)
--add the overall segment to the cleanup within the other segments
--it is removed after the cleanup
tinsert(combatTables, Details.tabela_overall)
bOverallAdded = true
end
for index, combatObject in ipairs(combats) do
for index, combatObject in ipairs(combatTables) do
---@cast combatObject combat
for classType, actorContainer in ipairs(combatObject) do
---@cast actorContainer actorcontainer
for index, actorObject in ipairs(actorContainer._ActorTable) do
for _, actorObject in ipairs(actorContainer._ActorTable) do --low level loop for performance
---@cast actorObject actor
actorObject.displayName = nil
actorObject.minha_barra = nil
if (classType == class_type_dano) then
if (classType == classTypeDamage) then
Details.clear:c_atributo_damage(actorObject)
elseif (classType == class_type_cura) then
elseif (classType == classTypeHeal) then
Details.clear:c_atributo_heal(actorObject)
elseif (classType == class_type_e_energy) then
elseif (classType == classTypeEnergy) then
Details.clear:c_atributo_energy(actorObject)
elseif (classType == class_type_misc) then
elseif (classType == classTypeUtility) then
Details.clear:c_atributo_misc(actorObject)
end
end
@@ -428,219 +420,214 @@
end
if (bOverallAdded) then
tremove(combats, #combats)
--remove the overall segment from the regular segments
tremove(combatTables, #combatTables)
end
end
function Details:DoContainerCleanup()
---@type combat[]
local combats = Details.tabela_historico.tabelas or {}
local combatTables = Details.tabela_historico.tabelas or {}
local bOverallAdded
if (not Details.overall_clear_logout) then
tinsert(combats, Details.tabela_overall)
tinsert(combatTables, Details.tabela_overall)
bOverallAdded = true
end
for index, combat in ipairs(combats) do
Details.clear:c_combate(combat)
for index, container in ipairs(combat) do
Details.clear:c_container_combatentes(container)
for _, combatObject in ipairs(combatTables) do
---@cast combatObject combat
Details.clear:c_combate(combatObject)
for _, actorContainer in ipairs(combatObject) do
---@cast actorContainer actorcontainer
Details.clear:c_container_combatentes(actorContainer)
end
end
if (bOverallAdded) then
tremove(combats, #combats)
tremove(combatTables, #combatTables)
end
end
function Details:DoContainerIndexCleanup()
---@type combat[]
local combats = Details.tabela_historico.tabelas or {}
local allSegments = Details.tabela_historico.tabelas or {}
local bOverallAdded
if (not Details.overall_clear_logout) then
tinsert(combats, Details.tabela_overall)
tinsert(allSegments, Details.tabela_overall)
bOverallAdded = true
end
for index, combat in ipairs(combats) do
for index, container in ipairs(combat) do
Details.clear:c_container_combatentes_index(container)
for _, combatObject in ipairs(allSegments) do
for _, actorContainer in ipairs(combatObject) do
Details.clear:c_container_combatentes_index(actorContainer)
end
end
if (bOverallAdded) then
tremove(combats, #combats)
tremove(allSegments, #allSegments)
end
end
--limpa indexes, metatables e shadows
function Details:PrepareTablesForSave()
Details.clear_ungrouped = true
function Details:PrepareTablesForSave()
Details.clear_ungrouped = true
--clear instances
Details:DoInstanceCleanup()
Details:DoClassesCleanup() --aumentou 1 combat
Details:DoContainerCleanup() --aumentou 1 combat
Details:DoInstanceCleanup() --checked
Details:DoClassesCleanup() --checked
Details:DoContainerCleanup() --checked
--clear combats
local combatTables = {}
---@type combat[]
local combatHistoryTable = Details.tabela_historico.tabelas or {}
---@type combat[]
local combatTables = {}
---@type combat[]
local allSegments = Details.tabela_historico.tabelas or {}
--remove os segmentos de trash
for i = #combatHistoryTable, 1, -1 do
---@type combat
local combateObject = combatHistoryTable[i]
if (combateObject:IsTrash()) then
table.remove(combatHistoryTable, i)
Details:Destroy(combatHistoryTable)
end
--remove segments marked as 'trash'
for i = #allSegments, 1, -1 do
---@type combat
local combatObject = allSegments[i]
if (combatObject:IsTrash()) then
table.remove(allSegments, i)
Details:Destroy(combatObject)
end
--remove os segmentos > que o limite permitido para salvar
if (Details.segments_amount_to_save and Details.segments_amount_to_save < Details.segments_amount) then
for i = Details.segments_amount, Details.segments_amount_to_save+1, -1 do
if (Details.tabela_historico.tabelas[i]) then
---@type combat
local combatObject = Details.tabela_historico.tabelas[i]
table.remove(Details.tabela_historico.tabelas, i)
Details:Destroy(combatObject)
end
end
end
--limpa a tabela overall
if (Details.overall_clear_logout) then
Details.tabela_overall = nil
_detalhes_database.tabela_overall = nil
else
---@type combat
local overallCombatObject = Details.tabela_overall
overallCombatObject.previous_combat = nil
---@type actorcontainer[]
local allAttributes = {
overallCombatObject[class_type_dano],
overallCombatObject[class_type_cura],
overallCombatObject[class_type_e_energy],
overallCombatObject[class_type_misc]
}
--this is a cleanup for overall data
if (Details.clear_ungrouped) then
--deal with actor which could potentially be removed from the database
for classType, actorContainer in ipairs(allAttributes) do
--get the actor table from the container, this table can be used
local actorTable = actorContainer:GetActorTable()
for i = #actorTable, 1, -1 do
---@type actor
local actorObject = actorTable[i]
if (actorObject.grupo and not actorObject.boss and not actorObject.boss_fight_component and not actorObject.fight_component and not actorObject.pvp_component and not actorObject.arena_enemy and not actorObject.enemy) then
--remove the actor from the container
table.remove(actorTable, i)
Details:DestroyActor(actorTable, overallCombatObject)
end
end
fullRemap(actorContainer)
end
end
--now deal with pets without owners
for classType, actorContainer in ipairs(allAttributes) do
--get the actor table from the container, this table can be used
local actorTable = actorContainer:GetActorTable()
for i = #actorTable, 1, -1 do
---@type actor
local actorObject = actorTable[i]
if (actorObject.owner) then
if (not actorObject.owner.serial) then
Details:DestroyActor(actorObject, overallCombatObject)
table.remove(actorTable, i)
end
end
end
fullRemap(actorContainer)
end
end
for i, combatObject in ipairs(combatHistoryTable) do
---@cast combatObject combat
combatTables[#combatTables+1] = combatObject
end
--this is a cleanup for combat stored in the segment list
for combatIndex, combatObject in ipairs(combatTables) do
--limpa a tabela do grafico
if (Details.clear_graphic) then
combatObject.TimeData = {}
end
--limpa a referencia do ultimo combate
combatObject.previous_combat = nil
local bIsBossEncounter = combatObject.is_boss
if (bIsBossEncounter) then
if (combatObject.pvp) then
bIsBossEncounter = false
end
end
if (not combatObject.is_mythic_dungeon_segment and Details.clear_ungrouped) then
for i = 1, DETAILS_COMBAT_AMOUNT_CONTAINERS do
---@type actorcontainer
local actorContainer = combatObject:GetContainer(i)
if (actorContainer) then
local actorTable = actorContainer:GetActorTable()
for o = #actorTable, 1, -1 do
local actorObject = actorTable[o]
if (not actorObject.grupo and not actorObject.boss and not actorObject.boss_fight_component and not bIsBossEncounter and not actorObject.pvp_component and not actorObject.fight_component) then
Details:DestroyActor(actorObject, combatObject)
table.remove(actorTable, o)
end
end
fullRemap(actorContainer)
for o = #actorTable, 1, -1 do
---@type actor
local actorObject = actorTable[o]
if (actorObject.owner) then
if (not actorObject.owner.serial) then
Details:DestroyActor(actorObject, combatObject)
table.remove(actorTable, i)
end
end
end
fullRemap(actorContainer)
end
end
end
end
--panic mode (in case the play 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()
end
end
--clear all segments on logoff
if (Details.data_cleanup_logout) then
Details.tabela_historico = Details.historico:NovoHistorico()
Details.tabela_overall = nil
_detalhes_database.tabela_overall = nil
end
--clear customs
Details.clear:c_atributo_custom()
--clear owners
Details:DoOwnerCleanup()
--cleer container indexes
Details:DoContainerIndexCleanup()
end
--remove segments > of the segment limit to save
if (Details.segments_amount_to_save and Details.segments_amount_to_save < Details.segments_amount) then
for i = Details.segments_amount, Details.segments_amount_to_save + 1, -1 do
if (Details.tabela_historico.tabelas[i]) then
---@type combat
local combatObject = Details.tabela_historico.tabelas[i]
table.remove(Details.tabela_historico.tabelas, i)
Details:Destroy(combatObject)
end
end
end
--clear overall segment
if (Details.overall_clear_logout) then
Details.tabela_overall = nil
_detalhes_database.tabela_overall = nil
Details:Destroy(Details.tabela_overall)
else
---@type combat
local overallCombatObject = Details.tabela_overall
overallCombatObject.previous_combat = nil
--this is a cleanup for overall data (overall)
if (Details.clear_ungrouped) then
--deal with actor which could potentially be removed from the database
for containerId = 1, DETAILS_COMBAT_AMOUNT_CONTAINERS do
local actorContainer = overallCombatObject:GetContainer(containerId)
local actorTable = actorContainer:GetActorTable()
for actorIndex = #actorTable, 1, -1 do
---@type actor
local actorObject = actorTable[actorIndex]
if (not actorObject.grupo and not actorObject.boss and not actorObject.boss_fight_component and not actorObject.fight_component and not actorObject.pvp_component and not actorObject.arena_enemy and not actorObject.enemy) then
Details:DestroyActor(actorObject, actorContainer, overallCombatObject)
end
end
end
end
--find orphans, finding orphans should be done when deleting an actor, it should iterate among the actor pets and delete them as well
--now deal with pets without owners (overall)
for containerId = 1, DETAILS_COMBAT_AMOUNT_CONTAINERS do
local actorContainer = overallCombatObject:GetContainer(containerId)
local actorTable = actorContainer:GetActorTable()
for actorIndex = #actorTable, 1, -1 do
---@type actor
local actorObject = actorTable[actorIndex]
if (actorObject.owner) then
if (not actorObject.owner.serial) then
Details:DestroyActor(actorObject, actorContainer, overallCombatObject)
end
end
end
end
end
for i, combatObject in ipairs(allSegments) do
---@cast combatObject combat
combatTables[#combatTables+1] = combatObject
end
--this is a cleanup for combat stored in the segment list
for combatIndex, combatObject in ipairs(combatTables) do
---@cast combatObject combat
--clear the time data (chart data) - if the option to cleanup on logout is enabled
if (Details.clear_graphic) then
Details:Destroy(combatObject.TimeData)
combatObject.TimeData = {}
end
--clear the reference of the previous combat
combatObject.previous_combat = nil
local bIsBossEncounter = combatObject.is_boss
if (bIsBossEncounter) then
if (combatObject.pvp) then
bIsBossEncounter = false
end
end
if (not combatObject.is_mythic_dungeon_segment and Details.clear_ungrouped) then
for i = 1, DETAILS_COMBAT_AMOUNT_CONTAINERS do
---@type actorcontainer
local actorContainer = combatObject:GetContainer(i)
if (actorContainer) then
local actorTable = actorContainer:GetActorTable()
for o = #actorTable, 1, -1 do
---@type actor
local actorObject = actorTable[o]
if (not actorObject.grupo and not actorObject.boss and not actorObject.boss_fight_component and not bIsBossEncounter and not actorObject.pvp_component and not actorObject.fight_component) then
Details:DestroyActor(actorObject, actorContainer, combatObject)
end
end
--find orphans
for o = #actorTable, 1, -1 do
---@type actor
local actorObject = actorTable[o]
if (actorObject.owner) then
if (not actorObject.owner.serial) then
Details:DestroyActor(actorObject, actorContainer, combatObject)
end
end
end
end
end
end
end
--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()
end
end
--clear all segments on logoff
if (Details.data_cleanup_logout) then
Details.tabela_historico = Details.historico:NovoHistorico()
Details.tabela_overall = nil
_detalhes_database.tabela_overall = nil
end
--clear customs
Details.clear:c_atributo_custom()
--clear owners
Details:DoOwnerCleanup()
--clear container indexes
Details:DoContainerIndexCleanup()
end
function Details:reset_window(instancia)
if (instancia.segmento == -1) then
instancia.showing[instancia.atributo].need_refresh = true
@@ -720,7 +707,7 @@
Details:ResetSpecCache()
--cleanup the shield cache
wipe(Details.ShieldCache)
Details:Destroy(Details.ShieldCache)
--set the time of the last run
Details222.GarbageCollector.lastCollectTime = Details._tempo
+72 -72
View File
@@ -4459,7 +4459,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
local schedule_table, schedule_id = unpack(Details.capture_schedules[i])
Details:CancelTimer(schedule_table)
end
wipe(Details.capture_schedules)
Details:Destroy(Details.capture_schedules)
end
function Details:CaptureTimeout (table)
@@ -4870,7 +4870,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
--reset spec cache if broadcaster requested
if (_detalhes.streamer_config.reset_spec_cache) then
wipe (_detalhes.cached_specs)
Details:Destroy (_detalhes.cached_specs)
end
end
@@ -4972,7 +4972,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes.boss1_health_percent = 1
local dbm_mod, dbm_time = _detalhes.encounter_table.DBM_Mod, _detalhes.encounter_table.DBM_ModTime
wipe(_detalhes.encounter_table)
Details:Destroy(_detalhes.encounter_table)
_detalhes.encounter_table.phase = 1
@@ -5100,10 +5100,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes:SendEvent("COMBAT_ENCOUNTER_END", nil, ...)
wipe(_detalhes.encounter_table)
wipe(dk_pets_cache.army)
wipe(dk_pets_cache.apoc)
wipe(empower_cache)
Details:Destroy(_detalhes.encounter_table)
Details:Destroy(dk_pets_cache.army)
Details:Destroy(dk_pets_cache.apoc)
Details:Destroy(empower_cache)
return true
end
@@ -5285,8 +5285,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
if (not OnRegenEnabled) then
wipe(bitfield_swap_cache)
wipe(empower_cache)
Details:Destroy(bitfield_swap_cache)
Details:Destroy(empower_cache)
_detalhes:DispatchAutoRunCode("on_leavecombat")
end
@@ -5601,7 +5601,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
Details:DispatchAutoRunCode("on_groupchange")
wipe (Details.trusted_characters)
Details:Destroy (Details.trusted_characters)
C_Timer.After(5, Details.ScheduleSyncPlayerActorData)
end
@@ -5613,12 +5613,12 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
Details222.GarbageCollector.RestartInternalGarbageCollector(true)
Details:WipePets()
Details:SchedulePetUpdate(1)
wipe(Details.details_users)
Details:Destroy(Details.details_users)
Details:InstanceCall(Details.AdjustAlphaByContext)
Details:CheckSwitchOnLogon()
Details:SendEvent("GROUP_ONLEAVE")
Details:DispatchAutoRunCode("on_groupchange")
wipe(Details.trusted_characters)
Details:Destroy(Details.trusted_characters)
else
--player is still in a group
_detalhes:SchedulePetUpdate(2)
@@ -5716,8 +5716,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
Details.faction_id = 1
end
local startLoadTime = debugprofilestop()
--this function applies the Details.default_profile to Details object, this isn't yet the player profile which will load later
Details222.LoadSavedVariables.DefaultProfile()
@@ -5739,11 +5737,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
Details:StartAutoRun()
Details.isLoaded = true
local endLoadTime = debugprofilestop() - startLoadTime
if (Details.version_alpha_id and Details.version_alpha_id > 0 or true) then
Details:Msg("load time: " .. math.floor(endLoadTime) .. "ms", "alpha:", Details.version_alpha_id)
end
end
function Details.IsLoaded()
@@ -5807,33 +5800,39 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes.listener:SetScript("OnEvent", _detalhes.OnEvent)
--logout function ~save ~logout
local saver = CreateFrame("frame", nil, UIParent)
saver:RegisterEvent("PLAYER_LOGOUT")
saver:SetScript("OnEvent", function(...)
---@type frame
local databaseSaver = CreateFrame("frame")
databaseSaver:RegisterEvent("PLAYER_LOGOUT")
databaseSaver:SetScript("OnEvent", function(...)
--safe guard logs and user settings
__details_backup = __details_backup or {
_exit_error = {},
_instance_backup = {},
}
---@type table
local exitErrors = __details_backup._exit_error
---@param text string the error to be logged
local addToExitErrors = function(text)
table.insert(exitErrors, 1, date() .. "|" .. text)
table.remove(exitErrors, 10)
end
---@type string current step of the logout process, used to log which is the current step when an error happens
local currentStep = ""
--save the time played on this class, run protected
local savePlayTimeClass, savePlayTimeError = pcall(function()
Details.SavePlayTimeOnClass()
end)
local savePlayTimeClass, savePlayTimeErrorText = pcall(function() Details.SavePlayTimeOnClass() end)
if (not savePlayTimeClass) then
addToExitErrors("Saving Play Time: " .. savePlayTimeError)
addToExitErrors("Saving Play Time: " .. savePlayTimeErrorText)
end
--SAVINGDATA = true
---@type table record a log of events that happened during the logout process
_detalhes_global.exit_log = {}
---@type table record errors that happened during the logout process
_detalhes_global.exit_errors = _detalhes_global.exit_errors or {}
currentStep = "Checking the framework integrity"
@@ -5845,8 +5844,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
return
end
local saver_error = function(errortext)
--if the error log cause an error?
local logSaverError = function(errortext)
local writeLog = function()
_detalhes_global = _detalhes_global or {}
tinsert(_detalhes_global.exit_errors, 1, currentStep .. "|" .. date() .. "|" .. _detalhes.userversion .. "|" .. errortext .. "|" .. debugstack())
@@ -5856,52 +5854,54 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
xpcall(writeLog, addToExitErrors)
end
_detalhes.saver_error_func = saver_error
_detalhes.saver_error_func = logSaverError
_detalhes.logoff_saving_data = true
--close info window
--close breakdown window
if (_detalhes.CloseBreakdownWindow) then
tinsert(_detalhes_global.exit_log, "1 - Closing Janela Info.")
currentStep = "Fecha Janela Info"
xpcall(_detalhes.CloseBreakdownWindow, saver_error)
tinsert(_detalhes_global.exit_log, "1 - Closing Breakdown Window.")
currentStep = "Closing Breakdown Window"
xpcall(_detalhes.CloseBreakdownWindow, logSaverError)
end
--do not save window pos
if (_detalhes.tabela_instancias) then
local clearInstances = function()
currentStep = "Dealing With Instances"
tinsert(_detalhes_global.exit_log, "2 - Clearing user place from instances.")
tinsert(_detalhes_global.exit_log, "2 - Clearing user placed position from instance windows.")
for id, instance in _detalhes:ListInstances() do
if (id) then
tinsert(_detalhes_global.exit_log, " - " .. id .. " has baseFrame: " .. (instance.baseframe and "yes" or "no") .. ".")
if (instance.baseframe) then
instance.baseframe:SetUserPlaced (false)
instance.baseframe:SetDontSavePosition (true)
instance.baseframe:SetUserPlaced(false)
instance.baseframe:SetDontSavePosition(true)
end
end
end
end
xpcall(clearInstances, saver_error)
xpcall(clearInstances, logSaverError)
else
tinsert(_detalhes_global.exit_errors, 1, "not _detalhes.tabela_instancias")
tremove(_detalhes_global.exit_errors, 6)
addToExitErrors("not _detalhes.tabela_instancias")
end
--leave combat start save tables
--if is in combat during the logout, stop the combat
if (_detalhes.in_combat and _detalhes.tabela_vigente) then
tinsert(_detalhes_global.exit_log, "3 - Leaving current combat.")
currentStep = "Leaving Current Combat"
xpcall(_detalhes.SairDoCombate, saver_error)
xpcall(_detalhes.SairDoCombate, logSaverError)
_detalhes.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
tinsert(_detalhes_global.exit_log, "4 - Reversing switches.")
currentStep = "Check Switch on Logon"
xpcall(_detalhes.CheckSwitchOnLogon, saver_error)
xpcall(_detalhes.CheckSwitchOnLogon, logSaverError)
end
--user requested a wipe of the full configuration
if (_detalhes.wipe_full_config) then
tinsert(_detalhes_global.exit_log, "5 - Is a full config wipe.")
addToExitErrors("true: _detalhes.wipe_full_config")
@@ -5910,22 +5910,22 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
return
end
--save the config
--save the config
tinsert(_detalhes_global.exit_log, "6 - Saving Config.")
currentStep = "Saving Config"
xpcall(_detalhes.SaveConfig, saver_error)
xpcall(_detalhes.SaveConfig, logSaverError)
tinsert(_detalhes_global.exit_log, "7 - Saving Profiles.")
currentStep = "Saving Profile"
xpcall(_detalhes.SaveProfile, saver_error)
xpcall(_detalhes.SaveProfile, logSaverError)
--save the nicktag cache
--save the nicktag cache
tinsert(_detalhes_global.exit_log, "8 - Saving nicktag cache.")
local saveNicktabCache = function()
_detalhes_database.nick_tag_cache = Details.CopyTable(_detalhes_database.nick_tag_cache)
end
xpcall(saveNicktabCache, saver_error)
xpcall(saveNicktabCache, logSaverError)
end)
local eraNamedSpellsToID = {}
@@ -6052,30 +6052,30 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
function _detalhes:ClearParserCache() --~wipe
wipe(damage_cache)
wipe(damage_cache_pets)
wipe(damage_cache_petsOwners)
wipe(healing_cache)
wipe(energy_cache)
wipe(misc_cache)
wipe(misc_cache_pets)
wipe(misc_cache_petsOwners)
wipe(npcid_cache)
wipe(enemy_cast_cache)
wipe(empower_cache)
Details:Destroy(damage_cache)
Details:Destroy(damage_cache_pets)
Details:Destroy(damage_cache_petsOwners)
Details:Destroy(healing_cache)
Details:Destroy(energy_cache)
Details:Destroy(misc_cache)
Details:Destroy(misc_cache_pets)
Details:Destroy(misc_cache_petsOwners)
Details:Destroy(npcid_cache)
Details:Destroy(enemy_cast_cache)
Details:Destroy(empower_cache)
wipe(ignore_death_cache)
Details:Destroy(ignore_death_cache)
wipe(reflection_damage)
wipe(reflection_debuffs)
wipe(reflection_events)
wipe(reflection_auras)
wipe(reflection_dispels)
Details:Destroy(reflection_damage)
Details:Destroy(reflection_debuffs)
Details:Destroy(reflection_events)
Details:Destroy(reflection_auras)
Details:Destroy(reflection_dispels)
wipe(dk_pets_cache.army)
wipe(dk_pets_cache.apoc)
Details:Destroy(dk_pets_cache.army)
Details:Destroy(dk_pets_cache.apoc)
wipe(cacheAnything.paladin_vivaldi_blessings)
Details:Destroy(cacheAnything.paladin_vivaldi_blessings)
cacheAnything.track_hunter_frenzy = Details.combat_log.track_hunter_frenzy
@@ -6175,11 +6175,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
function _detalhes:UptadeRaidMembersCache()
wipe(raid_members_cache)
wipe(tanks_members_cache)
wipe(auto_regen_cache)
wipe(bitfield_swap_cache)
wipe(empower_cache)
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
@@ -6332,7 +6332,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
--_recording_ability_with_buffs = _detalhes.RecordPlayerAbilityWithBuffs --can be deprecated
_in_combat = _detalhes.in_combat
wipe(ignored_npcids)
Details:Destroy(ignored_npcids)
--fill it with the default npcs ignored
for npcId in pairs(_detalhes.default_ignored_npcs) do
+2 -2
View File
@@ -107,8 +107,8 @@
end
function timeMachine:Reiniciar()
table.wipe(self.tabelas[1])
table.wipe(self.tabelas[2])
Details:Destroy(self.tabelas[1])
Details:Destroy(self.tabelas[2])
self.tabelas = {{}, {}} --1 dano 2 cura
end
+3 -3
View File
@@ -354,7 +354,7 @@
for key, value in pairs(_table) do
temptable [string.lower(key)] = value
end
temptable, _table = table.wipe(_table), temptable
temptable, _table = Details:Destroy(_table), temptable
return _table
end
@@ -526,7 +526,7 @@
return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right
end
wipe (_detalhes.ToKFunctions)
Details:Destroy (_detalhes.ToKFunctions)
tinsert(_detalhes.ToKFunctions, _detalhes.NoToK)
tinsert(_detalhes.ToKFunctions, _detalhes.ToK)
@@ -659,7 +659,7 @@
return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right
end
wipe (_detalhes.ToKFunctions)
Details:Destroy (_detalhes.ToKFunctions)
tinsert(_detalhes.ToKFunctions, _detalhes.NoToK)
tinsert(_detalhes.ToKFunctions, _detalhes.ToK)
+2 -2
View File
@@ -27,8 +27,8 @@ function Details.AuraTracker.AddAura(auraType, spellid)
end
local doFullAuraUpdate = function()
wipe(Details.AuraTracker.buff)
wipe(Details.AuraTracker.debuff)
Details:Destroy(Details.AuraTracker.buff)
Details:Destroy(Details.AuraTracker.debuff)
local unitId = "player"
+1 -1
View File
@@ -328,7 +328,7 @@ end
end
cooldownFrame.scheduleRosterUpdate = nil
wipe(cooldownFrame.playerCache)
Details:Destroy(cooldownFrame.playerCache)
cooldownFrame.nextLineId = 1
if (Details.ocd_tracker.show_conditions.only_in_group) then
+5 -5
View File
@@ -583,8 +583,8 @@ function Details:CreateCurrentDpsFrame(parent, name)
DF:SetFontOutline (labelYellowTeam_DPS, Details.realtime_dps_meter.font_shadow)
--wipe current data for arena
wipe (f.PlayerTeamBuffer)
wipe (f.YellowTeamBuffer)
Details:Destroy (f.PlayerTeamBuffer)
Details:Destroy (f.YellowTeamBuffer)
--reset damage
f.PlayerTeamDamage = 0
@@ -902,9 +902,9 @@ function Details:CreateCurrentDpsFrame(parent, name)
function eventListener:ResetBuffer()
if (f:IsShown()) then
wipe (f.PlayerTeamBuffer)
wipe (f.YellowTeamBuffer)
wipe (f.GroupBuffer)
Details:Destroy (f.PlayerTeamBuffer)
Details:Destroy (f.YellowTeamBuffer)
Details:Destroy (f.GroupBuffer)
f.GroupTotalDamage = 0
f.PlayerTeamDamage = 0
f.YellowDamage = 0
+4 -4
View File
@@ -105,10 +105,10 @@ function Details:OpenForge()
f:SetScript("OnHide", function()
for _, module in ipairs(all_modules) do
if (module.data) then
wipe (module.data)
Details:Destroy (module.data)
end
end
wipe (spell_already_added)
Details:Destroy (spell_already_added)
end)
f.bg1 = f:CreateTexture(nil, "background")
@@ -438,7 +438,7 @@ function Details:OpenForge()
local filter_name = DetailsForgeAllSpellsNameFilter:GetText()
local lower_FilterCaster = lower (filter_caster)
local lower_FilterSpellName = lower (filter_name)
wipe (spell_already_added)
Details:Destroy (spell_already_added)
local SpellPoll = Details.spell_pool
for spellID, className in pairs(SpellPoll) do
@@ -582,7 +582,7 @@ function Details:OpenForge()
local lower_FilterSpellName = lower (filter_name)
local lower_FilterEncounterName = lower (filter_encounter)
wipe (spell_already_added)
Details:Destroy (spell_already_added)
local SpellPoll = Details.encounter_spell_pool
for spellID, spellTable in pairs(SpellPoll) do
+4 -4
View File
@@ -2302,7 +2302,7 @@ function icon_frame_events:EnterCombat()
anim.icon_frame.icon_animation = nil
anim.icon_frame = nil
end
wipe (Details.icon_animations.load.in_use)
Details:Destroy (Details.icon_animations.load.in_use)
end
icon_frame_events:RegisterEvent("COMBAT_PLAYER_ENTER", "EnterCombat")
@@ -3060,7 +3060,7 @@ function Details:InstanceAlert (msg, icon, timeInSeconds, clickfunc, doflash, fo
end
self.alert.button.func = nil
wipe (self.alert.button.func_param)
Details:Destroy (self.alert.button.func_param)
if (clickfunc) then
self.alert.button.func = clickfunc[1]
@@ -5609,7 +5609,7 @@ function Details:SetIconAlpha(alpha, hide, noAnimations)
end
end
table.wipe(SetIconAlphaCacheButtonsTable)
Details:Destroy(SetIconAlphaCacheButtonsTable)
SetIconAlphaCacheButtonsTable[1] = self.baseframe.cabecalho.modo_selecao
SetIconAlphaCacheButtonsTable[2] = self.baseframe.cabecalho.segmento
SetIconAlphaCacheButtonsTable[3] = self.baseframe.cabecalho.atributo
@@ -5703,7 +5703,7 @@ function Details:ToolbarMenuSetButtons(_mode, _segment, _attributes, _report, _r
self.menu_icons[5] = _reset
self.menu_icons[6] = _close
table.wipe(tbuttons)
Details:Destroy(tbuttons)
tbuttons[1] = self.baseframe.cabecalho.modo_selecao
tbuttons[2] = self.baseframe.cabecalho.segmento
+1 -2
View File
@@ -15,7 +15,6 @@ local type = type
local unpack = _G.unpack
local PixelUtil = PixelUtil
local UISpecialFrames = UISpecialFrames
local wipe = wipe
local CreateFrame = _G.CreateFrame
local detailsFramework = DetailsFramework
@@ -248,7 +247,7 @@ function Details:OpenBreakdownWindow(instanceObject, actorObject, bFromAttribute
local tabsReplaced = {}
local tabReplacedAmount = 0
wipe(breakdownWindow.currentTabsInUse)
Details:Destroy(breakdownWindow.currentTabsInUse)
for index = 1, #Details.player_details_tabs do
local tab = Details.player_details_tabs[index]
+1 -1
View File
@@ -225,7 +225,7 @@ end
--called when Details! reset the data
function chartsObject.ResetSegmentData()
wipe(chartsObject.SegmentsData)
Details:Destroy(chartsObject.SegmentsData)
--stop the ticker
chartsObject.StopCombatDataTicker()
+1 -2
View File
@@ -7,7 +7,6 @@ local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" )
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
local unpack = unpack
local GetTime = GetTime
local wipe = wipe
local CreateFrame = CreateFrame
local GetSpellLink = GetSpellLink
local GetSpellInfo = GetSpellInfo
@@ -2515,7 +2514,7 @@ local getSpellBar = function(scrollFrame, lineIndex)
spellBar.bIsExpandedSpell = false
wipe(spellBar.ExpandedChildren)
Details:Destroy(spellBar.ExpandedChildren)
--reset header alignment
spellBar:ResetFramesToHeaderAlignment()
+2 -2
View File
@@ -239,7 +239,7 @@ function Details:ScrollDamage()
DetailsScrollDamage.Data.Started = time()
end
tinsert(DetailsScrollDamage.Data, 1, {timew, token, hidding, sourceSerial, sourceName, sourceFlag, sourceFlag2, targetSerial, targetName, targetFlag, targetFlag2, spellID, spellName, spellType, amount, overKill or 0, school or 1, resisted or 0, blocked or 0, absorbed or 0, isCritical})
wipe(DetailsScrollDamage.searchCache)
Details:Destroy(DetailsScrollDamage.searchCache)
damageScroll:RefreshScroll()
elseif (token == "SWING_DAMAGE") then
@@ -251,7 +251,7 @@ function Details:ScrollDamage()
end)
DetailsScrollDamage:SetScript("OnShow", function()
wipe(DetailsScrollDamage.Data)
Details:Destroy(DetailsScrollDamage.Data)
damageScroll:RefreshScroll()
combatLogReader:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
end)
+6 -6
View File
@@ -453,10 +453,10 @@ function Details:OpenRaidHistoryWindow(raidName, bossEncounterId, difficultyId,
local currentGuild = guildDropdown.value
--wipe data
wipe(difficultyList)
wipe(bossList)
wipe(raidList)
wipe(guildList)
Details:Destroy(difficultyList)
Details:Destroy(bossList)
Details:Destroy(raidList)
Details:Destroy(guildList)
local bossRepeated = {}
local raidRepeated = {}
@@ -618,8 +618,8 @@ function Details:OpenRaidHistoryWindow(raidName, bossEncounterId, difficultyId,
local raidSelected = DetailsRaidHistoryWindow.select_raid:GetValue()
local bossRepeated = {}
wipe(bossList)
wipe(difficultyList)
Details:Destroy(bossList)
Details:Destroy(difficultyList)
for difficulty, encounterIdTable in pairs(db) do
if (type(difficulty) == "number" and allowedKeysForDifficulty[difficulty]) then
+1 -1
View File
@@ -1961,7 +1961,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
spellname = select(1, GetSpellInfo(spellid))
end
wipe (empty_other_values)
Details:Destroy (empty_other_values)
other_values = other_values or empty_other_values
if (not DetailsAuraPanel or not DetailsAuraPanel.Initialized) then
+2 -2
View File
@@ -133,8 +133,8 @@ function Details:CreateCallbackListeners()
end
current_encounter = false
wipe (current_table_dbm)
wipe (current_table_bigwigs)
Details:Destroy (current_table_dbm)
Details:Destroy (current_table_bigwigs)
end
end)
event_frame:RegisterEvent("ENCOUNTER_START")
+2 -2
View File
@@ -74,8 +74,8 @@ end
--start the proccess of updating the current dps and hps for each player
function Details.CurrentDps.StartCurrentDpsTracker()
Details.CurrentDps.CombatObject = Details:GetCurrentCombat()
wipe(Details.CurrentDps.Dps)
wipe(Details.CurrentDps.Hps)
Details:Destroy(Details.CurrentDps.Dps)
Details:Destroy(Details.CurrentDps.Hps)
currentDpsFrame:SetScript("OnUpdate", currentDpsFrame.OnUpdateFunc)
end
--stop what the function above started
+69 -68
View File
@@ -3,7 +3,7 @@ local Details = _G.Details
local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" )
local _
local addonName, Details222 = ...
local C_Timer
local C_Timer = C_Timer
local UnitName = UnitName
--On Details! Load load default keys into the main object
@@ -22,7 +22,7 @@ function Details222.LoadSavedVariables.CharacterData()
local currentCharacterData = _detalhes_database
--check if the player data exists, if not, load from default
if (not currentCharacterData) then
if (not currentCharacterData) then --NOT EXISTS
currentCharacterData = Details.CopyTable(defaultCharacterData)
--[[GLOBAL]] _detalhes_database = currentCharacterData
end
@@ -106,71 +106,91 @@ end
--load previous saved combat data
function Details222.LoadSavedVariables.CombatSegments()
local currentCharacterData = _G["_detalhes_database"] --no need to check if it exists, it's already checked
if (currentCharacterData == nil) then
currentCharacterData = {}
end
--if isn't nothing saved, build a new one and quit
if (not currentCharacterData.tabela_historico) then
--custom displays - if there's no saved custom display, they will be filled from the StartMeUp() when a new version is installed
if (_detalhes_global.custom) then
Details.custom = _detalhes_global.custom
Details.refresh:r_atributo_custom()
end
local bShouldClearAndExit = not currentCharacterData.tabela_historico
--check integrity of the sub table 'tabelas' and its first index 'current segment'
if (not bShouldClearAndExit) then
if (not currentCharacterData.tabela_historico.tabelas or not currentCharacterData.tabela_historico.tabelas[1]) then
bShouldClearAndExit = true
end
end
--check if is a major version upgrade (usualy API or low level changes)
if (not bShouldClearAndExit) then
bShouldClearAndExit = currentCharacterData.last_realversion and currentCharacterData.last_realversion < Details.realversion
end
--if can just clear all data and exit
if (bShouldClearAndExit) then
Details.tabela_historico = Details.historico:NovoHistorico()
Details.tabela_overall = Details.combate:NovaTabela()
Details.tabela_vigente = Details.combate:NovaTabela(_, Details.tabela_overall)
Details.tabela_pets = Details.container_pets:NovoContainer()
Details:UpdateContainerCombatentes()
if (currentCharacterData.tabela_pets) then
Details:Destroy(currentCharacterData.tabela_pets) --saved pet data
currentCharacterData.tabela_pets = nil
end
if (currentCharacterData.tabela_overall) then --saved overall data
Details:Destroy(currentCharacterData.tabela_overall)
currentCharacterData.tabela_overall = nil
end
if (currentCharacterData.tabela_historico) then
Details:Destroy(currentCharacterData.tabela_historico)
currentCharacterData.tabela_historico = nil
end
return
else
Details.tabela_historico = Details.CopyTable(currentCharacterData.tabela_historico)
Details.tabela_overall = Details.combate:NovaTabela()
Details.tabela_pets = Details.container_pets:NovoContainer()
if (currentCharacterData.tabela_pets) then
Details.tabela_pets.pets = Details.CopyTable(currentCharacterData.tabela_pets)
end
Details:UpdateContainerCombatentes()
--if the core revision was incremented, reset all combat data to avoid incompatible data
if (currentCharacterData.last_realversion and currentCharacterData.last_realversion < Details.realversion) then
--details was been hard upgraded
Details.tabela_historico = Details.historico:NovoHistorico()
Details.tabela_overall = Details.combate:NovaTabela()
Details.tabela_vigente = Details.combate:NovaTabela(_, Details.tabela_overall)
--pet owners cache saved on logout
do
Details.tabela_pets = Details.container_pets:NovoContainer()
Details:UpdateContainerCombatentes()
if (currentCharacterData.tabela_pets) then
--pet ownership table only exists if the player logoff inside a raid or dungeon
Details.tabela_pets.pets = Details.CopyTable(currentCharacterData.tabela_pets)
Details:Destroy(currentCharacterData.tabela_pets)
currentCharacterData.tabela_pets = nil
end
end
currentCharacterData.tabela_historico = nil
currentCharacterData.tabela_overall = nil
else
--check integrity
local combat = Details.tabela_historico.tabelas[1]
if (combat) then
if (not combat[1] or not combat[2] or not combat[3] or not combat[4]) then
--something went wrong in last logon, let's just reset and we are good to go
Details.tabela_historico = Details.historico:NovoHistorico()
Details.tabela_vigente = Details.combate:NovaTabela(_, Details.tabela_overall)
Details.tabela_pets = Details.container_pets:NovoContainer()
Details:UpdateContainerCombatentes()
--restore saved overall data
do
if (not Details.overall_clear_logout) then
if (currentCharacterData.tabela_overall) then
Details.tabela_overall = Details.CopyTable(currentCharacterData.tabela_overall)
Details:RestoreOverallMetatables()
end
else
Details.tabela_overall = Details.combate:NovaTabela()
end
end
if (not Details.overall_clear_logout) then
if (currentCharacterData.tabela_overall) then
Details.tabela_overall = currentCharacterData.tabela_overall
Details:RestoreOverallMetatables()
Details:Destroy(currentCharacterData.tabela_overall)
currentCharacterData.tabela_overall = nil
end
else
Details.tabela_overall = Details.combate:NovaTabela()
end
--re-build all indexes and metatables
Details:RestoreMetatables()
--get lastest combat the player participated
---@type combat
local firstSegment = Details.tabela_historico.tabelas[1]
if (firstSegment) then
Details.tabela_vigente = firstSegment
else
Details.tabela_vigente = Details.combate:NovaTabela(_, Details.tabela_overall)
--restore saved segments
do
Details.tabela_historico = Details.CopyTable(currentCharacterData.tabela_historico)
Details:Destroy(currentCharacterData.tabela_historico)
currentCharacterData.tabela_historico = nil
end
--get the first segment saved and use it as current segment
Details.tabela_vigente = Details.tabela_historico.tabelas[1]
--need refresh for all containers
for _, actorContainer in ipairs(Details.tabela_overall) do
actorContainer.need_refresh = true
@@ -179,19 +199,8 @@ function Details222.LoadSavedVariables.CombatSegments()
actorContainer.need_refresh = true
end
--erase combat data from the database
if (currentCharacterData.tabela_historico) then
Details:Destroy(currentCharacterData.tabela_historico)
end
if (currentCharacterData.tabela_pets) then
Details:Destroy(currentCharacterData.tabela_pets)
end
--double check for pet container
if (not Details.tabela_pets or not Details.tabela_pets.pets) then
Details.tabela_pets = Details.container_pets:NovoContainer()
end
Details:UpdateContainerCombatentes()
Details:RestoreMetatables()
end
end
@@ -348,14 +357,6 @@ function Details:LoadConfig()
--apply the profile
Details:ApplyProfile(current_profile_name, true)
--custom
Details.custom = _detalhes_global.custom
if (_detalhes_global.custom and _detalhes_global.custom[1] and _detalhes_global.custom[1].__index and _detalhes_global.custom[1].__index._InstanceLastCombatShown) then
C_Timer.After(5, function() print("|cFFFFAA00Details!|r error 0x8487, report on discord") end)
end
Details.refresh:r_atributo_custom()
end
--On Details! Load count logons, tutorials, etc
+1 -1
View File
@@ -809,7 +809,7 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent(contextObject, even
--reset spec cache if broadcaster requested
if (Details.streamer_config.reset_spec_cache) then
wipe (Details.cached_specs)
Details:Destroy (Details.cached_specs)
end
C_Timer.After(0.5, DetailsMythicPlusFrame.OnChallengeModeStart)
+5 -5
View File
@@ -80,11 +80,11 @@ function Details.packFunctions.PackCombatData(combatObject, flags)
--0x8 misc
--0x10 no combat header
table.wipe(actorInformation)
table.wipe(actorInformationIndexes)
table.wipe(actorDamageInfo)
table.wipe(actorHealInfo)
table.wipe(actorUtilityInfo)
Details:Destroy(actorInformation)
Details:Destroy(actorInformationIndexes)
Details:Destroy(actorDamageInfo)
Details:Destroy(actorHealInfo)
Details:Destroy(actorUtilityInfo)
--reset the serial counter
entitySerialCounter = 0
+1 -1
View File
@@ -114,7 +114,7 @@ function Details:RefreshPlaterIntegration()
if (Plater and Details.plater.realtime_dps_enabled or Details.plater.realtime_dps_player_enabled or Details.plater.damage_taken_enabled) then
--wipe the cache
wipe (plater_integration_frame.DamageTaken)
Details:Destroy (plater_integration_frame.DamageTaken)
--read cleu events
plater_integration_frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
+3 -3
View File
@@ -144,7 +144,7 @@ function Details:ResetProfile (profile_name)
end
--reset the profile
table.wipe(profile.instances)
Details:Destroy(profile.instances)
--export first instance
local instance = Details:GetInstance(1)
@@ -529,7 +529,7 @@ function Details:SaveProfile (saveas)
--save skins
if (not Details.do_not_save_skins) then
table.wipe(profile.instances)
Details:Destroy(profile.instances)
for index, instance in ipairs(Details.tabela_instancias) do
local exported = instance:ExportSkin()
exported.__was_opened = instance:IsEnabled()
@@ -1668,7 +1668,7 @@ function Details:SaveProfileSpecial()
end
--save skins
table.wipe(profile.instances)
Details:Destroy(profile.instances)
if (Details.tabela_instancias) then
for index, instance in ipairs(Details.tabela_instancias) do
+77 -74
View File
@@ -1,14 +1,14 @@
--[[this file save the data when player leave the game]]
local _detalhes = _G.Details
local Details = _G.Details
local addonName, Details222 = ...
function _detalhes:WipeConfig()
function Details:WipeConfig()
local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" )
local wipeButton = CreateFrame("button", "DetailsResetConfigButton", UIParent, "BackdropTemplate")
wipeButton:SetSize(270, 40)
wipeButton:SetScript("OnClick", function() _detalhes.wipe_full_config = true; ReloadUI(); end)
wipeButton:SetScript("OnClick", function() Details.wipe_full_config = true; ReloadUI(); end)
wipeButton:SetPoint("center", UIParent, "center", 0, 0)
tinsert(UISpecialFrames, "DetailsResetConfigButton")
@@ -30,18 +30,17 @@ local is_exception = {
["nick_tag_cache"] = true
}
function _detalhes:SaveLocalInstanceConfig()
for index, instance in _detalhes:ListInstances() do
function Details:SaveLocalInstanceConfig()
for index, instance in Details:ListInstances() do
--check for the max size toggle, don't save it
if (instance.is_in_max_size) then
instance.is_in_max_size = false
instance:SetSize(instance.original_width, instance.original_height)
end
--save local instance data
local a1, a2 = instance:GetDisplay()
local t = {
pos = Details.CopyTable(instance:GetPosition()),
is_open = instance:IsEnabled(),
@@ -57,13 +56,13 @@ function _detalhes:SaveLocalInstanceConfig()
isLocked = instance.isLocked,
last_raid_plugin = instance.last_raid_plugin
}
if (t.isLocked == nil) then
t.isLocked = false
end
if (_detalhes.profile_save_pos) then
local cprofile = _detalhes:GetProfile()
if (Details.profile_save_pos) then
local cprofile = Details:GetProfile()
local skin = cprofile.instances [instance:GetId()]
if (skin) then
t.pos = Details.CopyTable(skin.__pos)
@@ -74,76 +73,80 @@ function _detalhes:SaveLocalInstanceConfig()
t.isLocked = skin.__locked
end
end
_detalhes.local_instances_config [index] = t
Details.local_instances_config [index] = t
end
end
function _detalhes:SaveConfig()
function Details:SaveConfig()
--save character instance settings, e.g. which attribute is selected, position, etc
Details:SaveLocalInstanceConfig()
--save instance configs localy
_detalhes:SaveLocalInstanceConfig()
--cleanup
_detalhes:PrepareTablesForSave()
Details:PrepareTablesForSave()
_detalhes_database.tabela_instancias = {} --_detalhes.tabela_instancias --[[instances now saves only inside the profile --]]
_detalhes_database.tabela_historico = _detalhes.tabela_historico
if (not _detalhes.overall_clear_logout) then
_detalhes_database.tabela_overall = _detalhes.tabela_overall
_detalhes_database.tabela_instancias = {} --Details.tabela_instancias --[[instances now saves only inside the profile --]]
_detalhes_database.tabela_historico = Details.tabela_historico
if (Details.overall_clear_logout) then
if (_detalhes_database.tabela_overall) then
Details:Destroy(_detalhes_database.tabela_overall)
_detalhes_database.tabela_overall = nil
end
local name, ttype, difficulty, difficultyName, maxPlayers, playerDifficulty, isDynamicInstance, mapID, instanceGroupSize = GetInstanceInfo()
if (ttype == "party" or ttype == "raid") then
--salvar container de pet
_detalhes_database.tabela_pets = _detalhes.tabela_pets.pets
end
xpcall(_detalhes.TimeDataCleanUpTemporary, _detalhes.saver_error_func)
--buffs
xpcall(_detalhes.Buffs.SaveBuffs, _detalhes.saver_error_func)
else
_detalhes_database.tabela_overall = Details.tabela_overall
--did it prepared the overall table for save?
end
local name, instanceType = GetInstanceInfo()
if (instanceType == "party" or instanceType == "raid") then
--save pet ownership information
_detalhes_database.tabela_pets = Details.tabela_pets.pets
end
--clear temporarly time data (charts)
xpcall(Details.TimeDataCleanUpTemporary, Details.saver_error_func)
--buffs - feature lost in time
xpcall(Details.Buffs.SaveBuffs, Details.saver_error_func)
--date
_detalhes.last_day = date ("%d")
--salva o container do personagem
for key, value in pairs(_detalhes.default_player_data) do
if (not is_exception [key]) then
_detalhes_database [key] = _detalhes [key]
end
end
--salva o container das globais
for key, value in pairs(_detalhes.default_global_data) do
if (key ~= "__profiles") then
_detalhes_global [key] = _detalhes [key]
end
end
Details.last_day = date("%d")
--solo e raid mode
if (_detalhes.SoloTables.Mode) then
_detalhes_database.SoloTablesSaved = {}
_detalhes_database.SoloTablesSaved.Mode = _detalhes.SoloTables.Mode
if (_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode]) then
_detalhes_database.SoloTablesSaved.LastSelected = _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].real_name
end
--save character data (unique for each character)
for key in pairs(Details.default_player_data) do
if (not is_exception[key]) then
_detalhes_database[key] = Details[key]
end
_detalhes_database.RaidTablesSaved = nil
--salva switch tables
_detalhes_global.switchSaved.slots = _detalhes.switch.slots
_detalhes_global.switchSaved.table = _detalhes.switch.table
--last boss
_detalhes_database.last_encounter = _detalhes.last_encounter
--last versions
_detalhes_database.last_realversion = _detalhes.realversion --core number
_detalhes_database.last_version = _detalhes.userversion --version
_detalhes_global.got_first_run = true
end
--save shared data (shared among all characters)
for key in pairs(Details.default_global_data) do
if (key ~= "__profiles") then
_detalhes_global[key] = Details[key]
end
end
--plugin for solo mode (currently none exists)
if (Details.SoloTables.Mode) then
_detalhes_database.SoloTablesSaved = {}
_detalhes_database.SoloTablesSaved.Mode = Details.SoloTables.Mode
if (Details.SoloTables.Plugins[Details.SoloTables.Mode]) then
_detalhes_database.SoloTablesSaved.LastSelected = Details.SoloTables.Plugins[Details.SoloTables.Mode].real_name
end
end
_detalhes_database.RaidTablesSaved = nil
--save bookmark tables
_detalhes_global.switchSaved.slots = Details.switch.slots
_detalhes_global.switchSaved.table = Details.switch.table
--last boss (boss name)
_detalhes_database.last_encounter = Details.last_encounter
--save the details version of the last time the user logged out
_detalhes_database.last_realversion = Details.realversion --core number
_detalhes_database.last_version = Details.userversion --version
_detalhes_global.got_first_run = true
end
+2 -1
View File
@@ -1056,7 +1056,8 @@ local addonName, Details222 = ...
end
table.wipe(instance1.snap); table.wipe(instance2.snap)
Details:Destroy(instance1.snap)
Details:Destroy(instance2.snap)
instance1.snap [3] = 2; instance2.snap [1] = 1;
instance1.horizontalSnap = true; instance2.horizontalSnap = true
+204 -326
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -74,7 +74,7 @@
local texture = portraitPool.inUse[i]
releaseTextureForPortraitPool(texture)
end
table.wipe(portraitPool.npcIdToTexture)
Details:Destroy(portraitPool.npcIdToTexture)
end)
eventListener:RegisterEvent("COMBAT_ENCOUNTER_START", function()
+154 -154
View File
@@ -1,6 +1,6 @@
local _
local _detalhes = _G.Details
local Details = _G.Details
local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" )
local addonName, Details222 = ...
@@ -8,9 +8,9 @@
Details222.TimeCapture = {}
--mantain the enabled time captures
_detalhes.timeContainer = {}
_detalhes.timeContainer.Exec = {}
Details.timeContainer = {}
Details.timeContainer.Exec = {}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--local pointers
local ipairs = ipairs
@@ -28,121 +28,121 @@
local INDEX_VERSION = 5
local INDEX_ICON = 6
local INDEX_ENABLED = 7
local DEFAULT_USER_MATRIX = {max_value = 0, last_value = 0}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--register and unregister captures
function _detalhes:TimeDataUpdate (index_or_name, name, func, matrix, author, version, icon, is_enabled)
function Details:TimeDataUpdate (index_or_name, name, func, matrix, author, version, icon, is_enabled)
local this_capture
if (type(index_or_name) == "number") then
this_capture = _detalhes.savedTimeCaptures [index_or_name]
this_capture = Details.savedTimeCaptures [index_or_name]
else
for index, t in ipairs(_detalhes.savedTimeCaptures) do
for index, t in ipairs(Details.savedTimeCaptures) do
if (t [INDEX_NAME] == index_or_name) then
this_capture = t
end
end
end
if (not this_capture) then
return false
end
if (this_capture.do_not_save) then
return _detalhes:Msg("This capture belongs to a plugin and cannot be edited.")
return Details:Msg("This capture belongs to a plugin and cannot be edited.")
end
this_capture [INDEX_NAME] = name or this_capture [INDEX_NAME]
this_capture [INDEX_FUNCTION] = func or this_capture [INDEX_FUNCTION]
this_capture [INDEX_MATRIX] = matrix or this_capture [INDEX_MATRIX]
this_capture [INDEX_AUTHOR] = author or this_capture [INDEX_AUTHOR]
this_capture [INDEX_VERSION] = version or this_capture [INDEX_VERSION]
this_capture [INDEX_ICON] = icon or this_capture [INDEX_ICON]
if (is_enabled ~= nil) then
this_capture [INDEX_ENABLED] = is_enabled
else
this_capture [INDEX_ENABLED] = this_capture [INDEX_ENABLED]
end
if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then
DetailsOptionsWindowTab17UserTimeCapturesFillPanel.MyObject:Refresh()
end
return true
end
--matrix = table containing {max_value = 0, last_value = 0}
function _detalhes:TimeDataRegister (name, func, matrix, author, version, icon, is_enabled, force_no_save)
function Details:TimeDataRegister (name, func, matrix, author, version, icon, is_enabled, force_no_save)
--check name
if (not name) then
return "Couldn't register the time capture, name was nil."
end
--check if the name already exists
for index, t in ipairs(_detalhes.savedTimeCaptures) do
for index, t in ipairs(Details.savedTimeCaptures) do
if (t [INDEX_NAME] == name) then
return "Couldn't register the time capture, name already registred."
end
end
--check function
if (not func) then
return "Couldn't register the time capture, invalid function."
end
local no_save = nil
--passed a function means that this isn't came from a user
--so the plugin register the capture every time it loads.
if (type(func) == "function") then
no_save = true
--this a custom capture from a user, so we register a default user table for matrix
elseif (type(func) == "string") then
matrix = DEFAULT_USER_MATRIX
end
if (not no_save and force_no_save) then
no_save = true
end
--check matrix
if (not matrix or type(matrix) ~= "table") then
return "Couldn't register the time capture, matrix was invalid."
end
author = author or "Unknown"
version = version or "v1.0"
icon = icon or [[Interface\InventoryItems\WoWUnknownItem01]]
tinsert(_detalhes.savedTimeCaptures, {name, func, matrix, author, version, icon, is_enabled, do_not_save = no_save})
tinsert(Details.savedTimeCaptures, {name, func, matrix, author, version, icon, is_enabled, do_not_save = no_save})
if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then
DetailsOptionsWindowTab17UserTimeCapturesFillPanel.MyObject:Refresh()
end
return true
end
--unregister
function _detalhes:TimeDataUnregister (name)
function Details:TimeDataUnregister (name)
if (type(name) == "number") then
tremove(_detalhes.savedTimeCaptures, name)
tremove(Details.savedTimeCaptures, name)
if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then
DetailsOptionsWindowTab17UserTimeCapturesFillPanel.MyObject:Refresh()
end
else
for index, t in ipairs(_detalhes.savedTimeCaptures) do
for index, t in ipairs(Details.savedTimeCaptures) do
if (t [INDEX_NAME] == name) then
tremove(_detalhes.savedTimeCaptures, index)
tremove(Details.savedTimeCaptures, index)
if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then
DetailsOptionsWindowTab17UserTimeCapturesFillPanel.MyObject:Refresh()
end
@@ -152,39 +152,39 @@
return false
end
end
--cleanup when logout
function _detalhes:TimeDataCleanUpTemporary()
local new_table = {}
for index, t in ipairs(_detalhes.savedTimeCaptures) do
function Details:TimeDataCleanUpTemporary()
local newData = {}
for index, t in ipairs(Details.savedTimeCaptures) do
if (not t.do_not_save) then
tinsert(new_table, t)
tinsert(newData, t)
end
end
_detalhes.savedTimeCaptures = new_table
Details.savedTimeCaptures = newData
end
local tick_time = 0
--starting a combat
function _detalhes:TimeDataCreateCombatTables()
function Details:TimeDataCreateCombatTables()
--create capture table
local data_captured = {}
--drop the last capture exec table without wiping
local exec = {}
_detalhes.timeContainer.Exec = exec
_detalhes:SendEvent("COMBAT_CHARTTABLES_CREATING")
Details.timeContainer.Exec = exec
Details:SendEvent("COMBAT_CHARTTABLES_CREATING")
--build the exec table
for index, t in ipairs(_detalhes.savedTimeCaptures) do
for index, t in ipairs(Details.savedTimeCaptures) do
if (t [INDEX_ENABLED]) then
local data = {}
data_captured [t [INDEX_NAME]] = data
if (type(t [INDEX_FUNCTION]) == "string") then
--user
local func, errortext = loadstring (t [INDEX_FUNCTION])
@@ -192,7 +192,7 @@
DetailsFramework:SetEnvironment(func)
tinsert(exec, { func = func, data = data, attributes = Details.CopyTable(t [INDEX_MATRIX]), is_user = true })
else
_detalhes:Msg("|cFFFF9900error compiling script for time data (charts)|r: ", errortext)
Details:Msg("|cFFFF9900error compiling script for time data (charts)|r: ", errortext)
end
else
--plugin
@@ -200,134 +200,134 @@
DetailsFramework:SetEnvironment(func)
tinsert(exec, { func = func, data = data, attributes = Details.CopyTable(t [INDEX_MATRIX]) })
end
end
end
_detalhes:SendEvent("COMBAT_CHARTTABLES_CREATED")
Details:SendEvent("COMBAT_CHARTTABLES_CREATED")
tick_time = 0
--return the capture table the to combat object
return data_captured
end
local exec_user_func = function(func, attributes, data, this_second)
local okey, result = _pcall (func, attributes)
if (not okey) then
_detalhes:Msg("|cFFFF9900error on chart script function|r:", result)
Details:Msg("|cFFFF9900error on chart script function|r:", result)
result = 0
end
local current = result - attributes.last_value
data [this_second] = current
if (current > attributes.max_value) then
attributes.max_value = current
data.max_value = current
end
attributes.last_value = result
end
function _detalhes:TimeDataTick()
function Details:TimeDataTick()
tick_time = tick_time + 1
for index, t in ipairs(_detalhes.timeContainer.Exec) do
for index, t in ipairs(Details.timeContainer.Exec) do
if (t.is_user) then
--by a user
exec_user_func (t.func, t.attributes, t.data, tick_time)
else
--by a plugin
t.func (t.attributes, t.data, tick_time)
end
end
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--broker dps stuff
local ToKFunctions = _detalhes.ToKFunctions
local ToKFunctions = Details.ToKFunctions
local broker_functions = {
-- raid dps [1]
function()
local combat = _detalhes.tabela_vigente
local combat = Details.tabela_vigente
local combatTime = combat:GetCombatTime()
if (not combatTime or combatTime == 0) then
return 0
else
return ToKFunctions [_detalhes.minimap.text_format] (_, combat.totals_grupo[1] / combatTime)
return ToKFunctions [Details.minimap.text_format] (_, combat.totals_grupo[1] / combatTime)
end
end,
-- raid hps [2]
function()
local combat = _detalhes.tabela_vigente
local combat = Details.tabela_vigente
local combatTime = combat:GetCombatTime()
if (not combatTime or combatTime == 0) then
return 0
else
return ToKFunctions [_detalhes.minimap.text_format] (_, combat.totals_grupo[2] / combatTime)
return ToKFunctions [Details.minimap.text_format] (_, combat.totals_grupo[2] / combatTime)
end
end
}
local get_combat_time = function()
local combat_time = _detalhes.tabela_vigente:GetCombatTime()
local combat_time = Details.tabela_vigente:GetCombatTime()
local minutos, segundos = _math_floor(combat_time / 60), _math_floor(combat_time % 60)
if (segundos < 10) then
segundos = "0" .. segundos
end
return minutos .. "m " .. segundos .. "s"
end
local get_damage_position = function()
local damage_container = _detalhes.tabela_vigente [1]
local damage_container = Details.tabela_vigente [1]
damage_container:SortByKey ("total")
local pos = 1
for index, actor in ipairs(damage_container._ActorTable) do
if (actor.grupo) then
if (actor.nome == _detalhes.playername) then
if (actor.nome == Details.playername) then
return pos
end
pos = pos + 1
end
end
return 0
end
local get_heal_position = function()
local heal_container = _detalhes.tabela_vigente [2]
local heal_container = Details.tabela_vigente [2]
heal_container:SortByKey ("total")
local pos = 1
for index, actor in ipairs(heal_container._ActorTable) do
if (actor.grupo) then
if (actor.nome == _detalhes.playername) then
if (actor.nome == Details.playername) then
return pos
end
pos = pos + 1
end
end
return 0
end
local get_damage_diff = function()
local damage_container = _detalhes.tabela_vigente [1]
local damage_container = Details.tabela_vigente [1]
damage_container:SortByKey ("total")
local first
local first_index
for index, actor in ipairs(damage_container._ActorTable) do
@@ -339,7 +339,7 @@
end
if (first) then
if (first.nome == _detalhes.playername) then
if (first.nome == Details.playername) then
local second
local container = damage_container._ActorTable
for i = first_index+1, #container do
@@ -348,32 +348,32 @@
break
end
end
if (second) then
local diff = first.total - second.total
return "+" .. ToKFunctions [_detalhes.minimap.text_format] (_, diff)
return "+" .. ToKFunctions [Details.minimap.text_format] (_, diff)
else
return "0"
end
else
local player = damage_container._NameIndexTable [_detalhes.playername]
local player = damage_container._NameIndexTable [Details.playername]
if (player) then
player = damage_container._ActorTable [player]
local diff = first.total - player.total
return "-" .. ToKFunctions [_detalhes.minimap.text_format] (_, diff)
return "-" .. ToKFunctions [Details.minimap.text_format] (_, diff)
else
return ToKFunctions [_detalhes.minimap.text_format] (_, first.total)
return ToKFunctions [Details.minimap.text_format] (_, first.total)
end
end
else
return "0"
end
end
local get_heal_diff = function()
local heal_container = _detalhes.tabela_vigente [2]
local heal_container = Details.tabela_vigente [2]
heal_container:SortByKey ("total")
local first
local first_index
for index, actor in ipairs(heal_container._ActorTable) do
@@ -383,9 +383,9 @@
break
end
end
if (first) then
if (first.nome == _detalhes.playername) then
if (first.nome == Details.playername) then
local second
local container = heal_container._ActorTable
for i = first_index+1, #container do
@@ -394,42 +394,42 @@
break
end
end
if (second) then
local diff = first.total - second.total
return "+" .. ToKFunctions [_detalhes.minimap.text_format] (_, diff)
return "+" .. ToKFunctions [Details.minimap.text_format] (_, diff)
else
return "0"
end
else
local player = heal_container._NameIndexTable [_detalhes.playername]
local player = heal_container._NameIndexTable [Details.playername]
if (player) then
player = heal_container._ActorTable [player]
local diff = first.total - player.total
return "-" .. ToKFunctions [_detalhes.minimap.text_format] (_, diff)
return "-" .. ToKFunctions [Details.minimap.text_format] (_, diff)
else
return ToKFunctions [_detalhes.minimap.text_format] (_, first.total)
return ToKFunctions [Details.minimap.text_format] (_, first.total)
end
end
else
return "0"
end
end
local get_player_dps = function()
local damage_player = _detalhes.tabela_vigente(1, _detalhes.playername)
local damage_player = Details.tabela_vigente(1, Details.playername)
if (damage_player) then
if (_detalhes.time_type == 1) then --activity time
if (Details.time_type == 1) then --activity time
local combat_time = damage_player:Tempo()
if (combat_time > 0) then
return ToKFunctions [_detalhes.minimap.text_format] (_, damage_player.total / combat_time)
return ToKFunctions [Details.minimap.text_format] (_, damage_player.total / combat_time)
else
return 0
end
else --effective time
local combat_time = _detalhes.tabela_vigente:GetCombatTime()
local combat_time = Details.tabela_vigente:GetCombatTime()
if (combat_time > 0) then
return ToKFunctions [_detalhes.minimap.text_format] (_, damage_player.total / combat_time)
return ToKFunctions [Details.minimap.text_format] (_, damage_player.total / combat_time)
else
return 0
end
@@ -439,21 +439,21 @@
return 0
end
end
local get_player_hps = function()
local heal_player = _detalhes.tabela_vigente(2, _detalhes.playername)
local heal_player = Details.tabela_vigente(2, Details.playername)
if (heal_player) then
if (_detalhes.time_type == 1) then --activity time
if (Details.time_type == 1) then --activity time
local combat_time = heal_player:Tempo()
if (combat_time > 0) then
return ToKFunctions [_detalhes.minimap.text_format] (_, heal_player.total / combat_time)
return ToKFunctions [Details.minimap.text_format] (_, heal_player.total / combat_time)
else
return 0
end
else --effective time
local combat_time = _detalhes.tabela_vigente:GetCombatTime()
local combat_time = Details.tabela_vigente:GetCombatTime()
if (combat_time > 0) then
return ToKFunctions [_detalhes.minimap.text_format] (_, heal_player.total / combat_time)
return ToKFunctions [Details.minimap.text_format] (_, heal_player.total / combat_time)
else
return 0
end
@@ -463,49 +463,49 @@
return 0
end
end
local get_raid_dps = function()
local damage_raid = _detalhes.tabela_vigente and _detalhes.tabela_vigente.totals [1]
local damage_raid = Details.tabela_vigente and Details.tabela_vigente.totals [1]
if (damage_raid ) then
return ToKFunctions [_detalhes.minimap.text_format] (_, damage_raid / _detalhes.tabela_vigente:GetCombatTime())
return ToKFunctions [Details.minimap.text_format] (_, damage_raid / Details.tabela_vigente:GetCombatTime())
else
return 0
end
end
local get_raid_hps = function()
local healing_raid = _detalhes.tabela_vigente and _detalhes.tabela_vigente.totals [2]
local healing_raid = Details.tabela_vigente and Details.tabela_vigente.totals [2]
if (healing_raid ) then
return ToKFunctions [_detalhes.minimap.text_format] (_, healing_raid / _detalhes.tabela_vigente:GetCombatTime())
return ToKFunctions [Details.minimap.text_format] (_, healing_raid / Details.tabela_vigente:GetCombatTime())
else
return 0
end
end
end
local get_player_damage = function()
local damage_player = _detalhes.tabela_vigente(1, _detalhes.playername)
local damage_player = Details.tabela_vigente(1, Details.playername)
if (damage_player) then
return ToKFunctions [_detalhes.minimap.text_format] (_, damage_player.total)
return ToKFunctions [Details.minimap.text_format] (_, damage_player.total)
else
return 0
end
end
local get_player_heal = function()
local heal_player = _detalhes.tabela_vigente(2, _detalhes.playername)
local heal_player = Details.tabela_vigente(2, Details.playername)
if (heal_player) then
return ToKFunctions [_detalhes.minimap.text_format] (_, heal_player.total)
return ToKFunctions [Details.minimap.text_format] (_, heal_player.total)
else
return 0
end
end
local parse_broker_text = function()
local text = _detalhes.data_broker_text
local text = Details.data_broker_text
if (text == "") then
return
end
text = text:gsub("{dmg}", get_player_damage)
text = text:gsub("{rdps}", get_raid_dps)
text = text:gsub("{rhps}", get_raid_hps)
@@ -520,21 +520,21 @@
return text
end
function _detalhes:BrokerTick()
_detalhes.databroker.text = parse_broker_text()
function Details:BrokerTick()
Details.databroker.text = parse_broker_text()
end
function _detalhes:SetDataBrokerText (text)
function Details:SetDataBrokerText (text)
if (type(text) == "string") then
_detalhes.data_broker_text = text
_detalhes:BrokerTick()
Details.data_broker_text = text
Details:BrokerTick()
elseif (text == nil or (type(text) == "boolean" and not text)) then
_detalhes.data_broker_text = ""
_detalhes:BrokerTick()
Details.data_broker_text = ""
Details:BrokerTick()
end
end
------------------------------------------------------------------------------------------------------
@@ -605,7 +605,7 @@ function Details222.TimeCapture.StopAllUnitTimers()
end
Details222.TimeCapture.Stop(unitName)
end
wipe(Details222.TimeCapture.Timers)
Details:Destroy(Details222.TimeCapture.Timers)
end
--can be a manual stop or from the stop all unit frames (function above)
+11 -11
View File
@@ -510,8 +510,8 @@ function Details:StartMeUp()
--dailly reset of the cache for talents and specs
local today = date("%d")
if (Details.last_day ~= today) then
wipe(Details.cached_specs)
wipe(Details.cached_talents)
Details:Destroy(Details.cached_specs)
Details:Destroy(Details.cached_talents)
end
--get the player spec
@@ -568,12 +568,12 @@ function Details:StartMeUp()
if (GetExpansionLevel() == 9) then
if (not Details.data_wipes_exp["10"]) then
wipe(Details.encounter_spell_pool or {})
wipe(Details.boss_mods_timers or {})
wipe(Details.spell_school_cache or {})
wipe(Details.spell_pool or {})
wipe(Details.npcid_pool or {})
wipe(Details.current_exp_raid_encounters or {})
Details:Destroy(Details.encounter_spell_pool or {})
Details:Destroy(Details.boss_mods_timers or {})
Details:Destroy(Details.spell_school_cache or {})
Details:Destroy(Details.spell_pool or {})
Details:Destroy(Details.npcid_pool or {})
Details:Destroy(Details.current_exp_raid_encounters or {})
Details.data_wipes_exp["10"] = true
end
end
@@ -582,9 +582,9 @@ function Details:StartMeUp()
Details.boss_mods_timers.encounter_timers_bw = Details.boss_mods_timers.encounter_timers_bw or {}
--clear overall data on new session
if (Details.overall_clear_logout) then
Details.tabela_overall = Details.combate:NovaTabela()
end
--if (Details.overall_clear_logout) then --this is suppose to be in the load data file
-- Details.tabela_overall = Details.combate:NovaTabela()
--end
if (not DetailsFramework.IsTimewalkWoW()) then
--wipe overall on torghast - REMOVE ON 10.0