示例#1
0
 public static void AnalogModeChange(AnalogueMode mode, short newUpperbound = 32767, float newDeadzone = 0.5f)
 {
     if (mode != analogMode || upperbound != newUpperbound)
     {
         analogMode    = mode;
         upperbound    = newUpperbound;
         ampLowerbound = (float)(newDeadzone * newDeadzone * DcMult);
     }
 }
        private static void Save(bool breakpoint)
        {
            if (IsSaved())
            {
                if (Controller.CurrentFrame == savedController.CurrentFrame)
                {
                    if (savedController.SavedChecksum == Controller.Checksum(savedController))
                    {
                        Manager.State &= ~State.FrameStep;
                        NextState     &= ~State.FrameStep;
                        return;
                    }
                }
            }

            if (!StateManager.Instance.SaveState())
            {
                return;
            }

            if (breakpoint && Controller.CurrentFf.SaveState)
            {
                Controller.CurrentFf.HasSavedState = true;
            }

            if (breakpoint)
            {
                savedLine = Controller.Current.Line - 1;
            }
            else
            {
                savedLine = Controller.Current.Line;
            }

            savedByBreakpoint        = breakpoint;
            savedPlayerStatus        = PlayerStatus;
            savedLastPos             = LastPos;
            savedLastPlayerSeekerPos = LastPlayerSeekerPos;
            savedAnalogueMode        = AnalogHelper.Mode;
            savedAnalogueLimit       = AnalogHelper.Limit;


            savedController = Controller.Clone();
            LoadStateRoutine();
        }
示例#3
0
        private static void DisableRun()
        {
            Running = false;

            /*
             * if (Recording) {
             *      controller.WriteInputs();
             * }
             */
            Recording = false;
            state     = State.None;
            nextState = State.None;
            RestorePlayerBindings();
            Celeste.Mod.Core.CoreModule.Settings.UseKeyboardForTextInput = kbTextInput;
            controller.resetSpawn = null;
            if (ExportSyncData)
            {
                EndExport();
                ExportSyncData = false;
            }
            enforceLegal     = false;
            allowUnsafeInput = false;
            analogueMode     = AnalogueMode.Ignore;        //Circle;
        }