-
Notifications
You must be signed in to change notification settings - Fork 0
/
se_core.lua
50 lines (41 loc) · 1.36 KB
/
se_core.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
SimpleExtension = {
SE_MAJOR = 1,
SE_MINOR = 1,
SE_NAME = "SimpleExtensions",
SE_PANEL = "SimpleExtensionsPanel",
SE_VERSION = "1.1",
SE_WEBSITE = "https://github.com/pcastellazzi/simpleextensions",
_controls = {{ type = "custom" }},
_extensions = {},
_lam = LibStub("LibAddonMenu-2.0"),
_settings = {},
Base = ZO_Object:Subclass(),
}
function SimpleExtension.Create(name, version)
local extension = ZO_Object.MultiSubclass(SimpleExtension.Base)
extension.SE_NAME = name
extension.SE_VERSION = version
table.insert(SimpleExtension._extensions, extension)
return extension
end
function SimpleExtension.Execute()
SimpleExtension._settings = ZO_SavedVars:NewAccountWide(
SimpleExtension.SE_NAME, SimpleExtension.SE_MAJOR, nil, {})
SimpleExtension._lam:RegisterAddonPanel(SimpleExtension.SE_PANEL, {
type = "panel",
name = "Simple Extensions",
displayName = "Simple Extensions",
author = "CastePablo",
version = SimpleExtension.SE_VERSION,
website = SimpleExtension.SE_WEBSITE,
})
for _, extension in ipairs(SimpleExtension._extensions) do
local e = extension:New()
if e:isEnabled() then
e:Run()
_G[e.SE_NAME] = e
end
end
SimpleExtension._lam:RegisterOptionControls(
SimpleExtension.SE_PANEL, SimpleExtension._controls)
end