Example #1
0
        /// <summary>
        /// 点击历史房间显示结算信息
        /// </summary>
        public void OnCreateUserInfoWindow()
        {
            var pWin = MainYxView as YxWindow;

            if (pWin == null)
            {
                return;
            }
            YxWindow         obj       = pWin.CreateChildWindow("TeaUserInfoPanel");
            TeaUserInfoPanel infoPanel = obj.GetComponent <TeaUserInfoPanel>();

            infoPanel.GameName.text    = _roomData.GameName;
            infoPanel.RoomId.text      = _roomData.RoomId;
            infoPanel.RoundAndUse.text = string.Format("{0}{1} {2}房卡", _roomData.GameRound, _roomData.IsQuan ? "圈" : "局", _roomData.UseNum);
            string rule = _roomData.InfoStr;

            string[] strList = rule.Split(' ');
            rule = "";
            for (int i = 0; i < strList.Length; i++)
            {
                if (strList[i] == "")
                {
                    continue;
                }
                if (i == strList.Length - 1)
                {
                    rule += strList[i];
                    continue;
                }
                rule += strList[i] + "\n";
            }
            infoPanel.RuleInfo.text = rule;

            var users = _roomData.UserInfos;

            for (int i = 0; i < users.Length; i++)
            {
                infoPanel.UserNames[i].text = users[i].UserName;
                infoPanel.UserNames[i].gameObject.SetActive(true);
                infoPanel.Scores[i].text = YxUtiles.GetShowNumberForm(long.Parse(users[i].Gold), 0, "N0");
                infoPanel.Scores[i].gameObject.SetActive(true);
                infoPanel.Heads[i].mainTexture = Avatars[i].GetTexture();
                infoPanel.Heads[i].gameObject.SetActive(true);
                if (infoPanel.Ids.Length != 0)
                {
                    infoPanel.Ids[i].text = users[i].Id;
                }
            }
        }
Example #2
0
        public void CreateUserInfoWindow(TeaRoomInfoItem item)
        {
            YxWindow         obj       = CreateChildWindow("TeaUserInfoPanel");
            TeaUserInfoPanel infoPanel = obj.GetComponent <TeaUserInfoPanel>();

            infoPanel.GameName.text    = item.RealGameName;
            infoPanel.RoomId.text      = item.RoomId.text;
            infoPanel.RoundAndUse.text = string.Format("{0} {1}房卡", item.RealGameRound, item.UseNum);
            string rule = item.InfoStr;

            string[] strList = rule.Split(' ');
            rule = "";
            for (int i = 0; i < strList.Length; i++)
            {
                if (strList[i] == "")
                {
                    continue;
                }
                if (i == strList.Length - 1)
                {
                    rule += strList[i];
                    continue;
                }
                rule += strList[i] + "\n";
            }
            infoPanel.RuleInfo.text = rule;
            for (int i = 0; i < item.Golds.Length; i++)
            {
                infoPanel.UserNames[i].text = item.Names[i].text;
                infoPanel.UserNames[i].gameObject.SetActive(true);
                infoPanel.Scores[i].text = YxUtiles.GetShowNumber(long.Parse(item.Golds[i])).ToString();
                infoPanel.Scores[i].gameObject.SetActive(true);
                infoPanel.Heads[i].mainTexture = item.Avatars[i].GetTexture();
                infoPanel.Heads[i].gameObject.SetActive(true);
                if (infoPanel.Ids.Length != 0)
                {
                    infoPanel.Ids[i].text = item.Ids[i];
                }
            }
        }