Exemplo n.º 1
0
 public override void OnAnimEvent(AnimEventID id)
 {
     if (id == AnimEventID.ShowMap)
     {
         this.m_Map.gameObject.SetActive(true);
         return;
     }
     if (id == AnimEventID.ShowMapEnd)
     {
         this.m_CanDisable = true;
         if (!this.m_CursorVisible && GreenHellGame.IsPCControllerActive())
         {
             CursorManager.Get().ShowCursor(true, false);
             this.m_CursorVisible = true;
         }
         HUDMap.Get().Activate();
         return;
     }
     if (id == AnimEventID.HideMapEnd)
     {
         this.Stop();
         return;
     }
     base.OnAnimEvent(id);
 }
Exemplo n.º 2
0
    public void OnChangeControllerOption()
    {
        GreenHellGame.Instance.m_Settings.SaveSettings();
        GreenHellGame.Instance.m_Settings.ApplySettings(false);
        MainMenuManager mainMenuManager = MainMenuManager.Get();

        if (mainMenuManager != null)
        {
            mainMenuManager.SetupController();
        }
        MenuInGameManager menuInGameManager = MenuInGameManager.Get();

        if (menuInGameManager != null)
        {
            menuInGameManager.SetupController();
        }
        HUDManager hudmanager = HUDManager.Get();

        if (hudmanager != null)
        {
            hudmanager.SetuController();
        }
        if (MainMenuManager.Get())
        {
            if (GreenHellGame.IsPadControllerActive())
            {
                CursorManager.Get().ShowCursor(false, false);
                return;
            }
            if (GreenHellGame.IsPCControllerActive())
            {
                CursorManager.Get().ShowCursor(true, false);
            }
        }
    }
Exemplo n.º 3
0
 public virtual void UpdateMenuOptions()
 {
     if (this.m_OptionsObjects.Count > 0)
     {
         if (GreenHellGame.IsPCControllerActive())
         {
             this.m_ActiveMenuOption = null;
             foreach (MenuBase.MenuOptionData data in this.m_OptionsObjects.Values)
             {
                 this.UpdateActiveMenuOption(data);
             }
         }
         foreach (MenuBase.MenuOptionData data2 in this.m_OptionsObjects.Values)
         {
             this.UpdateMenuOptionAnimation(data2);
         }
         if (!GreenHellGame.IsYesNoDialogActive())
         {
             CursorManager cursorManager = CursorManager.Get();
             if (cursorManager == null)
             {
                 return;
             }
             cursorManager.SetCursor((this.m_ActiveMenuOption != null && this.m_ActiveMenuOptionCanInteract && !GreenHellGame.GetFadeSystem().IsFadeVisible()) ? CursorManager.TYPE.MouseOver : CursorManager.TYPE.Normal);
         }
     }
 }
 public void ChangeControllerOption()
 {
     this.ApplySettings();
     GreenHellGame.Instance.OnChangeControllerOption();
     this.m_KeyBindingsButton.gameObject.SetActive(GreenHellGame.IsPCControllerActive());
     this.OnChangeControllerOption();
 }
Exemplo n.º 5
0
 public void Deactivate()
 {
     if (!this.m_Active)
     {
         return;
     }
     this.m_Active = false;
     this.ClearDatas();
     Player.Get().UnblockMoves();
     Player.Get().UnblockRotation();
     if (this.m_CursorVisible)
     {
         CursorManager.Get().ShowCursor(false, false);
         CursorManager.Get().SetCursor(CursorManager.TYPE.Normal);
         this.m_CursorVisible = false;
     }
     if (this.m_MarkedData != null)
     {
         if (!this.m_MarkedData.m_IsGroup && GreenHellGame.IsPCControllerActive())
         {
             this.OnSelectDialog(this.m_MarkedData);
         }
         this.m_MarkedData = null;
     }
     if (!DialogsManager.Get().IsAnyDialogPlaying())
     {
         WalkieTalkieController.Get().OnStopDialog(null);
     }
 }
Exemplo n.º 6
0
 public void UpdateCursorVisibility()
 {
     if (this.IsCursorVisible())
     {
         if (this.m_currentVisibilityMode == CursorManager.VisibilityMode.Visible && !Cursor.visible)
         {
             Cursor.visible = true;
         }
         CursorLockMode cursorLockMode = CursorLockMode.None;
         if (cursorLockMode != Cursor.lockState)
         {
             Cursor.lockState = cursorLockMode;
             return;
         }
     }
     else
     {
         if (Cursor.visible)
         {
             Cursor.visible = false;
         }
         if (GreenHellGame.IsPCControllerActive())
         {
             CursorLockMode cursorLockMode2 = (CustomCursor.Get() && CustomCursor.Get().m_Visible) ? CursorLockMode.None : CursorLockMode.Locked;
             if (cursorLockMode2 != Cursor.lockState)
             {
                 Cursor.lockState = cursorLockMode2;
             }
         }
     }
 }
