Thread Tools Display Modes
10-31-22, 04:41 AM   #1
yoshimario40
A Defias Bandit
 
yoshimario40's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2020
Posts: 2
Need help with the new RegisterVerticalLayoutCategory

Hey guys. I'm trying out the fancy new RegisterVerticalLayoutCategory() that was introduced in 10.0.0. There's a code sample in https://wowpedia.fandom.com/wiki/Pat....0/API_changes that I'm trying out, but I'm actually running into a couple of issues running it as is. The main problem is that RegisterProxySetting() seems to actually taint something in the background and the addon becomes blocked whenever you try to cast any spell.

I looked into some alternatives and found RegisterAddonSetting(), which seems to do something very similar but uses secure calls instead. It seems to work fine, but its missing the variableTbl parameter. I'm not sure how you're supposed to use this to hook back into your table of saved settings.

Has anyone been able to use the vertical layout successfully? If so, let me know if you were able to solve this problem!

(Also, Settings.CreateDropDownTextContainer() doesn't exist. Looks like it was renamed to Settings.CreateControlTextContainer(). Replacing the function call with this one seems to work out.)
  Reply With Quote
11-01-22, 03:01 AM   #2
yoshimario40
A Defias Bandit
 
yoshimario40's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2020
Posts: 2
Okay found something that works. It looks like I'm able to register a callback that triggers when the value is changed. This way, I can set the value in my table whenever the UI gets updated.

Code:
    local variable = "CREATE_BUTTON_EXTRA_TEXT"
    local name = "Dynamic Create Button"
    local tooltip = "If checked, the create button text will change to include (target) or (self) when shift or ctrl is held"
    local defaultValue = true

    local setting = Settings.RegisterAddOnSetting(category, name, variable, type(defaultValue), settings.CREATE_BUTTON_EXTRA_TEXT);
    Settings.SetOnValueChangedCallback(variable, function(event) settings.CREATE_BUTTON_EXTRA_TEXT = setting:GetValue(); end);
    Settings.CreateCheckBox(category, setting, tooltip);
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Need help with the new RegisterVerticalLayoutCategory


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