Skip to content

Commit

Permalink
v1.13.9 - Ace fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaminariss committed Sep 6, 2020
1 parent e1eccb9 commit dba53d0
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 28 deletions.
4 changes: 2 additions & 2 deletions AuctionFaster.toc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Title: AuctionFaster
## Notes: Super Fast AuctionHouse Addon
## Version: 1.13.8
## Version: 1.13.9
## Author: Kaminaris
## Interface: 11302
## Interface: 11305
## SavedVariables: AuctionFasterDb
## X-Curse-Project-ID: 292892
## X-WoWI-ID: 24771
Expand Down
24 changes: 8 additions & 16 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,25 @@ function AuctionFaster:OnInitialize()
self.db.auctionDb = {};
end

if self.db.enableToolTips then
self:EnableModule('Tooltip');
if not self.db.enableToolTips then
local tooltips = self:GetModule('Tooltips');
tooltips:Attach();
end

-- These modules must be enabled on start, they handle events themselves
self:EnableModule('ItemCache');
self:EnableModule('Inventory');
self:EnableModule('Auctions');
self:EnableModule('ChainBuy');
self:EnableModule('Tutorial');
--self:EnableModule('ItemCache');
--self:EnableModule('Inventory');
--self:EnableModule('Auctions');
--self:EnableModule('ChainBuy');
--self:EnableModule('Tutorial');
end

function AuctionFaster:AUCTION_HOUSE_SHOW()
if self.db.enabled then
self:EnableModule('Sell');
self:EnableModule('Buy');

if not self.onTabClickHooked then
self:Hook('AuctionFrameTab_OnClick', true);
self.onTabClickHooked = true;
end

if self.db.defaultTab == 'SELL' then
AuctionFrameTab_OnClick(self.auctionTabs[1].tabButton);
elseif self.db.defaultTab == 'BUY' then
AuctionFrameTab_OnClick(self.auctionTabs[2].tabButton);
end
end
end

Expand Down
4 changes: 2 additions & 2 deletions modules/tooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local ItemCache = AuctionFaster:GetModule('ItemCache');
local StdUi = LibStub('StdUi');
local L = LibStub('AceLocale-3.0'):GetLocale('AuctionFaster');

function Tooltip:OnEnable()
function Tooltip:Attach()
if not self:IsHooked(GameTooltip, 'OnTooltipSetItem') then
self:HookScript(GameTooltip, 'OnTooltipSetItem', 'UpdateTooltip');
if BattlePetTooltipTemplate_SetBattlePet then
Expand All @@ -22,7 +22,7 @@ function Tooltip:OnEnable()
end
end

function Tooltip:OnDisable()
function Tooltip:Detach()
if self:IsHooked(GameTooltip, 'OnTooltipSetItem') then
self:Unhook(GameTooltip, 'OnTooltipSetItem');
if BattlePetTooltipTemplate_SetBattlePet then
Expand Down
27 changes: 21 additions & 6 deletions tabs/buy/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,27 @@ local format = string.format;
local TableInsert = tinsert;

function Buy:OnEnable()
self:AddBuyAuctionHouseTab();
self:InterceptLinkClick();
self:RegisterEvent('AUCTION_HOUSE_SHOW');
self:RegisterEvent('AUCTION_HOUSE_CLOSED');
end

Buy.initialized = false;
function Buy:AUCTION_HOUSE_SHOW()
if AuctionFaster.db.enabled then
if not self.initialized then
self:AddBuyAuctionHouseTab();
self:InterceptLinkClick();
self.initialized = true;
end

if AuctionFaster.db.defaultTab == 'BUY' then
AuctionFrameTab_OnClick(self.auctionTabs[2].tabButton);
end
end
end

function Buy:AUCTION_HOUSE_CLOSED()
self:UnregisterEvent('AUCTION_ITEM_LIST_UPDATE');
end

function Buy:OnShow()
Expand All @@ -39,10 +58,6 @@ function Buy:OnHide()
self:UnregisterEvent('AUCTION_ITEM_LIST_UPDATE');
end

function Buy:OnDisable()
self:UnregisterEvent('AUCTION_ITEM_LIST_UPDATE');
end

----------------------------------------------------------------------------
--- Searching functions
----------------------------------------------------------------------------
Expand Down
19 changes: 17 additions & 2 deletions tabs/sell/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,22 @@ local Sell = AuctionFaster:GetModule('Sell');
local format = string.format;

function Sell:OnEnable()
self:AddSellAuctionHouseTab();
self:RegisterEvent('AUCTION_HOUSE_SHOW');
self:RegisterEvent('AUCTION_HOUSE_CLOSED');
end

Sell.initialized = false;
function Sell:AUCTION_HOUSE_SHOW()
if AuctionFaster.db.enabled then
if not self.initialized then
self:AddSellAuctionHouseTab();
self.initialized = true;
end

if AuctionFaster.db.defaultTab == 'SELL' then
AuctionFrameTab_OnClick(self.auctionTabs[1].tabButton);
end
end
end

function Sell:OnShow()
Expand All @@ -36,7 +51,7 @@ function Sell:OnHide()
--self:UnregisterEvent('AUCTION_ITEM_LIST_UPDATE');
end

function Sell:OnDisable()
function Sell:AUCTION_HOUSE_CLOSED()
self:OnHide();
end

Expand Down

0 comments on commit dba53d0

Please sign in to comment.