Exemplo n.º 7
0
 protected override void OnShow()
 {
     base.OnShow();
     this.SetupDialogs();
     this.SetupScroll();
     Player.Get().BlockMoves();
     Player.Get().BlockRotation();
     if (GreenHellGame.IsPCControllerActive())
     {
         CursorManager.Get().ShowCursor(CursorManager.TYPE.Normal);
         this.m_CursorVisible = true;
     }
     HUDItem.Get().Deactivate();
     this.m_InGroup    = false;
     this.m_MarkedData = null;
     Player.Get().m_ShouldStartWalkieTalkieController = true;
     if (Player.Get().GetCurrentItem(Hand.Left) == null)
     {
         Player.Get().StartController(PlayerControllerType.WalkieTalkie);
     }
     this.m_TempSanityTexts.Clear();
     this.m_TempSanityTexts.AddRange(this.m_SanityTexts);
     this.m_BackButtonObject.SetActive(false);
     this.SetupScroll();
     this.m_PadSelectionIndex = -1;
 }
Exemplo n.º 8
0
 private void UpdateController()
 {
     if (this.m_BlockControllerUpdate)
     {
         return;
     }
     this.m_PadControllerConnected = false;
     string[] joystickNames = Input.GetJoystickNames();
     if (joystickNames.Length != 0)
     {
         int i = 0;
         while (i < joystickNames.Length)
         {
             if (!string.IsNullOrEmpty(joystickNames[i]))
             {
                 this.m_PadControllerConnected = true;
                 if (joystickNames[i].Contains("Wireless") && !joystickNames[i].Contains("Xbox"))
                 {
                     InputsManager.Get().m_PadControllerType = InputsManager.PadControllerType.Ps4;
                     break;
                 }
                 InputsManager.Get().m_PadControllerType = InputsManager.PadControllerType.Xbox;
                 break;
             }
             else
             {
                 i++;
             }
         }
     }
     if (GreenHellGame.IsPadControllerActive() && !this.m_PadControllerConnected)
     {
         GreenHellGame.Instance.m_Settings.m_ControllerType = ControllerType.PC;
         this.OnChangeControllerOption();
     }
     if (this.m_PadControllerConnected && GreenHellGame.IsPCControllerActive() && !this.m_WasPadConstrollerInfo)
     {
         if (MainLevel.Instance && !MainLevel.Instance.IsPause())
         {
             MenuInGameManager.Get().ShowScreen(typeof(MenuInGame));
             this.m_PadConstrollerInfoPause = true;
         }
         this.m_WasPadConstrollerInfo = true;
         GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("YesNoDialog_Info", true), GreenHellGame.Instance.GetLocalization().Get("ControllerDetected_Info", true), false);
     }
     if (this.m_WasPadConstrollerInfo && !this.m_PadControllerConnected)
     {
         this.m_WasPadConstrollerInfo = false;
         return;
     }
     if (this.m_PadControllerConnected && GreenHellGame.IsPadControllerActive())
     {
         this.m_WasPadConstrollerInfo = true;
     }
 }
 private void UpdateSlots()
 {
     if (GreenHellGame.GetYesNoDialog().gameObject.activeSelf)
     {
         return;
     }
     if (GreenHellGame.IsPCControllerActive())
     {
         this.CheckSelection();
     }
 }
Exemplo n.º 10
0
    protected override void OnShow()
    {
        base.OnShow();
        if (!this.m_HUDTriggerAttach)
        {
            this.m_HUDTriggerAttach = HUDTrigger.GetNormal().transform.Find("Group/Action_0/KeyFrame0");
        }
        Player.Get().BlockRotation();
        Player.Get().BlockMoves();
        this.m_PadHideCursorPos = Vector2.zero;
        if (GreenHellGame.IsPCControllerActive())
        {
            CursorManager.Get().ShowCursor(CursorManager.TYPE.Normal);
            this.m_CursorVisible = true;
        }
        else if (Inventory3DManager.Get().IsActive() && CursorManager.Get().IsCursorVisible())
        {
            this.m_PadHideCursorPos = Input.mousePosition;
            CursorManager.Get().ShowCursor(false, false);
            this.m_CursorVisible = false;
        }
        Vector3 zero = Vector3.zero;

        if (!Inventory3DManager.Get().gameObject.activeSelf)
        {
            zero.x = (float)Screen.width * this.m_CursorOffset.x;
            zero.y = (float)Screen.height * this.m_CursorOffset.y;
            CursorManager.Get().SetCursorPos(this.m_HUDTriggerAttach.position + zero);
        }
        zero.x = (float)Screen.width * this.m_Offset.x;
        zero.y = (float)Screen.height * this.m_Offset.y;
        base.transform.position = this.m_HUDTriggerAttach.position + zero;
        this.ShowElements();
        float a  = float.MaxValue;
        float a2 = float.MaxValue;
        float a3 = float.MinValue;
        float a4 = float.MinValue;

        foreach (HUDItemButton huditemButton in this.m_ActiveButtons)
        {
            Vector3[] array = new Vector3[4];
            huditemButton.trans.GetWorldCorners(array);
            Vector2[] array2 = new Vector2[4];
            for (int i = 0; i < 4; i++)
            {
                array2[i] = RectTransformUtility.WorldToScreenPoint(base.transform.GetComponentInParent <Canvas>().worldCamera, array[i]);
                a         = Mathf.Min(a, array2[i].x);
                a3        = Mathf.Max(a3, array2[i].x);
                a2        = Mathf.Min(a2, array2[i].y);
                a4        = Mathf.Max(a4, array2[i].y);
            }
        }
    }
