options refactoring and added control-click search shortcut

This commit is contained in:
Manuel Simon Hirsig
2015-09-27 13:11:47 +02:00
parent 0ee3ed6723
commit 65ec994554
5 changed files with 224 additions and 92 deletions
+59 -33
View File
@@ -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("<html><body>"
@@ -18,59 +21,71 @@ function Aux_ShowDescriptionFrame()
.."</p><br/><h1>Aux Buy</h1><br/><p>"
.."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."
.."</p>"
.."</body></html>")
.."</body></html>")
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()