Exemplo n.º 1
0
        public override void OnReceiveRemote(bool server, EnumMessage <SignalFrequency> message)
        {
            PlayerData.LearnFrequency(message.EnumValue);
            var displayMsg = $"{UITextLibrary.GetString(UITextType.NotificationNewFreq)} <color=orange>{AudioSignal.FrequencyToString(message.EnumValue, false)}</color>";
            var data       = new NotificationData(NotificationTarget.All, displayMsg, 10f, true);

            NotificationManager.SharedInstance.PostNotification(data, false);
        }
        public override void OnReceiveRemote(bool server, EnumMessage <SignalName> message)
        {
            PlayerData.LearnSignal(message.EnumValue);
            QSBEventManager.FireEvent("IdentifySignal");
            var displayMsg = $"{UITextLibrary.GetString(UITextType.NotificationSignalIdentified)} <color=orange>{AudioSignal.SignalNameToString(message.EnumValue)}</color>";
            var data       = new NotificationData(NotificationTarget.All, displayMsg, 10f, true);

            NotificationManager.SharedInstance.PostNotification(data, false);
        }
Exemplo n.º 3
0
        public void Init(SingleAxisCommand inputCommand)
        {
            _button       = GetComponent <Button>();
            _inputCommand = inputCommand;
            var imageElement = GetComponent <ButtonWithHotkeyImageElement>();

            if (imageElement == null)
            {
                return;
            }
            var textId = GetComponentInChildren <LocalizedText>().GetValue <UITextType>("_textID");
            var title  = UITextLibrary.GetString(textId);

            imageElement.SetPrompt(new ScreenPrompt(inputCommand, title));
        }
 private void Update()
 {
     if (QSBCore.IsInMultiplayer &&
         (LoadManager.GetLoadingScene() == OWScene.SolarSystem || LoadManager.GetLoadingScene() == OWScene.EyeOfTheUniverse) &&
         _loadingText != null)
     {
         var num = LoadManager.GetAsyncLoadProgress();
         num = num < 0.1f
                                 ? Mathf.InverseLerp(0f, 0.1f, num) * 0.9f
                                 : 0.9f + (Mathf.InverseLerp(0.1f, 1f, num) * 0.1f);
         ResetStringBuilder();
         _nowLoadingSB.Append(UITextLibrary.GetString(UITextType.LoadingMessage));
         _nowLoadingSB.Append(num.ToString("P0"));
         _loadingText.text = _nowLoadingSB.ToString();
     }
 }
        public static bool ProbeLauncher_RetrieveProbe(
            ProbeLauncher __instance,
            bool playEffects,
            bool forcedRetrieval)
        {
            if (__instance._isRetrieving)
            {
                return(false);
            }

            if (__instance._activeProbe != null)
            {
                if (__instance._activeProbe.IsLaunched() && TimelineObliterationController.IsParadoxProbeActive() && !forcedRetrieval)
                {
                    var data = new NotificationData(__instance._notificationFilter, UITextLibrary.GetString(UITextType.NotificationMultProbe), 3f);
                    NotificationManager.SharedInstance.PostNotification(data);
                    Locator.GetPlayerAudioController().PlayNegativeUISound();
                    return(false);
                }

                __instance._activeProbe.GetRotatingCamera().ResetRotation();
                __instance._preLaunchProbeProxy.SetActive(true);
                if (playEffects)
                {
                    __instance._effects.PlayRetrievalClip();
                    __instance._probeRetrievalEffect.WarpObjectIn(__instance._probeRetrievalLength);
                }

                if (__instance != QSBPlayerManager.LocalPlayer.LocalProbeLauncher)
                {
                    __instance.GetWorldObject <QSBProbeLauncher>()
                    .SendMessage(new RetrieveProbeMessage(playEffects));
                }
                else
                {
                    new PlayerRetrieveProbeMessage(playEffects).Send();
                }

                __instance._activeProbe.Retrieve(__instance._probeRetrievalLength);
                __instance._isRetrieving = true;
            }

            return(false);
        }
Exemplo n.º 6
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);
                }
