mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-26 08:50:13 +00:00
feat: show sell price on item tooltips in gold/silver/copper format
Item tooltips now display the vendor sell price at the bottom, formatted as "Sell Price: 12g 50s 30c". Uses the vendorPrice field from GetItemInfo (field 11, sourced from SMSG_ITEM_QUERY_SINGLE_RESPONSE sellPrice). Helps players quickly assess item value when looting or sorting bags.
This commit is contained in:
parent
5678de562f
commit
22f8b721c7
1 changed files with 11 additions and 0 deletions
|
|
@ -5372,6 +5372,17 @@ void LuaEngine::registerCoreAPI() {
|
|||
" -- Flavor text\n"
|
||||
" if data.description then self:AddLine('\"'..data.description..'\"', 1, 0.82, 0) end\n"
|
||||
" end\n"
|
||||
" -- Sell price from GetItemInfo\n"
|
||||
" if sellPrice and sellPrice > 0 then\n"
|
||||
" local gold = math.floor(sellPrice / 10000)\n"
|
||||
" local silver = math.floor((sellPrice % 10000) / 100)\n"
|
||||
" local copper = sellPrice % 100\n"
|
||||
" local parts = {}\n"
|
||||
" if gold > 0 then table.insert(parts, gold..'g') end\n"
|
||||
" if silver > 0 then table.insert(parts, silver..'s') end\n"
|
||||
" if copper > 0 then table.insert(parts, copper..'c') end\n"
|
||||
" if #parts > 0 then self:AddLine('Sell Price: '..table.concat(parts, ' '), 1, 1, 1) end\n"
|
||||
" end\n"
|
||||
" self.__itemId = itemId\n"
|
||||
" return true\n"
|
||||
"end\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue