CHATGPT AI
end
function UIManager:onShow()
self.m_isShow = true;
for _, v in pairs(self.m_uiList) do
if v.onShow then
v:onShow();
end
end
self:updateUIPos();
--清除缓存的消息,以及重新订阅消息
if self.m_curUI then
local uiName = self.m_curUI:getName();
MsgDispatcher.unregisterMsg(uiName);
MsgDispatcher.registerMsg(uiName, self);
if self.m_curUI and self.m_curUI["initData"] then --初始化数据,用于处理页面切换时,重新加载数据的情况。
self.m_curUI:initData();
end
end
if self.m_preUI and self.m_preUI["onHide"] then --初始化数据,用于处理页面切换时,重新加载数据的情况。
self.m_preUI:onHide();
end
if not tolua.isnull(self._topNode) then --全屏界面不显示topNode 如大厅、房间等界面不显示topNode; 而且在这些界面中会有特定的topNode显示。 比如大厅有一个大厅TopNode; 房间有一个房间TopNode; 后台也有一个后台TopNode; 在这几个特定的界面中会在进入时创建对应的TopNode。 在其他界面中都会使用UIManager中的TopNode。 所以在UIManager中要根据当前打开的界面来显示/隐藏 TopNode; 目前使用该方法是因为直接将UIManager中的TopNode隐藏会造成其他特定界面也隐藏;而不能单独隐藏UIManager中的TopNode; 所以就使用该方法来处理。 如有新方法可以另行处理。 by wangtianye 2018-07-18 17:00:30
if not tolua.isnull(self._topPanel) and not tolua.isnull(self._topPanel._root) then --如果当前有特定的topPanel, 那么不显示UIManager中的topPanel; 如大厅、房间等界面不显示UIManager中的topPanel; by wangtianye 2018-07-18 16:59:19
local name = self._curPageName or ""; --当前打开的界面名字 by wangtianye 2018-07-18 16:59:32
local isFullScreenPage = false; --是否是全屏界面 by wangtianye 2018-07-18 16:59:51
for i=1, #self._fullScreenPages do --遍历全屏界面列表 by wangtianye 2018-07-18 17:00:04
local pageName = self._fullScreenPages[i]; --遍历全屏界面名字 by wangtianye 2018-07-18 17:00:15
if pageName == name then --如果当前打开的是全屏界面 by wangtianye 2018-07-18 17
function UIManager:onShow()
self.m_isShow = true;
for _, v in pairs(self.m_uiList) do
if v.onShow then
v:onShow();
end
end
self:updateUIPos();
--清除缓存的消息,以及重新订阅消息
if self.m_curUI then
local uiName = self.m_curUI:getName();
MsgDispatcher.unregisterMsg(uiName);
MsgDispatcher.registerMsg(uiName, self);
if self.m_curUI and self.m_curUI["initData"] then --初始化数据,用于处理页面切换时,重新加载数据的情况。
self.m_curUI:initData();
end
end
if self.m_preUI and self.m_preUI["onHide"] then --初始化数据,用于处理页面切换时,重新加载数据的情况。
self.m_preUI:onHide();
end
if not tolua.isnull(self._topNode) then --全屏界面不显示topNode 如大厅、房间等界面不显示topNode; 而且在这些界面中会有特定的topNode显示。 比如大厅有一个大厅TopNode; 房间有一个房间TopNode; 后台也有一个后台TopNode; 在这几个特定的界面中会在进入时创建对应的TopNode。 在其他界面中都会使用UIManager中的TopNode。 所以在UIManager中要根据当前打开的界面来显示/隐藏 TopNode; 目前使用该方法是因为直接将UIManager中的TopNode隐藏会造成其他特定界面也隐藏;而不能单独隐藏UIManager中的TopNode; 所以就使用该方法来处理。 如有新方法可以另行处理。 by wangtianye 2018-07-18 17:00:30
if not tolua.isnull(self._topPanel) and not tolua.isnull(self._topPanel._root) then --如果当前有特定的topPanel, 那么不显示UIManager中的topPanel; 如大厅、房间等界面不显示UIManager中的topPanel; by wangtianye 2018-07-18 16:59:19
local name = self._curPageName or ""; --当前打开的界面名字 by wangtianye 2018-07-18 16:59:32
local isFullScreenPage = false; --是否是全屏界面 by wangtianye 2018-07-18 16:59:51
for i=1, #self._fullScreenPages do --遍历全屏界面列表 by wangtianye 2018-07-18 17:00:04
local pageName = self._fullScreenPages[i]; --遍历全屏界面名字 by wangtianye 2018-07-18 17:00:15
if pageName == name then --如果当前打开的是全屏界面 by wangtianye 2018-07-18 17
function UIManager:onShow()
self.m_isShow = true;
for _, v in pairs(self.m_uiList) do
if v.onShow then
v:onShow();
end
end
self:updateUIPos();
--清除缓存的消息,以及重新订阅消息
if self.m_curUI then
local uiName = self.m_curUI:getName();
MsgDispatcher.unregisterMsg(uiName);
MsgDispatcher.registerMsg(uiName, self);
if self.m_curUI and self.m_curUI["initData"] then --初始化数据,用于处理页面切换时,重新加载数据的情况。
self.m_curUI:initData();
end
end
if self.m_preUI and self.m_preUI["onHide"] then --初始化数据,用于处理页面切换时,重新加载数据的情况。
self.m_preUI:onHide();
end
if not tolua.isnull(self._topNode) then --全屏界面不显示topNode 如大厅、房间等界面不显示topNode; 而且在这些界面中会有特定的topNode显示。 比如大厅有一个大厅TopNode; 房间有一个房间TopNode; 后台也有一个后台TopNode; 在这几个特定的界面中会在进入时创建对应的TopNode。 在其他界面中都会使用UIManager中的TopNode。 所以在UIManager中要根据当前打开的界面来显示/隐藏 TopNode; 目前使用该方法是因为直接将UIManager中的TopNode隐藏会造成其他特定界面也隐藏;而不能单独隐藏UIManager中的TopNode; 所以就使用该方法来处理。 如有新方法可以另行处理。 by wangtianye 2018-07-18 17:00:30
if not tolua.isnull(self._topPanel) and not tolua.isnull(self._topPanel._root) then --如果当前有特定的topPanel, 那么不显示UIManager中的topPanel; 如大厅、房间等界面不显示UIManager中的topPanel; by wangtianye 2018-07-18 16:59:19
local name = self._curPageName or ""; --当前打开的界面名字 by wangtianye 2018-07-18 16:59:32
local isFullScreenPage = false; --是否是全屏界面 by wangtianye 2018-07-18 16:59:51
for i=1, #self._fullScreenPages do --遍历全屏界面列表 by wangtianye 2018-07-18 17:00:04
local pageName = self._fullScreenPages[i]; --遍历全屏界面名字 by wangtianye 2018-07-18 17:00:15
if pageName == name then --如果当前打开的是全屏界面 by wangtianye 2018-07-18 17
0 Comments & Tags
0 condivisioni
1 Views