Skip to content

Commit

Permalink
MANY Blizz API call updates that were updated to retail versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Wutname1 committed Aug 16, 2024
1 parent 1d07bc6 commit b431a36
Show file tree
Hide file tree
Showing 20 changed files with 495 additions and 734 deletions.
169 changes: 18 additions & 151 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,30 +293,25 @@
"RegisterAsWidget",
"RAID",
"SlashCmdList",
"seterrorhandler",
"OnHyperlinkLeave",
"OnHyperlinkEnter",
"SUI_Art_Minimal_Base",
"IsInRaid",
"CUSTOM_CLASS_COLORS",
"OPEN_ALL_MAIL_BUTTON",
"OpenAllMailMixin",
"oUF",
"RegisterAttributeDriver",
"CreateFrame",
"UIParent",
"QuestFrame",
"GossipFrame",
"WOW_PROJECT_ID",
"WOW_PROJECT_MAINLINE",
"WOW_PROJECT_BURNING_CRUSADE_CLASSIC",
"WOW_PROJECT_CLASSIC",
"GetBuildInfo",
"_",
"AceGUIWidgetLSMlists",
"UnregisterUnitWatch",
"RegisterUnitWatch",
"InCombatLockdown",
"MultiCastActionBarFrame",
"MinimapCompassTexture",
"WOW_PROJECT_WRATH_CLASSIC",
Expand Down Expand Up @@ -367,160 +362,17 @@
"DebuffTypeColor",
"Settings",
"BossButtonHolder",
"GetScreenHeight",
"min",
"IsInInstance",
"IsInGroup",
"tinsert",
"hooksecurefunc",
"format",
"GetAddOnEnableState",
"strsub",
"strfind",
"strlen",
"floor",
"UnitName",
"GetItemInfo",
"strlower",
"strrep",
"UnitFactionGroup",
"SetCVar",
"GetCVar",
"IsAltKeyDown",
"gsub",
"GetAddOnInfo",
"UnitClass",
"strmatch",
"Mixin",
"UnitHealth",
"UnitHealthMax",
"UnitIsDeadOrGhost",
"UnitPower",
"UnitPowerMax",
"UnitLevel",
"UnitClassification",
"UnitIsPlayer",
"GetSpellInfo",
"UnitExists",
"GetTitleName",
"C_NamePlate",
"UnitIsAFK",
"UnitIsDND",
"GetSpecialization",
"GetCurrentTitle",
"GetSpecializationInfo",
"MoveViewRightStop",
"MoveViewRightStart",
"strsplit",
"IsAddOnLoaded",
"max",
"GetNumFactions",
"GetXPExhaustion",
"GetWatchedFactionInfo",
"UnitHonorLevel",
"UnitHonor",
"UnitHonorMax",
"C_AzeriteItem",
"GetFactionInfo",
"GetMaxPlayerLevel",
"UnitXP",
"UnitXPMax",
"C_GossipInfo",
"C_Reputation",
"Item",
"C_MajorFactions",
"C_Container",
"RepairAllItems",
"C_EquipmentSet",
"GetRepairAllCost",
"CanGuildBankRepair",
"CanMerchantRepair",
"SelectAvailableQuest",
"SelectActiveQuest",
"GetQuestReward",
"GetNumQuestChoices",
"GetDetailedItemLevelInfo",
"GetItemCount",
"GetNumActiveQuests",
"GetNumAvailableQuests",
"CompleteQuest",
"GetQuestItemLink",
"GetRewardText",
"GetQuestID",
"AcceptQuest",
"IsQuestCompletable",
"GetInventorySlotInfo",
"GetInventoryItemLink",
"GetActiveTitle",
"GetAvailableQuestInfo",
"GetTitleText",
"GetObjectiveText",
"C_CampaignInfo",
"Enum",
"C_Timer",
"Ambiguate",
"date",
"strtrim",
"GetNumGuildMembers",
"tremove",
"IsShiftKeyDown",
"GetGuildRosterInfo",
"UnitIsFriend",
"C_FriendList",
"LoggingCombat",
"GetInstanceInfo",
"GetItemQualityColor",
"GetItemInfoInstant",
"GetInventoryItemID",
"C_LFGList",
"C_ChallengeMode",
"CombatLogGetCurrentEventInfo",
"GetSpellLink",
"SendChatMessage",
"UnitGUID",
"SetCVarBitfield",
"mod",
"GetInboxHeaderInfo",
"TakeInboxMoney",
"TakeInboxItem",
"GetInboxInvoiceInfo",
"C_Map",
"C_SuperTrack",
"GetMouseFocus",
"C_CVar",
"Round",
"IsControlKeyDown",
"UnitNameplateShowsWidgetsOnly",
"UnitIsUnit",
"UnitReaction",
"C_TalkingHead",
"GetNumGroupMembers",
"GetGuildInfo",
"UnitRealmRelationship",
"UnitPVPName",
"UnitCreatureType",
"UnitRace",
"wipe",
"C_Item",
"C_PaperDollInfo",
"IsCorruptedItem",
"NotifyInspect",
"UnitBattlePetLevel",
"UnitIsWildBattlePet",
"UnitIsBattlePetCompanion",
"C_PetJournal",
"C_AzeriteEmpoweredItem",
"UnitHasVehicleUI",
"GetRealmName",
"IsSpellKnown",
"UnitIsEnemy",
"UnitPlayerControlled",
"UnitIsPVPFreeForAll",
"UnitIsPVP",
"C_PvP",
"C_MountJournal",
"UnitAura",
"GetTime",
"AddonCompartmentFrame",
"CopyTable",
"HideUIPanel",
Expand All @@ -529,7 +381,6 @@
"SecureButton_GetUnit",
"SecureButton_GetModifiedUnit",
"SecureHandlerSetFrameRef",
"IsLoggedIn",
"FramerateFrame",
"AchievementMicroButton",
"SplashFrameMixin",
Expand All @@ -548,7 +399,9 @@
"ComboFrame",
"TargetFrameToT",
"MAX_PARTY_MEMBERS",
"MAX_ARENA_ENEMIES"
"MAX_ARENA_ENEMIES",
"RAID_CLASS_COLORS",
"ShowUIPanel"
],
"Lua.workspace.ignoreDir": [".vscode", "libs/*"],
"Lua.diagnostics.enable": true,
Expand All @@ -562,5 +415,19 @@
},
"todo-tree.tree.showBadges": true,
"todo-tree.tree.showCountsInTree": true,
"todo-tree.tree.disableCompactFolders": false
"todo-tree.tree.disableCompactFolders": false,
"Lua.runtime.builtin": {
"basic": "disable",
"debug": "disable",
"io": "disable",
"math": "disable",
"os": "disable",
"package": "disable",
"string": "disable",
"table": "disable",
"utf8": "disable"
},
"Lua.workspace.library": [
"~\\.vscode\\extensions\\ketho.wow-api-0.17.4\\Annotations"
]
}
12 changes: 6 additions & 6 deletions Core/Framework.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ local type, pairs, unpack = type, pairs, unpack
local _G = _G
SUI.L = LibStub('AceLocale-3.0'):GetLocale('SpartanUI', true) ---@type SUIL
SUI.AutoOpenErrors = true
SUI.Version = GetAddOnMetadata('SpartanUI', 'Version') or 0
SUI.BuildNum = GetAddOnMetadata('SpartanUI', 'X-Build') or 0
SUI.Bartender4Version = (GetAddOnMetadata('Bartender4', 'Version') or 0)
SUI.Version = C_AddOns.GetAddOnMetadata('SpartanUI', 'Version') or 0
SUI.BuildNum = C_AddOns.GetAddOnMetadata('SpartanUI', 'X-Build') or 0
SUI.Bartender4Version = (C_AddOns.GetAddOnMetadata('Bartender4', 'Version') or 0)
SUI.IsDF = select(4, GetBuildInfo()) >= 100000 ---@type boolean
SUI.IsRetail = (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) ---@type boolean
SUI.IsClassic = (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) ---@type boolean
Expand Down Expand Up @@ -1278,7 +1278,7 @@ function SUI:OnInitialize()
end

