Patch 10.2.0/API changes

From Warcraft Wiki
Jump to navigation Jump to search

Summary

  • Added a new texture slicing system that can be used as a replacement for backdrops and nineslice layouts.
  • Addon management functions such as EnableAddOn and IsAddOnLoaded have been moved to the C_AddOns namespace.
    • Most functions have the same signatures as before, however one exception to this is GetAddOnEnableState which had the order of its parameters swapped.
    • Aliases from the old function names exist, but are deprecated and will be removed in a future patch.
  • The GetCVarInfo function has been moved to the C_CVar namespace. An alias for the old name still exists, but is deprecated and will be removed in a future patch.
  • The SetPortraitToTexture function now requires that the initial texture parameter be a texture object. Previously, this function would also accept string values if they named a global texture object.
  • The C_Console namespace has been removed, with its functions moved back to the global namespace.
  • The auto-generated API documentation has been expanded to include many global functions that were previously undocumented.
  • The auto-generated API documentation now contains a pony.
  • Addons can no longer be loaded before FrameXML has fully loaded.
  • Fixed an issue where newly created characters would have all addons enabled by default[1].
  • Fixed an issue where NaN values could be used as table keys.
  • (Nov 16 2023) The CheckInteractDistance and IsItemInRange APIs are now protected and cannot be called by insecure code in combat as of build 52188.

Resources

Texture Slicing

A new texture slicing system has been implemented that allows a single Texture object to render a grid of nine sub-textures without distortion at the corners. The edges and central fill of the rendered texture can be configured to either tile or stretch across their respective dimensions.

This system is recommended to be used in new code going forward as a replacement for both the deprecated Backdrop system and the script-based NineSlice panel layout utility. One of the advantages of this new system is that it only requires a single texture object to render the grid, whereas both the old systems required nine separate objects. This system is fully compatible with custom texture assets and does not require the use of atlases.

To use this system from Lua the TextureBase:SetTextureSliceMargins method should be called to specify the pixel margins that represent the edges of the underlying asset. The TextureBase:SetTextureSliceMode method controls whether or not the central portion of the texture and its surrounding edges will be tiled or stretched, with the default being stretched. The below example demonstrates the usage of these APIs.

local SliceDemo = CreateFrame("Frame", nil, UIParent);
SliceDemo:SetPoint("CENTER");
SliceDemo:SetSize(256, 256);
SliceDemo:SetResizable(true);

SliceDemo.Texture = SliceDemo:CreateTexture();
SliceDemo.Texture:SetTexture([[interface/soulbinds/soulbindsconduitpendinganimationmask]])
SliceDemo.Texture:SetTextureSliceMargins(24, 24, 24, 24);
SliceDemo.Texture:SetTextureSliceMode(Enum.UITextureSliceMode.Tiled);
SliceDemo.Texture:SetAllPoints(SliceDemo);
SliceDemo.Texture:SetVertexColor(0, 1, 0);

SliceDemo.ResizeButton = CreateFrame("Button", nil, SliceDemo, "PanelResizeButtonTemplate");
SliceDemo.ResizeButton:SetPoint("BOTTOMRIGHT");
SliceDemo.ResizeButton:Init(SliceDemo, 64, 64, 512, 512);

The following new elements in XML can be supplied when defining a Texture object to configure this functionality.

<Texture file="interface/soulbinds/soulbindsconduitpendinganimationmask">
    <TextureSliceMargins left="24" right="24" top="24" bottom="24"/>
    <TextureSliceMode mode="Tiled"/>  <!-- Can be "Tiled" or "Stretched" -->
</Texture>

Diffs

Global API

