forked from Sonaza/Experiencer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
databroker.lua
32 lines (27 loc) · 912 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
------------------------------------------------------------
-- Experiencer2 by DJScias (https://github.com/DJScias/Experiencer2)
-- Originally by Sonaza (https://sonaza.com)
-- Licensed under MIT License
-- See attached license text in file LICENSE
------------------------------------------------------------
local ADDON_NAME, Addon = ...;
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(_, button)
if button == "RightButton" then
Addon:OpenContextMenu();
end
end,
};
function Addon:InitializeDataBroker()
Addon.BrokerModule = LibDataBroker:NewDataObject("Experiencer", settings);
end
function Addon:UpdateDataBrokerText(text)
if Addon.BrokerModule then
Addon.BrokerModule.text = text;
end
end