public void AllBuild(GameWebAPI.RespData_ChatNewMessageHistoryLogic data) { CMD_ChatWindow.instance.nowPartsCount = data.result.Length; ClassSingleton <ChatData> .Instance.CurrentChatInfo.groupLastHistoryId = data.result[data.result.Length - 1].chatMessageHistoryId; if (base.selectCollider != null) { bool flag = true; this.allListHight = 0f; foreach (GameWebAPI.RespData_ChatNewMessageHistoryLogic.Result result2 in data.result) { BoxCollider component = this.goBaseParts.GetComponent <BoxCollider>(); string text; Vector3 colliderSize = ChatTools.GetColliderSize(result2, component, CMD_ChatWindow.instance.goBaseTXT, out text); this.allListHight += colliderSize.y; if (flag) { if (result2.type == 3) { this.startPartH = colliderSize.y + 40f; } else { this.startPartH = colliderSize.y; } CMD_ChatWindow.instance.nowLastMessageId = result2.chatMessageHistoryId; flag = false; } } base.InitBuild(); this.hsize = this.allListHight + this.verticalBorder * 2f - this.verticalMargin; this.ypos = this.hsize / 2f - this.startPartH / 2f; foreach (GameWebAPI.RespData_ChatNewMessageHistoryLogic.Result respDataChatMessageDataResult in data.result) { GameObject gameObject = base.AddBuildPart(); GUIListChatLogParts component2 = gameObject.GetComponent <GUIListChatLogParts>(); if (component2 != null) { component2.SetOriginalPos(new Vector3(0f, this.ypos, -5f)); component2.RespDataChatMessageDataResult = respDataChatMessageDataResult; } this.ypos -= component2.listColliderHeight; } base.height = this.hsize; base.InitMinMaxLocation(-1, 0f); } }
public override void ShowGUI() { base.ShowGUI(); if (this.RespDataChatMessageDataResult.type == 3) { this.ngTX_COMMENT = this.goSYS_TX_COMMENT.GetComponent <UILabel>(); this.goCONTENT_WRAP.SetActive(false); this.goSELF_CONTENT_WRAP.SetActive(false); } else if (DataMng.Instance().UserId == this.RespDataChatMessageDataResult.userId) { this.ngTX_USERNAME = this.goSELF_TX_USERNAME.GetComponent <UILabel>(); this.ngTX_DATE = this.goSELF_TX_DATE.GetComponent <UILabel>(); this.ngTX_COMMENT = this.goSELF_TX_COMMENT.GetComponent <UILabel>(); this.ngMONSTER_ICON = this.goSELF_MONSTER_ICON; this.ngTITLE_ICON = this.goSELF_TITLE_ICON; this.goCONTENT_WRAP.SetActive(false); this.goSYS_CONTENT_WRAP.SetActive(false); } else { this.ngTX_USERNAME = this.goTX_USERNAME.GetComponent <UILabel>(); this.ngTX_DATE = this.goTX_DATE.GetComponent <UILabel>(); this.ngTX_COMMENT = this.goTX_COMMENT.GetComponent <UILabel>(); this.ngMONSTER_ICON = this.goMONSTER_ICON; this.ngTITLE_ICON = this.goTITLE_ICON; if (this.RespDataChatMessageDataResult.type == 4) { this.ngMULTICODE_COL = this.goBG_BALLOON.GetComponent <GUICollider>(); this.ngMULTICODE_BCOL = this.goBG_BALLOON.GetComponent <BoxCollider>(); } this.goSELF_CONTENT_WRAP.SetActive(false); this.goSYS_CONTENT_WRAP.SetActive(false); } string text = ChatTools.OutputDateCtrl(this.RespDataChatMessageDataResult.createTime); if (this.RespDataChatMessageDataResult.type != 3) { this.ngTX_DATE.text = text; } BoxCollider component = base.gameObject.GetComponent <BoxCollider>(); string text2; component.size = ChatTools.GetColliderSize(this.RespDataChatMessageDataResult, component, CMD_ChatWindow.instance.goBaseTXT, out text2); this.listColliderHeight = component.size.y; int type = this.RespDataChatMessageDataResult.type; if (type != 3) { if (type != 4) { this.ngTX_COMMENT.text = text2; } else { string[] dungeonIds = text2.Split(new char[] { ',' }); string arg; if (dungeonIds.Length > 2) { GameWebAPI.RespDataMA_GetWorldStageM.WorldStageM[] worldStageM = MasterDataMng.Instance().RespDataMA_WorldStageM.worldStageM; GameWebAPI.RespDataMA_GetWorldDungeonM.WorldDungeonM[] worldDungeonM = MasterDataMng.Instance().RespDataMA_WorldDungeonM.worldDungeonM; GameWebAPI.RespDataMA_GetWorldStageM.WorldStageM worldStageM2 = worldStageM.SingleOrDefault((GameWebAPI.RespDataMA_GetWorldStageM.WorldStageM x) => x.worldStageId == dungeonIds[0]); GameWebAPI.RespDataMA_GetWorldDungeonM.WorldDungeonM worldDungeonM2 = worldDungeonM.SingleOrDefault((GameWebAPI.RespDataMA_GetWorldDungeonM.WorldDungeonM x) => x.worldDungeonId == dungeonIds[1]); arg = string.Format(StringMaster.GetString("MultiRecruitChat-07"), worldStageM2.name, worldDungeonM2.name); this.multiWorldAreaId = worldStageM2.worldAreaId; this.multiWorldDungeonId = worldDungeonM2.worldDungeonId; this.multiRoomId = dungeonIds[2]; } else { arg = text2; } this.ngTX_COMMENT.text = string.Format(StringMaster.GetString("ChatLog-11"), arg); this.ngTX_COMMENT.color = this.multiPassCodeTextColor; if (DataMng.Instance().UserId != this.RespDataChatMessageDataResult.userId) { this.ngMULTICODE_COL.onTouchEnded += delegate(Touch touch, Vector2 pos, bool flag) { this.OnMultiPassCodeClicked(); }; } } } else { this.ngTX_COMMENT.text = string.Format("{0}\n{1}", text, text2); } if (DataMng.Instance().UserId == this.RespDataChatMessageDataResult.userId && this.RespDataChatMessageDataResult.type != 3) { this.ngTX_COMMENT.pivot = UIWidget.Pivot.Left; } }