- Rolling back to Mercurial repository.

This commit is contained in:
Tercio
2017-09-27 17:59:04 -03:00
parent 7df507bd46
commit 7805d269e6
15 changed files with 626 additions and 170 deletions
Binary file not shown.
+10 -4
View File
@@ -351,14 +351,19 @@ function DF:CreateCoolTip()
end
end)
frame1:SetScript ("OnHide", function (self)
CoolTip.active = false
CoolTip.buttonClicked = false
CoolTip.mouseOver = false
--> reset parent and strata
frame1:SetParent (UIParent)
frame2:SetParent (UIParent)
frame1:SetFrameStrata ("TOOLTIP")
frame2:SetFrameStrata ("TOOLTIP")
end)
----------------------------------------------------------------------
--> Button Creation Functions
----------------------------------------------------------------------
@@ -2903,9 +2908,10 @@ function DF:CreateCoolTip()
CoolTip.Host = nil
DF:FadeFrame (frame1, 1)
DF:FadeFrame (frame2, 1)
end
--> old function call
function CoolTip:ShowMe (host, arg2)
--> ignore if mouse is up me
+1 -1
View File
@@ -1,5 +1,5 @@
local dversion = 55
local dversion = 56
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
+6 -5
View File
File diff suppressed because one or more lines are too long
+92
View File
@@ -138,10 +138,16 @@
function combate:GetCombatName (try_find)
if (self.is_pvp) then
return self.is_pvp.name
elseif (self.is_boss) then
return self.is_boss.encounter
elseif (self.is_mythic_dungeon_trash) then
return self.is_mythic_dungeon_trash.ZoneName .. " (" .. Loc ["STRING_SEGMENTS_LIST_TRASH"] .. ")"
elseif (_rawget (self, "is_trash")) then
return Loc ["STRING_SEGMENT_TRASH"]
else
if (self.enemy) then
return self.enemy
@@ -152,6 +158,92 @@
end
return Loc ["STRING_UNKNOW"]
end
--enum segments type
DETAILS_SEGMENTTYPE_GENERIC = 0
DETAILS_SEGMENTTYPE_OVERALL = 1
DETAILS_SEGMENTTYPE_DUNGEON_TRASH = 5
DETAILS_SEGMENTTYPE_DUNGEON_BOSS = 6
DETAILS_SEGMENTTYPE_RAID_TRASH = 7
DETAILS_SEGMENTTYPE_RAID_BOSS = 8
DETAILS_SEGMENTTYPE_MYTHICDUNGEON_GENERIC = 10
DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASH = 11
DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL = 12
DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASHOVERALL = 13
DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSS = 14
DETAILS_SEGMENTTYPE_PVP_ARENA = 20
DETAILS_SEGMENTTYPE_PVP_BATTLEGROUND = 21
function combate:GetCombatType()
--> mythic dungeon
local isMythicDungeon = is_mythic_dungeon_segment
if (isMythicDungeon) then
local isMythicDungeonTrash = self.is_mythic_dungeon_trash
if (isMythicDungeonTrash) then
return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASH
else
local isMythicDungeonOverall = self.is_mythic_dungeon and self.is_mythic_dungeon.OverallSegment
local isMythicDungeonTrashOverall = self.is_mythic_dungeon and self.is_mythic_dungeon.TrashOverallSegment
if (isMythicDungeonOverall) then
return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL
elseif (isMythicDungeonTrashOverall) then
return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASHOVERALL
end
local bossEncounter = self.is_boss
if (bossEncounter) then
return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSS
end
return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_GENERIC
end
end
--> arena
local arenaInfo = self.is_arena
if (arenaInfo) then
return DETAILS_SEGMENTTYPE_PVP_ARENA
end
--> battleground
local battlegroundInfo = self.is_pvp
if (battlegroundInfo) then
return DETAILS_SEGMENTTYPE_PVP_BATTLEGROUND
end
--> dungeon or raid
local instanceType = self.instance_type
if (instanceType == "party") then
local bossEncounter = self.is_boss
if (bossEncounter) then
return DETAILS_SEGMENTTYPE_DUNGEON_BOSS
else
return DETAILS_SEGMENTTYPE_DUNGEON_TRASH
end
elseif (instanceType == "raid") then
local bossEncounter = self.is_boss
if (bossEncounter) then
return DETAILS_SEGMENTTYPE_RAID_BOSS
else
return DETAILS_SEGMENTTYPE_RAID_TRASH
end
end
--> overall data
if (self == _detalhes.tabela_overall) then
return DETAILS_SEGMENTTYPE_OVERALL
end
return DETAILS_SEGMENTTYPE_GENERIC
end
--return a numeric table with all actors on the specific containter
function combate:GetActorList (container)
+1 -1
View File
@@ -3371,7 +3371,7 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown)
if (nome == self.nome and self.classe == "MONK") then
local ff = este_agressor.friendlyfire [nome]
if (ff and ff.total > 0) then
local staggerDamage = ff.spells [124255]
local staggerDamage = ff.spells [124255] or 0
if (staggerDamage > 0) then
if (table_added) then
table_added [2] = table_added [2] + staggerDamage
+131 -67
View File
@@ -30,6 +30,9 @@ function historico:adicionar_overall (tabela)
--> only for raids
if (tabela.instance_type == "raid" and tabela.is_boss) then
if (_detalhes.last_encounter ~= _detalhes.last_encounter2) then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) new boss detected 'overall_clear_newboss' is true, cleaning overall data.")
end
for index, combat in ipairs (_detalhes.tabela_historico.tabelas) do
combat.overall_added = false
end
@@ -37,14 +40,39 @@ function historico:adicionar_overall (tabela)
end
end
end
if (tabela.overall_added) then
_detalhes:Msg ("error > attempt to add a segment already added > func historico:adicionar_overall()")
return
end
local mythicInfo = tabela.is_mythic_dungeon
if (mythicInfo) then
--> do not add overall mythic+ dungeon segments
if (mythicInfo.TrashOverallSegment) then
_detalhes:Msg ("error > attempt to add a TrashOverallSegment > func historico:adicionar_overall()")
return
elseif (mythicInfo.OverallSegment) then
_detalhes:Msg ("error > attempt to add a OverallSegment > func historico:adicionar_overall()")
return
end
end
--> store the segments added to the overall data
_detalhes.tabela_overall.segments_added = _detalhes.tabela_overall.segments_added or {}
local this_clock = tabela.data_inicio
tinsert (_detalhes.tabela_overall.segments_added, 1, {name = tabela:GetCombatName (true), elapsed = tabela:GetCombatTime(), clock = this_clock})
if (#_detalhes.tabela_overall.segments_added > 20) then
tremove (_detalhes.tabela_overall.segments_added, 21)
local combatName = tabela:GetCombatName (true)
local combatTime = tabela:GetCombatTime()
local combatType = tabela:GetCombatType()
tinsert (_detalhes.tabela_overall.segments_added, 1, {name = combatName, elapsed = combatTime, clock = this_clock, type = combatType})
if (#_detalhes.tabela_overall.segments_added > 30) then
tremove (_detalhes.tabela_overall.segments_added, 31)
end
if (_detalhes.debug) then
_detalhes:Msg ("(debug) adding the segment to overall data: " .. (tabela:GetCombatName (true) or "no name") .. " with time of: " .. (tabela:GetCombatTime() or "no time"))
end
_detalhes.tabela_overall = _detalhes.tabela_overall + tabela
@@ -97,6 +125,84 @@ function _detalhes:GetCombatSegments()
return _detalhes.tabela_historico.tabelas
end
function _detalhes:ScheduleAddCombatToOverall (combat)
local canAdd = _detalhes:CanAddCombatToOverall (combat)
if (canAdd) then
_detalhes.schedule_add_to_overall = _detalhes.schedule_add_to_overall or {}
tinsert (_detalhes.schedule_add_to_overall, combat)
end
end
function _detalhes:CanAddCombatToOverall (tabela)
--> already added
if (tabela.overall_added) then
return false
end
--> already scheduled to add
if (_detalhes.schedule_add_to_overall) then
for _, combat in ipairs (_detalhes.schedule_add_to_overall) do
if (combat == tabela) then
return false
end
end
end
--> special cases
local mythicInfo = tabela.is_mythic_dungeon
if (mythicInfo) then
--> do not add overall mythic+ dungeon segments
if (mythicInfo.TrashOverallSegment) then
return false
elseif (mythicInfo.OverallSegment) then
return false
end
end
--> raid boss - flag 0x1
if (bit.band (_detalhes.overall_flag, 0x1) ~= 0) then
if (tabela.is_boss and tabela.instance_type == "raid" and not tabela.is_pvp) then
if (tabela:GetCombatTime() >= 30) then
return true
end
end
end
--> raid trash - flag 0x2
if (bit.band (_detalhes.overall_flag, 0x2) ~= 0) then
if (tabela.is_trash and tabela.instance_type == "raid") then
return true
end
end
--> dungeon boss - flag 0x4
if (bit.band (_detalhes.overall_flag, 0x4) ~= 0) then
if (tabela.is_boss and tabela.instance_type == "party" and not tabela.is_pvp) then
return true
end
end
--> dungeon trash - flag 0x8
if (bit.band (_detalhes.overall_flag, 0x8) ~= 0) then
if ((tabela.is_trash or tabela.is_mythic_dungeon_trash) and tabela.instance_type == "party") then
return true
end
end
--> any combat
if (bit.band (_detalhes.overall_flag, 0x10) ~= 0) then
return true
end
--> is a PvP combat
if (tabela.is_pvp or tabela.is_arena) then
return true
end
return false
end
--> sai do combate, chamou adicionar a tabela ao histórico
function historico:adicionar (tabela)
@@ -112,11 +218,10 @@ function historico:adicionar (tabela)
_detalhes:InstanciaCallFunction (_detalhes.CheckFreeze, tamanho+1, ultima_tabela)
end
--> adiciona no index #1
--> add to history table
_table_insert (self.tabelas, 1, tabela)
--_detalhes.encounter_counter
--> count boss tries
local boss = tabela.is_boss and tabela.is_boss.name
if (boss) then
local try_number = _detalhes.encounter_counter [boss]
@@ -142,73 +247,26 @@ function historico:adicionar (tabela)
tabela.is_boss.try_number = try_number
end
local overall_added = false
--> see if can add the encounter to overall data
local canAddToOverall = _detalhes:CanAddCombatToOverall (tabela)
if (not overall_added and bit.band (_detalhes.overall_flag, 0x1) ~= 0) then --> raid boss - flag 0x1
if (tabela.is_boss and tabela.instance_type == "raid" and not tabela.is_pvp) then
overall_added = true
end
--print ("0x1")
end
if (not overall_added and bit.band (_detalhes.overall_flag, 0x2) ~= 0) then --> raid trash - flag 0x2
if (tabela.is_trash and tabela.instance_type == "raid") then --check if the player is in a raid
overall_added = true
end
--print ("0x2")
end
if (not overall_added and bit.band (_detalhes.overall_flag, 0x4) ~= 0) then --> dungeon boss - flag 0x4
if (tabela.is_boss and tabela.instance_type == "party" and not tabela.is_pvp) then --check if this is a dungeon boss
overall_added = true
end
--print ("0x4")
end
if (not overall_added and bit.band (_detalhes.overall_flag, 0x8) ~= 0) then --> dungeon trash - flag 0x8
if (tabela.is_trash and tabela.instance_type == "party") then --check if the player is in a raid
overall_added = true
end
--print ("0x8")
end
if (not overall_added and bit.band (_detalhes.overall_flag, 0x10) ~= 0) then --> any combat
overall_added = true
--print ("0x10")
end
if (not overall_added and (tabela.is_pvp or tabela.is_arena)) then --> is a PvP combat
overall_added = true
--print ("0x10")
end
if (overall_added) then
if (tabela.is_boss and tabela:InstanceType() == "raid" and tabela:GetCombatTime() < 30) then
if (canAddToOverall) then
if (InCombatLockdown()) then
_detalhes:ScheduleAddCombatToOverall (tabela)
if (_detalhes.debug) then
_detalhes:Msg ("segment not added to overall (less than 30 seconds of combat time).")
_detalhes:Msg ("(debug) overall data flag match > in combat scheduling overall addition.")
end
else
if (_detalhes.debug) then
_detalhes:Msg ("(debug) overall data flag match with the current combat.")
end
if (InCombatLockdown()) then
_detalhes.schedule_add_to_overall = _detalhes.schedule_add_to_overall or {}
tinsert (_detalhes.schedule_add_to_overall, tabela)
if (_detalhes.debug) then
_detalhes:Msg ("(debug) player is in combat, scheduling overall addition.")
end
else
historico:adicionar_overall (tabela)
_detalhes:Msg ("(debug) overall data flag match addind the combat to overall data.")
end
historico:adicionar_overall (tabela)
end
end
--> erase trash segments
if (self.tabelas[2]) then
--> fazer limpeza na tabela
local _segundo_combate = self.tabelas[2]
local container_damage = _segundo_combate [1]
local container_heal = _segundo_combate [2]
@@ -236,10 +294,6 @@ function historico:adicionar (tabela)
if (_terceiro_combate) then
if ((_terceiro_combate.is_trash and not _terceiro_combate.is_boss) or (_terceiro_combate.is_temporary)) then
--if (_terceiro_combate.overall_added) then
-- _detalhes.tabela_overall = _detalhes.tabela_overall - _terceiro_combate
-- print ("removendo combate 1")
--end
--> verificar novamente a time machine
for _, jogador in ipairs (_terceiro_combate [1]._ActorTable) do --> damage
if (jogador.timeMachine) then
@@ -385,6 +439,16 @@ function historico:resetar()
_detalhes.last_closed_combat = nil
--> remove mythic dungeon schedules if any
_detalhes.schedule_mythicdungeon_trash_merge = nil
_detalhes.schedule_mythicdungeon_endtrash_merge = nil
_detalhes.schedule_mythicdungeon_overallrun_merge = nil
--> clear other schedules
_detalhes.schedule_flag_boss_components = nil
_detalhes.schedule_store_boss_encounter = nil
_detalhes.schedule_remove_overall = nil
--> fecha a janela de informações do jogador
_detalhes:FechaJanelaInfo()
+11 -7
View File
@@ -300,9 +300,9 @@
-- ~start ~inicio ~novo ñovo
function _detalhes:EntrarEmCombate (...)
if (_detalhes.debug) then
_detalhes:Msg ("(debug) |cFFFFFF00started a new combat|r|cFFFF7700", _detalhes.encounter_table and _detalhes.encounter_table.name or "")
local from = debugstack (2, 1, 0)
print (from)
--_detalhes:Msg ("(debug) |cFFFFFF00started a new combat|r|cFFFF7700", _detalhes.encounter_table and _detalhes.encounter_table.name or "")
--local from = debugstack (2, 1, 0)
--print (from)
end
if (not _detalhes.tabela_historico.tabelas[1]) then
@@ -312,7 +312,7 @@
_detalhes:InstanciaCallFunction (_detalhes.InstanciaFadeBarras, -1) --> esconde todas as barras
_detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos) --> atualiza o showing
end
--> re-lock nos tempos da tabela passada -- lock again last table times
_detalhes.tabela_vigente:TravarTempos()
@@ -336,7 +336,7 @@
--> é o timer que ve se o jogador ta em combate ou não -- check if any party or raid members are in combat
_detalhes.tabela_vigente.verifica_combate = _detalhes:ScheduleRepeatingTimer ("EstaEmCombate", 1)
_detalhes:ClearCCPetsBlackList()
_table_wipe (_detalhes.encounter_end_table)
@@ -514,9 +514,7 @@
if (not _detalhes.tabela_vigente.is_boss and from_encounter_end and type (from_encounter_end) == "table") then
local encounterID, encounterName, difficultyID, raidSize, endStatus = unpack (from_encounter_end)
if (encounterID) then
local ZoneName, InstanceType, DifficultyID, DifficultyName, _, _, _, ZoneMapID = GetInstanceInfo()
local ejid = EJ_GetCurrentInstance()
if (ejid == 0) then
@@ -542,7 +540,13 @@
if (_detalhes.MythicPlus.Started) then
_detalhes.tabela_vigente.is_mythic_dungeon_segment = true
_detalhes.tabela_vigente.is_mythic_dungeon_run_id = _detalhes.mythic_dungeon_id
else
local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo()
if (mythicLevel and mythicLevel >= 2) then
_detalhes.tabela_vigente.is_mythic_dungeon_segment = true
_detalhes.tabela_vigente.is_mythic_dungeon_run_id = _detalhes.mythic_dungeon_id
end
end
if (not _detalhes.tabela_vigente.is_boss) then
+19 -19
View File
@@ -4252,7 +4252,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
function _detalhes.parser_functions:PLAYER_REGEN_DISABLED (...)
if (not _detalhes:CaptureGet ("damage")) then
_detalhes:EntrarEmCombate()
end
@@ -4269,22 +4268,36 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
end
end
function _detalhes.parser_functions:PLAYER_REGEN_ENABLED (...)
function _detalhes.parser_functions:PLAYER_REGEN_ENABLED (...)
_detalhes.LatestCombatDone = GetTime()
_current_encounter_id = nil
--> playing alone, just finish the combat right now
if (not _IsInGroup() and not IsInRaid()) then
_detalhes.tabela_vigente.playing_solo = true
_detalhes:SairDoCombate()
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()
DetailsMythicPlusFrame.MergeTrashCleanup (true)
end
if (_detalhes.schedule_mythicdungeon_endtrash_merge) then
@@ -4313,7 +4326,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_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.")
@@ -4322,19 +4335,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes.tabela_historico:resetar_overall()
end
if (_detalhes.schedule_add_to_overall and _detalhes.schedule_add_to_overall [1]) 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_store_boss_encounter) then
if (not _detalhes.logoff_saving_data) then
--_detalhes.StoreEncounter()
+50 -4
View File
@@ -1253,10 +1253,11 @@
function f.BuildReport()
if (f.LatestResourceTable) then
local reportFunc = function (IsCurrent, IsReverse, AmtLines)
local bossName = f.select_boss.label:GetText()
local bossDiff = f.select_diff.label:GetText()
local reportTable = {"Details!: DPS Rank for: " .. (bossDiff or "") .. " " .. (bossName or "--x--x--")}
local guildName = f.select_guild.label:GetText()
local reportTable = {"Details!: DPS Rank for: " .. (bossDiff or "") .. " " .. (bossName or "--x--x--") .. " <" .. (guildName or "") .. ">"}
local result = {}
for i = 1, AmtLines do
@@ -1348,6 +1349,7 @@
--> select raid:
local on_raid_select = function (_, _, raid)
_detalhes.rank_window.last_raid = raid
f:UpdateDropdowns (true)
on_select()
end
@@ -1369,6 +1371,7 @@
--> select difficulty:
local on_diff_select = function (_, _, diff)
_detalhes.rank_window.last_difficulty = diff
on_select()
end
@@ -1494,6 +1497,20 @@
if (encounter) then
local InstanceID = _detalhes:GetInstanceIdFromEncounterId (encounterId)
if (raidSelected == InstanceID) then
--[=[
local bossIndex = _detalhes:GetBossIndex (InstanceID, encounterId)
if (bossIndex) then
local l, r, t, b, texturePath = _detalhes:GetBossIcon (InstanceID, bossIndex)
if (texturePath) then
tinsert (boss_list, {value = encounterId, label = encounter.boss, icon = texturePath, texcoord = {l, r, t, b}, onclick = on_boss_select})
else
tinsert (boss_list, {value = encounterId, label = encounter.boss, icon = icon, onclick = on_boss_select})
end
else
tinsert (boss_list, {value = encounterId, label = encounter.boss, icon = icon, onclick = on_boss_select})
end
--]=]
tinsert (boss_list, {value = encounterId, label = encounter.boss, icon = icon, onclick = on_boss_select})
boss_repeated [encounterId] = true
end
@@ -1576,6 +1593,19 @@
if (encounter) then
local InstanceID = _detalhes:GetInstanceIdFromEncounterId (encounterId)
if (raidSelected == InstanceID) then
--[=[
local bossIndex = _detalhes:GetBossIndex (InstanceID, encounterId)
if (bossIndex) then
local l, r, t, b, texturePath = _detalhes:GetBossIcon (InstanceID, bossIndex)
if (texturePath) then
tinsert (boss_list, {value = encounterId, label = encounter.boss, icon = texturePath, texcoord = {l, r, t, b}, onclick = on_boss_select})
else
tinsert (boss_list, {value = encounterId, label = encounter.boss, icon = icon, onclick = on_boss_select})
end
else
tinsert (boss_list, {value = encounterId, label = encounter.boss, icon = icon, onclick = on_boss_select})
end
--]=]
tinsert (boss_list, {value = encounterId, label = encounter.boss, icon = icon, onclick = on_boss_select})
boss_repeated [encounterId] = true
end
@@ -1897,10 +1927,11 @@
end
end
end
f.FirstRun = true
end
--> table means some button send the request - nil for other ways
if (type (_raid) == "table" or (not _raid and not _boss and not _difficulty and not _role and not _guild and not _player_base and not _player_name)) then
local f = _G.DetailsRaidHistoryWindow
@@ -1915,6 +1946,21 @@
end
end
if (_G.DetailsRaidHistoryWindow.FirstRun) then
_difficulty = _detalhes.rank_window.last_difficulty or _difficulty
if (IsInGuild()) then
local guildName = GetGuildInfo ("player")
if (guildName) then
_guild = guildName
end
end
if (_detalhes.rank_window.last_raid ~= "") then
_raid = _detalhes.rank_window.last_raid or _raid
end
_G.DetailsRaidHistoryWindow.FirstRun = nil
end
_G.DetailsRaidHistoryWindow:UpdateDropdowns()
_G.DetailsRaidHistoryWindow:UpdateDropdowns()
+16
View File
@@ -255,6 +255,22 @@ do
return nil
end
function _detalhes:GetBossIndex (mapid, encounterCLID, encounterEJID, encounterName)
local raidInfo = _detalhes.EncounterInformation [mapid]
if (raidInfo) then
local index = raidInfo.encounter_ids2 [encounterCLID] or raidInfo.encounter_ids [encounterEJID]
if (not index) then
for i = 1, #raidInfo.boss_names do
if (raidInfo.boss_names [i] == encounterName) then
index = i
break
end
end
end
return index
end
end
--> return the boss icon
function _detalhes:GetBossIcon (mapid, bossindex)
if (_detalhes.EncounterInformation [mapid]) then
+78
View File
@@ -1075,6 +1075,17 @@ local default_player_data = {
last_instance_id = 0,
last_instance_time = 0,
mythic_dungeon_id = 0,
mythic_dungeon_currentsaved = {
started = false,
run_id = 0,
dungeon_name = "",
dungeon_zone_id = 0,
started_at = 0,
segment_id = 0,
level = 0,
ej_id = 0,
previous_boss_killed_at = 0,
},
--> nicktag cache
nick_tag_cache = {},
ignore_nicktag = false,
@@ -1132,6 +1143,11 @@ local default_player_data = {
frame = {},
},
--> rank
rank_window = {
last_difficulty = 15,
last_raid = "",
},
}
_detalhes.default_player_data = default_player_data
@@ -1330,4 +1346,66 @@ function _detalhes:SaveProfileSpecial()
--> end
return profile
end
--> save things for the mythic dungeon run
function _detalhes:SaveState_CurrentMythicDungeonRun (runID, zoneName, zoneID, startAt, segmentID, level, ejID, latestBossAt)
local savedTable = _detalhes.mythic_dungeon_currentsaved
savedTable.started = true
savedTable.run_id = runID
savedTable.dungeon_name = zoneName
savedTable.dungeon_zone_id = zoneID
savedTable.started_at = startAt
savedTable.segment_id = segmentID
savedTable.level = level
savedTable.ej_id = ejID
savedTable.previous_boss_killed_at = latestBossAt
end
function _detalhes:UpdateState_CurrentMythicDungeonRun (stillOngoing, segmentID, latestBossAt)
local savedTable = _detalhes.mythic_dungeon_currentsaved
if (not stillOngoing) then
savedTable.started = false
end
if (segmentID) then
savedTable.segment_id = segmentID
end
if (latestBossAt) then
savedTable.previous_boss_killed_at = latestBossAt
end
end
function _detalhes:RestoreState_CurrentMythicDungeonRun()
local savedTable = _detalhes.mythic_dungeon_currentsaved
local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo()
local zoneName, _, _, _, _, _, _, currentZoneID = GetInstanceInfo()
local ejID = EJ_GetCurrentInstance()
--> is there a saved state for the dungeon?
if (savedTable.started) then
--> player are within the same zone?
if (zoneName == savedTable.dungeon_name and currentZoneID == savedTable.dungeon_zone_id) then
--> is there a mythic run ongoing and the level is the same as the saved state?
if (mythicLevel and mythicLevel == savedTable.level) then
--> restore the state
_detalhes.MythicPlus.Started = true
_detalhes.MythicPlus.DungeonName = zoneName
_detalhes.MythicPlus.DungeonID = currentZoneID
_detalhes.MythicPlus.StartedAt = savedTable.started_at
_detalhes.MythicPlus.SegmentID = savedTable.segment_id
_detalhes.MythicPlus.Level = mythicLevel
_detalhes.MythicPlus.ejID = ejID
_detalhes.MythicPlus.PreviousBossKilledAt = savedTable.previous_boss_killed_at
_detalhes.MythicPlus.IsRestoredState = true
DetailsMythicPlusFrame.IsDoingMythicDungeon = true
return
end
end
--> mythic run is over
savedTable.started = false
end
end
+3 -3
View File
@@ -117,11 +117,11 @@ do
[171746] = 103, -- Claws of Shirvallah
[22570] = 103, -- Maim
[16974] = 103, -- Predatory Swiftness
[106785] = 103, -- Swipe
[1079] = 103, -- Rip
--[106785] = 103, -- Swipe
--[1079] = 103, -- Rip
[52610] = 103, -- Savage Roar
[5217] = 103, -- Tiger's Fury
[1822] = 103, -- Rake
--[1822] = 103, -- Rake
-- Guardian Druid:
[155835] = 104, -- Bristling Fur
+25 -5
View File
@@ -6135,7 +6135,7 @@ local build_segment_list = function (self, elapsed)
if (trashInfo) then
local backgroundImage = _detalhes:GetRaidIcon (trashInfo.MapID, trashInfo.EJID, "party")
if (backgroundImage) then
CoolTip:SetWallpaper (2, backgroundImage, party_wallpaper_tex, {1, 1, 1, 0.5}, true)
CoolTip:SetWallpaper (2, backgroundImage, {0.070, 0.695, 0.087, 0.566}, {1, 1, 1, 0.5}, true)
end
end
end
@@ -6414,7 +6414,7 @@ local build_segment_list = function (self, elapsed)
local backgroundImage = _detalhes:GetRaidIcon (trashInfo.MapID, trashInfo.EJID, "party")
if (backgroundImage) then
CoolTip:SetWallpaper (2, backgroundImage, party_wallpaper_tex, {1, 1, 1, 0.5}, true)
CoolTip:SetWallpaper (2, backgroundImage, {0.070, 0.695, 0.087, 0.566}, {1, 1, 1, 0.5}, true)
end
end
@@ -6534,12 +6534,15 @@ local build_segment_list = function (self, elapsed)
local minutos, segundos = _math_floor (combat_time / 60), _math_floor (combat_time % 60)
CoolTip:AddLine (Loc ["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white")
CoolTip:SetWallpaper (2, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsComparisonBackground]], {0.085, 166/256, 0, 1}, {.42, .4, .4, 0.9}, true)
if (_detalhes.tooltip.submenu_wallpaper) then
CoolTip:SetWallpaper (2, [[Interface\PetPaperDollFrame\PetStatsBG-Hunter]], {321/512, 0, 0, 190/512}, {1, 1, 1, 0.9}, true)
--CoolTip:SetWallpaper (2, [[Interface\PetPaperDollFrame\PetStatsBG-Hunter]], {321/512, 0, 0, 190/512}, {1, 1, 1, 0.9}, true)
--CoolTip:SetWallpaper (2, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsComparisonBackground]], {166/256, 1, 0, 1}, {1, 1, 1, 0.9}, true)
else
--> wallpaper = main window
CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true)
--CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true)
end
CoolTip:AddLine (Loc ["STRING_SEGMENT_START"] .. ":", _detalhes.tabela_overall.data_inicio, 2, "white", "white")
@@ -6562,6 +6565,23 @@ local build_segment_list = function (self, elapsed)
end
CoolTip:AddLine ("" .. name, minutos.."m "..segundos.."s", 2, "white", "white")
local segmentType = segment.type
if (segmentType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASH) then
CoolTip:AddIcon ([[Interface\AddOns\Details\images\icons]], 2, 1, 12, 8, 479/512, 510/512, 24/512, 51/512, nil, nil, true)
elseif (segmentType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSS) then
CoolTip:AddIcon ([[Interface\AddOns\Details\images\icons]], 2, 1, 12, 12, 0.96875, 1, 0, 0.03125, party_line_color)
elseif (segmentType == DETAILS_SEGMENTTYPE_RAID_TRASH or segmentType == DETAILS_SEGMENTTYPE_DUNGEON_TRASH) then
CoolTip:AddIcon ([[Interface\AddOns\Details\images\icons]], 2, 1, 10, 8, 0.02734375, 0.11328125, 0.19140625, 0.3125)
elseif (segmentType == DETAILS_SEGMENTTYPE_RAID_BOSS) then
CoolTip:AddIcon ([[Interface\AddOns\Details\images\icons]], 2, 1, 12, 12, 0.96875, 1, 0, 0.03125)
end
--CoolTip:AddStatusBar (100, 2, 0, 0, 0, 0.2, false, false, "Skyline")
end
--> fill é a quantidade de menu que esta sendo mostrada
+183 -54
View File
@@ -316,6 +316,7 @@ function _G._detalhes:Start()
newFrame:RegisterEvent ("CHALLENGE_MODE_COMPLETED")
newFrame:RegisterEvent ("ZONE_CHANGED_NEW_AREA")
newFrame:RegisterEvent ("ENCOUNTER_END")
newFrame:RegisterEvent ("START_TIMER")
--]]
--[[
@@ -338,7 +339,7 @@ function _G._detalhes:Start()
-- at the end of a mythic run, if enable on settings, merge all the segments from the mythic run into only one
function newFrame.MergeSegmentsOnEnd()
if (newFrame.DevelopmentDebug) then
print ("Details!", "MythicDungeonFinished() > starting to merge mythic segments.", "InCombatLockdown():", InCombatLockdown())
print ("Details!", "MergeSegmentsOnEnd() > starting to merge mythic segments.", "InCombatLockdown():", InCombatLockdown())
end
--> create a new combat to be the overall for the mythic run
@@ -351,11 +352,12 @@ function _G._detalhes:Start()
local totalTime = 0
local startDate, endDate = "", ""
local lastSegment
local totalSegments = 0
--> add all boss segments from this run to this new segment
for i = 1, 25 do --> from the newer combat to the oldest
local pastCombat = segmentHistory [i]
if (pastCombat and pastCombat.is_mythic_dungeon and pastCombat.is_mythic_dungeon.RunID == self.mythic_dungeon_id) then
if (pastCombat and pastCombat.is_mythic_dungeon_run_id == self.mythic_dungeon_id) then
local canAddThisSegment = true
if (_detalhes.mythic_plus.make_overall_boss_only) then
if (not pastCombat.is_boss) then
@@ -366,9 +368,10 @@ function _G._detalhes:Start()
if (canAddThisSegment) then
newCombat = newCombat + pastCombat
totalTime = totalTime + pastCombat:GetCombatTime()
totalSegments = totalSegments + 1
if (newFrame.DevelopmentDebug) then
print ("MythicDungeonFinished() > adding time:", pastCombat:GetCombatTime(), pastCombat.is_boss and pastCombat.is_boss.name)
print ("MergeSegmentsOnEnd() > adding time:", pastCombat:GetCombatTime(), pastCombat.is_boss and pastCombat.is_boss.name)
end
if (endDate == "") then
@@ -386,7 +389,7 @@ function _G._detalhes:Start()
end
if (newFrame.DevelopmentDebug) then
print ("Details!", "MythicDungeonFinished() > totalTime:", totalTime, "startDate:", startDate)
print ("Details!", "MergeSegmentsOnEnd() > totalTime:", totalTime, "startDate:", startDate)
end
local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo()
@@ -404,6 +407,8 @@ function _G._detalhes:Start()
EJID = self.MythicPlus.ejID,
}
newCombat.total_segments_added = totalSegments
newCombat.is_mythic_dungeon_segment = true
newCombat.is_mythic_dungeon_run_id = self.mythic_dungeon_id
@@ -423,14 +428,22 @@ function _G._detalhes:Start()
self:AtualizaGumpPrincipal (-1, true)
if (newFrame.DevelopmentDebug) then
print ("Details!", "MythicDungeonFinished() > finished merging segments.")
print ("Details!", "MythicDungeonFinished() > all done, check in the segments list if everything is correct, if something is weird: '/details feedback' thanks in advance!")
print ("Details!", "MergeSegmentsOnEnd() > finished merging segments.")
print ("Details!", "MergeSegmentsOnEnd() > all done, check in the segments list if everything is correct, if something is weird: '/details feedback' thanks in advance!")
end
local lower_instance = self:GetLowerInstanceNumber()
if (lower_instance) then
local instance = self:GetInstance (lower_instance)
if (instance) then
local func = {function() end}
instance:InstanceAlert ("Showing Mythic+ Overall Segment", {[[Interface\AddOns\Details\images\icons]], 16, 16, false, 434/512, 466/512, 243/512, 273/512}, 6, func, true)
end
end
end
--> after each boss fight, if enalbed on settings, create an extra segment with all trash segments from the boss just killed
function newFrame.MergeTrashCleanup()
function newFrame.MergeTrashCleanup (isFromSchedule)
if (newFrame.DevelopmentDebug) then
print ("Details!", "MergeTrashCleanup() > running", newFrame.TrashMergeScheduled and #newFrame.TrashMergeScheduled)
end
@@ -506,44 +519,84 @@ function _G._detalhes:Start()
--> immediatly finishes the segment just started
self:SairDoCombate()
--o combate agora é _tabela_vigente e [1] na tabela de overall
--seria necessario passar essa tabela para [2] na overall
local segmentHistory = self:GetCombatSegments()
local bossSegment = segmentHistory [2]
if (bossSegment) then
--set the boss as the current combat
_detalhes.tabela_vigente = bossSegment
--swap tables
segmentHistory [1] = bossSegment --as the boss combat is done, it is also the first combat in the past combats table
segmentHistory [2] = newCombat --se the overall trash as the second segment on the past table (the semgnet 2 was occupy by the boss segment)
end
--> update all windows
self:InstanciaCallFunction (self.gump.Fade, "in", nil, "barras")
self:InstanciaCallFunction (self.AtualizaSegmentos)
self:InstanciaCallFunction (self.AtualizaSoloMode_AfertReset)
self:InstanciaCallFunction (self.ResetaGump)
self:AtualizaGumpPrincipal (-1, true)
--> if was scheduled, needs to reorder the segments so it will the in the correct order
if (isFromSchedule) then
local bossSegment = segmentHistory [3]
local currentTrash = segmentHistory [2]
local trashOverall = segmentHistory [1]
local bossCLID = bossSegment and bossSegment.is_mythic_dungeon and bossSegment.is_mythic_dungeon.EncounterID
local trashCLID = trashOverall and trashOverall.is_mythic_dungeon and trashOverall.is_mythic_dungeon.EncounterID
--> check if the guessed boss and guessed trash overall segments are from the same boss
if (bossCLID == trashCLID and currentTrash.is_mythic_dungeon_trash) then
--set the boss as the current combat
_detalhes.tabela_vigente = currentTrash
--swap tables
segmentHistory [1] = currentTrash
segmentHistory [2] = bossSegment
segmentHistory [3] = trashOverall
else
--> if it fails to guess which are the boss and trash, just pull the current trash segment to index 1
local currentTrash = segmentHistory [2]
if (currentTrash) then
--set the boss as the current combat
_detalhes.tabela_vigente = currentTrash
--swap tables
segmentHistory [1] = currentTrash --as the boss combat is done, it is also the first combat in the past combats table
segmentHistory [2] = newCombat --se the overall trash as the second segment on the past table (the semgnet 2 was occupy by the boss segment)
end
end
else
local bossSegment = segmentHistory [2]
if (bossSegment) then
--set the boss as the current combat
_detalhes.tabela_vigente = bossSegment
--swap tables
segmentHistory [1] = bossSegment --as the boss combat is done, it is also the first combat in the past combats table
segmentHistory [2] = newCombat --se the overall trash as the second segment on the past table (the semgnet 2 was occupy by the boss segment)
end
end
if (newFrame.DevelopmentDebug) then
print ("Details!", "MergeTrashCleanup() > finished merging trash segments.", _detalhes.tabela_vigente, _detalhes.tabela_vigente.is_boss)
end
for i = #segmentsToMerge, 1, -1 do
local segment = segmentsToMerge [i]
if (segment == _detalhes.tabela_vigente) then
_detalhes:Msg ("unhandled exception > merged trash segment is current segment > MergeTrashCleanup() is scheduled:", isFromSchedule)
end
end
--> should delete the trash segments after the merge?
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) then
wipe (segment)
if (segment == pastCombat and _detalhes.tabela_vigente ~= segment) then
--> double check if the combat should be added first to overall data
if (_detalhes:CanAddCombatToOverall (segment)) then
--> actuallt is handled, but shouldn't happen, need to know which boss are triggering this
--_detalhes:Msg ("unhandled exception > attempt to erase a segment valid to overall data > MergeTrashCleanup() is scheduled:", isFromSchedule)
_detalhes.historico:adicionar_overall (segment)
end
--> remove the segment
tremove (segmentHistory, i)
break
end
end
end
wipe (segmentsToMerge)
for i = #segmentsToMerge, 1, -1 do
tremove (segmentsToMerge, i)
end
self:SendEvent ("DETAILS_DATA_SEGMENTREMOVED")
else
--> clear the segments to merge table
@@ -557,6 +610,13 @@ function _G._detalhes:Start()
segmentsToMerge.EncounterID = nil
segmentsToMerge.EncounterName = nil
end
--> update all windows
self:InstanciaCallFunction (self.gump.Fade, "in", nil, "barras")
self:InstanciaCallFunction (self.AtualizaSegmentos)
self:InstanciaCallFunction (self.AtualizaSoloMode_AfertReset)
self:InstanciaCallFunction (self.ResetaGump)
self:AtualizaGumpPrincipal (-1, true)
end
end
@@ -616,20 +676,36 @@ function _G._detalhes:Start()
print ("MergeRemainingTrashAfterAllBossesDone() > elapsed time after:", mythicDungeonInfo.EndedAt - mythicDungeonInfo.StartedAt)
end
for i = #segmentsToMerge, 1, -1 do
local segment = segmentsToMerge [i]
if (segment == _detalhes.tabela_vigente) then
_detalhes:Msg ("unhandled exception > merged trash segment is current segment > MergeRemainingTrashAfterAllBossesDone()")
end
end
--> should delete the trash segments after the merge?
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) then
wipe (segment)
if (segment == pastCombat and _detalhes.tabela_vigente ~= segment) then
--> double check if the combat should be added first to overall data
if (_detalhes:CanAddCombatToOverall (segment)) then
--> actuallt is handled, but shouldn't happen, need to know which boss are triggering this
--_detalhes:Msg ("unhandled exception > attempt to erase a segment valid to overall data > MergeRemainingTrashAfterAllBossesDone()")
_detalhes.historico:adicionar_overall (segment)
end
--> remove the segment
tremove (segmentHistory, i)
break
end
end
end
wipe (segmentsToMerge)
for i = #segmentsToMerge, 1, -1 do
tremove (segmentsToMerge, i)
end
self:SendEvent ("DETAILS_DATA_SEGMENTREMOVED")
else
--> clear the segments to merge table
@@ -681,7 +757,7 @@ function _G._detalhes:Start()
end
--> check if need to merge the trash for this boss
if (_detalhes.mythic_plus.merge_boss_trash) then
if (_detalhes.mythic_plus.merge_boss_trash and not self.MythicPlus.IsRestoredState) then
--> store on an table all segments which should be merged
local segmentsToMerge = newFrame.TrashMergeScheduled or {}
--> table with all past semgnets
@@ -745,10 +821,13 @@ function _G._detalhes:Start()
--> register the time when the last boss has been killed (started a clean up for the next trash)
self.MythicPlus.PreviousBossKilledAt = time()
--> update the saved table inside the profile
_detalhes:UpdateState_CurrentMythicDungeonRun (true, self.MythicPlus.SegmentID, self.MythicPlus.PreviousBossKilledAt)
end
end
function newFrame.MythicDungeonFinished()
function newFrame.MythicDungeonFinished (fromZoneLeft)
if (newFrame.IsDoingMythicDungeon) then
if (newFrame.DevelopmentDebug) then
print ("Details!", "MythicDungeonFinished() > the dungeon was a Mythic+ and just ended.")
@@ -758,6 +837,8 @@ function _G._detalhes:Start()
self.MythicPlus.Started = false
self.MythicPlus.EndedAt = time()-1.9
self:UpdateState_CurrentMythicDungeonRun()
--> at this point, details! should not be in combat, but if something triggered a combat start, just close the combat right away
if (self.in_combat) then
if (newFrame.DevelopmentDebug) then
@@ -769,7 +850,7 @@ function _G._detalhes:Start()
local segmentsToMerge = {}
--> check if there is trash segments after the last boss. need to merge these segments with the trash segment of the last boss
if (_detalhes.mythic_plus.merge_boss_trash) then
if (_detalhes.mythic_plus.merge_boss_trash and not self.MythicPlus.IsRestoredState and not fromZoneLeft) then --and false
--> is the current combat not a boss fight? this means a combat was opened after the mythic run completed
if (not self.tabela_vigente.is_boss and self.tabela_vigente:GetCombatTime() > 5) then
if (newFrame.DevelopmentDebug) then
@@ -807,7 +888,7 @@ function _G._detalhes:Start()
end
end
if (#segmentsToMerge > 0) then
if (#segmentsToMerge > 0) then --and false
if (newFrame.DevelopmentDebug) then
print ("Details!", "MythicDungeonFinished() > found ", #segmentsToMerge, "segments after the last boss")
end
@@ -843,7 +924,7 @@ function _G._detalhes:Start()
end
--> merge segments
if (_detalhes.mythic_plus.make_overall_when_done) then
if (_detalhes.mythic_plus.make_overall_when_done and not self.MythicPlus.IsRestoredState and not fromZoneLeft) then
if (not InCombatLockdown() and not UnitAffectingCombat ("player")) then
if (newFrame.DevelopmentDebug) then
print ("Details!", "MythicDungeonFinished() > not in combat, creating overall segment now")
@@ -856,6 +937,17 @@ function _G._detalhes:Start()
_detalhes.schedule_mythicdungeon_overallrun_merge = true
end
end
self.MythicPlus.IsRestoredState = nil
--> shutdown parser for a few seconds to avoid opening new segments after the run ends
if (not fromZoneLeft) then
self:CaptureSet (false, "damage", false, 15)
self:CaptureSet (false, "energy", false, 15)
self:CaptureSet (false, "aura", false, 15)
self:CaptureSet (false, "energy", false, 15)
self:CaptureSet (false, "spellcast", false, 15)
end
end
end
@@ -871,6 +963,9 @@ function _G._detalhes:Start()
print ("Details!", "MythicDungeonStarted() > CHALLENGE_MODE_START triggered, setting up details!")
end
--> this counter is individual for each character
self.mythic_dungeon_id = self.mythic_dungeon_id + 1 --14 --15
local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo()
local zoneName, _, _, _, _, _, _, currentZoneID = GetInstanceInfo()
local ejID = EJ_GetCurrentInstance()
@@ -880,13 +975,13 @@ function _G._detalhes:Start()
self.MythicPlus.DungeonName = zoneName
self.MythicPlus.DungeonID = currentZoneID
self.MythicPlus.StartedAt = time()+9.7 --> there's the countdown timer of 10 seconds
self.MythicPlus.EndedAt = nil --reset
self.MythicPlus.SegmentID = 1
self.MythicPlus.Level = mythicLevel
self.MythicPlus.ejID = ejID
self.MythicPlus.PreviousBossKilledAt = time()
--> this counter is individual for each character
self.mythic_dungeon_id = self.mythic_dungeon_id + 1 --14 --15
self:SaveState_CurrentMythicDungeonRun (self.mythic_dungeon_id, zoneName, currentZoneID, time()+9.7, 1, mythicLevel, ejID, time())
--> start a new combat segment after 10 seconds
if (_detalhes.mythic_plus.always_in_combat) then
@@ -901,6 +996,8 @@ function _G._detalhes:Start()
local name, groupType, difficultyID, difficult = GetInstanceInfo()
if (groupType == "party" and self.overall_clear_newchallenge) then
self.historico:resetar_overall()
self:Msg ("overall data are now reset.")
if (self.debug) then
self:Msg ("(debug) timer is for a mythic+ dungeon, overall has been reseted.")
end
@@ -911,26 +1008,43 @@ function _G._detalhes:Start()
end
end
function newFrame.OnChallengeModeStart()
--> is this a mythic dungeon?
local _, _, difficulty, _, _, _, _, currentZoneID = GetInstanceInfo()
if (newFrame.DevelopmentDebug) then
print ("Details!", "Dungeon Dificulty:", difficulty, currentZoneID)
end
if (difficulty == 8 and newFrame.LastTimer and newFrame.LastTimer+2 > GetTime()) then
--> start the dungeon on Details!
newFrame.MythicDungeonStarted()
else
--> from zone changed
local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo()
local zoneName, _, _, _, _, _, _, currentZoneID = GetInstanceInfo()
if (not self.MythicPlus.Started and self.MythicPlus.DungeonID == currentZoneID and self.MythicPlus.Level == mythicLevel) then
self.MythicPlus.Started = true
self.MythicPlus.EndedAt = nil
_detalhes.mythic_dungeon_currentsaved.started = true
newFrame.IsDoingMythicDungeon = true
end
end
end
newFrame:SetScript ("OnEvent", function (_, event, ...)
if (event == "CHALLENGE_MODE_START") then
if (event == "START_TIMER") then
newFrame.LastTimer = GetTime()
elseif (event == "CHALLENGE_MODE_START") then
--> CHALLENGE_MODE_START does trigger every time the player enters a mythic dungeon already in progress
if (newFrame.DevelopmentDebug) then
print ("Details!", event, ...)
end
--> is this a mythic dungeon?
local _, _, difficulty, _, _, _, _, currentZoneID = GetInstanceInfo()
if (newFrame.DevelopmentDebug) then
print ("Details!", "Dungeon Dificulty:", difficulty, currentZoneID)
end
if (difficulty == 8) then
--> start the dungeon on Details!
newFrame.MythicDungeonStarted()
end
C_Timer.After (0.5, newFrame.OnChallengeModeStart)
elseif (event == "CHALLENGE_MODE_COMPLETED") then
if (newFrame.DevelopmentDebug) then
@@ -963,7 +1077,19 @@ function _G._detalhes:Start()
end
self:SairDoCombate()
end
--> just in case the combat get tagged as boss fight
self.tabela_vigente.is_boss = nil
--> tag the combat as mythic dungeon trash
local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo()
self.tabela_vigente.is_mythic_dungeon_trash = {
ZoneName = zoneName,
MapID = instanceMapID,
Level = _detalhes.MythicPlus.Level,
EJID = _detalhes.MythicPlus.ejID,
}
end
end
end
@@ -983,7 +1109,7 @@ function _G._detalhes:Start()
newFrame.BossDefeated (true)
--> finish the mythic run
newFrame.MythicDungeonFinished()
newFrame.MythicDungeonFinished (true)
end
end
@@ -1306,6 +1432,9 @@ function _G._detalhes:Start()
if (not _detalhes.schedule_chat_enter and not _detalhes.schedule_chat_leave) then
_detalhes:ScheduleTimer ("CheckChatOnZoneChange", 60)
end
--> restore mythic dungeon state
_detalhes:RestoreState_CurrentMythicDungeonRun()
--> open profiler
_detalhes:OpenProfiler()