Example #1
0
            private static void UpdateFlashlightPrompt(ScreenPrompt main, ScreenPrompt center)
            {
                var isShowingText = IsShowing(GestureText.Flashlight);

                if (PlayerState.IsFlashlightOn() && !isShowingText)
                {
                    return;
                }
                var tutorialStep      = "flashlight";
                var hasUsedFlashlight = NomaiVR.Save.tutorialSteps.Contains(tutorialStep);
                var isMainVisbileDark = main.IsVisible() && PlayerState.InDarkZone();
                var shouldShowText    = (center.IsVisible() || isMainVisbileDark) && !hasUsedFlashlight;

                if (!isShowingText && shouldShowText)
                {
                    SetText(GestureText.Flashlight);
                }
                if (isShowingText && !shouldShowText)
                {
                    SetText(GestureText.None);
                    if (PlayerState.IsFlashlightOn())
                    {
                        NomaiVR.Save.AddTutorialStep(tutorialStep);
                    }
                }
            }
Example #2
0
        public void Open(string value, string comboName, IModInputCombinationMenu combinationMenu = null, IModInputCombinationElement element = null)
        {
            _combinationMenu            = combinationMenu;
            _element                    = element;
            _comboName                  = comboName;
            _inputMenu.OnPopupConfirm  += OnPopupConfirm;
            _inputMenu.OnPopupCancel   += OnPopupCancel;
            _inputMenu.OnPopupValidate += OnPopupValidate;

            const string message = "Press your combination";

            _inputMenu.EnableMenu(true, value);

            var okCommand = InputLibrary.confirm;
            var okPrompt  = new ScreenPrompt(okCommand, "OK");

            if (_cancelCommand == null)
            {
                _cancelCommand = new SingleAxisCommand();
                var cancelBindingGamepad  = new InputBinding(JoystickButton.Select);
                var cancelBindingKeyboard = new InputBinding(KeyCode.Escape);
                _cancelCommand.SetInputs(cancelBindingGamepad, cancelBindingKeyboard);
                var commandObject    = new GameObject();
                var commandComponent = commandObject.AddComponent <ModCommandUpdater>();
                commandComponent.Initialize(_cancelCommand);
            }
            var cancelPrompt = new ScreenPrompt(_cancelCommand, "Cancel");
            var resetPrompt  = new ScreenPrompt("Reset");

            _inputMenu.SetUpPopup(message, okCommand, _cancelCommand, null, okPrompt, cancelPrompt, resetPrompt);
            _inputMenu.GetValue <Text>("_labelText").text = message;
        }
 public void SetUpPopup(string message, SingleAxisCommand okCommand, SingleAxisCommand cancelCommand,
                        SingleAxisCommand resetCommand, ScreenPrompt okPrompt, ScreenPrompt cancelPrompt,
                        ScreenPrompt resetPrompt, bool closeMenuOnOk = true, bool setCancelButtonActive = true)
 {
     SetUpPopupCommandsShort(resetCommand, resetPrompt);
     base.SetUpPopup(message, okCommand, cancelCommand, okPrompt, cancelPrompt, closeMenuOnOk, setCancelButtonActive);
 }
Example #4
0
 private static void RemoveSignalscopePrompts(
     ScreenPrompt ____unequipPrompt,
     ScreenPrompt ____zoomLevelPrompt
     )
 {
     _toolUnequipPrompts.Add(____unequipPrompt);
     Manager.RemoveScreenPrompt(____zoomLevelPrompt);
 }
Example #5
0
 private static void RemoveRoastingStickPrompts(
     ScreenPrompt ____tiltPrompt,
     ScreenPrompt ____mallowPrompt
     )
 {
     Manager.RemoveScreenPrompt(____tiltPrompt);
     Manager.RemoveScreenPrompt(____mallowPrompt);
 }
Example #6
0
    void Start()
    {
        prompt = GameObject.Find("ScreenPrompt").GetComponent<ScreenPrompt>();

        if ((PlayerPrefs.GetInt("ItemPickup/" + item) == 1))
        {
            PickUp();
        }
    }
