forked from aim2kill/FishingBuddy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFishingBuddyTitan.lua
executable file
·64 lines (53 loc) · 1.89 KB
/
FishingBuddyTitan.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
-- Titan Panel support
FishingBuddy.Titan = {};
FishingBuddy.Titan.OnLoad = function()
if not TitanPanelButton_UpdateButton then
return;
end
this.registry = {
id = FishingBuddy.ID,
menuText = FishingBuddy.NAME,
version = FishingBuddy.VERSION,
category = "Profession",
icon = "Interface\\AddOns\\FishingBuddy\\Icons\\Fishing-Icon",
iconWidth = 16,
tooltipTitle = FishingBuddy.NAME,
tooltipTextFunction = "TitanPanelFishingBuddyButton_GetTooltipText",
savedVariables = {
ShowIcon = 1,
}
};
this:RegisterEvent("PLAYER_ENTERING_WORLD");
end
FishingBuddy.Titan.OnClick = function(button)
if (button == "LeftButton") then
if (FishingBuddy.GetSetting("TitanClickToSwitch") == 1) then
FishingBuddy.Command(FishingBuddy.SWITCH);
else
FishingBuddy.Command("");
end
end
end
FishingBuddy.Titan.OnEvent = function()
if TitanPanelButton_UpdateButton then
TitanPanelButton_UpdateButton(FishingBuddy.ID);
TitanPanelButton_UpdateTooltip();
end
end
function TitanPanelFishingBuddyButton_GetTooltipText()
local text = FishingBuddy.DESCRIPTION1.."\n"..FishingBuddy.DESCRIPTION2.."\n";
if (FishingBuddy.GetSetting("TitanClickToSwitch") == 1) then
text = text..TitanUtils_GetGreenText(FishingBuddy.TOOLTIP_HINTSWITCH);
else
text = text..TitanUtils_GetGreenText(FishingBuddy.TOOLTIP_HINTTOGGLE);
end
return text;
end
function TitanPanelRightClickMenu_PrepareFishingBuddyMenu()
TitanPanelRightClickMenu_AddTitle(TitanPlugins[FishingBuddy.ID].menuText);
FishingBuddy.MakeDropDown(FishingBuddy.TITAN_CLICKTOSWITCH_ONOFF, "TitanClickToSwitch");
TitanPanelRightClickMenu_AddSpacer();
TitanPanelRightClickMenu_AddCommand(TITAN_PANEL_MENU_HIDE,
FishingBuddy.ID,
TITAN_PANEL_MENU_FUNC_HIDE);
end