- testing the mercurial repo packpager.

This commit is contained in:
Tercio
2017-09-19 12:56:32 -03:00
parent 1b07ba9276
commit 7df507bd46
48 changed files with 2860 additions and 532 deletions
+48 -27
View File
@@ -146,7 +146,7 @@
end
end
end
_detalhes.tabela_vigente.is_boss = boss_table
if (_detalhes.in_combat and not _detalhes.leaving_combat) then
@@ -239,7 +239,7 @@
end
--try to get the encounter name after the encounter (can be called during the combat as well)
function _detalhes:FindBoss()
function _detalhes:FindBoss (noJournalSearch)
if (_detalhes.encounter_table.name) then
local encounter_table = _detalhes.encounter_table
@@ -269,24 +269,27 @@
end
end
local in_instance = IsInInstance() --> garrison returns party as instance type.
if ((InstanceType == "party" or InstanceType == "raid") and in_instance) then
local boss_list = _detalhes:GetCurrentDungeonBossListFromEJ()
if (boss_list) then
local ActorsContainer = _detalhes.tabela_vigente [class_type_dano]._ActorTable
if (ActorsContainer) then
for index, Actor in _ipairs (ActorsContainer) do
if (not Actor.grupo) then
if (boss_list [Actor.nome]) then
Actor.boss = true
return boss_found_not_registered (boss_list [Actor.nome], ZoneName, ZoneMapID, DifficultyID)
noJournalSearch = true --> disabling the scan on encounter journal
if (not noJournalSearch) then
local in_instance = IsInInstance() --> garrison returns party as instance type.
if ((InstanceType == "party" or InstanceType == "raid") and in_instance) then
local boss_list = _detalhes:GetCurrentDungeonBossListFromEJ()
if (boss_list) then
local ActorsContainer = _detalhes.tabela_vigente [class_type_dano]._ActorTable
if (ActorsContainer) then
for index, Actor in _ipairs (ActorsContainer) do
if (not Actor.grupo) then
if (boss_list [Actor.nome]) then
Actor.boss = true
return boss_found_not_registered (boss_list [Actor.nome], ZoneName, ZoneMapID, DifficultyID)
end
end
end
end
end
end
end
return false
end
@@ -460,12 +463,13 @@
_detalhes:CatchRaidDebuffUptime ("DEBUFF_UPTIME_OUT")
_detalhes:CloseEnemyDebuffsUptime()
--> pega a zona do jogador e vê se foi uma luta contra um Boss -- identifica se a luta foi com um boss
--> check if this isn't a boss and try to find a boss in the segment
if (not _detalhes.tabela_vigente.is_boss) then
--> function which runs after a boss encounter to try recognize a encounter
--> if this is a mythic+ dungeon, do not scan for encounter journal boss names in the actor list
_detalhes:FindBoss()
--> still didn't find the boss
if (not _detalhes.tabela_vigente.is_boss) then
local ZoneName, _, DifficultyID, _, _, _, _, ZoneMapID = _GetInstanceInfo()
local findboss = _detalhes:GetRaidBossFindFunction (ZoneMapID)
@@ -512,6 +516,7 @@
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
@@ -531,8 +536,14 @@
id = encounterID,
}
end
end
end
--> tag as a mythic dungeon segment, can be any type of segment, this tag also avoid the segment to be tagged as trash
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
end
if (not _detalhes.tabela_vigente.is_boss) then
if (_detalhes.tabela_vigente.is_pvp or _detalhes.tabela_vigente.is_arena) then
@@ -542,16 +553,22 @@
if (_detalhes.tabela_vigente.is_arena) then
_detalhes.tabela_vigente.enemy = "[" .. ARENA .. "] " .. _detalhes.tabela_vigente.is_arena.name
end
local in_instance = IsInInstance() --> garrison returns party as instance type.
if ((InstanceType == "party" or InstanceType == "raid") and in_instance) then
if (InstanceType == "party") then
--if (_detalhes:GetBossNames (_detalhes.zone_id)) then
-- _detalhes.tabela_vigente.is_trash = true
--end
--> is new dungeon?
_detalhes.tabela_vigente.is_trash = true
if (not _detalhes.tabela_vigente.is_mythic_dungeon_segment) then
--> tag the combat as trash clean up
_detalhes.tabela_vigente.is_trash = true
else
local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo()
_detalhes.tabela_vigente.is_mythic_dungeon_trash = {
ZoneName = zoneName,
MapID = instanceMapID,
Level = _detalhes.MythicPlus.Level,
EJID = _detalhes.MythicPlus.ejID,
}
end
else
_detalhes.tabela_vigente.is_trash = true
end
@@ -636,7 +653,7 @@
end
if (from_encounter_end) then
_detalhes.tabela_vigente:SetEndTime (_detalhes.encounter_table ["end"])
_detalhes.tabela_vigente:SetEndTime (_detalhes.encounter_table ["end"] or GetTime())
end
--> encounter boss function
@@ -1614,6 +1631,10 @@
instancia = self
end
if (not forcar) then
_detalhes.LastUpdateTick = _detalhes._tempo
end
if (instancia == -1) then
--> update
+273 -30
View File
@@ -689,12 +689,59 @@ function _detalhes.storage:OpenRaidStorage()
return db
end
function _detalhes.storage:GetBestFromGuild (diff, encounter_id, role)
function _detalhes.storage:HaveDataForEncounter (diff, encounter_id, guild_name)
local db = _detalhes.storage:OpenRaidStorage()
if (not db) then
return
end
if (guild_name and type (guild_name) == "boolean") then
guild_name = GetGuildInfo ("player")
end
local table = db [diff]
if (table) then
local encounters = table [encounter_id]
if (encounters) then
--> didn't requested a guild name, so just return 'we have data for this encounter'
if (not guild_name) then
return true
end
--> data for a specific guild is requested, check if there is data for the guild
for index, encounter in ipairs (encounters) do
if (encounter.guild == guild_name) then
return true
end
end
end
end
end
function _detalhes.storage:GetBestFromGuild (diff, encounter_id, role, dps, guild_name)
local db = _detalhes.storage:OpenRaidStorage()
if (not db) then
return
end
if (not guild_name) then
guild_name = GetGuildInfo ("player")
end
if (not guild_name) then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) GetBestFromGuild() guild name invalid.")
end
return
end
local best = 0
local bestdps = 0
local bestplayername
local onencounter
local bestactor
if (not role) then
role = "damage"
@@ -711,14 +758,26 @@ function _detalhes.storage:GetBestFromGuild (diff, encounter_id, role)
local encounters = table [encounter_id]
if (encounters) then
for index, encounter in ipairs (encounters) do
local players = encounter [role]
if (players) then
for playername, t in pairs (players) do
if (t[1] > best) then
best = t [1]
bestplayername = playername
onencounter = encounter
if (encounter.guild == guild_name) then
local players = encounter [role]
if (players) then
for playername, t in pairs (players) do
if (dps) then
if (t[1]/encounter.elapsed > bestdps) then
bestdps = t[1]/encounter.elapsed
bestplayername = playername
onencounter = encounter
bestactor = t
end
else
if (t[1] > best) then
best = t [1]
bestplayername = playername
onencounter = encounter
bestactor = t
end
end
end
end
end
@@ -726,14 +785,107 @@ function _detalhes.storage:GetBestFromGuild (diff, encounter_id, role)
end
end
return best, bestplayername, onencounter
return t, onencounter
end
function _detalhes.storage:GetBestFromPlayer (diff, encounter_id, role, playername)
function _detalhes.storage:GetPlayerGuildRank (diff, encounter_id, role, playername, dps, guild_name)
local db = _detalhes.storage:OpenRaidStorage()
if (not db) then
return
end
if (not guild_name) then
guild_name = GetGuildInfo ("player")
end
if (not guild_name) then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) GetBestFromGuild() guild name invalid.")
end
return
end
if (not role) then
role = "damage"
end
role = string.lower (role)
if (role == "damager") then
role = "damage"
elseif (role == "healer") then
role = "healing"
end
local playerScore = {}
local _table = db [diff]
if (_table) then
local encounters = _table [encounter_id]
if (encounters) then
for index, encounter in ipairs (encounters) do
if (encounter.guild == guild_name) then
local roleTable = encounter [role]
for playerName, playerTable in pairs (roleTable) do
if (not playerScore [playerName]) then
playerScore [playerName] = {0, 0, {}}
end
local total = playerTable[1]
local persecond = total / encounter.elapsed
if (dps) then
if (persecond > playerScore [playerName][2]) then
playerScore [playerName][1] = total
playerScore [playerName][2] = total / encounter.elapsed
playerScore [playerName][3] = playerTable
playerScore [playerName][4] = encounter
end
else
if (total > playerScore [playerName][1]) then
playerScore [playerName][1] = total
playerScore [playerName][2] = total / encounter.elapsed
playerScore [playerName][3] = playerTable
playerScore [playerName][4] = encounter
end
end
end
end
end
if (not playerScore [playername]) then
return
end
local t = {}
for playerName, playerTable in pairs (playerScore) do
playerTable [5] = playerName
tinsert (t, playerTable)
end
table.sort (t, dps and _detalhes.Sort2 or _detalhes.Sort1)
for i = 1, #t do
if (t[i][5] == playername) then
return t[i][3], t[i][4], i
end
end
end
end
end
function _detalhes.storage:GetBestFromPlayer (diff, encounter_id, role, playername, dps)
local db = _detalhes.storage:OpenRaidStorage()
if (not db) then
return
end
local best
local onencounter
local topdps
if (not role) then
role = "damage"
@@ -753,13 +905,22 @@ function _detalhes.storage:GetBestFromPlayer (diff, encounter_id, role, playerna
local player = encounter [role] and encounter [role] [playername]
if (player) then
if (best) then
if (player[1] > best[1]) then
onencounter = encounter
best = player
if (dps) then
if (player[1]/encounter.elapsed > topdps) then
onencounter = encounter
best = player
topdps = player[1]/encounter.elapsed
end
else
if (player[1] > best[1]) then
onencounter = encounter
best = player
end
end
else
onencounter = encounter
best = player
topdps = player[1]/encounter.elapsed
end
end
end
@@ -1133,6 +1294,94 @@ function _detalhes.storage:GetEncounterData (diff, encounter_id, guild)
return t
end
local create_storage_tables = function()
--> get the storage table
local db = DetailsDataStorage
if (not db and _detalhes.CreateStorageDB) then
db = _detalhes:CreateStorageDB()
if (not db) then
return
end
elseif (not db) then
return
end
return db
end
function _detalhes.ScheduleLoadStorage()
if (InCombatLockdown() or UnitAffectingCombat ("player")) then
if (_detalhes.debug) then
print ("|cFFFFFF00Details! storage scheduled to load (player in combat).")
end
_detalhes.schedule_storage_load = true
return
else
if (not IsAddOnLoaded ("Details_DataStorage")) then
local loaded, reason = LoadAddOn ("Details_DataStorage")
if (not loaded) then
if (_detalhes.debug) then
print ("|cFFFFFF00Details! Storage|r: can't load storage, may be the addon is disabled.")
end
return
end
create_storage_tables()
end
end
if (IsAddOnLoaded ("Details_DataStorage")) then
_detalhes.schedule_storage_load = nil
_detalhes.StorageLoaded = true
if (_detalhes.debug) then
print ("|cFFFFFF00Details! storage loaded.")
end
else
if (_detalhes.debug) then
print ("|cFFFFFF00Details! fail to load storage, scheduled once again.")
end
_detalhes.schedule_storage_load = true
end
end
function _detalhes.GetStorage()
return DetailsDataStorage
end
function _detalhes.OpenStorage()
--if the player is in combat, this function return false, if failed to load by other reason it returns nil
--> check if the storage is already loaded
if (not IsAddOnLoaded ("Details_DataStorage")) then
--> can't open it during combat
if (InCombatLockdown() or UnitAffectingCombat ("player")) then
if (_detalhes.debug) then
print ("|cFFFFFF00Details! Storage|r: can't load storage due to combat.")
end
return false
end
local loaded, reason = LoadAddOn ("Details_DataStorage")
if (not loaded) then
if (_detalhes.debug) then
print ("|cFFFFFF00Details! Storage|r: can't load storage, may be the addon is disabled.")
end
return
end
local db = create_storage_tables()
if (db and IsAddOnLoaded ("Details_DataStorage")) then
_detalhes.StorageLoaded = true
end
return DetailsDataStorage
else
return DetailsDataStorage
end
end
function _detalhes:StoreEncounter (combat)
combat = combat or _detalhes.tabela_vigente
@@ -1238,7 +1487,7 @@ function _detalhes:StoreEncounter (combat)
elapsed = combat:GetCombatTime(),
guild = guildName,
}
local damage_container_hash = combat [1]._NameIndexTable
local damage_container_pool = combat [1]._ActorTable
@@ -1282,35 +1531,29 @@ function _detalhes:StoreEncounter (combat)
tinsert (encounter_database, this_combat_data)
print ("|cFFFFFF00Details! Storage|r: encounter saved!")
--print ("|cFFFFFF00Details! Storage|r: encounter saved!")
local myrole = UnitGroupRolesAssigned ("player")
local mybest, onencounter = _detalhes.storage:GetBestFromPlayer (diff, encounter_id, myrole, _detalhes.playername)
local mybest, onencounter = _detalhes.storage:GetBestFromPlayer (diff, encounter_id, myrole, _detalhes.playername, true) --> get dps or hps
local myBestDps = mybest [1] / onencounter.elapsed
--print (myrole, mybest and mybest[1], mybest and mybest[2], mybest and mybest[3], onencounter and onencounter.date)
if (mybest) then
local d_one = 0
if (myrole == "DAMAGER" or myrole == "TANK") then
d_one = combat (1, _detalhes.playername) and combat (1, _detalhes.playername).total
d_one = combat (1, _detalhes.playername) and combat (1, _detalhes.playername).total / combat:GetCombatTime()
elseif (myrole == "HEALER") then
d_one = combat (2, _detalhes.playername) and combat (2, _detalhes.playername).total
d_one = combat (2, _detalhes.playername) and combat (2, _detalhes.playername).total / combat:GetCombatTime()
end
if (mybest[1] > d_one) then
print (Loc ["STRING_DETAILS1"] .. format (Loc ["STRING_SCORE_NOTBEST"], _detalhes:comma_value (d_one), _detalhes:comma_value (mybest[1]), onencounter.date, mybest[2]))
if (myBestDps > d_one) then
print (Loc ["STRING_DETAILS1"] .. format (Loc ["STRING_SCORE_NOTBEST"], _detalhes:ToK2 (d_one), _detalhes:ToK2 (myBestDps), onencounter.date, mybest[2]))
else
print (Loc ["STRING_DETAILS1"] .. format (Loc ["STRING_SCORE_BEST"], _detalhes:comma_value (d_one)))
print (Loc ["STRING_DETAILS1"] .. format (Loc ["STRING_SCORE_BEST"], _detalhes:ToK2 (d_one)))
end
end
--guild best
local amount, playerName, encounterObject = _detalhes.storage:GetBestFromGuild (diff, encounter_id, myrole)
if (amount > 0) then
--> player got the high score on his guild
end
local lower_instance = _detalhes:GetLowerInstanceNumber()
if (lower_instance) then
local instance = _detalhes:GetInstance (lower_instance)
@@ -1323,7 +1566,7 @@ function _detalhes:StoreEncounter (combat)
local func = {_detalhes.OpenRaidHistoryWindow, _detalhes, raid_name, encounter_id, diff, my_role, guildName} --, 2, UnitName ("player")
--local icon = {[[Interface\AddOns\Details\images\icons]], 16, 16, false, 434/512, 466/512, 243/512, 273/512}
local icon = {[[Interface\PvPRankBadges\PvPRank08]], 16, 16, false, 0, 1, 0, 1}
instance:InstanceAlert (Loc ["STRING_GUILDDAMAGERANK_WINDOWALERT"], icon, 10, func, true)
instance:InstanceAlert (Loc ["STRING_GUILDDAMAGERANK_WINDOWALERT"], icon, _detalhes.update_warning_timeout, func, true)
end
end
else
+109 -25
View File
@@ -228,7 +228,7 @@
_detalhes.LastPullMsg = time()
--local hitLine = self.HitBy or "|cFFFFFF00First Hit|r: *?* from *?* "
local hitLine = self.HitBy or "|cFFFFFF00First Hit|r: *?*"
local hitLine = self.HitBy or "|cFFFFBB00First Hit|r: *?*"
local targetLine = ""
for i = 1, 5 do
@@ -236,7 +236,7 @@
if (boss) then
local target = UnitName ("boss" .. i .. "target")
if (target and type (target) == "string") then
targetLine = " |cFFFFFF00Boss First Target|r: " .. target
targetLine = " |cFFFFBB00Boss First Target|r: " .. target
break
end
end
@@ -246,6 +246,63 @@
_detalhes.WhoAggroTimer = nil
end
local lastRecordFound = {id = 0, diff = 0, combatTime = 0}
_detalhes.PrintEncounterRecord = function (self)
--> this block won't execute if the storage isn't loaded
--> self is a timer reference from C_Timer
local encounterID = self.Boss
local diff = self.Diff
if (diff == 15 or diff == 16) then
local value, rank, combatTime = 0, 0, 0
if (encounterID == lastRecordFound.id and diff == lastRecordFound.diff) then
--> is the same encounter, no need to find the value again.
value, rank, combatTime = lastRecordFound.value, lastRecordFound.rank, lastRecordFound.combatTime
else
local db = _detalhes.GetStorage()
local role = UnitGroupRolesAssigned ("player")
local isDamage = (role == "DAMAGER") or (role == "TANK") --or true
local bestRank, encounterTable = _detalhes.storage:GetBestFromPlayer (diff, encounterID, isDamage and "damage" or "healing", _detalhes.playername, true)
if (bestRank) then
local playerTable, onEncounter, rankPosition = _detalhes.storage:GetPlayerGuildRank (diff, encounterID, isDamage and "damage" or "healing", _detalhes.playername, true)
value = bestRank[1] or 0
rank = rankPosition or 0
combatTime = encounterTable.elapsed
--> if found the result, cache the values so no need to search again next pull
lastRecordFound.value = value
lastRecordFound.rank = rank
lastRecordFound.id = encounterID
lastRecordFound.diff = diff
lastRecordFound.combatTime = combatTime
else
--> if didn't found, no reason to search again on next pull
lastRecordFound.value = 0
lastRecordFound.rank = 0
lastRecordFound.combatTime = 0
lastRecordFound.id = encounterID
lastRecordFound.diff = diff
end
end
_detalhes:Msg ("|cFFFFBB00Your Best Score|r:", _detalhes:ToK2 ((value) / combatTime) .. " [|cFFFFFF00Guild Rank: " .. rank .. "|r]")
if ((not combatTime or combatTime == 0) and not _detalhes.SyncWarning) then
_detalhes:Msg ("|cFFFF3300you may need sync the rank within the guild, type '|cFFFFFF00/details rank|r'|r")
_detalhes.SyncWarning = true
end
end
end
function parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
------------------------------------------------------------------------------------------------
@@ -4007,8 +4064,16 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes:EnteredInArena()
else
if ((zoneType == "raid" or zoneType == "party") and select (1, IsInInstance())) then
local inInstance = IsInInstance()
if ((zoneType == "raid" or zoneType == "party") and inInstance) then
_detalhes:CheckForAutoErase (zoneMapID)
--> if the current raid is current tier raid, pre-load the storage database
if (zoneType == "raid") then
if (_detalhes.InstancesToStoreData [zoneMapID]) then
_detalhes.ScheduleLoadStorage()
end
end
end
if (_detalhes:IsInInstance()) then
@@ -4046,28 +4111,31 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (_detalhes.debug) then
_detalhes:Msg ("(debug) |cFFFFFF00ENCOUNTER_START|r event triggered.")
end
_detalhes.latest_ENCOUNTER_END = _detalhes.latest_ENCOUNTER_END or 0
if (_detalhes.latest_ENCOUNTER_END + 10 > _GetTime()) then
return
end
--> leave the current combat when the encounter start, if is doing a mythic plus dungeons, check if the options alows to create a dedicated segment for the boss fight
if ((_in_combat and not _detalhes.tabela_vigente.is_boss) and (not _detalhes.MythicPlus.Started or _detalhes.mythic_plus.boss_dedicated_segment)) then
_detalhes:SairDoCombate()
end
local encounterID, encounterName, difficultyID, raidSize = _select (1, ...)
if (not _detalhes.WhoAggroTimer and _detalhes.announce_firsthit.enabled) then
_detalhes.WhoAggroTimer = C_Timer.NewTimer (0.5, who_aggro)
end
local encounterID, encounterName, difficultyID, raidSize = _select (1, ...)
--print ("START", encounterID, encounterName, difficultyID, raidSize)
_current_encounter_id = encounterID
if (_in_combat and not _detalhes.tabela_vigente.is_boss) then
_detalhes:SairDoCombate()
--_detalhes:Msg ("encounter against|cFFFFFF00", encounterName, "|rbegan, GL HF!")
else
--_detalhes:Msg ("encounter against|cFFFFC000", encounterName, "|rbegan, GL HF!")
if (IsInGuild() and IsInRaid() and _detalhes.announce_damagerecord.enabled and _detalhes.StorageLoaded) then
_detalhes.TellDamageRecord = C_Timer.NewTimer (0.6, _detalhes.PrintEncounterRecord)
_detalhes.TellDamageRecord.Boss = encounterID
_detalhes.TellDamageRecord.Diff = difficultyID
end
_current_encounter_id = encounterID
local dbm_mod, dbm_time = _detalhes.encounter_table.DBM_Mod, _detalhes.encounter_table.DBM_ModTime
_table_wipe (_detalhes.encounter_table)
@@ -4116,7 +4184,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes.encounter_table.index = boss_index
end
parser:Handle3rdPartyBuffs_OnEncounterStart()
if (not _detalhes.MythicPlus.Started or (_detalhes.MythicPlus.Started and not _in_combat)) then
parser:Handle3rdPartyBuffs_OnEncounterStart()
end
end
function _detalhes.parser_functions:ENCOUNTER_END (...)
@@ -4127,7 +4198,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_current_encounter_id = nil
if (_detalhes.zone_type == "party") then
local _, instanceType = GetInstanceInfo() --> let's make sure it isn't a dungeon
if (_detalhes.zone_type == "party" or instanceType == "party") then
if (_detalhes.debug) then
_detalhes:Msg ("(debug) the zone type is 'party', ignoring ENCOUNTER_END.")
end
@@ -4210,6 +4282,21 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes:SairDoCombate()
end
if (_detalhes.schedule_mythicdungeon_trash_merge) then
_detalhes.schedule_mythicdungeon_trash_merge = nil
DetailsMythicPlusFrame.MergeTrashCleanup()
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
@@ -4217,6 +4304,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
end
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()
@@ -4350,14 +4442,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes:Msg ("(debug) found a timer.")
end
local name, groupType, _, difficult = GetInstanceInfo()
if (groupType == "party" and difficult == "Mythic Keystone" and _detalhes.overall_clear_newchallenge) then
_detalhes.historico:resetar_overall()
if (_detalhes.debug) then
_detalhes:Msg ("(debug) timer is for a mythic+ dungeon, overall has been reseted.")
end
end
--if (C_Scenario.IsChallengeMode() and _detalhes.overall_clear_newchallenge) then
-- if (_detalhes.overall_clear_newchallenge) then --C_Scenario.IsChallengeMode() and parece que não existe mais
-- _detalhes.historico:resetar_overall()
+5
View File
@@ -803,6 +803,11 @@ end
end
end
end
--mythic dungeon test
if (_detalhes.MythicPlus.Started and _detalhes.mythic_plus.always_in_combat) then
return true
end
_detalhes:SairDoCombate()
end
+86 -37
View File
@@ -1090,7 +1090,7 @@
end
--> raid history window ~history
function _detalhes:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild, _player_base, _player_name)
function _detalhes:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild, _player_base, _player_name, _history_type)
if (not _G.DetailsRaidHistoryWindow) then
@@ -1195,7 +1195,7 @@
local guild_sync = function()
_detalhes.storage:DBGuildSync()
f.GuildSyncButton:Disable()
if (not f.SyncTexture) then
local workingFrame = CreateFrame ("frame", nil, f)
f.WorkingFrame = workingFrame
@@ -1220,7 +1220,7 @@
local rotation = _detalhes.gump:CreateAnimation (animationHub, "ROTATION", 1, 3, -360)
rotation:SetTarget (f.SyncTextureCircle)
--_detalhes.gump:CreateAnimation (animationHub, "ALPHA", 1, 0.5, 0, 1)
f.SyncText = workingFrame:CreateFontString (nil, "border", "GameFontNormal")
f.SyncText:SetPoint ("right", f.SyncTextureBackground, "left", 0, 0)
f.SyncText:SetText ("working")
@@ -1250,24 +1250,29 @@
GuildSyncButton:SetPoint ("topright", f, "topright", -20, -34)
GuildSyncButton:SetIcon ([[Interface\GLUES\CharacterSelect\RestoreButton]], 12, 12, "overlay", {0.2, .8, 0.2, .8}, nil, 4)
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 result = {}
local bossName = f.select_boss.label:GetText()
tinsert (result, "Details!: Damage Rank for: " .. (bossName or "--x--x--"))
for i = 1, AmtLines do
if (f.LatestResourceTable[i]) then
tinsert (result, f.LatestResourceTable[i][1] .. ": " .. f.LatestResourceTable[i][2])
local playerName = f.LatestResourceTable[i][1]
playerName = playerName:gsub ("%|c%x%x%x%x%x%x%x%x", "")
playerName = playerName:gsub ("%|r", "")
playerName = playerName:gsub (".*%s", "")
tinsert (result, {playerName, f.LatestResourceTable[i][2]})
else
break
end
end
Details:SendReportLines (result)
_detalhes:FormatReportLines (reportTable, result)
Details:SendReportLines (reportTable)
end
Details:SendReportWindow (reportFunc, nil, nil, true)
@@ -1306,6 +1311,18 @@
end
end)
f:SetScript ("OnHide", function()
--> save latest shown state
f.LatestSelection = f.LatestSelection or {}
f.LatestSelection.Raid = DetailsRaidHistoryWindow.select_raid.value
f.LatestSelection.Boss = DetailsRaidHistoryWindow.select_boss.value
f.LatestSelection.Diff = DetailsRaidHistoryWindow.select_diff.value
f.LatestSelection.Role = DetailsRaidHistoryWindow.select_role.value
f.LatestSelection.Guild = DetailsRaidHistoryWindow.select_guild.value
f.LatestSelection.PlayerBase = DetailsRaidHistoryWindow.select_player.value
f.LatestSelection.PlayerName = DetailsRaidHistoryWindow.select_player2.value
end)
f.TitleText:SetText ("Details! Raid Ranking")
--f.portrait:SetTexture ([[Interface\AddOns\Details\images\icons2]])
f.portrait:SetTexture ([[Interface\PVPFrame\PvPPrestigeIcons]])
@@ -1429,6 +1446,8 @@
function f:UpdateDropdowns (DoNotSelectRaid)
local currentGuild = guild_dropdown.value
--difficulty
wipe (diff_list)
wipe (boss_list)
@@ -1473,7 +1492,6 @@
if (not boss_repeated [encounterId]) then
local encounter, instance = _detalhes:GetBossEncounterDetailsFromEncounterId (_, encounterId)
if (encounter) then
local InstanceID = _detalhes:GetInstanceIdFromEncounterId (encounterId)
if (raidSelected == InstanceID) then
tinsert (boss_list, {value = encounterId, label = encounter.boss, icon = icon, onclick = on_boss_select})
@@ -1491,7 +1509,7 @@
for index, encounter in ipairs (encounterTable) do
local guild = encounter.guild
if (not guild_repeated [guild]) then
tinsert (guild_list, {value = guild, label = guild, icon = icon, onclick = on_raid_select})
tinsert (guild_list, {value = guild, label = guild, icon = icon, onclick = on_guild_select})
guild_repeated [guild] = true
end
end
@@ -1510,9 +1528,13 @@
raid_dropdown:Refresh()
raid_dropdown:Select (1, true)
end
guild_dropdown:Refresh()
guild_dropdown:Select (1, true)
guild_dropdown:Refresh()
if (currentGuild) then
guild_dropdown:Select (currentGuild)
else
guild_dropdown:Select (1, true)
end
end
function f.UpdateBossDropdown()
@@ -1611,40 +1633,26 @@
local player = roleTable [playerName]
if (player) then
tinsert (data, {text = date, value = player[1], data = player, fulldate = encounter.date, elapsed = encounter.elapsed})
--tinsert (data, {text = date, value = player[1], data = player, fulldate = encounter.date, elapsed = encounter.elapsed})
tinsert (data, {text = date, value = player[1]/encounter.elapsed, utext = _detalhes:ToK2 (player[1]/encounter.elapsed), data = player, fulldate = encounter.date, elapsed = encounter.elapsed})
end
end
end
--> update graphic
if (not f.gframe) then
local cooltip_block_bg = {0, 0, 0, 1}
local menu_wallpaper_tex = {.6, 0.1, 0, 0.64453125}
local menu_wallpaper_color = {1, 1, 1, 0.1}
local onenter = function (self)
GameCooltip:Reset()
GameCooltip:SetType ("tooltip")
GameCooltip:SetOption ("TextSize", _detalhes.tooltip.fontsize)
GameCooltip:SetOption ("TextFont", _detalhes.tooltip.fontface)
GameCooltip:SetOption ("TextColor", _detalhes.tooltip.fontcolor)
GameCooltip:SetOption ("TextColorRight", _detalhes.tooltip.fontcolor_right)
GameCooltip:SetOption ("TextShadow", _detalhes.tooltip.fontshadow and "OUTLINE")
GameCooltip:SetOption ("LeftBorderSize", -5)
GameCooltip:SetOption ("RightBorderSize", 5)
GameCooltip:SetOption ("MinWidth", 175)
GameCooltip:SetOption ("StatusBarTexture", [[Interface\AddOns\Details\images\bar_background]])
GameCooltip:AddLine ("Total Done:", _detalhes:ToK2 (self.data.value))
GameCooltip:AddLine ("Dps:", _detalhes:ToK2 (self.data.value / self.data.elapsed))
GameCooltip:AddLine ("Item Level:", floor (self.data.data [2]))
GameCooltip:AddLine ("Date:", self.data.fulldate:gsub (".*%s", ""))
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], menu_wallpaper_tex, menu_wallpaper_color, true)
GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, cooltip_block_bg, _detalhes.tooltip_border_color)
GameCooltip:Preset (2)
GameCooltip:AddLine ("Total Done:", _detalhes:ToK2 (self.data.value), 1, "white")
GameCooltip:AddLine ("Dps:", _detalhes:ToK2 (self.data.value / self.data.elapsed), 1, "white")
GameCooltip:AddLine ("Item Level:", floor (self.data.data [2]), 1, "white")
GameCooltip:AddLine ("Date:", self.data.fulldate:gsub (".*%s", ""), 1, "white")
GameCooltip:SetOwner (self.ball.tooltip_anchor)
GameCooltip:Show()
end
@@ -1729,8 +1737,15 @@
t.ps,
})
end
table.sort (sortTable, function(a, b) return a[8] > b[8] end)
--> add the number before the player name
for i = 1, #sortTable do
local t = sortTable [i]
t [1] = i .. ". " .. t [1]
end
fillpanel:SetFillFunction (function (index) return sortTable [index] end)
fillpanel:SetTotalFunction (function() return #sortTable end)
fillpanel:UpdateRows (header)
@@ -1790,6 +1805,9 @@
end
end
--> sort alphabetical
table.sort (players, function(a, b) return a[1] < b[1] end)
for index, playerTable in ipairs (players) do
for i = #playerTable, amt_encounters do
tinsert (playerTable, "")
@@ -1882,12 +1900,40 @@
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
if (f.LatestSelection) then
_raid = f.LatestSelection.Raid
_boss = f.LatestSelection.Boss
_difficulty = f.LatestSelection.Diff
_role = f.LatestSelection.Role
_guild = f.LatestSelection.Guild
_player_base = f.LatestSelection.PlayerBase
_player_name = f.LatestSelection.PlayerBase
end
end
_G.DetailsRaidHistoryWindow:UpdateDropdowns()
_G.DetailsRaidHistoryWindow:UpdateDropdowns()
_G.DetailsRaidHistoryWindow:Refresh()
_G.DetailsRaidHistoryWindow:Show()
if (_history_type == 1 or _history_type == 2) then
DetailsRaidHistoryWindow.Mode = _history_type
if (DetailsRaidHistoryWindow.Mode == 1) then
--overall
DetailsRaidHistoryWindow.HistoryCheckBox:SetValue (true)
DetailsRaidHistoryWindow.GuildRankCheckBox:SetValue (false)
elseif (DetailsRaidHistoryWindow.Mode == 2) then
--guild rank
DetailsRaidHistoryWindow.GuildRankCheckBox:SetValue (true)
DetailsRaidHistoryWindow.HistoryCheckBox:SetValue (false)
end
end
if (_raid) then
DetailsRaidHistoryWindow.select_raid:Select (_raid)
_G.DetailsRaidHistoryWindow:Refresh()
@@ -1906,6 +1952,9 @@
_G.DetailsRaidHistoryWindow:Refresh()
end
if (_guild) then
if (type (_guild) == "boolean") then
_guild = GetGuildInfo ("player")
end
DetailsRaidHistoryWindow.select_guild:Select (_guild)
_G.DetailsRaidHistoryWindow:Refresh()
end