mirror of
https://github.com/parnic/LibDogTag-Unit-3.0.git
synced 2025-06-16 21:41:53 -05:00
Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
8d7646c83a | |||
4265d57599
|
|||
e970a958ac | |||
bde510f09c | |||
0c66028b9d | |||
7a2e432488 | |||
fc9ba7ac27 | |||
7cf02c9037 | |||
712fef34ae
|
|||
4c4262904d | |||
380bd0f06a
|
|||
e03b5c50cc | |||
aa2817b5db | |||
0217b0ba80 | |||
2641d29079 | |||
b2442ff568 | |||
1c161b436d | |||
9a939cca8b | |||
7f9d5db1e5 | |||
32583d92e0 | |||
05afef899d
|
|||
1ebf467ef4
|
18
.github/workflows/release.yml
vendored
18
.github/workflows/release.yml
vendored
@ -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
|
||||
|
@ -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),
|
||||
|
@ -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"],
|
||||
})
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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
|
||||
|
@ -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"]),
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user