diff --git a/lua/app/common/event_manager.lua b/lua/app/common/event_manager.lua index 4c4832b5..1d39ba63 100644 --- a/lua/app/common/event_manager.lua +++ b/lua/app/common/event_manager.lua @@ -49,6 +49,7 @@ EventManager.CUSTOM_EVENT = { ARENA_AD_BOX_SUCCESS = "ARENA_AD_BOX_SUCCESS",-- ad宝箱获取成功 COLLECTION_CLICK_GET_POINT = "COLLECTION_CLICK_GET_POINT", EQUIP_UPGRADE_SUCCESS = "EQUIP_UPGRADE_SUCCESS", + GO_DUNGEON_UI = "GO_DUNGEON_UI", -- BORAD_TOUCH_BEGIN = "BORAD_TOUCH_BEGIN", -- BORAD_TOUCH_OVER = "BORAD_TOUCH_OVER" DUNGEON_ARMOR_TO_TARGET_ID = "DUNGEON_ARMOR_TO_TARGET_ID", diff --git a/lua/app/ui/dungeon/cell/dungeon_target_cell.lua b/lua/app/ui/dungeon/cell/dungeon_target_cell.lua index dd3eb03f..916695ab 100644 --- a/lua/app/ui/dungeon/cell/dungeon_target_cell.lua +++ b/lua/app/ui/dungeon/cell/dungeon_target_cell.lua @@ -72,6 +72,7 @@ function DungeonTargetCell:showWeapon() ModuleManager.DungeonWeaponManager:reqSweep(self.dungeonId, self.target) else ModuleManager.DungeonWeaponManager:showMainUI() + EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GO_DUNGEON_UI) end end) end @@ -117,6 +118,7 @@ function DungeonTargetCell:showArmor() ModuleManager.DungeonArmorManager:reqSweep(self.dungeonId, self.target) else ModuleManager.DungeonArmorManager:showMainUI() + EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GO_DUNGEON_UI) end end) end diff --git a/lua/app/ui/dungeon/item_get_ui.lua b/lua/app/ui/dungeon/item_get_ui.lua index 9d5b4a90..ddffc570 100644 --- a/lua/app/ui/dungeon/item_get_ui.lua +++ b/lua/app/ui/dungeon/item_get_ui.lua @@ -83,6 +83,9 @@ function ItemGetUI:onLoadRootComplete() self.btnClose:addClickListener(function() self:closeUI() end) + self:addEventListener(EventManager.CUSTOM_EVENT.GO_DUNGEON_UI, function() + self:closeUI() + end) end function ItemGetUI:onRefresh() diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index a7094f00..a67ebfec 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -117,6 +117,9 @@ function HeroDetailUI:onLoadRootComplete() self:addEventListener(EventManager.CUSTOM_EVENT.EQUIP_UPGRADE_SUCCESS, function() self:refreshShow() end) + self:addEventListener(EventManager.CUSTOM_EVENT.GO_DUNGEON_UI, function() + self:closeUI() + end) self:bind(DataManager.BagData.ItemData:getItemById(GConst.ItemConst.ITEM_ID_GOLD), "isDirty", function() self:refreshShow() end)