Example #7
0
 private static void ChangeShipPrompts(
     ref ScreenPrompt ____exitLandingCamPrompt,
     ref ScreenPrompt ____autopilotPrompt,
     ref ScreenPrompt ____abortAutopilotPrompt
     )
 {
     ____exitLandingCamPrompt = new ScreenPrompt(InputLibrary.cancel, ____exitLandingCamPrompt.GetText());
     ____autopilotPrompt      = new ScreenPrompt(InputLibrary.swapShipLogMode, ____autopilotPrompt.GetText());
     ____abortAutopilotPrompt = new ScreenPrompt(InputLibrary.interact, ____abortAutopilotPrompt.GetText());
 }
Example #8
0
 static void RemoveSignalscopePrompts(
     ScreenPrompt ____unequipPrompt,
     ScreenPrompt ____changeFrequencyPrompt,
     ScreenPrompt ____zoomLevelPrompt
     )
 {
     _toolUnequipPrompts.Add(____unequipPrompt);
     _manager.RemoveScreenPrompt(____changeFrequencyPrompt);
     _manager.RemoveScreenPrompt(____zoomLevelPrompt);
 }
Example #9
0
    // Use this for initialization
    void Start()
    {
        disabled = false;
        prompt = GameObject.Find("ScreenPrompt").GetComponent<ScreenPrompt>();

        if((PlayerPrefs.GetInt("LockedObject/" + keyName) == 1))
        {
            Disable();
        }
    }
Example #10
0
 private static void RemoveShipPrompts(
     ScreenPrompt ____freeLookPrompt,
     ScreenPrompt ____landingModePrompt,
     ScreenPrompt ____liftoffCamera
     )
 {
     Manager.RemoveScreenPrompt(____freeLookPrompt);
     Manager.RemoveScreenPrompt(____landingModePrompt);
     Manager.RemoveScreenPrompt(____liftoffCamera);
 }
Example #11
0
 private static void RemoveTranslatorPrompts(
     ScreenPrompt ____unequipPrompt,
     ScreenPrompt ____scrollPrompt,
     ScreenPrompt ____pagePrompt
     )
 {
     Manager.RemoveScreenPrompt(____unequipPrompt);
     Manager.RemoveScreenPrompt(____scrollPrompt);
     Manager.RemoveScreenPrompt(____pagePrompt);
 }
Example #12
0
 private static void ChangeProbePrompts(
     ref ScreenPrompt ____launchPrompt,
     ref ScreenPrompt ____retrievePrompt,
     ref ScreenPrompt ____takeSnapshotPrompt,
     ref ScreenPrompt ____forwardCamPrompt
     )
 {
     ____launchPrompt       = new ScreenPrompt(InputLibrary.interact, ____launchPrompt.GetText());
     ____forwardCamPrompt   = new ScreenPrompt(InputLibrary.interact, ____takeSnapshotPrompt.GetText());
     ____retrievePrompt     = new ScreenPrompt(InputLibrary.swapShipLogMode, UITextLibrary.GetString(UITextType.ProbeRetrievePrompt) + "   <CMD>");
     ____takeSnapshotPrompt = new ScreenPrompt(InputLibrary.interact, ____takeSnapshotPrompt.GetText());
 }
Example #13
0
            private static void UpdateTranslatorPrompt(ScreenPrompt prompt)
            {
                var isShowingText = IsShowing(GestureText.Translator);

                if (!isShowingText && prompt.IsVisible())
                {
                    SetText(GestureText.Translator);
                }
                if (isShowingText && !prompt.IsVisible())
                {
                    SetText(GestureText.None);
                }
            }
Example #14
0
 private static void RemoveProbePrompts(
     ScreenPrompt ____unequipPrompt,
     ScreenPrompt ____photoModePrompt,
     ScreenPrompt ____rotatePrompt,
     ScreenPrompt ____rotateCenterPrompt,
     ScreenPrompt ____launchModePrompt
     )
 {
     _toolUnequipPrompts.Add(____unequipPrompt);
     Manager.RemoveScreenPrompt(____photoModePrompt);
     Manager.RemoveScreenPrompt(____rotatePrompt);
     Manager.RemoveScreenPrompt(____rotateCenterPrompt);
     Manager.RemoveScreenPrompt(____launchModePrompt);
 }
