Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: anzz1/TacoTip
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.2.9
Choose a base ref
...
head repository: anzz1/TacoTip
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 1,884 additions and 106 deletions.
  1. +159 −8 Libs/LibClassicInspector/API.txt
  2. +954 −73 Libs/LibClassicInspector/LibClassicInspector.lua
  3. +136 −2 Locale/deDE.lua
  4. +6 −1 Locale/enUS.lua
  5. +136 −2 Locale/esES.lua
  6. +137 −0 Locale/koKR.lua
  7. +136 −2 Locale/ruRU.lua
  8. +137 −3 Locale/zhCN.lua
  9. +20 −0 README.md
  10. +1 −1 TacoTip.toc
  11. +27 −0 main.lua
  12. +35 −14 options.lua
167 changes: 159 additions & 8 deletions Libs/LibClassicInspector/API.txt
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
-- LibClassicInspector by kebabstorm
-- for Classic/TBC/WOTLK
--
-- API Version 1 (2022-08-19)
-- API Version 9 (2022-12-11)
--
--------------------------------------------------------------------------

@@ -16,20 +16,28 @@
--------------------------------------------------------------------------
-- ClassicInspector.RegisterCallback(addOnName, "INVENTORY_READY", inventoryReadyCallback)
-- ClassicInspector.RegisterCallback(addOnName, "TALENTS_READY", talentsReadyCallback)
-- ClassicInspector.RegisterCallback(addOnName, "ACHIEVEMENTS_READY", achievementsReadyCallback)
-- ClassicInspector.RegisterCallback(addOnName, "GLYPHS_READY", glyphsReadyCallback)
--
-- Note
-- The callbacks are useful if you need to present data the instant it becomes available,
-- but in most cases these aren't needed and using the data request functions is enough.
--
-- Parameters
-- @string addOnName - your addon unique name
-- @string event - event name "INVENTORY_READY" or "TALENTS_READY"
-- @string event - event name (e.g. "INVENTORY_READY")
-- @function callbackFunc - your callback function
--
-- Returns
-- @string event - event name "INVENTORY_READY" or "TALENTS_READY"
-- @string event - event name
-- @string guid - player guid
-- @boolean isInspect - was the result of inspection
-- @string [unit] - unit token (optional, can return nil if not available)
--
local function inventoryReadyCallback(event, guid, isInspect, unit)
local function talentsReadyCallback(event, guid, isInspect, unit)
local function achievementsReadyCallback(event, guid, isInspect, unit)
local function glyphsReadyCallback(event, guid, isInspect, unit)

--------------------------------------------------------------------------
--
@@ -38,11 +46,12 @@ local function talentsReadyCallback(event, guid, isInspect, unit)
--------------------------------------------------------------------------

--------------------------------------------------------------------------
-- ClassicInspector:GetSpecializationName(class, tabIndex)
-- ClassicInspector:GetSpecializationName(class, tabIndex, localized)
--
-- Parameters
-- @string class - english class name in uppercase e.g. "WARRIOR"
-- @number tabIndex - talent tab index (1-3)
-- @boolean localized - return localized name instead of english name
--
-- Returns
-- @string specName - specialization name e.g. "Retribution"
@@ -107,6 +116,9 @@ function lib:GetActiveTalentGroup(unitorguid)
--------------------------------------------------------------------------
-- ClassicInspector:GetTalentInfo(unitorguid, tabIndex, talentIndex[, group])
--
-- Note
-- talentID is currently unimplemented and returns 0
--
-- Parameters
-- @string unitorguid - unit token or guid
-- @number tabIndex - talent tab index (1-3)
@@ -130,6 +142,9 @@ function lib:GetTalentInfo(unitorguid, tabIndex, talentIndex, _group)
--------------------------------------------------------------------------
-- ClassicInspector:GetTalentInfoByClass(class, tabIndex, talentIndex)
--
-- Note
-- talentID is currently unimplemented and returns 0
--
-- Parameters
-- @string class - english class name in uppercase e.g. "WARRIOR"
-- @number tabIndex - talent tab index (1-3)
@@ -198,7 +213,7 @@ function lib:GetInventoryItemMixin(unitorguid, slot)
-- @table inventoryTable - inventory item id table (1-19)
--
function lib:GetInventoryItemIDTable(unitorguid)
return inventoryTable
return inventoryTable

--------------------------------------------------------------------------
-- ClassicInspector:GetTalentRanksTable(unitorguid)
@@ -219,11 +234,13 @@ function lib:GetTalentRanksTable(unitorguid)
-- @string unitorguid - unit token or guid
--
-- Returns
-- @number talentsCacheTime - time when talents were last cached or 0 if not found
-- @number inventoryCacheTime - time when inventory was last cached or 0 if not found
-- @number talentsTime - time when talents were last cached or 0 if not found
-- @number inventoryTime - time when inventory was last cached or 0 if not found
-- @number achievementsTime - time when achievements were last cached or 0 if not found
-- @number glyphsTime - time when glyphs were last cached or 0 if not found
--
function lib:GetLastCacheTime(unitorguid)
return talentsCacheTime, inventoryCacheTime
return talentsTime, inventoryTime, achievementsTime, glyphsTime

