private void Start() { if (Object.op_Implicit((Object)this.btnClose)) { ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.btnClose), (Action <M0>)(_ => { this.SetActiveCanvas(false); if (this.onClose == null) { return; } this.onClose(); })); } ObservableExtensions.Subscribe <Unit>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable((Component)this), (Action <M0>)(_ => { if (Object.op_Equality((Object)null, (Object)this.rtfScroll) || Object.op_Equality((Object)null, (Object)this.rtfContent) || (Object.op_Equality((Object)null, (Object)this.textLog) || this.sbAdd.Length == 0)) { return; } UnityEngine.UI.Text text = (UnityEngine.UI.Text)Object.Instantiate <UnityEngine.UI.Text>((M0)this.textLog); ((Component)text).get_transform().SetParent(((Component)this.rtfContent).get_transform(), false); text.set_text(this.sbAdd.ToString().TrimEnd('\r', '\n')); ((Graphic)text).get_rectTransform().set_sizeDelta(new Vector2((float)((Graphic)text).get_rectTransform().get_sizeDelta().x, text.get_preferredHeight())); ((Component)text).get_gameObject().SetActive(true); this.sbAdd.Length = 0; })); }
private float GetTextWidth(UnityEngine.UI.Text textComp, string message) { if (this._text.get_supportRichText()) { message = Regex.Replace(message, HyphenationJpn.RITCH_TEXT_REPLACE, string.Empty); } textComp.set_text(message); return(textComp.get_preferredWidth()); }
private bool IsLineCountOver(UnityEngine.UI.Text textComp, int lineCount) { StringBuilder stringBuilder = new StringBuilder(); for (int index = 0; index < lineCount; ++index) { stringBuilder.Append("\n"); } textComp.set_text(stringBuilder.ToString()); double preferredHeight = (double)textComp.get_preferredHeight(); Rect rect = this.rectTransform.get_rect(); double height = (double)((Rect) ref rect).get_height(); return(preferredHeight > height); }
private void RefreshCloseShowMessage() { if (!Object.op_Inequality((Object)this.ClosedShowMessage, (Object)null) || !this.ClosedShowMessage.get_activeInHierarchy()) { return; } Transform child = this.ClosedShowMessage.get_transform().FindChild("text"); UnityEngine.UI.Text component = (UnityEngine.UI.Text)((Component)child).GetComponent <UnityEngine.UI.Text>(); if (Object.op_Equality((Object)child, (Object)null)) { return; } string str = string.Empty; if (this.mChatLogOffical != null && this.mChatLogOffical.messages.Count > 0) { ChatLogParam message = this.mChatLogOffical.messages[this.mChatLogOffical.messages.Count - 1]; int id = message.id; str = "[" + message.name + "]:" + message.message; } else if (this.mChatLog != null && this.mChatLog.messages.Count > 0) { ChatLogParam message = this.mChatLog.messages[this.mChatLog.messages.Count - 1]; int id = message.id; if (message.fuid != this.gm.Player.FUID) { string source = this.FilterMessage(message.message); if (source.All <char>((Func <char, bool>)(x => { if ((int)x != 42) { return((int)x == 32); } return(true); }))) { return; } str = "[" + message.name + "]:" + source; if (message.message == string.Empty) { str = "[" + message.name + "] " + LocalizedText.Get("sys.CHAT_SEND_STAMP"); } } } component.set_text(str); }
private void Refresh() { ChatChannelParam[] channels = this.mChannel.channels; this.RefreshPageButton(channels[0].id, channels[channels.Length - 1].id); ChatChannelParam[] ch_params1 = new ChatChannelParam[10]; for (int index = 0; index < 10; ++index) { ch_params1[index] = channels[index]; } ChatChannelParam[] ch_params2 = new ChatChannelParam[10]; for (int index = 0; index < 10; ++index) { ch_params2[index] = channels[10 + index]; } if (Object.op_Inequality((Object)this.PanelTemplate1, (Object)null)) { ChatChannelPanel component = (ChatChannelPanel)this.PanelTemplate1.GetComponent <ChatChannelPanel>(); if (Object.op_Inequality((Object)component, (Object)null)) { this.PanelTemplate1.SetActive(true); component.Refresh(ch_params1); } } if (Object.op_Inequality((Object)this.PanelTemplate2, (Object)null)) { ChatChannelPanel component = (ChatChannelPanel)this.PanelTemplate2.GetComponent <ChatChannelPanel>(); if (Object.op_Inequality((Object)component, (Object)null)) { this.PanelTemplate2.SetActive(true); component.Refresh(ch_params2); } } if (!Object.op_Inequality((Object)this.ChatChannelPagePanel, (Object)null)) { return; } LayoutElement[] componentsInChildren = (LayoutElement[])((Component)((Component)this.PageItemRoot).get_transform()).GetComponentsInChildren <LayoutElement>(false); if (componentsInChildren != null) { foreach (LayoutElement layoutElement in componentsInChildren) { if (Object.op_Implicit((Object)layoutElement)) { Object.Destroy((Object)((Component)layoutElement).get_gameObject()); } } } ChatChannelMasterParam[] chatChannelMaster = this.gm.GetChatChannelMaster(); if (chatChannelMaster == null || chatChannelMaster.Length < 0) { return; } int num1 = chatChannelMaster.Length / this.ONE_VIEW; for (int index1 = 0; index1 < num1; ++index1) { int index2 = 20 * index1; int num2 = chatChannelMaster.Length < index2 ? 0 : chatChannelMaster[index2].id; int index3 = index2 - 1 + 20; int num3 = chatChannelMaster.Length < index3 ? 0 : chatChannelMaster[index3].id; GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ChannelPageItem); gameObject.get_transform().SetParent(this.PageItemRoot, false); Transform child = gameObject.get_transform().FindChild("text"); if (Object.op_Inequality((Object)child, (Object)null)) { UnityEngine.UI.Text component = (UnityEngine.UI.Text)((Component)child).GetComponent <UnityEngine.UI.Text>(); StringBuilder stringBuilder = GameUtility.GetStringBuilder(); stringBuilder.Append("CH "); stringBuilder.Append(LocalizedText.Get("sys.TEXT_CHAT_CHANNEL_TEMP", (object)num2.ToString(), (object)num3.ToString())); string str = stringBuilder.ToString(); component.set_text(str); } SRPG_Button component1 = (SRPG_Button)gameObject.GetComponent <SRPG_Button>(); if (Object.op_Inequality((Object)component1, (Object)null)) { // ISSUE: object of a compiler-generated type is created // ISSUE: method pointer ((UnityEvent)component1.get_onClick()).AddListener(new UnityAction((object)new ChatChannelWindow.\u003CRefresh\u003Ec__AnonStorey313() { \u003C\u003Ef__this = this, index = index1 }, __methodptr(\u003C\u003Em__32C))); } gameObject.SetActive(true); } }
public void SetAccessoryCharacter(bool init = false) { if (!init && !((Component)this).get_gameObject().get_activeSelf()) { return; } Color color1 = (Color)null; for (int index1 = 0; index1 < this.AccessorySlots.GetToggleNum(); ++index1) { this.sbAcsName.Clear(); int index2 = index1; ListInfoBase listInfoBase = this.hSceneManager.numFemaleClothCustom >= 2 ? this.Males[this.hSceneManager.numFemaleClothCustom - 2].infoAccessory[index2] : this.females[this.hSceneManager.numFemaleClothCustom].infoAccessory[index2]; UnityEngine.UI.Text componentInChildren = (UnityEngine.UI.Text)((Component)this.AccessorySlots.lstToggle[index2]).GetComponentInChildren <UnityEngine.UI.Text>(); if (listInfoBase != null) { this.sbAcsName.Append(listInfoBase.Name); ((Graphic)((Component)this.AccessorySlots.lstToggle[index2]).GetComponent <Image>()).set_raycastTarget(true); if (this.hSceneManager.numFemaleClothCustom < 2) { this.AccessorySlots.lstToggle[index2].set_isOn(this.females[this.hSceneManager.numFemaleClothCustom].fileStatus.showAccessory[index2]); } else { this.AccessorySlots.lstToggle[index2].set_isOn(this.Males[this.hSceneManager.numFemaleClothCustom - 2].fileStatus.showAccessory[index2]); } if (this.AccessorySlots.lstToggle[index2].get_isOn()) { Define.Set(ref color1, Colors.White, false); ((Graphic)componentInChildren).set_color(color1); } else { ((Graphic)componentInChildren).set_color(Color32.op_Implicit(new Color32((byte)141, (byte)136, (byte)129, byte.MaxValue))); } } else { this.sbAcsName.AppendFormat("スロット{0}", (object)index2); ((Graphic)((Component)this.AccessorySlots.lstToggle[index2]).GetComponent <Image>()).set_raycastTarget(false); ((Graphic)componentInChildren).set_color(Color32.op_Implicit(new Color32((byte)141, (byte)136, (byte)129, byte.MaxValue))); } componentInChildren.set_text(this.sbAcsName.ToString()); } if (this.hSceneManager.numFemaleClothCustom < 2) { this.AccessorySlots.SetActive(Object.op_Inequality((Object)this.females[this.hSceneManager.numFemaleClothCustom].objBodyBone, (Object)null) && this.females[this.hSceneManager.numFemaleClothCustom].visibleAll, -1); } else { this.AccessorySlots.SetActive(Object.op_Inequality((Object)this.Males[this.hSceneManager.numFemaleClothCustom - 2].objBodyBone, (Object)null) && this.Males[this.hSceneManager.numFemaleClothCustom - 2].visibleAll, -1); } if (this.hSceneManager.numFemaleClothCustom > 1 || Object.op_Inequality((Object)this.hSceneManager.Player, (Object)null) && Object.op_Equality((Object)this.hSceneManager.Player.ChaControl, (Object)this.females[this.hSceneManager.numFemaleClothCustom])) { if (!Manager.Config.HData.Accessory) { this.AllChange.set_isOn(false); } else { this.AllChange.set_isOn(true); } } else { this.AllChange.set_isOn(true); } this.allState[this.hSceneManager.numFemaleClothCustom] = this.AllChange.get_isOn(); UnityEngine.UI.Text componentInChildren1 = (UnityEngine.UI.Text)((Component)this.AllChange).GetComponentInChildren <UnityEngine.UI.Text>(); Color color2 = ((Graphic)componentInChildren1).get_color(); if (this.allState[this.hSceneManager.numFemaleClothCustom]) { Define.Set(ref color2, Colors.White, false); } else { color2 = Color32.op_Implicit(new Color32((byte)141, (byte)136, (byte)129, byte.MaxValue)); } ((Graphic)componentInChildren1).set_color(color2); AgentActor agentActor = (AgentActor)null; if (this.hSceneManager.numFemaleClothCustom < 2) { if (Object.op_Inequality((Object)this.hSceneManager.females[this.hSceneManager.numFemaleClothCustom], (Object)null)) { agentActor = (AgentActor)((Component)this.hSceneManager.females[this.hSceneManager.numFemaleClothCustom]).GetComponent <AgentActor>(); } } else if (Object.op_Inequality((Object)this.hSceneManager.male, (Object)null)) { agentActor = (AgentActor)((Component)this.hSceneManager.male).GetComponent <AgentActor>(); } AgentData agentData = !Object.op_Inequality((Object)agentActor, (Object)null) ? (AgentData)null : agentActor.AgentData; bool flag1 = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; if (agentData != null) { this.player = false; flag1 = agentData.EquipedHeadItem != null && agentData.EquipedHeadItem.ID != -1; flag2 = agentData.EquipedBackItem != null && agentData.EquipedBackItem.ID != -1; flag3 = agentData.EquipedNeckItem != null && agentData.EquipedNeckItem.ID != -1; flag4 = agentData.EquipedLampItem != null && agentData.EquipedLampItem.ID != -1; } else { PlayerActor playerActor = (PlayerActor)null; if (this.hSceneManager.numFemaleClothCustom < 2) { if (Object.op_Inequality((Object)this.hSceneManager.females[this.hSceneManager.numFemaleClothCustom], (Object)null)) { playerActor = (PlayerActor)((Component)this.hSceneManager.females[this.hSceneManager.numFemaleClothCustom]).GetComponent <PlayerActor>(); } } else if (Object.op_Inequality((Object)this.hSceneManager.male, (Object)null)) { playerActor = (PlayerActor)((Component)this.hSceneManager.male).GetComponent <PlayerActor>(); } PlayerData playerData = !Object.op_Inequality((Object)playerActor, (Object)null) ? (PlayerData)null : playerActor.PlayerData; if (playerData != null) { this.player = true; flag1 = playerData.EquipedHeadItem != null && playerData.EquipedHeadItem.ID != -1; flag2 = playerData.EquipedBackItem != null && playerData.EquipedBackItem.ID != -1; flag3 = playerData.EquipedNeckItem != null && playerData.EquipedNeckItem.ID != -1; flag4 = playerData.EquipedLampItem != null && playerData.EquipedLampItem.ID != -1; } } if (this.hSceneManager.numFemaleClothCustom < 2) { this.EquipBts[0].chara = this.females[this.hSceneManager.numFemaleClothCustom]; this.EquipBts[1].chara = this.females[this.hSceneManager.numFemaleClothCustom]; this.EquipBts[2].chara = this.females[this.hSceneManager.numFemaleClothCustom]; this.EquipBts[3].chara = this.females[this.hSceneManager.numFemaleClothCustom]; } else { this.EquipBts[0].chara = this.Males[this.hSceneManager.numFemaleClothCustom - 2]; this.EquipBts[1].chara = this.Males[this.hSceneManager.numFemaleClothCustom - 2]; this.EquipBts[2].chara = this.Males[this.hSceneManager.numFemaleClothCustom - 2]; this.EquipBts[3].chara = this.Males[this.hSceneManager.numFemaleClothCustom - 2]; } this.EquipBts[0].Base.SetActive(flag1); this.EquipBts[1].Base.SetActive(flag2); this.EquipBts[2].Base.SetActive(flag3); this.EquipBts[3].Base.SetActive(flag4); this.EquipBts[0].id = 0; this.EquipBts[1].id = 1; this.EquipBts[2].id = 2; this.EquipBts[3].id = 3; if (Object.op_Inequality((Object)this.EquipBts[0].chara, (Object)null) && Object.op_Inequality((Object)this.EquipBts[0].chara.objExtraAccessory[0], (Object)null) && this.EquipBts[0].chara.objExtraAccessory[0].get_activeSelf() != this.EquipBts[0].active) { this.EquipBts[0].ChangeState(); } if (Object.op_Inequality((Object)this.EquipBts[1].chara, (Object)null) && Object.op_Inequality((Object)this.EquipBts[1].chara.objExtraAccessory[1], (Object)null) && this.EquipBts[1].chara.objExtraAccessory[1].get_activeSelf() != this.EquipBts[1].active) { this.EquipBts[1].ChangeState(); } if (Object.op_Inequality((Object)this.EquipBts[2].chara, (Object)null) && Object.op_Inequality((Object)this.EquipBts[2].chara.objExtraAccessory[2], (Object)null) && this.EquipBts[2].chara.objExtraAccessory[2].get_activeSelf() != this.EquipBts[2].active) { this.EquipBts[2].ChangeState(); } if (Object.op_Inequality((Object)this.EquipBts[3].chara, (Object)null)) { GameObject gameObject = (GameObject)null; if (!this.player) { gameObject = this.EquipBts[3].chara.objExtraAccessory[3]; } else if (this.hSceneManager.numFemaleClothCustom < 2) { if (this.hSceneManager.females[this.hSceneManager.numFemaleClothCustom].EquipedItem != null) { gameObject = this.hSceneManager.females[this.hSceneManager.numFemaleClothCustom].EquipedItem.AsGameObject; } } else if (this.hSceneManager.male.EquipedItem != null) { gameObject = this.hSceneManager.male.EquipedItem.AsGameObject; } if (Object.op_Inequality((Object)gameObject, (Object)null) && gameObject.get_activeSelf() != this.EquipBts[3].active) { this.EquipBts[3].ChangeState(); } } if (!this.hSceneSpriteChaChoice.Content.get_activeSelf()) { return; } this.hSceneSpriteChaChoice.Content.SetActive(false); }