Skip to content

Commit

Permalink
move setting to 'Hacks', tweak UI and tooltips accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
jcm committed Oct 8, 2023
1 parent 7342c5b commit 29be381
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
7 changes: 4 additions & 3 deletions src/Ryujinx.Ava/Assets/Locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,13 @@
"SettingsTabSystemSystemTimeZone": "System Time Zone:",
"SettingsTabSystemSystemTime": "System Time:",
"SettingsTabSystemPresentIntervalState": "VSync:",
"SettingsTabSystemEnableCustomPresentInterval": "Enable toggle through custom refresh rate",
"SettingsTabSystemEnableCustomPresentInterval": "Enable custom refresh rate (Experimental)",
"SettingsTabSystemPresentIntervalStateSwitch": "On",
"SettingsTabSystemPresentIntervalStateUnbounded": "Off",
"SettingsTabSystemPresentIntervalStateCustom": "Custom Refresh Rate",
"SettingsTabSystemPresentIntervalStateTooltip": "Emulated Vertical Sync. 'On' emulates the Switch's refresh rate of 60Hz. 'Off' is an unbounded refresh rate. 'Custom' allows the user to specify a custom emulated refresh rate. In some titles, the custom rate will act as an FPS cap. In others, it may lead to unpredictable behavior. \n\nLeave ON if unsure.",
"SettingsTabSystemEnableCustomPresentIntervalTooltip": "The VSync toggle will also cycle through the custom refresh rate mode.",
"SettingsTabSystemPresentIntervalStateTooltip": "Emulated Vertical Sync. 'On' emulates the Switch's refresh rate of 60Hz. 'Off' is an unbounded refresh rate.",
"SettingsTabSystemPresentIntervalStateTooltipCustom": "Emulated Vertical Sync. 'On' emulates the Switch's refresh rate of 60Hz. 'Off' is an unbounded refresh rate. 'Custom' emulates the specified custom refresh rate.",
"SettingsTabSystemEnableCustomPresentIntervalTooltip": "Allows the user to specify an emulated refresh rate. In some titles, this may speed up or slow down the rate of gameplay logic. In other titles, it may allow for capping FPS at some multiple of the refresh rate, or lead to unpredictable behavior. This is an experimental feature, with no guarantees for how gameplay will be affected. \n\nLeave OFF if unsure.",
"SettingsTabSystemCustomPresentIntervalValueTooltip": "The custom refresh rate target value.",
"SettingsTabSystemCustomPresentIntervalSliderTooltip": "The custom refresh rate, as a percentage of the normal Switch refresh rate.",
"SettingsTabSystemCustomPresentIntervalValue": "Custom Refresh Rate Value:",
Expand Down
15 changes: 9 additions & 6 deletions src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ public PresentIntervalState PresentIntervalState
get => _presentIntervalState;
set
{
if (value == PresentIntervalState.Custom)
if (value == PresentIntervalState.Custom ||
value == PresentIntervalState.Switch ||
value == PresentIntervalState.Unbounded)
{
EnableCustomPresentInterval = true;
_presentIntervalState = value;
OnPropertyChanged();
}
_presentIntervalState = value;
OnPropertyChanged();
OnPropertyChanged((nameof(EnableCustomPresentInterval)));
}
}

Expand Down Expand Up @@ -192,7 +192,10 @@ public bool EnableCustomPresentInterval
if (_presentIntervalState == PresentIntervalState.Custom && value == false)
{
PresentIntervalState = PresentIntervalState.Switch;
OnPropertyChanged(nameof(PresentIntervalState));
}
else if (value)
{
PresentIntervalState = PresentIntervalState.Custom;
}
OnPropertyChanged();
}
Expand Down
27 changes: 21 additions & 6 deletions src/Ryujinx.Ava/UI/Views/Settings/SettingsSystemView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@
ToolTip.Tip="{locale:Locale SettingsTabSystemPresentIntervalStateTooltip}"
Width="250" />
<ComboBox
IsVisible="{Binding EnableCustomPresentInterval}"
SelectedIndex="{Binding PresentIntervalState}"
ToolTip.Tip="{locale:Locale SettingsTabSystemPresentIntervalStateTooltip}"
ToolTip.Tip="{locale:Locale SettingsTabSystemPresentIntervalStateTooltipCustom}"
HorizontalContentAlignment="Left"
Width="350">
<ComboBoxItem>
Expand All @@ -204,6 +205,19 @@
<TextBlock Text="{locale:Locale SettingsTabSystemPresentIntervalStateCustom}" />
</ComboBoxItem>
</ComboBox>
<ComboBox
IsVisible="{Binding !EnableCustomPresentInterval}"
SelectedIndex="{Binding PresentIntervalState}"
ToolTip.Tip="{locale:Locale SettingsTabSystemPresentIntervalStateTooltip}"
HorizontalContentAlignment="Left"
Width="350">
<ComboBoxItem>
<TextBlock Text="{locale:Locale SettingsTabSystemPresentIntervalStateSwitch}" />
</ComboBoxItem>
<ComboBoxItem>
<TextBlock Text="{locale:Locale SettingsTabSystemPresentIntervalStateUnbounded}" />
</ComboBoxItem>
</ComboBox>
</StackPanel>
<StackPanel IsVisible="{Binding EnableCustomPresentInterval}"
Margin="0,0,0,10"
Expand All @@ -221,7 +235,7 @@
LargeChange="10"
SimpleNumberFormat="F0"
SpinButtonPlacementMode="Hidden"
Minimum="10"
Minimum="6"
Maximum="1000" />
<Slider Value="{Binding CustomPresentIntervalPercentageProxy}"
ToolTip.Tip="{locale:Locale SettingsTabSystemCustomPresentIntervalSliderTooltip}"
Expand All @@ -240,10 +254,6 @@
Width="40"
Text="{Binding CustomPresentIntervalPercentageText}"/>
</StackPanel>
<CheckBox IsChecked="{Binding EnableCustomPresentInterval}"
ToolTip.Tip="{locale:Locale SettingsTabSystemEnableCustomPresentIntervalTooltip}">
<TextBlock Text="{locale:Locale SettingsTabSystemEnableCustomPresentInterval}" />
</CheckBox>
<CheckBox IsChecked="{Binding EnableFsIntegrityChecks}">
<TextBlock
Text="{locale:Locale SettingsTabSystemEnableFsIntegrityChecks}"
Expand Down Expand Up @@ -275,6 +285,11 @@
ToolTip.Tip="{locale:Locale IgnoreMissingServicesTooltip}">
<TextBlock Text="{locale:Locale SettingsTabSystemIgnoreMissingServices}" />
</CheckBox>
<CheckBox
IsChecked="{Binding EnableCustomPresentInterval}"
ToolTip.Tip="{locale:Locale SettingsTabSystemEnableCustomPresentIntervalTooltip}">
<TextBlock Text="{locale:Locale SettingsTabSystemEnableCustomPresentInterval}" />
</CheckBox>
</StackPanel>
</StackPanel>
</Border>
Expand Down

0 comments on commit 29be381

Please sign in to comment.