private void SetupPage() { if (this.m_CurrentPage < 0 || this.m_CurrentPage >= this.m_MapDatas.Count) { this.m_CurrentPage = 0; } int num = 0; foreach (string key in this.m_MapDatas.Keys) { this.m_MapDatas[key].m_Object.SetActive(num++ == this.m_CurrentPage); } if (this.m_CurrentPage == 0) { MenuNotepad.Get().m_PrevMap.gameObject.SetActive(false); MenuNotepad.Get().m_NextMap.gameObject.SetActive(this.GetUnlockedPagesCount() > 1); } else { bool active = false; for (int i = this.m_CurrentPage - 1; i >= 0; i--) { if (this.m_MapDatas.Values.ElementAt(i).m_Unlocked) { active = true; break; } } MenuNotepad.Get().m_PrevMap.gameObject.SetActive(active); bool active2 = false; for (int j = this.m_CurrentPage + 1; j < this.m_NumActivePages; j++) { if (this.m_MapDatas.Values.ElementAt(j).m_Unlocked) { active2 = true; break; } } MenuNotepad.Get().m_NextMap.gameObject.SetActive(active2); } MapController.Get().SetActivePage(this.m_CurrentPage); }
protected override void OnEnable() { base.OnEnable(); this.CreateMapObject(); MenuNotepad.Get().gameObject.SetActive(true); this.m_Animator.SetBool(this.m_MapHash, true); this.PositionMap(); this.m_PrevNotepadTab = MenuNotepad.Get().m_ActiveTab; if (MenuNotepad.Get().m_ActiveTab != MenuNotepad.MenuNotepadTab.MapTab) { MenuNotepad.Get().SetActiveTab(MenuNotepad.MenuNotepadTab.MapTab, false); } if (Inventory3DManager.Get().gameObject.activeSelf) { Inventory3DManager.Get().Deactivate(); } this.m_Animator.SetBool(this.m_ZoomHash, false); HUDItem.Get().Deactivate(); this.m_CanDisable = false; }
private void CreateMapObject() { GameObject original = Resources.Load("Prefabs/TempPrefabs/Items/Item/map") as GameObject; this.m_Map = UnityEngine.Object.Instantiate <GameObject>(original); MenuNotepad.Get().m_NextMap = this.m_Map.transform.FindDeepChild("next_map").GetComponent <Collider>(); MenuNotepad.Get().m_PrevMap = this.m_Map.transform.FindDeepChild("prev_map").GetComponent <Collider>(); if (MenuNotepad.Get().m_NextMap) { Physics.IgnoreCollision(MenuNotepad.Get().m_NextMap, Player.Get().m_Collider); } if (MenuNotepad.Get().m_PrevMap) { Physics.IgnoreCollision(MenuNotepad.Get().m_PrevMap, Player.Get().m_Collider); } this.m_MapHolder = this.m_Map.transform.FindDeepChild("Holder"); this.m_Map.gameObject.SetActive(false); this.m_MapPages[0] = this.m_Map.transform.FindDeepChild("map_page1").gameObject; this.m_MapPages[1] = this.m_Map.transform.FindDeepChild("map_page2").gameObject; this.m_MapPages[2] = this.m_Map.transform.FindDeepChild("map_page3").gameObject; }
private void SetupPage() { if (this.m_CurrentPage < 0 || this.m_CurrentPage >= this.m_MapsData.Count) { this.m_CurrentPage = 0; } int num = 0; foreach (GameObject gameObject in this.m_MapsData.Keys) { gameObject.SetActive(num++ == this.m_CurrentPage); } if (this.m_CurrentPage == 0) { MenuNotepad.Get().m_PrevMap.gameObject.SetActive(false); MenuNotepad.Get().m_NextMap.gameObject.SetActive(this.m_NumActivePages > 1); } else { MenuNotepad.Get().m_PrevMap.gameObject.SetActive(true); MenuNotepad.Get().m_NextMap.gameObject.SetActive(this.m_CurrentPage + 1 < this.m_NumActivePages); } }
public bool CanReceiveAction() { return(NotepadController.Get().IsActive() && MenuNotepad.Get().m_ActiveTab == this.m_Tab); }
protected override bool ShouldShow() { return(!(NotepadController.Get() == null) && NotepadController.Get().IsActive() && MenuNotepad.Get().m_ActiveTab == MenuNotepad.MenuNotepadTab.PlannerTab); }
private void UpdateMasksUnderCursor() { Vector2 notepadCanvasCursorPos = MenuNotepad.Get().m_NotepadCanvasCursorPos; notepadCanvasCursorPos.x *= this.m_CanvasRecTransform.rect.width; notepadCanvasCursorPos.y *= this.m_CanvasRecTransform.rect.height; notepadCanvasCursorPos.x -= this.m_CanvasRecTransform.rect.width * 0.5f; notepadCanvasCursorPos.y -= this.m_CanvasRecTransform.rect.height * 0.5f; notepadCanvasCursorPos.x *= this.m_CanvasRecTransform.localScale.x; notepadCanvasCursorPos.y *= this.m_CanvasRecTransform.localScale.y; bool mouseOverConstruction = false; for (int i = 0; i < this.m_Masks.Count; i++) { if (RectTransformUtility.RectangleContainsScreenPoint(this.m_Masks[i].gameObject.GetComponent <RectTransform>(), notepadCanvasCursorPos) && this.m_Masks[i].gameObject.transform.parent.gameObject.activeSelf && MenuNotepad.Get().m_CollisionFound) { this.m_Masks[i].gameObject.SetActive(true); mouseOverConstruction = true; } else { this.m_Masks[i].gameObject.SetActive(false); } } MenuNotepad.Get().m_MouseOverConstruction = mouseOverConstruction; }
private void OnEnable() { this.UpdateActivePage(); MenuNotepad.Get().UpdatePrevNextButtons(); }
private void OnConstruct() { MenuNotepad.Get().SetActiveTab(MenuNotepad.MenuNotepadTab.ConstructionsTab, false); Player.Get().StartController(PlayerControllerType.Notepad); }
private void UpdateCounters() { if (!this.m_NotepadCreated) { return; } this.UpdateCounter(ref this.m_ItemsCounter, Vector3.right * this.m_ItemsCounter.bookmark.size.x * 0.5f, MenuNotepad.Get().m_Tabs[MenuNotepad.MenuNotepadTab.ItemsTab].GetNewEntriesCount()); this.UpdateCounter(ref this.m_StoryCounter, Vector3.right * this.m_StoryCounter.bookmark.size.x * 0.5f, MenuNotepad.Get().m_Tabs[MenuNotepad.MenuNotepadTab.StoryTab].GetNewEntriesCount()); this.UpdateCounter(ref this.m_SkillsCounter, Vector3.right * this.m_SkillsCounter.bookmark.size.x * 0.5f, MenuNotepad.Get().m_Tabs[MenuNotepad.MenuNotepadTab.SkillsTab].GetNewEntriesCount()); this.UpdateCounter(ref this.m_ConstructionsCounter, Vector3.left * this.m_ConstructionsCounter.bookmark.size.x * 0.8f, MenuNotepad.Get().m_Tabs[MenuNotepad.MenuNotepadTab.ConstructionsTab].GetNewEntriesCount()); this.UpdateCounter(ref this.m_TrapsCounter, Vector3.left * this.m_TrapsCounter.bookmark.size.x * 0.7f, MenuNotepad.Get().m_Tabs[MenuNotepad.MenuNotepadTab.TrapsTab].GetNewEntriesCount()); this.UpdateCounter(ref this.m_FirecampCounter, Vector3.left * this.m_FirecampCounter.bookmark.size.x * 0.7f, MenuNotepad.Get().m_Tabs[MenuNotepad.MenuNotepadTab.FirecampTab].GetNewEntriesCount()); this.UpdateCounter(ref this.m_WaterConstructionsCounter, Vector3.left * this.m_WaterConstructionsCounter.bookmark.size.x * 0.7f, MenuNotepad.Get().m_Tabs[MenuNotepad.MenuNotepadTab.WaterConstructionsTab].GetNewEntriesCount()); this.UpdateCounter(ref this.m_HealingItemsCounter, Vector3.right * this.m_HealingItemsCounter.bookmark.size.x * 0.5f, MenuNotepad.Get().m_Tabs[MenuNotepad.MenuNotepadTab.HealingItemsTab].GetNewEntriesCount()); this.UpdateCounter(ref this.m_PlantsCounter, Vector3.right * this.m_PlantsCounter.bookmark.size.x * 0.5f, MenuNotepad.Get().m_Tabs[MenuNotepad.MenuNotepadTab.PlantsTab].GetNewEntriesCount()); this.UpdateCounter(ref this.m_CustomConstructionsCounter, Vector3.left * this.m_CustomConstructionsCounter.bookmark.size.x * 0.6f, MenuNotepad.Get().m_Tabs[MenuNotepad.MenuNotepadTab.CustomConstructionsTab].GetNewEntriesCount()); this.UpdateCounter(ref this.m_MudCounter, Vector3.left * this.m_MudCounter.bookmark.size.x * 0.6f, MenuNotepad.Get().m_Tabs[MenuNotepad.MenuNotepadTab.MudBuildingsTab].GetNewEntriesCount()); this.UpdateCounter(ref this.m_StoryObjectivesCounter, Vector3.right * this.m_StoryObjectivesCounter.bookmark.size.x * 0.5f, MenuNotepad.Get().m_Tabs[MenuNotepad.MenuNotepadTab.StoryObjectivesTab].GetNewEntriesCount()); }