示例#1
0
    public override void _Process(float delta)
    {
        inputs.OnFrameChanged();

        var settings = Settings.Instance;

        float forwardMovement = forwardBackAxis.CurrentValue;

        if (autoMove.ToggledOn)
        {
            forwardMovement = -1;
        }

        var movement = new Vector3(leftRightAxis.CurrentValue, 0, forwardMovement);

        // Reset auto move if a key was pressed
        if (forward.ReadTrigger() || backwards.ReadTrigger() || left.ReadTrigger() || right.ReadTrigger())
        {
            autoMove.ToggledOn = false;
        }

        if (stage.Player != null)
        {
            stage.Player.MovementDirection = movement.Normalized();
            stage.Player.LookAtPoint       = stage.Camera.CursorWorldPos;
        }

        if (fireToxin.Pressed)
        {
            stage.Player?.EmitToxin();
        }

        if (toggleEngulf.ReadTrigger())
        {
            if (stage.Player != null)
            {
                stage.Player.EngulfMode = !stage.Player.EngulfMode;
            }
        }

        if (settings.CheatsEnabled && cheatEditor.ReadTrigger())
        {
            stage.HUD.ShowReproductionDialog();
        }

        if (settings.CheatsEnabled && cheatAmmonia.Pressed)
        {
            SpawnCheatCloud("ammonia", delta);
        }

        if (settings.CheatsEnabled && cheatGlucose.Pressed)
        {
            SpawnCheatCloud("glucose", delta);
        }

        if (settings.CheatsEnabled && cheatPhosphates.Pressed)
        {
            SpawnCheatCloud("phosphates", delta);
        }
    }
示例#2
0
    public override void _Process(float delta)
    {
        inputs.OnFrameChanged();

        if (load.ReadTrigger())
        {
            if (!InProgressLoad.IsLoading)
            {
                GD.Print("Quick load pressed, attempting to load latest save");

                if (!SaveHelper.QuickLoad())
                {
                    differentVersionDialog.PopupCenteredMinsize();
                }
            }
            else
            {
                GD.Print("Quick load pressed, cancelled because another is already in progress");
            }
        }
    }