Compare commits

...

22 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
712fef34ae Update TOC 2024-08-14 10:17:15 -05:00
4c4262904d Update TOC for Classic-era 2024-07-25 22:39:07 -05:00
380bd0f06a Update TOC 2024-07-24 09:26:33 -05:00
e03b5c50cc Update to current versions of actions 2024-07-21 13:48:33 -05:00
aa2817b5db Fix TooltipUtil.SurfaceArgs going away back in 10.1.0
It was a no-op then, it's removed in TWW beta.
2024-07-21 12:43:16 -05:00
0217b0ba80 fix: GetSpellInfo removed in TWW 2024-06-22 09:33:08 -07:00
2641d29079 Basic TWW support. Don't crash on login. 2024-06-18 23:07:05 -07:00
b2442ff568 Update TOC 2024-05-09 00:02:47 -05:00
1c161b436d Support Cataclysm Classic 2024-04-30 23:21:10 -05:00
9a939cca8b Name tooltip frame
Fixes #14
2024-04-27 08:26:37 -05:00
7f9d5db1e5 Update TOCs 2024-04-15 17:03:26 -05:00
32583d92e0 Update LibRangeCheck supported version
The 2.0 version seems to be causing taint somewhere.

ref: https://www.wowace.com/projects/ice-hud/issues/353
2024-04-04 08:12:01 -05:00
05afef899d Update TOC 2024-01-16 17:23:11 -06:00
1ebf467ef4 Update classic-era TOC 2023-12-10 18:54:10 -06:00
8 changed files with 125 additions and 43 deletions

View File

@ -31,25 +31,31 @@ jobs:
# we first have to clone the AddOn project, this is a required step
- name: Clone project
uses: actions/checkout@v1
uses: actions/checkout@v4
# once cloned, we just run the GitHub Action for the packager project
- name: Package and release
uses: BigWigsMods/packager@master
uses: BigWigsMods/packager@v2
# another example where we supply additional arguments, this example is specifically to release
# for the Classic version of the game
- name: Package and release for Classic
uses: BigWigsMods/packager@master
uses: BigWigsMods/packager@v2
with:
args: -g classic -w 0
- name: Package and release for TBC
uses: BigWigsMods/packager@master
uses: BigWigsMods/packager@v2
with:
args: -g bcc -w 0
- name: Package and release for TBC
uses: BigWigsMods/packager@master
- name: Package and release for Wrath
uses: BigWigsMods/packager@v2
with:
args: -g wrath -w 0
- name: Package and release for Cataclysm
uses: BigWigsMods/packager@v2
with:
args: -g cata -w 0

View File

