Ejemplo n.º 1
0
    /// <summary>
    /// 城战开始 tips
    /// </summary>
    /// <param name="cmd"></param>
    public void OnCityWarBeginNotice(GameCmd.stCityWarBeginClanUserCmd_CS cmd)
    {
        //同意参加
        Action agree = delegate
        {
            MainPlayStop();

            stCityWarBeginClanUserCmd_CS agreeCmd = new stCityWarBeginClanUserCmd_CS();
            NetService.Instance.Send(agreeCmd);
        };

        Action refuse = delegate
        {
        };

        List <table.CityWarDataBase> cityWarList = GameTableManager.Instance.GetTableList <table.CityWarDataBase>();

        table.CityWarDataBase db = cityWarList.Find((d) => { return(d.CopyId == cmd.city_war_id); });

        if (db == null)
        {
            return;
        }

        string des = string.Format("{0}即将开始,是否进入参加", db.Name);

        TipsManager.Instance.ShowTipWindow(0, 15, Client.TipWindowType.CancelOk, des, agree, refuse, title: db.Name);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 获取
    /// </summary>
    /// <param name="clanId">传入的氏族ID </param>
    /// <param name="winerCityName">氏族后缀 华夏城</param>
    /// <returns></returns>
    public bool GetWinerOfCityWarCityName(uint clanId, out string winerCityName)
    {
        winerCityName = string.Empty;

        if (clanId == 0)
        {
            return(false);
        }

        WinerData wd = m_lstWinerClanId.Find((d) => { return(d.clan_id == clanId); });

        if (wd == null)
        {
            return(false);
        }

        //城池名称
        table.CityWarDataBase cwdb = GameTableManager.Instance.GetTableItem <table.CityWarDataBase>(wd.copy_id);
        if (cwdb == null)
        {
            return(false);
        }

        winerCityName = string.Format(cwdb.CityName + "·");
        return(true);
    }
Ejemplo n.º 3
0
    void InitUI()
    {
        table.CityWarDataBase cityWarDb = GameTableManager.Instance.GetTableItem <table.CityWarDataBase>(DataManager.Manager <CityWarManager>().CityWarSelectCopyId);
        if (cityWarDb == null)
        {
            return;
        }

        //titleName
        uint   huaxiaCopyId = GameTableManager.Instance.GetGlobalConfig <uint>("CityWarCopyID");
        string titleName    = string.Empty;

        if (cityWarDb.CopyId == huaxiaCopyId)
        {
            titleName = "华夏争霸战";
            m_label_Registertime_label.gameObject.SetActive(false);
        }
        else
        {
            titleName = "城池争夺战";
            m_label_Registertime_label.gameObject.SetActive(true);
        }
        m_label_name.text = titleName;

        //name
        m_label_CityWar_name.text = cityWarDb.Name;

        //bg
        if (m__bgtexture != null)
        {
            UIManager.GetTextureAsyn(cityWarDb.Bg, ref m_iuiBgSeed, () => { if (m__bgtexture != null)
                                                                            {
                                                                                m__bgtexture.mainTexture = null;
                                                                            }
                                     }, m__bgtexture, false);
        }

        //isOpen
        m_sprite_OpenLimit.gameObject.SetActive(!DataManager.Manager <CityWarManager>().IsOpen);

        //time
        m_label_Starttime.text    = cityWarDb.OpenTime;
        m_label_Registertime.text = cityWarDb.RegisterTime;

        //CityLeader 城主
        m_label_Playerdes.text   = DataManager.Manager <CityWarManager>().CityWarRegisterClanLeaderName;
        m_label_ClanNamedes.text = DataManager.Manager <CityWarManager>().CityWarRegisterClanName;

        //signName
        for (int i = 0; i < m_signClanName.Length; i++)
        {
            List <string> list = DataManager.Manager <CityWarManager>().CityWarSignList;
            if (i < m_trans_ClanRoot.childCount)
            {
                Transform transf = m_trans_ClanRoot.GetChild(i);
                if (transf == null)
                {
                    return;
                }

                if (list != null && i < list.Count)
                {
                    m_signClanName[i].text = list[i];
                    transf.gameObject.SetActive(true);
                }
                else
                {
                    m_signClanName[i].text = "欢迎报名";
                    transf.gameObject.SetActive(false);
                }
            }
        }

        m_sprite_cityWarDefend.gameObject.SetActive(DataManager.Manager <CityWarManager>().HaveDefender);

        // applyList
        m_label_ApplyTitle.text = string.Format("申请{0}排名", cityWarDb.Name);
        m_lstApply = DataManager.Manager <CityWarManager>().CityWarApplyInfoList;

        if (m_cityWarRegisterClanGridCreator != null)
        {
            m_cityWarRegisterClanGridCreator.CreateGrids(m_lstApply != null ? m_lstApply.Count : 0);
        }
    }