Remove most C_ functions that cannot be downported
This commit is contained in:
+3
-8
@@ -9,11 +9,8 @@ local detailsFramework = DF
|
||||
|
||||
local _
|
||||
local tinsert = table.insert
|
||||
local GetSpellInfo = GetSpellInfo or function(spellID) if not spellID then return nil end local si = C_Spell.GetSpellInfo(spellID) if si then return si.name, nil, si.iconID, si.castTime, si.minRange, si.maxRange, si.spellID, si.originalIconID end end
|
||||
local GetSpellInfo = GetSpellInfo
|
||||
local lower = string.lower
|
||||
local SpellBookItemTypeMap = Enum.SpellBookItemType and {[Enum.SpellBookItemType.Spell] = "SPELL", [Enum.SpellBookItemType.None] = "NONE", [Enum.SpellBookItemType.Flyout] = "FLYOUT", [Enum.SpellBookItemType.FutureSpell] = "FUTURESPELL", [Enum.SpellBookItemType.PetAction] = "PETACTION" } or {}
|
||||
local GetSpellBookItemInfo = GetSpellBookItemInfo
|
||||
local SPELLBOOK_BANK_PLAYER = Enum.SpellBookSpellBank and Enum.SpellBookSpellBank.Player or "player"
|
||||
local GetNumSpellTabs = GetNumSpellTabs
|
||||
local GetSpellTabInfo = GetSpellTabInfo
|
||||
local unpack = unpack
|
||||
@@ -21,19 +18,17 @@ local CreateFrame = CreateFrame
|
||||
local GameTooltip = GameTooltip
|
||||
local tremove = tremove
|
||||
|
||||
local CONST_MAX_SPELLS = 500000
|
||||
|
||||
function DF:GetAuraByName(unit, spellName, isDebuff)
|
||||
isDebuff = isDebuff and "HARMFUL|PLAYER"
|
||||
|
||||
for i = 1, 40 do
|
||||
local name, texture, count, debuffType, duration, expirationTime, caster, canStealOrPurge, nameplateShowPersonal, spellId, canApplyAura, isBossDebuff, isCastByPlayer, nameplateShowAll = UnitAura(unit, i, isDebuff)
|
||||
local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, shouldConsolidate, spellID = UnitAura(unit, i, isDebuff)
|
||||
if (not name) then
|
||||
return
|
||||
end
|
||||
|
||||
if (name == spellName) then
|
||||
return name, texture, count, debuffType, duration, expirationTime, caster, canStealOrPurge, nameplateShowPersonal, spellId, canApplyAura, isBossDebuff, isCastByPlayer, nameplateShowAll
|
||||
return name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, shouldConsolidate, spellID
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+6
-7
@@ -15,9 +15,8 @@ local wipe = table.wipe
|
||||
local insert = table.insert
|
||||
local max = math.max
|
||||
|
||||
local GetSpellInfo = GetSpellInfo or function(spellID) if not spellID then return nil end local si = C_Spell.GetSpellInfo(spellID) if si then return si.name, nil, si.iconID, si.castTime, si.minRange, si.maxRange, si.spellID, si.originalIconID end end
|
||||
local SPELLBOOK_BANK_PLAYER = Enum.SpellBookSpellBank and Enum.SpellBookSpellBank.Player or "player"
|
||||
local IsPassiveSpell = IsPassiveSpell or C_Spell.IsSpellPassive
|
||||
local GetSpellInfo = GetSpellInfo
|
||||
local IsPassiveSpell = IsPassiveSpell
|
||||
|
||||
--api locals
|
||||
local PixelUtil = PixelUtil or DFPixelUtil
|
||||
@@ -1919,10 +1918,10 @@ function DF:CreateCoolTip()
|
||||
local spellDescription = GetSpellDescription(spellId)
|
||||
local cooldownTime, globalCooldown = GetSpellBaseCooldown(spellId)
|
||||
--local cooldown = cooldownTime / 1000
|
||||
local bIsPassive = IsPassiveSpell(spellId, SPELLBOOK_BANK_PLAYER)
|
||||
local chargesAvailable, maxCharges, chargeCooldownStart, rechargeTime, chargeModRate = GetSpellCharges(spellId)
|
||||
local bIsPassive = IsPassiveSpell(spellId, "spell")
|
||||
local chargesAvailable, maxCharges, chargeCooldownStart, rechargeTime = GetSpellCharges(spellId)
|
||||
|
||||
local tResourceCost = GetSpellPowerCost(spellId)
|
||||
local tResourceCost = GetSpellPowerCost and GetSpellPowerCost(spellId)
|
||||
--[=[
|
||||
hasRequiredAura=false,
|
||||
type=0,
|
||||
@@ -1942,7 +1941,7 @@ function DF:CreateCoolTip()
|
||||
gameCooltip:AddIcon(spellIcon, 1, 1, 20, 20, .1, .9, .1, .9)
|
||||
|
||||
if (not bShowDescriptionOnly) then
|
||||
if (tResourceCost.cost and tResourceCost.cost > 0) then
|
||||
if (tResourceCost and tResourceCost.cost and tResourceCost.cost > 0) then
|
||||
if (maxRange and maxRange > 0) then
|
||||
gameCooltip:AddLine(tResourceCost.cost .. " " .. (_G[tResourceCost.name] or tResourceCost.name), string.format(_G.SPELL_RANGE, math.floor(maxRange)), 1, 1, 1, 1, nil, 12)
|
||||
else
|
||||
|
||||
+38
-229
@@ -1573,34 +1573,10 @@ end
|
||||
function DF:GetAllTalents()
|
||||
local allTalents = {}
|
||||
|
||||
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 activeEntry = traitNodeInfo.activeEntry
|
||||
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) then -- == borderTypes.SpendCircle
|
||||
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
|
||||
local talentInfo = {Name = spellName, ID = spellId, Texture = spellTexture, IsSelected = (activeEntry and activeEntry.rank and activeEntry.rank > 0) or false}
|
||||
allTalents[#allTalents+1] = talentInfo
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
for _, entry in ipairs(C_CharacterAdvancement.GetAllEntries()) do
|
||||
if entry.Type == "Talent" then
|
||||
local talentInfo = {Name = entry.name, ID = entry.ID, Texture = entry.icon, IsSelected = entry.selected}
|
||||
allTalents[#allTalents + 1] = talentInfo
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1612,86 +1588,29 @@ end
|
||||
function DF:GetAvailableSpells()
|
||||
local completeListOfSpells = {}
|
||||
|
||||
--this line might not be compatible with classic
|
||||
--local specId, specName, _, specIconTexture = GetSpecializationInfo(GetSpecialization())
|
||||
--local classNameLoc, className, classId = UnitClass("player") --not in use
|
||||
local locPlayerRace, playerRace, playerRaceId = UnitRace("player")
|
||||
|
||||
--get racials from the general tab
|
||||
local generalTabIndex = 1
|
||||
local tabName, tabTexture, offset, numSpells, isGuild, offspecId = GetSpellTabInfo(generalTabIndex)
|
||||
offset = offset + 1
|
||||
local tabEnd = offset + numSpells
|
||||
for entryOffset = offset, tabEnd - 1 do
|
||||
local spellType, spellId = GetSpellBookItemInfo(entryOffset, SPELLBOOK_BANK_PLAYER)
|
||||
local spellData = LIB_OPEN_RAID_COOLDOWNS_INFO[spellId]
|
||||
if (spellData) then
|
||||
local raceId = spellData.raceid
|
||||
if (raceId) then
|
||||
if (type(raceId) == "table") then
|
||||
if (raceId[playerRaceId]) then
|
||||
local spellName = GetSpellInfo(spellId)
|
||||
local bIsPassive = IsPassiveSpell(spellId, SPELLBOOK_BANK_PLAYER)
|
||||
if (spellName and not bIsPassive) then
|
||||
completeListOfSpells[spellId] = true
|
||||
end
|
||||
end
|
||||
|
||||
elseif (type(raceId) == "number") then
|
||||
if (raceId == playerRaceId) then
|
||||
local spellName = GetSpellInfo(spellId)
|
||||
local bIsPassive = IsPassiveSpell(spellId, SPELLBOOK_BANK_PLAYER)
|
||||
if (spellName and not bIsPassive) then
|
||||
completeListOfSpells[spellId] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--get spells from the Spec spellbook
|
||||
local amountOfTabs = GetNumSpellTabs()
|
||||
for i = 2, amountOfTabs-1 do --starting at index 2 to ignore the general tab
|
||||
for i = 2, amountOfTabs do --starting at index 2 to ignore the general tab
|
||||
local tabName, tabTexture, offset, numSpells, isGuild, offSpecId, shouldHide, specID = GetSpellTabInfo(i)
|
||||
local bIsOffSpec = offSpecId ~= 0
|
||||
offset = offset + 1
|
||||
local tabEnd = offset + numSpells
|
||||
for entryOffset = offset, tabEnd - 1 do
|
||||
local spellType, spellId = GetSpellBookItemInfo(entryOffset, SPELLBOOK_BANK_PLAYER)
|
||||
if (spellId) then
|
||||
if (spellType == "SPELL") then
|
||||
local spellName = GetSpellInfo(spellId)
|
||||
local bIsPassive = IsPassiveSpell(spellId, SPELLBOOK_BANK_PLAYER)
|
||||
if (spellName and not bIsPassive) then
|
||||
completeListOfSpells[spellId] = bIsOffSpec == false
|
||||
if tabName and tabName ~= "Internal" and tabName ~= "Ascension Vanity Items" then
|
||||
local bIsOffSpec = offSpecId ~= 0
|
||||
offset = offset + 1
|
||||
local tabEnd = offset + numSpells
|
||||
for entryOffset = offset, tabEnd - 1 do
|
||||
local spellType, spellId = GetSpellBookItemInfo(entryOffset, SPELLBOOK_BANK_PLAYER)
|
||||
if (spellId) then
|
||||
if (spellType == "SPELL") then
|
||||
local spellName = GetSpellInfo(spellId)
|
||||
local bIsPassive = IsPassiveSpell(spellId, SPELLBOOK_BANK_PLAYER)
|
||||
if (spellName and not bIsPassive) then
|
||||
completeListOfSpells[spellId] = bIsOffSpec == false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--get class shared spells from the spell book
|
||||
--[=[
|
||||
local tabName, tabTexture, offset, numSpells, isGuild, offSpecId = GetSpellTabInfo(2)
|
||||
local bIsOffSpec = offSpecId ~= 0
|
||||
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
|
||||
local spellName = GetSpellInfo(spellId)
|
||||
local bIsPassive = IsPassiveSpell(spellId, "player")
|
||||
|
||||
if (spellName and not bIsPassive) then
|
||||
completeListOfSpells[spellId] = bIsOffSpec == false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
--]=]
|
||||
|
||||
local getNumPetSpells = function()
|
||||
--'HasPetSpells' contradicts the name and return the amount of pet spells available instead of a boolean
|
||||
return HasPetSpells()
|
||||
@@ -4259,59 +4178,8 @@ function DF:GetClassSpecIds(engClass) --naming conventions
|
||||
return DF:GetClassSpecIDs(engClass)
|
||||
end
|
||||
|
||||
--kinda deprecated
|
||||
local getDragonflightTalents = function()
|
||||
if (not ClassTalentFrame) then
|
||||
ClassTalentFrame_LoadUI()
|
||||
end
|
||||
|
||||
if (not DF.TalentExporter) then
|
||||
local talentExporter = CreateFromMixins(ClassTalentImportExportMixin)
|
||||
DF.TalentExporter = talentExporter
|
||||
end
|
||||
|
||||
local exportStream = ExportUtil.MakeExportDataStream()
|
||||
|
||||
local configId = C_ClassTalents.GetActiveConfigID()
|
||||
if (not configId) then
|
||||
return ""
|
||||
end
|
||||
|
||||
local configInfo = C_Traits.GetConfigInfo(configId)
|
||||
if (not configInfo) then
|
||||
return ""
|
||||
end
|
||||
|
||||
local currentSpecID = PlayerUtil.GetCurrentSpecID()
|
||||
|
||||
local treeInfo = C_Traits.GetTreeInfo(configId, configInfo.treeIDs[1])
|
||||
local treeHash = C_Traits.GetTreeHash(treeInfo.ID)
|
||||
local serializationVersion = C_Traits.GetLoadoutSerializationVersion()
|
||||
|
||||
DF.TalentExporter:WriteLoadoutHeader(exportStream, serializationVersion, currentSpecID, treeHash)
|
||||
DF.TalentExporter:WriteLoadoutContent(exportStream, configId, treeInfo.ID)
|
||||
|
||||
return exportStream:GetExportString()
|
||||
end
|
||||
|
||||
local getDragonflightTalentsEasy = function()
|
||||
local activeConfigID = C_ClassTalents.GetActiveConfigID()
|
||||
if (activeConfigID and activeConfigID > 0) then
|
||||
return C_Traits.GenerateImportString(activeConfigID)
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
--/dump DetailsFramework:GetDragonlightTalentString()
|
||||
function DF:GetDragonlightTalentString()
|
||||
local runOkay, errorText = pcall(getDragonflightTalentsEasy)
|
||||
if (not runOkay) then
|
||||
DF:Msg("error 0x4517", errorText)
|
||||
return ""
|
||||
else
|
||||
local talentString = errorText
|
||||
return talentString
|
||||
end
|
||||
function DF:GetAscensionTalentString()
|
||||
return C_CharacterAdvancement.ExportBuild(true)
|
||||
end
|
||||
|
||||
local dispatch_error = function(context, errortext)
|
||||
@@ -4440,19 +4308,19 @@ end
|
||||
|
||||
|
||||
--store and return a list of character races, always return the non-localized value
|
||||
DF.RaceCache = {}
|
||||
DF.RaceCache = {
|
||||
{ Name = "Human", FileString = "Human", ID = Enum.Race.Human },
|
||||
{ Name = "Orc", FileString = "Orc", ID = Enum.Race.Orc },
|
||||
{ Name = "Dwarf", FileString = "Dwarf", ID = Enum.Race.Dwarf },
|
||||
{ Name = "Night Elf", FileString = "NightElf", ID = Enum.Race.NightElf },
|
||||
{ Name = "Undead", FileString = "Scourge", ID = Enum.Race.Scourge },
|
||||
{ Name = "Tauren", FileString = "Tauren", ID = Enum.Race.Tauren },
|
||||
{ Name = "Gnome", FileString = "Gnome", ID = Enum.Race.Gnome },
|
||||
{ Name = "Troll", FileString = "Troll", ID = Enum.Race.Troll },
|
||||
{ Name = "Blood Elf", FileString = "BloodElf", ID = Enum.Race.BloodElf },
|
||||
{ Name = "Draenei", FileString = "Draenei", ID = Enum.Race.Draenei },
|
||||
}
|
||||
function DF:GetCharacterRaceList()
|
||||
if (next (DF.RaceCache)) then
|
||||
return DF.RaceCache
|
||||
end
|
||||
|
||||
for i = 1, 100 do
|
||||
local raceInfo = C_CreatureInfo.GetRaceInfo(i)
|
||||
if (raceInfo and DF.RaceList [raceInfo.raceID]) then
|
||||
table.insert(DF.RaceCache, {Name = raceInfo.raceName, FileString = raceInfo.clientFileString, ID = raceInfo.raceID})
|
||||
end
|
||||
end
|
||||
|
||||
return DF.RaceCache
|
||||
end
|
||||
|
||||
@@ -4461,71 +4329,13 @@ end
|
||||
--if onlySelectedHash return a hash table with [spelID] = true
|
||||
function DF:GetCharacterTalents(bOnlySelected, bOnlySelectedHash)
|
||||
local talentList = {}
|
||||
local version, build, date, tocversion = GetBuildInfo()
|
||||
|
||||
if (tocversion >= 70000 and tocversion <= 99999) then
|
||||
for i = 1, 7 do
|
||||
for o = 1, 3 do
|
||||
local talentID, name, texture, selected, available = GetTalentInfo(i, o, 1)
|
||||
if (bOnlySelectedHash) then
|
||||
if (selected) then
|
||||
talentList[talentID] = true
|
||||
break
|
||||
end
|
||||
elseif (bOnlySelected) then
|
||||
if (selected) then
|
||||
table.insert(talentList, {Name = name, ID = talentID, Texture = texture, IsSelected = selected})
|
||||
break
|
||||
end
|
||||
else
|
||||
table.insert(talentList, {Name = name, ID = talentID, Texture = texture, IsSelected = selected})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
elseif (tocversion >= 100000) then
|
||||
if (not bOnlySelected) then
|
||||
return DF:GetAllTalents()
|
||||
end
|
||||
|
||||
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 activeEntry = traitNodeInfo.activeEntry
|
||||
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) then -- == borderTypes.SpendCircle
|
||||
local definitionId = traitEntryInfo.definitionID
|
||||
local traitDefinitionInfo = C_Traits.GetDefinitionInfo(definitionId)
|
||||
local spellId = traitDefinitionInfo.overriddenSpellID or traitDefinitionInfo.spellID
|
||||
local spellName, _, spellTexture = GetSpellInfo(spellId)
|
||||
local bIsSelected = (activeEntry and activeEntry.rank and activeEntry.rank > 0) or false
|
||||
if (spellName and bIsSelected) then
|
||||
local talentInfo = {Name = spellName, ID = spellId, Texture = spellTexture, IsSelected = true}
|
||||
if (bOnlySelectedHash) then
|
||||
talentList[spellId] = talentInfo
|
||||
else
|
||||
table.insert(talentList, talentInfo)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
for _, entry in ipairs(C_CharacterAdvancement.GetKnownTalentEntries()) do
|
||||
local talentInfo = {Name = entry.name, ID = entry.ID, Texture = entry.icon, IsSelected = true}
|
||||
if bOnlySelectedHash then
|
||||
talentList[entry.ID] = talentInfo
|
||||
else
|
||||
table.insert(talentList, talentInfo)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4570,7 +4380,6 @@ DF.GroupTypes = {
|
||||
{Name = "Battleground", ID = "pvp"},
|
||||
{Name = "Raid", ID = "raid"},
|
||||
{Name = "Dungeon", ID = "party"},
|
||||
{Name = "Scenario", ID = "scenario"},
|
||||
{Name = "Open World", ID = "none"},
|
||||
}
|
||||
function DF:GetGroupTypes()
|
||||
|
||||
@@ -275,7 +275,7 @@ end
|
||||
if (spellIcon) then
|
||||
cooldownLine:SetIcon(spellIcon, .1, .9, .1, .9)
|
||||
|
||||
local classColor = C_ClassColor.GetClassColor(cooldownLine.class or "PRIEST")
|
||||
local classColor = Details.class_colors[cooldownLine.class or "PRIEST"]
|
||||
if (classColor) then
|
||||
cooldownLine:SetStatusBarColor(classColor.r, classColor.g, classColor.b)
|
||||
else
|
||||
@@ -360,7 +360,7 @@ end
|
||||
|
||||
if (Details.ocd_tracker.show_conditions.only_inside_instance) then
|
||||
local isInInstanceType = select(2, GetInstanceInfo())
|
||||
if (isInInstanceType ~= "party" and isInInstanceType ~= "raid" and isInInstanceType ~= "scenario" and isInInstanceType ~= "arena") then
|
||||
if (isInInstanceType ~= "party" and isInInstanceType ~= "raid" and isInInstanceType ~= "arena") then
|
||||
cooldownFrame:Hide()
|
||||
return
|
||||
end
|
||||
|
||||
+3
-5
@@ -1329,7 +1329,7 @@ function SlashCmdList.DETAILS (msg, editbox)
|
||||
Details:InstanceCallDetailsFunc(Details.ResetaGump)
|
||||
Details:RefreshMainWindow(-1, true)
|
||||
|
||||
elseif (msg == "ej") then
|
||||
elseif (msg == "ej" and false) then
|
||||
|
||||
local result = {}
|
||||
local spellIDs = {}
|
||||
@@ -1982,7 +1982,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
C_Timer.After(30, function()
|
||||
f:UnregisterEvent("GUILD_ROSTER_UPDATE")
|
||||
end)
|
||||
C_GuildInfo.GuildRoster()
|
||||
GuildRoster()
|
||||
|
||||
openRaidLib.RequestKeystoneDataFromGuild()
|
||||
end
|
||||
@@ -2380,9 +2380,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
local guildName = GetGuildInfo("player")
|
||||
if (guildName) then
|
||||
--call an update on the guild roster
|
||||
if (C_GuildInfo and C_GuildInfo.GuildRoster) then
|
||||
C_GuildInfo.GuildRoster()
|
||||
end
|
||||
GuildRoster()
|
||||
DetailsKeystoneInfoFrame.RequestFromGuildButton:Enable()
|
||||
else
|
||||
DetailsKeystoneInfoFrame.RequestFromGuildButton:Disable()
|
||||
|
||||
@@ -801,107 +801,58 @@ local CreatePluginFrames = function()
|
||||
end
|
||||
end
|
||||
|
||||
local checkBuffs_Shadowlands = function(unitId, consumableTable)
|
||||
local checkBuffs = function(unitId, consumableTable)
|
||||
local unitSerial = UnitGUID(unitId)
|
||||
|
||||
for buffIndex = 1, 40 do
|
||||
local bname, texture, count, debuffType, duration, expirationTime, caster, canStealOrPurge, nameplateShowPersonal, spellId = UnitBuff(unitId, buffIndex)
|
||||
local function handleAuraBuff(auraInfo)
|
||||
if (auraInfo) then
|
||||
local buffName = auraInfo.name
|
||||
local spellId = auraInfo.spellId
|
||||
|
||||
if (bname) then
|
||||
if (flaskList[spellId]) then
|
||||
DetailsRaidCheck.unitsWithFlaskTable[unitSerial] = {spellId, 1, texture}
|
||||
consumableTable.Flask = consumableTable.Flask + 1
|
||||
end
|
||||
|
||||
if (DetailsRaidCheck.db.food_tier1) then
|
||||
if (foodList.tier1[spellId]) then
|
||||
DetailsRaidCheck.unitWithFoodTable[unitSerial] = {spellId, 1, texture}
|
||||
consumableTable.Food = consumableTable.Food + 1
|
||||
if (buffName) then
|
||||
local flashInfo = flaskList[spellId]
|
||||
if (flashInfo) then
|
||||
local flaskTier = openRaidLib.GetFlaskTierFromAura(auraInfo)
|
||||
DetailsRaidCheck.unitsWithFlaskTable[unitSerial] = {spellId, flaskTier, auraInfo.icon}
|
||||
consumableTable.Flask = consumableTable.Flask + 1
|
||||
end
|
||||
end
|
||||
|
||||
if (DetailsRaidCheck.db.food_tier2) then
|
||||
if (foodList.tier2[spellId]) then
|
||||
DetailsRaidCheck.unitWithFoodTable[unitSerial] = {spellId, 2, texture}
|
||||
consumableTable.Food = consumableTable.Food + 1
|
||||
end
|
||||
end
|
||||
local foodInfo = foodInfoList[spellId]
|
||||
|
||||
if (DetailsRaidCheck.db.food_tier3) then
|
||||
if (foodList.tier3[spellId]) then
|
||||
DetailsRaidCheck.unitWithFoodTable[unitSerial] = {spellId, 3, texture}
|
||||
consumableTable.Food = consumableTable.Food + 1
|
||||
end
|
||||
end
|
||||
|
||||
if (runeIds[spellId]) then
|
||||
DetailsRaidCheck.havefocusaug_table[unitSerial] = spellId
|
||||
end
|
||||
|
||||
if (bname == localizedFoodDrink) then
|
||||
DetailsRaidCheck.iseating_table[unitSerial] = true
|
||||
end
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local checkBuffs_Dragonflight = function(unitId, consumableTable)
|
||||
local unitSerial = UnitGUID(unitId)
|
||||
|
||||
local function handleAuraBuff(aura)
|
||||
if (aura) then
|
||||
local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID(unitId, aura.auraInstanceID)
|
||||
if (auraInfo) then
|
||||
local buffName = auraInfo.name
|
||||
local spellId = auraInfo.spellId
|
||||
|
||||
if (buffName) then
|
||||
local flashInfo = flaskList[spellId]
|
||||
if (flashInfo) then
|
||||
local flaskTier = openRaidLib.GetFlaskTierFromAura(auraInfo)
|
||||
DetailsRaidCheck.unitsWithFlaskTable[unitSerial] = {spellId, flaskTier, auraInfo.icon}
|
||||
consumableTable.Flask = consumableTable.Flask + 1
|
||||
if (DetailsRaidCheck.db.food_tier1) then
|
||||
if (foodInfo) then
|
||||
local foodTier = openRaidLib.GetFoodTierFromAura(auraInfo)
|
||||
DetailsRaidCheck.unitWithFoodTable[unitSerial] = {spellId, foodTier or 1, auraInfo.icon}
|
||||
consumableTable.Food = consumableTable.Food + 1
|
||||
end
|
||||
end
|
||||
|
||||
local foodInfo = foodInfoList[spellId]
|
||||
|
||||
if (DetailsRaidCheck.db.food_tier1) then
|
||||
if (foodInfo) then
|
||||
local foodTier = openRaidLib.GetFoodTierFromAura(auraInfo)
|
||||
DetailsRaidCheck.unitWithFoodTable[unitSerial] = {spellId, foodTier or 1, auraInfo.icon}
|
||||
if (DetailsRaidCheck.db.food_tier2) then
|
||||
if (foodInfo) then
|
||||
local foodTier = openRaidLib.GetFoodTierFromAura(auraInfo)
|
||||
if (foodTier and foodTier >= 2) then
|
||||
DetailsRaidCheck.unitWithFoodTable[unitSerial] = {spellId, foodTier, auraInfo.icon}
|
||||
consumableTable.Food = consumableTable.Food + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (DetailsRaidCheck.db.food_tier2) then
|
||||
if (foodInfo) then
|
||||
local foodTier = openRaidLib.GetFoodTierFromAura(auraInfo)
|
||||
if (foodTier and foodTier >= 2) then
|
||||
DetailsRaidCheck.unitWithFoodTable[unitSerial] = {spellId, foodTier, auraInfo.icon}
|
||||
consumableTable.Food = consumableTable.Food + 1
|
||||
end
|
||||
if (DetailsRaidCheck.db.food_tier3) then
|
||||
if (foodInfo) then
|
||||
local foodTier = openRaidLib.GetFoodTierFromAura(auraInfo)
|
||||
if (foodTier and foodTier >= 3) then
|
||||
DetailsRaidCheck.unitWithFoodTable[unitSerial] = {spellId, foodTier, auraInfo.icon}
|
||||
consumableTable.Food = consumableTable.Food + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (DetailsRaidCheck.db.food_tier3) then
|
||||
if (foodInfo) then
|
||||
local foodTier = openRaidLib.GetFoodTierFromAura(auraInfo)
|
||||
if (foodTier and foodTier >= 3) then
|
||||
DetailsRaidCheck.unitWithFoodTable[unitSerial] = {spellId, foodTier, auraInfo.icon}
|
||||
consumableTable.Food = consumableTable.Food + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
if (runeIds[spellId]) then
|
||||
DetailsRaidCheck.havefocusaug_table[unitSerial] = spellId
|
||||
end
|
||||
|
||||
if (runeIds[spellId]) then
|
||||
DetailsRaidCheck.havefocusaug_table[unitSerial] = spellId
|
||||
end
|
||||
|
||||
if (buffName == localizedFoodDrink) then
|
||||
DetailsRaidCheck.iseating_table[unitSerial] = true
|
||||
end
|
||||
if (buffName == localizedFoodDrink) then
|
||||
DetailsRaidCheck.iseating_table[unitSerial] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -913,12 +864,7 @@ local CreatePluginFrames = function()
|
||||
end
|
||||
|
||||
function DetailsRaidCheck:CheckUnitBuffs(unitId, consumableTable)
|
||||
if (DF.IsShadowlandsWow() or DF.IsWotLKWow()) then
|
||||
checkBuffs_Shadowlands(unitId, consumableTable)
|
||||
|
||||
elseif (DF.IsDragonflight()) then
|
||||
checkBuffs_Dragonflight(unitId, consumableTable)
|
||||
end
|
||||
checkBuffs(unitId, consumableTable)
|
||||
end
|
||||
|
||||
function DetailsRaidCheck:BuffTrackTick()
|
||||
|
||||
+1
-1
@@ -481,7 +481,7 @@ function Details:StartMeUp()
|
||||
if (not trinketData[spellId]) then
|
||||
---@type trinketdata
|
||||
local thisTrinketData = {
|
||||
itemName = C_Item.GetItemNameByID(trinketTable.itemId),
|
||||
itemName = GetItemName(trinketTable.itemId),
|
||||
spellName = GetSpellInfo(spellId) or "spell not found",
|
||||
lastActivation = 0,
|
||||
lastPlayerName = "",
|
||||
|
||||
Reference in New Issue
Block a user