Browse Source

fix gathering from personal and realm banks

pull/27/head
soltanikian 5 months ago
parent
commit
61f80fc1c1
  1. 15
      TradeSkillMaster_Crafting/Modules/CraftingGUI.lua
  2. 2
      TradeSkillMaster_Crafting/Modules/Gather.lua

15
TradeSkillMaster_Crafting/Modules/CraftingGUI.lua

@ -2622,8 +2622,19 @@ function GUI:GatheringEventHandler(event)
if not GUI.gatheringFrame or not GUI.gatheringFrame:IsShown() then return end
if event == "GUILDBANKFRAME_OPENED" then
private.currentSource = UnitName("player")
private.currentTask = L["Visit Guild Bank"]
-- Ascension WoW: Detect bank type based on first tab name
local numTabs = GetNumGuildBankTabs()
local firstTabName = numTabs > 0 and GetGuildBankTabInfo(1) or nil
if firstTabName == "Personal Bank" then
private.currentSource = UnitName("player")
private.currentTask = L["Visit Personal Bank"]
elseif firstTabName == "Realm Bank" then
private.currentSource = L["Realm Bank"]
private.currentTask = L["Visit Realm Bank"]
else
private.currentSource = UnitName("player")
private.currentTask = L["Visit Guild Bank"]
end
elseif event == "GUILDBANKFRAME_CLOSED" then
private.currentSource = nil
private.currentTask = nil

2
TradeSkillMaster_Crafting/Modules/Gather.lua

@ -34,7 +34,7 @@ function Gather:gatherItems(source, task)
if source == L["Vendor"] then
Gather:BuyFromMerchant(items)
elseif source == UnitName("player") and (task == L["Visit Bank"] or task == L["Visit Guild Bank"]) then
elseif (source == UnitName("player") or source == L["Realm Bank"]) and (task == L["Visit Bank"] or task == L["Visit Guild Bank"] or task == L["Visit Personal Bank"] or task == L["Visit Realm Bank"]) then
Gather:GatherBank(items)
elseif source == UnitName("player") and task == L["Mail Items"] then
Gather:MailItems(items)

Loading…
Cancel
Save