Пример #1
0
        //IEnumerator OneSecond; //协成

        //void UpdateDownTimer(float timer)
        //{
        //    OneSecond = OneSecondDelay(timer);
        //    //Debug.LogError("开启协成");
        //    StartCoroutine(OneSecond);
        //}

        //IEnumerator OneSecondDelay(float timer)
        //{
        //    yield return new WaitForSeconds(1f);
        //    DTimer--;
        //    if (DTimer <= 0)
        //    {
        //        DTimer = 0;
        //        Minutes.text = "";
        //        //清空这个房间数据
        //        ClearPointTabelGame();
        //        yield break;
        //    }
        //    string tim = "0";
        //    TimeSpan timspan = new TimeSpan(0, 0, (int)DTimer);

        //    tim = timspan.Hours.ToString("00") + ":" + timspan.Minutes.ToString("00") + ":" + timspan.Seconds.ToString("00");

        //    Minutes.text = tim;
        //    UpdateDownTimer(DTimer);
        //}


        void ClearPointTabelGame()
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            //老板创房
            if (TabelInfo_Un.iOpenRoomId != pspd.iParlorId)
            {
                TabelInfo_Un.iBespeakTime    = 0;
                TabelInfo_Un.iaBespeakUserId = new int[4];
            }

            for (int i = 0; i < pspd.PointParlorTabelMessage_UnStart.Count; i++)
            {
                if (pspd.PointParlorTabelMessage_UnStart[i].iRoomNum == TabelInfo_Un.iRoomNum)
                {
                    if (TabelInfo_Un.iOpenRoomId != pspd.iParlorId)
                    {
                        pspd.PointParlorTabelMessage_UnStart[i].iBespeakTime    = 0;
                        pspd.PointParlorTabelMessage_UnStart[i].iaBespeakUserId = new int[4];
                    }
                    else
                    {
                        pspd.PointParlorTabelMessage_UnStart.RemoveAt(i);
                        pspd.iAllTabelNumUnStart--;
                        UIMainView.Instance.ParlorShowPanel.SpwanPorlorTabelMessage(2);
                    }
                    break;
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 处理点击规则说明
        /// </summary>
        void HandleBtnRuleContent()
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            pspd.isShowRulePanel = true;
            UpdateShow();
        }
Пример #3
0
        /// <summary>
        /// 处理点击返回大厅
        /// </summary>
        void HandleBtnReturnLobby(int type)
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            anhui.MahjongCommonMethod.Instance.iFromParlorInGame = 0;
            if (type == 1)
            {
                pspd.isShowMyParlorMessage       = false;
                pspd.isShowApplyCreatParlorPanel = false;
                pspd.isShowSecondSure            = false; //显示创
                pspd.isShowWriteParlorName       = false; //
                pspd.isShowChangeParlorMessage   = false;
                pspd.isShowSecondDismissPanel    = false;
                pspd.isSpwanStartedRoom          = false;
                pspd.isSpwanUnStartRoom          = false;
                UIMainView.Instance.ParlorShowPanel.InitData();
            }
            else
            {
                //根据当前界面,决定显示那个界面
                pspd.isShowMyParlorMessage = false;
                UIMainView.Instance.ParlorShowPanel.RemoveAllListener();
            }
            pspd.RefreshCount = 0;
            //GameData.Instance.CreatRoomMessagePanelData.CreatRoomType = 1;
            //先隐藏麻将馆红包
            UIMainView.Instance.ParlorShowPanel.ParlorBulletin_RedBag.gameObject.SetActive(false);
            UIMainView.Instance.ParlorShowPanel.ParlorRedBagBtn.gameObject.SetActive(false);

            UpdateShow();
        }
Пример #4
0
        /// <summary>
        /// 修改麻将馆的公告和联系方式
        /// </summary>
        void HandleBtnChangeParlorMessage()
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            pspd.isShowChangeParlorMessage = true;
            UpdateShow();
        }
Пример #5
0
    /// <summary>
    /// 点击数字按钮
    /// </summary>
    /// <param name="num"></param>
    public void BtnNum(GameObject num)
    {
        SystemMgr.Instance.AudioSystem.PlayAuto(AudioSystem.AudioType.VIEW_CLOSE);
        string name     = num.name;
        int    NumIndex = Convert.ToInt32(name.Split('_')[1]);

        if (NumIndex < 0 || NumIndex > 9)
        {
            return;
        }

        if (lsRoomId.Count < 5)
        {
            lsRoomId.Add(NumIndex.ToString().ToCharArray()[0]);
            if (lsRoomId.Count >= 5)
            {
                string sRoomId = "";
                for (int i = 0; i < 5; i++)
                {
                    sRoomId += lsRoomId[i];
                }
                int roomId = Convert.ToInt32(sRoomId);
                ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;
                pspd.FromWebGetSearchParlorMessage(5, sRoomId);
                pspd.isShowSearchPointParlor = true;
            }
        }

        UpdateShow();
    }
Пример #6
0
        void Ok()
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            pspd.isShowSecondDismissPanel = true;
            UpdateShow();
        }
Пример #7
0
        void LevelParlorOk()
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            NetMsg.ClientLeaveParlorReq msg = new NetMsg.ClientLeaveParlorReq();
            msg.iParlorId = pspd.iParlorId;
            msg.iUserId   = GameData.Instance.PlayerNodeDef.iUserId;
            Network.NetworkMgr.Instance.LobbyServer.SendLevelParlorReq(msg);
        }
Пример #8
0
        /// <summary>
        /// 馆主的查看牌局记录
        /// </summary>
        void HandleParlorGameRecord()
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            pspd.ParlorGameRecordPageId        = 1;
            pspd.isGetAllData_ParlorGameRecord = false;
            pspd.PointParlorGameRecordData     = new System.Collections.Generic.List <ParlorShowPanelData.GetPointParlorGameRecordData>();
            GameData.Instance.ParlorShowPanelData.FromWebPointParlorThreeDayGameNum(5);
        }
Пример #9
0
        /// <summary>
        /// 处理点击二次确认申请开馆
        /// </summary>
        void HandleBtnSecondSureCreatParlor()
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;
            SelectAreaPanelData sapd = GameData.Instance.SelectAreaPanelData;

            pspd.isShowSecondSure      = false;
            pspd.isShowWriteParlorName = true;
            UpdateShow();
        }
Пример #10
0
        /// <summary>
        /// 处理点击申请开馆
        /// </summary>
        void HandleBtnApplyCreatParlor()
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            //打开浏览器,进入馆主资格申请界面
            Application.OpenURL(pspd.ApplyBossCert_Url + GameData.Instance.PlayerNodeDef.iUserId);
            pspd.isShowApplyCreatParlorPanel = false;
            UpdateShow();
        }
Пример #11
0
        /// <summary>
        /// 成员管理
        /// </summary>
        void HandleParlorMemberManger()
        {
            //获取信息
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            pspd.isGetAllData_ParlorMember = false;
            pspd.iPageID_Member            = 1;
            pspd.ParlorAllMemberMessage    = new System.Collections.Generic.List <ParlorShowPanelData.ParlorMemberMessage>();
            pspd.FromWebGetParlorMember();
        }
