Go to Page... |
|
Thread Tools | Display Modes |
05/31/22, 02:27 PM | #1 |
registerForDefaults doesn't work as expected
Greetings.
I've recently coded my first addon Much Smarter AutoLoot and seems it gets the job done not bad. Yet I faced a problem that I can't make the build-in function registerForDefaults, which is provided by LibAddonMenu works on my addon. When I click the Default button in my addon panel and confirm in the confirmation box, nothing happens. The options aren't set to default, nor does the confirmation box disappear. Literally, nothing happens. I can't find out what causes this problem. I gave every panel option default and set registerForDefaults true, but for some reason, LibAddonMenu cannot reset them. Code:
... local panelData = { type = "panel", name = GetString(MSAL_PANEL_NAME), displayName = GetString(MSAL_PANEL_DISPLAYNAME), author = "|c215895Lykeion|r", version = "|ccc922f2.2.0|r", slashCommand = "/msal", registerForRefresh = true, registerForDefaults = true } ... local optionsData = { ... { type = "submenu", name = GetString(MSAL_LOOT_FILTERS), controls = { [1] = { type = "slider", name = GetString(MSAL_QUALITY_THRESHOLD), tooltip = GetString(MSAL_QUALITY_THRESHOLD_TOOLTIP), min = 1, max = 5, step = 1, getFunc = function() return db.minimumQuality end, setFunc = function(value) db.minimumQuality = value end, default = 1, }, [2] = { type = "slider", name = GetString(MSAL_VALUE_THRESHOLD), tooltip = GetString(MSAL_VALUE_THRESHOLD_TOOLTIP), min = 0, max = 10000, getFunc = function() return db.minimumValue end, setFunc = function(value) db.minimumValue = value end, default = 10, }, [3] = { type = "dropdown", name = GetString(MSAL_ORNATE_ITEMS), tooltip = GetString(MSAL_ORNATE_INTRCATE_TOOLTIP), choices = defaultChoices, choicesValues = defaultChoicesValues, getFunc = function() return db.filters.ornate end, setFunc = function(value) db.filters.ornate = value end, default = "always loot", }, [4] = { type = "dropdown", name = GetString(MSAL_INTRICATE_ITEMS), tooltip = GetString(MSAL_ORNATE_INTRCATE_TOOLTIP), choices = defaultChoices, choicesValues = defaultChoicesValues, getFunc = function() return db.filters.intricate end, setFunc = function(value) db.filters.intricate = value end, default = "always loot", }, ... } ... } LAM2:RegisterAddonPanel("MuchSmarterAutoLootOptions", panelData) LAM2:RegisterOptionControls("MuchSmarterAutoLootOptions", optionsData) ... Code:
MSAL_VARS = { ["NA Megaserver"] = { ["@userId"] = { ["Id"] = { ["$AccountWide"] = { ["Account"] = { ["lootStolen"] = false, ["allowDestroy"] = false, ["minimumQuality"] = 4, ["printItems"] = false, ["filters"] = { ["potions"] = "always loot", ["collectibles"] = "always loot", ["jewelry"] = "always loot", ["foodAndDrink"] = "never loot", ["ornate"] = "always loot", ["furnitureCraftingMaterials"] = "always loot", ["tickets"] = "never loot", ["craftingMaterials"] = "always loot", ["containers"] = "always loot", ["costumes"] = "never loot", ["soulGems"] = "always loot", ["runes"] = "always loot", ["fishingBaits"] = "never loot", ["ingredients"] = "always loot", ["glyphs"] = "never loot", ["styleMaterials"] = "always loot", ["intricate"] = "always loot", ["crystals"] = "always loot", ["armors"] = "per quality threshold", ["recipes"] = "always loot", ["tools"] = "always loot", ["poisons"] = "never loot", ["weapons"] = "per quality threshold", }, ["closeLootWindow"] = false, ["version"] = 1, ["minimumValue"] = 10, ["enabled"] = true, ["LibSavedVars"] = { ["accountSavedVarsActive"] = true, }, }, }, }, }, } Last edited by Lykeion : 05/31/22 at 02:53 PM. |
|
ESOUI » Developer Discussions » General Authoring Discussion » registerForDefaults doesn't work as expected |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Switch to Hybrid Mode |
Threaded Mode |
|
|