local function Version()
SUI:Print(SUI.L['Version'] .. ' ' .. GetAddOnMetadata('SpartanUI', 'Version'))
SUI:Print(SUI.L['Version'] .. ' ' .. C_AddOns.GetAddOnMetadata('SpartanUI', 'Version'))
SUI:Print(string.format('%s build %s', wowVersion, SUI.BuildNum))
if SUI.Bartender4Version ~= 0 then SUI:Print(SUI.L['Bartender4 version'] .. ' ' .. SUI.Bartender4Version) end
end
Expand Down Expand Up @@ -1679,7 +1679,7 @@ end
--------------- Misc Backend ---------------

function SUI:IsAddonEnabled(addon)
return GetAddOnEnableState(UnitName('player'), addon) == 2
return C_AddOns.GetAddOnEnableState(UnitName('player'), addon) == 2
end

function SUI:IsAddonDisabled(addon)
Expand All @@ -1695,7 +1695,7 @@ function SUI:GetiLVL(itemLink)

local scanningTooltip = CreateFrame('GameTooltip', 'AutoTurnInTooltip', nil, 'GameTooltipTemplate')
local itemLevelPattern = ITEM_LEVEL:gsub('%%d', '(%%d+)')
local itemQuality = select(3, GetItemInfo(itemLink))
local itemQuality = select(3, C_Item.GetItemInfo(itemLink))

-- if a heirloom return a huge number so we dont replace it.
if itemQuality == 7 then return math.huge end
Expand Down
2 changes: 1 addition & 1 deletion Core/Handlers/BugWindow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ local createBugWindow = function()
-- Create window Items
window.editBox = StdUi:MultiLineBox(window, 480, 320, '')

