vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | -- Titan Panel support |
2 | |||
3 | FishingBuddy.Titan = {}; |
||
4 | |||
5 | FishingBuddy.Titan.OnLoad = function() |
||
6 | if not TitanPanelButton_UpdateButton then |
||
7 | return; |
||
8 | end |
||
9 | |||
10 | this.registry = { |
||
11 | id = FishingBuddy.ID, |
||
12 | menuText = FishingBuddy.NAME, |
||
13 | version = FishingBuddy.VERSION, |
||
14 | category = "Profession", |
||
15 | icon = "Interface\\AddOns\\FishingBuddy\\Icons\\Fishing-Icon", |
||
16 | iconWidth = 16, |
||
17 | tooltipTitle = FishingBuddy.NAME, |
||
18 | tooltipTextFunction = "TitanPanelFishingBuddyButton_GetTooltipText", |
||
19 | savedVariables = { |
||
20 | ShowIcon = 1, |
||
21 | } |
||
22 | }; |
||
23 | |||
24 | this:RegisterEvent("PLAYER_ENTERING_WORLD"); |
||
25 | end |
||
26 | |||
27 | FishingBuddy.Titan.OnClick = function(button) |
||
28 | if (button == "LeftButton") then |
||
29 | if (FishingBuddy.GetSetting("TitanClickToSwitch") == 1) then |
||
30 | FishingBuddy.Command(FishingBuddy.SWITCH); |
||
31 | else |
||
32 | FishingBuddy.Command(""); |
||
33 | end |
||
34 | end |
||
35 | end |
||
36 | |||
37 | FishingBuddy.Titan.OnEvent = function() |
||
38 | if TitanPanelButton_UpdateButton then |
||
39 | TitanPanelButton_UpdateButton(FishingBuddy.ID); |
||
40 | TitanPanelButton_UpdateTooltip(); |
||
41 | end |
||
42 | end |
||
43 | |||
44 | function TitanPanelFishingBuddyButton_GetTooltipText() |
||
45 | local text = FishingBuddy.DESCRIPTION1.."\n"..FishingBuddy.DESCRIPTION2.."\n"; |
||
46 | if (FishingBuddy.GetSetting("TitanClickToSwitch") == 1) then |
||
47 | text = text..TitanUtils_GetGreenText(FishingBuddy.TOOLTIP_HINTSWITCH); |
||
48 | else |
||
49 | text = text..TitanUtils_GetGreenText(FishingBuddy.TOOLTIP_HINTTOGGLE); |
||
50 | end |
||
51 | return text; |
||
52 | end |
||
53 | |||
54 | function TitanPanelRightClickMenu_PrepareFishingBuddyMenu() |
||
55 | TitanPanelRightClickMenu_AddTitle(TitanPlugins[FishingBuddy.ID].menuText); |
||
56 | |||
57 | FishingBuddy.MakeDropDown(FishingBuddy.TITAN_CLICKTOSWITCH_ONOFF, "TitanClickToSwitch"); |
||
58 | |||
59 | TitanPanelRightClickMenu_AddSpacer(); |
||
60 | TitanPanelRightClickMenu_AddCommand(TITAN_PANEL_MENU_HIDE, |
||
61 | FishingBuddy.ID, |
||
62 | TITAN_PANEL_MENU_FUNC_HIDE); |
||
63 | end |
||
64 |