Example #15
0
            private static void UpdateSignalscopePrompt(ScreenPrompt main, ScreenPrompt center, bool isPlayingHideAndSeek)
            {
                var isShowingText            = IsShowing(GestureText.Signalscope);
                var isMainVisibleHideAndSeek = main.IsVisible() && isPlayingHideAndSeek;
                var shouldShowText           = center.IsVisible() || isMainVisibleHideAndSeek;

                if (!isShowingText && shouldShowText)
                {
                    SetText(GestureText.Signalscope);
                }
                if (isShowingText && !shouldShowText)
                {
                    SetText(GestureText.None);
                }
            }
Example #16
0
 private static void PostToolModeUiUpdate(
     ScreenPrompt ____flashlightPrompt,
     ScreenPrompt ____centerFlashlightPrompt,
     ScreenPrompt ____signalscopePrompt,
     ScreenPrompt ____centerSignalscopePrompt,
     ScreenPrompt ____centerTranslatePrompt,
     bool ____playingHideAndSeek
     )
 {
     if (!NomaiVR.Config.enableGesturePrompts)
     {
         return;
     }
     UpdateFlashlightPrompt(____flashlightPrompt, ____centerFlashlightPrompt);
     UpdateSignalscopePrompt(____signalscopePrompt, ____centerSignalscopePrompt, ____playingHideAndSeek);
     UpdateTranslatorPrompt(____centerTranslatePrompt);
 }
Example #17
0
 private static void RemoveToolModePrompts(
     ScreenPrompt ____freeLookPrompt,
     ScreenPrompt ____probePrompt,
     ScreenPrompt ____signalscopePrompt,
     ScreenPrompt ____flashlightPrompt,
     ScreenPrompt ____centerFlashlightPrompt,
     ScreenPrompt ____centerTranslatePrompt,
     ScreenPrompt ____centerProbePrompt,
     ScreenPrompt ____centerSignalscopePrompt
     )
 {
     Manager.RemoveScreenPrompt(____freeLookPrompt);
     Manager.RemoveScreenPrompt(____probePrompt);
     Manager.RemoveScreenPrompt(____signalscopePrompt);
     Manager.RemoveScreenPrompt(____flashlightPrompt);
     Manager.RemoveScreenPrompt(____centerFlashlightPrompt);
     Manager.RemoveScreenPrompt(____centerTranslatePrompt);
     Manager.RemoveScreenPrompt(____centerProbePrompt);
     Manager.RemoveScreenPrompt(____centerSignalscopePrompt);
 }
Example #18
0
        public void Open(InputType inputType, string value)
        {
            _inputMenu.OnPopupConfirm += OnPopupConfirm;
            _inputMenu.OnPopupCancel  += OnPopupCancel;

            if (inputType == InputType.Number)
            {
                _inputMenu.OnInputPopupValidateChar += OnValidateCharNumber;
                _inputMenu.OnPopupValidate          += OnValidateNumber;
            }
            var message = inputType == InputType.Number ? "Write a number" : "Write some text";

            _inputMenu.EnableMenu(true);

            var okPrompt      = new ScreenPrompt(InputLibrary.confirm2, "OK");
            var cancelCommand = OWInput.UsingGamepad() ? InputLibrary.cancel : InputLibrary.escape;
            var cancelPrompt  = new ScreenPrompt(cancelCommand, "Cancel");

            _inputMenu.SetUpPopup(message, InputLibrary.confirm2, cancelCommand, okPrompt, cancelPrompt);
            _inputMenu.SetInputFieldPlaceholderText("");
            _inputMenu.GetInputField().text = value;
            _inputMenu.GetValue <Text>("_labelText").text = message;
        }
