Commit eb731b51 authored by Azilroka's avatar Azilroka
Browse files

Tags

parent 3227a52d
......@@ -1273,8 +1273,15 @@ E.TagInfo = {
['threat'] = { category = 'Threat', description = "Displays the current threat situation (Aggro is secure tanking, -- is losing threat and ++ is gaining threat)" },
}
--[[
tagName = Tag Name
category = Category that you want it to fall in
description = self explainitory
order = This is optional. It's used for sorting the tags by order and not by name. The +10 is not a rule. I reserve the first 10 slots.
]]
function E:AddTagInfo(tagName, category, description, order)
if order then order = tonumber(order) + 10 end
if type(order) == 'number' then order = order + 10 else order = nil end
E.TagInfo[tagName] = E.TagInfo[tagName] or {}
E.TagInfo[tagName].category = category or 'Miscellaneous'
......
......@@ -5,13 +5,16 @@ local ACH = E.Libs.ACH
local _G = _G
local format = format
E.Options.args.tagGroup = ACH:Group(L["Available Tags"], nil, 3, 'tab')
E.Options.args.tagGroup.args.GuideLink = ACH:Input(L["Guide:"], nil, 1, nil, nil, function() return "https://www.tukui.org/forum/viewtopic.php?f=9&t=6" end)
E.Options.args.tagGroup = ACH:Group(L["Available Tags"], nil, 3)
E.Options.args.tagGroup.args.GuideLink = ACH:Input(L["Guide:"], nil, 1, nil, nil, function() return 'https://www.tukui.org/forum/viewtopic.php?f=9&t=6' end)
E.Options.args.tagGroup.args.GuideLink.customWidth = 310
E.Options.args.tagGroup.args.WikiLink = ACH:Input(L["Wiki:"], nil, 2, nil, nil, function() return "https://git.tukui.org/elvui/elvui/-/wikis/home" end)
E.Options.args.tagGroup.args.WikiLink = ACH:Input(L["Wiki:"], nil, 2, nil, nil, function() return 'https://git.tukui.org/elvui/elvui/-/wikis/home' end)
E.Options.args.tagGroup.args.WikiLink.customWidth = 290
E.Options.args.tagGroup.args.ColorWheel = ACH:Execute(L["Color Picker"], nil, 3, function() _G.ColorPickerFrame:Show() _G.ColorPickerFrame:SetFrameStrata("FULLSCREEN_DIALOG") _G.ColorPickerFrame:SetClampedToScreen(true) _G.ColorPickerFrame:Raise() end)
E.Options.args.tagGroup.args.ColorWheel = ACH:Execute(L["Color Picker"], nil, 3, function() _G.ColorPickerFrame:Show() _G.ColorPickerFrame:SetFrameStrata('FULLSCREEN_DIALOG') _G.ColorPickerFrame:SetClampedToScreen(true) _G.ColorPickerFrame:Raise() end)
E.Options.args.tagGroup.args.ColorWheel.customWidth = 120
E.Options.args.tagGroup.args.description = ACH:Description('This is for information. This will not change the tags in the UI.', 4, 'large')
E.Options.args.tagGroup.args.spacer = ACH:Spacer(5)
E.Options.args.tagGroup.args.Colors = ACH:Group(L["Colors"])
E.Options.args.tagGroup.args.Colors.args.customTagColorInfo = ACH:Input('Custom color your Text: replace the XXXXXX with a Hex color code', nil, 1, nil, 'full', function() return '||cffXXXXXX [tags] or text here ||r' end)
E.Options.args.tagGroup.args.Names = ACH:Group(L["Names"])
......@@ -25,22 +28,18 @@ local getTag = function(info) return format('[%s]', info[#info]) end
for _, Table in pairs({'Events', 'Methods'}) do
for Tag in next, E.oUF.Tags[Table] do
if not E.TagInfo[Tag] then
E:AddTagInfo(Tag, 'Miscellaneous')
--E:Print("['"..Tag.."'] = { category = 'Miscellaneous', description = '' }")
end
if not E.TagInfo[Tag] then E:AddTagInfo(Tag, 'Miscellaneous') end
if not E.Options.args.tagGroup.args[E.TagInfo[Tag].category] then
E.Options.args.tagGroup.args[E.TagInfo[Tag].category] = {
type = "group",
name = E.TagInfo[Tag].category,
type = 'group',
args = {}
}
end
E.Options.args.tagGroup.args[E.TagInfo[Tag].category].args[Tag] = E.Options.args.tagGroup.args[E.TagInfo[Tag].category].args[Tag] or {}
E.Options.args.tagGroup.args[E.TagInfo[Tag].category].args[Tag].type = "input"
E.Options.args.tagGroup.args[E.TagInfo[Tag].category].args[Tag].name = E.TagInfo[Tag].description
E.Options.args.tagGroup.args[E.TagInfo[Tag].category].args[Tag].type = 'input'
E.Options.args.tagGroup.args[E.TagInfo[Tag].category].args[Tag].name = E.TagInfo[Tag].description ~= '' and E.TagInfo[Tag].description or getTag
E.Options.args.tagGroup.args[E.TagInfo[Tag].category].args[Tag].order = E.TagInfo[Tag].order or nil
E.Options.args.tagGroup.args[E.TagInfo[Tag].category].args[Tag].width = 'full'
E.Options.args.tagGroup.args[E.TagInfo[Tag].category].args[Tag].get = getTag
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment