Removed LibStub Usage
This commit is contained in:
джерело
3279e2d0fb
коміт
7bfc87c37c
@ -1,3 +1,3 @@
|
||||
{
|
||||
"url": "https://drone.f-brinker.de/fbrinker/elderscrolls-addon-achievementInfo/"
|
||||
}
|
||||
{
|
||||
"url": "https://drone.f-brinker.de/fbrinker/elderscrolls-addon-achievementInfo/"
|
||||
}
|
@ -12,12 +12,11 @@ read_globals = {
|
||||
"GetCVar",
|
||||
"GetNumAchievementCategories",
|
||||
"GetPreviousAchievementInLine",
|
||||
"CHAT_SYSTEM",
|
||||
"CHAT_SYSTEM",
|
||||
"EVENT_ACHIEVEMENT_UPDATED",
|
||||
"EVENT_ADD_ON_LOADED",
|
||||
"EVENT_MANAGER",
|
||||
"LibStub",
|
||||
"LINK_STYLE_BRACKET",
|
||||
"EVENT_MANAGER",
|
||||
"LINK_STYLE_BRACKET",
|
||||
"zo_callLater",
|
||||
"ZO_SavedVars",
|
||||
}
|
@ -8,10 +8,9 @@
|
||||
## APIVersion: 100029
|
||||
## SavedVariables: ACHIEVEMENT_INFO_DB
|
||||
|
||||
## OptionalDependsOn: LibAddonMenu-2.0, LibStub
|
||||
## OptionalDependsOn: LibAddonMenu-2.0
|
||||
|
||||
## Libraries:
|
||||
Libs/LibStub/LibStub.lua
|
||||
Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
|
||||
|
||||
## Helper:
|
||||
|
@ -46,8 +46,6 @@ end
|
||||
|
||||
-- Function to create the settings panel
|
||||
function AchievementInfo.createSettingsPanel()
|
||||
local LAM = LibStub("LibAddonMenu-2.0")
|
||||
|
||||
local panelData = {
|
||||
type = "panel",
|
||||
name = AchievementInfo.name,
|
||||
@ -151,8 +149,8 @@ function AchievementInfo.createSettingsPanel()
|
||||
})
|
||||
|
||||
-- Register
|
||||
LAM:RegisterAddonPanel(AchievementInfo.name.."SettingsPanel", panelData)
|
||||
LAM:RegisterOptionControls(AchievementInfo.name.."SettingsPanel", optionsTable)
|
||||
LibAddonMenu2:RegisterAddonPanel(AchievementInfo.name.."SettingsPanel", panelData)
|
||||
LibAddonMenu2:RegisterOptionControls(AchievementInfo.name.."SettingsPanel", optionsTable)
|
||||
end
|
||||
|
||||
|
||||
|
@ -1,5 +1,9 @@
|
||||
#### Notable Changes
|
||||
|
||||
##### Release 2.24
|
||||
* Updated Dependencies
|
||||
* Removed LibStub Usage
|
||||
|
||||
##### Release 2.20
|
||||
* Now all the new achievement categories are enabled by default in the settings panel
|
||||
|
||||
|
@ -1,119 +0,0 @@
|
||||
local panelData = {
|
||||
type = "panel",
|
||||
name = "Window Title",
|
||||
displayName = "Longer Window Title",
|
||||
author = "Seerah",
|
||||
version = "1.3",
|
||||
slashCommand = "/myaddon", --(optional) will register a keybind to open to this panel
|
||||
registerForRefresh = true, --boolean (optional) (will refresh all options controls when a setting is changed and when the panel is shown)
|
||||
registerForDefaults = true, --boolean (optional) (will set all options controls back to default values)
|
||||
}
|
||||
|
||||
local optionsTable = {
|
||||
[1] = {
|
||||
type = "header",
|
||||
name = "My Header",
|
||||
width = "full", --or "half" (optional)
|
||||
},
|
||||
[2] = {
|
||||
type = "description",
|
||||
--title = "My Title", --(optional)
|
||||
title = nil, --(optional)
|
||||
text = "My description text to display. blah blah blah blah blah blah blah - even more sample text!!",
|
||||
width = "full", --or "half" (optional)
|
||||
},
|
||||
[3] = {
|
||||
type = "dropdown",
|
||||
name = "My Dropdown",
|
||||
tooltip = "Dropdown's tooltip text.",
|
||||
choices = {"table", "of", "choices"},
|
||||
getFunc = function() return "of" end,
|
||||
setFunc = function(var) print(var) end,
|
||||
width = "half", --or "half" (optional)
|
||||
warning = "Will need to reload the UI.", --(optional)
|
||||
},
|
||||
[4] = {
|
||||
type = "dropdown",
|
||||
name = "My Dropdown",
|
||||
tooltip = "Dropdown's tooltip text.",
|
||||
choices = {"table", "of", "choices"},
|
||||
getFunc = function() return "of" end,
|
||||
setFunc = function(var) print(var) end,
|
||||
width = "half", --or "half" (optional)
|
||||
warning = "Will need to reload the UI.", --(optional)
|
||||
},
|
||||
[5] = {
|
||||
type = "slider",
|
||||
name = "My Slider",
|
||||
tooltip = "Slider's tooltip text.",
|
||||
min = 0,
|
||||
max = 20,
|
||||
step = 1, --(optional)
|
||||
getFunc = function() return 3 end,
|
||||
setFunc = function(value) d(value) end,
|
||||
width = "half", --or "half" (optional)
|
||||
default = 5, --(optional)
|
||||
},
|
||||
[6] = {
|
||||
type = "button",
|
||||
name = "My Button",
|
||||
tooltip = "Button's tooltip text.",
|
||||
func = function() d("button pressed!") end,
|
||||
width = "half", --or "half" (optional)
|
||||
warning = "Will need to reload the UI.", --(optional)
|
||||
},
|
||||
[7] = {
|
||||
type = "submenu",
|
||||
name = "Submenu Title",
|
||||
tooltip = "My submenu tooltip", --(optional)
|
||||
controls = {
|
||||
[1] = {
|
||||
type = "checkbox",
|
||||
name = "My Checkbox",
|
||||
tooltip = "Checkbox's tooltip text.",
|
||||
getFunc = function() return true end,
|
||||
setFunc = function(value) d(value) end,
|
||||
width = "half", --or "half" (optional)
|
||||
warning = "Will need to reload the UI.", --(optional)
|
||||
},
|
||||
[2] = {
|
||||
type = "colorpicker",
|
||||
name = "My Color Picker",
|
||||
tooltip = "Color Picker's tooltip text.",
|
||||
getFunc = function() return 1, 0, 0, 1 end, --(alpha is optional)
|
||||
setFunc = function(r,g,b,a) print(r, g, b, a) end, --(alpha is optional)
|
||||
width = "half", --or "half" (optional)
|
||||
warning = "warning text",
|
||||
},
|
||||
[3] = {
|
||||
type = "editbox",
|
||||
name = "My Editbox",
|
||||
tooltip = "Editbox's tooltip text.",
|
||||
getFunc = function() return "this is some text" end,
|
||||
setFunc = function(text) print(text) end,
|
||||
isMultiline = false, --boolean
|
||||
width = "half", --or "half" (optional)
|
||||
warning = "Will need to reload the UI.", --(optional)
|
||||
default = "", --(optional)
|
||||
},
|
||||
},
|
||||
},
|
||||
[8] = {
|
||||
type = "custom",
|
||||
reference = "MyAddonCustomControl", --unique name for your control to use as reference
|
||||
refreshFunc = function(customControl) end, --(optional) function to call when panel/controls refresh
|
||||
width = "half", --or "half" (optional)
|
||||
},
|
||||
[9] = {
|
||||
type = "texture",
|
||||
image = "EsoUI\\Art\\ActionBar\\abilityframe64_up.dds",
|
||||
imageWidth = 64, --max of 250 for half width, 510 for full
|
||||
imageHeight = 64, --max of 100
|
||||
tooltip = "Image's tooltip text.", --(optional)
|
||||
width = "half", --or "half" (optional)
|
||||
},
|
||||
}
|
||||
|
||||
local LAM = LibStub("LibAddonMenu-2.0")
|
||||
LAM:RegisterAddonPanel("MyAddon", panelData)
|
||||
LAM:RegisterOptionControls("MyAddon", optionsTable)
|
Завантаження…
Посилання в новій задачі
Block a user