diff --git a/Aux-Addon.toc b/Aux-Addon.toc index 5b45862..5ed936e 100644 --- a/Aux-Addon.toc +++ b/Aux-Addon.toc @@ -1,7 +1,7 @@ ## Interface: 11200 ## Title: Aux ## Notes: A lightweight addon designed to help manage auctions -## SavedVariablesPerCharacter: AUX_ENABLE_ALT, AUX_OPEN_FIRST, AUX_INSTANT_BUYOUT, AUX_AUCTION_DURATION +## SavedVariablesPerCharacter: AUX_SELL_SHORTCUT, AUX_BUY_SHORTCUT, AUX_OPEN_SELL, AUX_OPEN_BUY, AUX_INSTANT_BUYOUT, AUX_AUCTION_DURATION ## SavedVariables: auxSellEntries core.xml diff --git a/about.xml b/about.xml index b884e1a..ba1f486 100644 --- a/about.xml +++ b/about.xml @@ -12,7 +12,7 @@ - + diff --git a/core.lua b/core.lua index 49b3fb9..4dde0e1 100644 --- a/core.lua +++ b/core.lua @@ -181,8 +181,10 @@ function Aux_OnAuctionHouseShow() AuxOptionsButtonPanel:Show() - if AUX_OPEN_FIRST then + if AUX_OPEN_SELL then AuctionFrameTab_OnClick(Aux.tabs.sell.index) + elseif AUX_OPEN_BUY then + AuctionFrameTab_OnClick(Aux.tabs.buy.index) end end @@ -442,34 +444,42 @@ end ----------------------------------------- function Aux_ContainerFrameItemButton_OnClick(button) + local bag, slot = this:GetParent():GetID(), this:GetID() + local container_item = Aux.info.container_item(bag, slot) - if button == "LeftButton" - and IsShiftKeyDown() - and not ChatFrameEditBox:IsVisible() - and AuctionFrame:IsVisible() - and (PanelTemplates_GetSelectedTab(AuctionFrame) == 1 or PanelTemplates_GetSelectedTab(AuctionFrame) == Aux.tabs.buy.index) - then - local container_item = Aux.info.container_item(this:GetParent():GetID(), this:GetID()) - if container_item then + if AuctionFrame:IsVisible() and button == "LeftButton" and container_item then + + if IsShiftKeyDown() + and not ChatFrameEditBox:IsVisible() + and (PanelTemplates_GetSelectedTab(AuctionFrame) == 1 or PanelTemplates_GetSelectedTab(AuctionFrame) == Aux.tabs.buy.index) + then if PanelTemplates_GetSelectedTab(AuctionFrame) == 1 then BrowseName:SetText(container_item.name) elseif PanelTemplates_GetSelectedTab(AuctionFrame) == Aux.tabs.buy.index then AuxBuySearchBox:SetText(container_item.name) end - end - else - Aux.orig.ContainerFrameItemButton_OnClick(button) - - if AUX_ENABLE_ALT and AuctionFrame:IsShown() and IsAltKeyDown() and button == "LeftButton" then - - ClickAuctionSellItemButton() + return + elseif AUX_SELL_SHORTCUT and IsAltKeyDown()then ClearCursor() - + PickupContainerItem(bag, slot) + ClickAuctionSellItemButton() + ClearCursor() if PanelTemplates_GetSelectedTab(AuctionFrame) ~= Aux.tabs.sell.index then AuctionFrameTab_OnClick(Aux.tabs.sell.index) + end + return + elseif AUX_BUY_SHORTCUT and IsControlKeyDown() and not ChatFrameEditBox:IsVisible() then + local container_item = Aux.info.container_item(this:GetParent():GetID(), this:GetID()) + if PanelTemplates_GetSelectedTab(AuctionFrame) ~= Aux.tabs.buy.index then + local container_item = Aux.info.container_item(this:GetParent():GetID(), this:GetID()) + AuctionFrameTab_OnClick(Aux.tabs.buy.index) end + AuxBuySearchBox:SetText(container_item.name) + AuxBuySearchButton_OnClick() + return end end + return Aux.orig.ContainerFrameItemButton_OnClick(button) end ----------------------------------------- diff --git a/options.lua b/options.lua index a8f9788..fd206a8 100644 --- a/options.lua +++ b/options.lua @@ -1,12 +1,15 @@ -AUX_ENABLE_ALT = true -AUX_OPEN_FIRST = false +Aux.options = {} + +AUX_SELL_SHORTCUT = true +AUX_BUY_SHORTCUT = true +AUX_OPEN_SELL = false +AUX_OPEN_BUY = false AUX_INSTANT_BUYOUT = false AUX_AUCTION_DURATION = 'long' -local BoolToString, BoolToNum, NumToBool +function Aux.options.show_description() -function Aux_ShowDescriptionFrame() AuxDescriptionFrame:Show() AuxDescriptionHTML:SetText("" @@ -18,59 +21,71 @@ function Aux_ShowDescriptionFrame() .."


