-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
26 lines (21 loc) · 829 Bytes
/
main.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
local SniperTips_VendorPrice = LibStub("AceAddon-3.0"):NewAddon("SniperTips_VendorPrice");
local LibTooltip = LibStub("SniperTips-2.0");
local tipColour = { 0.2, 0.6, 1 }
function SniperTips_VendorPrice:HandleItem(self, item)
if item.sellPrice ~= nil then
if (item.sellPrice == 0) then
-- do nothing
else
count = GetItemCount(item.link);
priceEach = GetCoinTextureString(item.sellPrice);
priceAll = GetCoinTextureString(item.sellPrice * count);
if (count > 1) then
self:AddDoubleLine("Vendor Sell (All): ",priceAll,unpack(tipColour));
self:AddDoubleLine("Vendor Sell (Each): ",priceEach,unpack(tipColour));
else
self:AddDoubleLine("Vendor Sell: ",priceAll,unpack(tipColour));
end
end
end
end
LibTooltip:AddItemHandler(SniperTips_VendorPrice)