10.1.7 (51261) → 10.2.0 (52106) Nov 8 2023
Added (46) Removed (46)
C_AddOns.DisableAddOn
C_AddOns.DisableAllAddOns
C_AddOns.EnableAddOn
C_AddOns.EnableAllAddOns
C_AddOns.GetAddOnDependencies
C_AddOns.GetAddOnEnableState
C_AddOns.GetAddOnInfo
C_AddOns.GetAddOnOptionalDependencies
C_AddOns.GetNumAddOns
C_AddOns.IsAddOnLoadable
C_AddOns.IsAddOnLoaded
C_AddOns.IsAddOnLoadOnDemand
C_AddOns.IsAddonVersionCheckEnabled
C_AddOns.LoadAddOn
C_AddOns.ResetAddOns
C_AddOns.ResetDisabledAddOns
C_AddOns.SaveAddOns
C_AddOns.SetAddonVersionCheck
C_CurrencyInfo.GetDragonIslesSuppliesCurrencyID
C_CVar.GetCVarInfo
C_LFGInfo.IsGroupFinderEnabled
C_LFGInfo.IsLFDEnabled
C_LFGInfo.IsLFREnabled
C_LFGInfo.IsPremadeGroupEnabled
C_PartyInfo.GetMinItemLevel
C_PerksActivities.GetPerksUIThemePrefix
C_PerksProgram.IsFrozenPerksVendorItem
C_PlayerInfo.GetNativeDisplayID
C_PlayerInfo.IsDisplayRaceNative
C_PlayerInfo.IsMirrorImage
C_PvP.GetSoloRBGMinItemLevel
C_PvP.IsBrawlSoloRBG
C_PvP.IsSoloRBG
C_Texture.GetAtlasElementID
C_Texture.GetAtlasID
C_WeeklyRewards.GetDifficultyIDForActivityTier
C_WeeklyRewards.GetNextActivitiesIncrease
C_WeeklyRewards.GetNumCompletedDungeonRuns
ConsoleGetAllCommands
ConsoleGetColorFromType
ConsoleGetFontHeight
ConsoleIsActive
ConsolePrintAllMatchingCommands
ConsoleSetFontHeight
CreateWindow
LaunchURL
C_Console.GetAllCommands
C_Console.GetColorFromType
C_Console.GetFontHeight
C_Console.PrintAllMatchingCommands
C_Console.SetFontHeight
DisableAddOn
DisableAllAddOns
EnableAddOn
EnableAllAddOns
GetAddOnDependencies
GetAddOnEnableState
GetAddOnInfo
GetAddOnOptionalDependencies
GetCVarInfo
GetNumAddOns
IsAddOnLoaded
IsAddOnLoadOnDemand
IsAddonVersionCheckEnabled
IsCompetitiveModeEnabled
KBArticle_BeginLoading
KBArticle_GetData
KBArticle_IsLoaded
KBQuery_BeginLoading
KBQuery_GetArticleHeaderCount
KBQuery_GetArticleHeaderData
KBQuery_GetTotalArticleCount
KBQuery_IsLoaded
KBSetup_BeginLoading
KBSetup_GetArticleHeaderCount
KBSetup_GetArticleHeaderData
KBSetup_GetCategoryCount
KBSetup_GetCategoryData
KBSetup_GetLanguageCount
KBSetup_GetLanguageData
KBSetup_GetSubCategoryCount
KBSetup_GetSubCategoryData
KBSetup_GetTotalArticleCount
KBSetup_IsLoaded
KBSystem_GetMOTD
KBSystem_GetServerNotice
KBSystem_GetServerStatus
LoadAddOn
ResetAddOns
ResetDisabledAddOns
SaveAddOns
SetAddonVersionCheck
C_FriendList.SendWho
  + arg: origin
C_Traits.CascadeRepurchaseRanks
  + arg: entryID
C_Traits.RefundRank
  + arg: clearEdges
C_Traits.SetSelection
  + arg: clearEdges

Widgets

Added (15) Removed (5)
Button:LockHighlight
Button:SetHighlightLocked
Button:UnlockHighlight
Widget Scripts
OnMovieHideSubtitle
OnMovieShowSubtitle
Object:SetParentKey
  + arg: clearOtherKeys

Events

Added (4) Removed (9)
GOSSIP_CLOSED
  + interactionIsContinuing
PVP_ROLE_POPUP_HIDE
  # readyCheckInfo, Nilable: false -> true

CVars

Added (14) Removed (4)
advFlyKeyboardMaxPitchFactoradvFlyKeyboardMaxPitchFactor (Game)
Default: 5.0, Scope: Account
Modifies the maximum pitch rate when using advFlyKeyboard.
advFlyKeyboardMaxTurnFactoradvFlyKeyboardMaxTurnFactor (Game)
Default: 8.0, Scope: Account
Modifies the maximum turn rate when using advFlyKeyboard.
advFlyKeyboardMinPitchFactoradvFlyKeyboardMinPitchFactor (Game)
Default: 2.5, Scope: Account
Modifies the minimum pitch rate when using advFlyKeyboard.
advFlyKeyboardMinTurnFactoradvFlyKeyboardMinTurnFactor (Game)
Default: 5.0, Scope: Account
Modifies the minimum turn rate when using advFlyKeyboard.
advFlyPitchControlCameraChaseadvFlyPitchControlCameraChase (Game)
Default: 20.0, Scope: Account
Modifies the speed at which camera pitch follows player pitch while dragonriding with forward/backward pitch control.
advFlyPitchControlGroundDebounceadvFlyPitchControlGroundDebounce (Game)
Default: 0, Scope: Account
If enabled, will debounce forwards/backwards inputs used to control pitch when transitioning between dragonriding and grounded.
advFlyPitchControladvFlyPitchControl (Game)
Default: 3, Scope: Account
Modifies forward/backwards inputs to control pitch when Dragonriding.
gxMTAlphaPassgxMTAlphaPass (Graphics)
Default: 1
Render Alpha Pass in parallel.
gxMTRefractiongxMTRefraction (Graphics)
Default: 1
Render refraction pass in parallel
gxMTVolFoggxMTVolFog (Graphics)
Default: 1
Render volumetric fog in parallel
lastRenownForMajorFaction2574lastRenownForMajorFaction2574 (Game)
Default: 0, Scope: Character
Stores the Dream Warden renown when Renown UI is closed
ThreadPoolLimitHPThreadPoolLimitHP (Graphics)
Default: 6
Limit number of threads allowed to be used for [Low|Mid|High] priority job scheduling
ThreadPoolLimitLPThreadPoolLimitLP (Graphics)
Default: 6
Limit number of threads allowed to be used for [Low|Mid|High] priority job scheduling
ThreadPoolLimitMPThreadPoolLimitMP (Graphics)
Default: 6
Limit number of threads allowed to be used for [Low|Mid|High] priority job scheduling
dragonRidingPitchSensitivitydragonRidingPitchSensitivity (Game)
Default: 2.5
Changes the sensitivity of pitch down/up keys
dragonRidingTurnSensitivitydragonRidingTurnSensitivity (Game)
Default: 5
Changes the sensitivity of turn left/right keys
gxMTAlphaWatergxMTAlphaWater (Graphics)
Default: 1
Render Alpha Water Volumes in parallel.
gxMTParticulateVolumesgxMTParticulateVolumes (Graphics)
Default: 0
Render Particulate Volumes in parallel.

