Patch 11.0.2/API changes
Jump to navigation
Jump to search
![]() |
This article documents API changes made in Patch 11.0.2.
|
Resources
- TOC:
110002
- Diffs: wow-ui-source, BlizzardInterfaceResources
Breaking changes
- The Settings API has been changed, particularly around the creation of settings. Refer to Settings API changes for more details.
Settings API changes
The Settings API has been updated to resolve a few usability issues with respect to the creation and management of settings.
- The Settings.RegisterAddOnSetting function has had its signature changed significantly and now requires two additional parameters (
variableKey
andvariableTbl
) in the middle of the parameter list. These are used to directly read and write settings from a supplied table, which is typically expected to be the addon's saved variables. - The Settings.RegisterProxySetting function has been adjusted and can now be called from insecure code. Proxy settings can be used to execute author-supplied callbacks when reading and writing settings as an alternative to RegisterAddOnSetting.
- The Settings.OpenToCategory function has been improved and now supports directly opening to a subcategory, as well as automatically expanding any categories that it opens.
A minimal example of registering both an addon and a proxy setting is provided below.
MyAddOn_SavedVars = {}
local category = Settings.RegisterVerticalLayoutCategory("My AddOn")
local function OnSettingChanged(setting, value)
-- This callback will be invoked whenever a setting is modified.
print("Setting changed:", setting:GetVariable(), value)
end
do
-- RegisterAddOnSetting example. This will read/write the setting directly
-- to `MyAddOn_SavedVars.toggle`.
local name = "Test Checkbox"
local variable = "MyAddOn_Toggle"
local variableKey = "toggle"
local variableTbl = MyAddOn_SavedVars
local defaultValue = false
local setting = Settings.RegisterAddOnSetting(category, variable, variableKey, variableTbl, type(defaultValue), name, defaultValue)
setting:SetValueChangedCallback(OnSettingChanged)
local tooltip = "This is a tooltip for the checkbox."
Settings.CreateCheckbox(category, setting, tooltip)
end
do
-- RegisterProxySetting example. This will run the GetValue and SetValue
-- callbacks whenever access to the setting is required.
local name = "Test Slider"
local variable = "MyAddOn_Slider"
local defaultValue = 180
local minValue = 90
local maxValue = 360
local step = 10
local function GetValue()
return MyAddOn_SavedVars.slider or defaultValue
end
local function SetValue(value)
MyAddOn_SavedVars.slider = value
end
local setting = Settings.RegisterProxySetting(category, variable, type(defaultValue), name, defaultValue, GetValue, SetValue)
setting:SetValueChangedCallback(OnSettingChanged)
local tooltip = "This is a tooltip for the slider."
local options = Settings.CreateSliderOptions(minValue, maxValue, step)
options:SetLabelFormatter(MinimalSliderWithSteppersMixin.Label.Right);
Settings.CreateSlider(category, setting, options, tooltip)
end
Settings.RegisterAddOnCategory(category)
Consolidated diffs
Global API
Added (6) | Removed (3) |
---|---|
C_Item.GetItemCount - arg 5: includeAccountBank
Events
Added (3) | Removed (0) |
---|---|
CURRENCY_DISPLAY_UPDATE # 3: quantityChange, No longer an absolute value. Can be negative when spending or losing currency # 5: quantityLostSource -> destroyReason SHOW_DELVES_DISPLAY_UI + Documentation START_TIMER # 1: timerType, Type: luaIndex -> StartTimerType STOP_TIMER_OF_TYPE # 1: timerType, Type: luaIndex -> StartTimerType
CVars
Added (3) | Removed (0) |
---|---|
|
Enums
Enum.BagFlag + SkipValidCountCheck Enum.EventToastDisplayType + SingleLineWithIcon Enum.MountType + RideAlong Enum.MountTypeFlag + IsRideAlongMount Enum.QuestClassification + BonusObjective + Threat + WorldQuest Enum.TraitConditionType + DisplayError Enum.UIWidgetVisualizationType + ScenarioHeaderDelves
Structures
CampaignInfo + sortAsNormalQuest CraftingOrderRewardInfo # currencyAmount -> count HorizontalCurrenciesWidgetVisualizationInfo - updateAnimType PlayerChoiceOptionInfo + consolidateWidgets QuestInfo + sortAsNormalQuest + questClassification - isLegendarySort SpellDisplayVisualizationInfo - shownState - enabledState TraitNodeInfo + isDisplayError UIWidgetCurrencyInfo + textEnabledState + iconSizeType + updateAnimType UIWidgetItemInfo + itemNameCustomColor + itemNameCustomColorOverrideState UIWidgetSpellInfo + shownState + enabledState + showGlowState
Deprecated API
These API functions are deprecated and will be removed in patch 11.0.2
These functions were deprecated in patch 10.2.6 but do not appear to be removed on the 11.0.2 beta.