Beispiel #1
0
 public static void SetupObjects()
 {
     SaveGame.m_Objects.Clear();
     SaveGame.m_Objects.Add(MainLevel.Instance);
     SaveGame.m_Objects.Add(Scenario.Get());
     SaveGame.m_Objects.Add(AIManager.Get());
     SaveGame.m_Objects.Add(TriggersManager.Get());
     SaveGame.m_Objects.Add(ItemsManager.Get());
     SaveGame.m_Objects.Add(SensorManager.Get());
     SaveGame.m_Objects.Add(ConstructionGhostManager.Get());
     SaveGame.m_Objects.Add(StaticObjectsManager.Get());
     SaveGame.m_Objects.Add(Player.Get());
     SaveGame.m_Objects.Add(PlayerConditionModule.Get());
     SaveGame.m_Objects.Add(PlayerInjuryModule.Get());
     SaveGame.m_Objects.Add(PlayerDiseasesModule.Get());
     SaveGame.m_Objects.Add(StatsManager.Get());
     SaveGame.m_Objects.Add(HintsManager.Get());
     SaveGame.m_Objects.Add(ObjectivesManager.Get());
     SaveGame.m_Objects.Add(HUDObjectives.Get());
     SaveGame.m_Objects.Add(MenuNotepad.Get());
     SaveGame.m_Objects.Add(MapTab.Get());
     SaveGame.m_Objects.Add(Music.Get());
     SaveGame.m_Objects.Add(RainManager.Get());
     SaveGame.m_Objects.Add(BalanceSystem.Get());
 }
Beispiel #2
0
    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++)
        {
            RectTransform component = this.m_Masks[i].gameObject.GetComponent <RectTransform>();
            if (RectTransformUtility.RectangleContainsScreenPoint(component, notepadCanvasCursorPos) && this.m_Masks[i].gameObject.transform.parent.gameObject.activeSelf)
            {
                this.m_Masks[i].gameObject.SetActive(true);
                mouseOverConstruction = true;
            }
            else
            {
                this.m_Masks[i].gameObject.SetActive(false);
            }
        }
        MenuNotepad.Get().m_MouseOverConstruction = mouseOverConstruction;
    }
Beispiel #3
0
    public void OnItemInNotepadUnlocked(ItemID id)
    {
        if (HUDManager.Get() == null)
        {
            Debug.Log("ItemsManager OnItemInNotepadUnlocked no HUDManager");
            return;
        }
        HUDInfoLog hudinfoLog = (HUDInfoLog)HUDManager.Get().GetHUD(typeof(HUDInfoLog));
        string     title      = GreenHellGame.Instance.GetLocalization().Get("HUD_InfoLog_NewEntry");
        string     text       = GreenHellGame.Instance.GetLocalization().Get(id.ToString());

        if (id == ItemID.Small_Fire || id == ItemID.Campfire || id == ItemID.Campfire_Rack || id == ItemID.Smoker || id == ItemID.Stone_Ring)
        {
            MenuNotepad.Get().SetActiveTab(MenuNotepad.MenuNotepadTab.FirecampTab, true);
        }
        else if (id == ItemID.Leaves_Bed || id == ItemID.Logs_Bed || id == ItemID.Small_Shelter || id == ItemID.Medium_Shelter)
        {
            MenuNotepad.Get().SetActiveTab(MenuNotepad.MenuNotepadTab.ConstructionsTab, true);
        }
        else if (id == ItemID.Cage_Trap || id == ItemID.Fish_Rod_Trap || id == ItemID.Killer_Trap || id == ItemID.Snare_Trap || id == ItemID.Stick_Fish_Trap || id == ItemID.Stone_Trap)
        {
            MenuNotepad.Get().SetActiveTab(MenuNotepad.MenuNotepadTab.TrapsTab, true);
        }
        else if (id == ItemID.Water_Collector || id == ItemID.Water_Filter)
        {
            MenuNotepad.Get().SetActiveTab(MenuNotepad.MenuNotepadTab.WaterConstructionsTab, true);
        }
        else
        {
            MenuNotepad.Get().SetActiveTab(MenuNotepad.MenuNotepadTab.ItemsTab, true);
        }
        MenuNotepad.Get().SetCurrentPageToItem(id);
        hudinfoLog.AddInfo(title, text);
        PlayerAudioModule.Get().PlayNotepadEntrySound();
    }
 public void Hide()
 {
     this.m_Animator.SetInteger(this.m_NotepadHash, 0);
     MenuNotepad.Get().OnNotepadHide();
     HUDNotepad.Get().Deactivate();
     CursorManager.Get().ShowCursor(false);
 }