Enums

Enum.AccountStateFlags
  + PerksPendingPurchaseLoaded = 0x0000000080000000
  + WoWTokenPurchaseLoaded = 0x0000001000000000
Enum.BrawlType
  + SoloRbg = 5
Enum.ChrCustomizationCategoryFlag
  + Subcategory = 2
Enum.CurrencyGainFlags
  + None = 0
Enum.CurrencySource
  # QuestRewardIgnoreCaps -> QuestRewardIgnoreCapsDeprecated
  # WorldQuestRewardIgnoreCaps -> WorldQuestRewardIgnoreCapsDeprecated
  + ConvertItemsToCurrencyAndReputation = 62
  + PhBuffer_63 = 63
  + PhBuffer_64 = 64
Enum.EventToastDisplayType
  + WeeklyRewardUnlock = 9
  + WeeklyRewardUpgrade = 10
Enum.EventToastEventType
  + WeeklyRewardUnlock = 23
  + WeeklyRewardUpgrade = 24,
Enum.GossipNpcOption
  # TabardVendor -> GuildTabardVendor
  + PersonalTabardVendor = 54
Enum.ItemDisplayTextDisplayStyle
  + PlayerChoiceReward = 3
Enum.LinkedCurrencyFlags
  + AddIgnoresMax = 0x8
Enum.PlayerInteractionType
  # TabardVendor -> GuildTabardVendor
  + PersonalTabardVendor = 65
Enum.UIMapFlag
  + DoNotShowOnNavbar = 0x80000

Constants

CurrencyConsts
 - DRAGON_ISLES_SUPPLIES_CURRENCY_ID
ItemConsts
 + MAX_LOOT_OBJECT_ITEMS = 31

Structures

AtlasInfo
  + rawSize
  + sliceData
CharCustomizationCategory
  + subcategory
ItemUpgradeSeasonalCostType
  # itemID, Nilable: false -> true
  + currencyID
PerksVendorItemInfo
  # pending -> isPurchasePending
  + uiGroupInfo
PvpBrawlInfo
  + minItemLevel
QuestInfo
  + isInternalOnly
StatusBarWidgetVisualizationInfo
  + glowAnimType
  + showGlowState
  + fillMinOpacity
  + fillMaxOpacity
TraitNodeInfoPartial
  + activeEntryID
UIWidgetItemInfo
  + showAsEarned
WeeklyRewardActivityInfo
  + activityTierID
XMLTemplateInfo
  + sourceLocation

Deprecated API

These are functions that were deprecated and will be removed in the future.

Deprecated_10_2_0.lua

GetCVarInfoC_CVar.GetCVarInfo
EnableAddOnC_AddOns.EnableAddOn
DisableAddOnC_AddOns.DisableAddOn
GetAddOnEnableStateC_AddOns.GetAddOnEnableState
LoadAddOnC_AddOns.LoadAddOn
IsAddOnLoadedC_AddOns.IsAddOnLoaded
EnableAllAddOnsC_AddOns.EnableAllAddOns
DisableAllAddOnsC_AddOns.DisableAllAddOns
GetAddOnInfoC_AddOns.GetAddOnInfo
GetAddOnDependenciesC_AddOns.GetAddOnDependencies
GetAddOnOptionalDependencies → C_AddOns.GetAddOnOptionalDependencies
GetNumAddOnsC_AddOns.GetNumAddOns
SaveAddOns → C_AddOns.SaveAddOns
ResetAddOns → C_AddOns.ResetAddOns
ResetDisabledAddOns → C_AddOns.ResetDisabledAddOns
IsAddonVersionCheckEnabled → C_AddOns.IsAddonVersionCheckEnabled
SetAddonVersionCheck → C_AddOns.SetAddonVersionCheck
IsAddOnLoadOnDemandC_AddOns.IsAddOnLoadOnDemand

References