Exemplo n.º 11
0
    private void UpdateVis()
    {
        Color color = Color.white;
        bool  flag  = PlayerWalkieTalkieModule.Get().CanCall();

        if (GreenHellGame.IsPCControllerActive())
        {
            using (List <HUDSelectDialogElemData> .Enumerator enumerator = this.m_Datas.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    HUDSelectDialogElemData hudselectDialogElemData = enumerator.Current;
                    if (flag && RectTransformUtility.RectangleContainsScreenPoint(hudselectDialogElemData.m_BG.rectTransform, Input.mousePosition))
                    {
                        this.m_MarkedData = hudselectDialogElemData;
                        hudselectDialogElemData.m_BG.gameObject.SetActive(true);
                    }
                    else
                    {
                        hudselectDialogElemData.m_BG.gameObject.SetActive(false);
                    }
                    color   = hudselectDialogElemData.m_Text.color;
                    color.a = (flag ? 1f : this.m_InactiveAlpha);
                    hudselectDialogElemData.m_Text.color = color;
                }
                goto IL_194;
            }
        }
        if (this.m_PadSelectionIndex < 0)
        {
            this.m_PadSelectionIndex = 0;
        }
        for (int i = 0; i < this.m_Datas.Count; i++)
        {
            HUDSelectDialogElemData hudselectDialogElemData2 = this.m_Datas[i];
            if (flag && i == this.m_PadSelectionIndex)
            {
                this.m_MarkedData = hudselectDialogElemData2;
                hudselectDialogElemData2.m_BG.gameObject.SetActive(true);
            }
            else
            {
                hudselectDialogElemData2.m_BG.gameObject.SetActive(false);
            }
            hudselectDialogElemData2.m_PadIconSelect.SetActive(hudselectDialogElemData2.m_BG.gameObject.activeSelf);
            color   = hudselectDialogElemData2.m_Text.color;
            color.a = (flag ? 1f : this.m_InactiveAlpha);
            hudselectDialogElemData2.m_Text.color = color;
        }
IL_194:
        this.UpdateHeaderText();
    }
Exemplo n.º 12
0
 protected override void OnShow()
 {
     base.OnShow();
     this.m_DetailsActive = false;
     this.m_PageNum       = 0;
     this.m_ReadButton.gameObject.SetActive(false);
     for (int i = 0; i < base.gameObject.transform.childCount; i++)
     {
         if (base.gameObject.transform.GetChild(i).gameObject.name == "HUD_" + this.m_ElementName)
         {
             GameObject gameObject = base.gameObject.transform.GetChild(i).gameObject;
             gameObject.SetActive(true);
             for (int j = 0; j < gameObject.transform.childCount; j++)
             {
                 Text[] componentsInChildren = gameObject.GetComponentsInChildren <Text>();
                 for (int k = 0; k < componentsInChildren.Length; k++)
                 {
                     componentsInChildren[k].text = GreenHellGame.Instance.GetLocalization().Get(componentsInChildren[k].name, true);
                 }
             }
         }
         else if (base.gameObject.transform.GetChild(i).gameObject.name == "HUD_" + this.m_ElementName + "_Details")
         {
             this.m_ReadButton.gameObject.SetActive(true);
             this.m_ReadButton.gameObject.GetComponentInChildren <Text>().text = GreenHellGame.Instance.GetLocalization().Get("HUD_ReadableItem_Details", true);
             base.gameObject.transform.GetChild(i).gameObject.SetActive(false);
         }
         else if (base.gameObject.transform.GetChild(i).gameObject != this.m_ReadButton.gameObject && base.gameObject.transform.GetChild(i).gameObject != this.m_PagePrevButton.gameObject && base.gameObject.transform.GetChild(i).gameObject != this.m_PageNextButton.gameObject)
         {
             base.gameObject.transform.GetChild(i).gameObject.SetActive(false);
         }
     }
     Player.Get().BlockMoves();
     Player.Get().BlockRotation();
     this.m_ScrollValue = 1f;
     if (GreenHellGame.IsPCControllerActive())
     {
         CursorManager.Get().ShowCursor(true, true);
         this.m_CursorVisible = true;
     }
     this.m_PagePrevButton.gameObject.GetComponentInChildren <Text>().text = GreenHellGame.Instance.GetLocalization().Get("HUD_ReadableItem_PrevPage", true);
     this.m_PageNextButton.gameObject.GetComponentInChildren <Text>().text = GreenHellGame.Instance.GetLocalization().Get("HUD_ReadableItem_NextPage", true);
     this.m_PagePrevButton.gameObject.SetActive(false);
     this.m_PageNextButton.gameObject.SetActive(false);
     this.m_QuitButton.gameObject.GetComponentInChildren <Text>().text = GreenHellGame.Instance.GetLocalization().Get("HUD_ReadableItem_Quit", true);
     this.m_QuitButton.gameObject.SetActive(true);
     this.m_ReadButton.GetComponentInChildren <Text>().text    = GreenHellGame.Instance.GetLocalization().Get("HUD_ReadableItem_Details", true);
     this.m_ReadButtonPad.GetComponentInChildren <Text>().text = GreenHellGame.Instance.GetLocalization().Get("HUD_ReadableItem_DetailsPad", true);
     this.m_PadScrollIcon.SetActive(false);
 }
 private void UpdateInputs()
 {
     if (this.m_Player.GetRotationBlocked())
     {
         return;
     }
     this.m_Inputs.m_Dir = Vector2.zero;
     if (GreenHellGame.IsPCControllerActive())
     {
         if (InputsManager.Get().IsActionActive(InputsManager.InputAction.Forward))
         {
             this.m_Inputs.m_Dir.y = 1f;
         }
         else if (InputsManager.Get().IsActionActive(InputsManager.InputAction.Backward))
         {
             this.m_Inputs.m_Dir.y = -1f;
         }
         if (InputsManager.Get().IsActionActive(InputsManager.InputAction.Left))
         {
             this.m_Inputs.m_Dir.x = -1f;
             return;
         }
         if (InputsManager.Get().IsActionActive(InputsManager.InputAction.Right))
         {
             this.m_Inputs.m_Dir.x = 1f;
             return;
         }
     }
     else
     {
         float num = 0.5f;
         if (InputsManager.Get().GetActionValue(InputsManager.InputAction.Forward) > num)
         {
             this.m_Inputs.m_Dir.y = 1f;
         }
         else if (InputsManager.Get().GetActionValue(InputsManager.InputAction.Backward) > num)
         {
             this.m_Inputs.m_Dir.y = -1f;
         }
         if (InputsManager.Get().GetActionValue(InputsManager.InputAction.Left) > num)
         {
             this.m_Inputs.m_Dir.x = -1f;
             return;
         }
         if (InputsManager.Get().GetActionValue(InputsManager.InputAction.Right) > num)
         {
             this.m_Inputs.m_Dir.x = 1f;
         }
     }
 }