Example #19
0
                private static bool InitLockOnReticule(
                    ref ScreenPrompt ____lockOnPrompt,
                    ref bool ____initialized,
                    ref bool ____showFullLockOnPrompt,
                    ref string ____lockOnPromptText,
                    ref string ____lockOnPromptTextShortened,
                    ScreenPromptList ____promptListBlock,
                    ref JetpackPromptController ____jetpackPromptController,
                    ref ScreenPrompt ____matchVelocityPrompt,
                    Text ____readout
                    )
                {
                    if (!____initialized)
                    {
                        ____jetpackPromptController   = Locator.GetPlayerTransform().GetComponent <JetpackPromptController>();
                        ____lockOnPromptText          = "<CMD>" + UITextLibrary.GetString(UITextType.PressPrompt) + "   " + UITextLibrary.GetString(UITextType.LockOnPrompt);
                        ____lockOnPromptTextShortened = "<CMD>";
                        ____showFullLockOnPrompt      = !PlayerData.GetPersistentCondition("HAS_PLAYER_LOCKED_ON");
                        if (____showFullLockOnPrompt)
                        {
                            ____lockOnPrompt = new ScreenPrompt(InputLibrary.interact, ____lockOnPromptText, 0, false, false);
                        }
                        else
                        {
                            ____lockOnPrompt = new ScreenPrompt(InputLibrary.interact, ____lockOnPromptTextShortened, 0, false, false);
                        }
                        ____matchVelocityPrompt = new ScreenPrompt(InputLibrary.matchVelocity, "<CMD>" + UITextLibrary.GetString(UITextType.HoldPrompt) + "   " + UITextLibrary.GetString(UITextType.MatchVelocityPrompt), 0, false, false);
                        ____readout.gameObject.SetActive(false);
                        ____promptListBlock.Init();
                        Locator.GetPromptManager().AddScreenPrompt(____lockOnPrompt, ____promptListBlock, TextAnchor.MiddleLeft, 20, false);
                        Locator.GetPromptManager().AddScreenPrompt(____matchVelocityPrompt, ____promptListBlock, TextAnchor.MiddleLeft, 20, false);
                        ____initialized = true;
                    }

                    return(false);
                }
Example #20
0
 private void OnWakeUp()
 {
     _repairPrompt = FindObjectOfType <FirstPersonManipulator>().GetValue <ScreenPrompt>("_repairScreenPrompt");
 }
Example #21
0
 private static void ChangeTranslatorPrompts(ref ScreenPrompt ____translatePrompt)
 {
     ____translatePrompt = new ScreenPrompt(InputLibrary.swapShipLogMode, UITextLibrary.GetString(UITextType.TranslatorUsePrompt) + "   <CMD>");
 }
Example #22
0
 public virtual void SetUpPopupCommands(SingleAxisCommand okCommand, SingleAxisCommand cancelCommand,
                                        SingleAxisCommand resetCommand, ScreenPrompt okPrompt, ScreenPrompt cancelPrompt, ScreenPrompt resetPrompt)
 {
     SetUpPopupCommandsShort(resetCommand, resetPrompt);
     base.SetUpPopupCommands(okCommand, cancelCommand, okPrompt, cancelPrompt);
 }