window.SubTitle = StdUi:Label(window, 'Error handler ' .. (GetAddOnMetadata('SpartanUI', 'Version') or ''), 10, nil, nil, 15)
window.SubTitle = StdUi:Label(window, 'Error handler ' .. (C_AddOns.GetAddOnMetadata('SpartanUI', 'Version') or ''), 10, nil, nil, 15)
window.SubTitle:SetPoint('BOTTOM', window.Title, 'BOTTOMRIGHT', 0, -1)

window.sessionLabel = StdUi:Label(window, '', 10, nil, 180, 20)
Expand Down
2 changes: 1 addition & 1 deletion Core/Handlers/SetupWizard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ local function WelcomePage()
WelcomePage.Helm:SetPoint('CENTER', 0, 45)
WelcomePage.Helm:SetAlpha(0.6)

if not select(4, GetAddOnInfo('Bartender4')) then
if not select(4, C_AddOns.GetAddOnInfo('Bartender4')) then
module.window.BT4Warning = StdUi:Label(module.window, L['Bartender4 not detected! Please download and install Bartender4.'], 25, nil, module.window:GetWidth(), 40)
module.window.BT4Warning:SetTextColor(1, 0.18, 0.18, 1)
StdUi:GlueAbove(module.window.BT4Warning, module.window, 0, 20)
Expand Down
2 changes: 1 addition & 1 deletion Core/Skins/Ace3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ local function attemptSkin()

local AceGUI = LibStub('AceGUI-3.0', true)
if AceGUI and (AceGUI.RegisterAsContainer ~= RegisterAsContainer or AceGUI.RegisterAsWidget ~= RegisterAsWidget) then
if select(4, GetAddOnInfo('ElvUI')) then return end
if select(4, C_AddOns.GetAddOnInfo('ElvUI')) then return end
SkinAce3()
end
end
Expand Down
35 changes: 0 additions & 35 deletions Core/oUF.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,6 @@ local SUI = SUI
local unpack = unpack

-------------- oUF Functions ------------------------------------
function SUI:HotsListing()
local _, classFileName = UnitClass('player')
local LifebloomSpellId = select(7, GetSpellInfo('Lifebloom'))
if classFileName == 'DRUID' then
return {
774, -- Rejuvenation
LifebloomSpellId, -- Lifebloom
8936, -- Regrowth
-- 48438, -- Wild Growth
-- 155777, -- Germination
-- 102351, -- Cenarion Ward
-- 102342 -- Ironbark
}
elseif classFileName == 'PRIEST' then
if SUI.IsClassic then
return {
139, -- Renew
17, -- sheild
}
else
return {
139, -- Renew
17, -- sheild
33076, -- Prayer of Mending
}
end
elseif classFileName == 'MONK' then
return {
119611, -- Renewing Mist
227345, -- Enveloping Mist
}
end
return {}
end

local function getCurrentUnitHP(unitid)
local aCurrentHP = 0
local aMaxHP = 0
Expand Down
4 changes: 2 additions & 2 deletions Modules/Artwork/BlizzMovers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ local function TalkingHead()
TalkingHeadFrame:SetPoint('CENTER', THUIHolder, 'CENTER', 0, 0)
end)
end
if IsAddOnLoaded('Blizzard_TalkingHeadUI') then
if C_AddOns.IsAddOnLoaded('Blizzard_TalkingHeadUI') then
SetupTalkingHead()
else
--We want the mover to be available immediately, so we load it ourselves
Expand Down Expand Up @@ -207,7 +207,7 @@ local function WidgetPowerBarContainer()
hooksecurefunc(_G['UIWidgetPowerBarContainerFrame'], 'SetPoint', ResetPosition)
end

if not IsAddOnLoaded('SimplePowerBar') then
if not C_AddOns.IsAddOnLoaded('SimplePowerBar') then
AttachToHolder(_G['PlayerPowerBarAlt'], holder)
hooksecurefunc(_G['PlayerPowerBarAlt'], 'SetPoint', ResetPosition)
end
Expand Down
2 changes: 1 addition & 1 deletion Modules/AutoSell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.description = 'Auto sells junk and more'
----------------------------------------------------------------------------------------------------
local GetContainerNumSlots = (C_Container and C_Container.GetContainerNumSlots) or GetContainerNumSlots
local GetContainerItemInfo = (C_Container and C_Container.GetContainerItemInfo) or GetContainerItemInfo
local GetItemInfo = C_Item.GetItemInfo or GetItemInfo
local GetItemInfo = C_Item.GetItemInfo
local UseContainerItem = (C_Container and C_Container.UseContainerItem) or UseContainerItem

local frame = CreateFrame('Frame')
Expand Down
Loading

0 comments on commit b431a36

Please sign in to comment.