-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMenu.lua
More file actions
55 lines (44 loc) · 1.83 KB
/
Copy pathMenu.lua
File metadata and controls
55 lines (44 loc) · 1.83 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
local _, addon = ...
local menu = {}
addon.Menu = menu
local menuBuilder
function menu.RefreshBroker()
addon.LDB:Update()
end
function menu.Init()
menuBuilder = addon.MenuBuilder:New({
uniqueTag = addon.Metadata.Prefix .. '_RIGHT_CLICK_MENU_OPTIONS',
callbacks = {
OnCheckboxSelect = function(filters, keys)
addon.Util.WriteNestedKeys(filters, keys, not menuBuilder:KeyIsTrue(filters, keys))
menu.RefreshBroker()
end,
OnRadioSelect = function(filters, keys, value)
addon.Util.WriteNestedKeys(filters, keys, value)
menu.RefreshBroker()
end
}
})
end
local function CreateMenu(menuObj, caller)
menuBuilder:CreateTitle(menuObj, addon.Metadata.Title .. ' ' .. addon.Metadata.Version)
menuBuilder:CreateDivider(menuObj)
local timeFormat = menuBuilder:CreateSubmenuButton(menuObj, addon.L['Format'])
menuBuilder:CreateRadio(timeFormat, addon.L['12 Hour'], KrowiBTI_Options, {'TimeFormat'}, '12H')
menuBuilder:CreateRadio(timeFormat, addon.L['24 Hour'], KrowiBTI_Options, {'TimeFormat'}, '24H')
menuBuilder:AddChildMenu(menuObj, timeFormat)
local timeMode = menuBuilder:CreateSubmenuButton(menuObj, addon.L['Display Mode'])
menuBuilder:CreateRadio(timeMode, addon.L['Local Time'], KrowiBTI_Options, {'TimeMode'}, 'Local')
menuBuilder:CreateRadio(timeMode, addon.L['Server Time'], KrowiBTI_Options, {'TimeMode'}, 'Server')
menuBuilder:CreateRadio(timeMode, addon.L['Both'], KrowiBTI_Options, {'TimeMode'}, 'Both')
menuBuilder:AddChildMenu(menuObj, timeMode)
menuBuilder:CreateCheckbox(menuObj, addon.L['Show Seconds'], KrowiBTI_Options, {'ShowSeconds'})
menu.CreateElvUIOptionsMenu(menuBuilder, menuObj, caller)
menu.CreateTitanOptionsMenu(menuBuilder, menuObj, caller)
end
function menu.ShowPopup(caller)
menuBuilder:ShowPopup(function()
local menuObj = menuBuilder:GetMenu()
CreateMenu(menuObj, caller)
end)
end