/// <summary> /// 更新麻将馆按钮的名称 /// </summary> /// <param name="info"></param> public void UpdateParlorBtn(NetMsg.ParlorInfoDef info) { if (info == null) { NetMsg.ParlorInfoDef temp = new NetMsg.ParlorInfoDef(); temp.iParlorId = 0; InfoDef = temp; status = 0; } else { add.gameObject.SetActive(false); InfoDef = info; string name = ""; if (info.szParlorName != null && info.szParlorName.Length > 5) { name = info.szParlorName.Substring(0, 4) + "..."; } else { name = info.szParlorName; } ParlorName.text = name; status = 2; } }
public Button[] ParlorBtn; //0表示申请 1取消申请 2表示退出按钮 //更新麻将馆的界面 public void UpdateShow(NetMsg.ParlorInfoDef infoDef, int type) { anhui.MahjongCommonMethod.Instance.GetPlayerAvatar(BossImage, infoDef.szBossHeadimgurl); BossName.text = infoDef.szBossNickname; BossId.text = "ID: " + infoDef.iBossId.ToString(); ParlorId.text = infoDef.iParlorId.ToString(); BossWx.text = infoDef.szContact; MemberCount.text = (infoDef.iMemberNum).ToString(); MonthVilty.text = infoDef.iMonthVitality.ToString(); AllVility.text = infoDef.iVitality.ToString(); Bulletin.text = infoDef.szBulletin; iParlorId = infoDef.iParlorId; //判断该麻将馆是不是自己的麻将馆 bool isSelfParlor = false; for (int i = 0; i < 4; i++) { //Debug.LogError("infoDef.iParlorId:" + infoDef.iParlorId + ",加入的麻将馆:" + GameData.Instance.PlayerNodeDef.iaJoinParlorId[i]); if (infoDef.iParlorId == GameData.Instance.PlayerNodeDef.iaJoinParlorId[i]) { isSelfParlor = true; break; } } if (isSelfParlor) { ParlorBtn[type - 1].gameObject.SetActive(false); ParlorBtn[2 - type].gameObject.SetActive(false); ParlorBtn[2].gameObject.SetActive(true); } else { ParlorBtn[type - 1].gameObject.SetActive(true); ParlorBtn[2 - type].gameObject.SetActive(false); ParlorBtn[2].gameObject.SetActive(false); } }
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); }