Skip to content

Commit

Permalink
BfA and Shadowlands support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladinator committed Aug 22, 2020
1 parent d42185f commit e23699f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CompactVendor.toc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Interface: 80300
## Interface: 90000
## Title: CompactVendor
## Notes: Compact Vendor converts your vendor frame into a compact scrollable list with a search box. Inspiration drawn from Tekkub's GnomishVendorShrinker.
## Author: Vladinator
## Version: 8.3.0.200202
## Version: 9.0.0.200731
## SavedVariables: CompactVendorDB
## X-Curse-Project-ID: 332178
## X-WoWI-ID: 25073
Expand Down
6 changes: 3 additions & 3 deletions frame_list.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VladsVendorListMixin = CreateFromMixins(CallbackRegistryBaseMixin)
VladsVendorListMixin = CreateFromMixins(CallbackRegistryMixin or CallbackRegistryBaseMixin)

local LibItemSearch = LibStub("LibItemSearch-1.2")

Expand All @@ -15,7 +15,7 @@ VladsVendorListMixin:GenerateCallbackEvents({
})

function VladsVendorListMixin:OnLoad()
CallbackRegistryBaseMixin.OnLoad(self)
(CallbackRegistryMixin or CallbackRegistryBaseMixin).OnLoad(self)

local function OnScroll()
self.isScrollUpdate = true -- avoid recursion
Expand Down Expand Up @@ -47,7 +47,7 @@ end

function VladsVendorListMixin:OnShow()
FrameUtil.RegisterFrameForEvents(self, VladsVendorListEvents)
self:RegisterCallback(VladsVendorListMixin.Event.Search, self.searchCallback)
self:RegisterCallback(VladsVendorListMixin.Event.Search, self.searchCallback, self.searchCallback)
self:Update()
end

Expand Down
2 changes: 1 addition & 1 deletion frame_list_item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ end

function VladsVendorListItemMixin:OnShow()
FrameUtil.RegisterFrameForEvents(self, VladsVendorListItemEvents)
self:GetList():RegisterCallback(VladsVendorListMixin.Event.Tooltip, self.tooltipCallback)
self:GetList():RegisterCallback(VladsVendorListMixin.Event.Tooltip, self.tooltipCallback, self.tooltipCallback)
self:Update()
end

Expand Down
10 changes: 8 additions & 2 deletions frame_list_item_cost_frame_button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,14 @@ function VladsVendorListItemCostButtonMixin:Set(costType, item, parent, pool)
if itemNumAvailable == 0 then
local currencyID = C_CurrencyInfo.GetCurrencyIDFromLink(itemLink)
if currencyID > 0 then
local _, currencyNumAvailable = GetCurrencyInfo(currencyID)
itemNumAvailable = currencyNumAvailable
-- TODO: 9.0
if GetCurrencyInfo then
local _, currencyNumAvailable = GetCurrencyInfo(currencyID)
itemNumAvailable = currencyNumAvailable
else
local currencyInfo = C_CurrencyInfo.GetCurrencyInfo(currencyID)
itemNumAvailable = currencyInfo.quantity
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion frame_list_item_methods.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function VladsVendorListItemMethodsMixin:HasRealExtendedCost()
-- if the item is a common barter item we don't care but if it's a rare one we ask to confirm
if link then
local _, _, quality = GetItemInfo(link)
if quality >= LE_ITEM_QUALITY_UNCOMMON then
if quality >= (LE_ITEM_QUALITY_UNCOMMON or Enum.ItemQuality.Uncommon) then -- TODO: 9.0
return false
end
end
Expand Down
2 changes: 1 addition & 1 deletion frame_list_item_quantity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function VladsVendorListItemQuantityButtonMixin:OnLoad()
end

function VladsVendorListItemQuantityButtonMixin:OnShow()
self:GetList():RegisterCallback(VladsVendorListMixin.Event.Scroll, self.listScrollCallback)
self:GetList():RegisterCallback(VladsVendorListMixin.Event.Scroll, self.listScrollCallback, self.listScrollCallback)
end

function VladsVendorListItemQuantityButtonMixin:OnHide()
Expand Down

0 comments on commit e23699f

Please sign in to comment.