public void Refresh(ChatChannelParam param) { if (param == null) { return; } if (param.category_id == 2) { this.Begginer.SetActive(true); } this.mChannelID = param.id; string str = "CH " + param.id.ToString(); if (!string.IsNullOrEmpty(param.name)) { str = param.name; } ((Text)((Component)this.ChannelName.get_transform().FindChild("text")).GetComponent <Text>()).set_text(str); this.ChannelName.SetActive(true); ((ImageArray)this.Fever.GetComponent <ImageArray>()).ImageIndex = param.fever_level < 15 ? (param.fever_level < 10 ? 0 : 1) : 2; this.Fever.SetActive(true); }
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); } }