public void bindui(Action <IUI, Variant> cb, Variant data)
        {
            if (m_bindFlag)
            {
                return;
            }

            if (g_mgr.showLoading(this))
            {
                onLoading();
            }

            BaseLGUI thisptr = this;

            m_bindFlag = true;
            g_mgr.getUI(
                this.uiName,
                (IUI u, Variant info) =>
            {
                onLoadingEnd();
                if (u == null)
                {
                    DebugTrace.add(Define.DebugTrace.DTT_ERR, " bindui [" + uiName + "] Err!  ");
                    return;
                }
                m_uiF = u;
                m_uiF.setCtrl(thisptr);
                init();
                cb(u, info);
            },
                data
                );
        }
Beispiel #2
0
        public void bindui(Action <IUI, Variant> cb, Variant data)
        {
            bool bindFlag = this.m_bindFlag;

            if (!bindFlag)
            {
                bool flag = this.g_mgr.showLoading(this);
                if (flag)
                {
                    this.onLoading();
                }
                BaseLGUI thisptr = this;
                this.m_bindFlag = true;
                this.g_mgr.getUI(this.uiName, delegate(IUI u, Variant info)
                {
                    this.onLoadingEnd();
                    bool flag2 = u == null;
                    if (flag2)
                    {
                        DebugTrace.add(Define.DebugTrace.DTT_ERR, " bindui [" + this.uiName + "] Err!  ");
                    }
                    else
                    {
                        this.m_uiF = u;
                        this.m_uiF.setCtrl(thisptr);
                        this.init();
                        cb(u, info);
                    }
                }, data);
            }
        }
        private void openSwitch(GameEvent e)
        {
            Variant d    = e.data;
            string  name = d["name"];
            Variant info = null;

            if (d.ContainsKey("data"))
            {
                info = d["data"] as Variant;
            }
            if (!(m_uiCtrlMap.ContainsKey(name)))
            {
                _openUI(name, info);
                return;
            }
            BaseLGUI lgui = m_uiCtrlMap[name] as BaseLGUI;

            if (lgui.isOpen)
            {
                lgui.close();
            }
            else
            {
                lgui.open(info);
            }
        }
Beispiel #4
0
        private void openSwitch(GameEvent e)
        {
            Variant data  = e.data;
            string  text  = data["name"];
            Variant data2 = null;
            bool    flag  = data.ContainsKey("data");

            if (flag)
            {
                data2 = data["data"];
            }
            bool flag2 = !this.m_uiCtrlMap.ContainsKey(text);

            if (flag2)
            {
                this._openUI(text, data2);
            }
            else
            {
                BaseLGUI baseLGUI = this.m_uiCtrlMap[text];
                bool     isOpen   = baseLGUI.isOpen;
                if (isOpen)
                {
                    baseLGUI.close();
                }
                else
                {
                    baseLGUI.open(data2);
                }
            }
        }
Beispiel #5
0
        public BaseLGUI getLGTUIInst(string lguiName, string uiName, Action <IUI, Variant> cb, Variant data)
        {
            bool     flag = lguiName != "UI_BASE";
            BaseLGUI baseLGUI;
            BaseLGUI result;

            if (flag)
            {
                baseLGUI = (base.createInst(this.tracsLguiName(lguiName), false) as BaseLGUI);
                bool flag2 = baseLGUI == null;
                if (flag2)
                {
                    GameTools.PrintNotice(" getLGTUIInst LGUIClass[" + lguiName + "]  err!!");
                    result = null;
                    return(result);
                }
            }
            else
            {
                baseLGUI = new BaseLGUI(this);
            }
            baseLGUI.uiName = uiName;
            baseLGUI.bindui(cb, data);
            result = baseLGUI;
            return(result);
        }
Beispiel #6
0
 virtual public void dispose()
 {
     if (_win != null)
     {
         _win.dispose();
     }
     _eventReceiver = null;
     g_mgr          = null;
     _ctrl          = null;
 }
Beispiel #7
0
        public virtual void dispose()
        {
            bool flag = this._win != null;

            if (flag)
            {
                this._win.dispose();
            }
            this._eventReceiver = null;
            this.g_mgr          = null;
            this._ctrl          = null;
        }
        //获取逻辑UI
        public BaseLGUI getLGUI(string lguiName)
        {
            BaseLGUI lgui = null;

            if (!(m_uiCtrlMap.ContainsKey(lguiName)))
            {
                lgui = createInst(tracsLguiName(lguiName), true) as BaseLGUI;
                if (lgui == null)
                {
                    GameTools.PrintNotice(" createInst LGUIClass[ " + lguiName + " ] err!");
                    return(null);
                }
                lgui.uiName           = lguiName;
                m_uiCtrlMap[lguiName] = lgui;
            }
            lgui = m_uiCtrlMap[lguiName] as BaseLGUI;
            return(lgui);
        }
        public BaseLGUI getLGTUIInst(string lguiName, string uiName, Action <IUI, Variant> cb, Variant data)
        {
            BaseLGUI lgui = null;

            if (lguiName != "UI_BASE")
            {
                lgui = createInst(tracsLguiName(lguiName), false) as BaseLGUI;

                if (lgui == null)
                {            //todo err
                    GameTools.PrintNotice(" getLGTUIInst LGUIClass[" + lguiName + "]  err!!");
                    return(null);
                }
            }
            else
            {
                lgui = new BaseLGUI(this);
            }

            lgui.uiName = uiName;
            lgui.bindui(cb, data);
            return(lgui);
        }
Beispiel #10
0
 public void setCtrl(BaseLGUI ctrl)
 {
     this._ctrl = ctrl;
     this.onSetCtrl();
 }
 virtual public void onLoadingUIEnd(BaseLGUI ui)
 {
 }
 virtual public bool showLoading(BaseLGUI ui)
 {
     return(false);
 }
Beispiel #13
0
 public void setCtrl(BaseLGUI ctrl)
 {
     _ctrl = ctrl;
     onSetCtrl();
 }
Beispiel #14
0
 public virtual void onLoadingUI(BaseLGUI ui)
 {
 }