| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- local NPCCommand = class('NPCCommand', framework.SimpleCommand)
- local STATE_TAG = 99
- function NPCCommand:ctor()
- end
- function NPCCommand:execute(notification)
- local data = notification:getBody()
-
-
- end
- -------------------------------------------下面代码勿删勿删 ---------------------------------------------------
- -------------------------------------------下面代码勿删勿删 ---------------------------------------------------
- -------------------------------------------下面代码勿删勿删 ---------------------------------------------------
- -- require "UlSystems/Common/IDefine"
- -- require 'Common/StackList'
- UIManager = {}
- local this = UIManager
- local ctrlList = {}
- local panelStack = nil
- --[[
- 对table运用mm L<度要求
- ]]
- function this.Init()
- logWarn("ctrl mgr init Ctrl len is :")
- panelStack = StackList:New()
- for panelName, path in pairs(UlPanels) do
- require (path.. panelName)
- --log('req panel name : ' .. panelName)
- local panel = panelName
- --替换字符串
- local ctrlName = string.gsub(panelName, 'Panel', 'Ctrl')
- local ctrl = require(path.. ctrlName)
- if type(ctrl) == 'boolean' then
- error (" require Ctrl error, 找不至lj lua 文件 path: *.. path.. ctrlName")
- end
- ctrlList[panelName] = ctrl
- --attempt to index a boolean value
- --出碰上面那个错,说明require路径没写对
- ctrlList[panelName].panelName = panel--这里赋值 panel 给 UlCtrl
- ctrlList[panelName].Init()
- end
- end
- local curPanelCtrl = nil
- function this.ShowPanel(panelName, data)
- --local topPaneLName = this. panelStack:GetTop()
- local beforePanelCtrl = curPanelCtrl
- local openPanelCtrl = ctrlList[panelName]
- if openPanelCtrl.uiShowType == nil then
- openPanelCtrl.uiShowType = UiShowType.ShowOnly
- end
- local showType = openPanelCtrl.uiShowType
- if showType == UiShowType.Switch and beforePanelCtrl ~= nil then
- beforePanelCtrl:HidePanel()
- end
- if showType == UiShowType.Top then
- -- openPEinelClrl. genneObject:SetAsLastSibling()
- end
- if showType ~= UiShowType.Stack then
- --如果没有根,push BasePanel,作为根Panel
- if panelStack:Comit() == 0 then
- panelStack:Push(beforePanelCtrl.panelName)
- end
- this.PushPanelStack(openPanelCtrl.panelName)
- end
-
- if showType == UIShowType.HideOthers then
- end
- -- panelStack:ToString()
- openPanelCtrl:ShowPanel(data)
- curPanelCtrl = openPanelCtrl
- --this.panelStack:Push(panelNamc)
- --this.panelStack:ToString()
- end
- function this.PushPanelStack(panelName)
- panelStack:Push(panelName)
- end
- function this.IlideTopPanel()
- local topPanelName = this.panelStack:GetTop()
- this.HidePanel(topPanelName)
- end
- function this.GetPanelCtrl(panelName)
- return ctrlList[panelName]
- end
- function this.HidePanel(panelName, data)
- local panelCtrl = ctrlList[panelName]
- if panelCtrl.uiShowType == UIShowType.Stack then
- local popPaneIName = panelStack:Pop()
- if panelName ~= popPanelName then
- logError('Pop panel name error'.. popPanelName)
- panelStack:Push(popPanelName)
- else
- --正常pop
- local parentCtrlName = panelStack:GctTop()
- local parentCtrl = ctrlList[parentCtrlName]
- -- pop时反向传值给父Panel
- if parentCtrl.OnPopPanel ~= nil and type(parentCtrl. OnPopPanel) == 'function' then
- parentCtrl.OnPopPanel(panelName, data)
- end
- ctrlList[panelName]:HidePanel()
- end
- else
- ctrlList[panelName]:HidePanel()
- end
- --只有一个了,留着无意义了
- if panelStack:Count() <= 1 then
- panelStack:Clear()
- end
- --panelStack:ToString()
- end
- function this.DestroyPanel(panelName)
- ctrlList[panelName]:DestroyPanel()
- end
- -- return {
- -- versioninfo =
- -- date = * 2017-1-16 16:54:22',
- -- checkvalue = ' d882d8b2d51a75dacbl7cfc6cda432455, version = 1484556862,
- -- creater = ' JUN'
- -- },
- return NPCCommand
|