-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGetTooltipLineData.lua
More file actions
executable file
·43 lines (38 loc) · 1.34 KB
/
GetTooltipLineData.lua
File metadata and controls
executable file
·43 lines (38 loc) · 1.34 KB
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
33
34
35
36
37
38
39
40
41
42
43
---@class DisenchantBuddy
local DisenchantBuddy = select(2, ...)
---@class TooltipLineData
---@field left string
---@field right string
---@field auctionValue number
---@param item ItemMixin
---@param result DisenchantResult
---@return TooltipLineData
function DisenchantBuddy.GetTooltipLineData(item, result)
local materialName = item:GetItemName()
local materialTexture = item:GetItemIcon()
local hex = item:GetItemQualityColor().hex
local leftSide = " |T" .. materialTexture .. ":0|t " .. hex .. materialName .. "|r"
local rightSide = result.probability .. "%"
if result.minQuantity == result.maxQuantity then
rightSide = rightSide .. " (" .. result.minQuantity
else
rightSide = rightSide .. " (" .. result.minQuantity .. "-" .. result.maxQuantity
end
local auctionValue = 0
if Auctionator then
auctionValue = Auctionator.API.v1.GetAuctionPriceByItemID("DisenchantBuddy", result.itemId)
if auctionValue then
rightSide = rightSide .. " x " .. HIGHLIGHT_FONT_COLOR_CODE .. GetCoinTextureString(auctionValue, 12) .. "|r"
else
rightSide = rightSide .. "x"
end
else
rightSide = rightSide .. "x"
end
rightSide = rightSide .. ")"
return {
left = leftSide,
right = rightSide,
auctionValue = auctionValue,
}
end