Exemplo n.º 7
0
 private static void ChangeTranslatorPrompts(ref ScreenPrompt ____translatePrompt)
 {
     ____translatePrompt = new ScreenPrompt(InputLibrary.swapShipLogMode, UITextLibrary.GetString(UITextType.TranslatorUsePrompt) + "   <CMD>");
 }
Exemplo n.º 8
0
 private static void ChangeSignalscopePrompts(ref ScreenPrompt ____zoomModePrompt)
 {
     ____zoomModePrompt = new ScreenPrompt(InputLibrary.interact, UITextLibrary.GetString(UITextType.SignalscopeZoomInPrompt) + "   <CMD>");
 }
Exemplo n.º 9
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());
 }
Exemplo n.º 10
0
 private static void ChangeProbePrompts(ref ScreenPrompt ____retrievePrompt)
 {
     ____retrievePrompt = new ScreenPrompt(InputLibrary.probeRetrieve, UITextLibrary.GetString(UITextType.ProbeRetrievePrompt) + "   <CMD>");
 }
Exemplo n.º 11
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);
        }
        public static bool RoastingStickController_UpdateMarshmallowInput(
            RoastingStickController __instance
            )
        {
            var changePromptText = false;
            var showRemovePrompt = false;
            var text             = string.Empty;

            if (__instance._extendFraction == 0f)
            {
                if (__instance._marshmallow.IsEdible())
                {
                    text             = UITextLibrary.GetString(UITextType.RoastingEatPrompt);
                    changePromptText = true;
                    if (__instance._marshmallow.IsBurned())
                    {
                        showRemovePrompt = true;
                        if (OWInput.IsNewlyPressed(InputLibrary.cancel, InputMode.Roasting))
                        {
                            InputLibrary.cancel.ConsumeInput();
                            __instance._marshmallow.Remove();
                            Locator.GetPlayerAudioController().PlayMarshmallowToss();
                            var spawnedMarshmallow = Object.Instantiate(__instance._mallowBodyPrefab, __instance._stickTransform.position, __instance._stickTransform.rotation);
                            var rigidbody          = spawnedMarshmallow.GetComponent <OWRigidbody>();
                            rigidbody.SetVelocity(__instance._campfire.GetAttachedOWRigidbody().GetPointVelocity(__instance._stickTransform.position) + __instance._stickTransform.forward * 3f);
                            rigidbody.SetAngularVelocity(__instance._stickTransform.right * 10f);
                            var burntColor = __instance._marshmallow.GetBurntColor();
                            spawnedMarshmallow.GetComponentInChildren <MeshRenderer>().material.color = burntColor;
                            new MarshmallowEventMessage(MarshmallowMessageType.Toss).Send();
                        }
                    }

                    if (OWInput.IsNewlyPressed(InputLibrary.interact, InputMode.Roasting) && __instance._marshmallow.IsEdible())
                    {
                        __instance._marshmallow.Eat();
                    }
                }
                else if (__instance._marshmallow.GetState() == Marshmallow.MallowState.Burning)
                {
                    text             = UITextLibrary.GetString(UITextType.RoastingExtinguishPrompt);
                    changePromptText = true;
                    if (OWInput.IsNewlyPressed(InputLibrary.interact, InputMode.Roasting))
                    {
                        __instance._marshmallow.Extinguish();
                        new MarshmallowEventMessage(MarshmallowMessageType.Extinguish).Send();
                    }
                }
                else if (__instance._marshmallow.GetState() == Marshmallow.MallowState.Gone)
                {
                    text             = UITextLibrary.GetString(UITextType.RoastingReplacePrompt);
                    changePromptText = true;
                    if (OWInput.IsNewlyPressed(InputLibrary.interact, InputMode.Roasting))
                    {
                        __instance._marshmallow.SpawnMallow(true);
                    }
                }

                if (changePromptText && __instance._promptText != text)
                {
                    __instance._promptText = text;
                    __instance._mallowPrompt.SetText(__instance._promptText);
                }

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

            __instance._showMallowPrompt = changePromptText;
            __instance._showRemovePrompt = showRemovePrompt;

            return(false);
        }