-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathinit.lua
95 lines (81 loc) · 1.94 KB
/
init.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
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
-- Lua
local _G = getfenv(0)
local unpack = _G.unpack
-- Libs
local AceConfig = LibStub("AceConfig-3.0")
local AceConfigDialog = LibStub("AceConfigDialog-3.0")
local LibKeyBound = LibStub("LibKeyBound-1.0")
-- Mine
local E, M, L, C, D, PrC, PrD, P, oUF, CONFIG = unpack(ls_UI)
local isInit = false
function CONFIG:Open()
if not isInit then
self.options = {
type = "group",
name = L["LS_UI"],
disabled = function()
return InCombatLockdown()
end,
args = {
toggle_anchors = {
order = 2,
type = "execute",
name = L["TOGGLE_ANCHORS"],
width = 1.25,
func = function()
E.Movers:ToggleAll(true)
AceConfigDialog:Close("ls_UI")
end,
},
keybind_mode = {
order = 3,
type = "execute",
name = LibKeyBound.L.BindingMode,
width = 1.25,
func = function()
LibKeyBound:Toggle()
end,
},
reload_ui = {
order = 4,
type = "execute",
name = L["RELOAD_UI"],
width = 1.25,
func = function()
ReloadUI()
end,
},
profiles = CONFIG:CreateProfilesPanel(100),
about = CONFIG:CreateAboutPanel(101),
},
}
CONFIG:GetGeneralOptions(5)
CONFIG:CreateActionBarsOptions(6)
CONFIG:CreateAuraTrackerOptions(7)
CONFIG:CreateBlizzardOptions(8)
CONFIG:CreateAurasOptions(9)
CONFIG:CreateMinimapOptions(11)
CONFIG:GetTooltipsOptions(12)
CONFIG:CreateUnitFramesOptions(13)
AceConfig:RegisterOptionsTable("ls_UI", self.options)
AceConfigDialog:SetDefaultSize("ls_UI", 1228, 768)
P:AddCommand("kb", function()
if not InCombatLockdown() then
LibKeyBound:Toggle()
end
end)
E:RegisterEvent("PLAYER_REGEN_DISABLED", function()
AceConfigDialog:Close("ls_UI")
end)
CONFIG:RunCallbacks()
isInit = true
end
AceConfigDialog:Open("ls_UI")
local frame = AceConfigDialog.OpenFrames.ls_UI
if frame then
frame:SetCallback("OnRelease", CONFIG.ShouldReloadUI)
end
end
function CONFIG:IsLoaded()
return true
end