Quantcast
Shadowlands API changes? - WoWInterface
Thread Tools Display Modes
04-14-20, 02:12 PM   #1
Voxxel
A Chromatic Dragonspawn
Join Date: Mar 2009
Posts: 180
Shadowlands API changes?

Hi there,

Are the Shadowlands API changes announced for now?
  Reply With Quote
04-14-20, 02:42 PM   #2
Kanegasi
A Firelord
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 499
Server-side changes have not been announced yet, nor has any organized patch notes concerning API.

However, you're welcome to browse this github diff between live servers and a UI extract from the beta: https://github.com/Gethe/wow-ui-sour...a?diff=unified
  Reply With Quote
04-15-20, 07:12 AM   #3
Voxxel
A Chromatic Dragonspawn
Join Date: Mar 2009
Posts: 180
Thank you very much!
  Reply With Quote
08-16-20, 04:42 PM   #4
Drudatz
A Fallenroot Satyr
Join Date: Aug 2009
Posts: 20
frame:SetBackdrop("something") doesnt work anymore and SL Beta tells me SetBackdrop is nil.
Anyone knows what replaces SetBackdrop?

EDITH: nvm found it: https://us.forums.blizzard.com/en/wo...beta/586355/17

"Instead of always creating backdrops on every frame, they require each frame to explicitly inherit backdrops. There is no change in functionality, only the default setting has been changed in an effort to improve performance."

Last edited by Drudatz : 08-16-20 at 04:47 PM.
  Reply With Quote
08-16-20, 06:47 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,757
Try this thread: https://www.wowinterface.com/forums/...ad.php?t=58109
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-17-20, 12:57 PM   #6
Drudatz
A Fallenroot Satyr
Join Date: Aug 2009
Posts: 20
Anyone knows with what GetCurrencyListSize() was replaced cause it aint working on Beta anymore?
  Reply With Quote
