- Tagging deprecated functions as 'deprecated' and small cleanups.

- Adding more prints to chat on the overall merge.
This commit is contained in:
Tercioo
2019-03-15 20:03:38 -03:00
parent b7b90f6d5e
commit 55790fb0ff
6 changed files with 106 additions and 103 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
## Interface: 80100
## Title: Details! Damage Meter
## Notes: Computes detailed infos about combats.
## Notes: Essential tool to impress that chick in your raid.
## SavedVariables: _detalhes_global
## SavedVariablesPerCharacter: _detalhes_database
## OptionalDeps: Ace3, LibSharedMedia-3.0, LibWindow-1.1, LibDBIcon-1.0, NickTag-1.0, LibDataBroker-1.1, LibItemUpgradeInfo-1.0, LibGroupInSpecT-1.1, LibCompress, LibGraph-2.0
+1 -1
View File
@@ -5,7 +5,7 @@
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")
_detalhes.build_counter = 6923
_detalhes.alpha_build_counter = 6992 --if this is higher than the regular counter, use it instead
_detalhes.alpha_build_counter = 7002 --if this is higher than the regular counter, use it instead
_detalhes.game_version = "v8.1.0"
_detalhes.userversion = "v8.1.0." .. _detalhes.build_counter
_detalhes.realversion = 136 --core version, this is used to check API version for scripts and plugins (see alias below)
+10 -10
View File
@@ -146,7 +146,7 @@ function historico:adicionar_overall (tabela)
end
function _detalhes:ScheduleAddCombatToOverall (combat)
function _detalhes:ScheduleAddCombatToOverall (combat) --deprecated (15/03/2019)
local canAdd = _detalhes:CanAddCombatToOverall (combat)
if (canAdd) then
_detalhes.schedule_add_to_overall = _detalhes.schedule_add_to_overall or {}
@@ -162,7 +162,7 @@ function _detalhes:CanAddCombatToOverall (tabela)
end
--> already scheduled to add
if (_detalhes.schedule_add_to_overall) then
if (_detalhes.schedule_add_to_overall) then --deprecated
for _, combat in ipairs (_detalhes.schedule_add_to_overall) do
if (combat == tabela) then
return false
@@ -425,10 +425,10 @@ function _detalhes:OverallOptions (reset_new_boss, reset_new_challenge, reset_on
end
function historico:resetar_overall()
if (InCombatLockdown()) then
_detalhes:Msg (Loc ["STRING_ERASE_IN_COMBAT"])
_detalhes.schedule_remove_overall = true
else
--if (InCombatLockdown()) then
-- _detalhes:Msg (Loc ["STRING_ERASE_IN_COMBAT"])
-- _detalhes.schedule_remove_overall = true
--else
--> fecha a janela de informaes do jogador
_detalhes:FechaJanelaInfo()
@@ -441,10 +441,10 @@ function historico:resetar_overall()
end
end
if (_detalhes.schedule_add_to_overall) then
if (_detalhes.schedule_add_to_overall) then --deprecated
wipe (_detalhes.schedule_add_to_overall)
end
end
--end
--> stop bar testing if any
_detalhes:StopTestBarUpdate()
@@ -475,7 +475,7 @@ function historico:resetar()
--> clear other schedules
_detalhes.schedule_flag_boss_components = nil
_detalhes.schedule_store_boss_encounter = nil
_detalhes.schedule_remove_overall = nil
--_detalhes.schedule_remove_overall = nil
--> fecha a janela de informaes do jogador
_detalhes:FechaJanelaInfo()
@@ -490,7 +490,7 @@ function historico:resetar()
_table_wipe (_detalhes.tabela_overall)
_table_wipe (_detalhes.spellcache)
if (_detalhes.schedule_add_to_overall) then
if (_detalhes.schedule_add_to_overall) then --deprecated
wipe (_detalhes.schedule_add_to_overall)
end
+9 -10
View File
@@ -478,13 +478,14 @@
_detalhes.leaving_combat = true
_detalhes.last_combat_time = _tempo
if (_detalhes.schedule_remove_overall and not from_encounter_end and not InCombatLockdown()) then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) found schedule overall data deletion.")
end
_detalhes.schedule_remove_overall = false
_detalhes.tabela_historico:resetar_overall()
end
--deprecated (combat are now added immediatelly since there's no script run too long)
--if (_detalhes.schedule_remove_overall and not from_encounter_end and not InCombatLockdown()) then
-- if (_detalhes.debug) then
-- _detalhes:Msg ("(debug) found schedule overall data deletion.")
-- end
-- _detalhes.schedule_remove_overall = false
-- _detalhes.tabela_historico:resetar_overall()
--end
_detalhes:CatchRaidBuffUptime ("BUFF_UPTIME_OUT")
_detalhes:CatchRaidDebuffUptime ("DEBUFF_UPTIME_OUT")
@@ -706,13 +707,11 @@
local bossFunction, bossFunctionType = _detalhes:GetBossFunction (_detalhes.tabela_vigente.is_boss.mapid or 0, _detalhes.tabela_vigente.is_boss.index or 0)
if (bossFunction) then
if (_bit_band (bossFunctionType, 0x2) ~= 0) then --end of combat
if (not InCombatLockdown() and not UnitAffectingCombat ("player") and not _detalhes.logoff_saving_data) then
if (not _detalhes.logoff_saving_data) then
local successful, errortext = pcall (bossFunction, _detalhes.tabela_vigente)
if (not successful) then
_detalhes:Msg ("error occurred on Encounter Boss Function:", errortext)
end
else
_detalhes.schedule_boss_function_run = bossFunction
end
end
end
+70 -76
View File
@@ -4196,7 +4196,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
--store the encounter time inside the encounter table for the encounter plugin
_detalhes.encounter_table ["start"] = _GetTime()
_detalhes.encounter_table ["end"] = nil
-- local encounterID = Details.encounter_table.id
_detalhes.encounter_table.id = encounterID
_detalhes.encounter_table.name = encounterName
_detalhes.encounter_table.diff = difficultyID
@@ -4374,60 +4374,13 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes:Msg ("(debug) running scheduled events after combat end.")
end
--> add segments to overall data if any scheduled
if (_detalhes.schedule_add_to_overall and #_detalhes.schedule_add_to_overall > 0) then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) adding ", #_detalhes.schedule_add_to_overall, "combats in queue to overall data.")
end
for i = #_detalhes.schedule_add_to_overall, 1, -1 do
local CombatToAdd = tremove (_detalhes.schedule_add_to_overall, i)
if (CombatToAdd) then
_detalhes.historico:adicionar_overall (CombatToAdd)
end
end
end
if (_detalhes.schedule_mythicdungeon_trash_merge) then
_detalhes.schedule_mythicdungeon_trash_merge = nil
DetailsMythicPlusFrame.MergeTrashCleanup (true)
end
if (_detalhes.schedule_mythicdungeon_endtrash_merge) then
_detalhes.schedule_mythicdungeon_endtrash_merge = nil
DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone()
end
if (_detalhes.schedule_mythicdungeon_overallrun_merge) then
_detalhes.schedule_mythicdungeon_overallrun_merge = nil
DetailsMythicPlusFrame.MergeSegmentsOnEnd()
end
--> aqui, tentativa de fazer o timer da janela do Solo funcionar corretamente:
if (_detalhes.solo and _detalhes.PluginCount.SOLO > 0) then
if (_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Stop) then
_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Stop()
end
end
--when the user requested data from the storage but is in combat lockdown
if (_detalhes.schedule_storage_load) then
_detalhes.schedule_storage_load = nil
_detalhes.ScheduleLoadStorage()
end
if (_detalhes.schedule_flag_boss_components) then
_detalhes.schedule_flag_boss_components = false
_detalhes:FlagActorsOnBossFight()
end
if (_detalhes.schedule_remove_overall) then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) found schedule overall data clean up.")
end
_detalhes.schedule_remove_overall = false
_detalhes.tabela_historico:resetar_overall()
end
--store a boss encounter when out of combat since it might need to load the storage
if (_detalhes.schedule_store_boss_encounter) then
if (not _detalhes.logoff_saving_data) then
--_detalhes.StoreEncounter()
@@ -4439,16 +4392,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes.schedule_store_boss_encounter = nil
end
if (_detalhes.schedule_boss_function_run) then
if (not _detalhes.logoff_saving_data) then
local successful, errortext = pcall (_detalhes.schedule_boss_function_run, _detalhes.tabela_vigente)
if (not successful) then
_detalhes:Msg ("error occurred on Encounter Boss Function:", errortext)
end
end
_detalhes.schedule_boss_function_run = nil
end
--when a large amount of data has been removed and the player is in combat, schedule to run the hard garbage collector (the blizzard one, not the details! internal)
if (_detalhes.schedule_hard_garbage_collect) then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) found schedule collectgarbage().")
@@ -4463,27 +4407,77 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
end
if (_detalhes.wipe_called and false) then --disabled
_detalhes.wipe_called = nil
_detalhes:CaptureSet (nil, "damage", true)
_detalhes:CaptureSet (nil, "energy", true)
_detalhes:CaptureSet (nil, "aura", true)
_detalhes:CaptureSet (nil, "energy", true)
_detalhes:CaptureSet (nil, "spellcast", true)
_detalhes:CaptureSet (false, "damage", false, 10)
_detalhes:CaptureSet (false, "energy", false, 10)
_detalhes:CaptureSet (false, "aura", false, 10)
_detalhes:CaptureSet (false, "energy", false, 10)
_detalhes:CaptureSet (false, "spellcast", false, 10)
end
if (not OnRegenEnabled) then
_table_wipe (bitfield_swap_cache)
_table_wipe (ignore_actors)
_detalhes:DispatchAutoRunCode ("on_leavecombat")
end
if (_detalhes.solo and _detalhes.PluginCount.SOLO > 0) then --code too old and I don't have documentation for it
if (_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Stop) then
_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Stop()
end
end
--deprecated shcedules
do
if (_detalhes.schedule_add_to_overall and #_detalhes.schedule_add_to_overall > 0) then --deprecated (combat are now added immediatelly since there's no script run too long)
if (_detalhes.debug) then
_detalhes:Msg ("(debug) adding ", #_detalhes.schedule_add_to_overall, "combats in queue to overall data.")
end
for i = #_detalhes.schedule_add_to_overall, 1, -1 do
local CombatToAdd = tremove (_detalhes.schedule_add_to_overall, i)
if (CombatToAdd) then
_detalhes.historico:adicionar_overall (CombatToAdd)
end
end
end
if (_detalhes.schedule_mythicdungeon_trash_merge) then --deprecated (combat are now added immediatelly since there's no script run too long)
_detalhes.schedule_mythicdungeon_trash_merge = nil
DetailsMythicPlusFrame.MergeTrashCleanup (true)
end
if (_detalhes.schedule_mythicdungeon_endtrash_merge) then --deprecated (combat are now added immediatelly since there's no script run too long)
_detalhes.schedule_mythicdungeon_endtrash_merge = nil
DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone()
end
if (_detalhes.schedule_mythicdungeon_overallrun_merge) then --deprecated (combat are now added immediatelly since there's no script run too long)
_detalhes.schedule_mythicdungeon_overallrun_merge = nil
DetailsMythicPlusFrame.MergeSegmentsOnEnd()
end
if (_detalhes.schedule_flag_boss_components) then --deprecated (combat are now added immediatelly since there's no script run too long)
_detalhes.schedule_flag_boss_components = false
_detalhes:FlagActorsOnBossFight()
end
if (_detalhes.schedule_remove_overall) then --deprecated (combat are now added immediatelly since there's no script run too long)
if (_detalhes.debug) then
_detalhes:Msg ("(debug) found schedule overall data clean up.")
end
_detalhes.schedule_remove_overall = false
_detalhes.tabela_historico:resetar_overall()
end
if (_detalhes.wipe_called and false) then --disabled
_detalhes.wipe_called = nil
_detalhes:CaptureSet (nil, "damage", true)
_detalhes:CaptureSet (nil, "energy", true)
_detalhes:CaptureSet (nil, "aura", true)
_detalhes:CaptureSet (nil, "energy", true)
_detalhes:CaptureSet (nil, "spellcast", true)
_detalhes:CaptureSet (false, "damage", false, 10)
_detalhes:CaptureSet (false, "energy", false, 10)
_detalhes:CaptureSet (false, "aura", false, 10)
_detalhes:CaptureSet (false, "energy", false, 10)
_detalhes:CaptureSet (false, "spellcast", false, 10)
end
end
end
+15 -5
View File
@@ -594,7 +594,7 @@ function _G._detalhes:Start()
local lastSegment
--> add segments
for _, pastCombat in ipairs (segmentsToMerge) do
for i, pastCombat in ipairs (segmentsToMerge) do
overallCombat = overallCombat + pastCombat
if (newFrame.DevelopmentDebug) then
print ("MergeRemainingTrashAfterAllBossesDone() > segment added")
@@ -609,6 +609,8 @@ function _G._detalhes:Start()
endDate = whenEnded
end
lastSegment = pastCombat
Details:Msg ("segment " .. i .. " merged.")
end
--> set the segment time / using a sum of combat times, this combat time is reliable
@@ -635,14 +637,21 @@ function _G._detalhes:Start()
end
--> should delete the trash segments after the merge?
Details:Msg ("merge finished, starting clean up of merged segments.")
if (_detalhes.mythic_plus.delete_trash_after_merge) then
local segmentHistory = self:GetCombatSegments()
for _, pastCombat in ipairs (segmentsToMerge) do
for i = #segmentHistory, 1, -1 do
local segment = segmentHistory [i]
if (segment == pastCombat and _detalhes.tabela_vigente ~= segment) then
--> remove the segment
tremove (segmentHistory, i)
if (segment == pastCombat) then
if (_detalhes.tabela_vigente ~= segment) then
--> remove the segment
tremove (segmentHistory, i)
Details:Msg ("segment " .. i .. " removed.")
else
Details:Msg ("error removing segment " .. i .. ", reason: the segment is the current segment.")
end
break
end
end
@@ -655,7 +664,6 @@ function _G._detalhes:Start()
--> clear the segments to merge table
for i = #segmentsToMerge, 1, -1 do
tremove (segmentsToMerge, i)
--> notify plugins about a segment deleted
self:SendEvent ("DETAILS_DATA_SEGMENTREMOVED")
end
@@ -849,6 +857,7 @@ function _G._detalhes:Start()
local pastCombat = segmentHistory [i]
if (pastCombat and pastCombat.is_mythic_dungeon and pastCombat.is_mythic_dungeon.SegmentID == "trashoverall") then
latestTrashOverall = pastCombat
Details:Msg ("found last trash overall on segment " .. i .. ", starting the merge.")
break
end
end
@@ -863,6 +872,7 @@ function _G._detalhes:Start()
if (newFrame.DevelopmentDebug) then
print ("Details!", "MythicDungeonFinished() > not in combat, merging last pack of trash now")
end
newFrame.MergeRemainingTrashAfterAllBossesDone()
--else
-- if (newFrame.DevelopmentDebug) then