From fa1aae088b6915af63764b31e976c6d6d27afecb Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Sun, 12 Nov 2017 20:49:15 +0100 Subject: [PATCH] bugfix --- gui/auction_listing.lua | 8 +------- tabs/auctions/frame.lua | 16 +++++++++++++--- tabs/bids/frame.lua | 22 +++++++++++++++------- tabs/search/frame.lua | 23 ++++++++++++++++------- 4 files changed, 45 insertions(+), 24 deletions(-) diff --git a/gui/auction_listing.lua b/gui/auction_listing.lua index 47063bf..7e90fcf 100644 --- a/gui/auction_listing.lua +++ b/gui/auction_listing.lua @@ -9,7 +9,6 @@ local sort_util = require 'aux.util.sort' local money = require 'aux.util.money' local history = require 'aux.core.history' local gui = require 'aux.gui' -local search_tab = require 'aux.tabs.search' local tooltip = require 'aux.core.tooltip' local price_per_unit = false @@ -608,17 +607,12 @@ local methods = { DressUpItemLink(this.record.link) elseif IsShiftKeyDown() and ChatFrameEditBox:IsVisible() then ChatFrameEditBox:Insert(this.record.link) - elseif not modified() and button == 'RightButton' then -- TODO not when alt (how?) - set_tab(1) - search_tab.set_filter(strlower(info.item(this.record.item_id).name) .. '/exact') - search_tab.execute(nil, false) else local selection = this.rt:GetSelection() if not selection or selection.record ~= this.record then this.rt:SetSelectedRecord(this.record) - elseif this.rt.handlers.OnClick then - this.rt.handlers.OnClick(this, button) end + do (this.rt.handlers.OnClick or nop)(this, button) end end end, diff --git a/tabs/auctions/frame.lua b/tabs/auctions/frame.lua index b8268cc..d988a26 100644 --- a/tabs/auctions/frame.lua +++ b/tabs/auctions/frame.lua @@ -1,7 +1,9 @@ module 'aux.tabs.auctions' +local info = require 'aux.util.info' local gui = require 'aux.gui' local auction_listing = require 'aux.gui.auction_listing' +local search_tab = require 'aux.tabs.search' frame = CreateFrame('Frame', nil, AuxFrame) frame:SetAllPoints() @@ -17,9 +19,17 @@ listing = auction_listing.new(frame.listing, 20, auction_listing.auctions_column listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8) listing:Reset() listing:SetHandler('OnClick', function(row, button) - if IsAltKeyDown() and listing:GetSelection().record == row.record then - cancel_button:Click() - end + if IsAltKeyDown() then + if listing:GetSelection().record == row.record then + if IsAltKeyDown() and listing:GetSelection().record == row.record then + cancel_button:Click() + end + end + elseif button == 'RightButton' then + set_tab(1) + search_tab.set_filter(strlower(info.item(this.record.item_id).name) .. '/exact') + search_tab.execute(nil, false) + end end) listing:SetHandler('OnSelectionChanged', function(rt, datum) if not datum then return end diff --git a/tabs/bids/frame.lua b/tabs/bids/frame.lua index 42a62d3..2bd20a9 100644 --- a/tabs/bids/frame.lua +++ b/tabs/bids/frame.lua @@ -1,7 +1,9 @@ module 'aux.tabs.bids' +local info = require 'aux.util.info' local gui = require 'aux.gui' local auction_listing = require 'aux.gui.auction_listing' +local search_tab = require 'aux.tabs.search' frame = CreateFrame('Frame', nil, AuxFrame) frame:SetAllPoints() @@ -17,13 +19,19 @@ listing = auction_listing.new(frame.listing, 20, auction_listing.bids_columns) listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8) listing:Reset() listing:SetHandler('OnClick', function(row, button) - if IsAltKeyDown() and listing:GetSelection().record == row.record then - if button == 'LeftButton' then - buyout_button:Click() - elseif button == 'RightButton' then - bid_button:Click() - end - end + if IsAltKeyDown() then + if listing:GetSelection().record == row.record then + if button == 'LeftButton' then + buyout_button:Click() + elseif button == 'RightButton' then + bid_button:Click() + end + end + elseif button == 'RightButton' then + set_tab(1) + search_tab.set_filter(strlower(info.item(this.record.item_id).name) .. '/exact') + search_tab.execute(nil, false) + end end) listing:SetHandler('OnSelectionChanged', function(rt, datum) if not datum then return end diff --git a/tabs/search/frame.lua b/tabs/search/frame.lua index a1c44c8..871912e 100644 --- a/tabs/search/frame.lua +++ b/tabs/search/frame.lua @@ -2,6 +2,7 @@ module 'aux.tabs.search' local T = require 'T' +local info = require 'aux.util.info' local completion = require 'aux.util.completion' local filter_util = require 'aux.util.filter' local scan = require 'aux.core.scan' @@ -521,15 +522,23 @@ for _ = 1, 5 do local table = auction_listing.new(frame.results, 16, auction_listing.search_columns) table:SetHandler('OnClick', function(row, button) - if IsAltKeyDown() and get_current_search().table:GetSelection().record == row.record then - if button == 'LeftButton' then - buyout_button:Click() - elseif button == 'RightButton' then - bid_button:Click() - end - end + if IsAltKeyDown() then + if get_current_search().table:GetSelection().record == row.record then + if button == 'LeftButton' then + buyout_button:Click() + elseif button == 'RightButton' then + bid_button:Click() + end + end + elseif button == 'RightButton' then + set_tab(1) + set_filter(strlower(info.item(this.record.item_id).name) .. '/exact') + execute(nil, false) + end end) table:SetHandler('OnSelectionChanged', function(rt, datum) + bid_button:Disable() + buyout_button:Disable() if not datum then return end find_auction(datum.record) end)