Example #23
0
        public static bool RoastingStickController_UpdateMarshmallowInput(
            float ____extendFraction,
            Marshmallow ____marshmallow,
            GameObject ____mallowBodyPrefab,
            Transform ____stickTransform,
            Campfire ____campfire,
            ref string ____promptText,
            ScreenPrompt ____mallowPrompt,
            ref bool ____showMallowPrompt,
            ref bool ____showRemovePrompt)
        {
            var changePromptText = false;
            var showRemovePrompt = false;
            var text             = string.Empty;

            if (____extendFraction == 0f)
            {
                if (____marshmallow.IsEdible())
                {
                    text             = UITextLibrary.GetString(UITextType.RoastingEatPrompt);
                    changePromptText = true;
                    if (____marshmallow.IsBurned())
                    {
                        showRemovePrompt = true;
                        if (OWInput.IsNewlyPressed(InputLibrary.cancel, true, InputMode.Roasting))
                        {
                            ____marshmallow.Remove();
                            Locator.GetPlayerAudioController().PlayMarshmallowToss();
                            var spawnedMarshmallow = UnityEngine.Object.Instantiate <GameObject>(____mallowBodyPrefab, ____stickTransform.position, ____stickTransform.rotation);
                            var rigidbody          = spawnedMarshmallow.GetComponent <OWRigidbody>();
                            rigidbody.SetVelocity(____campfire.GetAttachedOWRigidbody(false).GetPointVelocity(____stickTransform.position) + (____stickTransform.forward * 3f));
                            rigidbody.SetAngularVelocity(____stickTransform.right * 10f);
                            var burntColor = ____marshmallow.GetBurntColor();
                            spawnedMarshmallow.GetComponentInChildren <MeshRenderer>().material.color = burntColor;
                            QSBEventManager.FireEvent(EventNames.QSBMarshmallowEvent, MarshmallowEventType.Toss);
                        }
                    }
                    if (OWInput.IsNewlyPressed(InputLibrary.interact, InputMode.Roasting) && ____marshmallow.IsEdible())
                    {
                        ____marshmallow.Eat();
                    }
                }
                else if (____marshmallow.GetState() == Marshmallow.MallowState.Burning)
                {
                    text             = UITextLibrary.GetString(UITextType.RoastingExtinguishPrompt);
                    changePromptText = true;
                    if (OWInput.IsNewlyPressed(InputLibrary.interact, InputMode.Roasting))
                    {
                        ____marshmallow.Extinguish();
                        QSBEventManager.FireEvent(EventNames.QSBMarshmallowEvent, MarshmallowEventType.Extinguish);
                    }
                }
                else if (____marshmallow.GetState() == Marshmallow.MallowState.Gone)
                {
                    text             = UITextLibrary.GetString(UITextType.RoastingReplacePrompt);
                    changePromptText = true;
                    if (OWInput.IsNewlyPressed(InputLibrary.interact, InputMode.Roasting))
                    {
                        ____marshmallow.SpawnMallow(true);
                    }
                }

                if (changePromptText && ____promptText != text)
                {
                    ____promptText = text;
                    ____mallowPrompt.SetText(____promptText);
                }

                if (OWInput.IsNewlyPressed(InputLibrary.cancel, InputMode.Roasting))
                {
                    ____campfire.StopRoasting();
                    return(false);
                }
            }

            ____showMallowPrompt = changePromptText;
            ____showRemovePrompt = showRemovePrompt;

            return(false);
        }
Example #24
0
 private static void ChangeSignalscopePrompts(ref ScreenPrompt ____zoomModePrompt)
 {
     ____zoomModePrompt = new ScreenPrompt(InputLibrary.interact, UITextLibrary.GetString(UITextType.SignalscopeZoomInPrompt) + "   <CMD>");
 }
Example #25
0
 private void SetUpPopupCommandsShort(SingleAxisCommand resetCommand, ScreenPrompt resetPrompt)
 {
     _resetCommand = resetCommand;
     _resetButton.SetPrompt(resetPrompt);
 }
Example #26
0
 private static void ChangeShipPrompts(ref ScreenPrompt ____exitLandingCamPrompt)
 {
     ____exitLandingCamPrompt = new ScreenPrompt(InputLibrary.cancel, ____exitLandingCamPrompt.GetText());
 }
Example #27
0
	// Use this for initialization
	void Start () {
        prompt = GameObject.Find("ScreenPrompt").GetComponent<ScreenPrompt>();
    }
Example #28
0
 private static void RemoveProbePrompts(ScreenPrompt ____unequipPrompt)
 {
     _toolUnequipPrompts.Add(____unequipPrompt);
 }
Example #29
0
 private static void RemoveSatellitePrompts(ScreenPrompt ____rearviewPrompt)
 {
     Manager.RemoveScreenPrompt(____rearviewPrompt);
 }
Example #30
0
 private static void ChangeSatellitePrompts(ref ScreenPrompt ____forwardPrompt)
 {
     ____forwardPrompt = new ScreenPrompt(InputLibrary.interact, ____forwardPrompt.GetText(), 0, false, false);
 }
Example #31
0
 private static void ChangeProbePrompts(ref ScreenPrompt ____retrievePrompt)
 {
     ____retrievePrompt = new ScreenPrompt(InputLibrary.probeRetrieve, UITextLibrary.GetString(UITextType.ProbeRetrievePrompt) + "   <CMD>");
 }