Пример #12
0
        /// <summary>
        /// 馆主踢出成员
        /// </summary>
        void HandleKickMember()
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            NetMsg.ClientKickParlorReq msg = new NetMsg.ClientKickParlorReq();
            msg.iUserId     = GameData.Instance.PlayerNodeDef.iUserId;
            msg.iParlorId   = pspd.iParlorId;
            msg.iKickUserId = pspd.iUserid_Seach;
            Network.NetworkMgr.Instance.LobbyServer.SendKickParlorReq(msg);
        }
Пример #13
0
        public void UpdateShow()
        {
            Score.text = ((float)GameData.Instance.PlayerNodeDef.userDef.fParlorScore / 100f).ToString("0.00");
            gameObject.SetActive(true);
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            Button[]      btn   = Parent.GetComponentsInChildren <Button>(true);
            List <Button> lsBtn = new List <Button>();

            for (int i = 0; i < btn.Length; i++)
            {
                if (btn[i].name.Contains("ExChange"))
                {
                    lsBtn.Add(btn[i]);
                }
            }

            int count = (lsBtn.Count > MahjongCommonMethod.Instance.ExChange.Count) ? lsBtn.Count : MahjongCommonMethod.Instance.ExChange.Count;

            for (int i = 0; i < count; i++)
            {
                string content = MahjongCommonMethod.Instance.ExChange[i].iExchangeId + "_" + MahjongCommonMethod.Instance.ExChange[i].iType;
                if (i > lsBtn.Count - 1)
                {
                    GameObject go = Instantiate(lsBtn[0].gameObject);
                    go.transform.SetParent(Parent);
                    go.transform.localPosition    = new Vector3(go.transform.localPosition.x, go.transform.localPosition.y, 0);
                    go.transform.localScale       = Vector3.one;
                    go.transform.localEulerAngles = Vector3.zero;
                    go.transform.GetChild(2).GetChild(0).GetComponent <Text>().text = MahjongCommonMethod.Instance.ExChange[i].iCoin + "金币";
                    go.transform.GetChild(3).GetChild(1).GetComponent <Text>().text = MahjongCommonMethod.Instance.ExChange[i].iBindCoin + "金币";
                    go.transform.GetChild(4).GetChild(0).GetComponent <Text>().text = MahjongCommonMethod.Instance.ExChange[i].iAsset + "业绩";
                    go.transform.GetChild(1).GetComponent <Image>().sprite          = CoinImages[i];
                    //添加点击方法
                    go.transform.GetChild(4).GetComponent <Button>().onClick.AddListener(delegate() { BtnClick(content); });
                }
                else
                {
                    if (i > MahjongCommonMethod.Instance.ExChange.Count - 1)
                    {
                        lsBtn[i].gameObject.SetActive(false);
                    }
                    else
                    {
                        lsBtn[i].gameObject.SetActive(true);
                        lsBtn[i].transform.GetChild(2).GetChild(0).GetComponent <Text>().text = MahjongCommonMethod.Instance.ExChange[i].iCoin + "金币";
                        lsBtn[i].transform.GetChild(3).GetChild(1).GetComponent <Text>().text = MahjongCommonMethod.Instance.ExChange[i].iBindCoin + "金币";
                        lsBtn[i].transform.GetChild(4).GetChild(0).GetComponent <Text>().text = MahjongCommonMethod.Instance.ExChange[i].iAsset + "业绩";
                        lsBtn[i].transform.GetChild(1).GetComponent <Image>().sprite          = CoinImages[i];
                        //添加点击方法
                        lsBtn[i].transform.GetChild(4).GetComponent <Button>().onClick.AddListener(delegate() { BtnClick(content); });
                    }
                }
            }
        }
Пример #14
0
        /// <summary>
        /// 邀请成员加入馆
        /// </summary>
        void HandleInviteMember()
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            NetMsg.ClientInvitParlorReq msg = new NetMsg.ClientInvitParlorReq();
            msg.iUserId       = GameData.Instance.PlayerNodeDef.iUserId;
            msg.iParlorId     = GameData.Instance.PlayerNodeDef.iMyParlorId;
            msg.iInviteUserId = pspd.iUserid_Seach;
            Debug.LogError("麻将馆的id:" + msg.iParlorId + ",玩家id:" + msg.iInviteUserId);
            Network.NetworkMgr.Instance.LobbyServer.SendInvifeParlorReq(msg);
        }
Пример #15
0
        /// <summary>
        /// 处理点击雀神广场
        /// </summary>
        void HandleBtnParlorRound()
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            //进入雀神广场,获取该区域所有的麻将馆的信息
            pspd.isShowPanel = true;
            UIMainView.Instance.ParlorShowPanel.ShowPointPanel(MainViewParlorShowPanel.ParlorPanel.ParlorGod);
            UIMainView.Instance.ParlorShowPanel.ParlorGodPanel.NoParlorMessage(1);
            //获取现在选择县的所有麻将馆
            //if (!pspd.isGetAllData_PointCountyParlor[0])
            //{
            //pspd.FromWebGetParlorMessage(1, 5);
            //}
        }
Пример #16
0
        /// <summary>
        /// 处理点击麻将馆的排序方式,默认时间排序
        /// </summary>
        /// <param name="type"></param>
        void HandleBtnParlorOrderType(int type)
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            pspd.iNowCheckType     = type;
            pspd.UnNeedSpecialSort = true;
            if (!pspd.isGetAllData_PointCountyParlor[type - 1])
            {
                pspd.FromWebGetParlorMessage(type, 5);
            }
            else
            {
                UIMainView.Instance.ParlorShowPanel.ShowPointCountyParlor(1, type);
            }
        }
Пример #17
0
    /// <summary>
    /// 处理对搜索结果的处理
    /// </summary>
    public void SearchResultDeal(int iParlorId)
    {
        ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;
        int status = 1;  //搜索结果的状态 1表示不在玩家的审核和已有麻将馆队列  2表示在已有麻将馆队列  3表示在申请麻将馆队列

        for (int i = 0; i < pspd.parlorInfoDef.Length; i++)
        {
            if (pspd.parlorInfoDef[i] != null && pspd.parlorInfoDef[i].iParlorId == iParlorId)
            {
                status = 2;
                break;
            }
        }


        if (status != 1)
        {
            for (int i = 0; i < pspd.ApplyParlorMessage.Count; i++)
            {
                if (pspd.ApplyParlorMessage[i].iParlorId == iParlorId)
                {
                    status = 3;
                    break;
                }
            }
        }
        UIMainView.Instance.ParlorShowPanel.joinParlorPanel.BtnClose();
        //直接发送馆的申请请求
        if (status == 1)
        {
            NetMsg.ClientJoinParlorReq msg = new NetMsg.ClientJoinParlorReq();
            msg.iUserId   = GameData.Instance.PlayerNodeDef.iUserId;
            msg.iParlorId = iParlorId;
            NetworkMgr.Instance.LobbyServer.SendJoinParlorReq(msg);
        }
        //直接进入申请或者已加入界面
        else if (status == 2 || status == 3)
        {
            //如果是3给出提示
            if (status == 3)
            {
                UIMgr.GetInstance().GetUIMessageView().Show("您已申请该麻将馆,请耐心等待老板审核!");
            }
            PlayerPrefs.SetInt(ParlorShowPanelData.SaveLaseParlorId, iParlorId);
            //请求麻将馆请求信息
            Messenger_anhui.Broadcast(MainViewLobbyPanel.MESSAGE_OPENPARLOR);
        }
    }
