Skip to content

Commit

Permalink
fix: priciest tooltip showing base item, not actual looted item
Browse files Browse the repository at this point in the history
  • Loading branch information
will0w7 committed Oct 6, 2024
1 parent 62d5a4d commit 06cbf5a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function Core.LootEventHandler(_, event, ...)
Data.AddItemsMoney(totalPrice)
Data.AddTotalMoney(totalPrice)
-- only price of individual items, not groups (1xBismuth not 5xBismuth)
Data.SetPriciest(price, itemID)
Data.SetPriciest(price, itemLink)
UpdateLoot()
elseif event == Constants.Events.ChatMsgMoney or event == Constants.Events.QuestTurnedIn then
-- here we dont stop interaction, if we turn in a quest with a profession
Expand Down
14 changes: 7 additions & 7 deletions data/Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Data.DB.prototype = {
ItemsMoney = 0,
TotalMoney = 0,
Priciest = 0,
PriciestID = 0,
PriciestLink = "",
ListLootedItems = CircularBuffer,
----------------------------------------------
Timer = 0,
Expand Down Expand Up @@ -153,18 +153,18 @@ function Data.GetPriciest()
return MoneyLooterDB.Priciest
end

---@param id integer
---@param itemLink string
---@param money integer
function Data.SetPriciest(money, id)
function Data.SetPriciest(money, itemLink)
if money ~= nil and money > MoneyLooterDB.Priciest then
MoneyLooterDB.Priciest = money
MoneyLooterDB.PriciestID = id
MoneyLooterDB.PriciestLink = itemLink
end
end

---@return integer
function Data.GetPriciestID()
return MoneyLooterDB.PriciestID
---@return string
function Data.GetPriciestLink()
return MoneyLooterDB.PriciestLink
end

---@return table
Expand Down
6 changes: 3 additions & 3 deletions ui/UIEvents.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ UI.MLMainFrame.MinimizeCheck:SetScript(Constants.Events.OnClick, function()
end)

UI.MLMainFrame.PriciestFS:SetScript(Constants.Events.OnEnter, function()
local priciestID = Data.GetPriciestID()
if priciestID == nil or priciestID == 0 then return end
local priciestLink = Data.GetPriciestLink()
if priciestLink == nil or priciestLink == "" then return end
GameTooltip:SetOwner(UI.MLMainFrame.PriciestFS, "ANCHOR_BOTTOMRIGHT")
GameTooltip:SetItemByID(Data.GetPriciestID())
GameTooltip:SetHyperlink(priciestLink)
GameTooltip:Show()
end)

Expand Down

0 comments on commit 06cbf5a

Please sign in to comment.