Rewrite on storage and internal ranking system

This commit is contained in:
Tercio Jose
2024-07-09 23:41:47 -03:00
committed by andrew6180
parent 904a7eab1b
commit a02e5d4bc6
14 changed files with 822 additions and 610 deletions
+5 -8
View File
@@ -24,22 +24,19 @@ return a new numeric table with sorted in decreasing order:
Raid History
=======================================
Details.storage:OpenRaidStorage()
Details222.storage.OpenRaidStorage()
get the table containing all stored data.
Details.storage:ListDiffs()
return a indexed table with dificulty numbers.
Details.storage:ListEncounters (diff)
Details222.storage.ListEncounters (diff)
return a indexed table with all encounters stored for the dificulty.
Details.storage:GetEncounterData (diff, encounterId, guildname)
Details222.storage.GetEncounterData (diff, encounterId, guildname)
return a indexed table with encounter tables playd by the guild.
Details.storage:GetPlayerData (diff, encounterId, playername)
Details222.storage.GetUnitData (diff, encounterId, role, playername)
return a indexed table with player tables for the player.
Details.storage:GetBestFromPlayer (diff, encounterId, role, playername)
Details222.storage.GetBestFromPlayer (diff, encounterId, role, playername)
return the best result from the player.
Structure:
+2 -2
View File
@@ -559,7 +559,7 @@ Details:GetSourceFromNpcId (npcId)
return the npc name for the specific npcId.
this is a expensive function, once you get a valid result, store the npc name somewhere.
bestResult, encounterTable = Details.storage:GetBestFromPlayer (encounterDiff, encounterId, playerRole, playerName)
bestResult, encounterTable = Details222.storage.GetBestFromPlayer (encounterDiff, encounterId, playerRole, playerName)
query the storage for the best result of the player on the encounter.
encounterDiff = raid difficult ID (15 for heroic, 16 for mythic).
encounterId = may be found on "id" member getting combat:GetBossInfo().
@@ -568,7 +568,7 @@ playerName = name of the player to query (with server name if the player is from
bestResult = integer, best damage or healing done on the boss made by the player.
encounterTable = {["date"] = formated time() ["time"] = time() ["elapsed"] = combat time ["guild"] = guild name ["damage"] = all damage players ["healing"] = all healers}
heal_or_damage_done = Details.storage:GetPlayerData (encounterDiff, encounterId, playerName)
heal_or_damage_done = Details222.storage.GetUnitData (encounterDiff, encounterId, role, playerName)
query the storage for previous ecounter data for the player.
returns a numeric table with the damage or healing done by the player on all encounters found.
encounterDiff = raid difficult ID (15 for heroic, 16 for mythic).
+5 -2
View File
@@ -221,6 +221,9 @@ returns a table containing information about alternate power gains from players.
Other Calls:
Details:GetItemLevelFromGuid(guid)
return the item level of a player passing the player guid, if the player is not found, returns 0.
Details:GetCombatNumber()
returns the current unique combat number counter.
combat number is a unique number given to each combat started, this number won't
@@ -564,7 +567,7 @@ Details:GetSourceFromNpcId (npcId)
return the npc name for the specific npcId.
this is a expensive function, once you get a valid result, store the npc name somewhere.
bestResult, encounterTable = Details.storage:GetBestFromPlayer (encounterDiff, encounterId, playerRole, playerName)
bestResult, encounterTable = Details222.storage.GetBestFromPlayer (encounterDiff, encounterId, playerRole, playerName)
query the storage for the best result of the player on the encounter.
encounterDiff = raid difficult ID (15 for heroic, 16 for mythic).
encounterId = may be found on "id" member getting combat:GetBossInfo().
@@ -573,7 +576,7 @@ playerName = name of the player to query (with server name if the player is from
bestResult = integer, best damage or healing done on the boss made by the player.
encounterTable = {["date"] = formated time() ["time"] = time() ["elapsed"] = combat time ["guild"] = guild name ["damage"] = all damage players ["healing"] = all healers}
heal_or_damage_done = Details.storage:GetPlayerData (encounterDiff, encounterId, playerName)
heal_or_damage_done = Details222.storage.GetUnitData (encounterDiff, encounterId, role, playerName)
query the storage for previous ecounter data for the player.
returns a numeric table with the damage or healing done by the player on all encounters found.
encounterDiff = raid difficult ID (15 for heroic, 16 for mythic).
+45 -45
View File
@@ -282,54 +282,54 @@
---@field PhaseData table
---@field player_last_events table<string, table[]> record the latest events of each player, latter used to build the death log
---@field
---@field GetCurrentPhase fun(combat: combat) : number return the current phase of the combat or the phase where the combat ended
---@field GetTotal fun(self: combat, attribute: number, subAttribute: number?, onlyGroup: boolean?) : number return the total amount of the requested attribute
---@field GetCurrentPhase fun(self: combat) : number return the current phase of the combat or the phase where the combat ended
---@field StoreTalents fun(self:combat)
---@field FindEnemyName fun(combat: combat) : string attempt to get the name of the enemy in the combat by getting the top most damaged unit by the player
---@field GetTryNumber fun(combat: combat) : number?
---@field GetFormattedCombatTime fun(combat: combat) : string
---@field GetMSTime fun(combat: combat) : number, number
---@field GetSegmentSlotId fun(combat: combat) : segmentid
---@field GetCombatName fun(combat: combat, bOnlyName: boolean?, bTryFind: boolean?) : string, number?, number?, number?, number? get the name of the combat
---@field GetCombatIcon fun(combat: combat) : df_atlasinfo, df_atlasinfo?
---@field FindEnemyName fun(self: combat) : string attempt to get the name of the enemy in the combat by getting the top most damaged unit by the player
---@field GetTryNumber fun(self: combat) : number?
---@field GetFormattedCombatTime fun(self: combat) : string
---@field GetMSTime fun(self: combat) : number, number
---@field GetSegmentSlotId fun(self: combat) : segmentid
---@field GetCombatName fun(self: combat, bOnlyName: boolean?, bTryFind: boolean?) : string, number?, number?, number?, number? get the name of the combat
---@field GetCombatIcon fun(self: combat) : df_atlasinfo, df_atlasinfo?
---@field GetTrinketProcsForPlayer fun(self: combat, playerName: string) : table<spellid, trinketprocdata> return a key|value table containing the spellId as key and a table with information about the trinket as value
---@field IsMythicDungeon fun(combat: combat) : boolean, number return a boolean indicating if the combat is from a mythic+ dungeon, if true, also return the runId
---@field GetMythicDungeonInfo fun(combat: combat) : mythicdungeoninfo
---@field GetCombatType fun(combat: combat) : number
---@field GetCombatUID fun(combat: combat) : uniquecombatid
---@field GetTimeData fun(combat: combat, dataName: string) : table
---@field GetPhases fun(combat: combat) : table
---@field GetCombatTime fun(comba: combat) : number
---@field GetRunTime fun(combat: combat) : number return the elapsed time of a mythic+ dungeon run, if not exists, return the combat time
---@field GetRunTimeNoDefault fun(combat: combat) : number return the elapsed time of a mythic+ dungeon run, nil if not exists
---@field GetDeaths fun(combat) : table --get the table which contains the deaths of the combat
---@field GetStartTime fun(combat: combat) : number
---@field SetStartTime fun(combat: combat, time: number)
---@field GetEndTime fun(combat: combat) : number
---@field GetDifficulty fun(combat: combat) : number return the dungeon or raid difficulty for boss fights
---@field GetEncounterCleuID fun(combat: combat) : number return the encounterId for boss fights, this number is gotten from the ENCOUNTER_START event
---@field GetBossInfo fun(combat: combat) : bossinfo a table containing many informations about the boss fight
---@field SetEndTime fun(combat: combat, time: number)
---@field IsMythicDungeon fun(self: combat) : boolean, number return a boolean indicating if the combat is from a mythic+ dungeon, if true, also return the runId
---@field GetMythicDungeonInfo fun(self: combat) : mythicdungeoninfo
---@field GetCombatType fun(self: combat) : number
---@field GetCombatUID fun(self: combat) : uniquecombatid
---@field GetTimeData fun(self: combat, dataName: string) : table
---@field GetPhases fun(self: combat) : table
---@field GetCombatTime fun(self: combat) : number
---@field GetRunTime fun(self: combat) : number return the elapsed time of a mythic+ dungeon run, if not exists, return the combat time
---@field GetRunTimeNoDefault fun(self: combat) : number return the elapsed time of a mythic+ dungeon run, nil if not exists
---@field GetDeaths fun(self: combat) : table --get the table which contains the deaths of the combat
---@field GetStartTime fun(self: combat) : number
---@field SetStartTime fun(self: combat, time: number)
---@field GetEndTime fun(self: combat) : number
---@field GetDifficulty fun(self: combat) : number, string return the dungeon or raid difficulty for boss fights as a number, the string is an english difficulty name in lower case which is not always present
---@field GetEncounterCleuID fun(self: combat) : number return the encounterId for boss fights, this number is gotten from the ENCOUNTER_START event
---@field GetBossInfo fun(self: combat) : bossinfo a table containing many informations about the boss fight
---@field SetEndTime fun(self: combat, time: number)
---@field CopyDeathsFrom fun(combat1: combat, combat2: combat, bMythicPlus: boolean) copy the deaths from combat2 to combat1, use true on bMythicPlus if the combat is from a mythic plus run
---@field GetContainer fun(combat: combat, containerType: containertype) : actorcontainer get an actorcontainer, containerType can be 1 for damage, 2 heal, 3 resources, 4 utility
---@field GetSpellCastAmount fun(combat: combat, actorName: string, spellName: string) : number get the amount of times a spell was casted
---@field RemoveActorFromSpellCastTable fun(combat: combat, actorName: string)
---@field GetSpellCastTable fun(combat: combat, actorName: string|nil) : table
---@field GetSpellUptime fun(combat: combat, actorName: string, spellId: number, auraType: string|nil) : number get the uptime of a buff or debuff
---@field GetActor fun(combat: combat, containerType: number, playerName: string) : actor
---@field CreateAlternatePowerTable fun(combat: combat, actorName: string) : alternatepowertable
---@field GetCombatNumber fun(combat: combat) : number get a unique number representing the combatId, each combat has a unique number
---@field SetDate fun(combat: combat, startDate: string?, endDate: string?) set the start and end date of the combat, format: "H:M:S"
---@field GetDate fun(combat: combat) : string, string get the start and end date of the combat, format: "H:M:S"
---@field GetRoster fun(combat: combat) : table<string, string> get the roster of the combat, the table contains the names of the players in the combat
---@field GetInstanceType fun(combat: combat) : instancetype get the instance type of the combat, can be "raid" or "party" or "pvp" or "arena" or "none"
---@field IsTrash fun(combat: combat) : boolean is true if the combat is a trash combat
---@field GetEncounterName fun(combat: combat) : string get the name of the encounter
---@field GetBossImage fun(combat: combat) : texturepath|textureid get the icon of the encounter
---@field SetDateToNow fun(combat: combat, bSetStartDate: boolean?, bSetEndDate: boolean?) set the date to the current time. format: "H:M:S"
---@field GetBossHealth fun(combat: combat) : number get the percentage of the boss health when the combat ended
---@field GetBossHealthString fun(combat: combat) : string get the percentage of the boss health when the combat ended as a string
---@field GetBossName fun(combat: combat) : string? return the name of the unitId "boss1", nil if the unit doesn't existed during the combat
---@field GetContainer fun(self: combat, containerType: containertype) : actorcontainer get an actorcontainer, containerType can be 1 for damage, 2 heal, 3 resources, 4 utility
---@field GetSpellCastAmount fun(self: combat, actorName: string, spellName: string) : number get the amount of times a spell was casted
---@field RemoveActorFromSpellCastTable fun(self: combat, actorName: string)
---@field GetSpellCastTable fun(self: combat, actorName: string|nil) : table
---@field GetSpellUptime fun(self: combat, actorName: string, spellId: number, auraType: string|nil) : number get the uptime of a buff or debuff
---@field GetActor fun(self: combat, containerType: number, playerName: string) : actor
---@field CreateAlternatePowerTable fun(self: combat, actorName: string) : alternatepowertable
---@field GetCombatNumber fun(self: combat) : number get a unique number representing the combatId, each combat has a unique number
---@field SetDate fun(self: combat, startDate: string?, endDate: string?) set the start and end date of the combat, format: "H:M:S"
---@field GetDate fun(self: combat) : string, string get the start and end date of the combat, format: "H:M:S"
---@field GetRoster fun(self: combat) : table<string, string> get the roster of the combat, the table contains the names of the players in the combat
---@field GetInstanceType fun(self: combat) : instancetype get the instance type of the combat, can be "raid" or "party" or "pvp" or "arena" or "none"
---@field IsTrash fun(self: combat) : boolean is true if the combat is a trash combat
---@field GetEncounterName fun(self: combat) : string get the name of the encounter
---@field GetBossImage fun(self: combat) : texturepath|textureid get the icon of the encounter
---@field SetDateToNow fun(self: combat, bSetStartDate: boolean?, bSetEndDate: boolean?) set the date to the current time. format: "H:M:S"
---@field GetBossHealth fun(self: combat) : number get the percentage of the boss health when the combat ended
---@field GetBossHealthString fun(self: combat) : string get the percentage of the boss health when the combat ended as a string
---@field GetBossName fun(self: combat) : string? return the name of the unitId "boss1", nil if the unit doesn't existed during the combat
---@class actorcontainer : table contains two tables _ActorTable and _NameIndexTable, the _ActorTable contains the actors, the _NameIndexTable contains the index of the actors in the _ActorTable, making quick to reorder them without causing overhead
---@field need_refresh boolean when true the container is dirty and needs to be refreshed
+8
View File
@@ -101,6 +101,14 @@
[666953] = true, --Outland Single Target Training Dummy
}
---@type details_storage_feature
---@diagnostic disable-next-line: missing-fields
local storage = {
DiffNames = {"normal", "heroic", "mythic", "ascended"},
DiffNamesHash = {normal = 1, heroic = 2, mythic = 3, ascended = 4},
}
Details222.storage = storage
--namespace for damage spells (spellTable)
Details222.DamageSpells = {}
--namespace for texture
+13 -2
View File
@@ -177,8 +177,19 @@ local segmentTypeToString = {
return rawget(self, "is_trash")
end
local diffNumberToName = {
[1] = "normal",
[2] = "heroic",
[3] = "mythic",
[4] = "ascended",
}
function classCombat:GetDifficulty()
return self.is_boss and self.is_boss.diff
local bossInfo = self:GetBossInfo()
if (bossInfo) then
local difficultyId = bossInfo.diff
return difficultyId, diffNumberToName[difficultyId]
end
end
function classCombat:GetEncounterCleuID()
@@ -941,7 +952,7 @@ local segmentTypeToString = {
---return the total of a specific attribute, example: total damage, total healing, total resources, etc
---@param attribute number
---@param subAttribute number
---@param subAttribute number?
---@param onlyGroup boolean?
---@return number
function classCombat:GetTotal(attribute, subAttribute, onlyGroup)
+6 -5
View File
@@ -4910,7 +4910,7 @@ function damageClass:MontaInfoDamageDone() --I guess this fills the list of spel
---@type combat
local combatObject = instance:GetCombat()
---@type number
local diff = combatObject:GetDifficulty()
local diff, diffEngName = combatObject:GetDifficulty()
---@type string
local playerName = actorObject:Name()
@@ -4919,14 +4919,15 @@ function damageClass:MontaInfoDamageDone() --I guess this fills the list of spel
--guild ranking on a boss
--check if is a raid encounter and if is heroic or mythic
do
if (diff and (diff == 15 or diff == 16)) then
if (diff and (diff == 1 or diff == 2 or diff == 3 or diff == 4)) then --this might give errors
local db = Details.OpenStorage()
if (db) then
local bestRank, encounterTable = Details.storage:GetBestFromPlayer(diff, combatObject:GetBossInfo().id, "damage", playerName, true)
---@type details_storage_unitresult, details_encounterkillinfo
local bestRank, encounterTable = Details222.storage.GetBestFromPlayer(diffEngName, combatObject:GetBossInfo().id, "DAMAGER", playerName, true)
if (bestRank) then
--discover which are the player position in the guild rank
local playerTable, onEncounter, rankPosition = Details.storage:GetPlayerGuildRank (diff, combatObject:GetBossInfo().id, "damage", playerName, true)
local text1 = playerName .. " Guild Rank on " .. (combatObject:GetBossInfo().name or "") .. ": |cFFFFFF00" .. (rankPosition or "x") .. "|r Best Dps: |cFFFFFF00" .. Details:ToK2((bestRank[1] or 0) / encounterTable.elapsed) .. "|r (" .. encounterTable.date:gsub(".*%s", "") .. ")"
local rankPosition = Details222.storage.GetUnitGuildRank(diffEngName, combatObject:GetBossInfo().id, "DAMAGER", playerName, true)
local text1 = playerName .. " Guild Rank on " .. (combatObject:GetBossInfo().name or "") .. ": |cFFFFFF00" .. (rankPosition or "x") .. "|r Best Dps: |cFFFFFF00" .. Details:ToK2((bestRank.total or SMALL_NUMBER) / encounterTable.elapsed) .. "|r (" .. encounterTable.date:gsub(".*%s", "") .. ")"
breakdownWindowFrame:SetStatusbarText (text1, 10, "gray")
else
breakdownWindowFrame:SetStatusbarText()
+664 -494
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -314,7 +314,7 @@
--return false
end
local IDs = Details.storage:GetIDsToGuildSync()
local IDs = Details222.storage.GetIDsToGuildSync()
if (IDs and IDs [1]) then
local from = UnitName("player")
@@ -326,7 +326,7 @@
return true
elseif (type == "L") then --RoC - the player received the IDs list and send back which IDs he doesn't have
local missingIds = Details.storage:CheckMissingIDsToGuildSync(data)
local missingIds = Details222.storage.CheckMissingIDsToGuildSync(data)
if (missingIds and missingIds[1]) then
local from = UnitName ("player")
@@ -336,7 +336,7 @@
return true
elseif (type == "G") then --RoS - the 'server' send the encounter dps table to the player which requested
local encounterData = Details.storage:BuildEncounterDataToGuildSync(data)
local encounterData = Details222.storage.BuildEncounterDataToGuildSync(data)
if (encounterData and encounterData[1]) then
local task = C_Timer.NewTicker(4, function(task)
@@ -365,7 +365,7 @@
return true
elseif (type == "A") then --RoC - the player received the dps table and should now add it to the db
Details.storage:AddGuildSyncData(data, player)
Details222.storage.AddGuildSyncData(data, player)
return true
end
end
+16 -9
View File
@@ -394,10 +394,17 @@
--this block won't execute if the storage isn't loaded
--self is a timer reference from C_Timer
local diffNumberToName = {
[1] = "normal",
[2] = "heroic",
[3] = "mythic",
[4] = "ascended",
}
local encounterID = self.Boss
local diff = self.Diff
if (diff == 15 or diff == 16) then
if (diff == 1 or diff == 2 or diff == 3 or diff == 4) then --might give errors
local value, rank, combatTime = 0, 0, 0
if (encounterID == lastRecordFound.id and diff == lastRecordFound.diff) then
@@ -408,12 +415,14 @@
local role = _UnitGroupRolesAssigned("player")
local isDamage = (role == "DAMAGER") or (role == "TANK") --or true
local bestRank, encounterTable = Details.storage:GetBestFromPlayer (diff, encounterID, isDamage and "damage" or "healing", Details.playername, true)
---@type details_storage_unitresult, details_encounterkillinfo
local bestRank, encounterTable = Details222.storage.GetBestFromPlayer(diffNumberToName[diff], encounterID, isDamage and "DAMAGER" or "HEALER", Details.playername, true)
if (bestRank) then
local playerTable, onEncounter, rankPosition = Details.storage:GetPlayerGuildRank (diff, encounterID, isDamage and "damage" or "healing", Details.playername, true)
---@type number
local rankPosition = Details222.storage.GetUnitGuildRank(diffNumberToName[diff], encounterID, isDamage and "DAMAGER" or "HEALER", Details.playername, true)
value = bestRank[1] or 0
value = bestRank.total or 0
rank = rankPosition or 0
combatTime = encounterTable.elapsed
@@ -4809,7 +4818,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
Details.is_in_arena = true
Details:EnteredInArena()
else
local inInstance = IsInInstance()
if ((zoneType == "raid" or zoneType == "party") and inInstance) then
@@ -4817,7 +4825,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
--if the current raid is current tier raid, pre-load the storage database
if (zoneType == "raid") then
if (Details.InstancesToStoreData[zoneMapID]) then
if (Details:IsZoneIdFromCurrentExpansion(zoneMapID)) then
Details.ScheduleLoadStorage()
end
end
@@ -4873,7 +4881,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
end
if (Details.InstancesToStoreData[zoneMapID]) then
if (Details:IsZoneIdFromCurrentExpansion(zoneMapID)) then
Details.current_exp_raid_encounters[encounterID] = true
end
@@ -4893,7 +4901,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
end
if (IsInGuild() and IsInRaid() and Details.announce_damagerecord.enabled and Details.StorageLoaded) then
if (IsInGuild() and IsInRaid() and Details.announce_damagerecord.enabled and Details222.storageLoaded) then
Details.TellDamageRecord = C_Timer.NewTimer(0.6, Details.PrintEncounterRecord)
Details.TellDamageRecord.Boss = encounterID
Details.TellDamageRecord.Diff = difficultyID
@@ -5189,7 +5197,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
--Details:Msg("(debug) running scheduled events after combat end.")
end
--when the user requested data from the storage but is in combat lockdown
if (Details.schedule_storage_load) then
Details.schedule_storage_load = nil
+1 -1
View File
@@ -59,7 +59,7 @@ function Details:OpenForge()
local have_plugins_enabled
for id, instanceTable in pairs(Details.EncounterInformation) do
if (Details.InstancesToStoreData [id]) then
if (Details:IsZoneIdFromCurrentExpansion(id)) then
have_plugins_enabled = true
break
end
+8 -7
View File
@@ -2160,19 +2160,20 @@ local iconFrame_OnEnter = function(self)
end
local combat = instance:GetShowingCombat()
local diff = combat:GetDifficulty()
local diff, diffEngName = combat:GetDifficulty()
local attribute, subattribute = instance:GetDisplay()
--check if is a raid encounter and if is heroic or mythic
if (diff and (diff == 15 or diff == 16) and (attribute == 1 or attribute == 2)) then
if (diff and (diff == 15 or diff == 16) and (attribute == 1 or attribute == 2)) then --might give errors
local db = Details.OpenStorage()
if (db) then
local bestRank, encounterTable = Details.storage:GetBestFromPlayer(diff, combat:GetBossInfo().id, attribute == 1 and "damage" or "healing", name, true)
---@type details_storage_unitresult, details_encounterkillinfo
local bestRank, encounterTable = Details222.storage.GetBestFromPlayer(diffEngName, combat:GetBossInfo().id, attribute == 1 and "DAMAGER" or "HEALER", name, true)
if (bestRank) then
--discover which are the player position in the guild rank
local playerTable, onEncounter, rankPosition = Details.storage:GetPlayerGuildRank(diff, combat:GetBossInfo().id, attribute == 1 and "damage" or "healing", name, true)
local rankPosition = Details222.storage.GetUnitGuildRank(diffEngName, combat:GetBossInfo().id, attribute == 1 and "DAMAGER" or "HEALER", name, true)
GameCooltip:AddLine("Best Score:", Details:ToK2((bestRank[1] or 0) / encounterTable.elapsed) .. " [|cFFFFFF00Rank: " .. (rankPosition or "#") .. "|r]", 1, "white")
GameCooltip:AddLine("Best Score:", Details:ToK2((bestRank.total or 0) / encounterTable.elapsed) .. " [|cFFFFFF00Rank: " .. (rankPosition or "#") .. "|r]", 1, "white")
Details:AddTooltipBackgroundStatusbar()
GameCooltip:AddLine("|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:14:12:0:1:512:512:8:70:224:306|t Open Rank", "|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:14:12:0:1:512:512:8:70:328:409|t Refresh Talents", 1, "white", "white")
@@ -2333,13 +2334,13 @@ local icon_frame_on_click_up = function(self, button)
if (instance) then
local attribute, subattribute = instance:GetDisplay()
local combat = instance:GetShowingCombat()
local diff = combat:GetDifficulty()
local diff, diffName = combat:GetDifficulty()
local bossInfo = combat:GetBossInfo()
if ((attribute == 1 or attribute == 2) and bossInfo) then --if bossInfo is nil, means the combat isn't a boss
local db = Details.OpenStorage()
if (db and bossInfo.id) then
local haveData = Details.storage:HaveDataForEncounter (diff, bossInfo.id, true) --attempt to index local 'bossInfo' (a nil value)
local haveData = Details222.storage.HaveDataForEncounter (diffName, bossInfo.id, true) --attempt to index local 'bossInfo' (a nil value)
if (haveData) then
Details:OpenRaidHistoryWindow (bossInfo.zone, bossInfo.id, diff, attribute == 1 and "damage" or "healing", true, 1, false, 2)
end
+2 -2
View File
@@ -43,7 +43,7 @@ function Details:OpenRaidHistoryWindow(raidName, bossEncounterId, difficultyId,
table.insert(UISpecialFrames, "DetailsRaidHistoryWindow")
function statisticsFrame.OpenDB()
local db = Details.storage:OpenRaidStorage()
local db = Details222.storage.OpenRaidStorage()
if (not db) then
Details:Msg(Loc ["STRING_GUILDDAMAGERANK_DATABASEERROR"])
return
@@ -128,7 +128,7 @@ function Details:OpenRaidHistoryWindow(raidName, bossEncounterId, difficultyId,
statisticsFrame.DownloadedSize = 0
statisticsFrame.SyncStartTime = time()
Details.storage:DBGuildSync()
Details222.storage.DBGuildSync()
statisticsFrame.GuildSyncButton:Disable()
if (not statisticsFrame.SyncTexture) then
+14
View File
@@ -379,6 +379,19 @@ do
--this cache is local and isn't shared with other components of the addon
local expansionBossList_Cache = {build = false}
---@class details_bossinfo : table
---@field bossName string name
---@field journalEncounterID number journalEncounterID
---@field bossRaidName string instanceName
---@field bossIcon number iconImage
---@field bossIconCoords table<number, number, number, number> {0, 1, 0, 0.95}
---@field bossIconSize table<number, number> {70, 36}
---@field instanceId number raidInstanceID
---@field uiMapId number UiMapID
---@field instanceIndex number instanceIndex
---@field journalInstanceId number journalInstanceID
---@field dungeonEncounterID number dungeonEncounterID
function Details:GetExpansionBossList() --~bosslist - load on demand from gears-gsync and statistics-valid boss for exp
if (expansionBossList_Cache.build) then
return expansionBossList_Cache.bossIndexedTable, expansionBossList_Cache.bossInfoTable, expansionBossList_Cache.raidInfoTable
@@ -426,6 +439,7 @@ do
local name, description, journalEncounterID, rootSectionID, link, journalInstanceID, dungeonEncounterID, UiMapID = EJ_GetEncounterInfoByIndex(i, raidInstanceID)
if (name) then
local id, creatureName, creatureDescription, displayInfo, iconImage = EJ_GetCreatureInfo(1, journalEncounterID)
---@type details_bossinfo
local thisbossIndexedTable = {
bossName = name,
journalEncounterID = journalEncounterID,