Exemplo n.º 14
0
    private void UpdateState()
    {
        switch (this.m_State)
        {
        case ItemController.State.None:
            this.SetAnimatorParameters();
            return;

        case ItemController.State.Swing:
        case ItemController.State.Throw:
            break;

        case ItemController.State.FinishSwing:
            this.SetState(ItemController.State.None);
            return;

        case ItemController.State.Aim:
            if (this.m_Item.m_Info.IsStone())
            {
                if (GreenHellGame.IsPCControllerActive() && !InputsManager.Get().IsActionActive(InputsManager.InputAction.ThrowStone) && Player.Get().CanThrowStone())
                {
                    this.SetState(ItemController.State.Throw);
                    return;
                }
            }
            else if (!InputsManager.Get().IsActionActive(InputsManager.InputAction.ItemAim) || TriggerController.Get().IsGrabInProgress() || Inventory3DManager.Get().gameObject.activeSelf)
            {
                this.SetState(ItemController.State.None);
                return;
            }
            break;

        case ItemController.State.StoneAim:
            if (GreenHellGame.IsPCControllerActive() && this.m_Animator.GetCurrentAnimatorStateInfo(this.m_SpineLayerIndex).shortNameHash == this.m_ObjectAimHash && !this.m_Animator.IsInTransition(this.m_SpineLayerIndex) && !InputsManager.Get().IsActionActive(InputsManager.InputAction.ThrowStone))
            {
                Camera mainCamera = CameraManager.Get().m_MainCamera;
                Player.Get().m_StopAimCameraMtx.SetColumn(0, mainCamera.transform.right);
                Player.Get().m_StopAimCameraMtx.SetColumn(1, mainCamera.transform.up);
                Player.Get().m_StopAimCameraMtx.SetColumn(2, mainCamera.transform.forward);
                Player.Get().m_StopAimCameraMtx.SetColumn(3, mainCamera.transform.position);
                this.SetState(ItemController.State.Throw);
            }
            break;

        default:
            return;
        }
    }
Exemplo n.º 15
0
 protected override void OnShow()
 {
     base.OnShow();
     Player.Get().BlockRotation();
     if (GreenHellGame.IsPCControllerActive())
     {
         CursorManager.Get().ShowCursor(true, false);
         this.m_CursorVisible = true;
         Vector3 position = base.gameObject.transform.position;
         CursorManager.Get().SetCursorPos(position);
     }
     for (int i = 0; i < 6; i++)
     {
         if (!this.IsSlotActive((HUDWheel.HUDWheelSlot)i))
         {
             this.m_Icons[i].color = this.m_InactiveColor;
         }
         else
         {
             this.m_Icons[i].color = this.m_ActiveColor;
         }
     }
     if (Inventory3DManager.Get().IsActive())
     {
         Inventory3DManager.Get().Deactivate();
     }
     if (BodyInspectionController.Get().IsActive())
     {
         BodyInspectionController.Get().Hide();
     }
     if (NotepadController.Get().IsActive())
     {
         NotepadController.Get().Hide();
     }
     if (MapController.Get().IsActive())
     {
         MapController.Get().Hide();
     }
     HUDItem.Get().Deactivate();
     this.m_SelectedSlot = HUDWheel.HUDWheelSlot.None;
     for (int j = 0; j < 6; j++)
     {
         this.m_Selections[j].enabled = false;
         this.m_Icons[j].enabled      = true;
         this.m_IconsHL[j].enabled    = false;
     }
     this.UpdateText();
 }
Exemplo n.º 16
0
 public override void SetupController()
 {
     base.SetupController();
     if (this.m_ActiveHint != null)
     {
         if (GreenHellGame.IsPCControllerActive())
         {
             this.m_Text.text = this.m_ActiveHint.m_LocalizedText;
         }
         else
         {
             this.SetupPadText();
         }
         this.UpdateBackground();
     }
 }
