WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   WoD Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=151)
-   -   API Changes (https://www.wowinterface.com/forums/showthread.php?t=49500)

p3lim 07-19-14 11:02 PM

API Changes
 
Note; this list might be far from complete, I'm completely unaware of how accurate this is (pulled from exe strings)

Parameter Changes:

1/nil/0 changed to true/false across the API, examples:
CheckButton:SetChecked(true/false)
Texture:SetDesaturated(true/false)

Code:

Old: Button:SetCooldown(start, duration, charges, maxCharges)
New: Button:SetCooldown(start, duration)

Code:

Old: GameTooltip:SetHyperlink(link)
New: GameTooltip:SetHyperlink(link, classID, specID)

Code:

Old: GetSpecializationSpells(specIndex[, isInspect[, isPet]])
New: GetSpecializationSpells(specIndex[, isInspect[, isPet[, ignorePetOverrideSpec]]])

Code:

Old: Tooltip:SetTalent(talentIndex[, isInspect[, groupIndex]])
New: Tooltip:SetTalent(talentID[, isInspect[, groupIndex]])

Code:

Old: BNSendFriendInvite(battletag/email, noteText)
New: BNSendFriendInvite(battletag/email)

Code:

Old: BNSendFriendInviteByID(ID, noteText)
New: BNSendFriendInviteByID(ID)

Code:

Old: C_Vignettes.GetVignetteInfoFromInstanceID(instanceID)
New: C_Vignettes.GetVignetteInfoFromInstanceID(instanceGUID)

Code:

Old: C_Vignettes.GetVignetteInstanceID(index)
New: C_Vignettes.GetVignetteGUID(index)

Code:

Old: CagePetByID(petID)
New: CagePetByID(petGUID)

Code:

Old: ClickVoidStorageSlot(slot, [button])
New: ClickVoidStorageSlot(tab, slot, [button])

Code:

Old: DisableAddOn("character", index)
Old: DisableAddOn(index or "name")
New: DisableAddOn(index or "name", [set for all or "character"])

Code:

Old: EnableAddOn("character", index)
Old: EnableAddOn(index or "name")
New: EnableAddOn(index or "name", [set for all or "character"])

Code:

Old: LearnTalent(talentIndex)
New: LearnTalent(talentID)

Code:

Old: LearnTalents(talentIndex1 [, talentIndex2, ...])
New: LearnTalents(talentID1 [, talentID2, ...])

Code:

Old: PetCanBeReleased(petID)
New: PetCanBeReleased(petGUID)

Code:

Old: PetIsCaptureable(petID)
New: PetIsCaptureable(petGUID)

Code:

Old: PetIsHurt(petID)
New: PetIsHurt(petGUID)

Code:

Old: PetIsLockedForConvert(petID)
New: PetIsLockedForConvert(petGUID)

Code:

Old: PetIsRevoked(petID)
New: PetIsRevoked(petGUID)

Code:

Old: PetIsSlotted(petID)
New: PetIsSlotted(petGUID)

Code:

Old: PetIsSummonable(petID)
New: PetIsSummonable(petGUID)

Code:

Old: PetIsTradable(petID)
New: PetIsTradable(petGUID)

Code:

Old: PickupPet(petID)
New: PickupPet(petGUID)

Code:

Old: PickupTalent(talentindex)
New: PickupTalent(talentID)

Code:

Old: PlaySound("sound", optional["SFX","Music","Ambience" or "Master"])
New: PlaySound("sound", optional["SFX","Music","Ambience", "Dialog" or "Master"])

Code:

Old: RemoveTalent(talentIndex)
New: RemoveTalent(talentID)

Code:

Old: SetMapByID(mapID)
New: SetMapByID(mapID[, floor])

Code:

Old: SetRaidDifficultyID(difficultyID)
New: SetRaidDifficultyID(difficultyID[, force])

Code:

Old: SummonPetByGUID(petID)
New: SummonPetByGUID(petGUID)

Code:

Old: UseContainerItem(index, slot[, target])
New: UseContainerItem(index, slot[, target[, reagentBankOpen]])

Code:

Old: UseVoidItemForTransmogrify(voidItemslot, inventorySlot)
New: UseVoidItemForTransmogrify(voidItemTab, voidItemslot, inventorySlot)

Code:

Old: QueryAuctionItems(name, minLevel, maxLevel, invTypeIndex, classIndex, subclassIndex, page, isUsable, qualityIndex, getAll)
New: QueryAuctionItems(name, minLevel, maxLevel, invTypeIndex, classIndex, subclassIndex, page, isUsable, qualityIndex, getAll, exactMatch)

Code:

Old: StopSound(soundHandleID)
New: StopSound(soundHandleID[, fadeOutTime]) -- milliseconds


p3lim 07-20-14 12:40 AM

Return Changes:
Code:

Old: player, bank, bags, voidStorage, slot, bag = EquipmentManager_UnpackLocation(location)
New: player, bank, bags, voidStorage, slot, bag, tab, voidSlot = EquipmentManager_UnpackLocation(location)

Code:

Old: specID = GetArenaOpponentSpec(arenaUnitIndex)
New: specID, gender = GetArenaOpponentSpec(arenaUnitIndex)

Code:

Old: commandName, binding1, binding2, ... = GetBinding(index, mode)
New: commandName, category, binding1, binding2, ... = GetBinding(index, mode)

Code:

Old: name, className, class, specID = GetChallengeBestTimeInfo(mapID, index, guildOnly)
New: name, className, class, specID, gender = GetChallengeBestTimeInfo(mapID, index, guildOnly)

Code:

Old: name, groupType, isHeroic, isChallengeMode, toggleDifficultyID = GetDifficultyInfo(id)
New: name, groupType, isHeroic, isChallengeMode, displayHeroic, displayMythic, toggleDifficultyID = GetDifficultyInfo(id)

Code:

Old: id, name, description, icon, background, role, class = GetSpecializationInfoByID(specID)
New: id, name, description, icon, background, role, class = GetSpecializationInfoByID(specID, gender)

Code:

Old: id, name, description, icon, background, role = GetSpecializationInfo(specIndex [, isInspect [, isPet]])
New: id, name, description, icon, background, role, primaryStat = GetSpecializationInfo(specIndex [, isInspect [, isPet]], inspectedUnit, gender)

Code:

Old: id, name, description, icon, background, role = GetSpecializationInfoForClassID(classID, index)
New: id, name, description, icon, background, role, primaryStat = GetSpecializationInfoForClassID(classID, index, gender)

Code:

Old: GetSpecializationInfoForSpecID(specID)
New: GetSpecializationInfoForSpecID(specID[, gender])

Code:

Old: texture, itemCount, locked, isFiltered = GetGuildBankItemInfo(tabId, index)
New: texture, itemCount, locked, isFiltered, quality = GetGuildBankItemInfo(tabId, index)

Code:

Old: name, glyphType, isKnown, icon, glyphID, link, subText = GetGlyphInfo(index)
New: name, glyphType, isKnown, icon, glyphID, link, subText, specMatches, excluded = GetGlyphInfo(index)

Code:

Old: guildLevel, guildXP, guildNumMembers, guildName = GetInspectGuildInfo(unit);
New: guildPoints, guildNumMembers, guildName = GetInspectGuildInfo(unit);

Code:

Old: itemID = GetInventoryItemID(unit, slot);
New: itemID, itemAppearanceModID = GetInventoryItemID(unit, slot);

Code:

Old: isTransmogrified, canTransmogrify, cannotTransmogrifyReason, hasPending, hasUndo, visibleItemID, textureName = GetTransmogrifySlotInfo(index)
New: isTransmogrified, canTransmogrify, cannotTransmogrifyReason, hasPending, hasUndo, visibleItemID, textureName, visibleItemAppearanceModID = GetTransmogrifySlotInfo(index)

Code:

Old: link, icon, charges = GetQuestLogSpecialItemInfo(questIndex)
New: link, item, charges, showItemWhenComplete = GetQuestLogSpecialItemInfo(questIndex);

Code:

Old: distance = GetDistanceSqToQuest(index)
New: distance, onContinent = GetDistanceSqToQuest(index)

Code:

Old: description, type, completed, quantity, requiredQuantity, characterName, flags, assetID, quantityString, criteriaID = GetAchievementCriteriaInfo(achievementID, index)
New: description, type, completed, quantity, requiredQuantity, characterName, flags, assetID, quantityString, criteriaID, eligible, duration, elapsed = GetAchievementCriteriaInfo(achievementID, index)

Note: If you pass an invalid value to GetSpellInfo(), like a string or 0, it will return three empty strings, making checks like this return true regardless if the spell exists or not: if(GetSpellInfo('something')) then
Code:

Old: name, rank, icon, powerCost, isFunnel, powerType, castingTime, minRange, maxRange[/color] = GetSpellInfo(id)
New: name, subname, icon, castingTime, minRange, maxRange = GetSpellInfo(id)

Code:

Old: skillName, skillType, numAvailable, isExpanded, altVerb, numSkillUps, indentLevel, showProgressBar, currentRank, maxRank, startingRank = GetTradeSkillInfo(skillIndex)
New: skillName, skillType, numAvailable, isExpanded, altVerb, numSkillUps, indentLevel, showProgressBar, currentRank, maxRank, startingRank, displayAsUnavailable, unavailableString = GetTradeSkillInfo(skillIndex)

Code:

Old: cooldown, isDayCooldown = GetTradeSkillCooldown(index);
New: cooldown, isDayCooldown, charges, maxCharges = GetTradeSkillCooldown(index);

Code:

Old: itemID, textureName = GetVoidTransferDepositInfo(index)
New: itemID, textureName, quality = GetVoidTransferDepositInfo(index)

Code:

Old: itemID, textureName = GetVoidTransferWithdrawalInfo(index)
New: itemID, textureName, quality = GetVoidTransferWithdrawalInfo(index)

Code:

Old: itemID, textureName, locked, recentDeposit, isFiltered = GetVoidItemInfo(index)
New: itemID, textureName, locked, recentDeposit, isFiltered, quality = GetVoidItemInfo(tabId, index)

Code:

Old: texture, itemCount, locked, quality, readable, lootable, link, isFiltered = GetContainerItemInfo(container, slot)
New: texture, itemCount, locked, quality, readable, lootable, link, isFiltered, noValue = GetContainerItemInfo(container, slot)

Code:

Old: name, level, class, area, connected, status, note = GetFriendInfo(friendIndex)
New: name, level, class, area, connected, status, note, isReferAFriend = GetFriendInfo(friendIndex)

Code:

Old: texture, name, isTradeskillSpell, isSpellLearned = GetQuestLogRewardSpell()
New: texture, name, isTradeskillSpell, isSpellLearned, hideSpellLearnText = GetQuestLogRewardSpell()

Code:

Old: texture, name, isTradeskillSpell, isSpellLearned = GetRewardSpell()
New: texture, name, isTradeskillSpell, isSpellLearned, hideSpellLearnText = GetRewardSpell()

Code:

Old: areaID = GetCurrentMapAreaID()
New: areaID, isContinent = GetCurrentMapAreaID()

Code:

Old: title, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete, isDaily, questID, startEvent, displayQuestID = GetQuestLogTitle(questIndex)
New: title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(questIndex)

Code:

Old: name, texture, offset, numSpells, isGuild, offSpecID = GetSpellTabInfo(index)
New: name, texture, offset, numSpells, isGuild, offSpecID, shouldHide = GetSpellTabInfo(index)

Code:

Old: name, iconTexture, tier, column, selected, available = GetTalentInfo(talentIndex [, isInspect, talentGroup, inspectedUnit, classID])
New: talentID, name, iconTexture, selected, available = GetTalentInfo(tier, column, talentGroup [, isInspect, inspectedUnit])

Code:

Old: link = GetTalentLink(talentIndex[, isInspect, inspectClassID])
New: link = GetTalentLink(talentID)

Code:

Old: name, description, textureIndex, x, y, mapLinkID, showInBattleMap, graveyardID, areaID, poiID, isObjectIcon = GetMapLandmarkInfo(index)
New: name, description, textureIndex, x, y, mapLinkID, showInBattleMap, graveyardID, areaID, poiID, isObjectIcon, atlasIcon = GetMapLandmarkInfo(index)

Code:

Old: name, title, notes, enabled, loadable, reason, security = GetAddOnInfo(index or "name")
New: name, title, notes, url, loadable, reason, security, newVersion = GetAddOnInfo(index or "name")

Code:

Old: optionsTable = GetVideoOptions(value)
New: optionsTable = GetVideoOptions(value[, isRaid])

Code:

Old: index, current, max, xp, gold, maxGold = GetGuildChallengeInfo(index)
New:  index, current, max, gold, maxGold = GetGuildChallengeInfo(index)

Code:

Old: name, typeID, subtypeID, minLevel, maxLevel, recLevel, minRecLevel, maxRecLevel, expansionLevel, groupID, textureFilename, difficulty, maxPlayers, description, isHoliday, repAmount, forceHide = GetLFGDungeonInfo(dungeonID)
New name, typeID, subtypeID, minLevel, maxLevel, recLevel, minRecLevel, maxRecLevel, expansionLevel, groupID, textureFilename, difficulty, maxPlayers, description, isHoliday, repAmount = GetLFGDungeonInfo(dungeonID)

NOTE: GetBindingText is now implemented C-side (used to be in FrameXML/UIParent.lua)
Code:

Old: text = GetBindingText(key, prefix, abbreviate)
New: text = GetBindingText(key, abbreviate)


p3lim 07-20-14 01:13 AM

Please let me know if you find additional changes and I'll update the original posts.

Nimhfree 07-20-14 09:41 AM

GetQuestLogTitle no longer returns "isDaily" as a boolean, but "frequency" which needs to be compared against two constants representing daily or weekly values.

p3lim 08-05-14 12:09 AM

Changes in 18663:

Code:

Old: GameTooltip:SetHyperlink(link)
New: GameTooltip:SetHyperlink(link, classID, specID)


Tageshi 08-05-14 07:13 AM

GetMacroIcons
 
GetMacroIcons(table) will (sometimes?) populate numbers in the table instead of string for texture file path.
And we need to use texture:SetToFileData() for numbers instead of texture:SetTexture() like below:
Code:

texture = GetSpellorMacroIconInfo(index);
if(type(texture) == "number") then
        macroPopupIcon:SetToFileData(texture);
else
        macroPopupIcon:SetTexture("INTERFACE\\ICONS\\"..texture);
end

Where GetSpellorMacroIconInfo is returning values populated by GetMacroIcons()

p3lim 08-05-14 07:39 AM

Might be temporary, at least seems like it.

Here is where they do this for future reference:
https://github.com/tekkub/wow-ui-sou....lua#L412-L417

p3lim 08-07-14 03:19 AM

Changes in 18689:

Code:

Old: SetMapByID(mapID)
New: SetMapByID(mapID[, floor])


myrroddin 08-07-14 08:27 PM

Quote:

Originally Posted by p3lim (Post 294936)
Changes in 18689:

Code:

Old: SetMapByID(mapID)
New: SetMapByID(mapID[, floor])


o.O That's a nice, if minor, change.

semlar 08-07-14 08:54 PM

Quote:

Originally Posted by myrroddin (Post 294989)
o.O That's a nice, if minor, change.

It doesn't currently work.

It would also be nice if we could somehow access microdungeon maps without actually being inside of it.

p3lim 08-12-14 03:14 PM

Changes from 18689 to 18716:

Code:

Old: name, groupType, isHeroic, isChallengeMode, toggleDifficultyID = GetDifficultyInfo(id)
New: name, groupType, isHeroic, isChallengeMode, displayHeroic, displayMythic, toggleDifficultyID = GetDifficultyInfo(id)


p3lim 08-18-14 07:01 PM

No changes in build 18738, but GetSpellInfo no longer returns empty strings on invalid parameters, now returns nil as intended.

Tekkub 08-25-14 01:44 AM

`BankButtonIDToInvSlotID(id, isBag)` appears to have changed the values is accepts for `id`. Previously it was 5-11 (the bank bags' bag IDs), now it is 1-7 (the bank bags' logical indexes).

p3lim 09-03-14 03:22 AM

Changes in 18816:

Code:

Old: GetSpecializationSpells(specIndex[, isInspect[, isPet]])
New: GetSpecializationSpells(specIndex[, isInspect[, isPet[, ignorePetOverrideSpec]]])


Haleth 09-03-14 07:44 AM

Code:

name, title, notes, url, loadable, reason, security, newVersion = GetAddOnInfo(index)
newVersion? Incoming built-in addon update checker, or am I missing something? :confused:

AddonList.lua:

Code:

function AddonList_HasNewVersion()
        local hasNewVersion = false;
        for i=1, GetNumAddOns() do
                local name, title, notes, loadable, reason, security, newVersion = GetAddOnInfo(i);
                if ( newVersion ) then
                        hasNewVersion = true;
                        break;
                end
        end
        return hasNewVersion;
end

function UpdateAddonButton()
        if ( GetNumAddOns() > 0 ) then
                -- Check to see if any of them are out of date and not disabled
                if ( IsAddonVersionCheckEnabled() and AddonList_HasOutOfDate() and not HasShownAddonOutOfDateDialog ) then
                        AddonDialog_Show("ADDONS_OUT_OF_DATE");
                        HasShownAddonOutOfDateDialog = true;
                end
                if ( AddonList_HasNewVersion() ) then
                        CharacterSelectAddonsButtonGlow:Show();
                else
                        CharacterSelectAddonsButtonGlow:Hide();
                end
                CharacterSelectAddonsButton:Show();
        else
                CharacterSelectAddonsButton:Hide();
        end
end


TOM_RUS 09-03-14 08:03 AM

Quote:

Originally Posted by Haleth (Post 296222)
newVersion? Incoming built-in addon update checker, or am I missing something? :confused:

Nope. It has been in game since at least TBC. And never been used. It needs some server side support and only works for "Secure" addons right now.

This is how it looks in game (screenshots not from blizzard servers obviously):


liquidbase 09-04-14 09:46 AM

Am I correct that they also have the "Enabled" removed from GetAddOnInfo ()?

On the live servers are GetAddOnInfo () still following values:

Code:

name, title, notes, enabled, loadable, reason, security = GetAddOnInfo(index or "name")
How can I now query whether a particular addon is enabled or not? So completely I do not understand the change of the function.

p3lim 09-04-14 11:04 AM

Quote:

Originally Posted by liquidbase (Post 296254)
Am I correct that they also have the "Enabled" removed from GetAddOnInfo ()?

On the live servers are GetAddOnInfo () still following values:

Code:

name, title, notes, enabled, loadable, reason, security = GetAddOnInfo(index or "name")
How can I now query whether a particular addon is enabled or not? So completely I do not understand the change of the function.

It seems to be gone, use this:

Code:

GetAddOnEnableState('character', index)

liquidbase 09-04-14 11:06 AM

Thanks I will try it.

gizmo28 09-04-14 02:49 PM

Quote:

Originally Posted by p3lim (Post 296258)
It seems to be gone, use this:

Code:

GetAddOnEnableState('character', index)

This would also work without to much work:

Code:

                local enabled
                for i = 1, GetNumAddOns() do
                        local name, title, notes, loadable, reason, security, newversion = GetAddOnInfo(i)
                        if name ==  "NameofAddon" and loadable then
                                enabled = true
                                break
                        end
                end

You can use either one of these of:

name - Name of the addon (name of the addon's folder and TOC file) (string)
title - Title of the addon (from the Title header in the addon's TOC file) (string)

I personally would use name because some people use different titles from the addon folder in their .toc files.

Xrystal 09-04-14 03:21 PM

I tested this myself yesterday ( with index numbers not names ) and there are 2 '1' values on addons that are loadable and enabled. The values listed in wowpedia for GetAddOnInfo function are still valid from my tests and in the order listed.

On my lowbies I don't have DBM enabled and those addons only listed the name, title and notes values.

reason showed as nil for all my addons that I could see, I even tried enabling addons that had missing requirements.

security showed as INSECURE for all addons whether enabled or not. there may be values after that but when checked manually they always appeared as nil.

Phanx 09-04-14 11:47 PM

Quote:

Originally Posted by gizmo28 (Post 296266)
I personally would use name because some people use different titles from the addon folder in their .toc files.

Not only that, but an addon can have different titles for different languages, and some authors include the version number in the title (though they really shouldn't do that). Nobody should ever use the Title field as a means of detecting particular addons. If you've seen some resource recommending this practice, or an addon doing it, please tell me what it is so I can go yell at its author. :mad:

Phanx 09-05-14 03:42 AM

Ugh, the change to GetAddOnInfo and related APIs (dropping support for querying by name) is so obnoxious... is there some official forum where Blizzard might actually see complaints about beta API changes? Having to loop over every single addon, query GetAddOnInfo, check the name, and then separately query GetAddOnEnableState is ridiculous. :mad:

Coote 09-05-14 04:52 AM

Quote:

Originally Posted by Phanx (Post 296294)
Ugh, the change to GetAddOnInfo and related APIs (dropping support for querying by name) is so obnoxious... is there some official forum where Blizzard might actually see complaints about beta API changes? Having to loop over every single addon, query GetAddOnInfo, check the name, and then separately query GetAddOnEnableState is riduclous. :mad:

I think every patch they flip a coin to decide if they're going to screw with people and make random changes. If it comes up heads, they do, if tails, they don't. When it comes up heads, they spin a wheel to decide what kind of random archaic changes they should do.

I joke about it all the time, but I wouldn't be surprised if I were to find out this is exactly what they do.

Rainrider 09-05-14 05:04 AM

This also has the implication that one can't call GetAddOnInfo and the like on Blizzard addons, not that I know of a reason why one would want that. I also don't find GetAddOnEnableState particularly useful. You could get this info from GetAddOnInfo's fifth return (named "reason" in previous posts in this thread). If reason is not "DISABLED" then the addon is enabled.

Apart from that the old behavior of GetAddOnInfo is easily achieved by creating an addon_name = addon_index dictionary, isn't it? I do believe this is just like how GetSpellInfo used to return empty strings instead of nil for non-existent spells - they'll change it back.

Phanx 09-05-14 07:26 AM

Quote:

Originally Posted by Rainrider (Post 296298)
I also don't find GetAddOnEnableState particularly useful. You could get this info from GetAddOnInfo's fifth return (named "reason" in previous posts in this thread). If reason is not "DISABLED" then the addon is enabled.

GetAddOnEnableState is theoretically useful; while GetAddOnInfo only tells you whether the addon is enabled on the currect character, with GetAddOnEnableState you can get a bit more detail:

Addon is enabled on all characters:
GetAddOnEnableState(nil, index) => 2
GetAddOnEnableState("Charname", index) => 2

Addon is only enabled on some characters, including the current one:
GetAddOnEnableState(nil, index) => 1
GetAddOnEnableState("Charname", index) => 2

Addon is only enabled on some characters, but not on the current one:
GetAddOnEnableState(nil, index) => 1
GetAddOnEnableState("Charname", index) => 0

Addon is not enabled on any characters:
GetAddOnEnableState(nil, index) => 0
GetAddOnEnableState("Charname", index) => 0

The only real use I can think of for this information is in addon managers; the new in-game Blizzard addon manager is the same one that you can use at the character screen, including the "all/character" dropdown, though you can only choose "All" or the current character when using it in-game.

Quote:

Originally Posted by Rainrider (Post 296298)
Apart from that the old behavior of GetAddOnInfo is easily achieved by creating an addon_name = addon_index dictionary, isn't it?

Yeah, but that's still annoying, and requires a significant increase in code clutter and complexity for no apparent reason. LoadAddOn can still handle names, so it's not like they just decided to remove the ability to identify addons by name on the C side. They just disabled the functionality for certain API functions because ... well, because.

If all they wanted was to stop people from being able to disable the Blizzard_* addons, they should have just done that instead of breaking the whole API.

Seerah 09-05-14 07:21 PM

Was IsAddonLoaded's usage changed as well?

Fizzlemizz 09-05-14 08:02 PM

Quote:

Originally Posted by Seerah (Post 296334)
Was IsAddonLoaded's usage changed as well?

Still working the same as is LoadAddOn but you never know what the next build will bring.

Phanx 09-05-14 09:28 PM

Quote:

Originally Posted by Fizzlemizz (Post 296337)
Still working the same as is LoadAddOn but you never know what the next build will bring.

I don't think they can change LoadAddOn to require an index, since they use it to load their own addons, which cannot be accessed by index.

Fizzlemizz 09-05-14 09:41 PM

It was more to emphasize that they're not getting rid of using addon names so changing to index seems eeerr, pointless.

Rilgamon 09-06-14 12:03 AM

Quote:

Originally Posted by Phanx (Post 296340)
I don't think they can change LoadAddOn to require an index, since they use it to load their own addons, which cannot be accessed by index.

And what if thats the reason for this change? I mean loading those addons in the wrong order often causes trouble. What if we're no longer supposed to load system addons?

Phanx 09-06-14 01:29 AM

Quote:

Originally Posted by Rilgamon (Post 296345)
And what if thats the reason for this change? I mean loading those addons in the wrong order often causes trouble. What if we're no longer supposed to load system addons?

As I said in an earlier post, if their goal was to prevent third-party addons from doing anything with Blizzard addons, they could have just made third-party addons unable to do anything with Blizzard addons, rather than screwing up an entire category of API functions.

Torhal 09-06-14 08:52 PM

From my experience tonight with Ackis Recipe List on the latest beta build (18833) the return values for GetAddOnInfo() are actually:

Lua Code:
  1. name, title, notes, isLoaded, reason, security, newVersion = _G.GetAddOnInfo(index)

Though I didn't actually check that newVersion or anything beyond existed.

OttoDeFe 09-07-14 01:11 PM

Ahh... I see why AddonLoader (among others) is now broken.

jaliborc 09-07-14 07:27 PM

I want to be able to check if an addon is enabled without having to mess my code with loops on all my addons, so I made a library for this: https://github.com/Jaliborc/AddonList-1.0 (yeah, feels stupid to have such a small lib, but crappy APIs lead to crappy solutions). Just in case someone is interested.

Phanx 09-07-14 10:09 PM

Quote:

Originally Posted by jaliborc (Post 296387)
I want to be able to check if an addon is enabled without having to mess my code with loops on all my addons, so I made a library for this: https://github.com/Jaliborc/AddonList-1.0 (yeah, feels stupid to have such a small lib, but crappy APIs lead to crappy solutions). Just in case someone is interested.

Since the list of addons cannot change during a session, you should just create a static name->index table, and use a simple table lookup to get the index for the requested name, instead of calling a function that loops over all addons and calls more functions every time.

jaliborc 09-09-14 10:30 AM

Quote:

Originally Posted by Phanx (Post 296392)
Since the list of addons cannot change during a session, you should just create a static name->index table, and use a simple table lookup to get the index for the requested name, instead of calling a function that loops over all addons and calls more functions every time.

Yeah, you're right. Though about it, but I never seen anyone checking an addon information on performant critical situations (just checking if it is enabled to react accordingly, for example), so I did not worry about it. But caching the indexes certainly scales better. I'll change it.

p3lim 09-10-14 09:57 AM

Changes in 18837:

Code:

Old: GetAddOnInfo(index)
New: GetAddOnInfo(index or "name")

Basically reverting their change.

Phanx 09-10-14 01:55 PM

Victory! \o/

humfras 09-10-14 03:20 PM

Quote:

Originally Posted by Phanx (Post 296496)
Victory! \o/

Victory for common sense.

Blizz' still in desperate need of more of that...

Phanx 09-10-14 04:20 PM

Quote:

Originally Posted by humfras (Post 296500)
Victory for common sense.

Blizz' still in desperate need of more of that...

Indeed. I'm still hoping they will fix the pet journal API to be less insane, since they have a perfectly fine example now in their own mount journal API.


All times are GMT -6. The time now is 11:17 AM.

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