forked from Sonaza/Experiencer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabroker.lua
32 lines (27 loc) · 869 Bytes
/
databroker.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
------------------------------------------------------------
-- Experiencer by Sonaza (https://sonaza.com)
-- Licensed under MIT License
-- See attached license text in file LICENSE
------------------------------------------------------------
local ADDON_NAME, Addon = ...;
local _;
local LibDataBroker = LibStub("LibDataBroker-1.1");
local settings = {
type = "data source",
label = "Experiencer",
text = "Experiencer Text Display",
icon = "Interface\\Icons\\Ability_Paladin_EmpoweredSealsRighteous",
OnClick = function(frame, button)
if(button == "RightButton") then
Addon:OpenContextMenu(frame);
end
end,
};
function Addon:InitializeDataBroker()
Addon.BrokerModule = LibDataBroker:NewDataObject("Experiencer", settings);
end
function Addon:UpdateDataBrokerText(text)
if (Addon.BrokerModule ~= nil) then
Addon.BrokerModule.text = text;
end
end