Exemplo n.º 17
0
    private void UpdateSelectionBG()
    {
        bool flag = false;

        if (this.m_ActiveButton != null)
        {
            this.m_SelectionBG.rectTransform.position = this.m_ActiveButton.trans.position + Vector3.right * 5f;
            flag = true;
            if (GreenHellGame.IsPadControllerActive() && this.m_DestroyButton != null && this.m_DestroyButton.confirm.gameObject.activeSelf)
            {
                flag = false;
            }
            if (GreenHellGame.IsPadControllerActive() && this.m_DestroyStackButton != null && this.m_DestroyStackButton.confirm.gameObject.activeSelf)
            {
                flag = false;
            }
        }
        this.m_SelectionBG.gameObject.SetActive(flag);
        this.m_PadIconSelect.SetActive(GreenHellGame.IsPadControllerActive() && (flag || (this.m_DestroyButton != null && this.m_DestroyButton.confirm_sel.activeSelf)));
        if (this.m_PadIconSelect.activeSelf)
        {
            float x = ((RectTransform)HUDManager.Get().m_CanvasGameObject.transform).localScale.x;
            if (flag)
            {
                Vector3 position = this.m_SelectionBG.transform.position;
                position.x += this.m_SelectionBG.rectTransform.rect.width * 0.5f * x + this.m_PadIconSelect.GetComponent <Image>().rectTransform.rect.width * 0.3f * x;
                this.m_PadIconSelect.transform.position = position;
            }
            else
            {
                Vector3 position2 = this.m_DestroyButton.confirm_sel.transform.position;
                position2.x += this.m_DestroyButton.confirm_sel.GetComponent <Image>().rectTransform.rect.width * 0.5f * x + this.m_PadIconSelect.GetComponent <Image>().rectTransform.rect.width * 0.3f * x;
                this.m_PadIconSelect.transform.position = position2;
            }
        }
        if (GreenHellGame.IsPCControllerActive())
        {
            if (this.m_DestroyButton != null)
            {
                this.m_DestroyButton.confirm.gameObject.SetActive(this.m_DestroyButton == this.m_ActiveButton);
            }
            if (this.m_DestroyStackButton != null)
            {
                this.m_DestroyStackButton.confirm.gameObject.SetActive(this.m_DestroyStackButton == this.m_ActiveButton);
            }
        }
    }
    private void OnChangeControllerOption()
    {
        base.SetupController();
        bool flag = GreenHellGame.IsPadControllerConnected();

        this.m_ControllerButton.gameObject.SetActive(flag);
        this.m_ControllerButton.SetByOption(GreenHellGame.IsPCControllerActive() ? "No" : "Yes");
        if (GreenHellGame.IsPadControllerActive() && this.m_CursorVisible)
        {
            this.HideCursor();
        }
        else if (GreenHellGame.IsPCControllerActive() && !this.m_CursorVisible)
        {
            this.ShowCursor();
        }
        this.m_PadControllerConnected = flag;
    }
Exemplo n.º 19
0
    private void Setup()
    {
        this.m_PosY       = this.m_Dummy.transform.localPosition.y;
        this.m_MaxBGWidth = 0f;
        int num = 0;

        foreach (DialogNode dialogNode in this.m_Nodes)
        {
            if (!dialogNode.m_Additional)
            {
                this.AddNode(dialogNode, num++);
            }
        }
        float x = ((RectTransform)HUDManager.Get().m_CanvasGameObject.transform).localScale.x;

        foreach (UISelectDialogNodeData uiselectDialogNodeData in this.m_UINodeDatas)
        {
            uiselectDialogNodeData.m_BG.rectTransform.sizeDelta = new Vector2(this.m_MaxBGWidth, uiselectDialogNodeData.m_BG.rectTransform.sizeDelta.y);
            Vector3 position = uiselectDialogNodeData.m_BG.transform.position;
            position.x += this.m_MaxBGWidth * 0.29f * x + uiselectDialogNodeData.m_PadIcon.rectTransform.rect.width * 0.3f * x;
            uiselectDialogNodeData.m_PadIcon.transform.position = position;
            uiselectDialogNodeData.m_PadIcon.gameObject.SetActive(false);
        }
        string str = (this.m_Nodes[0].m_Prevs.Count > 0 && this.m_Nodes[0].m_Prevs[0].m_IconName != string.Empty) ? this.m_Nodes[0].m_Prevs[0].m_IconName : "Walkie_talkie_icon";

        this.m_Icon.texture = Resources.Load <Texture>("HUD/HUD_Walkie_Talkie/" + str);
        this.m_TimerBelt[GreenHellGame.IsPCControllerActive() ? 0 : 1].gameObject.SetActive(this.m_Duration > 0f);
        InputActionData actionDataByInputAction = InputsManager.Get().GetActionDataByInputAction(InputsManager.InputAction.ShowSelectDialogNode, ControllerType._Count);

        this.m_KeyText.text = KeyCodeToString.GetString((actionDataByInputAction != null) ? actionDataByInputAction.m_KeyCode : KeyCode.None);
        GameObject gameObject = GreenHellGame.IsPCControllerActive() ? this.m_Reply : this.m_ReplyPad;
        Vector3    position2  = this.m_KeyFrame.transform.position;

        position2.x = gameObject.transform.position.x;
        Text component = gameObject.GetComponent <Text>();
        TextGenerationSettings generationSettings = component.GetGenerationSettings(component.rectTransform.rect.size);

        generationSettings.scaleFactor = 1f;
        float num2 = this.m_TextGen.GetPreferredWidth(component.text, generationSettings) * x;

        position2.x -= num2 * 0.5f;
        position2.x -= this.m_KeyFrame.GetComponent <RectTransform>().sizeDelta.x * 1.1f * x;
        this.m_KeyFrame.transform.position = position2;
        this.m_PadIcon.transform.position  = position2;
    }
