forked from m00nyONE/HodorReflexes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHodorReflexes.lua
More file actions
99 lines (86 loc) · 3.24 KB
/
HodorReflexes.lua
File metadata and controls
99 lines (86 loc) · 3.24 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
-- SPDX-FileCopyrightText: 2025 m00nyONE
-- SPDX-License-Identifier: Artistic-2.0
--[[ doc.lua begin ]]
--- @class HodorReflexes
local addon = {
name = "HodorReflexes",
friendlyName = "Hodor Reflexes",
slashCmd = "hodor",
version = "dev",
author = "|cFFFF00@andy.s|r, |c76c3f4@m00nyONE|r",
debug = false,
extensions = {},
modules = {},
internal = {
core = {
svName = "HodorReflexesSavedVars",
svVersion = 2,
sv = nil, -- per character saved variables
sw = nil, -- global accountwide saved variables
svDefault = {
accountWide = true,
enableExperimentalFeatures = false,
extensions = {
["seasons"] = true,
["names"] = true,
["icons"] = true,
["animations"] = true,
},
modules = {
["readycheck"] = true,
["exitinstance"] = true,
["pull"] = true,
["skilllines"] = true,
["dps"] = true,
["ult"] = true,
["hideme"] = true,
},
libraryPopupDisabled = false,
enableTestTick = true, -- this is not toggleable via the settings atm. only for dev purposes
}
},
registeredLists = {}, -- list of all registered lists
extensionClass = {}, -- will be set later
moduleClass = {}, -- will be set later
},
}
local addon_name = addon.name
local internal = addon.internal
local core = internal.core
_G[addon_name] = addon
local EM = GetEventManager()
local CM = ZO_CallbackObject:New()
core.CM = CM -- make the callback manager available to other parts of the addon
-- initialize addon
local function initialize()
core.logger.main:Debug("version: %s", addon.version)
core.logger.main:Debug("svVersion: %d", core.svVersion)
-- we use a combination of accountWide saved variables and per character saved variables. This little swappi swappi allows us to switch between them without defining new variables
core.sw = ZO_SavedVars:NewAccountWide(core.svName, core.svVersion, nil, core.svDefault)
if not core.sw.accountWide then
core.sv = ZO_SavedVars:NewCharacterIdSettings(core.svName, core.svVersion, nil, core.svDefault)
core.sw.accountWide = false
else
core.sv = core.sw
end
core.RegisterLGBHandler()
core.RegisterCoreEvents()
core.RegisterCoreCommands()
core.InitializeCombat()
core.InitializeModules()
core.InitializeExtensions()
core.BuildMenu()
EM:RegisterForEvent(addon_name .. "_LIB_CHECK", EVENT_PLAYER_ACTIVATED, function()
EM:UnregisterForEvent(addon_name .. "_LIB_CHECK", EVENT_PLAYER_ACTIVATED)
core.OptionalLibrariesCheck()
end)
addon.internal = nil
end
EM:RegisterForEvent(addon_name, EVENT_ADD_ON_LOADED, function(_, name)
if name ~= addon_name then return end
EM:UnregisterForEvent(addon_name, EVENT_ADD_ON_LOADED)
local beginTime = GetGameTimeMilliseconds()
initialize()
core.logger.main:Debug("initialized in %d ms", GetGameTimeMilliseconds() - beginTime)
end)
--[[ doc.lua end ]]