Пример #18
0
        void Ok()
        {
            _gPanelBg.GetComponent <RectTransform>().localScale    = new Vector3(1, 1, 1);
            _gPanelBg.GetComponent <RectTransform>().localPosition = new Vector3(0, 0);
            _gPanelBg.GetComponent <RectTransform>().sizeDelta     = new Vector2(0, 0);
            sapd.isPanelShow = false;
            for (int i = 0; i < countyMap_go.Length; i++)
            {
                countyMap_go[i].SetActive(false);
            }
            SystemMgr.Instance.SelectAreaSystem.UpdateShow();
            //刷新大厅面板
            if (sapd.iOpenStatus == 5 && GameData.Instance.LobbyMainPanelData.isPanelShow)
            {
                SystemMgr.Instance.LobbyMainSystem.UpdateShow();
                return;
            }


            //如果选择玩法规则
            if (sapd.iOpenStatus == 6)
            {
                Messenger_anhui.Broadcast(MainViewLobbyPanel.MESSAGE_PALYINGMETHOD);
                //SystemMgr.Instance.GamePlayingMethodSystem.UpdateShow(1);
            }

            if (sapd.iOpenStatus == 3 || sapd.iOpenStatus == 4)
            {
                ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;
                pspd.pageId        = new int[] { 1, 1, 1 };
                pspd.iNowCheckType = 1;
                pspd.isGetAllData_PointCountyParlor = new bool[] { false, false, false };
                pspd.TimeOrderParlorMessage         = new List <NetMsg.ParlorInfoDef>();
                pspd.MemberCountOrderParlorMessage  = new List <NetMsg.ParlorInfoDef>();
                pspd.ActivityOrderParlorMessage     = new List <NetMsg.ParlorInfoDef>();
                UIMainView.Instance.ParlorShowPanel.BtnSelectAreaOk(sapd.iOpenStatus);
                return;
            }

            //第一次进入麻将馆
            if (sapd.iOpenStatus == 8)
            {
                //获取玩家的申请馆的id
                GameData.Instance.ParlorShowPanelData.FromWebGetApplyParlorId(6, 1);
                SDKManager.Instance.GetComponent <anhui.CameControler>().PostMsg("loading", "正在获取您的麻将馆信息");
            }
        }
Пример #19
0
        /// <summary>
        /// 获取已开放城市的信息
        /// </summary>
        /// <param name="json"></param>
        public void GetCityMessage(string json, int status)
        {
            listCityMessage.Clear();
            CityMessageData data = new CityMessageData();

            data = JsonBase.DeserializeFromJson <CityMessageData>(json.ToString());
            if (data.CityData[0].status != 1)
            {
                Debug.LogError("获取网页json数据状态错误,status:" + data.CityData[0].status);
                return;
            }


            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            //保存获取的城市信息
            for (int i = 0; i < data.CityData.Count; i++)
            {
                for (int j = 0; j < data.CityData[i].data.Count; j++)
                {
                    CityMessage message = new CityMessage();
                    message.cityId   = data.CityData[i].data[j].cityId;
                    message.cityName = data.CityData[i].data[j].cityName;
                    message.flag     = data.CityData[i].data[j].flag;
                    listCityMessage.Add(message);
                    if (System.Convert.ToInt16(message.flag) == 2)
                    {
                        pspd.listCityMessage.Add(message);
                    }
                }
            }
            //获取城市信息成功
            isGetCitySuccess = true;

            if (isGetCountySuccess)
            {
                //改变地图大小
                UIMainView.Instance.SelectAreaPanel.ChangeScale();
            }
        }
Пример #20
0
        /// <summary>
        /// 点击城市选择按钮
        /// </summary>
        /// <param name="CityIndex"></param>
        public void ChoiceCity(int CityIndex)
        {
            Debug.LogWarning(CityIndex);
            sapd.isStartMove = false;
            sapd.isMove      = false;
            sapd.iCityId     = CityIndex;
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            for (int i = 0; i < countyMap_go.Length; i++)
            {
                //Debug.LogError("城市按钮:" + countyMap_go[i].name + "," + CityIndex+","+ countyMap_go.Length);
                if (Convert.ToInt32(countyMap_go[i].name) == CityIndex)
                {
                    countyMap_go[i].SetActive(true);
                    if (!sapd.IsGetCountyMessage[CityIndex - int.Parse(pspd.listCityMessage[0].cityId)])
                    {
                        SpwanCountyChioceBtn(countyMap_go[i], CityIndex);
                    }
                    //关闭省份的名字
                    proviceText.SetActive(false);
                }
                else
                {
                    countyMap_go[i].SetActive(false);
                }
            }

            if (sapd.iOpenStatus == 3)
            {
                pspd.iCityId[0] = CityIndex;
            }

            if (sapd.iOpenStatus == 4)
            {
                pspd.iCityId[1] = CityIndex;
            }


            anhui.MahjongCommonMethod.Instance.HasClicked((int)anhui.MahjongCommonMethod.StateType.CompeletChoiceMap);
        }
Пример #21
0
        /// <summary>
        /// 处理点击开麻将馆
        /// </summary>
        void HandleBtnCreatParlor()
        {
            //如果自己已经开过麻将馆
            if (GameData.Instance.PlayerNodeDef.iMyParlorId > 0)
            {
                anhui.MahjongCommonMethod.Instance.ShowRemindFrame("每人只可以开办一个麻将馆!");
                return;
            }

            ////判断加馆冷却时间
            //if ((int)MahjongCommonMethod.Instance.DateTimeToUnixTimestamp(DateTime.Now) - GameData.Instance.PlayerNodeDef.userDef.iLeaveParlorTime < GameData.Instance.ParlorShowPanelData.ColdTimer
            //    || (int)MahjongCommonMethod.Instance.DateTimeToUnixTimestamp(DateTime.Now) - GameData.Instance.PlayerNodeDef.userDef.iKickParlorTime < GameData.Instance.ParlorShowPanelData.ColdTimer)
            //{
            //    MahjongCommonMethod.Instance.ShowRemindFrame("您最近两小时退出或者解散过馆,不可加入!");
            //    return;
            //}

            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            NetMsg.ClientParlorCertReq msg = new NetMsg.ClientParlorCertReq();
            msg.iUserId = GameData.Instance.PlayerNodeDef.iUserId;
            Network.NetworkMgr.Instance.LobbyServer.SendCreatParlorCertReq(msg);
        }
