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
+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