Beispiel #1
0
        public bool GenericGoToSysWindow(uint sys_id, params object[] args)
        {
            //先判断是否有下拉系统列表
            DBSysConfig.SysConfig config = DBSysConfig.Instance.GetConfigById(sys_id);
            if (config.DropDown != null && config.DropDown.Count > 0)
            {
                if (!SysConfigManager.GetInstance().CheckSysHasOpened(sys_id, true))
                {
                    return(false);
                }
                if (!CheckSysDownloaded(sys_id))
                {
                    return(false);
                }

                if (config.DropDownType == 0)
                {
                    UIManager.GetInstance().ShowWindow("UISysDropDownWindow", sys_id, args);
                }
                else if (config.DropDownType == 1)
                {
                    //只有韩国版开放
                    if (Const.Region == RegionType.KOREA)
                    {
                        UIManager.GetInstance().ShowWindow("UIActivityEntryWindow", sys_id, args);
                    }
                }

                return(true);
            }

            //只有韩国版开放
            if (Const.Region == RegionType.KOREA)
            {
                //如果是正常跳转到系统界面,需要关闭下拉窗
                if (UIManager.GetInstance().GetWindow("UISysDropDownWindow") != null)
                {
                    UIManager.GetInstance().CloseWindow("UISysDropDownWindow");
                }
                if (UIManager.GetInstance().GetWindow("UIActivityEntryWindow") != null)
                {
                    UIManager.GetInstance().CloseWindow("UIActivityEntryWindow");
                }
            }

            //再执行正常流程
            OpenSysWindowDelegate dlg;

            if (RouterDict.TryGetValue(sys_id, out dlg))
            {
                dlg(args);
            }
            else
            {
                UINotice.Instance.ShowMessage(xc.DBConstText.GetText("MODULE_IS_DEVELOPING"));
                GameDebug.LogError(string.Format("没有配置系统({0})的点击事件!", sys_id));
            }

            return(true);
        }
Beispiel #2
0
        public void OpenSys(DBSysConfig.SysConfig config, bool fire_evet = true)
        {
            if (mWaitingSysList.Contains(config))
            {
                mWaitingSysList.Remove(config);
            }

            if (!mRawOpenSysIds.Contains(config.Id))
            {
                mRawOpenSysIds.Add(config.Id);
            }

            if (!mOpenSysDic.ContainsKey(config.Id))
            {
                mOpenSysList.Add(config);
                mOpenSysList.Sort();
                mOpenSysDic[config.Id] = config;
            }

            if (fire_evet)
            {
                ClientEventMgr.Instance.FireEvent((int)ClientEvent.CE_SYS_OPEN, new CEventBaseArgs(config));

                // 在野外需要发送特殊的系统开启事件
                if (xc.SceneHelp.Instance.IsInWildInstance())
                {
                    ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_SYS_OPEN_POST, new CEventBaseArgs(config.Id));
                }
                else
                {
                    ClientEventMgr.GetInstance().PostEvent((int)ClientEvent.CE_SYS_OPEN_POST, new CEventBaseArgs(config.Id));
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// 响应系统开放的网络消息
        /// </summary>
        /// <param name="sys_id"></param>
        public void HandleNotifySysOpen(uint sys_id)
        {
            GameDebug.LogRed("系统开启,ID: " + sys_id);

            var sys_config = DBManager.Instance.GetDB <DBSysConfig>().GetConfigById(sys_id);

            if (sys_config == null)
            {
                List <string> spe_sys_config = DBManager.Instance.QuerySqliteField <string>(GlobalConfig.DBFile, "sys_config", "sys_id", sys_id, "sys_type");
                if (spe_sys_config.Count == 0)
                {
                    GameDebug.LogError("没有对应的系统开放配置,ID: " + sys_id);
                }
                else
                {
                    uint sys_type = 0;
                    uint.TryParse(spe_sys_config[0], out sys_type);

                    if (sys_type == 1)// sys_type为1时表示不通过系统开发逻辑控制的系统(比如怒气技能的开放)
                    {
                        ClientEventMgr.Instance.FireEvent((int)ClientEvent.CE_SYS_SPECIAL, new CEventBaseArgs(sys_id));
                    }
                    else
                    {
                        GameDebug.LogError("读取对应的系统开放配置时有遗漏,ID: " + sys_id);
                    }
                }

                return;
            }
            //OpenSys(sys_config);
            var in_close_list = mClosedSysList.Remove(sys_config);

            mClosedSysList.Sort();
            if (in_close_list && sys_id != GameConst.SYS_OPEN_GOD_WARE)
            {
                // 如果是之前已经关闭的系统, 再此开启的时候,不播放动画
                OpenSys(sys_config);
                //ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_RE_OPEN_SYS, new CEventBaseArgs(sys_config));
            }
            else
            {
                if (sys_config.NeedAnim == false)
                {
                    OpenSys(sys_config);
                }
                else
                {
                    DBSysConfig.SysConfig config = mWaitingSysList.Find(delegate(DBSysConfig.SysConfig _config) { return(_config.Id == sys_config.Id); });
                    if (config == null)
                    {
                        mWaitingSysList.Add(sys_config);
                    }
                }
            }

            ClientEventMgr.Instance.FireEvent((int)ClientEvent.CE_SYS_OPEN_NOTIFY, new CEventBaseArgs(sys_id));
        }
Beispiel #4
0
 public void Update(CEventBaseArgs eventParam)
 {
     if (eventParam == null || eventParam.arg == null)
     {
         return;
     }
     DBSysConfig.SysConfig config = eventParam.arg as DBSysConfig.SysConfig;
     FreshBySystemId(config.Id);
 }
Beispiel #5
0
            public void AddSysConfig(DBSysConfig.SysConfig sys)
            {
                if (ChildSysConfigs == null)
                {
                    ChildSysConfigs = new List <DBSysConfig.SysConfig>();
                }


                ChildSysConfigs.Add(sys);
                ChildSysConfigs.Sort();
            }