Work on Ascension Backport

This commit is contained in:
andrew6180
2024-05-17 15:08:08 -07:00
parent 5de2a04b8c
commit bb7e0d2c27
325 changed files with 26995 additions and 41741 deletions
+3 -17
View File
@@ -385,21 +385,6 @@
Details:CatchRaidDebuffUptime("DEBUFF_UPTIME_IN")
Details:UptadeRaidMembersCache()
--is inside a mythic dungeon and running a mythic+?
if (newCombatObject.is_challenge or Details.debug) then
--local bRegisterAuraScanTimeLine = true
--Details222.AuraScan.AddAura(395152) --ebon might
--Details222.AuraScan.AddAura(395296) --the evoker buff on it self
--Details222.AuraScan.AddAura(410089--[[, bRegisterAuraScanTimeLine--]]) --prescience
--Details222.AuraScan.AddAura(413984) --Shifting Sands
--Details222.AuraScan.AddAura(409560) --Temporal Wound
--Details222.AuraScan.AddAura(360827) --Blistering Scales
--Details222.AuraScan.AddAura(410263) --Inferno's Blessing
--Details222.AuraScan.RegisterCallback(Details222.SpecHelpers[1473].OnAugmentationBuffUpdate)
--Details222.AuraScan.Start() --combat started (m+ active)
end
--Details222.TimeCapture.StartCombatTimer(Details.tabela_vigente)
--we already have boss information? build .is_boss table
@@ -607,7 +592,8 @@
end
--tag as a mythic dungeon segment, can be any type of segment, this tag also avoid the segment to be tagged as trash
local mythicLevel = C_ChallengeMode and C_ChallengeMode.GetActiveKeystoneInfo()
local activeKeystone = C_MythicPlus.IsKeystoneActive() and C_MythicPlus.GetActiveKeystoneInfo()
local mythicLevel = activeKeystone and activeKeystone.keystoneLevel
if (mythicLevel and mythicLevel >= 2) then
currentCombat.is_mythic_dungeon_segment = true
currentCombat.is_mythic_dungeon_run_id = Details.mythic_dungeon_id
@@ -1582,7 +1568,7 @@
GameCooltip:SetType("tooltip")
--GameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_background_dark_withline]])
GameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_textures\bar_rounded.png]])
GameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_textures\bar_rounded]])
GameCooltip:SetOption("TextSize", Details.tooltip.fontsize)
GameCooltip:SetOption("TextFont", Details.tooltip.fontface)
+57 -733
View File
@@ -725,8 +725,8 @@ _detalhes.storage = {}
function _detalhes.storage:OpenRaidStorage()
--check if the storage is already loaded
if (not C_AddOns.IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
local loaded, reason = C_AddOns.LoadAddOn(CONST_ADDONNAME_DATASTORAGE)
if (not IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
local loaded, reason = LoadAddOn(CONST_ADDONNAME_DATASTORAGE)
if (not loaded) then
return
end
@@ -1429,8 +1429,8 @@ function _detalhes.ScheduleLoadStorage()
_detalhes.schedule_storage_load = true
return
else
if (not C_AddOns.IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
local loaded, reason = C_AddOns.LoadAddOn(CONST_ADDONNAME_DATASTORAGE)
if (not IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
local loaded, reason = LoadAddOn(CONST_ADDONNAME_DATASTORAGE)
if (not loaded) then
if (_detalhes.debug) then
print("|cFFFFFF00Details! Storage|r: can't load storage, may be the addon is disabled.")
@@ -1442,7 +1442,7 @@ function _detalhes.ScheduleLoadStorage()
end
end
if (C_AddOns.IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
if (IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
_detalhes.schedule_storage_load = nil
_detalhes.StorageLoaded = true
if (_detalhes.debug) then
@@ -1467,7 +1467,7 @@ function _detalhes.OpenStorage()
do return end
--check if the storage is already loaded
if (not C_AddOns.IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
if (not IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
--can't open it during combat
if (InCombatLockdown() or UnitAffectingCombat("player")) then
if (_detalhes.debug) then
@@ -1476,7 +1476,7 @@ function _detalhes.OpenStorage()
return false
end
local loaded, reason = C_AddOns.LoadAddOn(CONST_ADDONNAME_DATASTORAGE)
local loaded, reason = LoadAddOn(CONST_ADDONNAME_DATASTORAGE)
if (not loaded) then
if (_detalhes.debug) then
print("|cFFFFFF00Details! Storage|r: can't load storage, may be the addon is disabled.")
@@ -1486,7 +1486,7 @@ function _detalhes.OpenStorage()
local db = createStorageTables()
if (db and C_AddOns.IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
if (db and IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
_detalhes.StorageLoaded = true
end
@@ -1503,8 +1503,8 @@ function Details.Database.LoadDB()
do return end
--check if the storage is already loaded
if (not C_AddOns.IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
local loaded, reason = C_AddOns.LoadAddOn(CONST_ADDONNAME_DATASTORAGE)
if (not IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then
local loaded, reason = LoadAddOn(CONST_ADDONNAME_DATASTORAGE)
if (not loaded) then
if (_detalhes.debug) then
print("|cFFFFFF00Details! Storage|r: can't save the encounter, couldn't load DataStorage, may be the addon is disabled.")
@@ -1988,35 +1988,6 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
end
end
local spec
local talents = {}
if (not DetailsFramework.IsTimewalkWoW()) then
spec = GetInspectSpecialization (unitid)
if (spec and spec ~= 0) then
_detalhes.cached_specs [guid] = spec
Details:SendEvent("UNIT_SPEC", nil, unitid, spec, guid)
end
--------------------------------------------------------------------------------------------------------
for i = 1, 7 do
for o = 1, 3 do
--need to review this in classic
local talentID, name, texture, selected, available = GetTalentInfo (i, o, 1, true, unitid)
if (selected) then
tinsert(talents, talentID)
break
end
end
end
if (talents [1]) then
_detalhes.cached_talents [guid] = talents
Details:SendEvent("UNIT_TALENTS", nil, unitid, talents, guid)
end
end
--------------------------------------------------------------------------------------------------------
if (ilvl_core.forced_inspects [guid]) then
@@ -2082,18 +2053,12 @@ function ilvl_core:ReGetItemLevel (t)
end
function ilvl_core:GetItemLevel (unitid, guid, is_forced, try_number)
--disable for timewalk wow ~timewalk
if (DetailsFramework.IsTimewalkWoW()) then
return
end
--ddouble check
if (not is_forced and (UnitAffectingCombat("player") or InCombatLockdown())) then
return
end
if (InCombatLockdown() or not unitid or not CanInspect(unitid) or not UnitPlayerControlled(unitid) or not CheckInteractDistance(unitid, CONST_INSPECT_ACHIEVEMENT_DISTANCE)) then
if (AscensionInspectFrame and AscensionInspectFrame:IsShown() or InCombatLockdown() or not unitid or not CanInspect(unitid) or not UnitPlayerControlled(unitid) or not CheckInteractDistance(unitid, CONST_INSPECT_ACHIEVEMENT_DISTANCE)) then
if (is_forced) then
try_number = try_number or 0
if (try_number > 18) then
@@ -2109,7 +2074,7 @@ function ilvl_core:GetItemLevel (unitid, guid, is_forced, try_number)
inspecting [guid] = {unitid, ilvl_core:ScheduleTimer("InspectTimeOut", 12, guid)}
ilvl_core.amt_inspecting = ilvl_core.amt_inspecting + 1
--NotifyInspect (unitid)
NotifyInspect (unitid)
end
local NotifyInspectHook = function(unitid) --not in use
@@ -2131,7 +2096,7 @@ local NotifyInspectHook = function(unitid) --not in use
end
end
end
--hooksecurefunc ("NotifyInspect", NotifyInspectHook)
hooksecurefunc ("NotifyInspect", NotifyInspectHook)
function ilvl_core:Reset()
ilvl_core.raid_id = 1
@@ -2144,11 +2109,6 @@ function ilvl_core:Reset()
end
function ilvl_core:QueryInspect (unitName, callback, param1)
--disable for timewalk wow ~timewalk
if (DetailsFramework.IsTimewalkWoW()) then
return
end
local unitid
if (IsInRaid()) then
@@ -2201,11 +2161,6 @@ function ilvl_core:ClearQueryInspectQueue()
end
function ilvl_core:Loop()
--disable for timewalk wow ~timewalk
if (DetailsFramework.IsTimewalkWoW()) then
return
end
if (ilvl_core.amt_inspecting >= MAX_INSPECT_AMOUNT) then
return
end
@@ -2253,11 +2208,6 @@ function ilvl_core:EnterCombat()
end
local can_start_loop = function()
--disable for timewalk wow ~timewalk
if (DetailsFramework.IsTimewalkWoW()) then
return false
end
if ((_detalhes:GetZoneType() ~= "raid" and _detalhes:GetZoneType() ~= "party") or ilvl_core.loop_process or _detalhes.in_combat or not _detalhes.track_item_level) then
return false
end
@@ -2421,372 +2371,40 @@ function Details:DecompressData (data, dataType)
end
end
Details.specToRole = {
--DRUID
[102] = "DAMAGER", --BALANCE
[103] = "DAMAGER", --FERAL DRUID
[105] = "HEALER", --RESTORATION
local function GetRoleFromSpecInfo(specInfo)
if specInfo.Healer then
return "HEALER"
elseif specInfo.Tank then
return "TANK"
else
return "DAMAGER"
end
end
--HUNTER
[253] = "DAMAGER", --BM
[254] = "DAMAGER", --MM
[255] = "DAMAGER", --SURVIVOR
Details.specToRole = {}
Details.validSpecIds = {}
--MAGE
[62] = "DAMAGER", --ARCANE
[64] = "DAMAGER", --FROST
[63] = "DAMAGER", ---FIRE
Details.textureToSpec = {}
Details.specToTexture = {}
--PALADIN
[70] = "DAMAGER", --RET
[65] = "HEALER", --HOLY
[66] = "TANK", --PROT
--PRIEST
[257] = "HEALER", --HOLY
[256] = "HEALER", --DISC
[258] = "DAMAGER", --SHADOW
--ROGUE
[259] = "DAMAGER", --ASSASSINATION
[260] = "DAMAGER", --COMBAT
[261] = "DAMAGER", --SUB
--SHAMAN
[262] = "DAMAGER", --ELEMENTAL
[263] = "DAMAGER", --ENHAN
[264] = "HEALER", --RESTO
--WARLOCK
[265] = "DAMAGER", --AFF
[266] = "DAMAGER", --DESTRO
[267] = "DAMAGER", --DEMO
--WARRIOR
[71] = "DAMAGER", --ARMS
[72] = "DAMAGER", --FURY
[73] = "TANK", --PROT
--DK
[250] = "TANK", --Blood
[251] = "DAMAGER", --Frost
[252] = "DAMAGER", --Unholy
--MONK
[268] = "TANK", -- Brewmaster Monk
[269] = "DAMAGER", -- Windwalker Monk
[270] = "HEALER", -- Mistweaver Monk
--DH
[577] = "DAMAGER", -- Havoc Demon Hunter
[581] = "TANK", -- Vengeance Demon Hunter
--EVOKER
[1467] = "DAMAGER", --Devastation Evoker
[1468] = "HEALER", --Preservation Evoker
[1473] = "DAMAGER", --Augmentation Evoker
}
for _, class in ipairs(CLASS_SORT_ORDER) do
local specs = C_ClassInfo.GetAllSpecs(class)
for _, spec in ipairs(specs) do
local specInfo = C_ClassInfo.GetSpecInfo(class, spec)
local thumbnail = ClassTalentUtil.GetThumbnailAtlas(class, spec)
Details.validSpecIds[specInfo.ID] = true
Details.specToRole[specInfo.ID] = GetRoleFromSpecInfo(specInfo)
Details.textureToSpec[thumbnail] = specInfo.ID
Details.specToTexture[specInfo.ID] = thumbnail
end
end
--oldschool talent tree
if (DetailsFramework.IsWotLKWow() or DetailsFramework.IsCataWow()) then
local talentWatchClassic = CreateFrame("frame")
talentWatchClassic:RegisterEvent("CHARACTER_POINTS_CHANGED")
talentWatchClassic:RegisterEvent("SPELLS_CHANGED")
talentWatchClassic:RegisterEvent("PLAYER_ENTERING_WORLD")
talentWatchClassic:RegisterEvent("GROUP_ROSTER_UPDATE")
talentWatchClassic.cooldown = 0
C_Timer.NewTicker(600, function()
Details:GetOldSchoolTalentInformation()
end)
talentWatchClassic:SetScript("OnEvent", function(self, event, ...)
if (talentWatchClassic.delayedUpdate and not talentWatchClassic.delayedUpdate:IsCancelled()) then
return
else
talentWatchClassic.delayedUpdate = C_Timer.NewTimer(5, Details.GetOldSchoolTalentInformation)
end
end)
function Details.GetOldSchoolTalentInformation()
--cancel any schedule
if (talentWatchClassic.delayedUpdate and not talentWatchClassic.delayedUpdate:IsCancelled()) then
talentWatchClassic.delayedUpdate:Cancel()
end
talentWatchClassic.delayedUpdate = nil
--amount of tabs existing
local numTabs = GetNumTalentTabs() or 3
--store the background textures for each tab
local pointsPerSpec = {}
local talentsSelected = {}
for i = 1, (MAX_TALENT_TABS or 3) do
if (i <= numTabs) then
--tab information
local id, name, description, iconTexture, pointsSpent, fileName
if DetailsFramework.IsCataWow() then
id, name, description, iconTexture, pointsSpent, fileName = GetTalentTabInfo(i)
else
name, iconTexture, pointsSpent, fileName = GetTalentTabInfo(i)
end
if (name) then
tinsert(pointsPerSpec, {name, pointsSpent, fileName})
end
--talents information
local numTalents = GetNumTalents (i) or 20
local MAX_NUM_TALENTS = MAX_NUM_TALENTS or 20
for talentIndex = 1, MAX_NUM_TALENTS do
if (talentIndex <= numTalents) then
local name, iconTexture, tier, column, rank, maxRank, isExceptional, available = GetTalentInfo (i, talentIndex)
if (name and rank and type(rank) == "number") then
--send the specID instead of the specName
local specID = Details.textureToSpec [fileName]
tinsert(talentsSelected, {iconTexture, rank, tier, column, i, specID, maxRank})
end
end
end
end
end
local MIN_SPECS = 4
--put the spec with more talent point to the top
table.sort (pointsPerSpec, function(t1, t2) return t1[2] > t2[2] end)
--get the spec with more points spent
local spec = pointsPerSpec[1]
if (spec and spec[2] >= MIN_SPECS) then
local specTexture = spec[3]
--add the spec into the spec cache
Details.playerClassicSpec = {}
Details.playerClassicSpec.specs = Details.GetClassicSpecByTalentTexture(specTexture)
Details.playerClassicSpec.talents = talentsSelected
--cache the player specId
_detalhes.cached_specs [UnitGUID("player")] = Details.playerClassicSpec.specs
--cache the player talents
_detalhes.cached_talents [UnitGUID("player")] = talentsSelected
local role = Details:GetRoleFromSpec(Details.playerClassicSpec.specs, UnitGUID("player"))
if (Details.playerClassicSpec.specs == 103) then
if (role == "TANK") then
Details.playerClassicSpec.specs = 104
_detalhes.cached_specs [UnitGUID("player")] = Details.playerClassicSpec.specs
end
end
_detalhes.cached_roles[UnitGUID("player")] = role
--gear status
local item_amount = 16
local item_level = 0
local failed = 0
local two_hand = {
["INVTYPE_2HWEAPON"] = true,
["INVTYPE_RANGED"] = true,
["INVTYPE_RANGEDRIGHT"] = true,
}
for equip_id = 1, 17 do
if (equip_id ~= 4) then --shirt slot, trinkets
local item = GetInventoryItemLink("player", equip_id)
if (item) then
local _, _, itemRarity, iLevel, _, _, _, _, equipSlot = GetItemInfo(item)
if (iLevel) then
item_level = item_level + iLevel
--16 = main hand 17 = off hand
-- if using a two-hand, ignore the off hand slot
if (equip_id == 16 and two_hand [equipSlot]) then
item_amount = 15
break
end
end
else
failed = failed + 1
if (failed > 2) then
break
end
end
end
end
local itemLevel = floor(item_level / item_amount)
local dataToShare = {role or "NONE", Details.playerClassicSpec.specs or 0, itemLevel or 0, talentsSelected, UnitGUID("player")}
--local serialized = _detalhes:Serialize(dataToShare)
local compressedData = Details:CompressData(dataToShare, "comm")
if (IsInRaid()) then
_detalhes:SendRaidData(DETAILS_PREFIX_TBC_DATA, compressedData)
if (_detalhes.debug) then
_detalhes:Msg("(debug) sent talents data to Raid")
end
elseif (IsInGroup()) then
_detalhes:SendPartyData(DETAILS_PREFIX_TBC_DATA, compressedData)
if (_detalhes.debug) then
_detalhes:Msg("(debug) sent talents data to Party")
end
end
end
end
function _detalhes:GetRoleFromSpec (specId, unitGUID)
if (specId == 103) then --feral druid
local talents = _detalhes.cached_talents [unitGUID]
if (talents) then
local tankTalents = 0
for i = 1, #talents do
local iconTexture, rank, tier, column = unpack(talents [i])
if (tier == 2) then
if (column == 1 and rank == 5) then
tankTalents = tankTalents + 5
end
if (column == 3 and rank == 5) then
tankTalents = tankTalents + 5
end
if (tankTalents >= 10) then
return "TANK"
end
end
end
end
end
do
function _detalhes:GetRoleFromSpec (specId)
return Details.specToRole [specId] or "NONE"
end
Details.validSpecIds = {
[250] = true,
[252] = true,
[251] = true,
[102] = true,
[103] = true,
[104] = true,
[105] = true,
[253] = true,
[254] = true,
[255] = true,
[62] = true,
[63] = true,
[64] = true,
[70] = true,
[65] = true,
[66] = true,
[257] = true,
[256] = true,
[258] = true,
[259] = true,
[260] = true,
[261] = true,
[262] = true,
[263] = true,
[264] = true,
[265] = true,
[266] = true,
[267] = true,
[71] = true,
[72] = true,
[73] = true,
}
Details.textureToSpec = {
DruidBalance = 102,
DruidFeralCombat = 103,
DruidRestoration = 105,
HunterBeastMastery = 253,
HunterMarksmanship = 254,
HunterSurvival = 255,
MageArcane = 62,
MageFrost = 64,
MageFire = 63,
PaladinCombat = 70,
PaladinHoly = 65,
PaladinProtection = 66,
PriestHoly = 257,
PriestDiscipline = 256,
PriestShadow = 258,
RogueAssassination = 259,
RogueCombat = 260,
RogueSubtlety = 261,
ShamanElementalCombat = 262,
ShamanEnhancement = 263,
ShamanRestoration = 264,
WarlockCurses = 265, --affliction
WarlockSummoning = 266, --demo
WarlockDestruction = 267, --destruction
--WarriorArm = 71,
WarriorArms = 71,
WarriorFury = 72,
WarriorProtection = 73,
DeathKnightBlood = 250,
DeathKnightFrost = 251,
DeathKnightUnholy = 252,
}
Details.specToTexture = {
[102] = "DruidBalance",
[103] = "DruidFeralCombat",
[105] = "DruidRestoration",
[253] = "HunterBeastMastery",
[254] = "HunterMarksmanship",
[255] = "HunterSurvival",
[62] = "MageArcane",
[64] = "MageFrost",
[63] = "MageFire",
[70] = "PaladinCombat",
[65] = "PaladinHoly",
[66] = "PaladinProtection",
[257] = "PriestHoly",
[256] = "PriestDiscipline",
[258] = "PriestShadow",
[259] = "RogueAssassination",
[260] = "RogueCombat",
[261] = "RogueSubtlety",
[262] = "ShamanElementalCombat",
[263] = "ShamanEnhancement",
[264] = "ShamanRestoration",
[265] = "WarlockCurses",
[266] = "WarlockDestruction",
[267] = "WarlockSummoning",
--[71] = "WarriorArm",
[71] = "WarriorArms",
[72] = "WarriorFury",
[73] = "WarriorProtection",
[250] = "DeathKnightBlood",
[251] = "DeathKnightFrost",
[252] = "DeathKnightUnholy",
}
function Details.IsValidSpecId (specId)
return Details.validSpecIds [specId]
end
@@ -2796,314 +2414,33 @@ if (DetailsFramework.IsWotLKWow() or DetailsFramework.IsCataWow()) then
end
end
--dragonflight talents, return {[spellId] = true}
function Details.GetDragonflightTalentsAsHashTable()
local allTalents = {}
local configId = C_ClassTalents.GetActiveConfigID()
if (not configId) then
return allTalents
end
local configInfo = C_Traits.GetConfigInfo(configId)
for treeIndex, treeId in ipairs(configInfo.treeIDs) do
local treeNodes = C_Traits.GetTreeNodes(treeId)
for nodeIdIndex, treeNodeID in ipairs(treeNodes) do
local traitNodeInfo = C_Traits.GetNodeInfo(configId, treeNodeID)
if (traitNodeInfo) then
local activeEntry = traitNodeInfo.activeEntry
if (activeEntry) then
local entryId = activeEntry.entryID
local rank = activeEntry.rank
if (rank > 0) then
--get the entry info
local traitEntryInfo = C_Traits.GetEntryInfo(configId, entryId)
local definitionId = traitEntryInfo.definitionID
--definition info
local traitDefinitionInfo = C_Traits.GetDefinitionInfo(definitionId)
local spellId = traitDefinitionInfo.overriddenSpellID or traitDefinitionInfo.spellID
local spellName, _, spellTexture = GetSpellInfo(spellId)
if (spellName) then
allTalents[spellId] = true
end
end
end
end
end
end
return allTalents
end
--called from inside the function Details.GenerateSpecSpellList()
local getSpellList = function(specIndex, completeListOfSpells, sharedSpellsBetweenSpecs, specNames)
local specId, specName, _, specIconTexture = GetSpecializationInfo(specIndex)
completeListOfSpells[specId] = {}
specNames[specId] = specName
--get spells from talents
local configId = C_ClassTalents.GetActiveConfigID()
if (not configId) then
return completeListOfSpells
end
local configInfo = C_Traits.GetConfigInfo(configId)
--get the spells from the SPEC from talents
for treeIndex, treeId in ipairs(configInfo.treeIDs) do
local treeNodes = C_Traits.GetTreeNodes(treeId)
for nodeIdIndex, treeNodeID in ipairs(treeNodes) do
local traitNodeInfo = C_Traits.GetNodeInfo(configId, treeNodeID)
if (traitNodeInfo and traitNodeInfo.posX > 9000) then
local entryIds = traitNodeInfo.entryIDs
for i = 1, #entryIds do
local entryId = entryIds[i] --number
local traitEntryInfo = C_Traits.GetEntryInfo(configId, entryId)
local borderTypes = Enum.TraitNodeEntryType
if (traitEntryInfo.type == borderTypes.SpendSquare) then
local definitionId = traitEntryInfo.definitionID
local traitDefinitionInfo = C_Traits.GetDefinitionInfo(definitionId)
local spellId = traitDefinitionInfo.overriddenSpellID or traitDefinitionInfo.spellID
local spellName, _, spellTexture = GetSpellInfo(spellId)
if (spellName) then
completeListOfSpells[specId][spellId] = specId
end
end
end
end
end
end
--get spells of the SPEC from the spell book
for i = 1, GetNumSpellTabs() do
local tabName, tabTexture, offset, numSpells, isGuild, offspecId = GetSpellTabInfo(i)
if (tabTexture == specIconTexture) then
offset = offset + 1
local tabEnd = offset + numSpells
for entryOffset = offset, tabEnd - 1 do
local spellType, spellId = GetSpellBookItemInfo(entryOffset, "player")
if (spellId) then
if (spellType == "SPELL") then
spellId = C_SpellBook.GetOverrideSpell(spellId)
local spellName = GetSpellInfo(spellId)
local isPassive = IsPassiveSpell(entryOffset, "player")
if (spellName and not isPassive) then
completeListOfSpells[specId][spellId] = specId
end
end
end
end
end
end
--get shared spells from the spell book
local tabName, tabTexture, offset, numSpells, isGuild, offspecId = GetSpellTabInfo(CONST_SPELLBOOK_CLASSSPELLS_TABID)
offset = offset + 1
local tabEnd = offset + numSpells
for entryOffset = offset, tabEnd - 1 do
local spellType, spellId = GetSpellBookItemInfo(entryOffset, "player")
if (spellId) then
if (spellType == "SPELL") then
spellId = C_SpellBook.GetOverrideSpell(spellId)
local spellName = GetSpellInfo(spellId)
local isPassive = IsPassiveSpell(entryOffset, "player")
if (spellName and not isPassive) then
sharedSpellsBetweenSpecs[spellId] = true
end
end
end
end
local classNameLoc = UnitClass("player")
print(specName .. " " .. classNameLoc .. " spells recorded.")
return completeListOfSpells, sharedSpellsBetweenSpecs, specNames
end
function Details.GenerateSpecSpellList()
local dumpSpellTable = 1
local specId, specName, _, specIconTexture = GetSpecializationInfo(GetSpecialization())
local classNameLoc, className, classId = UnitClass("player")
local completeListOfSpells = {}
local sharedSpellsBetweenSpecs = {}
local specNames = {}
local amountSpecs = GetNumSpecializationsForClassID(classId)
local totalTimeToWait = 0
DetailsFramework.Schedules.NewTimer(0, function() SetSpecialization(1) end)
DetailsFramework.Schedules.NewTimer(6, getSpellList, 1, completeListOfSpells, sharedSpellsBetweenSpecs, specNames)
totalTimeToWait = 7
DetailsFramework.Schedules.NewTimer(7, function() SetSpecialization(2) end)
DetailsFramework.Schedules.NewTimer(13, getSpellList, 2, completeListOfSpells, sharedSpellsBetweenSpecs, specNames)
totalTimeToWait = 14
if (amountSpecs >= 3) then
DetailsFramework.Schedules.NewTimer(14, function() SetSpecialization(3) end)
DetailsFramework.Schedules.NewTimer(20, getSpellList, 3, completeListOfSpells, sharedSpellsBetweenSpecs, specNames)
totalTimeToWait = 21
end
if (amountSpecs >= 4) then
DetailsFramework.Schedules.NewTimer(21, function() SetSpecialization(4) end)
DetailsFramework.Schedules.NewTimer(28, getSpellList, 4, completeListOfSpells, sharedSpellsBetweenSpecs, specNames)
totalTimeToWait = 29
end
print("Total Time to Wait:", totalTimeToWait)
DetailsFramework.Schedules.NewTimer(totalTimeToWait, function()
if (dumpSpellTable) then
local parsedSpells = {}
local sharedSpells = sharedSpellsBetweenSpecs
for specId, spellTable in pairs(completeListOfSpells) do
parsedSpells[specId] = {}
--create a list of spells which is in use in the other spec talent tree
local spellsInUse = {}
for specId2, spellTable2 in pairs(completeListOfSpells) do
if (specId2 ~= specId) then
for spellId in pairs(spellTable2) do
spellsInUse[spellId] = true
end
end
end
for spellId in pairs(sharedSpells) do
spellsInUse[spellId] = true
end
--build the list of spells for this spec
for spellId in pairs(spellTable) do
if (not spellsInUse[spellId]) then
parsedSpells[specId][spellId] = true
end
end
end
local result = ""
for specId, spellsTable in pairs(parsedSpells) do
local specName = specNames[specId]
result = result .. "\n--" .. specName .. " " .. classNameLoc .. ":\n"
for spellId in pairs(spellsTable) do
local spellName = GetSpellInfo(spellId)
result = result .. "[" .. spellId .. "] = " .. specId .. ", --" .. spellName .. "\n"
end
end
Details:Dump({result})
end
end)
end
function Details.GenerateRacialSpellList()
local racialsSpells = "|n"
local locClassName, unitClass = UnitClass("player")
local locPlayerRace, playerRace, playerRaceId = UnitRace("player")
--get general spells from the spell book
local tabName, tabTexture, offset, numSpells, isGuild, offspecId = GetSpellTabInfo(CONST_SPELLBOOK_GENERAL_TABID)
offset = offset + 1
local tabEnd = offset + numSpells
for entryOffset = offset, tabEnd - 1 do
local spellType, spellId = GetSpellBookItemInfo(entryOffset, "player")
if (spellId) then
local spell = Spell:CreateFromSpellID(spellId)
local subSpellName = spell:GetSpellSubtext()
if (subSpellName == "Racial") then
spellId = C_SpellBook.GetOverrideSpell(spellId)
local spellName = GetSpellInfo(spellId)
local isPassive = IsPassiveSpell(entryOffset, "player")
if (spellName and not isPassive) then
local cooldownTime = floor(GetSpellBaseCooldown(spellId) / 1000)
racialsSpells = racialsSpells .. "[" .. spellId .. "] = {cooldown = " .. cooldownTime .. ", duration = 0, specs = {}, talent = false, charges = 1, raceid = " .. playerRaceId .. ", race = \"".. playerRace .."\", class = \"\", type = 9}, --" .. spellName .. " (" .. playerRace .. ")|n"
end
end
end
end
racialsSpells = racialsSpells .. "|n"
dumpt(racialsSpells)
end
--fill the passed table with spells from talents and spellbook, affect only the active spec
function Details.FillTableWithPlayerSpells(completeListOfSpells)
local specId, specName, _, specIconTexture = GetSpecializationInfo(GetSpecialization())
local classNameLoc, className, classId = UnitClass("player")
for tab = 2, GetNumSpellTabs() do
local name, _, offset, numSpells = GetSpellTabInfo(tab)
--get spells from talents
local configId = C_ClassTalents.GetActiveConfigID()
if (configId) then
local configInfo = C_Traits.GetConfigInfo(configId)
--get the spells from the SPEC from talents
for treeIndex, treeId in ipairs(configInfo.treeIDs) do
local treeNodes = C_Traits.GetTreeNodes(treeId)
for nodeIdIndex, treeNodeID in ipairs(treeNodes) do
local traitNodeInfo = C_Traits.GetNodeInfo(configId, treeNodeID)
if (traitNodeInfo) then
local entryIds = traitNodeInfo.entryIDs
for i = 1, #entryIds do
local entryId = entryIds[i] --number
local traitEntryInfo = C_Traits.GetEntryInfo(configId, entryId)
local borderTypes = Enum.TraitNodeEntryType
if (traitEntryInfo.type == borderTypes.SpendSquare) then
local definitionId = traitEntryInfo.definitionID
local traitDefinitionInfo = C_Traits.GetDefinitionInfo(definitionId)
local spellId = traitDefinitionInfo.overriddenSpellID or traitDefinitionInfo.spellID
local spellName, _, spellTexture = GetSpellInfo(spellId)
if (spellName) then
completeListOfSpells[spellId] = completeListOfSpells[spellId] or true
end
end
end
end
end
end
end
if name and name ~= "Internal" and name ~= "Ascension Vanity Items" then
for i = offset + 1, offset + numSpells do
local spellName, rank = GetSpellInfo(i, BOOKTYPE_SPELL)
--get spells from the Spec spellbook
for i = 1, GetNumSpellTabs() do
local tabName, tabTexture, offset, numSpells, isGuild, offspecId = GetSpellTabInfo(i)
if (tabTexture == specIconTexture) then
offset = offset + 1
local tabEnd = offset + numSpells
for entryOffset = offset, tabEnd - 1 do
local spellType, spellId = GetSpellBookItemInfo(entryOffset, "player")
if (spellId) then
if (spellType == "SPELL") then
spellId = C_SpellBook.GetOverrideSpell(spellId)
local spellName = GetSpellInfo(spellId)
local isPassive = IsPassiveSpell(entryOffset, "player")
if (spellName and not isPassive) then
completeListOfSpells[spellId] = completeListOfSpells[spellId] or true
if spellName then
local link = GetSpellLink(spellName, rank)
if link then
local spellID = tonumber(link:match("spell:(%d*)"))
if spellID and not IsPassiveSpellID(spellID) then
if LIB_OPEN_RAID_MULTI_OVERRIDE_SPELLS and LIB_OPEN_RAID_MULTI_OVERRIDE_SPELLS[spellID] then
for _, overrideSpellID in pairs(LIB_OPEN_RAID_MULTI_OVERRIDE_SPELLS[spellID]) do
completeListOfSpells[overrideSpellID] = true
end
else
completeListOfSpells[spellID] = true
end
end
end
end
end
end
end
--get class shared spells from the spell book
local tabName, tabTexture, offset, numSpells, isGuild, offspecId = GetSpellTabInfo(CONST_SPELLBOOK_CLASSSPELLS_TABID)
offset = offset + 1
local tabEnd = offset + numSpells
for entryOffset = offset, tabEnd - 1 do
local spellType, spellId = GetSpellBookItemInfo(entryOffset, "player")
if (spellId) then
if (spellType == "SPELL") then
spellId = C_SpellBook.GetOverrideSpell(spellId)
local spellName = GetSpellInfo(spellId)
local isPassive = IsPassiveSpell(entryOffset, "player")
if (spellName and not isPassive) then
completeListOfSpells[spellId] = completeListOfSpells[spellId] or true
end
end
end
end
end
function Details.SavePlayTimeOnClass()
@@ -3161,20 +2498,7 @@ end
hooksecurefunc("ChatFrame_DisplayTimePlayed", function()
if (Details.played_class_time) then
C_Timer.After(0, function()
local expansionName = _G["EXPANSION_NAME" .. GetExpansionLevel()]
for fontString in ChatFrame1.fontStringPool:EnumerateActive() do
if (fontString:GetText() and fontString:GetText():find(expansionName)) then
return
end
end
local levelText = TIME_PLAYED_LEVEL and TIME_PLAYED_LEVEL:gsub("%%s", "") or ""
for fontString in ChatFrame1.fontStringPool:EnumerateActive() do
if (fontString:GetText() and fontString:GetText():find(levelText)) then
print(Details.GetPlayTimeOnClassString() .. " \ncommand: /details playedclass")
break
end
end
print(Details.GetPlayTimeOnClassString() .. " \ncommand: /details playedclass")
end)
end
end)
+5 -100
View File
@@ -45,7 +45,6 @@
local CONST_ROGUE_SR = "SR" --soul rip from akaari's soul (LEGION ONLY)
_G.DETAILS_PREFIX_COACH = "CO" --coach feature
_G.DETAILS_PREFIX_TBC_DATA = "BC" --tbc data
Details.network.ids = {
["HIGHFIVE_REQUEST"] = CONST_HIGHFIVE_REQUEST,
@@ -69,8 +68,6 @@
["CLOUD_SHAREDATA"] = CONST_CLOUD_SHAREDATA,
["COACH_FEATURE"] = DETAILS_PREFIX_COACH, --ask the raid leader is the coach is enbaled
["TBC_DATA"] = DETAILS_PREFIX_TBC_DATA, --get basic information about the player
}
local registredPlugins = {}
@@ -110,10 +107,6 @@
return
end
if (DetailsFramework.IsTimewalkWoW()) then
return
end
--check the player level to be at least 60
---@type number
local playerLevel = UnitLevel("player")
@@ -130,48 +123,9 @@
end
--get the equipped player item level
local overall, equipped = GetAverageItemLevel()
local equipped = GetAverageItemLevel()
local talentsAsString = ""
--get player talents
--depending on the game version, the talent API is different
--vertical tree
if (DetailsFramework.IsClassicWow()) then --vanilla
talentsAsString = ""
elseif (DetailsFramework.IsTBCWow()) then --burning crusade
talentsAsString = ""
elseif (DetailsFramework.IsWotLKWow()) then --wrath of the lich king
talentsAsString = ""
elseif (DetailsFramework.IsCataWow()) then --cataclysm
talentsAsString = ""
end
--horizontal pick one
if (DetailsFramework.IsPandaWow()) then
talentsAsString = getHorizontalTalentsAsString()
elseif (DetailsFramework.IsWarlordsWow()) then
talentsAsString = getHorizontalTalentsAsString()
elseif (DetailsFramework.IsLegionWow()) then
talentsAsString = getHorizontalTalentsAsString()
elseif (DetailsFramework.IsBFAWow()) then
talentsAsString = getHorizontalTalentsAsString()
elseif (DetailsFramework.IsShadowlandsWow()) then
talentsAsString = getHorizontalTalentsAsString()
end
--vertical, horizonal tree
if (DetailsFramework.IsDragonflight()) then
talentsAsString = detailsFramework:GetDragonlightTalentString()
end
local talentsAsString = C_CharacterAdvancement.ExportBuild(true)
--get the spec ID
local spec = DetailsFramework.GetSpecialization()
@@ -280,47 +234,6 @@
--deprecated
end
function Details.network.TBCData(player, realm, coreVersion, data)
if (not IsInRaid() and not IsInGroup()) then
return
end
local LibDeflate = _G.LibStub:GetLibrary("LibDeflate")
local dataCompressed = LibDeflate:DecodeForWoWAddonChannel(data)
local dataSerialized = LibDeflate:DecompressDeflate(dataCompressed)
local dataTable = {Details:Deserialize(dataSerialized)}
tremove(dataTable, 1)
local dataTable = dataTable[1]
local playerRole = dataTable[1]
local spec = dataTable[2]
local itemLevel = dataTable[3]
local talents = dataTable[4]
local guid = dataTable[5]
--[=[
print("Details! Received TBC Comm Data:")
print("From:", player)
print("spec:", spec)
print("role:", playerRole)
print("item level:", itemLevel)
print("guid:", guid)
--]=]
if (guid) then
Details.cached_talents[guid] = talents
if (spec and spec ~= 0) then
Details.cached_specs[guid] = spec
end
Details.cached_roles[guid] = playerRole
Details.item_level_pool[guid] = {
name = player,
ilvl = itemLevel,
time = time()
}
end
end
--"CIEA" Coach Is Enabled Ask (client > server)
--"CIER" Coach Is Enabled Response (server > client)
--"CCS" Coach Combat Start (client > server)
@@ -486,7 +399,6 @@
[CONST_PVP_ENEMY] = Details.network.ReceivedEnemyPlayer,
[DETAILS_PREFIX_COACH] = Details.network.Coach, --coach feature
[DETAILS_PREFIX_TBC_DATA] = Details.network.TBCData
}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -610,24 +522,17 @@
end
function Details:SendHomeRaidData(type, ...)
if (IsInRaid(LE_PARTY_CATEGORY_HOME) and IsInInstance()) then
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...), "RAID")
end
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...), "RAID")
end
function Details:SendRaidData(type, ...)
local isInInstanceGroup = IsInRaid(LE_PARTY_CATEGORY_INSTANCE)
if (isInInstanceGroup) then
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...), "INSTANCE_CHAT")
else
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...), "RAID")
end
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...), "RAID")
end
function Details:SendPartyData(type, ...)
local prefix = DETAILS_PREFIX_NETWORK
local data = Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...)
local channel = IsInGroup(LE_PARTY_CATEGORY_INSTANCE) and "INSTANCE_CHAT" or "PARTY"
local channel = "PARTY"
Details:SendCommMessage(prefix, data, channel)
end
+337 -931
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -572,7 +572,7 @@
bigDogRowTexture:SetPoint("bottomleft", optionsLeftSideBarMenu, "bottomleft", 1, 1)
bigDogRowTexture:SetPoint("bottomright", optionsLeftSideBarMenu, "bottomright", -1, 1)
bigDogRowTexture:SetHeight(20)
bigDogRowTexture:SetColorTexture(.5, .5, .5, .1)
bigDogRowTexture:SetTexture(.5, .5, .5, .1)
bigDogRowTexture:Hide()
--tools title bar
+3 -3
View File
@@ -595,7 +595,7 @@ do
function PDps:PlayerLeaveCombat()
for index, child in ipairs(PDps.childs) do
if (child.tick) then
Details:CancelTimer(child.tick)
Details:CancelTimer(child.tick, true)
child.tick = nil
end
end
@@ -889,7 +889,7 @@ do
--leave combat
function Clock:PlayerLeaveCombat()
Details:CancelTimer(Clock.tick)
Details:CancelTimer(Clock.tick, true)
end
function Details:ClockPluginTickOnSegment()
@@ -1556,7 +1556,7 @@ function Details.StatusBar:OpenOptionsForChild(child)
_G.DetailsStatusBarOptionsTextStyleDropdown.MyObject:Select(child.options.textStyle, true)
_G.DetailsStatusBarOptionsTextColorTexture:SetColorTexture(child.options.textColor[1], child.options.textColor[2], child.options.textColor[3], child.options.textColor[4])
_G.DetailsStatusBarOptionsTextColorTexture:SetTexture(child.options.textColor[1], child.options.textColor[2], child.options.textColor[3], child.options.textColor[4])
_G.DetailsStatusBarOptionsSliderFontSize.MyObject:SetFixedParameter(child)
_G.DetailsStatusBarOptionsSliderFontSize.MyObject:SetValue(child.options.textSize)
+6 -9
View File
@@ -36,7 +36,7 @@
local gump = Details.gump --details local
function Details:IsInMythicPlus()
return C_ChallengeMode and C_ChallengeMode.IsChallengeModeActive and C_ChallengeMode.IsChallengeModeActive()
return C_MythicPlus.IsKeystoneActive()
end
local predicateFunc = function(spellIdToFind, casterName, _, name, icon, applications, dispelName, duration, expirationTime, sourceUnitId, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, applications)
@@ -91,9 +91,9 @@
do
function Details:FindBuffCastedBy(unitId, buffSpellId, casterName) --not called anywhere else except the function below
local auraName, texture, count, auraType, duration, expTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, playerOrPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = AuraUtil.FindAura(predicateFunc, unitId, "HELPFUL", buffSpellId, casterName)
local auraName, rank, texture, count, auraType, duration, expTime, sourceUnit, isStealable, shouldConsolidate, spellId = AuraUtil.FindAura(predicateFunc, unitId, "HELPFUL", buffSpellId, casterName)
if (auraName) then
return auraName, texture, count, auraType, duration, expTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, playerOrPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5
return auraName, rank, texture, count, auraType, duration, expTime, sourceUnit, isStealable, shouldConsolidate, spellId
end
end
@@ -1559,13 +1559,11 @@ end
FlashAnimation.fadeOut = FlashAnimation:CreateAnimation("Alpha") --fade out anime
FlashAnimation.fadeOut:SetOrder (1)
FlashAnimation.fadeOut:SetFromAlpha (0)
FlashAnimation.fadeOut:SetToAlpha (1)
FlashAnimation.fadeOut:SetChange(-1)
FlashAnimation.fadeIn = FlashAnimation:CreateAnimation("Alpha") --fade in anime
FlashAnimation.fadeIn:SetOrder (2)
FlashAnimation.fadeIn:SetFromAlpha (0)
FlashAnimation.fadeIn:SetToAlpha (1)
FlashAnimation.fadeIn:SetChange(1)
frame.FlashAnimation = FlashAnimation
FlashAnimation.frame = frame
@@ -1813,12 +1811,11 @@ end
Details222.BarIconSetList = {
{value = [[]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE1"], icon = defaultIconTexture, texcoord = defaultClassIconCoords, iconsize = defaultIconSize, iconcolor = {1, 1, 1, .3}},
{value = [[Interface\AddOns\Details\images\classes_small]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE2"], icon = defaultIconTexture, texcoord = defaultClassIconCoords, iconsize = defaultIconSize},
{value = [[Interface\AddOns\Details\images\spec_icons_normal]], label = "Specialization", isSpec = true, icon = [[Interface\AddOns\Details\images\icons]], texcoord = defaultSpecIconCoords, iconsize = defaultIconSize},
{value = [[Interface\AddOns\Details\images\spec_icons_normal_alpha]], label = "Specialization Alpha", isSpec = true, icon = [[Interface\AddOns\Details\images\icons]], texcoord = defaultSpecIconCoords, iconsize = defaultIconSize},
{value = [[Interface\AddOns\Details\images\classes_small_bw]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE3"], icon = defaultIconTexture, texcoord = defaultClassIconCoords, iconsize = defaultIconSize},
{value = [[Interface\AddOns\Details\images\classes_small_alpha]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE4"], icon = defaultIconTexture, texcoord = defaultClassIconCoords, iconsize = defaultIconSize},
{value = [[Interface\AddOns\Details\images\classes_small_alpha_bw]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE6"], icon = defaultIconTexture, texcoord = defaultClassIconCoords, iconsize = defaultIconSize},
{value = [[Interface\AddOns\Details\images\classes]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE5"], icon = defaultIconTexture, texcoord = defaultClassIconCoords, iconsize = defaultIconSize},
{value = [[Interface\AddOns\Details\images\classes_alpha]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE7"], icon = defaultIconTexture, texcoord = defaultClassIconCoords, iconsize = defaultIconSize},
}
function Details:AddCustomIconSet(path, dropdownLabel, isSpecIcons, dropdownIcon, dropdownIconTexCoords, dropdownIconSize, dropdownIconColor)
+2 -4
View File
@@ -957,14 +957,12 @@
--WaitTexture:SetDesaturated(true)
--WaitTexture:SetVertexColor(1, 1, 1, 0.3)
WaitForPluginFrame.wheel = WaitTexture
local RotateAnimGroup = WaitForPluginFrame:CreateAnimationGroup()
local RotateAnimGroup = WaitTexture:CreateAnimationGroup()
local rotate = RotateAnimGroup:CreateAnimation("Alpha")
--rotate:SetDegrees(360)
--rotate:SetDuration(5)
rotate:SetFromAlpha(0.8)
rotate:SetToAlpha(1)
rotate:SetChange(-0.2)
--RotateAnimGroup:SetLooping ("repeat")
rotate:SetTarget(WaitTexture)
local bgpanel = gump:NewPanel(WaitForPluginFrame, WaitForPluginFrame, "DetailsWaitFrameBG"..self.meu_id, nil, 120, 30, false, false, false)
bgpanel:SetPoint("center", WaitForPluginFrame, "center")