Zerotorescue@203: local addon = select(2, ...); Zerotorescue@203: local mod = addon:NewModule("MinimapIcon"); Zerotorescue@203: Zerotorescue@203: function mod:OnEnable() Zerotorescue@203: self:Make(); Zerotorescue@203: end Zerotorescue@203: Zerotorescue@203: function mod:Make() Zerotorescue@203: local ldb = LibStub("LibDataBroker-1.1"); Zerotorescue@203: Zerotorescue@203: local dataobject = ldb:GetDataObjectByName("Inventorium") or ldb:NewDataObject("Inventorium", { Zerotorescue@203: ["type"] = "launcher", Zerotorescue@203: ["label"] = "Inventorium", Zerotorescue@203: ["icon"] = [[Interface\Icons\INV_Misc_Bag_15]], Zerotorescue@203: ["OnClick"] = function(frame, button) Zerotorescue@203: if button == "RightButton" then Zerotorescue@203: -- Open up the config Zerotorescue@203: InventoriumCommandHandler("config"); Zerotorescue@203: elseif button == "LeftButton" then Zerotorescue@203: -- Open the summary Zerotorescue@203: InventoriumCommandHandler("summary"); Zerotorescue@203: elseif button == "MiddleButton" then Zerotorescue@203: -- Check stock and provide the alert if needed Zerotorescue@203: InventoriumCommandHandler("alert"); Zerotorescue@203: end Zerotorescue@203: end, Zerotorescue@203: ["OnTooltipShow"] = function(tooltip) Zerotorescue@203: tooltip:AddLine("Inventorium"); Zerotorescue@203: tooltip:AddLine(" "); Zerotorescue@203: tooltip:AddLine("|cfffed000Left-click|r to open the summary window.", 0, 1, 0); Zerotorescue@203: tooltip:AddLine("|cfffed000Middle-click|r to generate a stock alert.", 0, 1, 0); Zerotorescue@203: tooltip:AddLine("|cfffed000Right-click|r to open the config window.", 0, 1, 0); Zerotorescue@203: end, Zerotorescue@203: }); Zerotorescue@203: Zerotorescue@203: local icon = LibStub("LibDBIcon-1.0"); Zerotorescue@203: if icon then Zerotorescue@203: icon:Register("Inventorium", dataobject); Zerotorescue@203: end Zerotorescue@203: end