Exemplo n.º 20
0
    private void UpdateWoundSlots(SlotData data)
    {
        if (!Inventory3DManager.Get().isActiveAndEnabled || !BodyInspectionController.Get().IsActive())
        {
            data.obj.gameObject.SetActive(false);
            return;
        }
        if (GreenHellGame.IsPCControllerActive() && (Inventory3DManager.Get().m_CarriedItem == null || !data.slot.CanInsertItem(Inventory3DManager.Get().m_CarriedItem)))
        {
            data.obj.gameObject.SetActive(false);
            return;
        }
        BIWoundSlot biwoundSlot = (BIWoundSlot)data.slot;

        if (biwoundSlot == null || biwoundSlot.m_Injury == null)
        {
            data.obj.gameObject.SetActive(false);
            return;
        }
        if (biwoundSlot.m_Injury.m_Type == InjuryType.Leech)
        {
            data.obj.gameObject.SetActive(false);
            return;
        }
        if (!data.obj.gameObject.activeSelf)
        {
            data.obj.gameObject.SetActive(true);
        }
        Vector3 screenPoint = data.slot.GetScreenPoint();

        if (screenPoint.z <= 0f)
        {
            data.icon.enabled = false;
            return;
        }
        data.icon.rectTransform.position = screenPoint;
        if (biwoundSlot.GetInjury() != null && BodyInspectionController.Get() != null && BodyInspectionController.Get().enabled&& EnumTools.ConvertInjuryPlaceToLimb(biwoundSlot.GetInjury().m_Place) == HUDBodyInspection.Get().GetSelectedLimb() && biwoundSlot.GetInjury().m_Bandage == null && biwoundSlot.m_Maggots == null && biwoundSlot.GetInjury().m_ParentInjury == null)
        {
            data.icon.enabled       = true;
            this.m_SelectedSlotData = data;
            return;
        }
        data.icon.enabled = false;
    }
Exemplo n.º 21
0
 protected override void Update()
 {
     base.Update();
     if (this.m_BG.color.a < 1f)
     {
         Color color = this.m_BG.color;
         color.a        += Time.deltaTime;
         color.a         = Mathf.Clamp01(color.a);
         this.m_BG.color = color;
     }
     else if (this.m_CanvasGroup.alpha < 1f)
     {
         this.m_CanvasGroup.alpha += Time.deltaTime;
         this.m_CanvasGroup.alpha  = Mathf.Clamp01(this.m_CanvasGroup.alpha);
         Color color2 = this.m_QuitButton.image.color;
         color2.a = this.m_CanvasGroup.alpha;
         this.m_QuitButton.image.color = color2;
         color2   = this.m_QuitText.color;
         color2.a = this.m_CanvasGroup.alpha;
         this.m_QuitText.color = color2;
     }
     if (this.m_CanvasGroup.alpha < 1f)
     {
         if (this.m_CursorVisible)
         {
             this.ShowCursor(false);
             return;
         }
     }
     else
     {
         if (GreenHellGame.IsPCControllerActive() && !this.m_CursorVisible)
         {
             this.ShowCursor(true);
             return;
         }
         if (GreenHellGame.IsPadControllerActive() && this.m_CursorVisible)
         {
             this.ShowCursor(false);
         }
     }
 }
