Compare commits
5 Commits
Canary-1.2
...
8b1a4f02ab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b1a4f02ab | ||
|
|
2d79cc7a8c | ||
|
|
73e9e44a27 | ||
|
|
78924af397 | ||
|
|
729774f37d |
@@ -6,16 +6,4 @@ namespace Ryujinx.Common.Configuration
|
||||
Unbounded,
|
||||
Custom
|
||||
}
|
||||
|
||||
public static class VSyncModeExtensions
|
||||
{
|
||||
public static VSyncMode Next(this VSyncMode vsync, bool customEnabled = false) =>
|
||||
vsync switch
|
||||
{
|
||||
VSyncMode.Switch => customEnabled ? VSyncMode.Custom : VSyncMode.Unbounded,
|
||||
VSyncMode.Unbounded => VSyncMode.Switch,
|
||||
VSyncMode.Custom => VSyncMode.Unbounded,
|
||||
_ => VSyncMode.Switch
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,12 +319,31 @@ namespace Ryujinx.Ava
|
||||
public void VSyncModeToggle()
|
||||
{
|
||||
VSyncMode oldVSyncMode = Device.VSyncMode;
|
||||
VSyncMode newVSyncMode = VSyncMode.Switch;
|
||||
bool customVSyncIntervalEnabled = ConfigurationState.Instance.Graphics.EnableCustomVSyncInterval.Value;
|
||||
|
||||
UpdateVSyncMode(this, new ReactiveEventArgs<VSyncMode>(
|
||||
oldVSyncMode,
|
||||
oldVSyncMode.Next(customVSyncIntervalEnabled))
|
||||
);
|
||||
switch (oldVSyncMode)
|
||||
{
|
||||
case VSyncMode.Switch:
|
||||
newVSyncMode = VSyncMode.Unbounded;
|
||||
break;
|
||||
case VSyncMode.Unbounded:
|
||||
if (customVSyncIntervalEnabled)
|
||||
{
|
||||
newVSyncMode = VSyncMode.Custom;
|
||||
}
|
||||
else
|
||||
{
|
||||
newVSyncMode = VSyncMode.Switch;
|
||||
}
|
||||
|
||||
break;
|
||||
case VSyncMode.Custom:
|
||||
newVSyncMode = VSyncMode.Switch;
|
||||
break;
|
||||
}
|
||||
|
||||
UpdateVSyncMode(this, new ReactiveEventArgs<VSyncMode>(oldVSyncMode, newVSyncMode));
|
||||
}
|
||||
|
||||
private void UpdateCustomVSyncIntervalValue(object sender, ReactiveEventArgs<int> e)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Ryujinx.Ava.UI.ViewModels;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
namespace Ryujinx.Ava.UI.Models
|
||||
{
|
||||
@@ -21,11 +21,6 @@ namespace Ryujinx.Ava.UI.Models
|
||||
public string Path { get; }
|
||||
public string Name { get; }
|
||||
|
||||
public string FormattedName =>
|
||||
InSd && ulong.TryParse(Name, NumberStyles.HexNumber, null, out ulong applicationId)
|
||||
? $"Atmosphère: {System.IO.Path.GetFileNameWithoutExtension(RyujinxApp.MainWindow.ApplicationLibrary.GetNameForApplicationId(applicationId))}"
|
||||
: Name;
|
||||
|
||||
public ModModel(string path, string name, bool enabled, bool inSd)
|
||||
{
|
||||
Path = path;
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.UI.Models.Input;
|
||||
using Ryujinx.Ava.UI.ViewModels.Input;
|
||||
using Ryujinx.Ava.UI.Views.Input;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.UI.Views.Input
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
MaxLines="2"
|
||||
TextWrapping="Wrap"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Text="{Binding FormattedName}" />
|
||||
Text="{Binding Name}" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Spacing="10"
|
||||
|
||||
@@ -111,30 +111,6 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a name for an available content file based on the Application ID '<paramref name="id"/>'.
|
||||
/// <br/><br/>
|
||||
/// For Applications, this returns the localized name of the app found in the file.
|
||||
/// For DLCs, this returns the name of the file that contains the DLC, minus the file extension.
|
||||
/// </summary>
|
||||
/// <param name="id">The Application ID to search for.</param>
|
||||
/// <remarks>
|
||||
/// If the provided Application ID does not have a corresponding Application OR DLC file,
|
||||
/// <paramref name="id"/> formatted as hexadecimal is returned.
|
||||
/// </remarks>
|
||||
/// <returns>A formatted Application name, or <paramref name="id"/> as hexadecimal if none is found.</returns>
|
||||
public string GetNameForApplicationId(ulong id)
|
||||
{
|
||||
DynamicData.Kernel.Optional<ApplicationData> appData = Applications.Lookup(id);
|
||||
if (appData.HasValue)
|
||||
return appData.Value.Name;
|
||||
|
||||
if (DownloadableContents.Keys.FindFirst(x => x.TitleId == id).TryGet(out DownloadableContentModel dlcData))
|
||||
return dlcData.FileName;
|
||||
|
||||
return id.ToString("X16");
|
||||
}
|
||||
|
||||
/// <exception cref="LibHac.Common.Keys.MissingKeyException">The configured key set is missing a key.</exception>
|
||||
/// <exception cref="InvalidDataException">The NCA header could not be decrypted.</exception>
|
||||
/// <exception cref="NotSupportedException">The NCA version is not supported.</exception>
|
||||
|
||||
Reference in New Issue
Block a user