vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 --===========================================================================--
2 ---------------------------- LootTracker by PNB ----------------------------
3 --===========================================================================--
4 -- LootTrackerTitan.lua
5 --
6 -- Logic for interacting with Titan
7 --===========================================================================--
8  
9 LT_TITAN_ID = "LootTracker";
10 LT_TITAN_MENU_TEXT = "LootTracker";
11 LT_TITAN_TOOLTIP_TITLE = "Loot Tracker Summary";
12  
13  
14 ------------------------------------------------------------------------------
15 -- LT_Titan_ButtonOnLoad
16 -- Initialize our Titan button
17 ------------------------------------------------------------------------------
18  
19 function LT_Titan_ButtonOnLoad()
20  
21 this.registry = {
22 id = LT_TITAN_ID,
23 menuText = LT_TITAN_MENU_TEXT,
24 buttonTextFunction = "LT_Titan_GetButtonText",
25 tooltipTitle = LT_TITAN_TOOLTIP_TITLE,
26 tooltipTextFunction = "LT_Titan_GetTooltipText",
27 };
28  
29 -- Listen for change events on the data source
30 LT_AddListener(LT_Titan_DataChanged);
31  
32 end
33  
34  
35 ------------------------------------------------------------------------------
36 -- LT_Titan_ButtonOnClick
37 -- Respond to our Titan button's click event
38 ------------------------------------------------------------------------------
39  
40 function LT_Titan_ButtonOnClick(button)
41  
42 if (button == "LeftButton") then
43  
44 if (LT_SettingsUI:IsShown()) then
45 HideUIPanel(LT_SettingsUI);
46 else
47 ShowUIPanel(LT_SettingsUI);
48 end
49  
50 elseif (button == "RightButton") then
51  
52 LT_NextTooltipMode();
53  
54 end
55  
56 end
57  
58  
59 ------------------------------------------------------------------------------
60 -- LT_Titan_GetButtonText
61 -- Get the text to display on our Titan button
62 ------------------------------------------------------------------------------
63  
64 function LT_Titan_GetButtonText(id)
65  
66 return LT_GetToolbarSummary();
67  
68 end
69  
70  
71 ------------------------------------------------------------------------------
72 -- LT_Titan_GetTooltipText
73 -- Get the text to display when the user hovers over our Titan button
74 ------------------------------------------------------------------------------
75  
76 function LT_Titan_GetTooltipText()
77  
78 return LT_GetTooltipSummary();
79  
80 end
81  
82  
83 ------------------------------------------------------------------------------
84 -- LT_Titan_DataChanged
85 -- The data source has changed in some way. Refresh our dependant controls.
86 ------------------------------------------------------------------------------
87  
88 function LT_Titan_DataChanged()
89  
90 if (getglobal("TitanPanelButton_UpdateButton") ~= nil) then
91  
92 TitanPanelButton_UpdateButton(LT_TITAN_ID);
93 TitanPanelButton_UpdateTooltip();
94  
95 end
96  
97 end
98