Skip to content

Commit 2ba2bce

Browse files
committed
Bump TOC for 1.15.7
Refatoring and removed deprecations
1 parent e0d3d8c commit 2ba2bce

File tree

4 files changed

+16
-24
lines changed

4 files changed

+16
-24
lines changed

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"SetTooltipMoney",
2626
"WOW_PROJECT_WRATH_CLASSIC",
2727
"WOW_PROJECT_ID",
28-
"WOW_PROJECT_CLASSIC"
28+
"WOW_PROJECT_CLASSIC",
29+
"WOW_PROJECT_MISTS_CLASSIC"
2930
],
3031
"Lua.runtime.version": "Lua 5.1",
3132
"Lua.runtime.builtin": {
@@ -40,6 +41,6 @@
4041
"utf8": "disable"
4142
},
4243
"Lua.workspace.library": [
43-
"~\\.vscode\\extensions\\ketho.wow-api-0.17.6\\Annotations"
44+
"~\\.vscode\\extensions\\ketho.wow-api-0.20.8\\Annotations\\Core"
4445
]
4546
}

Compat.lua

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
local VP = VendorPrice
22

3-
if not VP.isVanilla and not VP.isCata and not VP.isMop then
3+
if VP.isRetail then
44
return
55
end
66

77
local function SetPrice(tt, count, item)
88
VP:SetPrice(tt, false, "Compat", count, item, true)
99
end
1010

11-
local function GetMouseFoc()
12-
if GetMouseFoci then
13-
return GetMouseFoci()[1]
14-
elseif GetMouseFocus then
15-
return GetMouseFocus()
16-
end
17-
end
18-
1911
function VP:IsShown(frame)
2012
return frame and frame:IsVisible() and frame:IsMouseOver()
2113
end
@@ -61,7 +53,7 @@ GameTooltip:HookScript("OnTooltipSetItem", function(tt)
6153
elseif AtlasLoot and VP:IsShown(_G["AtlasLoot_GUI-Frame"]) then
6254
SetPrice(tt)
6355
else -- Chatter, Prat: check for active chat windows
64-
local mouseFocus = GetMouseFoc()
56+
local mouseFocus = GetMouseFoci()[1]
6557
if mouseFocus and mouseFocus:GetObjectType() == "FontString" then
6658
for i = 1, FCF_GetNumActiveChatFrames() do
6759
if _G["ChatFrame"..i]:IsMouseOver() then

VendorPrice.lua

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
VendorPrice = {}
22
local VP = VendorPrice
33

4+
VP.isRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
45
VP.isVanilla = WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
5-
VP.isCata = WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC
66
VP.isMop = WOW_PROJECT_ID == WOW_PROJECT_MISTS_CLASSIC
77

8-
if not VP.isVanilla and not VP.isCata and not VP.isMop then
8+
if VP.isRetail then
99
return
1010
end
1111

12-
local GetItemInfo = GetItemInfo or C_Item.GetItemInfo
13-
1412
local SELL_PRICE_TEXT = format("%s:", SELL_PRICE)
1513
local overridePrice
1614

1715
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
2018
for i = 31, 34 do
2119
CharacterBags[i] = true
2220
end
2321

22+
-- on vanilla invslotid 88-93, on mists 88-94
2423
local firstBankBag = C_Container.ContainerIDToInventoryID(NUM_BAG_SLOTS + 1)
2524
local lastBankBag = C_Container.ContainerIDToInventoryID(NUM_BAG_SLOTS + NUM_BANKBAGSLOTS)
2625
for i = firstBankBag, lastBankBag do
@@ -66,19 +65,19 @@ GameTooltip:HookScript("OnHide", function()
6665
overridePrice = nil
6766
end)
6867

69-
function VP:SetPrice(tt, hasCataTooltip, source, count, item, isOnTooltipSetItem)
68+
function VP:SetPrice(tt, hasMopTooltip, source, count, item, isOnTooltipSetItem)
7069
if ShouldShowPrice(tt, source) then
7170
count = count or 1
7271
item = item or select(2, tt:GetItem())
7372
if item then
74-
local sellPrice, classID = select(11, GetItemInfo(item))
73+
local sellPrice, classID = select(11, C_Item.GetItemInfo(item))
7574
if sellPrice and sellPrice > 0 and not CheckRecipe(tt, classID, isOnTooltipSetItem) then
7675
local isShift = IsShiftKeyDown() and count > 1
7776
local displayPrice = isShift and sellPrice or sellPrice * count
7877
if self.isVanilla then
7978
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
8281
if isShift then
8382
overridePrice = displayPrice
8483
end
@@ -199,7 +198,7 @@ end
199198
ItemRefTooltip:HookScript("OnTooltipSetItem", function(tt)
200199
local item = select(2, tt:GetItem())
201200
if item then
202-
local sellPrice, classID = select(11, GetItemInfo(item))
201+
local sellPrice, classID = select(11, C_Item.GetItemInfo(item))
203202
if sellPrice and sellPrice > 0 and not CheckRecipe(tt, classID, true) then
204203
SetTooltipMoney(tt, sellPrice, nil, SELL_PRICE_TEXT)
205204
end

VendorPrice.toc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Interface: 11504, 40400, 50500
1+
## Interface: 11507, 50500
22
## Version: @project-version@
33
## Title: Vendor Price
44
## Notes: Displays the price of an item when not at a vendor

0 commit comments

Comments
 (0)