Пример #22
0
        /// <summary>
        /// 更新面板
        /// </summary>
        public void UpdateShow()
        {
            GameData          gd   = GameData.Instance;
            UserInfoPanelData uipd = gd.UserInfoPanelData;

            if (uipd.isPanelShow)
            {
                gameObject.SetActive(true);

                if (SDKManager.Instance.IOSCheckStaus == 1 || SDKManager.Instance.CheckStatus == 1)
                {
                    ParlorMessage.SetActive(false);
                }
                else
                {
                    ParlorMessage.SetActive(true);
                }

                if (gd.PlayerNodeDef.iPlayCardAcc != 0)
                {
                    PlayerNode[0].text = (gd.PlayerNodeDef.iPlayCardTimeAcc / gd.PlayerNodeDef.iPlayCardAcc).ToString("0") + "秒/平均";
                }
                else
                {
                    PlayerNode[0].text = "0秒/平均";
                }

                // Debug.LogError("游戏局数:" + gd.PlayerNodeDef.iGameNumAcc + ",掉线次数:" + gd.PlayerNodeDef.iDisconnectAcc);

                if (gd.PlayerNodeDef.iGameNumAcc != 0)
                {
                    PlayerNode[1].text = ((gd.PlayerNodeDef.iDisconnectAcc / (float)gd.PlayerNodeDef.iGameNumAcc) * 100f).ToString("0.00") + "%";
                }
                else
                {
                    PlayerNode[1].text = "0%";
                }
                //声音关闭按钮显示
                Button[] gomusic = _Music.GetComponentsInChildren <Button>(true);
                gomusic[0].gameObject.SetActive(MahjongCommonMethod.Instance.isMusicShut);
                gomusic[1].gameObject.SetActive(!MahjongCommonMethod.Instance.isMusicShut);
                Button[] goeffect = _Effect.GetComponentsInChildren <Button>(true);
                goeffect[0].gameObject.SetActive(MahjongCommonMethod.Instance.isEfectShut);
                goeffect[1].gameObject.SetActive(!MahjongCommonMethod.Instance.isEfectShut);
                _sliderM.value     = MahjongCommonMethod.Instance.MusicVolume * 0.01f;
                _sliderE.value     = MahjongCommonMethod.Instance.EffectValume * 0.01f;
                PlayerNode[2].text = gd.PlayerNodeDef.iCompliment.ToString();
                PlayerNode[3].text = MahjongCommonMethod.PlayerIp;
                PlayerNode[4].text = gd.PlayerNodeDef.iUserId.ToString();
                PlayerNode[5].text = gd.PlayerNodeDef.szNickname;
                MahjongCommonMethod com = MahjongCommonMethod.Instance;
                com.GetPlayerAvatar(headImage, gd.PlayerNodeDef.szHeadimgurl);
                if (uipd.SettingPanelShow)
                {
                    SettingPanel.SetActive(true);
                }
                else
                {
                    SettingPanel.SetActive(false);
                }

                //处理麻将馆信息
                PlayerNodeDef pnd = GameData.Instance.PlayerNodeDef;
                if (pnd.iMyParlorId > 0)
                {
                    ParlorIdentity.text  = "麻将馆老板";
                    JoinParlorTitle.text = "创建的麻将馆:";
                }
                else
                {
                    ParlorIdentity.text  = "麻将馆会员";
                    JoinParlorTitle.text = "加入的麻将馆:";
                }
                ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;
                int parlorCount          = 0;
                for (int i = 0; i < pspd.parlorInfoDef.Length; i++)
                {
                    if (pspd.parlorInfoDef[i] != null && pspd.parlorInfoDef[i].iParlorId > 0)
                    {
                        parlorCount++;
                        Parlor[i].SetActive(true);
                        Parlor[i].transform.GetChild(1).GetComponent <Text>().text = pspd.parlorInfoDef[i].szParlorName;
                    }
                    else
                    {
                        Parlor[i].SetActive(false);
                    }
                }

                if (parlorCount == 0)
                {
                    NoneParlor.SetActive(true);
                }
                else
                {
                    NoneParlor.SetActive(false);
                }


                ParlorCount[0].text = pnd.iLeaveParlorAcc + "次";

                if (pnd.iMyParlorId > 0)
                {
                    ParlorCount[1].text = (pnd.iCreatParlorAcc + 1) + "次";
                }
                else
                {
                    ParlorCount[1].text = (pnd.iCreatParlorAcc) + "次";
                }
                ParlorCount[2].text = pnd.iKickParlorAcc + "次";
                ParlorCount[3].text = pnd.iDismissParlorAcc + "次";
            }
            else
            {
                GameData.Instance.isShowQuitPanel = true;
                gameObject.SetActive(false);
            }
        }
Пример #23
0
    public void Refresh(int status_ = 0)
    {
        ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;
        int count = 0;

        if (status == 1)
        {
            Debug.LogError("城市信息:" + pspd.listCityMessage.Count);
            //在这里需要对list按需求排序
            for (int i = 0; i < pspd.listCityMessage.Count; i++)
            {
                SelectAreaPanelData.CityMessage temp = new SelectAreaPanelData.CityMessage();
                if (Convert.ToInt32(pspd.listCityMessage[i].cityId) == pspd.iCityId[1])
                {
                    temp = pspd.listCityMessage[i];
                    pspd.listCityMessage.RemoveAt(i);
                    if (pspd.listCityMessage.Count > 0)
                    {
                        pspd.listCityMessage.Insert(pspd.listCityMessage.Count - 1, temp);
                    }
                    else
                    {
                        pspd.listCityMessage.Add(temp);
                    }

                    break;
                }
            }

            count = pspd.listCityMessage.Count;
        }
        else if (status == 2)
        {
            if (pspd.dicCountyMessage.ContainsKey(pspd.iCityId[1]))
            {
                //在这里需要对list按需求排序
                for (int i = 0; i < pspd.dicCountyMessage[pspd.iCityId[1]].Count; i++)
                {
                    SelectAreaPanelData.CountyMessage temp = new SelectAreaPanelData.CountyMessage();
                    if (Convert.ToInt32(pspd.dicCountyMessage[pspd.iCityId[1]][i].countyId) == pspd.iCityId[1])
                    {
                        temp = pspd.dicCountyMessage[pspd.iCityId[1]][i];
                        pspd.dicCountyMessage[pspd.iCityId[1]].RemoveAt(i);
                        if (pspd.dicCountyMessage.Count > 0)
                        {
                            pspd.dicCountyMessage[pspd.iCityId[1]].Insert(pspd.dicCountyMessage.Count - 1, temp);
                        }
                        else
                        {
                            pspd.dicCountyMessage[pspd.iCityId[1]].Add(temp);
                        }

                        break;
                    }
                }
                count = pspd.dicCountyMessage[pspd.iCityId[1]].Count;
            }
        }

        //处理两个子物体
        if (count == 2)
        {
            StartValue = 0.3f;
            VMin       = 0.3f;
            VMax       = 0.7f;
        }
        else if (count == 1)
        {
            StartValue      = 0.5f;
            pspd.temp_cc[0] = Convert.ToInt32(pspd.listCityMessage[0].cityId);
        }


        if (status_ == 0)
        {
            SpwanAllGameobject(count, status);
        }

        //处理一个子物体
        if (count == 1)
        {
            //关闭滑动功能
            transform.GetChild(0).GetComponent <Text>().raycastTarget = false;
        }


        if (Rect.childCount < 5)
        {
            //VMax = StartValue + 4 * AddValue;
        }
        else
        {
            VMax = StartValue + (Rect.childCount - 1) * AddValue;
        }
        if (MoveEnd != null)
        {
            MoveEnd(Current);
        }
    }
