Controller overlay duration config

This commit is contained in:
Barış Hamil 2025-06-20 18:13:55 +03:00 committed by GreemDev
parent 175d5f9bb3
commit 1e86aa9764
6 changed files with 67 additions and 2 deletions

View file

@ -15,7 +15,7 @@ namespace Ryujinx.Ava.Systems.Configuration
/// <summary>
/// The current version of the file format
/// </summary>
public const int CurrentVersion = 70;
public const int CurrentVersion = 71;
/// <summary>
/// Version of the configuration file format
@ -217,6 +217,16 @@ namespace Ryujinx.Ava.Systems.Configuration
/// </summary>
public HideCursorMode HideCursor { get; set; }
/// <summary>
/// Duration to show controller overlay when game starts (seconds, 0 = disabled)
/// </summary>
public int ControllerOverlayGameStartDuration { get; set; }
/// <summary>
/// Duration to show controller overlay when input is cycled (seconds, 0 = disabled)
/// </summary>
public int ControllerOverlayInputCycleDuration { get; set; }
/// <summary>
/// Enables or disables Vertical Sync
/// </summary>

View file

@ -53,6 +53,8 @@ namespace Ryujinx.Ava.Systems.Configuration
ShowOldUI.Value = shouldLoadFromFile ? cff.ShowTitleBar : ShowOldUI.Value; // Get from global config only
EnableHardwareAcceleration.Value = shouldLoadFromFile ? cff.EnableHardwareAcceleration : EnableHardwareAcceleration.Value; // Get from global config only
HideCursor.Value = cff.HideCursor;
ControllerOverlayGameStartDuration.Value = cff.ControllerOverlayGameStartDuration;
ControllerOverlayInputCycleDuration.Value = cff.ControllerOverlayInputCycleDuration;
Logger.EnableFileLog.Value = cff.EnableFileLog;
Logger.EnableDebug.Value = cff.LoggingEnableDebug;
@ -479,7 +481,12 @@ namespace Ryujinx.Ava.Systems.Configuration
};
}
),
(69, static cff => cff.SkipUserProfiles = false)
(69, static cff => cff.SkipUserProfiles = false),
(71, static cff =>
{
cff.ControllerOverlayGameStartDuration = 3;
cff.ControllerOverlayInputCycleDuration = 2;
})
);
}
}

View file

@ -846,6 +846,16 @@ namespace Ryujinx.Ava.Systems.Configuration
/// </summary>
public ReactiveObject<HideCursorMode> HideCursor { get; private set; }
/// <summary>
/// Duration to show controller overlay when game starts (seconds, 0 = disabled)
/// </summary>
public ReactiveObject<int> ControllerOverlayGameStartDuration { get; private set; }
/// <summary>
/// Duration to show controller overlay when input is cycled (seconds, 0 = disabled)
/// </summary>
public ReactiveObject<int> ControllerOverlayInputCycleDuration { get; private set; }
private ConfigurationState()
{
UI = new UISection();
@ -863,6 +873,8 @@ namespace Ryujinx.Ava.Systems.Configuration
RememberWindowState = new ReactiveObject<bool>();
ShowOldUI = new ReactiveObject<bool>();
EnableHardwareAcceleration = new ReactiveObject<bool>();
ControllerOverlayGameStartDuration = new ReactiveObject<int>();
ControllerOverlayInputCycleDuration = new ReactiveObject<int>();
}
public HleConfiguration CreateHleConfiguration() =>

View file

@ -65,6 +65,8 @@ namespace Ryujinx.Ava.Systems.Configuration
ShowTitleBar = ShowOldUI,
EnableHardwareAcceleration = EnableHardwareAcceleration,
HideCursor = HideCursor,
ControllerOverlayGameStartDuration = ControllerOverlayGameStartDuration,
ControllerOverlayInputCycleDuration = ControllerOverlayInputCycleDuration,
VSyncMode = Graphics.VSyncMode,
EnableCustomVSyncInterval = Graphics.EnableCustomVSyncInterval,
CustomVSyncInterval = Graphics.CustomVSyncInterval,
@ -190,6 +192,8 @@ namespace Ryujinx.Ava.Systems.Configuration
ShowOldUI.Value = !OperatingSystem.IsWindows();
EnableHardwareAcceleration.Value = true;
HideCursor.Value = HideCursorMode.OnIdle;
ControllerOverlayGameStartDuration.Value = 3;
ControllerOverlayInputCycleDuration.Value = 2;
Graphics.VSyncMode.Value = VSyncMode.Switch;
Graphics.CustomVSyncInterval.Value = 120;
Graphics.EnableCustomVSyncInterval.Value = false;

View file

@ -146,6 +146,8 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool EnableMouse { get; set; }
public bool DisableInputWhenOutOfFocus { get; set; }
public int FocusLostActionType { get; set; }
public int ControllerOverlayGameStartDuration { get; set; }
public int ControllerOverlayInputCycleDuration { get; set; }
public bool UseGlobalInputConfig
{
@ -587,6 +589,8 @@ namespace Ryujinx.Ava.UI.ViewModels
HideCursor = (int)config.HideCursor.Value;
UpdateCheckerType = (int)config.UpdateCheckerType.Value;
FocusLostActionType = (int)config.FocusLostActionType.Value;
ControllerOverlayGameStartDuration = config.ControllerOverlayGameStartDuration.Value;
ControllerOverlayInputCycleDuration = config.ControllerOverlayInputCycleDuration.Value;
GameDirectories.Clear();
GameDirectories.AddRange(config.UI.GameDirs.Value);
@ -698,6 +702,8 @@ namespace Ryujinx.Ava.UI.ViewModels
config.HideCursor.Value = (HideCursorMode)HideCursor;
config.UpdateCheckerType.Value = (UpdaterType)UpdateCheckerType;
config.FocusLostActionType.Value = (FocusLostType)FocusLostActionType;
config.ControllerOverlayGameStartDuration.Value = ControllerOverlayGameStartDuration;
config.ControllerOverlayInputCycleDuration.Value = ControllerOverlayInputCycleDuration;
config.UI.GameDirs.Value = [.. GameDirectories];
config.UI.AutoloadDirs.Value = [.. AutoloadDirectories];

View file

@ -157,6 +157,32 @@
</ComboBox>
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}" />
</StackPanel>
<Separator Height="1" Margin="0,15,0,15" />
<TextBlock Classes="h1" Text="Controller Overlay" />
<StackPanel Margin="10,0,0,0" Orientation="Vertical" Spacing="10">
<StackPanel Orientation="Horizontal">
<TextBlock VerticalAlignment="Center"
Text="Show on game start (seconds):"
Width="200" />
<NumericUpDown Value="{Binding ControllerOverlayGameStartDuration}"
Minimum="0"
Maximum="30"
Increment="1"
FormatString="0"
ToolTip.Tip="Duration to show controller overlay when game starts (0 = disabled)" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock VerticalAlignment="Center"
Text="Show on input cycle (seconds):"
Width="200" />
<NumericUpDown Value="{Binding ControllerOverlayInputCycleDuration}"
Minimum="0"
Maximum="30"
Increment="1"
FormatString="0"
ToolTip.Tip="Duration to show controller overlay when cycling inputs (0 = disabled)" />
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
<Border Grid.Column="1"