-
Notifications
You must be signed in to change notification settings - Fork 4
/
Options.lua
63 lines (59 loc) · 1.43 KB
/
Options.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
---@class AddonNamespace
local addon = select(2, ...)
local AceAddon = LibStub("AceAddon-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("TankMD")
addon.defaultProfile = {
profile = {
tankSelectionMethod = "tankRoleOnly",
prioritizeFocus = false,
},
}
---@type AceConfig.OptionsTable
addon.optionsTable = {
name = L.title,
type = "group",
childGroups = "tab",
order = 1,
get = function(info)
return addon.db.profile[info[#info]]
end,
set = function(info, value)
addon.db.profile[info[#info]] = value
local TankMD = AceAddon:GetAddon("TankMD")
---@cast TankMD TankMD
TankMD:QueueButtonTargetUpdate()
end,
args = {
general = {
type = "group",
name = L.general,
order = 1,
args = {
tankSelectionMethod = {
type = "select",
name = L.tank_selection_method,
order = 1,
width = "full",
values = {
tankRoleOnly = L.tank_role_only,
tanksAndMainTanks = L.tanks_and_main_tanks,
prioritizeMainTanks = L.prioritize_main_tanks,
mainTanksOnly = L.main_tanks_only,
},
sorting = { "tankRoleOnly", "tanksAndMainTanks", "prioritizeMainTanks", "mainTanksOnly" },
disabled = function()
local _, class = UnitClass("player")
return class ~= "HUNTER" and class ~= "ROGUE"
end,
},
prioritizeFocus = {
type = "toggle",
name = L.prioritize_focus,
desc = L.prioritize_focus_desc,
order = 2,
width = "full",
}
},
},
},
}