Exemplo n.º 22
0
    private void UpdateButtons(bool force)
    {
        this.m_ButtonsActive = (this.m_State == MainMenuState.MainMenu && this.m_ButtonActivationTime > 0f && Time.time - this.m_ButtonActivationTime > this.m_ButtonsFadeInDuration);
        if (this.m_ButtonsActive && !this.m_WasButtonsActive)
        {
            if (GreenHellGame.IsPCControllerActive())
            {
                CursorManager.Get().ShowCursor(true, false);
            }
            this.m_WasButtonsActive = true;
        }
        if (force || Time.time - this.m_ButtonActivationTime <= this.m_ButtonsFadeInDuration || this.m_ButtonActivationTime < 0f)
        {
            Color color  = this.m_StartSurvival.GetComponentInChildren <Text>().color;
            Color color2 = this.m_StartSurvival.GetComponentInChildren <Text>().color;
            float num    = Mathf.Clamp01((Time.time - this.m_ButtonActivationTime) / this.m_ButtonsFadeInDuration) * MenuScreen.s_ButtonsAlpha;
            float num2   = Mathf.Clamp01((Time.time - this.m_ButtonActivationTime) / this.m_ButtonsFadeInDuration) * MenuScreen.s_InactiveButtonsAlpha;
            color.a  = (this.m_ButtonsEnabled ? num : 0f);
            color2.a = (this.m_ButtonsEnabled ? num2 : 0f);
            this.m_Continue.GetComponentInChildren <Text>().color       = (this.m_Continue.interactable ? color : color2);
            this.m_Tutorial.GetComponentInChildren <Text>().color       = (this.m_Tutorial.interactable ? color : color2);
            this.m_StartStory.GetComponentInChildren <Text>().color     = (this.m_StartStory.interactable ? color : color2);
            this.m_StartChallenge.GetComponentInChildren <Text>().color = (this.m_StartChallenge.interactable ? color : color2);
            this.m_StartSurvival.GetComponentInChildren <Text>().color  = (this.m_StartSurvival.interactable ? color : color2);
            this.m_LoadGame.GetComponentInChildren <Text>().color       = (this.m_LoadGame.interactable ? color : color2);
            this.m_Options.GetComponentInChildren <Text>().color        = (this.m_Options.interactable ? color : color2);
            this.m_Credits.GetComponentInChildren <Text>().color        = (this.m_Credits.interactable ? color : color2);
            this.m_Quit.GetComponentInChildren <Text>().color           = (this.m_Quit.interactable ? color : color2);
            this.m_VLine.color          = color;
            this.m_VLineWContinue.color = color;
            this.m_GameVersion.color    = color;
            color   = this.m_PadSelectButton.color;
            color.a = (this.m_ButtonsEnabled ? num : 0f);
            this.m_PadSelectButton.color = color;
            this.m_PadSelectButton.GetComponentInChildren <Text>().color = color;
        }
        GameObject continueSlot = this.m_ContinueSlot;

        MenuBase.MenuOptionData activeMenuOption = this.m_ActiveMenuOption;
        continueSlot.SetActive(((activeMenuOption != null) ? activeMenuOption.m_Button : null) == this.m_Continue);
    }
Exemplo n.º 23
0
    protected override void OnShow()
    {
        base.OnShow();
        Vector3 position = this.m_Dummy.transform.position;

        position.y = (float)Screen.height * 0.23f;
        this.m_Dummy.transform.position = position;
        this.m_Reply.SetActive(GreenHellGame.IsPCControllerActive());
        this.m_ReplyCanvasGroup.alpha = 0f;
        this.m_ReplyPad.SetActive(GreenHellGame.IsPadControllerActive());
        this.m_ReplyPadCanvasGroup.alpha = 0f;
        this.m_NodesVisible = false;
        this.m_SelectedNode = 0;
        this.Setup();
        InputsManager.Get().RegisterReceiver(this);
        this.Update();
        foreach (UISelectDialogNodeData uiselectDialogNodeData in this.m_UINodeDatas)
        {
            uiselectDialogNodeData.m_Object.SetActive(this.m_NodesVisible);
        }
    }
Exemplo n.º 24
0
    public override void ControllerUpdate()
    {
        base.ControllerUpdate();
        bool flag = (GreenHellGame.IsPCControllerActive() && InputsManager.Get().IsActionActive(InputsManager.InputAction.RMB)) || (GreenHellGame.IsPadControllerActive() && InputsManager.Get().IsActionActive(InputsManager.InputAction.ZoomMap));

        if (flag != this.m_Animator.GetBool(this.m_ZoomHash))
        {
            this.m_Animator.SetBool(this.m_ZoomHash, flag);
        }
        if (this.m_CursorVisible && WatchController.Get().IsActive())
        {
            CursorManager.Get().ShowCursor(false, false);
            this.m_CursorVisible = false;
            return;
        }
        if (!this.m_CursorVisible && !WatchController.Get().IsActive() && GreenHellGame.IsPCControllerActive())
        {
            CursorManager.Get().ShowCursor(true, true);
            this.m_CursorVisible = true;
        }
    }
Exemplo n.º 25
0
 protected override void Update()
 {
     base.Update();
     this.UpdateSelection();
     for (int i = 0; i < 6; i++)
     {
         if (!this.IsSlotActive((HUDWheel.HUDWheelSlot)i))
         {
             this.m_Icons[i].color = this.m_InactiveColor;
         }
         else
         {
             this.m_Icons[i].color = this.m_ActiveColor;
         }
     }
     if (!CursorManager.Get().IsCursorVisible() && GreenHellGame.IsPCControllerActive())
     {
         CursorManager.Get().ShowCursor(true, false);
         this.m_CursorVisible = true;
     }
 }
Exemplo n.º 26
0
 protected override void Update()
 {
     base.Update();
     if (this.m_BG.color.a < 1f)
     {
         Color color = this.m_BG.color;
         color.a        += Time.deltaTime;
         color.a         = Mathf.Clamp01(color.a);
         this.m_BG.color = color;
         return;
     }
     if (this.m_CanvasGroup.alpha < 1f)
     {
         this.m_CanvasGroup.alpha += Time.deltaTime;
         this.m_CanvasGroup.alpha  = Mathf.Clamp01(this.m_CanvasGroup.alpha);
         if (this.m_CanvasGroup.alpha == 1f && GreenHellGame.IsPCControllerActive())
         {
             CursorManager.Get().ShowCursor(true, true);
             this.m_CursorVisible = true;
         }
     }
 }
