|
1 | 1 | VendorPrice = {} |
2 | 2 | local VP = VendorPrice |
3 | 3 |
|
| 4 | +VP.isRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE |
4 | 5 | VP.isVanilla = WOW_PROJECT_ID == WOW_PROJECT_CLASSIC |
5 | | -VP.isCata = WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC |
6 | 6 | VP.isMop = WOW_PROJECT_ID == WOW_PROJECT_MISTS_CLASSIC |
7 | 7 |
|
8 | | -if not VP.isVanilla and not VP.isCata and not VP.isMop then |
| 8 | +if VP.isRetail then |
9 | 9 | return |
10 | 10 | end |
11 | 11 |
|
12 | | -local GetItemInfo = GetItemInfo or C_Item.GetItemInfo |
13 | | - |
14 | 12 | local SELL_PRICE_TEXT = format("%s:", SELL_PRICE) |
15 | 13 | local overridePrice |
16 | 14 |
|
17 | 15 | local CharacterBags = {} |
18 | | --- CONTAINER_BAG_OFFSET is 19 on classic and 30 on retail |
19 | | --- but classic uses slot 31 to 34 for bags |
| 16 | + |
| 17 | +-- on vanilla and mists invslotid 31 to 34 |
20 | 18 | for i = 31, 34 do |
21 | 19 | CharacterBags[i] = true |
22 | 20 | end |
23 | 21 |
|
| 22 | +-- on vanilla invslotid 88-93, on mists 88-94 |
24 | 23 | local firstBankBag = C_Container.ContainerIDToInventoryID(NUM_BAG_SLOTS + 1) |
25 | 24 | local lastBankBag = C_Container.ContainerIDToInventoryID(NUM_BAG_SLOTS + NUM_BANKBAGSLOTS) |
26 | 25 | for i = firstBankBag, lastBankBag do |
@@ -66,19 +65,19 @@ GameTooltip:HookScript("OnHide", function() |
66 | 65 | overridePrice = nil |
67 | 66 | end) |
68 | 67 |
|
69 | | -function VP:SetPrice(tt, hasCataTooltip, source, count, item, isOnTooltipSetItem) |
| 68 | +function VP:SetPrice(tt, hasMopTooltip, source, count, item, isOnTooltipSetItem) |
70 | 69 | if ShouldShowPrice(tt, source) then |
71 | 70 | count = count or 1 |
72 | 71 | item = item or select(2, tt:GetItem()) |
73 | 72 | if item then |
74 | | - local sellPrice, classID = select(11, GetItemInfo(item)) |
| 73 | + local sellPrice, classID = select(11, C_Item.GetItemInfo(item)) |
75 | 74 | if sellPrice and sellPrice > 0 and not CheckRecipe(tt, classID, isOnTooltipSetItem) then |
76 | 75 | local isShift = IsShiftKeyDown() and count > 1 |
77 | 76 | local displayPrice = isShift and sellPrice or sellPrice * count |
78 | 77 | if self.isVanilla then |
79 | 78 | SetTooltipMoney(tt, displayPrice, nil, SELL_PRICE_TEXT) |
80 | | - elseif self.isCata or self.isMop then |
81 | | - if hasCataTooltip then |
| 79 | + elseif self.isMop then |
| 80 | + if hasMopTooltip then |
82 | 81 | if isShift then |
83 | 82 | overridePrice = displayPrice |
84 | 83 | end |
|
199 | 198 | ItemRefTooltip:HookScript("OnTooltipSetItem", function(tt) |
200 | 199 | local item = select(2, tt:GetItem()) |
201 | 200 | if item then |
202 | | - local sellPrice, classID = select(11, GetItemInfo(item)) |
| 201 | + local sellPrice, classID = select(11, C_Item.GetItemInfo(item)) |
203 | 202 | if sellPrice and sellPrice > 0 and not CheckRecipe(tt, classID, true) then |
204 | 203 | SetTooltipMoney(tt, sellPrice, nil, SELL_PRICE_TEXT) |
205 | 204 | end |
|
0 commit comments