Beispiel #5
0
 public static void SetupObjects()
 {
     SaveGame.m_Objects.Clear();
     SaveGame.m_Objects.Add(DifficultySettings.Get());
     SaveGame.m_Objects.Add(DialogsManager.Get());
     SaveGame.m_Objects.Add(AIManager.Get());
     SaveGame.m_Objects.Add(EnemyAISpawnManager.Get());
     SaveGame.m_Objects.Add(TriggersManager.Get());
     SaveGame.m_Objects.Add(ItemsManager.Get());
     SaveGame.m_Objects.Add(SensorManager.Get());
     SaveGame.m_Objects.Add(ConstructionGhostManager.Get());
     SaveGame.m_Objects.Add(StaticObjectsManager.Get());
     SaveGame.m_Objects.Add(Player.Get());
     SaveGame.m_Objects.Add(PlayerConditionModule.Get());
     SaveGame.m_Objects.Add(PlayerInjuryModule.Get());
     SaveGame.m_Objects.Add(PlayerDiseasesModule.Get());
     SaveGame.m_Objects.Add(StatsManager.Get());
     SaveGame.m_Objects.Add(HintsManager.Get());
     SaveGame.m_Objects.Add(ObjectivesManager.Get());
     SaveGame.m_Objects.Add(StoryObjectivesManager.Get());
     SaveGame.m_Objects.Add(HUDObjectives.Get());
     SaveGame.m_Objects.Add(MenuNotepad.Get());
     SaveGame.m_Objects.Add(MapTab.Get());
     SaveGame.m_Objects.Add(Music.Get());
     SaveGame.m_Objects.Add(RainManager.Get());
     SaveGame.m_Objects.Add(SleepController.Get());
     SaveGame.m_Objects.Add(MainLevel.Instance);
     SaveGame.m_Objects.Add(ScenarioManager.Get());
     SaveGame.m_Objects.Add(InventoryBackpack.Get());
     SaveGame.m_Objects.Add(ReplicatedSessionState.Get());
 }
Beispiel #6
0
 private void OnEnable()
 {
     if (this.m_LastUnlockedItem != ItemID.None)
     {
         this.ShowPageForLastUnlockedItem();
     }
     this.UpdateActivePage();
     MenuNotepad.Get().UpdatePrevNextButtons();
 }
    private void CreateNotepadObject()
    {
        GameObject original = Resources.Load("Prefabs/TempPrefabs/Items/Item/notebook") as GameObject;

        this.m_Notepad       = UnityEngine.Object.Instantiate <GameObject>(original);
        this.m_NotepadHolder = this.m_Notepad.transform.FindDeepChild("Holder");
        MenuNotepad.Get().SetNotepadObject(this.m_Notepad.GetComponent <Notepad>());
        MenuNotepad.Get().gameObject.SetActive(true);
    }
Beispiel #8
0
    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>();
        this.m_MapHolder = this.m_Map.transform.FindDeepChild("Holder");
        this.m_Map.gameObject.SetActive(false);
    }
Beispiel #9
0
 public void UnlockElement(string element_name)
 {
     foreach (string key in this.m_MapDatas.Keys)
     {
         for (int i = 0; i < this.m_MapDatas[key].m_Elemets.Count; i++)
         {
             if (this.m_MapDatas[key].m_Elemets[i].name == element_name)
             {
                 this.m_MapDatas[key].m_Elemets[i].SetActive(true);
                 MenuNotepad.Get().OnAddMapArea();
                 break;
             }
         }
     }
 }
Beispiel #10
0
 private void OnNotebook()
 {
     if (!Player.Get().CanShowNotepad())
     {
         return;
     }
     if (!Player.Get().GetComponent <NotepadController>().IsActive())
     {
         if (MenuNotepad.Get().m_ActiveTab == MenuNotepad.MenuNotepadTab.PlannerTab)
         {
             HUDPlanner.Get().m_PlannerMode = PlannerMode.ReadOnly;
         }
         Player.Get().StartController(PlayerControllerType.Notepad);
     }
 }
Beispiel #11
0
 protected override void OnDisable()
 {
     base.OnDisable();
     this.DestroyMapObject();
     MenuNotepad.Get().SetActiveTab(this.m_PrevNotepadTab, false);
     this.m_Animator.SetBool(this.m_MapHash, false);
     HUDMap.Get().Deactivate();
     CursorManager.Get().ShowCursor(false);
     if (MenuNotepad.Get() != null)
     {
         MenuNotepad.Get().gameObject.SetActive(false);
     }
     this.m_Player.UnblockRotation();
     this.m_Player.UnblockMoves();
     Player.Get().OnHideMap();
 }
