mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-03 04:00:02 +00:00
autovendor: abort when merchant window is closed
This commit is contained in:
@@ -70,6 +70,9 @@ pfUI:RegisterModule("autovendor", "vanilla:tbc", function ()
|
||||
this.count = this.count + 1
|
||||
end
|
||||
|
||||
-- abort if the merchant window disappeared
|
||||
if not this.merchant then return end
|
||||
|
||||
-- clear cursor and sell the item
|
||||
ClearCursor()
|
||||
UseContainerItem(bag, slot)
|
||||
@@ -82,11 +85,16 @@ pfUI:RegisterModule("autovendor", "vanilla:tbc", function ()
|
||||
end)
|
||||
|
||||
autovendor:RegisterEvent("MERCHANT_SHOW")
|
||||
autovendor:RegisterEvent("MERCHANT_CLOSED")
|
||||
autovendor:RegisterEvent("MERCHANT_UPDATE")
|
||||
autovendor:SetScript("OnEvent", function()
|
||||
autovendor.button:Update()
|
||||
|
||||
if event == "MERCHANT_SHOW" then
|
||||
if event == "MERCHANT_CLOSED" then
|
||||
autovendor.merchant = nil
|
||||
autovendor:Hide()
|
||||
elseif event == "MERCHANT_SHOW" then
|
||||
autovendor.merchant = true
|
||||
if C["global"]["autorepair"] == "1" then
|
||||
RepairItems()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user