Skip to content

Commit

Permalink
Added undocumented GetItemAttuneForge function
Browse files Browse the repository at this point in the history
  • Loading branch information
imevul committed Jun 29, 2024
1 parent fe6599d commit 0c13274
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"GetItemLinkAttuneProgress",
"GetItemAffixMask",
"ItemAttuneAffix",
"HasAttunedAnyVariantOfItem"
"HasAttunedAnyVariantOfItem",
"GetItemAttuneForge"
]
}
4 changes: 4 additions & 0 deletions SynastriaAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ Returns the name of a stat, given a statId
Returns the attunment progress for an itemId (optional affixId, optional titanforged)
1 = Titanforged, 2 = Warforged, 3 = Lightforged

### GetItemAttuneForge(itemid) -> int
Returns the attuned forge level for an itemid
1 = Titanforged, 2 = Warforged, 3 = Lightforged

### GetAttuneAffixName(itemId, affixId) -> string
Returns the affix name

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local MODULE_NAME, MODULE_VERSION = 'Attunement', 3
local MODULE_NAME, MODULE_VERSION = 'Attunement', 4
local SynastriaCoreLib = LibStub and LibStub('SynastriaCoreLib-1.0', true)
if not SynastriaCoreLib or SynastriaCoreLib:_GetModuleVersion(MODULE_NAME) >= MODULE_VERSION then return end

Expand Down Expand Up @@ -51,6 +51,12 @@ function SynastriaCoreLib.GetAttuneProgress(itemIdOrLink, suffixId, forgedType)
return GetItemAttuneProgress(itemId, suffixId, forgedType) or 0
end

function SynastriaCoreLib.GetItemAttuneForge(itemIdOrLink)
if (type(itemIdOrLink) ~= 'number' and type(itemIdOrLink) ~= 'string') or not SynastriaCoreLib.isLoaded() then return -1 end
local itemId, _ = SynastriaCoreLib.parseItemIdAndLink(itemIdOrLink)
return GetItemAttuneForge(itemId) or -1
end

function SynastriaCoreLib.IsAttuned(itemIdOrLink)
if (type(itemIdOrLink) ~= 'number' and type(itemIdOrLink) ~= 'string') or not SynastriaCoreLib.isLoaded() then return false end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SYNASTRIACORELIB_MAJOR, SYNASTRIACORELIB_MINOR = 'SynastriaCoreLib-1.0', 11
local SYNASTRIACORELIB_MAJOR, SYNASTRIACORELIB_MINOR = 'SynastriaCoreLib-1.0', 12
local SynastriaCoreLib, oldminor = LibStub:NewLibrary(SYNASTRIACORELIB_MAJOR, SYNASTRIACORELIB_MINOR)

if not SynastriaCoreLib then return end -- No upgrade needed
Expand Down
2 changes: 1 addition & 1 deletion src/SynastriaCoreLib/SynastriaCoreLib.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: SynastriaCoreLib-1.0
## Notes: A library of functions from Synastria
## Author: Imevul, meh321
## Version: 1.0.11-Release
## Version: 1.0.12-Release
## X-Category: Imevul

#@no-lib-strip@
Expand Down

0 comments on commit 0c13274

Please sign in to comment.