Пример #24
0
    /// <summary>
    /// 获取指定的更新物体
    /// </summary>
    IEnumerator GetPointObject()
    {
        yield return(new WaitForSeconds(0.2f));

        ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;
        SelectAreaPanelData sapd = GameData.Instance.SelectAreaPanelData;

        if (status == 1)
        {
            int CityCount = transform.GetComponentsInChildren <UI_Control_ScrollFlow_Item>().Length;
            UI_Control_ScrollFlow_Item[] cityItem = new UI_Control_ScrollFlow_Item[CityCount];
            cityItem = transform.GetComponentsInChildren <UI_Control_ScrollFlow_Item>();
            for (int i = 0; i < CityCount; i++)
            {
                float y = cityItem[i].sv;
                if (0.9 < y && y < 1)
                {
                    pspd.temp_cc[0] = cityItem[i].iCityId;
                    pspd.iCityId[pspd.iStatus_AreaSeeting - 1] = cityItem[i].iCityId;

                    Debug.LogError("城市id:" + cityItem[i].iCityId);
                    break;
                }
            }

            //更新玩家对应的县的玩家
            UI_Control_ScrollFlow_Item[] temp = CountyMessage.transform.GetComponentsInChildren <UI_Control_ScrollFlow_Item>();
            int count = 0;
            if (pspd.dicCountyMessage.ContainsKey(sapd.iCityId))
            {
                count = pspd.dicCountyMessage[sapd.iCityId].Count;
            }
            CountyMessage.GetComponent <UI_Control_ScrollFlow>().Items.Clear();
            if (temp.Length > count)
            {
                for (int i = 0; i < temp.Length; i++)
                {
                    if (i < count)
                    {
                        //更新该预置体的界面信息
                        temp[i].GetComponent <Text>().text = pspd.dicCountyMessage[sapd.iCityId][i].countyName;
                        temp[i].iCountyId = Convert.ToInt32(pspd.dicCountyMessage[sapd.iCityId][i].countyId);
                        CountyMessage.GetComponent <UI_Control_ScrollFlow>().Items.Add(temp[i]);
                        temp[i].Init_Num();
                        temp[i].Init(this);
                        temp[i].Drag(StartValue + i * AddValue);
                        if (temp[i].v - 0.5 < 0.05f)
                        {
                            CountyMessage.GetComponent <UI_Control_ScrollFlow>().Current = temp[i];
                        }
                    }
                    else
                    {
                        if (temp[i] != null)
                        {
                            Destroy(temp[i].gameObject);
                        }
                    }
                }
            }
            else
            {
                for (int i = 0; i < count; i++)
                {
                    UI_Control_ScrollFlow_Item item = null;
                    if (i < temp.Length)
                    {
                        item = temp[i].GetComponent <UI_Control_ScrollFlow_Item>();
                        item.Init_Num();
                    }
                    else
                    {
                        GameObject go = Instantiate(Resources.Load <GameObject>("Lobby/County"));
                        go.transform.localScale       = Vector3.one;
                        go.transform.localEulerAngles = Vector3.zero;
                        go.transform.SetParent(CountyMessage.GetComponent <UI_Control_ScrollFlow>().Rect.transform);
                        item = go.GetComponent <UI_Control_ScrollFlow_Item>();
                    }

                    //更新该预置体的界面信息
                    item.GetComponent <Text>().text = pspd.dicCountyMessage[sapd.iCityId][i].countyName;
                    item.iCountyId = Convert.ToInt32(pspd.dicCountyMessage[sapd.iCityId][i].countyId);
                    CountyMessage.GetComponent <UI_Control_ScrollFlow>().Items.Add(item);
                    item.Init(this);
                    item.Drag(StartValue + i * AddValue);
                    if (item.v - 0.5 < 0.05f)
                    {
                        CountyMessage.GetComponent <UI_Control_ScrollFlow>().Current = item;
                    }
                }
            }
            CountyMessage.GetComponent <UI_Control_ScrollFlow>().Init();
            CountyMessage.GetComponent <UI_Control_ScrollFlow>().Refresh(1);
        }

        if (status == 2)
        {
            int CountyCount = transform.GetComponentsInChildren <UI_Control_ScrollFlow_Item>().Length;
            UI_Control_ScrollFlow_Item[] countyItem = transform.GetComponentsInChildren <UI_Control_ScrollFlow_Item>();
            for (int i = 0; i < CountyCount; i++)
            {
                float y = countyItem[i].sv;
                if (0.95f < y && y < 1.05f)
                {
                    pspd.temp_cc[1] = countyItem[i].iCountyId;
                    Debug.LogError("县城id:" + countyItem[i].iCountyId + ",名字:" + countyItem[i].GetComponent <Text>().text + ",位置:" + countyItem[i].transform.localPosition.y);
                    break;
                }
            }
        }
    }
