/// <summary>
        /// 点击面板关闭按钮
        /// </summary>
        public void BtnClose()
        {
            SystemMgr.Instance.AudioSystem.PlayAuto(AudioSystem.AudioType.VIEW_CLOSE);
            HistroyGradePanelData hgpd = GameData.Instance.HistroyGradePanelData;

            if (hgpd.BtnCloseStatus == 1)
            {
                hgpd.isShowGrade_Round = false;
                hgpd.isShowGrade_Room  = true;
                hgpd.isPanelShow       = true;
                hgpd.BtnCloseStatus    = 2;

                //删除玩家的之前的面板
                HistroyGradeRound[] rounds = UIMainView.Instance.HistroyGradePanel.GradeRect_Round.transform.Find("Content").GetComponentsInChildren <HistroyGradeRound>(true);
                for (int i = 0; i < rounds.Length; i++)
                {
                    Destroy(rounds[i].gameObject);
                }

                GradeRect_Round.transform.Find("Content").GetComponent <InfinityGridLayoutGroup>().Init();
            }
            else if (hgpd.BtnCloseStatus == 2)
            {
                hgpd.isShowGrade_Round = false;
                hgpd.isShowGrade_Room  = false;
                hgpd.isPanelShow       = false;
            }

            UpdateShow();
        }
        //面板更新
        public void UpdateShow()
        {
            HistroyGradePanelData hgpd = GameData.Instance.HistroyGradePanelData;

            if (hgpd.isPanelShow)
            {
                gameObject.SetActive(true);
                GameData.Instance.isShowQuitPanel = false;
                if (hgpd.isShowGrade_Room)
                {
                    GradeRect_Room.SetActive(true);
                    Room_Title.gameObject.SetActive(true);
                    SpwanHistoryPanel();
                }
                else
                {
                    if (infinityGridLayoutGroup)
                    {
                        infinityGridLayoutGroup.RemoveListener_Rect();
                    }
                    //Room_Title.gameObject.SetActive(false);
                    GradeRect_Room.SetActive(false);
                }


                if (hgpd.isShowGrade_Round)
                {
                    //处理玩家点击具体游戏列表
                    Room_Title.gameObject.SetActive(false);
                    Round_Title.SetActive(true);
                    GradeRect_Round.SetActive(true);
                    Debug.LogWarning("已经激活战绩详情面板");
                }
                else
                {
                    Round_Title.SetActive(false);
                    GradeRect_Round.SetActive(false);
                }

                if (!hgpd.isShowGrade_Room && !hgpd.isShowGrade_Round)
                {
                    NoneGrade.SetActive(true);
                    //Room_Title.gameObject.SetActive(false);
                    GradeRect_Round.SetActive(false);
                    Round_Title.SetActive(false);
                    GradeRect_Room.SetActive(false);
                }
            }
            else
            {
                if (infinityGridLayoutGroup)
                {
                    infinityGridLayoutGroup.RemoveListener_Rect();
                }
                GameData.Instance.isShowQuitPanel = true;
                gameObject.SetActive(false);
            }
        }
Esempio n. 3
0
        public void SpwanHistroyGrade_Round()
        {
            // Debug.LogError("开始产生对应的战绩预置体");

            UIMainView.Instance.HistroyGradePanel.GradeRect_Round.transform.Find("Content").GetComponent <GridLayoutGroup>().enabled   = true;
            UIMainView.Instance.HistroyGradePanel.GradeRect_Round.transform.Find("Content").GetComponent <ContentSizeFitter>().enabled = true;
            int count = Grade_RoundData_.Count;

            if (count <= 0)
            {
                MahjongCommonMethod.Instance.ShowRemindFrame("本条记录没有战绩");
                return;
            }

            if (count > 5)
            {
                HistroyGradePanelData hgpd = GameData.Instance.HistroyGradePanelData;
                for (int i = 0; i < 5; i++)
                {
                    GameObject go = Instantiate(Resources.Load <GameObject>("Lobby/HistroyGrade/HistroyGrade_Round"));
                    go.transform.SetParent(UIMainView.Instance.HistroyGradePanel.GradeRect_Round.transform.Find("Content"));
                    go.transform.localEulerAngles = Vector3.zero;
                    go.transform.localPosition    = new Vector3(go.transform.localPosition.x, go.transform.localPosition.y, 0);
                    go.transform.localScale       = Vector3.one;
                    go.name = "HistroyGrade_Round_" + i;
                    UIMainView.Instance.HistroyGradePanel.GradeRect_Round.transform.Find("Content").
                    GetComponent <InfinityGridLayoutGroup>().children.Add(go.GetComponent <RectTransform>());
                    // Debug.Log ("go.name:" + go.name);
                }

                //初始化数据列表;
                infinityGridLayoutGroup = UIMainView.Instance.HistroyGradePanel.GradeRect_Round.transform.Find("Content").GetComponent <InfinityGridLayoutGroup>();
                infinityGridLayoutGroup.Init();
                infinityGridLayoutGroup.SetAmount(Grade_RoundData_.Count);
                infinityGridLayoutGroup.updateChildrenCallback = UpdateChildrenCallback;
            }
            else
            {
                for (int i = 0; i < count; i++)
                {
                    GameObject go = Instantiate(Resources.Load <GameObject>("Lobby/HistroyGrade/HistroyGrade_Round"));
                    go.transform.SetParent(UIMainView.Instance.HistroyGradePanel.GradeRect_Round.transform.Find("Content"));
                    go.transform.localEulerAngles = Vector3.zero;
                    go.transform.localPosition    = new Vector3(go.transform.localPosition.x, go.transform.localPosition.y, 0);
                    go.transform.localScale       = Vector3.one;
                    go.name = "HistroyGrade_Round_" + i;
                    HistroyGradeRound round = go.GetComponent <HistroyGradeRound>();
                    round.RoundData = Grade_RoundData_[i];
                    round.UpdateShow(i + 1);
                }

                //初始化数据列表;
                infinityGridLayoutGroup = UIMainView.Instance.HistroyGradePanel.GradeRect_Round.transform.Find("Content").GetComponent <InfinityGridLayoutGroup>();
                infinityGridLayoutGroup.Init();
                infinityGridLayoutGroup.SetAmount(Grade_RoundData_.Count);
                infinityGridLayoutGroup.updateChildrenCallback = UpdateChildrenCallback;
            }
        }
        void UpdateChildrenCallback(int index, Transform trans)
        {
            HistroyGradePanelData hgpd = GameData.Instance.HistroyGradePanelData;
            HistroyGradeRoom      room = trans.GetComponent <HistroyGradeRoom>();

            room.GradeRoom = hgpd.GradeMessage[index];
            room.index     = index;
            room.UpdateShow();
        }
