WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Legion Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=177)
-   -   Notable API changes in Legion (https://www.wowinterface.com/forums/showthread.php?t=53248)

Simca 05-19-16 05:55 PM

Here's an example of how TradeSkill stuff changed from Live to Legion. This code was designed to execute an a passed function on every result for a tradeskill.

Before:
Code:

-- Clear the search box focus so the scan will have correct results.
local search_box = _G.TradeSkillFrameSearchBox
search_box:SetText("")

_G.TradeSkillSearch_OnTextChanged(search_box)
search_box:ClearFocus()
search_box:GetScript("OnEditFocusLost")(search_box)

table.wipe(header_list)

-- Save the current state of the TradeSkillFrame so it can be restored after we muck with it.
local have_materials = _G.TradeSkillFrame.filterTbl.hasMaterials
local have_skillup = _G.TradeSkillFrame.filterTbl.hasSkillUp

if have_materials then
    _G.TradeSkillFrame.filterTbl.hasMaterials = false
    _G.TradeSkillOnlyShowMakeable(false)
end

if have_skillup then
    _G.TradeSkillFrame.filterTbl.hasSkillUp = false
    _G.TradeSkillOnlyShowSkillUps(false)
end
_G.SetTradeSkillInvSlotFilter(0, true, true)
_G.TradeSkillUpdateFilterBar()
_G.TradeSkillFrame_Update()

-- Expand all headers so we can see all the recipes there are
for tradeskill_index = 1, _G.GetNumTradeSkills() do
    local name, tradeskill_type, _, is_expanded = _G.GetTradeSkillInfo(tradeskill_index)

    if tradeskill_type == "header" or tradeskill_type == "subheader" then
        if not is_expanded then
            header_list[name] = true
            _G.ExpandTradeSkillSubClass(tradeskill_index)
        end
    elseif iter_func(name, tradeskill_index) then
        break
    end
end

-- Restore the state of the things we changed.
for tradeskill_index = 1, _G.GetNumTradeSkills() do
    local name, tradeskill_type, _, is_expanded = _G.GetTradeSkillInfo(tradeskill_index)

    if header_list[name] then
        _G.CollapseTradeSkillSubClass(tradeskill_index)
    end
end
_G.TradeSkillFrame.filterTbl.hasMaterials = have_materials
_G.TradeSkillOnlyShowMakeable(have_materials)
_G.TradeSkillFrame.filterTbl.hasSkillUp = have_skillup
_G.TradeSkillOnlyShowSkillUps(have_skillup)

_G.TradeSkillUpdateFilterBar()
_G.TradeSkillFrame_Update()

After:
Code:

local recipes = _G.C_TradeSkillUI.GetAllRecipeIDs()

if recipes and (#recipes > 0) then
    for i = 1, #recipes do
        if iter_func(_G.C_TradeSkillUI.GetRecipeInfo(recipes[i]).name, recipes[i]) then
            break
        end
    end
end

If you had trouble working with filters with the old UI like I did, you will love these changes, since there are two main APIs - C_TradeSkillUI.GetAllRecipeIDs() and C_TradeSkillUI.GetFilteredRecipeIDs() (spelling?). The former ignores filters/searching while the latter respects them.

Kapulani 05-22-16 08:50 AM

Quote:

Originally Posted by icyblade (Post 313723)
[*] item:125794:::::::::: is allowed now
For item link, we use something like "item:125794:0:0:0:0:0:0" before.
But in Legion, we can dismiss these zeros.
For user who wants to regex an item link, this is useful.

Has anyone done a total breakdown of new item links? There seem to be more 'fields' than there were in WoD.

Gello 05-22-16 10:01 AM

Quote:

Originally Posted by Simca (Post 314991)
there are two main APIs - C_TradeSkillUI.GetAllRecipeIDs() and C_TradeSkillUI.GetFilteredRecipeIDs() (spelling?). The former ignores filters/searching while the latter respects them.

The mount journal works this way too but from the other direction. In WoD the indexes were always available. Now there's C_MountJournal.GetMountIDs() and C_MountJournal.GetDisplayedMountInfo() and the WoD index functions were removed.

I'd kill for an equivalent for the pet journal. No new indexing would be needed, just fill the table with petIDs for pets the player owns and speciesIDs otherwise. An addon can work it out from there much easier than:

- hook C_PetJournal.SetSearchFilter and C_PetJournal.ClearSearchFilter to watch the search being changed (because there's no C_PetJournal.GetSearchFilter)
- watch for number of owned pets changing in PET_JOURNAL_LIST_UPDATE
- when that happens:
- backup the collected/uncollected, types, sources filters
- turn on all those filters and clear search
- gather pets into a table
- restore to backup and restore search

zork 05-22-16 12:39 PM

Tested the animation widget changes. Everything is working fine as far as I can tell.
https://github.com/zorker/rothui/blo...idget/core.lua

lieandswell 05-23-16 05:20 PM

Forgive me if this is covered before, but UnitAura() seems to have a new argument related to nameplates:

local name, rank, texture, count, debuffType, duration, expirationTime, caster, canStealOrPurge, shouldConsolidate, spellId, canApplyAura, isBossDebuff, isCastByPlayer, nameplateShowAll, timeMod = UnitAura(unit, i, filter);

Maybe these are the debuffs applied by other players that show on your nameplates?

ceylina 05-26-16 09:04 PM

Actionbar cooldown timer has changed or was changed this build

Code:

CooldownFrame_SetTimer(self.cooldown, start, duration, enable)
to

Quote:

CooldownFrame_Set(self.cooldown, start, duration, enable)

icyblade 06-03-16 09:31 PM

In this build(21863) .tga textures will not be loaded by addons, use .blp instead.GJ BLIZZARD

galvin 06-03-16 09:40 PM

And how do you make .BLP, thats a proprietary image format blizzard made.
Blizzard probably broke a ton of addons again. Going to be a PITA now I have to convert my images everytime I update them by a 3rd party. use paint.net, save file, convert, see how it looks in game. And repeat. Hope this is a bug.

Found a converter in the blizzard forums. Glad I found out about this cause I thought my addon was bugged and this saved a lot of time.

Stanzilla 06-03-16 11:05 PM

Just do nothing, it will be fixed in a new build. Don't panic because of stuff like that, it happens and it's not intentional.

zork 06-04-16 03:36 AM

DigitalUtopia made an amazing tool. It can convert BLP<->TGA or BLP<->PNG.
http://www.wowinterface.com/download...Converter.html

It converts folders in seconds. Adjust your texture names to work without .tga. Just use the texture name only. WoW will pick tga or blp depending on what it finds first.

semlar 06-04-16 11:17 AM

You don't even need to convert your files, the reason textures aren't loading is because it's replacing the extension with ".blp" in the texture path.

If you rename your texture files to end in .blp it will load them.

galvin 06-04-16 02:13 PM

Cool, just removed all .TGA extensions from my addon. Then renamed all the tga to blp works fine. Blizzard could of prevented a lot of headaches if they just used a standard image format from the start.

kaytotes 06-17-16 04:32 PM

ReputationWatchStatusBar seems to have gone the way of the dodo. Anyone got any pointers for how best to resize / move the reputation bar now?

Edit: I'm an idiot for not using /framestack

It's ReputationWatchBar.StatusBar now.

sezz 06-18-16 09:19 PM

Quote:

Originally Posted by Zavian (Post 314718)
It seems GetItemTransmogrifyInfo() it's been removed. Occuring here
Lua Code:
  1. local canBeSource = select(3, GetItemTransmogrifyInfo(item))

local canBeChanged, noChangeReason, canBeSource, noSourceReason = C_Transmog.GetItemInfo(itemID|"name"|"itemlink")

Ketho 06-20-16 04:50 AM

Quote:

Originally Posted by ykiigor (Post 314875)
Thanks, I found problem. GetTime is rounded to 0.25 for me, no idea why. (debugprofilestop works as intended, no problem with GetTime on live client)
Seems it is rounded on that gif too, but more accurate.

Probably fixed a long time ago, but at least GetTime() is not rounded to 1/32 seconds anymore for me


icyblade 06-24-16 01:32 AM

In today's build (22018), cameraDistanceMax was removed from cvar list.
Since cameraDistanceMaxFactor was restricted from 0 to 1.9, I can't figure out any way to extend the camera distance (except for binary modification).

whatisxml 07-04-16 09:51 AM

Quote:

Originally Posted by lieandswell (Post 315178)
Forgive me if this is covered before, but UnitAura() seems to have a new argument related to nameplates:

local name, rank, texture, count, debuffType, duration, expirationTime, caster, canStealOrPurge, shouldConsolidate, spellId, canApplyAura, isBossDebuff, isCastByPlayer, nameplateShowAll, timeMod = UnitAura(unit, i, filter);

Maybe these are the debuffs applied by other players that show on your nameplates?

UnitAura output looks like this:
Code:

local name, rank, texture, count, debuffType, duration, expirationTime, caster, _, nameplateShowPersonal, spellId, _, _, _, nameplateShowAll = UnitAura(unit, i, filter);
nameplateShowAll means the aura is displayed on all nameplates whereas nameplateShowPersonal means it's shown only on you or your pet

Nitrak 07-04-16 12:06 PM

Quote:

Originally Posted by galvin (Post 314806)
You shouldn't have to change anything unless you were doing something with pathnames.
Code snippet below uses Icon the same was as live.

Code:

  local Name, _, Icon = GetSpellInfo(SpellID)

  -- Check if the spell was removed from the game.
  if Name == nil then
    Name = format('%s removed from the game', SpellID)
    Icon = [[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]
  end

  TO.args[AuraGroup] = {
    type = 'group',
    name = format('|T%s:20:20:0:5|t |cFFFFFFFF%s|r (%s)', Icon, Name, SpellID),


Though I was using pathnames, as I linked above.

I have a list where the content of my list are an icon followed by the spells name using ACE3.

I don't see how I can put my icons into the string with the change (if at all possible)

EDIT: I fixed it by using: "|T" .. icon .. ":18:18:0:0|t " instead

Ketho 07-06-16 10:19 AM

Texture:GetTexture() doesn't seem to include the ".blp" extension anymore since build 22133 (July 4), maybe they reverted this change?

It was like this since the Beta, at least



(Edit) Another change, the releaseUITextures cvar was removed again
Quote:

Originally Posted by dssd (Post 316213)
In the latest beta build it appears the CVar was removed. The texture paths/ids are now being returned even if the texture is hidden.


ceylina 07-06-16 11:04 AM

If anyone cares,

GetTradeSkillSelectionIndex()

has become

TradeSkillFrame.RecipeList:GetSelectedRecipeID()

Also

GetTradeSkillInfo(recipeID)

is replaced by a table produced by

C_TradeSkillUI.GetRecipeInfo(recipeID) so if you want the name for example, just do C_TradeSkillUI.GetRecipeInfo(recipeID).name

GetRecipeInfo provides tons more information. Here is a dump example from an engineering recipe

disabled=false,
type="recipe",
hiddenUnlessLearned=false,
icon=1405810,
craftable=true,
numSkillUps=1,
recipeID=198979,
sourceType=1,
numIndents=1,
difficulty="optimal",
name="Intra-Dalaran Wormhole Generator",
numAvailable=0,
learned=true,
favorite=false,
categoryID=473


All times are GMT -6. The time now is 08:57 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI