mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-04-24 04:37:42 +02:00
Improve description of Turbo Mode in the UI and localize FPS/Turbo indicator on status bar
This commit is contained in:
parent
ed5cb82aa8
commit
768406cb67
6 changed files with 130 additions and 70 deletions
|
@ -166,17 +166,6 @@ namespace Ryujinx.HLE
|
||||||
return 1000 / _frameRate[FrameTypeGame];
|
return 1000 / _frameRate[FrameTypeGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
public string FormatGameFrameRate()
|
|
||||||
{
|
|
||||||
double frameRate = GetGameFrameRate();
|
|
||||||
double frameTime = GetGameFrameTime();
|
|
||||||
string turboSuffix = _device.TurboMode
|
|
||||||
? $" Turbo ({_device.TickScalar}%)"
|
|
||||||
: string.Empty;
|
|
||||||
|
|
||||||
return $"{frameRate:00.00} FPS ({frameTime:00.00}ms){turboSuffix}";
|
|
||||||
}
|
|
||||||
|
|
||||||
public string FormatFifoPercent()
|
public string FormatFifoPercent()
|
||||||
{
|
{
|
||||||
double fifoPercent = GetFifoPercent();
|
double fifoPercent = GetFifoPercent();
|
||||||
|
|
|
@ -4,6 +4,7 @@ using Avalonia.Controls.ApplicationLifetimes;
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
using DiscordRPC;
|
using DiscordRPC;
|
||||||
|
using Gommon;
|
||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
using LibHac.Ns;
|
using LibHac.Ns;
|
||||||
using LibHac.Tools.FsSystem;
|
using LibHac.Tools.FsSystem;
|
||||||
|
@ -1153,11 +1154,23 @@ namespace Ryujinx.Ava
|
||||||
LocaleManager.Instance[LocaleKeys.VolumeShort] + $": {(int)(Device.GetVolume() * 100)}%",
|
LocaleManager.Instance[LocaleKeys.VolumeShort] + $": {(int)(Device.GetVolume() * 100)}%",
|
||||||
dockedMode,
|
dockedMode,
|
||||||
ConfigurationState.Instance.Graphics.AspectRatio.Value.ToText(),
|
ConfigurationState.Instance.Graphics.AspectRatio.Value.ToText(),
|
||||||
Device.Statistics.FormatGameFrameRate(),
|
FormatGameFrameRate(),
|
||||||
Device.Statistics.FormatFifoPercent(),
|
Device.Statistics.FormatFifoPercent(),
|
||||||
_displayCount));
|
_displayCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string FormatGameFrameRate()
|
||||||
|
{
|
||||||
|
string frameRate = Device.Statistics.GetGameFrameRate().ToString("00.00");
|
||||||
|
string frameTime = Device.Statistics.GetGameFrameTime().ToString("00.00");
|
||||||
|
|
||||||
|
return Device.TurboMode
|
||||||
|
? LocaleManager.GetUnformatted(LocaleKeys.FpsTurboStatusBarText)
|
||||||
|
.Format(frameRate, frameTime, Device.TickScalar)
|
||||||
|
: LocaleManager.GetUnformatted(LocaleKeys.FpsStatusBarText)
|
||||||
|
.Format(frameRate, frameTime);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task ShowExitPrompt()
|
public async Task ShowExitPrompt()
|
||||||
{
|
{
|
||||||
bool shouldExit = !ConfigurationState.Instance.ShowConfirmExit;
|
bool shouldExit = !ConfigurationState.Instance.ShowConfirmExit;
|
||||||
|
|
|
@ -4898,37 +4898,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ID": "SettingsTabSystemTurboMultiplierValue",
|
"ID": "SettingsTabSystemTurboMultiplier",
|
||||||
"Translations": {
|
"Translations": {
|
||||||
"ar_SA": "",
|
"ar_SA": "",
|
||||||
"de_DE": "",
|
"de_DE": "",
|
||||||
"el_GR": "",
|
"el_GR": "",
|
||||||
"en_US": "Turbo multiplier:",
|
"en_US": "Turbo Mode multiplier:",
|
||||||
"es_ES": "",
|
|
||||||
"fr_FR": "",
|
|
||||||
"he_IL": "",
|
|
||||||
"it_IT": "",
|
|
||||||
"ja_JP": "",
|
|
||||||
"ko_KR": "",
|
|
||||||
"no_NO": "",
|
|
||||||
"pl_PL": "",
|
|
||||||
"pt_BR": "",
|
|
||||||
"ru_RU": "",
|
|
||||||
"sv_SE": "",
|
|
||||||
"th_TH": "",
|
|
||||||
"tr_TR": "",
|
|
||||||
"uk_UA": "",
|
|
||||||
"zh_CN": "",
|
|
||||||
"zh_TW": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ID": "SettingsTabSystemTurboMultiplierSliderToolTip",
|
|
||||||
"Translations": {
|
|
||||||
"ar_SA": "",
|
|
||||||
"de_DE": "",
|
|
||||||
"el_GR": "",
|
|
||||||
"en_US": "The Turbo mode multiplier target value.\n\nLeave at 100 if unsure.",
|
|
||||||
"es_ES": "",
|
"es_ES": "",
|
||||||
"fr_FR": "",
|
"fr_FR": "",
|
||||||
"he_IL": "",
|
"he_IL": "",
|
||||||
|
@ -4953,7 +4928,32 @@
|
||||||
"ar_SA": "",
|
"ar_SA": "",
|
||||||
"de_DE": "",
|
"de_DE": "",
|
||||||
"el_GR": "",
|
"el_GR": "",
|
||||||
"en_US": "The Turbo mode multiplier, as a percentage of the normal Switch clock speed.\n\nLeave at 100 if unsure.",
|
"en_US": "The Turbo mode multiplier target value.\n\nLeave at 200 if unsure.",
|
||||||
|
"es_ES": "",
|
||||||
|
"fr_FR": "",
|
||||||
|
"he_IL": "",
|
||||||
|
"it_IT": "",
|
||||||
|
"ja_JP": "",
|
||||||
|
"ko_KR": "",
|
||||||
|
"no_NO": "",
|
||||||
|
"pl_PL": "",
|
||||||
|
"pt_BR": "",
|
||||||
|
"ru_RU": "",
|
||||||
|
"sv_SE": "",
|
||||||
|
"th_TH": "",
|
||||||
|
"tr_TR": "",
|
||||||
|
"uk_UA": "",
|
||||||
|
"zh_CN": "",
|
||||||
|
"zh_TW": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ID": "SettingsTabSystemTurboMultiplierToolTip",
|
||||||
|
"Translations": {
|
||||||
|
"ar_SA": "",
|
||||||
|
"de_DE": "",
|
||||||
|
"el_GR": "",
|
||||||
|
"en_US": "Turbo mode is an emulator feature which effectively causes speed up or slow down when a game is not frame-rate sensitive.\nYou can toggle this feature in-game with a hotkey, configurable in Ryujinx Keyboard Hotkeys settings.\n\nLeave at 200 if unsure.",
|
||||||
"es_ES": "",
|
"es_ES": "",
|
||||||
"fr_FR": "",
|
"fr_FR": "",
|
||||||
"he_IL": "",
|
"he_IL": "",
|
||||||
|
@ -5172,31 +5172,6 @@
|
||||||
"zh_TW": "可能導致模擬器不穩定"
|
"zh_TW": "可能導致模擬器不穩定"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"ID": "SettingsTabCpuHacksNote",
|
|
||||||
"Translations": {
|
|
||||||
"ar_SA": "",
|
|
||||||
"de_DE": "",
|
|
||||||
"el_GR": "",
|
|
||||||
"en_US": "Can and will cause crashing, slow/too fast games, etc. Use with caution.",
|
|
||||||
"es_ES": "",
|
|
||||||
"fr_FR": "",
|
|
||||||
"he_IL": "",
|
|
||||||
"it_IT": "",
|
|
||||||
"ja_JP": "",
|
|
||||||
"ko_KR": "",
|
|
||||||
"no_NO": "",
|
|
||||||
"pl_PL": "",
|
|
||||||
"pt_BR": "",
|
|
||||||
"ru_RU": "",
|
|
||||||
"sv_SE": "",
|
|
||||||
"th_TH": "",
|
|
||||||
"tr_TR": "",
|
|
||||||
"uk_UA": "",
|
|
||||||
"zh_CN": "",
|
|
||||||
"zh_TW": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"ID": "SettingsTabSystemDramSize",
|
"ID": "SettingsTabSystemDramSize",
|
||||||
"Translations": {
|
"Translations": {
|
||||||
|
@ -18172,6 +18147,56 @@
|
||||||
"zh_TW": "更新已停用!"
|
"zh_TW": "更新已停用!"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ID": "FpsStatusBarText",
|
||||||
|
"Translations": {
|
||||||
|
"ar_SA": "",
|
||||||
|
"de_DE": "",
|
||||||
|
"el_GR": "",
|
||||||
|
"en_US": "{0} FPS ({1}ms)",
|
||||||
|
"es_ES": "",
|
||||||
|
"fr_FR": "",
|
||||||
|
"he_IL": "",
|
||||||
|
"it_IT": "",
|
||||||
|
"ja_JP": "",
|
||||||
|
"ko_KR": "",
|
||||||
|
"no_NO": "",
|
||||||
|
"pl_PL": "",
|
||||||
|
"pt_BR": "",
|
||||||
|
"ru_RU": "",
|
||||||
|
"sv_SE": "",
|
||||||
|
"th_TH": "",
|
||||||
|
"tr_TR": "",
|
||||||
|
"uk_UA": "",
|
||||||
|
"zh_CN": "",
|
||||||
|
"zh_TW": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ID": "FpsTurboStatusBarText",
|
||||||
|
"Translations": {
|
||||||
|
"ar_SA": "",
|
||||||
|
"de_DE": "",
|
||||||
|
"el_GR": "",
|
||||||
|
"en_US": "{0} FPS ({1}ms), Turbo ({2}%)",
|
||||||
|
"es_ES": "",
|
||||||
|
"fr_FR": "",
|
||||||
|
"he_IL": "",
|
||||||
|
"it_IT": "",
|
||||||
|
"ja_JP": "",
|
||||||
|
"ko_KR": "",
|
||||||
|
"no_NO": "",
|
||||||
|
"pl_PL": "",
|
||||||
|
"pt_BR": "",
|
||||||
|
"ru_RU": "",
|
||||||
|
"sv_SE": "",
|
||||||
|
"th_TH": "",
|
||||||
|
"tr_TR": "",
|
||||||
|
"uk_UA": "",
|
||||||
|
"zh_CN": "",
|
||||||
|
"zh_TW": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"ID": "UpdaterBackgroundStatusBarButtonText",
|
"ID": "UpdaterBackgroundStatusBarButtonText",
|
||||||
"Translations": {
|
"Translations": {
|
||||||
|
@ -23922,6 +23947,31 @@
|
||||||
"zh_TW": ""
|
"zh_TW": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ID": "SettingsTabHotkeysTurboModeToolTip",
|
||||||
|
"Translations": {
|
||||||
|
"ar_SA": "",
|
||||||
|
"de_DE": "",
|
||||||
|
"el_GR": "",
|
||||||
|
"en_US": "The Turbo mode hotkey.\nConfigure the behavior of Turbo mode in Ryujinx CPU settings.\n\nLeave Unbound if unsure.",
|
||||||
|
"es_ES": "",
|
||||||
|
"fr_FR": "",
|
||||||
|
"he_IL": "",
|
||||||
|
"it_IT": "",
|
||||||
|
"ja_JP": "",
|
||||||
|
"ko_KR": "",
|
||||||
|
"no_NO": "",
|
||||||
|
"pl_PL": "",
|
||||||
|
"pt_BR": "",
|
||||||
|
"ru_RU": "",
|
||||||
|
"sv_SE": "",
|
||||||
|
"th_TH": "",
|
||||||
|
"tr_TR": "",
|
||||||
|
"uk_UA": "",
|
||||||
|
"zh_CN": "",
|
||||||
|
"zh_TW": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"ID": "SettingsTabHotkeysOnlyWhilePressed",
|
"ID": "SettingsTabHotkeysOnlyWhilePressed",
|
||||||
"Translations": {
|
"Translations": {
|
||||||
|
|
|
@ -57,6 +57,13 @@ namespace Ryujinx.Ava.Common.Locale
|
||||||
SetDynamicValues(LocaleKeys.RyujinxRebooter, RyujinxApp.FullAppName);
|
SetDynamicValues(LocaleKeys.RyujinxRebooter, RyujinxApp.FullAppName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetUnformatted(LocaleKeys key) => Instance.Get(key);
|
||||||
|
|
||||||
|
public string Get(LocaleKeys key) =>
|
||||||
|
_localeStrings.TryGetValue(key, out string value)
|
||||||
|
? value
|
||||||
|
: key.ToString();
|
||||||
|
|
||||||
public string this[LocaleKeys key]
|
public string this[LocaleKeys key]
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Foreground="{DynamicResource SecondaryTextColor}"
|
Foreground="{DynamicResource SecondaryTextColor}"
|
||||||
TextDecorations="Underline"
|
TextDecorations="Underline"
|
||||||
Text="{ext:Locale SettingsTabCpuHacksNote}" />
|
Text="{ext:Locale SettingsTabSystemHacksNote}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Margin="10,0,0,0"
|
Margin="10,0,0,0"
|
||||||
|
@ -97,8 +97,9 @@
|
||||||
Orientation="Horizontal">
|
Orientation="Horizontal">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{ext:Locale SettingsTabSystemTurboMultiplierValue}"
|
Background="Transparent"
|
||||||
ToolTip.Tip="{ext:Locale SettingsTabSystemTurboMultiplierValueToolTip}"
|
Text="{ext:Locale SettingsTabSystemTurboMultiplier}"
|
||||||
|
ToolTip.Tip="{ext:Locale SettingsTabSystemTurboMultiplierToolTip}"
|
||||||
Width="250" />
|
Width="250" />
|
||||||
<ui:NumberBox ToolTip.Tip="{ext:Locale SettingsTabSystemTurboMultiplierValueToolTip}"
|
<ui:NumberBox ToolTip.Tip="{ext:Locale SettingsTabSystemTurboMultiplierValueToolTip}"
|
||||||
Value="{Binding TurboMultiplier}"
|
Value="{Binding TurboMultiplier}"
|
||||||
|
@ -110,7 +111,7 @@
|
||||||
Minimum="50"
|
Minimum="50"
|
||||||
Maximum="500" />
|
Maximum="500" />
|
||||||
<Slider Value="{Binding TurboMultiplier}"
|
<Slider Value="{Binding TurboMultiplier}"
|
||||||
ToolTip.Tip="{ext:Locale SettingsTabSystemTurboMultiplierSliderToolTip}"
|
ToolTip.Tip="{ext:Locale SettingsTabSystemTurboMultiplierValueToolTip}"
|
||||||
MinWidth="175"
|
MinWidth="175"
|
||||||
Margin="10,-3,0,0"
|
Margin="10,-3,0,0"
|
||||||
Height="32"
|
Height="32"
|
||||||
|
|
|
@ -113,7 +113,7 @@
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysTurboMode}" Classes="settingHeader" />
|
<TextBlock Text="{ext:Locale SettingsTabHotkeysTurboMode}" Classes="settingHeader" ToolTip.Tip="{ext:Locale SettingsTabHotkeysTurboModeToolTip}" Background="Transparent" />
|
||||||
<ToggleButton Name="TurboMode">
|
<ToggleButton Name="TurboMode">
|
||||||
<TextBlock Text="{Binding KeyboardHotkey.TurboMode, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
<TextBlock Text="{Binding KeyboardHotkey.TurboMode, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
|
|
Loading…
Add table
Reference in a new issue