Пример #25
0
        /// <summary>
        /// 更新业绩统计面板信息
        /// </summary>
        /// <param name="status">1表示本月 2表示上月</param>
        public void UpdateShow(int status)
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            #region 老板金币消耗
            float Sum_1               = pspd.ParlorBossScoreStatMessage[status - 1].bossCoin + pspd.ParlorBossScoreStatMessage[status - 1].bossCoin3; //当前月的消耗总数
            float Sum_2               = pspd.ParlorBossScoreStatMessage[2 - status].bossCoin + pspd.ParlorBossScoreStatMessage[2 - status].bossCoin3; //另一个月的消耗总数
            float rate_my             = pspd.ParlorBossScoreStatMessage[status - 1].bossCoin / Sum_1;
            float Width_MyCoin_My     = 0;                                                                                                            //我的金币消耗显示长度
            float Width_MyFreeCoin_My = 0;                                                                                                            //我的金币消耗显示长度
            if (Sum_1 > Sum_2)
            {
                Width_MyCoin_My     = pspd.CoinPayLength;
                Width_MyFreeCoin_My = pspd.CoinPayLength * (1 - rate_my);
                //Debug.LogError(",rate_my:" + rate_my);
            }
            else
            {
                float rate_min  = Sum_1 / Sum_2;
                float width_all = pspd.CoinPayLength * rate_min;
                Width_MyCoin_My     = width_all;
                Width_MyFreeCoin_My = width_all * (1 - rate_my);
                //Debug.LogError("rate_min:" + rate_min + ",rate_my:" + rate_my);
            }


            //老板金币显示

            //MyCoinPay.GetComponent<RectTransform>().SetInsetAndSizeFromParentEdge(RectTransform.Edge.Right, 0.5f, Width_MyCoin_My);
            MyCoinPay.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, Width_MyCoin_My);
            //老板赠币显示
            //MyFreeCoinPay.GetComponent<RectTransform>().SetInsetAndSizeFromParentEdge(RectTransform.Edge.Right, 0.5f, Width_MyFreeCoin_My);
            MyFreeCoinPay.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, Width_MyFreeCoin_My);
            #endregion

            #region 会员金币消耗
            float Sum_3                = pspd.ParlorBossScoreStatMessage[status - 1].memCoin + pspd.ParlorBossScoreStatMessage[status - 1].memCoin3; //本月金币消耗总数
            float Sum_4                = pspd.ParlorBossScoreStatMessage[2 - status].memCoin3 + pspd.ParlorBossScoreStatMessage[2 - status].memCoin; //上月金币消耗总数
            float rate_my_             = (float)pspd.ParlorBossScoreStatMessage[status - 1].memCoin / Sum_3;
            float Width_MemCoin_My     = 0;                                                                                                          //会员金币消耗显示长度
            float Width_MemFreeCoin_My = 0;                                                                                                          //会员赠币消耗显示长度
            if (Sum_3 > Sum_4)
            {
                Width_MemCoin_My     = pspd.CoinPayLength;
                Width_MemFreeCoin_My = pspd.CoinPayLength * (1 - rate_my_);
                //Debug.LogError(",rate_my:" + rate_my_);
            }
            else
            {
                float rate_min  = Sum_3 / Sum_4;
                float width_all = pspd.CoinPayLength * rate_min;
                Width_MemCoin_My     = width_all;
                Width_MemFreeCoin_My = width_all * (1 - rate_my_);
                //Debug.LogError("rate_min:" + rate_min + ",rate_my:" + rate_my_);
            }

            //Debug.LogError("Width_MemCoin_My:" + Width_MemCoin_My + ",Width_MemFreeCoin_My:" + Width_MemFreeCoin_My);
            //会员金币显示
            MemberCoinPay.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, Width_MemCoin_My);
            //会员赠币显示
            MemberFreeCoinPay.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, Width_MemFreeCoin_My);
            #endregion

            #region 业绩收入
            //显示 老板业绩收入
            if (pspd.ParlorBossScoreStatMessage[status - 1].score1 > pspd.ParlorBossScoreStatMessage[2 - status].score1)
            {
                MyScoreGet.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, pspd.ScoreGetLength);
            }
            else
            {
                float rate = 0;

                if (pspd.ParlorBossScoreStatMessage[2 - status].score1 != 0)
                {
                    rate = (float)(pspd.ParlorBossScoreStatMessage[status - 1].score1 / pspd.ParlorBossScoreStatMessage[2 - status].score1);
                }

                MyScoreGet.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, pspd.ScoreGetLength * rate);
            }

            //显示 会员业绩收入
            if (pspd.ParlorBossScoreStatMessage[status - 1].score2 > pspd.ParlorBossScoreStatMessage[2 - status].score2)
            {
                MemberScoreGet.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, pspd.ScoreGetLength);
            }
            else
            {
                float rate = 0;
                if (pspd.ParlorBossScoreStatMessage[2 - status].score2 != 0)
                {
                    rate = (float)(pspd.ParlorBossScoreStatMessage[status - 1].score2 / pspd.ParlorBossScoreStatMessage[2 - status].score2);
                }

                MemberScoreGet.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, pspd.ScoreGetLength * rate);
            }
            #endregion

            #region 显示数据信息
            AllGet.text = "本月总收入: " + (pspd.ParlorBossScoreStatMessage[status - 1].score1 + pspd.ParlorBossScoreStatMessage[status - 1].score2).ToString("0.00");
            AllPay.text = "本月兑换: " + pspd.ParlorBossScoreStatMessage[status - 1].consume.ToString("0.00");

            MyCoin[0].text = pspd.ParlorBossScoreStatMessage[status - 1].bossCoin3.ToString();
            MyCoin[1].text = pspd.ParlorBossScoreStatMessage[status - 1].bossCoin.ToString();
            MyCoin[2].text = Sum_1.ToString();

            MemCoin[0].text = pspd.ParlorBossScoreStatMessage[status - 1].memCoin3.ToString();
            MemCoin[1].text = pspd.ParlorBossScoreStatMessage[status - 1].memCoin.ToString();
            MemCoin[2].text = (pspd.ParlorBossScoreStatMessage[status - 1].memCoin3 + pspd.ParlorBossScoreStatMessage[status - 1].memCoin).ToString();

            ScoreGet[0].text = pspd.ParlorBossScoreStatMessage[status - 1].score1.ToString("0.00");
            ScoreGet[1].text = pspd.ParlorBossScoreStatMessage[status - 1].score2.ToString("0.00");
            #endregion
        }
Пример #26
0
        /// <summary>
        /// 获取已开放县城的信息
        /// </summary>
        /// <param name="json"></param>
        public void GetCountyMessage(string json, int status)
        {
            dicCountyMessage.Clear();
            CountyMessageData data = new CountyMessageData();

            data = JsonBase.DeserializeFromJson <CountyMessageData>(json.ToString());
            if (data.CountyData[0].status != 1)
            {
                Debug.LogError("获取网页json数据状态错误,status:" + data.CountyData[0].status);
                return;
            }

            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            //保存获取的城市信息
            for (int i = 0; i < data.CountyData.Count; i++)
            {
                for (int j = 0; j < data.CountyData[i].data.Count; j++)
                {
                    CountyMessage message = new CountyMessage();
                    message.cityId     = data.CountyData[i].data[j].cityId;
                    message.countyId   = data.CountyData[i].data[j].countyId;
                    message.countyName = data.CountyData[i].data[j].countyName;
                    message.flag       = data.CountyData[i].data[j].flag;
                    message.num        = data.CountyData[i].data[j].num;
                    bool isAdd = false;
                    if (System.Convert.ToInt16(message.flag) == 2)
                    {
                        isAdd = true;
                    }

                    //如果字典中已经有这个键,直接添加县
                    if (dicCountyMessage.ContainsKey(System.Convert.ToInt32(message.cityId)))
                    {
                        dicCountyMessage[System.Convert.ToInt32(message.cityId)].Add(message);
                    }
                    else
                    {
                        List <CountyMessage> county = new List <CountyMessage>();
                        county.Add(message);
                        dicCountyMessage.Add(System.Convert.ToInt32(message.cityId), county);
                    }


                    if (isAdd)
                    {
                        if (pspd.dicCountyMessage.ContainsKey(System.Convert.ToInt32(message.cityId)))
                        {
                            pspd.dicCountyMessage[System.Convert.ToInt32(message.cityId)].Add(message);
                        }
                        else
                        {
                            List <CountyMessage> county = new List <CountyMessage>();
                            county.Add(message);
                            pspd.dicCountyMessage.Add(System.Convert.ToInt32(message.cityId), county);
                        }
                    }
                }
            }

            ////添加县城的测试
            //CountyMessage message_ = new CountyMessage();
            //message_.countyId = "140428";
            //message_.cityId = "355";
            //message_.countyName = "长子县";
            //message_.flag = "2";
            //List<CountyMessage> county_ = new List<CountyMessage>();
            //county_.Add(message_);
            //if (dicCountyMessage.ContainsKey(System.Convert.ToInt32(message_.cityId)))
            //{
            //    dicCountyMessage[System.Convert.ToInt32(message_.cityId)].Add(message_);
            //}

            //获取县的信息成功
            isGetCountySuccess = true;

            if (isGetCitySuccess)
            {
                //改变地图大小
                UIMainView.Instance.SelectAreaPanel.ChangeScale();
            }
        }
