Compare commits

...

8 Commits

Author SHA1 Message Date
8d7646c83a Update TOC 2025-04-26 16:41:39 -05:00
4265d57599 Update TOCs 2025-04-02 07:25:05 -05:00
e970a958ac Update TOCs 2025-02-23 14:03:31 -06:00
bde510f09c Update TOCs 2024-12-20 22:18:37 -06:00
0c66028b9d Update TOCs 2024-11-13 08:56:33 -06:00
7a2e432488 fix: https://github.com/ascott18/TellMeWhen/issues/2088 UnitName can rarely return nil on a valid unit 2024-09-07 20:37:43 -07:00
fc9ba7ac27 Fix reported TooltipScanning error from reputation (#16)
I'm not sure why an index that's within range of GetNumFactions would
return nil data from GetFactionDataByIndex, so we probably need to
figure out what's up with that. Maybe the value returned by
GetNumFactions is only a valid input in some other GetFactionDataBy
variant?

Ref:
* https://www.wowace.com/projects/ice-hud/issues/366
* https://www.curseforge.com/projects/5394?comment=7333
2024-08-25 22:44:14 -05:00
7cf02c9037 Add UnitAura function shim
Fixes error with Aura-based tags such as NumAura, RaidStacks, Druid forms, and any tag checking for the existence of specific buffs/debuffs.

Fixes #15
2024-08-14 17:38:43 -05:00
4 changed files with 42 additions and 17 deletions

View File

@ -8,6 +8,17 @@ end
local select, pairs, rawget, GetTime, setmetatable = select, pairs, rawget, GetTime, setmetatable
local UnitAura, UnitIsFriend, UnitClass, UnitPowerType =
UnitAura, UnitIsFriend, UnitClass, UnitPowerType
if not UnitAura and C_UnitAuras and C_UnitAuras.GetAuraDataByIndex then
UnitAura = function(unitToken, index, filter)
local auraData = C_UnitAuras.GetAuraDataByIndex(unitToken, index, filter)
if not auraData then
return nil
end
return AuraUtil.UnpackAuraData(auraData)
end
end
-- GetSpellInfo removed in WoW 11.0
local GetSpellName = C_Spell and C_Spell.GetSpellName or GetSpellInfo

View File

@ -103,7 +103,7 @@ DogTag:AddTag("Unit", "SimpleName", {
arg = {
'unit', 'string;undef', 'player'
},
ret = "string",
ret = "string;nil",
events = "UNIT_NAME_UPDATE#$unit",
doc = L["Return the name of unit"],
example = ('[SimpleName] => %q'):format(UnitName("player")),

View File

@ -28,20 +28,22 @@ if C_Reputation and C_Reputation.GetNumFactions then
local function iter()
for i = 1, GetNumFactions() do
local data = GetFactionDataByIndex(i)
if data.isHeader == 1 then
if data.isCollapsed == 1 then
local NumFactions = GetNumFactions()
ExpandFactionHeader(i)
currentOpenHeader = i
NumFactions = GetNumFactions() - NumFactions
for j = i+1, i+NumFactions do
yield(GetFactionInfo(j))
if data then
if data.isHeader == 1 then
if data.isCollapsed == 1 then
local NumFactions = GetNumFactions()
ExpandFactionHeader(i)
currentOpenHeader = i
NumFactions = GetNumFactions() - NumFactions
for j = i+1, i+NumFactions do
yield(GetFactionInfo(j))
end
CollapseFactionHeader(i)
currentOpenHeader = nil
end
CollapseFactionHeader(i)
currentOpenHeader = nil
else
yield(data.name, data.description, data.reaction, data.currentReactionThreshold, data.nextReactionThreshold, data.currentStanding)
end
else
yield(data.name, data.description, data.reaction, data.currentReactionThreshold, data.nextReactionThreshold, data.currentStanding)
end
end
end

View File

@ -1,9 +1,9 @@
## Interface: 110002
## Interface-Retail: 110002
## Interface-Classic: 11503
## Interface: 110105
## Interface-Retail: 110105
## Interface-Classic: 11507
## Interface-BCC: 20504
## Interface-Wrath: 30403
## Interface-Cata: 40400
## Interface-Cata: 40402
## LoadOnDemand: 1
## Title: Lib: DogTag-Unit-3.0
## Notes: A library to provide unit-oriented tags to LibDogTag-3.0
@ -15,5 +15,17 @@
## X-Curse-Project-ID: 14282
## Dependencies: LibDogTag-3.0
## OptionalDeps: LibDruidMana-1.0, RangeCheck-1.0, LibTalentQuery-1.0
## Category-enUS: Libraries
## Category-deDE: Bibliotheken
## Category-esES: Bibliotecas
## Category-esMX: Bibliotecas
## Category-frFR: Bibliothèques
## Category-itIT:
## Category-koKR:
## Category-ptBR: Bibliotecas
## Category-ruRU: Библиотеки
## Category-zhCN: 函数库
## Category-zhTW: 函式庫
## Group: LibDogTag
lib.xml