ingame/guild/gamepad/guildheraldry_gamepad.lua:82 -- GUILD_HERALDRY_GAMEPAD_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState)
if newState == SCENE_SHOWING then
self:PerformDeferredInitialization()
MAIN_MENU_MANAGER:SetBlockingScene("guildHeraldry_gamepad", OnBlockingSceneActivated)
self.pendingTransaction = false
self:PopulateCategories()
self:PopulateStyleCategoryLists() -- Depends on PopulateCategories being called first.
self.categoryList:Activate()
KEYBIND_STRIP:AddKeybindButtonGroup(self.categoryKeybindStripDescriptor)
self:RegisterEvents()
StartHeraldryCustomization(self.guildId)
KEYBIND_STRIP:RemoveDefaultExit()
KEYBIND_STRIP:AddKeybindButtonGroup(self.globalKeybindStripDescriptor)
elseif newState == SCENE_HIDING then
EndHeraldryCustomization()
self:UnregisterEvents()
self:SetDirectionalInputEnabled(false)
self:SetPendingExit(false)
-- Remove all keybind groups that may have been added
KEYBIND_STRIP:RemoveKeybindButtonGroup(self.globalKeybindStripDescriptor)
KEYBIND_STRIP:RemoveKeybindButtonGroup(self.categoryKeybindStripDescriptor)
KEYBIND_STRIP:RemoveKeybindButtonGroup(self.colorKeybindStripDescriptor)
KEYBIND_STRIP:RemoveKeybindButtonGroup(self.styleCategoryKeybindStripDescriptor)
KEYBIND_STRIP:RemoveKeybindButtonGroup(self.styleKeybindStripDescriptor)
KEYBIND_STRIP:RestoreDefaultExit()
self.activeKeybindStripDescriptor = nil
GAMEPAD_NAV_QUADRANT_1_BACKGROUND_FRAGMENT:TakeFocus()
-- Deactivate the active element to remove the tigger keybinds associated with the active control manager
if self.categoryList:IsActive() then
self.categoryList:Deactivate()
end
if self.colorGridList:IsActive() then
self.colorGridList:Deactivate()
end
self:DeactivateCurrentFocus()
end
end)