--------------------------------------------------------------------------
-- ClassicInspector:PlayerGUIDToUnitToken(unit)
@@ -267,6 +284,10 @@ function lib:IsWotlk()
--------------------------------------------------------------------------
-- ClassicInspector:CanInspect(unitorguid)
--
-- Note
-- This function is provided for special cases and does not need to be used in normal operation.
-- Inspections are handled automatically by the library and do not need to be handled manually.
--
-- Parameters
-- @string unitorguid - unit token or guid of target to check
--
@@ -279,6 +300,10 @@ function lib:CanInspect(unitorguid)
--------------------------------------------------------------------------
-- ClassicInspector:DoInspect(unitorguid)
--
-- Note
-- This function is provided for special cases and does not need to be used in normal operation.
-- Inspections are handled automatically by the library and do not need to be handled manually.
--
-- Parameters
-- @string unitorguid - unit token or guid of inspection target
--
@@ -290,4 +315,130 @@ function lib:CanInspect(unitorguid)
--
function lib:DoInspect(unitorguid)
return status

--------------------------------------------------------------------------
-- ClassicInspector:Version()
--
-- Returns
-- @number version - library version
--
function lib:Version()
return version

--------------------------------------------------------------------------
-- [WOTLK]
-- ClassicInspector:GetTotalAchievementPoints(unitorguid)
--
-- Parameters
-- @string unitorguid - unit token or guid
--
-- Returns
-- @number total_points - total achievement points
--
function lib:GetTotalAchievementPoints(unitorguid)
return total_points

--------------------------------------------------------------------------
-- [WOTLK]
-- ClassicInspector:GetAchievementInfo(unitorguid, achievementID)
--
-- Parameters
-- @string unitorguid - unit token or guid
-- @number achievementID - achievement ID (type=achievement)
--
-- Returns
-- @boolean completed - is achievement completed
-- @number month - month of completion
-- @number day - day of completion
-- @number year - year of completion
--
function lib:GetAchievementInfo(unitorguid, achievementID)
return completed, month, day, year

--------------------------------------------------------------------------
-- [WOTLK]
-- ClassicInspector:GetStatistic(unitorguid, achievementID)
--
-- Parameters
-- @string unitorguid - unit token or guid
-- @number achievementID - achievement ID (type=statistic)
--
-- Returns
-- @string value - value of the statistic as displayed in-game
--
function lib:GetStatistic(unitorguid, achievementID)
return value

--------------------------------------------------------------------------
-- [WOTLK]
-- ClassicInspector:AddTrackedAchievement(achievementID)
--
-- Note
-- It is not required to use this, as using the GetAchievementInfo/GetStatistic functions
-- will automatically add the requested achievement to the tracking list.
--
-- Parameters
-- @number achievementID - achievement ID (type=achievement/statistic)
--
-- Returns
-- @boolean success - achievementID is valid and added to tracking list
-- @boolean isStatistic - is achievement type a statistic
--
function lib:AddTrackedAchievement(achievementID)
return success, isStatistic

--------------------------------------------------------------------------
-- [WOTLK]
-- ClassicInspector:GetGlyphSocketInfo(unitorguid, socketID[, group])
--
-- Note
-- iconFile is currently implemented only for the local player and returns 0 when requesting
-- info for other players
--
-- Parameters
-- @string unitorguid - unit token or guid
-- @number socketID - socket index to query, ranging from 1 to 6 (NUM_GLYPH_SLOTS)
-- @number [group] - talent group or the current active talent group if nil
--
-- Returns
-- @boolean enabled - true if the socket has a glyph inserted
-- @number glyphType - type of glyph accepted by this socket (GLYPHTYPE_MAJOR=1 or GLYPHTYPE_MINOR=2)
-- @number glyphSpellID - spell ID of the socketed glyph
-- @number iconFile - file ID of the sigil icon associated with the socketed glyph
--
function lib:GetGlyphSocketInfo(unitorguid, socketID, _group)
return enabled, glyphType, glyphSpellID, iconFile

--------------------------------------------------------------------------
-- [WOTLK]
-- ClassicInspector:HasGlyph(unitorguid, glyphSpellID[, group])
--
-- Parameters
-- @string unitorguid - unit token or guid
-- @number glyphSpellID - spell ID of the socketed glyph
-- @number [group] - talent group or the current active talent group if nil
--
-- Returns
-- @boolean enabled - true if the player has socketed glyph with matching ID
--
function lib:HasGlyph(unitorguid, glyphSpellID, _group)
return enabled

--------------------------------------------------------------------------
-- [WOTLK]
-- ClassicInspector:GetGlyphs(unitorguid[, group])
--
-- Parameters
-- @string unitorguid - unit token or guid
-- @number [group] - talent group or the current active talent group if nil
--
-- Returns
-- @number glyphSpellID1 - spell ID of glyph in socket 1 (MAJOR)
-- @number glyphSpellID2 - spell ID of glyph in socket 2 (MINOR)
-- @number glyphSpellID3 - spell ID of glyph in socket 3 (MINOR)
-- @number glyphSpellID4 - spell ID of glyph in socket 4 (MAJOR)
-- @number glyphSpellID5 - spell ID of glyph in socket 5 (MINOR)
-- @number glyphSpellID6 - spell ID of glyph in socket 6 (MAJOR)
--
function lib:GetGlyphs(unitorguid, _group)
return glyphSpellID1, glyphSpellID2, glyphSpellID3, glyphSpellID4, glyphSpellID5, glyphSpellID6
Loading