Skip to content

Commit

Permalink
Update for Cataclysm Classic (closes #14, #15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ketho committed May 28, 2024
1 parent 3c39c1b commit 088a4d9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion Compat.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local VP = VendorPrice

if not VP.isVanilla and not VP.isWrath then
if not VP.isVanilla and not VP.isCata then
return
end

Expand Down
12 changes: 7 additions & 5 deletions VendorPrice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ VendorPrice = {}
local VP = VendorPrice

VP.isVanilla = WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
VP.isWrath = WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC
VP.isCata = WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC

if not VP.isVanilla and not VP.isWrath then
if not VP.isVanilla and not VP.isCata then
return
end

local GetItemInfo = GetItemInfo or C_Item.GetItemInfo

local SELL_PRICE_TEXT = format("%s:", SELL_PRICE)
local overridePrice

Expand Down Expand Up @@ -63,7 +65,7 @@ GameTooltip:HookScript("OnHide", function()
overridePrice = nil
end)

function VP:SetPrice(tt, hasWrathTooltip, source, count, item, isOnTooltipSetItem)
function VP:SetPrice(tt, hasCataTooltip, source, count, item, isOnTooltipSetItem)
if ShouldShowPrice(tt, source) then
count = count or 1
item = item or select(2, tt:GetItem())
Expand All @@ -74,8 +76,8 @@ function VP:SetPrice(tt, hasWrathTooltip, source, count, item, isOnTooltipSetIte
local displayPrice = isShift and sellPrice or sellPrice * count
if self.isVanilla then
SetTooltipMoney(tt, displayPrice, nil, SELL_PRICE_TEXT)
elseif self.isWrath then
if hasWrathTooltip then
elseif self.isCata then
if hasCataTooltip then
if isShift then
overridePrice = displayPrice
end
Expand Down
4 changes: 2 additions & 2 deletions VendorPrice.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 30403
## Interface-Classic: 11501
## Interface: 40400
## Interface-Classic: 11502
## Version: @project-version@
## Title: Vendor Price
## Notes: Displays the price of an item when not at a vendor
Expand Down

0 comments on commit 088a4d9

Please sign in to comment.