08-17-20, 01:02 PM   #7
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,276
Code:
local numTokenTypes = C_CurrencyInfo.GetCurrencyListSize();
A good place to start looking.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
08-17-20, 01:18 PM   #8
Drudatz
A Fallenroot Satyr
Join Date: Aug 2009
Posts: 20
Originally Posted by Fizzlemizz View Post
[code]A good place to start looking.
thank you! I was looking for something like that but didnt find it :-(
  Reply With Quote
08-23-20, 11:38 PM   #9
arith
A Cyclonian
 
arith's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 45
Several of currency related function calls have been replace with C_CurrencyInfo API calls.
So the return values also changed.

Check here for some more details.
  Reply With Quote
08-29-20, 01:46 AM   #10
Goldpaw
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 55
Not sure about the code in general, but I know that NAMEPLATE_FONT and NAMEPLATE_SPELLCAST_FONT doesn't accept file paths, they have to be the name of a font object instead. Like "GameFontWhite" or "GameFontNormalSmall".
  Reply With Quote
08-29-20, 11:43 AM   #11
Voxxel
A Chromatic Dragonspawn
Join Date: Mar 2009
Posts: 180
I've asked about the API changes because my good old lua code seems to have stopped working in 9.x. It's a simple code to print out quest IDs into chat if any quest is accepted or completed. (useful for tracking hidden quests)

Code:
    local RealQuestBlacklist = {} -- [questID] = true, Ignore any questIDs in the list
    local QUEST_TIMEOUT = 1
    local function ScrapeQTip(self)
        local tipName = self:GetName()
        local name, description = _G[tipName .. 'TextLeft1']:GetText(), _G[tipName ..'TextLeft3']:GetText()
        if name then
            print(format('Quest Completed: |cffffff00|Hquest:%d|h[%s]|h|r (%d) %s', self.questID, name, self.questID, description or ''))
        elseif self.questID ~= 0 then
            print('Quest Completed: |cffffff00' .. self.questID)
        end
        self:SetScript('OnTooltipSetQuest', nil) -- If it gets to this point we don't want this potentially firing again
        self.questID = nil
    end
     
    local QTips = {}
    local function GetQTip() -- Recycle old tooltip or create new one if none available
        local now = GetTime()
        for i, tip in ipairs(QTips) do
            if not tip.questID or now - tip.lastUpdate > QUEST_TIMEOUT then -- If it hasn't finished within this time frame then recycle it anyway
                tip.lastUpdate = now
                return tip
            end
        end
        local tip = CreateFrame('GameTooltip',  'SemlarsQTip' .. (#QTips + 1), WorldFrame, 'GameTooltipTemplate')
        tip:Show()
        tip:SetHyperlink('quest:0')
        tip.lastUpdate = now
        tinsert(QTips, tip)
        return tip
    end
     
    function FetchQuestInfo(questID)
        local tip = GetQTip()
        tip:SetOwner(WorldFrame, 'ANCHOR_NONE')
        tip.questID = questID or 0
        tip:SetScript('OnTooltipSetQuest', ScrapeQTip)
        tip:SetHyperlink('quest:' .. tip.questID)
    end
     
    local OldQuests, NewQuests = {}, {}
    local f = CreateFrame('frame')
    f:SetScript('OnEvent', function(self, event, ...) return self[event] and self[event](self, ...) end)
     
     
    function f:QUEST_COMPLETED(questID) -- Fake event that fires whenever we complete a quest
    		print('Quest Completed: |cffffff00' .. questID)
        FetchQuestInfo(questID)
    end
     
    -- QUEST_TURNED_IN first argument is quest ID
     
    --function f:QUEST_TURNED_IN(questID) -- Blacklist real quests we've completed
        --RealQuestBlacklist[questID] = true
    --end f:RegisterEvent('QUEST_TURNED_IN')
     
    local eventFired = false
    local throttleRate, timeSince = 0.1, 0
    local function OnUpdate(self, elapsed) -- Limit new quest checks to if CRITERIA_UPDATE has fired within the last x seconds (throttleRate)
        timeSince = timeSince + elapsed
        if timeSince >= throttleRate then
            if eventFired then
                GetQuestsCompleted(NewQuests)
                for questID in pairs(NewQuests) do
                    if not OldQuests[questID] then
                        OldQuests[questID] = true
                        if not RealQuestBlacklist[questID] then -- Ignore real questIDs
                            self:QUEST_COMPLETED(questID)
                        end
                    end
                end
                eventFired = false
            end
            timeSince = 0
        end
    end
     
    function f:PLAYER_REGEN_ENABLED() -- Exit combat
        --self:RegisterEvent('CRITERIA_UPDATE')
        throttleRate = 0.1 -- Out of combat throttle rate
    end f:RegisterEvent('PLAYER_REGEN_ENABLED')
     
    function f:PLAYER_REGEN_DISABLED() -- Enter combat
        --self:UnregisterEvent('CRITERIA_UPDATE')
        throttleRate = 3 -- In-combat throttle rate
    end f:RegisterEvent('PLAYER_REGEN_DISABLED')
     
    function f:CRITERIA_UPDATE()
        eventFired = true
    end -- Don't register this until after PLAYER_LOGIN
     
    function f:PLAYER_LOGIN()
        GetQuestsCompleted(OldQuests)
        local hasQuests = false
        for questID in pairs(OldQuests) do
            hasQuests = true
            break
        end
        if not hasQuests then print('Failed to load completed quests, api function is bugged |cffff00ff(RELOG)|r.') end
        self:RegisterEvent('CRITERIA_UPDATE')
        self:SetScript('OnUpdate', OnUpdate)
    end f:RegisterEvent('PLAYER_LOGIN')
    function f:QUEST_ACCEPTED(index, questID)
        print('QUEST_ACCEPTED', questID)
        -- FetchQuestInfo(questID) -- uncomment if you want it to do the same thing as completed quests
    end f:RegisterEvent('QUEST_ACCEPTED')

It's a part of an old, never released rare scanner addon, I just cut this part for myself so there may be some leftovers here and there (since I don't speak the lua language at all.) On retail this code prints out every accepted and completed quest but on Beta/PTR it says "QUEST_ACCEPTED nil" for the accepted quests and nothing for completed ones.

The error log is:
Code:
Message: Interface\AddOns\raredar\code.lua:94: attempt to call global 'GetQuestsCompleted' (a nil value)
Time: Sat Aug 29 19:23:28 2020
Count: 1
Stack: Interface\AddOns\raredar\code.lua:94: attempt to call global 'GetQuestsCompleted' (a nil value)
[string "@Interface\AddOns\raredar\code.lua"]:94: in function `?'
[string "@Interface\AddOns\raredar\code.lua"]:44: in function <Interface\AddOns\raredar\code.lua:44>

Locals: self = <unnamed> {
 0 = <userdata>
 QUEST_COMPLETED = <function> defined @Interface\AddOns\raredar\code.lua:47
 PLAYER_REGEN_ENABLED = <function> defined @Interface\AddOns\raredar\code.lua:79
 PLAYER_LOGIN = <function> defined @Interface\AddOns\raredar\code.lua:93
 CRITERIA_UPDATE = <function> defined @Interface\AddOns\raredar\code.lua:89
 PLAYER_REGEN_DISABLED = <function> defined @Interface\AddOns\raredar\code.lua:84
 QUEST_ACCEPTED = <function> defined @Interface\AddOns\raredar\code.lua:104
}
(*temporary) = nil
(*temporary) = <table> {
}
(*temporary) = "attempt to call global 'GetQuestsCompleted' (a nil value)"
OldQuests = <table> {
}
OnUpdate = <function> defined @Interface\AddOns\raredar\code.lua:60
I see they've removed the 'GetQuestsCompleted' command but could you please help me if this is replaced with something rather than just deleted?

Also, if no replacements, do you know any addon that does the same thing? Or do you have any idea how to change this code chunk to print IDs for accepted and completed quests in 9.x?

Thank you very much in advance.
  Reply With Quote
08-29-20, 02:05 PM   #12
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 788
GetAllCompletedQuestIDs exists in C_QuestLog namespace.

https://www.townlong-yak.com/framexm...umentation.lua
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
08-31-20, 09:37 AM   #13
Voxxel
A Chromatic Dragonspawn
Join Date: Mar 2009
Posts: 180
Thank you,

It works differently, so I see it's not enough just to replace the function's name in the code. Wowpedia says "it now returns quest IDs in a sequentially ordered table instead of associative." - but I don't know what does it mean. ^^

Do you have any idea how to change this chunk of code to make it work again?
  Reply With Quote
08-31-20, 10:03 AM   #14
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,276
Lua Code:
  1. local completed = C_QuestLog.GetAllCompletedQuestIDs()
  2. for i=1, #completed do
  3.       local id = completed[i]
  4.       -- do whatever with the id
  5. end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
09-03-20, 02:27 AM   #15
Voxxel
A Chromatic Dragonspawn
Join Date: Mar 2009
Posts: 180
Thank you!
  Reply With Quote

WoWInterface » PTR » PTR API and Graphics Changes » Shadowlands API changes?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off