-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMBFTitan.lua
74 lines (59 loc) · 1.96 KB
/
MBFTitan.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
64
65
66
67
68
69
70
71
72
73
74
-- Do not load if Titan Bar is not loaded
if not IsAddOnLoaded("Titan") then
return
end
TITAN_MBF_ID = "MBF";
TITAN_MBF_FREQUENCY = 1;
MBF_LOCALE = {
menu = "Minimap Button Frame",
tooltip = "Minimap Button Frame",
button = "MBF"
};
MBF_TITAN_HINT = "|cff1eff00Left-Click|r to Hide/Show the frame\n|cff1eff00Shift-click|r to show the config screen";
function TitanPanelMBFButton_OnLoad()
-- register plugin
this.registry = {
id = TITAN_MBF_ID,
menuText = MBF_LOCALE["menu"],
buttonTextFunction = "TitanPanelMBFButton_GetButtonText",
tooltipTitle = MBF_LOCALE["tooltip"],
tooltipTextFunction = "TitanPanelMBFButton_GetTooltipText",
category = "Interface",
frequency = TITAN_MBF_FREQUENCY,
icon = "Interface\\Icons\\INV_Misc_Coin_11",
iconWidth = 16,
savedVariables = {
ShowIcon = 1,
ShowLabelText = 1,
ShowColoredText = 1
}
};
TitanPanelMBFButtonIcon:SetVertexColor(1, 1, 0);
end
function TitanPanelMBFButton_GetButtonText(id)
local retstr = "";
-- supports turning off labels
if (TitanGetVar(TITAN_MBF_ID, "ShowLabelText")) then
if (TitanGetVar(TITAN_MBF_ID, "ShowColoredText")) then
retstr = TitanUtils_GetGreenText(MBF_LOCALE["button"]);
else
retstr = TitanUtils_GetNormalText(MBF_LOCALE["button"]);
end
end
if ((mbfHidden == true) and ((grabMBFButton == true) or (minimapButton == false)) and (activeScanning == true))then
MBF_Scan();
end
return retstr;
end
function TitanPanelMBFButton_GetTooltipText()
return MBF_TITAN_HINT;
end
function TitanPanelRightClickMenu_PrepareMBFMenu()
TitanPanelRightClickMenu_AddTitle(TitanPlugins[TITAN_MBF_ID].menuText);
TitanPanelRightClickMenu_AddSpacer();
TitanPanelRightClickMenu_AddToggleIcon(TITAN_MBF_ID);
TitanPanelRightClickMenu_AddToggleLabelText(TITAN_MBF_ID);
TitanPanelRightClickMenu_AddToggleColoredText(TITAN_MBF_ID);
TitanPanelRightClickMenu_AddSpacer();
TitanPanelRightClickMenu_AddCommand(TITAN_PANEL_MENU_HIDE, TITAN_MBF_ID, TITAN_PANEL_MENU_FUNC_HIDE);
end