Added in cycling on the Guild panel. Only on the dropdown area though.

Wobin [04-28-14 - 14:24]
Added in cycling on the Guild panel. Only on the dropdown area though.
Filename
GuildBankCycler.lua
diff --git a/GuildBankCycler.lua b/GuildBankCycler.lua
index 56c77e7..da87411 100644
--- a/GuildBankCycler.lua
+++ b/GuildBankCycler.lua
@@ -10,20 +10,36 @@ GuildBankCycler.guildCount = 0
 GuildBankCycler.dropDownLookup = {}
 GuildBankCycler.dropDownIndex = {}

+-- You know what's weird? These Layer Pushed combos, that's what. Guild panel seems to be some combination of the below. 4/4 is guild bank/shop
+local layers = {
+    [22] = true,
+    [23] = true,
+    [24] = true,
+    [44] = true,
+    [62] = true,
+    [63] = true,
+    [64] = true,
+    [82] = true,
+    [83] = true,
+    [84] = true,
+}

 local currentSelector = nil

 function GuildBankCycler:SelectorPushed(...)
 	local eventId, a, b = ...
-	if not (a == b and a == 4) then return end
+    d(a*10 + b)
+	if not (layers[a*10 + b]) then return end

 	local control = (not ZO_SelectGuildBankDialogGuild:IsHidden() and ZO_SelectGuildBankDialogGuild)
 					or
 					(not ZO_SelectTradingHouseGuildDialogGuild:IsHidden() and ZO_SelectTradingHouseGuildDialogGuild)
+                    or
+                    (not ZO_GuildSelector:IsHidden() and ZO_GuildSelectorComboBox)
 					or nil

 	if not control then return end
-
+	d("found match")
 	local dropDown = control.m_comboBox
 	local entries = dropDown:GetItems()

@@ -31,9 +47,9 @@ function GuildBankCycler:SelectorPushed(...)
 	self.dropDownLookup[control] = {}
 	self.dropDownIndex[control] = {}
 	for index,entry in ipairs(entries) do
-		self.dropDownLookup[control][entry.guildId] = entry
-		self.dropDownIndex[control][index] = entry.guildId
-		if entry.guildText == dropDown:GetSelectedItem() then currentSelector = index end
+		self.dropDownLookup[control][entry.guildId or self.guildCount] = entry
+		self.dropDownIndex[control][index] = entry.guildId or self.guildCount
+		if entry.guildText or entry.selectedText == dropDown:GetSelectedItem() then currentSelector = index end
 	end
 end

@@ -68,7 +84,8 @@ local function GuildBankCyclerLoaded(eventCode, addOnName)
     end
 	ZO_PreHookHandler(ZO_SelectGuildBankDialogModalUnderlay, "OnMouseWheel", function(...) GuildBankCycler:ChangeGuildSelected( ZO_SelectGuildBankDialogGuild, ...) end)
 	ZO_PreHookHandler(ZO_SelectTradingHouseGuildDialogModalUnderlay, "OnMouseWheel", function(...) GuildBankCycler:ChangeGuildSelected( ZO_SelectTradingHouseGuildDialogGuild, ...) end)
-	EVENT_MANAGER:RegisterForEvent("GuildBankCyclerGuildSelector", EVENT_ACTION_LAYER_PUSHED, function(...) GuildBankCycler:SelectorPushed(...) end)
+	ZO_PreHookHandler(ZO_GuildSelectorComboBox, "OnMouseWheel", function(...) GuildBankCycler:ChangeGuildSelected( ZO_GuildSelectorComboBox, ...) end)
+	EVENT_MANAGER:RegisterForEvent("GuildBankCyclerGuildSelector", EVENT_ACTION_LAYER_PUSHED, function(...) GuildBankCycler:SelectorPushed(...) end)
 end

 EVENT_MANAGER:RegisterForEvent("GuildBankCyclerLoaded", EVENT_ADD_ON_LOADED, GuildBankCyclerLoaded)
\ No newline at end of file