Aux Buy


" .."The Aux Buy panel makes a multi-page search for you and lists all items with the most relevant information sorted by unit price. From that list you can select all the auctions you want to buy and after your confirmation Aux then makes another multi-page search, picking up all the selected auctions in the process. At the end you're presented with a report about what has been purchased." .."

" - .."") - + .."") AuxDescriptionHTML:SetSpacing(3) + AuxOptionsAuthorText:SetText("Authors: "..AuxAuthors) - AuxAuthorText:SetText("Authors: "..AuxAuthors) end ----------------------------------------- -function Aux_ShowOptionsFrame() +function Aux.options.show() AuxOptionsFrame:Show() AuxOptionsFrame:SetBackdropColor(0,0,0,100) - AuxConfigFrameTitle:SetText("Aux Options for "..UnitName("player")) - - AuxExplanation:SetText("Aux is an addon designed to make it easier and faster to setup your auctions and find the best deals at the auction house.") - - - AuxVersionText:SetText("Version: "..AuxVersion) + AuxOptionsConfigTitleText:SetText("Aux Options for "..UnitName("player")) + AuxOptionsSummary:SetText("Aux is an addon designed to make it easier and faster to setup your auctions and find the best deals at the auction house.") + AuxOptionsVersionText:SetText("Version: "..AuxVersion) - AuxOption_Enable_Alt:SetChecked(AUX_ENABLE_ALT) - AuxOption_Open_First:SetChecked(AUX_OPEN_FIRST) - AuxOption_Instant_Buyout:SetChecked(AUX_INSTANT_BUYOUT) -end - ------------------------------------------ - -function AuxOptionsSave() - - AUX_ENABLE_ALT = AuxOption_Enable_Alt:GetChecked() - AUX_OPEN_FIRST = AuxOption_Open_First:GetChecked() - AUX_INSTANT_BUYOUT = AuxOption_Instant_Buyout:GetChecked() + AuxOptionsSellShortcut:SetChecked(AUX_SELL_SHORTCUT) + AuxOptionsBuyShortcut:SetChecked(AUX_BUY_SHORTCUT) + AuxOptionsOpenSell:SetChecked(AUX_OPEN_SELL) + AuxOptionsOpenBuy:SetChecked(AUX_OPEN_BUY) + AuxOptionsInstantBuyout:SetChecked(AUX_INSTANT_BUYOUT) end ----------------------------------------- -function Aux_ShowTooltip_EnableAlt() +function Aux.options.save() + + AUX_SELL_SHORTCUT = AuxOptionsSellShortcut:GetChecked() + AUX_BUY_SHORTCUT = AuxOptionsBuyShortcut:GetChecked() + AUX_OPEN_SELL = AuxOptionsOpenSell:GetChecked() + AUX_OPEN_BUY = AuxOptionsOpenBuy:GetChecked() + AUX_INSTANT_BUYOUT = AuxOptionsInstantBuyout:GetChecked() + +end + +----------------------------------------- + +function Aux.options.show_sell_shortcut_tooltip() GameTooltip:SetOwner(this, "ANCHOR_BOTTOM") - GameTooltip:SetText("Enable ALT-key shortcut", 0.9, 1.0, 1.0) - GameTooltip:AddLine("If this option is checked, holding the Alt key down while clicking an item in your bags will switch to the Aux Sell panel, place the item in the Auction Item area, and suggest a price.", 0.5, 0.5, 1.0, 1) + GameTooltip:SetText("Aux Sell shortcut", 0.9, 1.0, 1.0) + GameTooltip:AddLine("If this option is checked, holding the Alt key down while clicking an item in your bags will switch to the Aux Sell panel, place the item in the Auction Item area and suggest a price.", 0.5, 0.5, 1.0, 1) GameTooltip:Show() end ----------------------------------------- -function Aux_ShowTooltip_OpenFirst() +function Aux.options.show_buy_shortcut_tooltip() GameTooltip:SetOwner(this, "ANCHOR_BOTTOM") - GameTooltip:SetText("Automatically open Aux Sell panel", 0.9, 1.0, 1.0) + GameTooltip:SetText("Aux Buy Shortcut", 0.9, 1.0, 1.0) + GameTooltip:AddLine("If this option is checked, holding the Control key down while clicking an item in your bags will switch to the Aux Buy panel and start a search.", 0.5, 0.5, 1.0, 1) + GameTooltip:Show() + +end + +----------------------------------------- + +function Aux.options.show_open_sell_tooltip() + + GameTooltip:SetOwner(this, "ANCHOR_BOTTOM") + GameTooltip:SetText("Start on Aux Sell panel", 0.9, 1.0, 1.0) GameTooltip:AddLine("If this option is checked, the Aux Sell panel will display first whenever you open the Auction House window.", 0.5, 0.5, 1.0, 1) GameTooltip:Show() @@ -78,10 +93,21 @@ end ----------------------------------------- -function Aux_ShowTooltip_InstantBuyout() +function Aux.options.show_open_buy_tooltip() GameTooltip:SetOwner(this, "ANCHOR_BOTTOM") - GameTooltip:SetText("Enable right-click instant buyout", 0.9, 1.0, 1.0) + GameTooltip:SetText("Start on Aux Buy panel", 0.9, 1.0, 1.0) + GameTooltip:AddLine("If this option is checked, the Aux Buy panel will display first whenever you open the Auction House window.", 0.5, 0.5, 1.0, 1) + GameTooltip:Show() + +end + +----------------------------------------- + +function Aux.options.show_instant_buyout_tooltip() + + GameTooltip:SetOwner(this, "ANCHOR_BOTTOM") + GameTooltip:SetText("Instant buyout", 0.9, 1.0, 1.0) GameTooltip:AddLine("If this option is checked, right-clicking on an auction in the Browse tab will instantly buy it out.", 0.5, 0.5, 1.0, 1) GameTooltip:Show() diff --git a/options.xml b/options.xml index e4dba9b..5dd57fe 100644 --- a/options.xml +++ b/options.xml @@ -19,7 +19,7 @@ - Aux_ShowOptionsFrame() + Aux.options.show() @@ -27,7 +27,7 @@ - + @@ -38,13 +38,13 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -71,13 +71,13 @@ - + - + @@ -87,21 +87,21 @@ - - + @@ -110,23 +110,23 @@ - + - + - + - Aux_ShowTooltip_EnableAlt() + Aux.options.show_sell_shortcut_tooltip() GameTooltip:Hide() @@ -134,14 +134,13 @@ - - + - + - + @@ -150,7 +149,7 @@ - Aux_ShowTooltip_EnableAlt() + Aux.options.show_sell_shortcut_tooltip() GameTooltip:Hide() @@ -161,17 +160,17 @@ - + - + - Aux_ShowTooltip_OpenFirst() + Aux.options.show_buy_shortcut_tooltip() GameTooltip:Hide() @@ -179,13 +178,13 @@ - + - + - + @@ -194,7 +193,7 @@ - Aux_ShowTooltip_OpenFirst() + Aux.options.show_buy_shortcut_tooltip() GameTooltip:Hide() @@ -205,17 +204,17 @@ - + - + - Aux_ShowTooltip_InstantBuyout() + Aux.options.show_open_sell_tooltip() GameTooltip:Hide() @@ -223,13 +222,111 @@ - + - + - + + + + + + + + + + if this:GetChecked() then + AuxOptionsOpenBuy:SetChecked(false) + end + + + Aux.options.show_open_sell_tooltip() + + + GameTooltip:Hide() + + + + + + + + + + + + + + + + + + Aux.options.show_open_buy_tooltip() + + + GameTooltip:Hide() + + + + + + + + + + + + + + + + + + + + if this:GetChecked() then + AuxOptionsOpenSell:SetChecked(false) + end + + + Aux.options.show_open_buy_tooltip() + + + GameTooltip:Hide() + + + + + + + + + + + + + + + + + + Aux.options.show_instant_buyout_tooltip() + + + GameTooltip:Hide() + + + + + + + + + + + @@ -238,14 +335,13 @@ - Aux_ShowTooltip_InstantBuyout() + Aux.options.show_instant_buyout_tooltip() GameTooltip:Hide() - @@ -256,12 +352,12 @@ - + - -