Example #1
0
    public override void _Ready()
    {
        Button holder = GetChild <Button>(0);

        holder.Pressed = SettingsOptions.GetSetting <bool>(optionName);
        holder.Connect("toggled", this, nameof(ChangeSetting));
        button = holder;
        SettingsOptions.RegisterUpdatedEvent(UpdateValue);
        button.Text = text;
    }
Example #2
0
 private bool SprintOutput()
 {
     if (SettingsOptions.GetSetting <bool>(SettingsNames.toggleSprint))
     {
         if (Input.IsActionJustPressed("Sprint"))
         {
             sprintToggleOn = !sprintToggleOn;
         }
         return(sprintToggleOn);
     }
     return(Input.IsActionPressed("Sprint"));
 }
 public override void _Ready()
 {
     number = GetChild <SpinBox>(0);
     slider = GetChild <Slider>(1);
     number.Connect("value_changed", this, nameof(ValuesChanged));
     slider.Connect("value_changed", this, nameof(ValuesChanged));
     number.MaxValue = max;
     slider.MaxValue = max;
     slider.MinValue = min;
     number.MinValue = min;
     GetChild <RichTextLabel>(2).BbcodeText = "[center]" + name + "[/center]";
     number.Value = SettingsOptions.GetSetting <float>(optionName) * multiplier;
     slider.Value = number.Value;
     SettingsOptions.RegisterUpdatedEvent(UpdateValue);
 }
Example #4
0
 public void Rotating(Vector2 vec)
 {
     if (GameManager.InCutscene())
     {
         return;
     }
     if (GameManager.Instance.playing && inputLockTimer <= 0f)
     {
         controller.bodyRotation.RotateAmount(vec.x * GameManager.Instance.GetPhysicsProcessDeltaTime() * SettingsOptions.GetSetting <float>(SettingsNames.mouseXSensitivity) *
                                              (SettingsOptions.GetSetting <bool>(SettingsNames.invertX) ? -1 : 1) *
                                              controller.ability.ZoomRatio);
         controller.headRotation.RotateAmount(vec.y * GameManager.Instance.GetPhysicsProcessDeltaTime() * SettingsOptions.GetSetting <float>(SettingsNames.mouseYSensitivity) *
                                              (SettingsOptions.GetSetting <bool>(SettingsNames.invertY) ? -1 : 1) *
                                              controller.ability.ZoomRatio);
     }
 }
Example #5
0
    private void SetZoom(ZoomLevel level)
    {
        currentZoom = level;
        float newValue = 0f;

        switch (currentZoom)
        {
        case ZoomLevel.normal:
            newValue = SettingsOptions.GetSetting <float>(SettingsNames.cameraFOV);
            break;

        case ZoomLevel.zoom1:
            newValue = PlayerOptions.level1Zoom;
            break;

        case ZoomLevel.zoom2:
            newValue = PlayerOptions.level2Zoom;
            break;
        }
        controller.anim.ZoomCamera(newValue, controller.camera.Fov);
        zoomRatio = newValue / SettingsOptions.GetSetting <float>(SettingsNames.cameraFOV);
    }
Example #6
0
 public void UpdateCharacterSettings()
 {
     camera.Fov = SettingsOptions.GetSetting <float>(SettingsNames.cameraFOV);
 }
 private void UpdateValue()
 {
     slider.Value = SettingsOptions.GetSetting <float>(optionName) * multiplier;
 }
Example #8
0
 public void UpdateGameSettings()
 {
     Engine.TargetFps = Mathf.RoundToInt(SettingsOptions.GetSetting <float>(SettingsNames.FPS));
     OS.VsyncEnabled  = SettingsOptions.GetSetting <bool>(SettingsNames.VSync);
 }
Example #9
0
 public void UpdateValue()
 {
     button.Pressed = SettingsOptions.GetSetting <bool>(optionName);
 }