Пример #27
0
        /// <summary>
        /// 点击对应的麻将馆,查看详细信息
        /// </summary>
        public void BtnLeftParlor(Toggle tog)
        {
            //改变颜色
            if (!tog.isOn)
            {
                transform.GetChild(1).GetComponent <Text>().color = new Color(0.17f, 0.78f, 0.87f, 1);
                if (status == 0)
                {
                    transform.GetChild(1).GetComponent <Text>().text = "";
                    add.gameObject.SetActive(true);
                    add.sprite = Add_s[0];
                }
                else
                {
                    add.gameObject.SetActive(false);
                }
                return;
            }
            else
            {
                transform.GetChild(1).GetComponent <Text>().color = new Color(0.565f, 0.35f, 0.08f, 1);
                if (status == 0)
                {
                    transform.GetChild(1).GetComponent <Text>().text = "";
                    add.gameObject.SetActive(true);
                    add.sprite = Add_s[1];
                }
                else
                {
                    add.gameObject.SetActive(false);
                }

                if (status == 2)
                {
                    //打开麻将馆信息界面
                    UIMainView.Instance.ParlorShowPanel.ShowPointPanel(MainViewParlorShowPanel.ParlorPanel.TabelGame);
                }
                else if (status == 0)
                {
                    if (GameData.Instance.ParlorShowPanelData.RefreshCount > 0)
                    {
                        UIMainView.Instance.ParlorShowPanel.OpenRefresh();
                    }
                    //在这里重新请求该县的麻将馆信息(暂时关闭麻将广场的界面信息)
                    //GameData.Instance.ParlorShowPanelData.FromWebGetParlorMessage(1, 5);
                    UIMainView.Instance.ParlorShowPanel.ShowPointPanel(MainViewParlorShowPanel.ParlorPanel.ParlorGod);
                    //直接显示策划指定信息
                    UIMainView.Instance.ParlorShowPanel.ParlorGodPanel.NoParlorMessage(1);
                }

                //进入麻将馆查看详情
                if (status == 2)
                {
                    ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;
                    pspd.iParlorId             = InfoDef.iParlorId;
                    pspd.isShowMyParlorMessage = true;
                    UIMainView.Instance.ParlorShowPanel.RemoveAllListener();
                    UIMainView.Instance.ParlorShowPanel.InitAllBtn_Parlor();
                    if (InfoDef.iStatus == 0)
                    {
                        UIMainView.Instance.ParlorShowPanel.BtnParlorTabelGame(true, 0);
                    }
                    SystemMgr.Instance.ParlorShowSystem.UpdateMyParlor(InfoDef);

                    pspd.iCityId[2]   = InfoDef.iCityId;
                    pspd.iCountyId[2] = InfoDef.iCountyId;

                    //隐藏老板的操作按钮
                    int count = UIMainView.Instance.ParlorShowPanel.ParlorMessagePanel.transform.GetChild(1).childCount;
                    for (int i = 1; i < count - 1; i++)
                    {
                        UIMainView.Instance.ParlorShowPanel.ParlorMessagePanel.transform.GetChild(1).GetChild(i).gameObject.SetActive(false);
                    }
                    //开启普通成员的操作按钮
                    UIMainView.Instance.ParlorShowPanel.ParlorMessagePanel.transform.GetChild(1).GetChild(count - 1).gameObject.SetActive(true);
                    if (FindObjectOfType <ParlorTabelGameMessage>())
                    {
                        FindObjectOfType <ParlorTabelGameMessage>().Member.SetActive(false);
                    }
                    SystemMgr.Instance.ParlorShowSystem.UpdateShow();
                }
            }
        }
Пример #28
0
        //绑定按钮
        void AddDelgeteToCountyBtn(int index)
        {
            SystemMgr.Instance.AudioSystem.PlayAuto(AudioSystem.AudioType.VIEW_CLOSE);
            sapd.iCountyId = index;
            NetMsg.ClientCityCountyReq msg = new NetMsg.ClientCityCountyReq();
            msg.iUserId   = GameData.Instance.PlayerNodeDef.iUserId;
            msg.iCityId   = sapd.iCityId;
            msg.iCountyId = sapd.iCountyId;

            Debug.Log("msg.iCityId:" + msg.iCityId + ",msg.iCountyId:" + msg.iCountyId);
            if (sapd.iCountyId != GameData.Instance.PlayerNodeDef.iCountyId)
            {
                NetworkMgr.Instance.LobbyServer.SendCityCountyReq(msg);
            }
            //给出选择成功提示,同时修改玩法界面
            ScaleAreaPanel();
            //  UIMgr.GetInstance().GetUIMessageView().Show("恭喜您修改地区成功", Ok);

            //如果是正常写入玩家市县id
            if (sapd.iOpenStatus == 1)
            {
                //sapd.iCountyId = index;
                //NetMsg.ClientCityCountyReq msg = new NetMsg.ClientCityCountyReq();
                //msg.iUserId = GameData.Instance.PlayerNodeDef.iUserId;
                //msg.iCityId = sapd.iCityId;
                //msg.iCountyId = sapd.iCountyId;
                //NetworkMgr.Instance.LobbyServer.SendCityCountyReq(msg);
            }
            //如果是在创建房间点击选择市县id
            else if (sapd.iOpenStatus == 2)
            {
                sapd.iCountyId = index;
                GameData.Instance.ParlorShowPanelData.iCountyId[2] = index;
                PlayerPrefs.SetInt("CityId" + GameData.Instance.PlayerNodeDef.iUserId, sapd.iCityId);
                PlayerPrefs.SetInt("CountyId" + GameData.Instance.PlayerNodeDef.iUserId, sapd.iCountyId);
                //修改玩法id
                anhui.MahjongCommonMethod.Instance.lsMethodId = new List <int>();
                string[] id = anhui.MahjongCommonMethod.Instance._dicDisConfig[index].METHOD.Split('_');
                for (int k = 0; k < id.Length; k++)
                {
                    int ID = Convert.ToInt16(id[k]);
                    if (ID != 0)
                    {
                        Debug.LogWarning("绑定按钮");
                        anhui.MahjongCommonMethod.Instance.lsMethodId.Add(ID);
                    }
                }

                //修改初始方法的id
                GameData.Instance.CreatRoomMessagePanelData.MethodId = anhui.MahjongCommonMethod.Instance.lsMethodId[0];

                CreatRoomMessagePanelData crmpd = GameData.Instance.CreatRoomMessagePanelData;

                //在这里初始化创建房间的参数
                for (int i = 0; i < crmpd.iParamOpenRoomMessage.Length; i++)
                {
                    crmpd.iParamOpenRoomMessage[i] = 0;
                }
                Debug.LogWarning(GameData.Instance.ParlorShowPanelData.iCountyId[2] + "," + crmpd.CreatRoomType);
                //更新面板
                UIMainView.Instance.CreatRoomMessagePanel.UpdateShowMethod(GameData.Instance.CreatRoomMessagePanelData.MethodId);
                UIMainView.Instance.CreatRoomMessagePanel.SpwanPlayMethodBtn();
                SystemMgr.Instance.CreatRoomMessageSystem.UpdateShow();
                SystemMgr.Instance.LobbyMainSystem.UpdateShow();
            }


            //if (sapd.iOpenStatus == 5)
            //{
            //    sapd.iCountyId = index;
            //    PlayerPrefs.SetInt("CityId", sapd.iCityId);
            //    PlayerPrefs.SetInt("CountyId", sapd.iCountyId);
            //}

            //if (sapd.iOpenStatus > 1)
            //{

            //}

            //ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;
            //if (sapd.iOpenStatus == 3)
            //{
            //    pspd.iCountyId[0] = index;
            //}

            //if (sapd.iOpenStatus == 4)
            //{
            //    pspd.iCountyId[1] = index;
            //}

            //if (sapd.iOpenStatus == 6)
            //{
            //    GameData.Instance.GamePlayingMethodPanelData.CountyId = index;
            //}

            //申请开馆信息
            if (sapd.iOpenStatus == 7)
            {
                ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;
                pspd.iCountyId[0] = index;
                UIMainView.Instance.ParlorShowPanel.ApplyCreatParlorCertl.GetTgMessage(index);
            }
        }