Beispiel #12
0
 public static void SetupObjectsCoop()
 {
     SaveGame.m_Objects.Clear();
     SaveGame.m_Objects.Add(ItemsManager.Get());
     SaveGame.m_Objects.Add(Player.Get());
     SaveGame.m_Objects.Add(PlayerConditionModule.Get());
     SaveGame.m_Objects.Add(PlayerInjuryModule.Get());
     SaveGame.m_Objects.Add(PlayerDiseasesModule.Get());
     SaveGame.m_Objects.Add(StatsManager.Get());
     SaveGame.m_Objects.Add(HintsManager.Get());
     SaveGame.m_Objects.Add(MenuNotepad.Get());
     SaveGame.m_Objects.Add(MapTab.Get());
     SaveGame.m_Objects.Add(SleepController.Get());
     SaveGame.m_Objects.Add(DifficultySettings.Get());
     SaveGame.m_Objects.Add(InventoryBackpack.Get());
 }
 protected override void OnDisable()
 {
     base.OnDisable();
     this.Hide();
     this.DestroyNotepadObject();
     if (MenuNotepad.Get() != null)
     {
         MenuNotepad.Get().gameObject.SetActive(false);
     }
     this.m_Player.UnblockRotation();
     this.m_Player.UnblockMoves();
     HUDQuickAccessBar.Get().OnHideNotepad();
     Player.Get().OnHideNotepad();
     this.m_Animator.SetInteger(this.m_NotepadHash, 0);
     HUDNotepad.Get().Deactivate();
     CursorManager.Get().ShowCursor(false);
 }
Beispiel #14
0
 public override void SetNextPage()
 {
     if (!MenuNotepad.Get().m_NextMap.gameObject.activeSelf)
     {
         return;
     }
     if (this.m_CurrentPage < this.m_NumActivePages - 1)
     {
         this.m_CurrentPage++;
         if (!this.m_MapDatas.Values.ElementAt(this.m_CurrentPage).m_Unlocked)
         {
             this.SetNextPage();
             return;
         }
     }
     this.SetupPage();
 }
Beispiel #15
0
 public override void SetPrevPage()
 {
     if (!MenuNotepad.Get().m_PrevMap.gameObject.activeSelf)
     {
         return;
     }
     if (this.m_CurrentPage > 0)
     {
         this.m_CurrentPage--;
         if (!this.m_MapDatas.Values.ElementAt(this.m_CurrentPage).m_Unlocked)
         {
             this.SetPrevPage();
             return;
         }
     }
     this.SetupPage();
 }
Beispiel #16
0
 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_CanDisable = false;
 }
Beispiel #17
0
 protected override void OnDisable()
 {
     base.OnDisable();
     this.DestroyMapObject();
     MenuNotepad.Get().SetActiveTab(this.m_PrevNotepadTab, false);
     this.m_Animator.SetBool(this.m_MapHash, false);
     HUDMap.Get().Deactivate();
     if (this.m_CursorVisible)
     {
         CursorManager.Get().ShowCursor(false, false);
         this.m_CursorVisible = false;
     }
     this.m_Animator.SetBool(this.m_ZoomHash, false);
     if (MenuNotepad.Get() != null)
     {
         MenuNotepad.Get().gameObject.SetActive(false);
     }
     Player.Get().OnHideMap();
 }
Beispiel #18
0
 private void OnNotebook()
 {
     if (NotepadController.Get().IsActive())
     {
         NotepadController.Get().Hide();
     }
     else
     {
         if (MenuNotepad.Get().m_ActiveTab == MenuNotepad.MenuNotepadTab.PlannerTab)
         {
             HUDPlanner.Get().m_PlannerMode = PlannerMode.ReadOnly;
         }
         if (Inventory3DManager.Get().IsActive())
         {
             Inventory3DManager.Get().Deactivate();
         }
         Player.Get().StartController(PlayerControllerType.Notepad);
     }
 }
Beispiel #19
0
    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);
    }
Beispiel #20
0
    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;
    }
Beispiel #21
0
    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);
        }
    }
Beispiel #22
0
 public bool CanReceiveAction()
 {
     return(NotepadController.Get().IsActive() && MenuNotepad.Get().m_ActiveTab == this.m_Tab);
 }
Beispiel #23
0
 protected override bool ShouldShow()
 {
     return(!(NotepadController.Get() == null) && NotepadController.Get().IsActive() && MenuNotepad.Get().m_ActiveTab == MenuNotepad.MenuNotepadTab.PlannerTab);
 }
Beispiel #24
0
 private void OnEnable()
 {
     this.UpdateActivePage();
     MenuNotepad.Get().UpdatePrevNextButtons();
 }
Beispiel #25
0
 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());
 }
Beispiel #26
0
 private void OnConstruct()
 {
     MenuNotepad.Get().SetActiveTab(MenuNotepad.MenuNotepadTab.ConstructionsTab, false);
     Player.Get().StartController(PlayerControllerType.Notepad);
 }