Esempio n. 5
0
        /// <summary>
        /// 本条开房记录的点击
        /// </summary>
        public void BtnGradeRoom()
        {
            HistroyGradePanelData hgpd = GameData.Instance.HistroyGradePanelData;
            string url = LobbyContants.MAJONG_PORT_URL + url_suffix;

            if (SDKManager.Instance.IOSCheckStaus == 1)
            {
#if UNITY_IOS
                url = LobbyContants.MAJONG_PORT_URL_T + url_suffix;
#endif
            }
            //要传的值
            Dictionary <string, string> value = new Dictionary <string, string>();
            value.Add("openRoomId", GradeRoom.openRoomId);

            int    portIndex = GradeRoom.openRoomId.IndexOf('-');
            string strPort   = GradeRoom.openRoomId.Substring(0, portIndex);
            MahjongCommonMethod.Instance.SeverPort = (ushort)Convert.ToInt32(strPort);

            //获取该条记录对应的每局的信息
            MahjongCommonMethod.Instance.GetPlayerMessageData_IE(url, value, GetGrade_Round, json_data, 0);
            //打开具体的信息显示
            hgpd.isPanelShow       = true;
            hgpd.isShowGrade_Round = true;
            hgpd.isShowGrade_Room  = false;
            hgpd.BtnCloseStatus    = 1;

            //更新显示该局的房间信息
            UIMainView.Instance.HistroyGradePanel.RoomId.text     = GradeRoom.roomNum;
            UIMainView.Instance.HistroyGradePanel.Timer.text      = GradeRoom.openTim.ToString("yyyy_MM_dd HH:mm");
            UIMainView.Instance.HistroyGradePanel.MethodName.text = "(" + MahjongCommonMethod.Instance._dicMethodConfig[Convert.ToInt32(GradeRoom.playing_method)].METHOD_NAME + ")";
            for (int i = 0; i < 4; i++)
            {
                if (GradeRoom.nickName[i].Length > 3)
                {
                    UIMainView.Instance.HistroyGradePanel.NickName[i].text = GradeRoom.nickName[i].Substring(0, 3) + "..";
                }
                else
                {
                    UIMainView.Instance.HistroyGradePanel.NickName[i].text = GradeRoom.nickName[i];
                }

                if (GradeRoom.point[i] == scoreMax)
                {
                    UIMainView.Instance.HistroyGradePanel.NickName[i].color = new Color(0.8f, 0.34f, 0, 1);
                }
                else
                {
                    UIMainView.Instance.HistroyGradePanel.NickName[i].color = new Color(0.23f, 0.5f, 0.65f, 1);
                }
            }

            SystemMgr.Instance.HistroyGradeSystem.UpdateShow();
        }
Esempio n. 6
0
        /// <summary>
        /// 处理点击战绩按钮
        /// </summary>
        void HandleHistroyGrade()
        {
            //显示战绩面板,同时产生玩家战绩
            GameData gd = GameData.Instance;
            HistroyGradePanelData hgpd = gd.HistroyGradePanelData;

            hgpd.isPanelShow       = true;
            hgpd.isShowGrade_Room  = true;
            hgpd.isShowGrade_Round = false;
            hgpd.BtnCloseStatus    = 2;
            hgpd.timer             = (int)MahjongCommonMethod.Instance.DateTimeToUnixTimestamp(System.DateTime.Now);
            //把时间写入请求时间
            PlayerPrefs.SetInt("time_h" + GameData.Instance.PlayerNodeDef.iUserId, (int)MahjongCommonMethod.Instance.DateTimeToUnixTimestamp(System.DateTime.Now));

            //Debug.LogError("time_h:" + PlayerPrefs.GetInt("time_h"));

            UIMainView.Instance.LobbyPanel.RedPoint[2].gameObject.SetActive(false);
            SystemMgr.Instance.HistroyGradeSystem.UpdateShow();
        }
