/// <summary> /// 赋值每大局信息 /// </summary> /// <param name="key"></param> public void InitFrame(string key) { News_Pel_timeTxt = Info_Frame.transform.Find("Time").GetComponent <Text>(); for (int i = 0; i < 4; i++) { News_Pel_headIge[i] = Info_Frame.transform.Find("hard" + (i + 1) + "/head").GetComponent <Image>(); News_Pel_scoreTxt[i] = Info_Frame.transform.Find("hard" + (i + 1) + "/score").GetComponent <Text>(); FangzhuGo[i] = Info_Frame.transform.Find("hard" + (i + 1) + "/Fangzhu").gameObject; } RoomInfoTxt = Info_Frame.transform.Find("RoomInfo").GetComponent <Text>(); playback_Btn = Info_Frame.transform.Find("playback_Btn").GetComponent <Button>(); var time = TimeToLong.ConvertIntDateTime(userRecords[key].CreateDate); News_Pel_timeTxt.text = time.Year + "-" + time.Month + "-" + time.Day + "\n" + time.Hour.ToString().PadLeft(2, '0') + ":" + time.Minute.ToString().PadLeft(2, '0'); for (int i = 0; i < userRecords[key].recordUserInfo.Count; i++) { News_Pel_headIge[i].transform.parent.gameObject.SetActive(true); LoadImage.Instance.LoadPicture(userRecords[key].recordUserInfo[i].headimg, News_Pel_headIge[i]); News_Pel_scoreTxt[i].text = userRecords[key].recordUserInfo[i].Score; if (userRecords[key].recordUserInfo[i].UserID == userRecords[key].UserID) { FangzhuGo[i].SetActive(true); } } RoomInfoTxt.text = hall.RoomInfo(userRecords[key].RoomMsg); playback_Btn.onClick.AddListener(delegate { OnSendGetUserGamePlayback(key); }); }
/// <summary> /// 赋值每局信息 /// </summary> /// <param name="index"></param> public void InitFrameDetails(int index) { Newss_Pel_timeTxt = Info_FrameDetails.transform.Find("Time").GetComponent <Text>(); for (int i = 0; i < 4; i++) { Newss_Pel_headIge[i] = Info_FrameDetails.transform.Find("hard" + (i + 1) + "/head").GetComponent <Image>(); Newss_Pel_scoreTxt[i] = Info_FrameDetails.transform.Find("hard" + (i + 1) + "/score").GetComponent <Text>(); zhuang[i] = Info_FrameDetails.transform.Find("hard" + (i + 1) + "/zhuang").gameObject; } playbacks_Btn = Info_FrameDetails.transform.Find("playback_Btn").GetComponent <Button>(); Newss_Pel_timeTxt.text = index + 1 + "/" + GameOperationProcesss.Count; zhuang[GameOperationProcesss[index].gameOperationInfo[0].OperationFW - 1].SetActive(true); var jsInfo = ProtobufUtility.DeserializeProtobuf <ReturnJS>(GameOperationProcesss[index].JieSuanInfo); for (int i = 0; i < userRecords[keyTemp].recordUserInfo.Count; i++) { Newss_Pel_headIge[i].transform.parent.gameObject.SetActive(true); LoadImage.Instance.LoadPicture(userRecords[keyTemp].recordUserInfo[i].headimg, Newss_Pel_headIge[i]); Newss_Pel_scoreTxt[i].text = jsInfo.js[i].FS.ToString(); } var time = TimeToLong.ConvertIntDateTime(userRecords[keyTemp].CreateDate); timeTxt.text = time.Year + "-" + time.Month + "-" + time.Day + "\n" + time.Hour.ToString().PadLeft(2, '0') + ":" + time.Minute.ToString().PadLeft(2, '0'); rule.text = hall.RoomInfo(userRecords[keyTemp].RoomMsg); playbacks_Btn.onClick.AddListener(delegate { GamePlayback(GameOperationProcesss[index]); }); }
/// <summary> /// 圈主查看申请 /// </summary> void ShowPengYQApply() { Transform tf = PengYQApply_Pel.transform.Find("Scroll View/Viewport/Content/QuanZi"); Clear(tf.parent); PengYQApply_Pel.transform.Find("bgLogo").gameObject.SetActive(true); foreach (var item in GameInfo.returnGroupApplyInfo.GroupApplyInfoList.OrderByDescending(w => w.ApplyDateTime)) { PengYQApply_Pel.transform.Find("bgLogo").gameObject.SetActive(false); Transform tf1 = Instantiate(tf, tf.parent) as Transform; //tf1.gameObject.SetActive(true); tf1.Find("UserName").GetComponent <Text>().text = "用户名:" + item.PlayerInfo[GameInfo.returnGroupApplyInfo.GroupApplyInfoList.IndexOf(item)].NickName; tf1.Find("UserId").GetComponent <Text>().text = "用户ID:" + item.PlayerInfo[GameInfo.returnGroupApplyInfo.GroupApplyInfoList.IndexOf(item)].GroupUserID.ToString(); tf1.name = item.PlayerInfo[GameInfo.returnGroupApplyInfo.GroupApplyInfoList.IndexOf(item)].GroupUserID.ToString(); tf1.Find("Time").GetComponent <Text>().text = "申请时间:" + TimeToLong.ConvertIntDateTime(item.ApplyDateTime).ToShortDateString().ToString(); LoadImage.Instance.LoadPicture(item.PlayerInfo[GameInfo.returnGroupApplyInfo.GroupApplyInfoList.IndexOf(item)].picture, tf1.Find("hard/head").GetComponent <Image>()); if (item.ApplyStatus == 4) { tf1.transform.Find("ConsentBtn/Text").GetComponent <Text>().text = "同意退出"; tf1.transform.Find("RejectBtn/Text").GetComponent <Text>().text = "拒绝退出"; tf1.transform.Find("ConsentBtn").GetComponent <Button>().onClick.AddListener(delegate { SendChangeApplyStatus(5, long.Parse(tf1.name)); SendApplyRecord(groupID); SendGroupUsersManager(GameInfo.OpenID, GameInfo.unionid, groupID); }); tf1.transform.Find("RejectBtn").GetComponent <Button>().onClick.AddListener(delegate { SendChangeApplyStatus(6, long.Parse(tf1.name)); SendApplyRecord(groupID); SendGroupUsersManager(GameInfo.OpenID, GameInfo.unionid, groupID); }); } else { tf1.transform.Find("ConsentBtn").GetComponent <Button>().onClick.AddListener(delegate { SendChangeApplyStatus(1, long.Parse(tf1.name)); SendApplyRecord(groupID); SendGroupUsersManager(GameInfo.OpenID, GameInfo.unionid, groupID); }); tf1.transform.Find("RejectBtn").GetComponent <Button>().onClick.AddListener(delegate { SendChangeApplyStatus(2, long.Parse(tf1.name)); SendApplyRecord(groupID); SendGroupUsersManager(GameInfo.OpenID, GameInfo.unionid, groupID); }); } } PengYQApply_Pel.transform.Find("Scroll View").GetComponent <ScrollRectControl>().InitScrollRect(1, delegate { SendApplyRecord(groupID); Debug.Log(groupID); }); GameInfo.returnGroupApplyInfo = null; }
/// <summary> /// 圈子用户战绩查看 /// </summary> void ShowPengYQUserExploits() { Debug.Log("圈子战绩"); Transform tf = PengYQUserExploits_Pel.transform.Find("Scroll View/Viewport/Content/QuanZi"); Clear(tf.parent); int index = 0; PengYQUserExploits_Pel.transform.Find("bgLogo").gameObject.SetActive(true); foreach (var item in GameInfo.returnUserRecord.userRecord) { PengYQUserExploits_Pel.transform.Find("bgLogo").gameObject.SetActive(false); Transform tf1 = Instantiate(tf, tf.parent) as Transform; var time = TimeToLong.ConvertIntDateTime(item.CreateDate); tf1.Find("time").GetComponent <Text>().text = "时间:" + time.Month + "/" + time.Day + " " + time.Hour.ToString().PadLeft(2, '0') + ":" + time.Minute.ToString().PadLeft(2, '0'); tf1.Find("index").GetComponent <Text>().text = "序号:" + ++index; for (int i = 0; i < item.recordUserInfo.Count; i++) { tf1.Find("hard" + (i + 1)).gameObject.SetActive(true); tf1.Find("hard" + (i + 1) + "/UserId").GetComponent <Text>().text = item.recordUserInfo[i].UserID.ToString(); tf1.Find("hard" + (i + 1) + "/UserName").GetComponent <Text>().text = item.recordUserInfo[i].nickname; tf1.Find("hard" + (i + 1) + "/Score").GetComponent <Text>().text = int.Parse(item.recordUserInfo[i].Score) >= 0 ? "<color=green>+" + item.recordUserInfo[i].Score + "</color>" : "<color=red>" + item.recordUserInfo[i].Score + "</color>";//if (int.Parse(item.recordUserInfo[i].Score) >= 0) { } ? "<color=lime>充足</color>" : "<color=red>不足</color>"); LoadImage.Instance.LoadPicture(item.recordUserInfo[i].headimg, tf1.Find("hard" + (i + 1) + "/head").GetComponent <Image>()); } } PengYQUserExploits_Pel.transform.Find("Scroll View").GetComponent <ScrollRectControl>().InitScrollRect(1, delegate { SendGetUserRecord(); }); GameInfo.returnUserRecord = null; GameInfo.isPYQExploits = false; }
/// <summary> /// 显示朋友圈大厅 /// </summary> void ShowPengYQLobby() { Transform tf = PengYQLobby_Pel.transform.Find("Scroll View/Viewport/Content/QuanZi"); Clear(tf.parent); PengYQLobby_Pel.transform.Find("bgLogo").gameObject.SetActive(true); foreach (var item in GameInfo.returnLobbyInfo.RoomListInfo) { PengYQLobby_Pel.transform.Find("bgLogo").gameObject.SetActive(false); Transform tf1 = Instantiate(tf, tf.parent) as Transform; //tf1.gameObject.SetActive(true); for (int i = 0; i < item.room_peo; i++) { tf1.Find("hard" + (i + 1)).gameObject.SetActive(true); if (i < item.PlayerList.Count) { LoadImage.Instance.LoadPicture(item.PlayerList[i].picture, tf1.Find("hard" + (i + 1) + "/head").GetComponent <Image>()); } } tf1.Find("roomId").GetComponent <Text>().text = "房间号:" + item.roomID.ToString(); tf1.name = item.roomID.ToString(); var time = TimeToLong.ConvertIntDateTime(item.CreateDate); tf1.Find("Time").GetComponent <Text>().text = "创建时间:" + time.Month + "/" + time.Day + " " + time.Hour.ToString().PadLeft(2, '0') + ":" + time.Minute.ToString().PadLeft(2, '0'); ReturnRoomMsg msg = new ReturnRoomMsg(); msg.is_benji = item.is_benji; msg.is_shangxiaji = item.is_shangxiaji; msg.is_wgj = item.is_wgj; msg.is_xinqiji = item.is_xinqiji; msg.is_lianzhuang = item.is_lianzhuang; msg.is_yikousan = item.is_yikousan; msg.Is_yuanque = item.IsYuanQue; msg.QuickCard = item.QuickCard; tf1.Find("method").GetComponent <Text>().text = "房间规则:" + hall.RoomInfo(msg); if (item.room_peo > item.PlayerList.Count) { tf1.Find("JoinRoomBtn").GetComponent <Button>().onClick.AddListener(delegate { enterRoom.gameObject.SetActive(true); enterRoom.roomidStr = tf1.name; GameInfo.GroupID = groupInfo.GroupID; enterRoom.OnEnterRoomClick(); }); tf1.SetSiblingIndex(1); } else { tf1.Find("JoinRoomBtn").gameObject.SetActive(false); tf1.SetSiblingIndex(tf.parent.childCount - 1); } } PengYQLobby_Pel.transform.Find("Name").GetComponent <Text>().text = "圈名:" + groupInfo.GroupName; PengYQLobby_Pel.transform.Find("QuanHao").GetComponent <Text>().text = "圈号:" + groupInfo.GroupID.ToString(); //PengYQLobby_Pel.transform.Find("Intro").GetComponent<Text>().text = "圈子简介:\n\t\t" + groupInfo.GroupIntroduction; //PengYQLobby_Pel.transform.Find("LookInfoBtn").gameObject.SetActive(!groupInfo.IsGroupLord); PengYQInfo_Pel.transform.Find("Info_Pel/QuitBtn").gameObject.SetActive(!groupInfo.IsGroupLord); PengYQLobby_Pel.transform.Find("Scroll View").GetComponent <ScrollRectControl>().InitScrollRect(1, delegate { SendLobbyInfo(groupInfo.GroupID); Debug.Log(groupInfo.GroupID); }); GameInfo.returnLobbyInfo = null; }
/// <summary> /// 显示申请记录 /// </summary> void ShowPengYQApplyRecord() { Transform tf = PengYQApplyRecord_Pel.transform.Find("Scroll View/Viewport/Content/QuanZi"); Clear(tf.parent); PengYQApplyRecord_Pel.transform.Find("bgLogo").gameObject.SetActive(true); foreach (var item in GameInfo.returnGroupApplyInfo.GroupApplyInfoList.OrderByDescending(w => w.ApplyDateTime)) { PengYQApplyRecord_Pel.transform.Find("bgLogo").gameObject.SetActive(false); Transform tf1 = Instantiate(tf, tf.parent) as Transform; //tf1.gameObject.SetActive(true); tf1.Find("UserName").GetComponent <Text>().text = "圈名:" + item.GroupName; tf1.Find("UserId").GetComponent <Text>().text = "圈号:" + item.GroupID.ToString(); tf1.Find("Time").GetComponent <Text>().text = "申请时间:" + TimeToLong.ConvertIntDateTime(item.ApplyDateTime).ToShortDateString().ToString(); tf1.Find("State").GetComponent <Text>().text = item.ApplyStatus == 0 ? "申请中": item.ApplyStatus == 1 ? "申请通过" : "申请拒绝"; } PengYQApplyRecord_Pel.transform.Find("Scroll View").GetComponent <ScrollRectControl>().InitScrollRect(1, delegate { SendApplyRecord(); }); GameInfo.returnGroupApplyInfo = null; }
/// <summary> /// 显示朋友圈界面 /// </summary> void ShowPengYouQuan() { Transform tf = PengYQMain_Pel.transform.Find("Scroll View/Viewport/Content/QuanZi"); dicTemp.Clear(); Clear(tf.parent); PengYQMain_Pel.transform.Find("bgLogo").gameObject.SetActive(true); foreach (var item in GameInfo.returnGroupInfo.groupInfo) { PengYQMain_Pel.transform.Find("bgLogo").gameObject.SetActive(false); Transform tf1 = Instantiate(tf, tf.parent) as Transform; //tf1.gameObject.SetActive(true); tf1.name = item.GroupID.ToString(); tf1.Find("Name").GetComponent <Text>().text = "圈名:" + item.GroupName; tf1.Find("QuanHao").GetComponent <Text>().text = "圈号:" + item.GroupID.ToString(); Debug.Log(TimeToLong.ConvertIntDateTime(item.CreateTime).Date.ToString()); tf1.Find("Time").GetComponent <Text>().text = "创建时间:" + TimeToLong.ConvertIntDateTime(item.CreateTime).ToShortDateString().ToString(); //tf1.Find("Intro").GetComponent<Text>().text = "圈子简介:\n\t\t" + item.GroupIntroduction; tf1.Find("FKstate").GetComponent <Text>().text = "房卡状态:" + (item.RoomCardCounts > 0 ? "<color=lime>充足</color>" : "<color=red>不足</color>"); if (item.IsGroupLord) { tf1.Find("QZManagerBtn").GetComponent <Button>().onClick.AddListener(delegate { SendGroupUsersManager(GameInfo.OpenID, GameInfo.unionid, long.Parse(tf1.name)); groupID = long.Parse(tf1.name); }); // tempAction = delegate { SendGroupUsersManager(GameInfo.OpenID, GameInfo.unionid, long.Parse(tf1.name)); }; tf1.SetSiblingIndex(1); } else { tf1.Find("QZManagerBtn").gameObject.SetActive(false); } //dicTemp.Add(tf1.name, item); dicTemp[tf1.name] = item; tf1.Find("CreateRoomBtn").GetComponent <Button>().onClick.AddListener(delegate { GameInfo.GroupID = long.Parse(tf1.name); }); tf1.Find("EnterLobbiesBtn").GetComponent <Button>().onClick.AddListener(delegate { groupInfo = dicTemp[tf1.name]; SendLobbyInfo(long.Parse(tf1.name)); // tempAction = delegate { SendLobbyInfo(long.Parse(tf1.name)); }; }); } PengYQMain_Pel.transform.Find("Scroll View").GetComponent <ScrollRectControl>().InitScrollRect(1, delegate { SendGroupInfo(); }); GameInfo.returnGroupInfo = null; }
/// <summary> /// 显示开房记录 /// </summary> void ShowPengYQCreateRommRecord() { Transform tf = PengYQCreateRommRecord_Pel.transform.Find("Scroll View/Viewport/Content/QuanZi"); Clear(tf.parent); PengYQCreateRommRecord_Pel.transform.Find("bgLogo").gameObject.SetActive(true); foreach (var item in GameInfo.returnRecordList.CreateRommRecordList.OrderByDescending(w => w.CreateDate)) { PengYQCreateRommRecord_Pel.transform.Find("bgLogo").gameObject.SetActive(false); Transform tf1 = Instantiate(tf, tf.parent) as Transform; //tf1.gameObject.SetActive(true); var time = TimeToLong.ConvertIntDateTime(item.CreateDate); tf1.Find("Time").GetComponent <Text>().text = "创建时间:" + time.Month + "/" + time.Day + " " + time.Hour.ToString().PadLeft(2, '0') + ":" + time.Minute.ToString().PadLeft(2, '0'); tf1.Find("CreateUserID").GetComponent <Text>().text = "创建用户ID:" + item.CreateUserID.ToString(); tf1.Find("GroupID").GetComponent <Text>().text = "圈号:" + item.GroupID.ToString(); tf1.Find(" RoomID").GetComponent <Text>().text = "房间号:" + item.RoomID.ToString(); tf1.Find("UseRoomCard").GetComponent <Text>().text = "消耗房卡:" + item.UseRoomCard.ToString(); } PengYQCreateRommRecord_Pel.transform.Find("Scroll View").GetComponent <ScrollRectControl>().InitScrollRect(1, delegate { SendGroupUsersManager(GameInfo.OpenID, GameInfo.unionid, groupID, 0, userID); Debug.Log(userID); }); GameInfo.returnRecordList = null; }
/// <summary> /// 显示朋友圈信息 /// </summary> void ShowPengYQInfo() { if (GameInfo.returnGroupInfoByGroupID.Status == 0) { FICWaringPanel._instance.Show("圈子不存在,或者 不是圈子用户,需要刷新圈子信息。"); return; } PengYQInfo_Pel.transform.Find("Info_Pel/tag").GetComponent <Text>().text = "圈子号:" + GameInfo.returnGroupInfoByGroupID.GroupID + "\n圈子名:" + GameInfo.returnGroupInfoByGroupID.GroupName + "\n创建人:" + GameInfo.returnGroupInfoByGroupID.NikeName + "\n\n创建时间:" + TimeToLong.ConvertIntDateTime(GameInfo.returnGroupInfoByGroupID.CreateTime).Date + "\n圈子人数:" + GameInfo.returnGroupInfoByGroupID.GroupNumberPeople; GameInfo.returnGroupInfoByGroupID = null; }