public override void Init() { base.Init(); for (int i = 0; i < base.gameObject.transform.childCount; i++) { GameObject gameObject = base.gameObject.transform.GetChild(i).gameObject; this.m_ItemsElelements.Add(gameObject); NotepadData component = gameObject.GetComponent <NotepadData>(); if (component) { component.Init(); } } int num = 0; for (int j = 0; j < this.m_ItemsElelements.Count; j++) { Text[] componentsDeepChild = General.GetComponentsDeepChild <Text>(this.m_ItemsElelements[j]); for (int k = 0; k < componentsDeepChild.Length; k++) { componentsDeepChild[k].text = GreenHellGame.Instance.GetLocalization().Get(componentsDeepChild[k].name, true); } PageNum component2 = this.m_ItemsElelements[j].GetComponent <PageNum>(); if (component2.m_PageNum + 1 > num) { num = component2.m_PageNum + 1; } } this.m_NumActivePages = num * 2; }
private void UpdateActivePage() { int num = 0; for (int i = 0; i < this.m_PlantsElements.Count; i++) { PageNum component = this.m_PlantsElements[i].GetComponent <PageNum>(); NotepadData component2 = this.m_PlantsElements[i].gameObject.GetComponent <NotepadData>(); if (component.m_PageNum == this.m_CurrentPage && (component2 == null || component2.ShouldShow())) { this.m_PlantsElements[i].SetActive(true); if (component2 != null) { component2.m_WasActive = true; } this.UpdateSubElements(this.m_PlantsElements[i].transform); num++; } else { this.m_PlantsElements[i].SetActive(false); } } this.m_NumActiveElementsOnPage = num; }
private void UpdateActivePage() { float num = 0f; bool flag = false; int numActiveElementsOnPage = 0; for (int i = 0; i < this.m_ItemsElelements.Count; i++) { this.m_ItemsElelements[i].SetActive(false); } for (int j = 0; j < StoryObjectivesManager.Get().m_CompletedObjectives.Count; j++) { NotepadData dataByname = this.GetDataByname(StoryObjectivesManager.Get().m_CompletedObjectives[j].m_Name); if (dataByname) { this.SetupElement(dataByname, ref flag, ref num, 0.7f, ref numActiveElementsOnPage, 14); } } for (int k = 0; k < StoryObjectivesManager.Get().m_ActiveObjectives.Count; k++) { NotepadData dataByname2 = this.GetDataByname(StoryObjectivesManager.Get().m_ActiveObjectives[k].m_Name); if (dataByname2) { this.SetupElement(dataByname2, ref flag, ref num, 0.7f, ref numActiveElementsOnPage, 14); } } this.m_NumActiveElementsOnPage = numActiveElementsOnPage; }
public override void Init() { base.Init(); this.m_LeftDummyPosition.Set(-103.4f, 72.2f, 1920f); this.m_RightDummyPosition.Set(23.6f, 72.2f, 1920f); for (int i = 0; i < base.gameObject.transform.childCount; i++) { GameObject gameObject = base.gameObject.transform.GetChild(i).gameObject; if (!(gameObject.name == "LeftPageDummy") && !(gameObject.name == "RightPageDummy")) { this.m_ItemsElelements.Add(gameObject); NotepadData component = gameObject.GetComponent <NotepadData>(); if (component) { component.Init(); } } } for (int j = 0; j < this.m_ItemsElelements.Count; j++) { Text[] componentsDeepChild = General.GetComponentsDeepChild <Text>(this.m_ItemsElelements[j]); for (int k = 0; k < componentsDeepChild.Length; k++) { componentsDeepChild[k].text = GreenHellGame.Instance.GetLocalization().Get(componentsDeepChild[k].name, true); } } }
public override bool ShouldShowNoEntries() { for (int i = 0; i < this.m_ItemsElelements.Count; i++) { NotepadData component = this.m_ItemsElelements[i].gameObject.GetComponent <NotepadData>(); if (component == null || component.ShouldShow()) { return(false); } } return(true); }
public override int GetNewEntriesCount() { int num = 0; for (int i = 0; i < this.m_PlantsElements.Count; i++) { NotepadData component = this.m_PlantsElements[i].gameObject.GetComponent <NotepadData>(); if (component != null && component.ShouldShow() && !component.m_WasActive) { num++; } } return(num); }
public override int GetNewEntriesCount() { int num = 0; for (int i = 0; i < this.m_StoryEvents.Count; i++) { NotepadData component = this.m_StoryEvents[i].GetComponent <NotepadData>(); if (component != null && !component.m_WasActive) { num++; } } return(num); }
private void UpdateSubElements(Transform trans) { for (int i = 0; i < trans.childCount; i++) { Transform child = trans.GetChild(i); NotepadData component = child.GetComponent <NotepadData>(); if (component == null || component.ShouldShow()) { child.gameObject.SetActive(true); } else { child.gameObject.SetActive(false); } } }
private void SetupElement(NotepadData data, ref bool right_page, ref float shift_y, float height_scale, ref int num_elems, int num_elems_in_page) { if (data.ShouldShow()) { data.gameObject.SetActive(true); if (data.gameObject.transform.childCount > 0) { RectTransform component = data.gameObject.transform.GetChild(0).gameObject.GetComponent <RectTransform>(); if (component) { Vector3 v = component.anchoredPosition; v.x = (right_page ? this.m_RightDummyPosition.x : this.m_LeftDummyPosition.x); v.y = (right_page ? this.m_RightDummyPosition.y : this.m_LeftDummyPosition.y); v.y += shift_y; v.z = this.m_LeftDummyPosition.z; component.anchoredPosition = v; shift_y -= 7f; num_elems++; if (num_elems >= num_elems_in_page) { if (!right_page) { shift_y = 0f; } right_page = true; } } } if (data != null) { data.m_WasActive = true; if (StoryObjectivesManager.Get().IsStoryObjectiveCompleted(data.name)) { this.StrikeThroughChildren(data.gameObject.transform); return; } } } else { data.gameObject.SetActive(false); } }
public override void UpdatePages() { if (!this.m_Initialized) { this.Initialize(); } int num = 0; for (int i = 0; i < this.m_StoryEvents.Count; i++) { if (i == this.m_CurrentPage * 2) { this.m_StoryEvents[i].SetActive(true); this.m_StoryEvents[i].transform.position = this.m_LeftDummy.transform.position; num++; } else if (i == this.m_CurrentPage * 2 + 1) { this.m_StoryEvents[i].SetActive(true); this.m_StoryEvents[i].transform.position = this.m_RightDummy.transform.position; num++; } else { this.m_StoryEvents[i].SetActive(false); } if (this.m_StoryEvents[i].activeSelf) { NotepadData component = this.m_StoryEvents[i].GetComponent <NotepadData>(); if (component) { component.m_WasActive = true; } } } this.m_NumActiveElementsOnPage = num; }