Esempio n. 7
0
        //对本条记录进行点赞
        public void BtnCompliment(int seatNum)
        {
            int selfSeatNum = -1;  //自己的座位号  0----3

            //获取自己的座位号
            for (int i = 0; i < 4; i++)
            {
                if (GameData.Instance.PlayerNodeDef.iUserId == Convert.ToInt32(GradeRoom.userid[i]))
                {
                    selfSeatNum = i;
                }
            }

            NetMsg.ClientComplimentReq msg = new NetMsg.ClientComplimentReq();
            msg.iUserId          = GameData.Instance.PlayerNodeDef.iUserId;
            msg.szOpenRoomId     = GradeRoom.openRoomId;
            msg.byComplimentSeat = (byte)seatNum;
            NetworkMgr.Instance.LobbyServer.SendComplimentReq(msg);
            GradeRoom.playerComplient[seatNum - 1] = 1.ToString();

            HistroyGradePanelData hgpd = GameData.Instance.HistroyGradePanelData;

            //修改该条房间记录的赞的标志
            for (int i = 0; i < 4; i++)
            {
                if (i == selfSeatNum)
                {
                    Debug.LogError("seatNum:" + seatNum);
                    hgpd.GradeMessage[index].playerComplient[i] = seatNum.ToString();
                }
                else
                {
                    Debug.LogError("======================================");
                    hgpd.GradeMessage[index].playerComplient[i] = 0.ToString();
                }
            }

            //处理当前的界面,更新界面
            UpdateComplient(seatNum - 1);
        }
Esempio n. 8
0
 void Awake()
 {
     instance = this;
     hgpd     = GameData.instance.HistroyGradePanelData;
 }
        /// <summary>
        /// 产生历史战绩的面板
        /// </summary>
        public void SpwanHistoryPanel()
        {
            //删除玩家的之前的面板
            HistroyGradeRoom[] rooms = GradeRect_Room.transform.Find("Content").GetComponentsInChildren <HistroyGradeRoom>();

            if (rooms.Length > 0)
            {
                for (int i = 0; i < rooms.Length; i++)
                {
                    Destroy(rooms[i].gameObject);
                }

                //return;
            }
            GradeRect_Room.transform.Find("Content").GetComponent <GridLayoutGroup>().enabled   = true;
            GradeRect_Room.transform.Find("Content").GetComponent <ContentSizeFitter>().enabled = true;



            HistroyGradePanelData hgpd = GameData.Instance.HistroyGradePanelData;
            int count = hgpd.GradeMessage.Count;

            if (count <= 0)
            {
                hgpd.isShowGrade_Room  = false;
                hgpd.isShowGrade_Round = false;
                UpdateShow();
            }



            //Debug.LogError("hgpd.GradeMessage:" + hgpd.GradeMessage.Count);
            if (count > 5)
            {
                for (int i = 0; i < 5; i++)
                {
                    GameObject go = Instantiate(Resources.Load <GameObject>("Lobby/HistroyGrade/HistroyGrade_Room"));
                    go.transform.SetParent(GradeRect_Room.transform.Find("Content"));
                    go.transform.localEulerAngles = Vector3.zero;
                    go.transform.localPosition    = new Vector3(go.transform.localPosition.x, go.transform.localPosition.y, 0);
                    go.transform.localScale       = Vector3.one;
                    go.name = "HistroyGrade_Room_" + i;
                }
                //初始化数据列表;
                infinityGridLayoutGroup = GradeRect_Room.transform.Find("Content").GetComponent <InfinityGridLayoutGroup>();
                infinityGridLayoutGroup.Init();
                //Invoke("SetAmount", 0.1f);
                infinityGridLayoutGroup.SetAmount(hgpd.GradeMessage.Count);
                infinityGridLayoutGroup.updateChildrenCallback = UpdateChildrenCallback;
            }
            else
            {
                for (int i = 0; i < count; i++)
                {
                    GameObject go = Instantiate(Resources.Load <GameObject>("Lobby/HistroyGrade/HistroyGrade_Room"));
                    go.transform.SetParent(GradeRect_Room.transform.Find("Content"));
                    go.transform.localEulerAngles = Vector3.zero;
                    go.transform.localPosition    = new Vector3(go.transform.localPosition.x, go.transform.localPosition.y, 0);
                    go.transform.localScale       = Vector3.one;
                    go.name = "HistroyGrade_Room_" + i;
                    HistroyGradeRoom room = go.GetComponent <HistroyGradeRoom>();
                    room.GradeRoom = hgpd.GradeMessage[i];
                    room.index     = i;
                    room.UpdateShow();
                }
            }
        }