-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptions.lua
More file actions
142 lines (137 loc) · 5.92 KB
/
Options.lua
File metadata and controls
142 lines (137 loc) · 5.92 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
local addonName, ns = ...
local E = ns.E
local WUI = ns.WUI
local function reloadPrompt()
if E and E.StaticPopup_Show then
E:StaticPopup_Show("PRIVATE_RL")
elseif StaticPopup_Show then
StaticPopup_Show("CONFIRM_RELOAD_UI")
end
end
-- Builds the Wick's UI option group under ElvUI → Plugins. Called by ElvUI
-- via EP:RegisterPlugin(addonName, ns.AddOptions) — see Init.lua.
function ns.AddOptions()
if not (E and E.Options and E.Options.args) then return end
E.Options.args.WicksUI = {
order = 100,
type = "group",
name = WUI.title,
childGroups = "tab",
args = {
header = {
order = 1,
type = "header",
name = ("Wick's UI v%s — theme for ElvUI"):format(WUI.version or "0.1.0"),
},
description = {
order = 2,
type = "description",
name = "Wick brand palette + 10/2 fel-green L-bracket chrome on ElvUI panels. Brackets apply automatically; the palette is opt-in via the button below (writes to your current ElvUI profile and prompts a reload).",
fontSize = "medium",
},
brackets = {
order = 10,
type = "group",
name = "Brackets",
inline = true,
args = {
enabled = {
order = 1,
type = "toggle",
name = "Show L-brackets",
desc = "Adds 10x2 fel-green L-shaped corner brackets to the chat, datatext, and minimap panels.",
get = function() return WUI.db.brackets.enabled end,
set = function(_, v)
WUI.db.brackets.enabled = v
if v then
ns.Brackets:ApplyAll()
else
ns.Brackets:RemoveAll()
end
end,
},
size = {
order = 2,
type = "range",
name = "Arm length",
desc = "Length of each L-bracket arm in pixels.",
min = 4, max = 24, step = 1,
get = function() return WUI.db.brackets.size end,
set = function(_, v)
WUI.db.brackets.size = v
ns.Brackets:RemoveAll()
if WUI.db.brackets.enabled then ns.Brackets:ApplyAll() end
end,
},
thickness = {
order = 3,
type = "range",
name = "Arm thickness",
desc = "Thickness of each L-bracket arm in pixels.",
min = 1, max = 6, step = 1,
get = function() return WUI.db.brackets.thickness end,
set = function(_, v)
WUI.db.brackets.thickness = v
ns.Brackets:RemoveAll()
if WUI.db.brackets.enabled then ns.Brackets:ApplyAll() end
end,
},
reapply = {
order = 4,
type = "execute",
name = "Re-apply brackets",
desc = "Re-attach brackets after a profile change or panel layout swap.",
func = function()
ns.Brackets:RemoveAll()
if WUI.db.brackets.enabled then ns.Brackets:ApplyAll() end
end,
},
},
},
theme = {
order = 20,
type = "group",
name = "Palette",
inline = true,
args = {
status = {
order = 1,
type = "description",
name = function()
if WUI.db.theme.applied then
return "|cff4FC778Wick palette is applied to this profile.|r"
else
return "|cffD4C8A1Wick palette has not been applied to this profile.|r"
end
end,
fontSize = "medium",
},
apply = {
order = 2,
type = "execute",
name = "Apply Wick palette",
desc = "Writes the locked Wick palette (border, backdrop, accent) and the flat 'ElvUI Norm' statusbar texture into your current ElvUI profile, then prompts a UI reload.",
func = function()
if ns.Theme:Apply() then
WUI:Print("Wick palette applied. Reload to finish.")
reloadPrompt()
end
end,
},
revert = {
order = 3,
type = "execute",
name = "Revert palette",
desc = "Restores ElvUI's default border / backdrop / accent colors. Other settings are left untouched.",
func = function()
if ns.Theme:Revert() then
WUI:Print("Reverted to ElvUI defaults. Reload to finish.")
reloadPrompt()
end
end,
},
},
},
},
}
end