Exemple #1
0
 private bool EqualsMapID(uint nMapID)
 {
     Client.IMapSystem ms = Client.ClientGlobal.Instance().GetMapSystem();
     if (ms == null)
     {
         return(false);
     }
     return(ms.GetMapID() == nMapID);
 }
Exemple #2
0
    public void ShowMain(bool bFirst = false)
    {
        ClearCacheStack();

        if (!IsShowPanel(PanelID.RoleStateBarPanel))
        {
            ShowPanel(PanelID.RoleStateBarPanel);
        }

        if (DataManager.Manager <ArenaManager>().EnterArena == false)
        {
            ShowPanel(PanelID.MissionAndTeamPanel);
        }

        ShowPanel(PanelID.MainPanel);
        Client.IMapSystem ms = Client.ClientGlobal.Instance().GetMapSystem();
        if (ms != null)
        {
            if (ms.GetMapID() != GameTableManager.Instance.GetGlobalConfig <int>("HomeSceneID"))
            {
                //ShowPanel( PanelID.SkillPanel );
            }
        }

        //阵营战  打开战斗界面
        if (DataManager.Manager <CampCombatManager>().isEnterScene)
        {
            DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.CampFightingPanel);
        }
        //城战  打开城战战斗界面
        if (DataManager.Manager <CityWarManager>().EnterCityWar)
        {
            DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.CityWarFightingPanel);
        }

        ShowPanel(PanelID.GuideUnconstrainPanel);
        //if (DataManager.Manager<ComBatCopyDataManager>().EnterCopyID ==0)//非副本才显示
        if (!DataManager.Manager <ComBatCopyDataManager>().IsEnterCopy)//非副本才显示
        {
            ShowPanel(PanelID.MessagePushPanel);
        }
        ShowPanel(PanelID.EffectDiplayPanel);

        if (bFirst)
        {
            Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.SYSTEM_LOADUICOMPELETE);
        }
    }
Exemple #3
0
    void OnBtnTopClick(GameObject go)
    {
        // m_goSelect.transform.parent = m_trans_pkmodel.transform;
        m_transBtnBg.gameObject.SetActive(true);
        m_transBtnBg.transform.DestroyChildren();

        Client.IMapSystem ms = Client.ClientGlobal.Instance().GetMapSystem();
        if (ms == null)
        {
            return;
        }
        table.MapDataBase mapdata = GameTableManager.Instance.GetTableItem <table.MapDataBase>(ms.GetMapID());
        if (mapdata == null)
        {
            return;
        }

        GameObject curBtn = null;

        if (ClientGlobal.Instance().MainPlayer != null)
        {
            int nmodel = ClientGlobal.Instance().MainPlayer.GetProp((int)PlayerProp.PkMode);
            int index  = 0;
            for (int i = (int)PLAYERPKMODEL.PKMODE_M_NONE + 1; i <= (int)PLAYERPKMODEL.PKMODE_M_JUSTICE; i++, index++)
            {
                PLAYERPKMODEL model = (PLAYERPKMODEL)i;
                GameObject    btn   = NGUITools.AddChild(m_transBtnBg.gameObject, m_btnPrefab);
                btn.transform.localPosition = new UnityEngine.Vector3(174, -28 - index * 52, 0);
                btn.gameObject.SetActive(true);
                btn.GetComponentInChildren <UILabel>().text = GetDesByPkModel(model);
                btn.name = i.ToString();
                Transform flagTrans = btn.transform.Find("flag");
                if (flagTrans != null)
                {
                    UISprite sp = flagTrans.GetComponent <UISprite>();
                    if (sp != null)
                    {
                        sp.spriteName = GetFlagByPkModel(model);
                    }
                }
                SetSelect(btn, false);
                SetMask(btn, true);
                if ((int)model == nmodel)
                {
                    curBtn = btn;
                }
                if (mapdata.supportModel == "0")
                {
                    UIEventListener.Get(btn).onClick = OnClickBtn;
                    SetMask(btn, false);
                }
                else
                {
                    string[] param = mapdata.supportModel.Split('_');
                    for (int m = 0; m < param.Length; m++)
                    {
                        int value = int.Parse(param[m]);
                        if (i == value)
                        {
                            UIEventListener.Get(btn).onClick = OnClickBtn;
                            SetMask(btn, false);
                        }
                        else
                        {
                            UIEventListener.Get(btn).onClick = onClickUnenble;
                        }
                    }
                }
            }
            if (curBtn != null)
            {
                SetSelect(curBtn, true);
                SetMask(curBtn, false);
            }
        }
    }
Exemple #4
0
    /// <summary>
    /// 请求读条上马
    /// </summary>
    public bool TryUsingRide(Action <object> callback, object param)
    {
        Client.IMapSystem ms = Client.ClientGlobal.Instance().GetMapSystem();
        if (ms == null)
        {
            return(false);
        }
        table.MapDataBase mapdata = GameTableManager.Instance.GetTableItem <table.MapDataBase>(ms.GetMapID());
        if (mapdata == null)
        {
            return(false);
        }

        if (mapdata.canUsingRide != 1)
        {
            TipsManager.Instance.ShowTips("该地图不能上马");
            if (callback != null)
            {
                callback(param);
            }
            return(false);
        }
        Client.IPlayer mainPlayer = Client.ClientGlobal.Instance().MainPlayer;
        if (mainPlayer != null)
        {
            Client.ISkillPart skillpart = mainPlayer.GetPart(Client.EntityPart.Skill) as Client.ISkillPart;
            if (skillpart != null)
            {
                if (skillpart.GetCurSkillState() != (int)Client.SkillState.None)
                {
                    TipsManager.Instance.ShowTips(LocalTextType.Ride_Commond_shifangjinengzhongwufashangma);
                    if (callback != null)
                    {
                        callback(param);
                    }
                    return(false);
                }
            }
            bool isChangeBody = (bool)mainPlayer.SendMessage(Client.EntityMessage.EntityCommand_IsChange, null);
            if (isChangeBody)
            {
                if (callback != null)
                {
                    callback(param);
                }
                return(false);
            }
            bool bRide = DataManager.Manager <RideManager>().IsRide;
            if (bRide)
            {
                if (callback != null)
                {
                    callback(param);
                }
                return(false);
            }
            else if (Auto_Ride == 0)
            {
                if (callback != null)
                {
                    callback(param);
                }
                return(false);
            }
        }

        UsingRideCallback      = callback;
        UsingRideCallbackParam = param;
        if (Auto_Ride != 0)
        {
            //先发送读条 读条 结束在上马
            Client.stUninterruptMagic stparam = new Client.stUninterruptMagic();
            if (GetRideDataById(Auto_Ride) != null)
            {
                stparam.time = GetRideDataById(Auto_Ride).spellTime;
            }
            stparam.type = GameCmd.UninterruptActionType.UninterruptActionType_DEMON;
            stparam.uid  = MainPlayerHelper.GetPlayerUID();
            Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.SKILLGUIDE_PROGRESSSTART, stparam);
            //NetService.Instance.Send(new stUsingRideUserCmd_C());
        }
        return(true);
    }