Пример #29
0
        //void OnDisable()
        //{
        //    if (OneSecond != null)
        //    {
        //        Debug.LogError("关闭协成");
        //        StopCoroutine(OneSecond);
        //    }
        //}

        //public void StopOneSecond()
        //{
        //    if (OneSecond != null)
        //    {
        //        Debug.LogError("关闭协成");
        //        StopCoroutine(OneSecond);
        //    }
        //}


        /// <summary>
        /// 更新预置体显示界面
        /// </summary>
        public void UpdateShow(int type_, NetMsg.TableInfoDef Info, ParlorShowPanelData.GetPointParlorTabelMessage info_1)
        {
            gameObject.SetActive(true);
            type = type_;
            if (type == 2)
            {
                TabelInfo_Un = Info;
            }
            else if (type == 3)
            {
                TabelInfo_Ed = info_1;
                RoomNum.text = "房间号_" + Convert.ToInt32(info_1.roomNum).ToString("D6");
                return;
            }
            //显示老板的标志
            int    bossId            = 0;
            string bossImage         = " ";
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            for (int i = 0; i < pspd.parlorInfoDef.Length; i++)
            {
                if (pspd.parlorInfoDef[i] != null && pspd.parlorInfoDef[i].iParlorId == pspd.iParlorId)
                {
                    bossId    = pspd.parlorInfoDef[i].iBossId;
                    bossImage = pspd.parlorInfoDef[i].szBossHeadimgurl;
                    break;
                }
            }
            if (BossImage == null)
            {
                BossImage = transform.GetChild(0).GetChild(3).GetComponent <Image>();
            }

            if (bossId == Convert.ToInt32(Info.iOpenRoomId))
            {
                BossImage.gameObject.SetActive(true);
                MahjongCommonMethod.Instance.GetPlayerAvatar(BossImage.transform.GetChild(0).GetComponent <RawImage>(), bossImage);
            }
            else
            {
                BossImage.gameObject.SetActive(false);
            }


            if (type == 3)
            {
                RoomNum.text = "房号_" + Info.iRoomNum.ToString("D6");
                return;
            }


            if (Info == null || (Info.iRoomNum == 0 && Info.iSeverId == 0))
            {
                type = 1;
                transform.GetChild(0).gameObject.SetActive(false);
                transform.GetChild(1).gameObject.SetActive(false);
                transform.GetChild(2).gameObject.SetActive(false);
                CreatRoom.SetActive(true);
                return;
            }
            else
            {
                type = 2;
                transform.GetChild(0).gameObject.SetActive(true);
                transform.GetChild(1).gameObject.SetActive(true);
                transform.GetChild(2).gameObject.SetActive(true);
                CreatRoom.SetActive(false);
            }

            int[] userid  = new int[4];
            int[] ruserid = new int[4];

            userid  = Info.iaUserId;
            ruserid = Info.iaBespeakUserId;

            //显示玩家的状态
            for (int i = 0; i < 4; i++)
            {
                if (userid[i] > 0)
                {
                    //有人但是没占座
                    if (ruserid[i] == 0)
                    {
                        ready[i].SetActive(true);
                        holdSeat[i].SetActive(false);
                    }
                    //有人且占座
                    else
                    {
                        ready[i].SetActive(false);
                        holdSeat[i].SetActive(true);
                    }
                }
                else
                {
                    //无人但是占座
                    if (ruserid[i] > 0)
                    {
                        ready[i].SetActive(false);
                        holdSeat[i].SetActive(true);
                    }
                    else
                    {
                        ready[i].SetActive(false);
                        holdSeat[i].SetActive(false);
                    }
                }
            }

            RoomNum.text = "房间号_" + Info.iRoomNum.ToString("D6");
            if (MethodName != null)
            {
                //显示玩法名称
                MethodName.text = MahjongCommonMethod.Instance._dicMethodConfig[Convert.ToInt32(Info.iPlayMethod)].METHOD_NAME;
            }
            else
            {
                transform.GetChild(1).GetComponent <Text>().text = MahjongCommonMethod.Instance._dicMethodConfig[Convert.ToInt32(Info.iPlayMethod)].METHOD_NAME;
            }

            if (TabelInfo_Un.iBespeakTime > 0)
            {
                DownTimerImage.SetActive(true);
                //如果预约时间大于0,显示倒计时
                MahjongCommonMethod.Instance.GetNowTimer(0, IeDelayGetTimer);
            }
            else
            {
                DownTimerImage.SetActive(false);
            }
        }
Пример #30
0
        public int status_parlor = 0;  //0表示无需求  1表示已加入 2表示已申请
        //更新对应麻将馆的信息
        public void UpdateShow(NetMsg.ParlorInfoDef info)
        {
            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            ParlorStatus.gameObject.SetActive(false);
            status_parlor = 0;

            if (pspd.isShowParlorRoundPanel)
            {
                for (int i = 0; i < pspd.parlorInfoDef.Length; i++)
                {
                    if (pspd.parlorInfoDef[i] != null && info.iParlorId == pspd.parlorInfoDef[i].iParlorId)
                    {
                        status_parlor = 1;
                        break;
                    }
                }

                for (int i = 0; i < pspd.ApplyParlorId_All.Length; i++)
                {
                    if (info.iParlorId == pspd.ApplyParlorId_All[i])
                    {
                        status_parlor = 2;
                        break;
                    }
                }
            }


            if (status_parlor == 0)
            {
                ParlorStatus.gameObject.SetActive(false);
            }
            else
            {
                ParlorStatus.gameObject.SetActive(true);
                ParlorStatus.sprite = ParlorStatus_Spr[status_parlor - 1];
            }


            if (info.iParlorId == 0 && info.iBossId == 1)
            {
                ParlorMessage[0].SetActive(true);
                ParlorMessage[1].SetActive(false);
                return;
            }
            else
            {
                ParlorMessage[1].SetActive(true);
                ParlorMessage[0].SetActive(false);
            }
            InfoDef = info;
            string name = anhui.MahjongCommonMethod.Instance._dicDisConfig[GameData.Instance.SelectAreaPanelData.iCountyId].COUNTY_NAME;

            if (name.Length < 3)
            {
                Area.fontSize    = 30;
                Area.lineSpacing = 1f;
            }
            else
            {
                Area.fontSize    = 25;
                Area.lineSpacing = 0.85f;
            }
            Area.text                = name;
            ParlorName.text          = info.szParlorName;
            ParlorMemberCount.text   = (info.iMemberNum).ToString();
            ParlorMonthActivity.text = info.iMonthVitality.ToString();
            anhui.MahjongCommonMethod.Instance.GetPlayerAvatar(BossImage, info.szBossHeadimgurl);
        }