Exemplo n.º 27
0
 public override void GetInputActions(ref List <int> actions)
 {
     ItemController.State state = this.m_State;
     if (state != ItemController.State.None)
     {
         if (state == ItemController.State.Aim)
         {
             actions.Add(5);
             actions.Add(4);
             return;
         }
         if (state != ItemController.State.StoneAim)
         {
             return;
         }
         if (GreenHellGame.IsPCControllerActive())
         {
             actions.Add(51);
         }
         else
         {
             actions.Add(106);
         }
         actions.Add(4);
     }
     else
     {
         if (this.CanThrow())
         {
             actions.Add(3);
         }
         if (this.m_Animator.GetBool(this.m_FireHash))
         {
             actions.Add(0);
             return;
         }
     }
 }
    public override void OnShow()
    {
        base.OnShow();
        this.m_ControllerButton.SetByOption((GreenHellGame.Instance.m_Settings.m_ControllerType == ControllerType.PC) ? "No" : "Yes");
        switch (GreenHellGame.Instance.m_Settings.m_ToggleRunOption)
        {
        case GameSettings.ToggleRunOption.No:
            this.m_ToggleRunButton.SetByOption("No");
            break;

        case GameSettings.ToggleRunOption.Yes:
            this.m_ToggleRunButton.SetByOption("Yes");
            break;

        case GameSettings.ToggleRunOption.Always:
            this.m_ToggleRunButton.SetByOption("On");
            break;
        }
        this.m_ToggleCrouchButton.SetByOption(GreenHellGame.Instance.m_Settings.m_ToggleCrouch ? "Yes" : "No");
        this.m_ToggleWatchButton.SetByOption(GreenHellGame.Instance.m_Settings.m_ToggleWatch ? "Yes" : "No");
        this.m_InvertMouseYButton.SetByOption(GreenHellGame.Instance.m_Settings.m_InvertMouseY ? "Yes" : "No");
        this.m_InvertMouseY             = GreenHellGame.Instance.m_Settings.m_InvertMouseY;
        this.m_XSensitivitySlider.value = GreenHellGame.Instance.m_Settings.m_XSensitivity;
        this.m_YSensitivitySlider.value = GreenHellGame.Instance.m_Settings.m_YSensitivity;
        if (GreenHellGame.Instance.m_Settings.m_LookRotationSpeed > 50f)
        {
            this.m_MouseSmoothing.value = CJTools.Math.GetProportionalClamp(0f, 0.5f, GreenHellGame.Instance.m_Settings.m_LookRotationSpeed, 200f, 50f);
        }
        else
        {
            this.m_MouseSmoothing.value = CJTools.Math.GetProportionalClamp(0.5f, 1f, GreenHellGame.Instance.m_Settings.m_LookRotationSpeed, 50f, 12f);
        }
        this.m_CursorVisible = GreenHellGame.IsPCControllerActive();
        this.m_KeyBindingsButton.gameObject.SetActive(GreenHellGame.IsPCControllerActive());
        this.m_PadControllerConnected = GreenHellGame.IsPadControllerConnected();
        this.m_ControllerButton.gameObject.SetActive(this.m_PadControllerConnected);
    }
Exemplo n.º 29
0
 protected override void Update()
 {
     base.Update();
     if (this.m_HintsQueue.Count == 0)
     {
         this.m_BG.enabled   = false;
         this.m_Text.enabled = false;
         this.m_Icon.enabled = false;
         this.m_ActiveHint   = null;
         return;
     }
     this.m_BG.enabled   = true;
     this.m_Text.enabled = true;
     this.m_Icon.enabled = true;
     if (this.m_ActiveHint != this.m_HintsQueue[0])
     {
         this.m_ActiveHint = this.m_HintsQueue[0];
         Debug.Log(this.m_ActiveHint.m_Name);
         this.m_HintShowTime = Time.time;
         if (GreenHellGame.IsPCControllerActive())
         {
             this.m_Text.text = this.m_ActiveHint.m_LocalizedText;
         }
         else
         {
             this.SetupPadText();
         }
         this.UpdateBackground();
     }
     else if (this.m_ActiveHint != null && ((this.m_ActiveHint.m_Duration > 0f && Time.time > this.m_ActiveHint.m_Duration + this.m_HintShowTime) || Input.GetKeyDown(KeyCode.Space)))
     {
         this.m_ActiveHint.m_LastShowTime = Time.time;
         this.m_ActiveHint = null;
         this.m_HintsQueue.RemoveAt(0);
     }
     this.UpdateIcon();
 }
Exemplo n.º 30
0
    protected override void OnShow()
    {
        base.OnShow();
        this.m_CanvasGroup.alpha = 0f;
        int    num  = (int)MainLevel.Instance.m_TODSky.Cycle.Hour;
        int    num2 = (int)((MainLevel.Instance.m_TODSky.Cycle.Hour - (float)num) * 60f);
        string text = string.Format("{0}:{1:00}", num, num2);

        this.m_StartTime.text = text;
        num += SleepController.Get().m_SleepDuration;
        if (num >= 24)
        {
            num -= 24;
        }
        text = string.Format("{0}:{1:00}", num, num2);
        this.m_EndTime.text = text;
        this.SetBGAlpha(0f);
        if (GreenHellGame.IsPCControllerActive())
        {
            CursorManager.Get().ShowCursor(true, true);
            this.m_CursorVisible = true;
        }
        this.m_State = HUDSleepingState.FadeIn;
    }