vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | -- InfoBar support |
2 | |||
3 | FishingBuddy.InfoBar = {}; |
||
4 | |||
5 | FishingBuddy.InfoBar.OnLoad = function() |
||
6 | if ( not InfoBarFrame ) then |
||
7 | return; |
||
8 | end |
||
9 | |||
10 | this:RegisterForClicks("LeftButtonUp", "RightButtonUp"); |
||
11 | |||
12 | this.info = { |
||
13 | name = FishingBuddy.NAME, |
||
14 | version = FishingBuddy.CURRENTVERSION/100, |
||
15 | tooltip = FishingBuddy.InfoBar.Tooltip, |
||
16 | }; |
||
17 | end |
||
18 | |||
19 | FishingBuddy.InfoBar.OnClick = function(button) |
||
20 | if (button == "LeftButton") then |
||
21 | if (FishingBuddy.GetSetting("InfoBarClickToSwitch") == 1) then |
||
22 | FishingBuddy.Command(FishingBuddy.SWITCH); |
||
23 | else |
||
24 | FishingBuddy.Command(""); |
||
25 | end |
||
26 | else |
||
27 | -- Toggle menu |
||
28 | local menu = getglobal("FishingBuddyInfoBarMenu"); |
||
29 | menu.point = "TOPRIGHT"; |
||
30 | menu.relativePoint = "CENTER"; |
||
31 | local level = 1; |
||
32 | ToggleDropDownMenu(level, nil, menu, "IB_FishingBuddy", 0, 0); |
||
33 | end |
||
34 | end |
||
35 | |||
36 | FishingBuddy.InfoBar.OnEvent = function() |
||
37 | end |
||
38 | |||
39 | FishingBuddy.InfoBar.Tooltip = function() |
||
40 | local text = FishingBuddy.DESCRIPTION1.."\n"..FishingBuddy.DESCRIPTION2.."\n"; |
||
41 | text = text.."|c"..FishingBuddy.Colors.GREEN; |
||
42 | if (FishingBuddy.GetSetting("InfoBarClickToSwitch") == 1) then |
||
43 | text = text..FishingBuddy.TOOLTIP_HINTSWITCH; |
||
44 | else |
||
45 | text = text..FishingBuddy.TOOLTIP_HINTTOGGLE; |
||
46 | end |
||
47 | text = text.."|r"; |
||
48 | return text; |
||
49 | end |
||
50 | |||
51 | FishingBuddy.InfoBar.Menu_Initialize = function() |
||
52 | FishingBuddy.MakeDropDown(FishingBuddy.TITAN_CLICKTOSWITCH_ONOFF, |
||
53 | "InfoBarClickToSwitch"); |
||
54 | end |