@ -6,8 +6,22 @@ if MINOR_VERSION > _G.DogTag_Unit_MINOR_VERSION then
end
local select, pairs, rawget, GetTime, setmetatable = select, pairs, rawget, GetTime, setmetatable
local GetSpellInfo, UnitAura, UnitIsFriend, UnitClass, UnitPowerType =
GetSpellInfo, UnitAura, UnitIsFriend, UnitClass, UnitPowerType
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
DogTag_Unit_funcs[#DogTag_Unit_funcs+1] = function(DogTag_Unit, DogTag)
@ -300,12 +314,12 @@ DogTag:AddTag("Unit", "RaidStacks", {
category = L["Auras"]
})
local MOONKIN_FORM = GetSpellInfo(24858)
local AQUATIC_FORM = GetSpellInfo(1066)
local FLIGHT_FORM = GetSpellInfo(33943)
local SWIFT_FLIGHT_FORM = GetSpellInfo(40120)
local TRAVEL_FORM = GetSpellInfo(783)
local TREE_OF_LIFE = GetSpellInfo(33891)
local MOONKIN_FORM = GetSpellName(24858)
local AQUATIC_FORM = GetSpellName(1066)
local FLIGHT_FORM = GetSpellName(33943)
local SWIFT_FLIGHT_FORM = GetSpellName(40120)
local TRAVEL_FORM = GetSpellName(783)
local TREE_OF_LIFE = GetSpellName(33891)
local function DruidForm(unit)
local _, c = UnitClass(unit)
@ -403,7 +417,7 @@ DogTag:AddTag("Unit", "AuraDuration", {
category = L["Auras"],
})
local SHADOWFORM = GetSpellInfo(15473) or GetSpellInfo(232698)
local SHADOWFORM = GetSpellName(15473) or GetSpellName(232698)
if SHADOWFORM then
DogTag:AddTag("Unit", "IsShadowform", {
alias = ("HasAura(aura=%q, unit=unit)"):format(SHADOWFORM),
@ -416,13 +430,13 @@ DogTag:AddTag("Unit", "IsShadowform", {
})
end
local STEALTH = GetSpellInfo(1784)
local STEALTH = GetSpellName(1784)
local SHADOWMELD =
GetSpellInfo(58984) -- BFA
or GetSpellInfo(20580) -- Classic TBC
or GetSpellInfo(743) -- Classic Vanilla
GetSpellName(58984) -- BFA
or GetSpellName(20580) -- Classic TBC
or GetSpellName(743) -- Classic Vanilla
local PROWL = GetSpellInfo(5215)
local PROWL = GetSpellName(5215)
DogTag:AddTag("Unit", "IsStealthed", {
alias = ("HasAura(aura=%q, unit=unit) or HasAura(aura=%q, unit=unit) or HasAura(aura=%q, unit=unit)"):format(STEALTH, SHADOWMELD, PROWL),
arg = {
@ -433,7 +447,7 @@ DogTag:AddTag("Unit", "IsStealthed", {
category = L["Auras"]
})
local SHIELD_WALL = GetSpellInfo(871)
local SHIELD_WALL = GetSpellName(871)
DogTag:AddTag("Unit", "HasShieldWall", {
alias = ("HasAura(aura=%q, unit=unit)"):format(SHIELD_WALL),
arg = {
@ -444,7 +458,7 @@ DogTag:AddTag("Unit", "HasShieldWall", {
category = L["Auras"]
})
local LAST_STAND = GetSpellInfo(12975)
local LAST_STAND = GetSpellName(12975)
DogTag:AddTag("Unit", "HasLastStand", {
alias = ("HasAura(aura=%q, unit=unit)"):format(LAST_STAND),
arg = {
@ -455,7 +469,7 @@ DogTag:AddTag("Unit", "HasLastStand", {
category = L["Auras"]
})
local SOULSTONE_RESURRECTION = GetSpellInfo(20707)
local SOULSTONE_RESURRECTION = GetSpellName(20707)
DogTag:AddTag("Unit", "HasSoulstone", {
alias = ("HasAura(aura=%q, unit=unit)"):format(SOULSTONE_RESURRECTION),
arg = {
@ -466,7 +480,7 @@ DogTag:AddTag("Unit", "HasSoulstone", {
category = L["Auras"]
})
local MISDIRECTION = GetSpellInfo(34477)
local MISDIRECTION = GetSpellName(34477)
if MISDIRECTION then -- WoW Classic compat
DogTag:AddTag("Unit", "HasMisdirection", {
alias = ("HasAura(aura=%q, unit=unit)"):format(MISDIRECTION),
@ -479,7 +493,7 @@ if MISDIRECTION then -- WoW Classic compat
})
end
local ICE_BLOCK = GetSpellInfo(27619)
local ICE_BLOCK = GetSpellName(27619)
DogTag:AddTag("Unit", "HasIceBlock", {
alias = ("HasAura(aura=%q, unit=unit)"):format(ICE_BLOCK),
arg = {
@ -490,7 +504,7 @@ DogTag:AddTag("Unit", "HasIceBlock", {
category = L["Auras"]
})
local INVISIBILITY = GetSpellInfo(66)
local INVISIBILITY = GetSpellName(66)
DogTag:AddTag("Unit", "HasInvisibility", {
alias = ("HasAura(aura=%q, unit=unit)"):format(INVISIBILITY),
arg = {
@ -502,7 +516,7 @@ DogTag:AddTag("Unit", "HasInvisibility", {
})
-- Parnic: DI removed in Cataclysm
local DIVINE_INTERVENTION = GetSpellInfo(19752)
local DIVINE_INTERVENTION = GetSpellName(19752)
if DIVINE_INTERVENTION then
DogTag:AddTag("Unit", "HasDivineIntervention", {
alias = ("HasAura(aura=%q, unit=unit)"):format(DIVINE_INTERVENTION),

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")),
@ -167,13 +167,14 @@ DogTag:AddTag("Unit", "Level", {
category = L["Characteristics"]
})
local maxLevel = GetMaxPlayerLevel and GetMaxPlayerLevel() or _G.MAX_PLAYER_LEVEL
DogTag:AddTag("Unit", "IsMaxLevel", {
alias = ("Boolean(Level(unit=unit) >= %d)"):format(_G.MAX_PLAYER_LEVEL),
alias = ("Boolean(Level(unit=unit) >= %d)"):format(maxLevel),
arg = {
'unit', 'string;undef', 'player'
},
doc = L["Return True if the level of unit is %d"]:format(_G.MAX_PLAYER_LEVEL),
example = ('[IsMaxLevel] => %q'):format(UnitLevel("player") >= _G.MAX_PLAYER_LEVEL and L["True"] or ""),
doc = L["Return True if the level of unit is %d"]:format(maxLevel),
example = ('[IsMaxLevel] => %q'):format(UnitLevel("player") >= maxLevel and L["True"] or ""),
category = L["Characteristics"],
})

View File

@ -25,7 +25,7 @@ local function formatMinMax(min, max)
end
local found = false
DogTag:AddAddonFinder("Unit", "LibStub", "LibRangeCheck-2.0", function(RangeCheckLib)
DogTag:AddAddonFinder("Unit", "LibStub", "LibRangeCheck-3.0", function(RangeCheckLib)
found = true
function MinRange_func(unit)
return (RangeCheckLib:getRange(unit))

View File

@ -7,15 +7,61 @@ end
local _G, coroutine = _G, coroutine
local wrap, yield = coroutine.wrap, coroutine.yield
local GetWatchedFactionInfo, GetNumFactions, GetFactionInfo, ExpandFactionHeader, CollapseFactionHeader =
GetWatchedFactionInfo, GetNumFactions, GetFactionInfo, ExpandFactionHeader, CollapseFactionHeader
local GetWatchedFactionInfo = C_Reputation and C_Reputation.GetWatchedFactionData and function()
local data = C_Reputation.GetWatchedFactionData()
return data.name, data.reaction, data.currentReactionThreshold, data.nextReactionThreshold, data.currentStanding
end or _G.GetWatchedFactionInfo
DogTag_Unit_funcs[#DogTag_Unit_funcs+1] = function(DogTag_Unit, DogTag)
local L = DogTag_Unit.L
local IterateFactions, TerminateIterateFactions
do
if C_Reputation and C_Reputation.GetNumFactions then
local GetNumFactions = C_Reputation.GetNumFactions
local GetFactionDataByIndex = C_Reputation.GetFactionDataByIndex
local ExpandFactionHeader = C_Reputation.ExpandFactionHeader
local CollapseFactionHeader = C_Reputation.CollapseFactionHeader
local currentOpenHeader
local function iter()
for i = 1, GetNumFactions() do
local data = GetFactionDataByIndex(i)
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
else
yield(data.name, data.description, data.reaction, data.currentReactionThreshold, data.nextReactionThreshold, data.currentStanding)
end
end
end
end
function TerminateIterateFactions()
if currentOpenHeader then
CollapseFactionHeader(currentOpenHeader)
currentOpenHeader = nil
end
end
function IterateFactions()
currentOpenHeader = nil
return wrap(iter)
end
else
local GetNumFactions, GetFactionInfo, ExpandFactionHeader, CollapseFactionHeader =
GetNumFactions, GetFactionInfo, ExpandFactionHeader, CollapseFactionHeader
local currentOpenHeader
local function iter()
for i = 1, GetNumFactions() do

View File

@ -968,7 +968,7 @@ DogTag:AddTag("Unit", "HappyColor", {
end
-- Parnic: DI removed in Cataclysm
local DIVINE_INTERVENTION = GetSpellInfo(19752)
local DIVINE_INTERVENTION = (GetSpellInfo or C_Spell.GetSpellName)(19752)
if DIVINE_INTERVENTION then
DogTag:AddTag("Unit", "Status", {
alias = ("Offline(unit=unit) or (HasDivineIntervention(unit=unit) ? %q) or (IsFeignedDeath(unit=unit) ? %q) or [if Dead(unit=unit) then ((HasSoulstone(unit=unit) ? %q) or Dead(unit=unit))]"):format(DIVINE_INTERVENTION, L["Feigned Death"], L["Soulstoned"]),

View File

@ -19,7 +19,7 @@ local L = DogTag_Unit.L
local tt
if not C_TooltipInfo then
tt = CreateFrame("GameTooltip")
tt = CreateFrame("GameTooltip", "LibDogTag-Unit-3.0-"..MAJOR_VERSION.."."..MINOR_VERSION)
tt:SetOwner(UIParent, "ANCHOR_NONE")
tt.left = {}
tt.right = {}
@ -37,9 +37,11 @@ local lastUnit
local function updateTT(unit)
if C_TooltipInfo then
local tooltipData = C_TooltipInfo.GetUnit(unit)
TooltipUtil.SurfaceArgs(tooltipData)
for _, line in ipairs(tooltipData.lines) do
TooltipUtil.SurfaceArgs(line)
if TooltipUtil.SurfaceArgs then
TooltipUtil.SurfaceArgs(tooltipData)
for _, line in ipairs(tooltipData.lines) do
TooltipUtil.SurfaceArgs(line)
end
end
return tooltipData

View File

@ -1,8 +1,9 @@
## Interface: 100200
## Interface-Retail: 100200
## Interface-Classic: 11404
## Interface: 110105
## Interface-Retail: 110105
## Interface-Classic: 11507
## Interface-BCC: 20504
## Interface-Wrath: 30403
## Interface-Cata: 40402
## LoadOnDemand: 1
## Title: Lib: DogTag-Unit-3.0
## Notes: A library to provide unit-oriented tags to LibDogTag-3.0
@ -14,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