-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptions.lua
More file actions
97 lines (83 loc) · 2.62 KB
/
Options.lua
File metadata and controls
97 lines (83 loc) · 2.62 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
assert(KGB, "KGB not found!")
local AceLocale = AceLibrary("AceLocale-2.1")
------------------------------
-- Are you local? --
------------------------------
AceLocale:RegisterTranslation("KGBOptions", "enUS", function()
return {
["AA"] = "GG"
}
end)
AceLocale:RegisterTranslation("KGBOptions", "enGB", function()
return {
["AA"] = "GG"
}
end)
AceLocale:RegisterTranslation("KGBOptions", "frFR", function()
return {
["AA"] = "GG"
}
end)
AceLocale:RegisterTranslation("KGBOptions", "deDE", function()
return {
["AA"] = "GG"
}
end)
local L = AceLibrary("AceLocale-2.1"):GetInstance("KGBOptions", true)
local tablet = AceLibrary("Tablet-2.0")
KGBOptions = AceLibrary("AceAddon-2.0"):new("AceEvent-2.0", "AceConsole-2.0", "AceDB-2.0", "FuBarPlugin-2.0")
local deuce = KGB:NewModule("KGB Options Menu")
deuce.hasFuBar = IsAddOnLoaded("FuBar") and FuBar
deuce.consoleCmd = not deuce.hasFuBar and "Minimap"
deuce.consoleOptions = not deuce.hasFuBar and {
type = "toggle",
name = "Minimap",
desc = "Toggle Minimap",
get = function() return KGBOptions.minimapFrame and KGBOptions.minimapFrame:IsVisible() or false end,
set = function(v)
if v then
KGBOptions:Show()
else
KGBOptions:Hide()
end
end,
map = {[false] = "hidden", [true] = "shown"},
message = "%s icon is now %s.",
hidden = function() return deuce.hasFuBar end,
}
KGBOptions.name = "FuBar - KGB"
KGBOptions:RegisterDB("KGBOptionsFubarDB")
KGBOptions.hasNoColor = true
KGBOptions.hasIcon = "Interface\\Icons\\spell_shadow_shadowworddominate"
KGBOptions.lockMinimap = true
KGBOptions.defaultMinimapPosition = 180
KGBOptions.clickableTooltip = true
KGBOptions.hideWithoutStandby = true
KGBOptions.OnMenuRequest = KGB.options
local args = AceLibrary("FuBarPlugin-2.0"):GetAceOptionsDataTable(KGBOptions)
for k,v in pairs(args) do
if KGBOptions.OnMenuRequest.args[k] == nil then
KGBOptions.OnMenuRequest.args[k] = v
end
end
-----------------------------
-- Icon Handling --
-----------------------------
function KGBOptions:OnEnable()
self:RegisterEvent("KGB_Enabled", "OnStateChange")
self:RegisterEvent("KGB_Disabled", "OnStateChange")
self:RegisterEvent("KGB_OnTooltipUpdate", "UpdateTooltip")
self:OnStateChange()
end
function KGBOptions:OnStateChange()
self:SetIcon("Interface\\Icons\\spell_shadow_shadowworddominate")
self:UpdateTooltip()
end
-----------------------------
-- FuBar Methods --
-----------------------------
function KGBOptions:OnTooltipUpdate()
KGB:TooltipUpdate(tablet)
end
function KGBOptions:OnClick()
end