Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e77494780b |
@@ -1,3 +1,5 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Ryujinx.Common.Configuration.Hid
|
namespace Ryujinx.Common.Configuration.Hid
|
||||||
{
|
{
|
||||||
public class KeyboardHotkeys
|
public class KeyboardHotkeys
|
||||||
@@ -13,5 +15,6 @@ namespace Ryujinx.Common.Configuration.Hid
|
|||||||
public Key VolumeDown { get; set; }
|
public Key VolumeDown { get; set; }
|
||||||
public Key CustomVSyncIntervalIncrement { get; set; }
|
public Key CustomVSyncIntervalIncrement { get; set; }
|
||||||
public Key CustomVSyncIntervalDecrement { get; set; }
|
public Key CustomVSyncIntervalDecrement { get; set; }
|
||||||
|
public List<Key> CycleControllers { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<Application
|
<Application
|
||||||
x:Class="Ryujinx.Ava.RyujinxApp"
|
x:Class="Ryujinx.Ava.App"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:sty="using:FluentAvalonia.Styling">
|
xmlns:sty="using:FluentAvalonia.Styling">
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls.ApplicationLifetimes;
|
using Avalonia.Controls.ApplicationLifetimes;
|
||||||
using Avalonia.Input.Platform;
|
|
||||||
using Avalonia.Markup.Xaml;
|
using Avalonia.Markup.Xaml;
|
||||||
using Avalonia.Platform;
|
using Avalonia.Platform;
|
||||||
using Avalonia.Styling;
|
using Avalonia.Styling;
|
||||||
@@ -20,7 +19,7 @@ using System.Diagnostics;
|
|||||||
|
|
||||||
namespace Ryujinx.Ava
|
namespace Ryujinx.Ava
|
||||||
{
|
{
|
||||||
public class RyujinxApp : Application
|
public class App : Application
|
||||||
{
|
{
|
||||||
internal static string FormatTitle(LocaleKeys? windowTitleKey = null)
|
internal static string FormatTitle(LocaleKeys? windowTitleKey = null)
|
||||||
=> windowTitleKey is null
|
=> windowTitleKey is null
|
||||||
@@ -33,12 +32,6 @@ namespace Ryujinx.Ava
|
|||||||
.ApplicationLifetime.Cast<IClassicDesktopStyleApplicationLifetime>()
|
.ApplicationLifetime.Cast<IClassicDesktopStyleApplicationLifetime>()
|
||||||
.MainWindow.Cast<MainWindow>();
|
.MainWindow.Cast<MainWindow>();
|
||||||
|
|
||||||
public static bool IsClipboardAvailable(out IClipboard clipboard)
|
|
||||||
{
|
|
||||||
clipboard = MainWindow.Clipboard;
|
|
||||||
return clipboard != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SetTaskbarProgress(TaskBarProgressBarState state) => MainWindow.PlatformFeatures.SetTaskBarProgressBarState(state);
|
public static void SetTaskbarProgress(TaskBarProgressBarState state) => MainWindow.PlatformFeatures.SetTaskBarProgressBarState(state);
|
||||||
public static void SetTaskbarProgressValue(ulong current, ulong total) => MainWindow.PlatformFeatures.SetTaskBarProgressBarValue(current, total);
|
public static void SetTaskbarProgressValue(ulong current, ulong total) => MainWindow.PlatformFeatures.SetTaskBarProgressBarValue(current, total);
|
||||||
public static void SetTaskbarProgressValue(long current, long total) => SetTaskbarProgressValue(Convert.ToUInt64(current), Convert.ToUInt64(total));
|
public static void SetTaskbarProgressValue(long current, long total) => SetTaskbarProgressValue(Convert.ToUInt64(current), Convert.ToUInt64(total));
|
||||||
@@ -98,9 +91,6 @@ namespace Ryujinx.Ava
|
|||||||
|
|
||||||
private void ThemeChanged_Event(object _, ReactiveEventArgs<string> rArgs) => ApplyConfiguredTheme(rArgs.NewValue);
|
private void ThemeChanged_Event(object _, ReactiveEventArgs<string> rArgs) => ApplyConfiguredTheme(rArgs.NewValue);
|
||||||
|
|
||||||
|
|
||||||
public static readonly ThemeVariant AmoledThemeVariant = new("Amoled", ThemeVariant.Dark);
|
|
||||||
|
|
||||||
public void ApplyConfiguredTheme(string baseStyle)
|
public void ApplyConfiguredTheme(string baseStyle)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -119,7 +109,6 @@ namespace Ryujinx.Ava
|
|||||||
"Auto" => DetectSystemTheme(),
|
"Auto" => DetectSystemTheme(),
|
||||||
"Light" => ThemeVariant.Light,
|
"Light" => ThemeVariant.Light,
|
||||||
"Dark" => ThemeVariant.Dark,
|
"Dark" => ThemeVariant.Dark,
|
||||||
"AMOLED" => AmoledThemeVariant,
|
|
||||||
_ => ThemeVariant.Default,
|
_ => ThemeVariant.Default,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -143,7 +132,7 @@ namespace Ryujinx.Ava
|
|||||||
};
|
};
|
||||||
|
|
||||||
public static ThemeVariant DetectSystemTheme() =>
|
public static ThemeVariant DetectSystemTheme() =>
|
||||||
Current is RyujinxApp { PlatformSettings: not null } app
|
Current is App { PlatformSettings: not null } app
|
||||||
? ConvertThemeVariant(app.PlatformSettings.GetColorValues().ThemeVariant)
|
? ConvertThemeVariant(app.PlatformSettings.GetColorValues().ThemeVariant)
|
||||||
: ThemeVariant.Default;
|
: ThemeVariant.Default;
|
||||||
}
|
}
|
||||||
@@ -36,6 +36,7 @@ using Ryujinx.HLE;
|
|||||||
using Ryujinx.HLE.FileSystem;
|
using Ryujinx.HLE.FileSystem;
|
||||||
using Ryujinx.HLE.HOS;
|
using Ryujinx.HLE.HOS;
|
||||||
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||||
|
using Ryujinx.HLE.HOS.Services.Hid;
|
||||||
using Ryujinx.HLE.HOS.SystemState;
|
using Ryujinx.HLE.HOS.SystemState;
|
||||||
using Ryujinx.Input;
|
using Ryujinx.Input;
|
||||||
using Ryujinx.Input.HLE;
|
using Ryujinx.Input.HLE;
|
||||||
@@ -50,6 +51,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -1332,6 +1334,18 @@ namespace Ryujinx.Ava
|
|||||||
|
|
||||||
_viewModel.Volume = Device.GetVolume();
|
_viewModel.Volume = Device.GetVolume();
|
||||||
break;
|
break;
|
||||||
|
case KeyboardHotkeyState.CycleControllersPlayer1:
|
||||||
|
case KeyboardHotkeyState.CycleControllersPlayer2:
|
||||||
|
case KeyboardHotkeyState.CycleControllersPlayer3:
|
||||||
|
case KeyboardHotkeyState.CycleControllersPlayer4:
|
||||||
|
case KeyboardHotkeyState.CycleControllersPlayer5:
|
||||||
|
case KeyboardHotkeyState.CycleControllersPlayer6:
|
||||||
|
case KeyboardHotkeyState.CycleControllersPlayer7:
|
||||||
|
case KeyboardHotkeyState.CycleControllersPlayer8:
|
||||||
|
var player = currentHotkeyState - KeyboardHotkeyState.CycleControllersPlayer1;
|
||||||
|
var ivm = new UI.ViewModels.Input.InputViewModel();
|
||||||
|
Dispatcher.UIThread.Invoke(() => ivm.CyclePlayerDevice(player));
|
||||||
|
break;
|
||||||
case KeyboardHotkeyState.None:
|
case KeyboardHotkeyState.None:
|
||||||
(_keyboardInterface as AvaloniaKeyboard).Clear();
|
(_keyboardInterface as AvaloniaKeyboard).Clear();
|
||||||
break;
|
break;
|
||||||
@@ -1414,6 +1428,15 @@ namespace Ryujinx.Ava
|
|||||||
state = KeyboardHotkeyState.CustomVSyncIntervalDecrement;
|
state = KeyboardHotkeyState.CustomVSyncIntervalDecrement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var cycle in ConfigurationState.Instance.Hid.Hotkeys.Value.CycleControllers?.Select((value, index) => (value, index)) ?? [])
|
||||||
|
{
|
||||||
|
if (_keyboardInterface.IsPressed((Key)cycle.value))
|
||||||
|
{
|
||||||
|
state = KeyboardHotkeyState.CycleControllersPlayer1 + cycle.index;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
xmlns:ryu="clr-namespace:Ryujinx.Ava">
|
|
||||||
<ResourceDictionary.ThemeDictionaries>
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceDictionary x:Key="Default">
|
<ResourceDictionary x:Key="Default">
|
||||||
<SolidColorBrush x:Key="DataGridSelectionBackgroundBrush"
|
<SolidColorBrush x:Key="DataGridSelectionBackgroundBrush"
|
||||||
@@ -53,22 +52,5 @@
|
|||||||
<Color x:Key="Unbounded">#FFFF4554</Color>
|
<Color x:Key="Unbounded">#FFFF4554</Color>
|
||||||
<Color x:Key="Custom">#6483F5</Color>
|
<Color x:Key="Custom">#6483F5</Color>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
<ResourceDictionary x:Key="{x:Static ryu:RyujinxApp.AmoledThemeVariant}">
|
|
||||||
<SolidColorBrush x:Key="DataGridSelectionBackgroundBrush"
|
|
||||||
Color="{DynamicResource DataGridSelectionColor}" />
|
|
||||||
<Color x:Key="ControlFillColorSecondary">#008AA8</Color>
|
|
||||||
<Color x:Key="DataGridSelectionColor">#FF00FABB</Color>
|
|
||||||
<Color x:Key="ThemeContentBackgroundColor">#FF000000</Color>
|
|
||||||
<Color x:Key="ThemeControlBorderColor">#2D000000</Color>
|
|
||||||
<Color x:Key="ThemeForegroundColor">#FFFFFFFF</Color>
|
|
||||||
<Color x:Key="MenuFlyoutPresenterBorderColor">#79000000</Color>
|
|
||||||
<Color x:Key="AppListBackgroundColor">#50000000</Color>
|
|
||||||
<Color x:Key="AppListHoverBackgroundColor">#40000000</Color>
|
|
||||||
<Color x:Key="SecondaryTextColor">#A0FFFFFF</Color>
|
|
||||||
<Color x:Key="FavoriteApplicationIconColor">#fffcd12a</Color>
|
|
||||||
<Color x:Key="Switch">#FF2EEAC9</Color>
|
|
||||||
<Color x:Key="Unbounded">#FFFF4554</Color>
|
|
||||||
<Color x:Key="Custom">#6483F5</Color>
|
|
||||||
</ResourceDictionary>
|
|
||||||
</ResourceDictionary.ThemeDictionaries>
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
@@ -4989,6 +4989,30 @@
|
|||||||
"zh_TW": "啟用警告日誌"
|
"zh_TW": "啟用警告日誌"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ID": "SettingsTabHotkeysCycleControllers",
|
||||||
|
"Translations": {
|
||||||
|
"ar_SA": "",
|
||||||
|
"de_DE": "",
|
||||||
|
"el_GR": "",
|
||||||
|
"en_US": "Cycle Controllers",
|
||||||
|
"es_ES": "",
|
||||||
|
"fr_FR": "",
|
||||||
|
"he_IL": "",
|
||||||
|
"it_IT": "",
|
||||||
|
"ja_JP": "",
|
||||||
|
"ko_KR": "",
|
||||||
|
"no_NO": "",
|
||||||
|
"pl_PL": "",
|
||||||
|
"pt_BR": "",
|
||||||
|
"ru_RU": "",
|
||||||
|
"th_TH": "",
|
||||||
|
"tr_TR": "",
|
||||||
|
"uk_UA": "",
|
||||||
|
"zh_CN": "",
|
||||||
|
"zh_TW": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"ID": "SettingsTabLoggingEnableErrorLogs",
|
"ID": "SettingsTabLoggingEnableErrorLogs",
|
||||||
"Translations": {
|
"Translations": {
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ namespace Ryujinx.Ava.Common
|
|||||||
var cancellationToken = new CancellationTokenSource();
|
var cancellationToken = new CancellationTokenSource();
|
||||||
|
|
||||||
UpdateWaitWindow waitingDialog = new(
|
UpdateWaitWindow waitingDialog = new(
|
||||||
RyujinxApp.FormatTitle(LocaleKeys.DialogNcaExtractionTitle),
|
App.FormatTitle(LocaleKeys.DialogNcaExtractionTitle),
|
||||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogNcaExtractionMessage, ncaSectionType, Path.GetFileName(titleFilePath)),
|
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogNcaExtractionMessage, ncaSectionType, Path.GetFileName(titleFilePath)),
|
||||||
cancellationToken);
|
cancellationToken);
|
||||||
|
|
||||||
@@ -268,9 +268,10 @@ namespace Ryujinx.Ava.Common
|
|||||||
{
|
{
|
||||||
Dispatcher.UIThread.Post(waitingDialog.Close);
|
Dispatcher.UIThread.Post(waitingDialog.Close);
|
||||||
|
|
||||||
NotificationHelper.ShowInformation(
|
NotificationHelper.Show(
|
||||||
RyujinxApp.FormatTitle(LocaleKeys.DialogNcaExtractionTitle),
|
App.FormatTitle(LocaleKeys.DialogNcaExtractionTitle),
|
||||||
$"{titleName}\n\n{LocaleManager.Instance[LocaleKeys.DialogNcaExtractionSuccessMessage]}");
|
$"{titleName}\n\n{LocaleManager.Instance[LocaleKeys.DialogNcaExtractionSuccessMessage]}",
|
||||||
|
NotificationType.Information);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,5 +14,13 @@ namespace Ryujinx.Ava.Common
|
|||||||
VolumeDown,
|
VolumeDown,
|
||||||
CustomVSyncIntervalIncrement,
|
CustomVSyncIntervalIncrement,
|
||||||
CustomVSyncIntervalDecrement,
|
CustomVSyncIntervalDecrement,
|
||||||
|
CycleControllersPlayer1,
|
||||||
|
CycleControllersPlayer2,
|
||||||
|
CycleControllersPlayer3,
|
||||||
|
CycleControllersPlayer4,
|
||||||
|
CycleControllersPlayer5,
|
||||||
|
CycleControllersPlayer6,
|
||||||
|
CycleControllersPlayer7,
|
||||||
|
CycleControllersPlayer8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ namespace Ryujinx.Ava
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static AppBuilder BuildAvaloniaApp() =>
|
public static AppBuilder BuildAvaloniaApp() =>
|
||||||
AppBuilder.Configure<RyujinxApp>()
|
AppBuilder.Configure<App>()
|
||||||
.UsePlatformDetect()
|
.UsePlatformDetect()
|
||||||
.With(new X11PlatformOptions
|
.With(new X11PlatformOptions
|
||||||
{
|
{
|
||||||
@@ -100,7 +100,7 @@ namespace Ryujinx.Ava
|
|||||||
// Delete backup files after updating.
|
// Delete backup files after updating.
|
||||||
Task.Run(Updater.CleanupUpdate);
|
Task.Run(Updater.CleanupUpdate);
|
||||||
|
|
||||||
Console.Title = $"{RyujinxApp.FullAppName} Console {Version}";
|
Console.Title = $"{App.FullAppName} Console {Version}";
|
||||||
|
|
||||||
// Hook unhandled exception and process exit events.
|
// Hook unhandled exception and process exit events.
|
||||||
AppDomain.CurrentDomain.UnhandledException += (sender, e)
|
AppDomain.CurrentDomain.UnhandledException += (sender, e)
|
||||||
@@ -225,7 +225,7 @@ namespace Ryujinx.Ava
|
|||||||
|
|
||||||
private static void PrintSystemInfo()
|
private static void PrintSystemInfo()
|
||||||
{
|
{
|
||||||
Logger.Notice.Print(LogClass.Application, $"{RyujinxApp.FullAppName} Version: {Version}");
|
Logger.Notice.Print(LogClass.Application, $"{App.FullAppName} Version: {Version}");
|
||||||
SystemInfo.Gather().Print();
|
SystemInfo.Gather().Print();
|
||||||
|
|
||||||
var enabledLogLevels = Logger.GetEnabledLevels().ToArray();
|
var enabledLogLevels = Logger.GetEnabledLevels().ToArray();
|
||||||
|
|||||||
@@ -55,7 +55,6 @@
|
|||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
ClipToBounds="True"
|
ClipToBounds="True"
|
||||||
Background="{DynamicResource ThemeControlBorderColor}"
|
|
||||||
CornerRadius="5">
|
CornerRadius="5">
|
||||||
<Grid ColumnDefinitions="Auto,10,*,150,100">
|
<Grid ColumnDefinitions="Auto,10,*,150,100">
|
||||||
<Image
|
<Image
|
||||||
@@ -102,22 +101,11 @@
|
|||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="5">
|
Spacing="5">
|
||||||
<Button
|
<TextBlock
|
||||||
Click="IdString_OnClick"
|
HorizontalAlignment="Stretch"
|
||||||
HorizontalContentAlignment="Left"
|
Text="{Binding IdString}"
|
||||||
VerticalAlignment="Center"
|
TextAlignment="Start"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
Background="{DynamicResource AppListBackgroundColor}"
|
|
||||||
Margin="-1, 0, 0, 0"
|
|
||||||
Padding="0" >
|
|
||||||
<TextBlock
|
|
||||||
Margin="1.5"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Text="{Binding IdString}"
|
|
||||||
Tag="{Binding Id}"
|
|
||||||
TextAlignment="Start"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
</Button>
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Text="{Binding FileExtension}"
|
Text="{Binding FileExtension}"
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Notifications;
|
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using FluentAvalonia.UI.Controls;
|
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.ViewModels;
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
using Ryujinx.UI.App.Common;
|
using Ryujinx.UI.App.Common;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Controls
|
namespace Ryujinx.Ava.UI.Controls
|
||||||
{
|
{
|
||||||
@@ -35,27 +32,5 @@ namespace Ryujinx.Ava.UI.Controls
|
|||||||
if (DataContext is MainWindowViewModel viewModel && sender is ListBox { SelectedItem: ApplicationData selected })
|
if (DataContext is MainWindowViewModel viewModel && sender is ListBox { SelectedItem: ApplicationData selected })
|
||||||
viewModel.ListSelectedApplication = selected;
|
viewModel.ListSelectedApplication = selected;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void IdString_OnClick(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (DataContext is not MainWindowViewModel mwvm)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (sender is not Button { Content: TextBlock idText })
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!RyujinxApp.IsClipboardAvailable(out var clipboard))
|
|
||||||
return;
|
|
||||||
|
|
||||||
var appData = mwvm.Applications.FirstOrDefault(it => it.IdString == idText.Text);
|
|
||||||
if (appData is null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await clipboard.SetTextAsync(appData.IdString);
|
|
||||||
|
|
||||||
NotificationHelper.ShowInformation(
|
|
||||||
"Copied Title ID",
|
|
||||||
$"{appData.Name} ({appData.IdString})");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,46 +62,9 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||||||
_notifications.Add(new Notification(title, text, type, delay, onClick, onClose));
|
_notifications.Add(new Notification(title, text, type, delay, onClick, onClose));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ShowError(string message) =>
|
public static void ShowError(string message)
|
||||||
ShowError(
|
{
|
||||||
LocaleManager.Instance[LocaleKeys.DialogErrorTitle],
|
Show(LocaleManager.Instance[LocaleKeys.DialogErrorTitle], $"{LocaleManager.Instance[LocaleKeys.DialogErrorMessage]}\n\n{message}", NotificationType.Error);
|
||||||
$"{LocaleManager.Instance[LocaleKeys.DialogErrorMessage]}\n\n{message}"
|
}
|
||||||
);
|
|
||||||
|
|
||||||
public static void ShowInformation(string title, string text, bool waitingExit = false, Action onClick = null, Action onClose = null) =>
|
|
||||||
Show(
|
|
||||||
title,
|
|
||||||
text,
|
|
||||||
NotificationType.Information,
|
|
||||||
waitingExit,
|
|
||||||
onClick,
|
|
||||||
onClose);
|
|
||||||
|
|
||||||
public static void ShowSuccess(string title, string text, bool waitingExit = false, Action onClick = null, Action onClose = null) =>
|
|
||||||
Show(
|
|
||||||
title,
|
|
||||||
text,
|
|
||||||
NotificationType.Success,
|
|
||||||
waitingExit,
|
|
||||||
onClick,
|
|
||||||
onClose);
|
|
||||||
|
|
||||||
public static void ShowWarning(string title, string text, bool waitingExit = false, Action onClick = null, Action onClose = null) =>
|
|
||||||
Show(
|
|
||||||
title,
|
|
||||||
text,
|
|
||||||
NotificationType.Warning,
|
|
||||||
waitingExit,
|
|
||||||
onClick,
|
|
||||||
onClose);
|
|
||||||
|
|
||||||
public static void ShowError(string title, string text, bool waitingExit = false, Action onClick = null, Action onClose = null) =>
|
|
||||||
Show(
|
|
||||||
title,
|
|
||||||
text,
|
|
||||||
NotificationType.Error,
|
|
||||||
waitingExit,
|
|
||||||
onClick,
|
|
||||||
onClose);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
|
using DynamicData;
|
||||||
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.ViewModels;
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
using Ryujinx.Common.Configuration.Hid;
|
using Ryujinx.Common.Configuration.Hid;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Models.Input
|
namespace Ryujinx.Ava.UI.Models.Input
|
||||||
{
|
{
|
||||||
@@ -126,8 +131,15 @@ namespace Ryujinx.Ava.UI.Models.Input
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ObservableCollection<CycleController> CycleControllers { get; set; } = new ObservableCollection<CycleController>();
|
||||||
|
public ICommand AddCycleController { get; set; }
|
||||||
|
public ICommand RemoveCycleController { get; set; }
|
||||||
|
public bool CanRemoveCycleController => CycleControllers.Count > 0 && CycleControllers.Count < 8;
|
||||||
|
|
||||||
public HotkeyConfig(KeyboardHotkeys config)
|
public HotkeyConfig(KeyboardHotkeys config)
|
||||||
{
|
{
|
||||||
|
AddCycleController = MiniCommand.Create(() => CycleControllers.Add(new CycleController(CycleControllers.Count + 1, Key.Unbound)));
|
||||||
|
RemoveCycleController = MiniCommand.Create(() => CycleControllers.Remove(CycleControllers.Last()));
|
||||||
if (config != null)
|
if (config != null)
|
||||||
{
|
{
|
||||||
ToggleVSyncMode = config.ToggleVSyncMode;
|
ToggleVSyncMode = config.ToggleVSyncMode;
|
||||||
@@ -141,7 +153,9 @@ namespace Ryujinx.Ava.UI.Models.Input
|
|||||||
VolumeDown = config.VolumeDown;
|
VolumeDown = config.VolumeDown;
|
||||||
CustomVSyncIntervalIncrement = config.CustomVSyncIntervalIncrement;
|
CustomVSyncIntervalIncrement = config.CustomVSyncIntervalIncrement;
|
||||||
CustomVSyncIntervalDecrement = config.CustomVSyncIntervalDecrement;
|
CustomVSyncIntervalDecrement = config.CustomVSyncIntervalDecrement;
|
||||||
|
CycleControllers.AddRange((config.CycleControllers ?? []).Select((x, i) => new CycleController(i + 1, x)));
|
||||||
}
|
}
|
||||||
|
CycleControllers.CollectionChanged += (sender, e) => OnPropertyChanged(nameof(CanRemoveCycleController));
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeyboardHotkeys GetConfig()
|
public KeyboardHotkeys GetConfig()
|
||||||
@@ -159,6 +173,7 @@ namespace Ryujinx.Ava.UI.Models.Input
|
|||||||
VolumeDown = VolumeDown,
|
VolumeDown = VolumeDown,
|
||||||
CustomVSyncIntervalIncrement = CustomVSyncIntervalIncrement,
|
CustomVSyncIntervalIncrement = CustomVSyncIntervalIncrement,
|
||||||
CustomVSyncIntervalDecrement = CustomVSyncIntervalDecrement,
|
CustomVSyncIntervalDecrement = CustomVSyncIntervalDecrement,
|
||||||
|
CycleControllers = CycleControllers.Select(x => x.Hotkey).ToList()
|
||||||
};
|
};
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
public AboutWindowViewModel()
|
public AboutWindowViewModel()
|
||||||
{
|
{
|
||||||
Version = RyujinxApp.FullAppName + "\n" + Program.Version;
|
Version = App.FullAppName + "\n" + Program.Version;
|
||||||
UpdateLogoTheme(ConfigurationState.Instance.UI.BaseStyle.Value);
|
UpdateLogoTheme(ConfigurationState.Instance.UI.BaseStyle.Value);
|
||||||
|
|
||||||
ThemeManager.ThemeChanged += ThemeManager_ThemeChanged;
|
ThemeManager.ThemeChanged += ThemeManager_ThemeChanged;
|
||||||
@@ -64,7 +64,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
private void UpdateLogoTheme(string theme)
|
private void UpdateLogoTheme(string theme)
|
||||||
{
|
{
|
||||||
bool isDarkTheme = theme == "Dark" || (theme == "Auto" && RyujinxApp.DetectSystemTheme() == ThemeVariant.Dark);
|
bool isDarkTheme = theme == "Dark" || (theme == "Auto" && App.DetectSystemTheme() == ThemeVariant.Dark);
|
||||||
|
|
||||||
string basePath = "resm:Ryujinx.UI.Common.Resources.";
|
string basePath = "resm:Ryujinx.UI.Common.Resources.";
|
||||||
string themeSuffix = isDarkTheme ? "Dark.png" : "Light.png";
|
string themeSuffix = isDarkTheme ? "Dark.png" : "Light.png";
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
using Ryujinx.Ava.Common.Locale;
|
||||||
|
using Ryujinx.Common.Configuration.Hid;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
{
|
||||||
|
public class CycleController : BaseModel
|
||||||
|
{
|
||||||
|
private string _player;
|
||||||
|
private Key _hotkey;
|
||||||
|
|
||||||
|
public string Player
|
||||||
|
{
|
||||||
|
get => _player;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_player = value;
|
||||||
|
OnPropertyChanged(nameof(Player));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Key Hotkey
|
||||||
|
{
|
||||||
|
get => _hotkey;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_hotkey = value;
|
||||||
|
OnPropertyChanged(nameof(Hotkey));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public CycleController(int v, Key x)
|
||||||
|
{
|
||||||
|
Player = v switch
|
||||||
|
{
|
||||||
|
1 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer1],
|
||||||
|
2 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer2],
|
||||||
|
3 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer3],
|
||||||
|
4 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer4],
|
||||||
|
5 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer5],
|
||||||
|
6 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer6],
|
||||||
|
7 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer7],
|
||||||
|
8 => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer8],
|
||||||
|
_ => LocaleManager.Instance[LocaleKeys.ControllerSettingsPlayer] + " " + v
|
||||||
|
};
|
||||||
|
Hotkey = x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -266,6 +266,10 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
|
|
||||||
public InputViewModel()
|
public InputViewModel()
|
||||||
{
|
{
|
||||||
|
_mainWindow =
|
||||||
|
(MainWindow)((IClassicDesktopStyleApplicationLifetime)Application.Current
|
||||||
|
.ApplicationLifetime).MainWindow;
|
||||||
|
AvaloniaKeyboardDriver = new AvaloniaKeyboardDriver(_mainWindow);
|
||||||
PlayerIndexes = new ObservableCollection<PlayerModel>();
|
PlayerIndexes = new ObservableCollection<PlayerModel>();
|
||||||
Controllers = new ObservableCollection<ControllerModel>();
|
Controllers = new ObservableCollection<ControllerModel>();
|
||||||
Devices = new ObservableCollection<(DeviceType Type, string Id, string Name)>();
|
Devices = new ObservableCollection<(DeviceType Type, string Id, string Name)>();
|
||||||
@@ -754,38 +758,34 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
bool validFileName = ProfileName.IndexOfAny(Path.GetInvalidFileNameChars()) == -1;
|
||||||
|
|
||||||
|
if (!validFileName)
|
||||||
{
|
{
|
||||||
bool validFileName = ProfileName.IndexOfAny(Path.GetInvalidFileNameChars()) == -1;
|
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogProfileInvalidProfileNameErrorMessage]);
|
||||||
|
return;
|
||||||
if (validFileName)
|
|
||||||
{
|
|
||||||
string path = Path.Combine(GetProfileBasePath(), ProfileName + ".json");
|
|
||||||
|
|
||||||
InputConfig config = null;
|
|
||||||
|
|
||||||
if (IsKeyboard)
|
|
||||||
{
|
|
||||||
config = (ConfigViewModel as KeyboardInputViewModel).Config.GetConfig();
|
|
||||||
}
|
|
||||||
else if (IsController)
|
|
||||||
{
|
|
||||||
config = (ConfigViewModel as ControllerInputViewModel).Config.GetConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
config.ControllerType = Controllers[_controller].Type;
|
|
||||||
|
|
||||||
string jsonString = JsonHelper.Serialize(config, _serializerContext.InputConfig);
|
|
||||||
|
|
||||||
await File.WriteAllTextAsync(path, jsonString);
|
|
||||||
|
|
||||||
LoadProfiles();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogProfileInvalidProfileNameErrorMessage]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
string path = Path.Combine(GetProfileBasePath(), ProfileName + ".json");
|
||||||
|
|
||||||
|
InputConfig config = null;
|
||||||
|
|
||||||
|
if (IsKeyboard)
|
||||||
|
{
|
||||||
|
config = (ConfigViewModel as KeyboardInputViewModel).Config.GetConfig();
|
||||||
|
}
|
||||||
|
else if (IsController)
|
||||||
|
{
|
||||||
|
config = (ConfigViewModel as ControllerInputViewModel).Config.GetConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
config.ControllerType = Controllers[_controller].Type;
|
||||||
|
|
||||||
|
string jsonString = JsonHelper.Serialize(config, _serializerContext.InputConfig);
|
||||||
|
|
||||||
|
await File.WriteAllTextAsync(path, jsonString);
|
||||||
|
|
||||||
|
LoadProfiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void RemoveProfile()
|
public async void RemoveProfile()
|
||||||
@@ -899,5 +899,13 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
|
|
||||||
AvaloniaKeyboardDriver.Dispose();
|
AvaloniaKeyboardDriver.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void CyclePlayerDevice(int player)
|
||||||
|
{
|
||||||
|
LoadDevices();
|
||||||
|
PlayerId = (PlayerIndex)player;
|
||||||
|
Device = (Device + 1) % Devices.Count;
|
||||||
|
Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2051,7 +2051,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
Dispatcher.UIThread.InvokeAsync(() =>
|
Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
Title = RyujinxApp.FormatTitle();
|
Title = App.FormatTitle();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -547,7 +547,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
"Auto" => 0,
|
"Auto" => 0,
|
||||||
"Light" => 1,
|
"Light" => 1,
|
||||||
"Dark" => 2,
|
"Dark" => 2,
|
||||||
"AMOLED" => 3,
|
|
||||||
_ => 0
|
_ => 0
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -657,7 +656,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
0 => "Auto",
|
0 => "Auto",
|
||||||
1 => "Light",
|
1 => "Light",
|
||||||
2 => "Dark",
|
2 => "Dark",
|
||||||
3 => "AMOLED",
|
|
||||||
_ => "Auto"
|
_ => "Auto"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsHotkeysView"
|
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsHotkeysView"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
@@ -18,17 +18,18 @@
|
|||||||
<helpers:KeyValueConverter x:Key="Key" />
|
<helpers:KeyValueConverter x:Key="Key" />
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<UserControl.Styles>
|
<UserControl.Styles>
|
||||||
<Style Selector="StackPanel > StackPanel">
|
<Style Selector="StackPanel StackPanel">
|
||||||
<Setter Property="Margin" Value="10, 0, 0, 0" />
|
<Setter Property="Margin" Value="10, 0, 0, 0" />
|
||||||
<Setter Property="Orientation" Value="Horizontal" />
|
<Setter Property="Orientation" Value="Horizontal" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="StackPanel > StackPanel > TextBlock">
|
<Style Selector="StackPanel StackPanel > TextBlock">
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
<Setter Property="Width" Value="230" />
|
<Setter Property="Width" Value="230" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="ToggleButton">
|
<Style Selector="ToggleButton, Button">
|
||||||
<Setter Property="Width" Value="90" />
|
<Setter Property="Width" Value="90" />
|
||||||
<Setter Property="Height" Value="27" />
|
<Setter Property="Height" Value="27" />
|
||||||
|
<Setter Property="Padding" Value="0,5,0,5" /> <!-- Added vertical padding -->
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="ToggleButton > TextBlock">
|
<Style Selector="ToggleButton > TextBlock">
|
||||||
<Setter Property="TextAlignment" Value="Center" />
|
<Setter Property="TextAlignment" Value="Center" />
|
||||||
@@ -42,79 +43,123 @@
|
|||||||
VerticalScrollBarVisibility="Auto">
|
VerticalScrollBarVisibility="Auto">
|
||||||
<Border Classes="settings">
|
<Border Classes="settings">
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Name="SettingButtons"
|
|
||||||
Margin="10"
|
Margin="10"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="10">
|
Spacing="10"
|
||||||
|
Name="SettingButtons">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Classes="h1"
|
Classes="h1"
|
||||||
Text="{ext:Locale SettingsTabHotkeysHotkeys}" />
|
Text="{ext:Locale SettingsTabHotkeysHotkeys}" />
|
||||||
<StackPanel>
|
<StackPanel
|
||||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysToggleVSyncModeHotkey}" />
|
Margin="10,0,0,0"
|
||||||
<ToggleButton Name="ToggleVSyncMode">
|
Spacing="10"
|
||||||
<TextBlock Text="{Binding KeyboardHotkey.ToggleVSyncMode, Converter={StaticResource Key}}" />
|
Orientation="Vertical">
|
||||||
</ToggleButton>
|
<StackPanel>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabHotkeysToggleVSyncModeHotkey}" />
|
||||||
|
<ToggleButton Name="ToggleVSyncMode">
|
||||||
|
<TextBlock Text="{Binding KeyboardHotkey.ToggleVSyncMode, Converter={StaticResource Key}}" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabHotkeysScreenshotHotkey}" />
|
||||||
|
<ToggleButton Name="Screenshot">
|
||||||
|
<TextBlock Text="{Binding KeyboardHotkey.Screenshot, Converter={StaticResource Key}}" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabHotkeysShowUiHotkey}" />
|
||||||
|
<ToggleButton Name="ShowUI">
|
||||||
|
<TextBlock Text="{Binding KeyboardHotkey.ShowUI, Converter={StaticResource Key}}" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabHotkeysPauseHotkey}" />
|
||||||
|
<ToggleButton Name="Pause">
|
||||||
|
<TextBlock Text="{Binding KeyboardHotkey.Pause, Converter={StaticResource Key}}" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabHotkeysToggleMuteHotkey}" />
|
||||||
|
<ToggleButton Name="ToggleMute">
|
||||||
|
<TextBlock Text="{Binding KeyboardHotkey.ToggleMute, Converter={StaticResource Key}}" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabHotkeysResScaleUpHotkey}" />
|
||||||
|
<ToggleButton Name="ResScaleUp">
|
||||||
|
<TextBlock Text="{Binding KeyboardHotkey.ResScaleUp, Converter={StaticResource Key}}" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabHotkeysResScaleDownHotkey}" />
|
||||||
|
<ToggleButton Name="ResScaleDown">
|
||||||
|
<TextBlock Text="{Binding KeyboardHotkey.ResScaleDown, Converter={StaticResource Key}}" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabHotkeysVolumeUpHotkey}" />
|
||||||
|
<ToggleButton Name="VolumeUp">
|
||||||
|
<TextBlock Text="{Binding KeyboardHotkey.VolumeUp, Converter={StaticResource Key}}" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabHotkeysVolumeDownHotkey}" />
|
||||||
|
<ToggleButton Name="VolumeDown">
|
||||||
|
<TextBlock Text="{Binding KeyboardHotkey.VolumeDown, Converter={StaticResource Key}}" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabHotkeysIncrementCustomVSyncIntervalHotkey}" />
|
||||||
|
<ToggleButton Name="CustomVSyncIntervalIncrement">
|
||||||
|
<TextBlock Text="{Binding KeyboardHotkey.CustomVSyncIntervalIncrement, Converter={StaticResource Key}}" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabHotkeysDecrementCustomVSyncIntervalHotkey}" />
|
||||||
|
<ToggleButton Name="CustomVSyncIntervalDecrement">
|
||||||
|
<TextBlock Text="{Binding KeyboardHotkey.CustomVSyncIntervalDecrement, Converter={StaticResource Key}}" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel>
|
<Separator Height="1" />
|
||||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysScreenshotHotkey}" />
|
<StackPanel Margin="0">
|
||||||
<ToggleButton Name="Screenshot">
|
<TextBlock
|
||||||
<TextBlock Text="{Binding KeyboardHotkey.Screenshot, Converter={StaticResource Key}}" />
|
Classes="h1"
|
||||||
</ToggleButton>
|
Text="{ext:Locale SettingsTabHotkeysCycleControllers}" />
|
||||||
</StackPanel>
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
||||||
<StackPanel>
|
<Button
|
||||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysShowUiHotkey}" />
|
Content="{ext:Locale SettingsTabGeneralAdd}"
|
||||||
<ToggleButton Name="ShowUI">
|
Margin="10,0,0,0"
|
||||||
<TextBlock Text="{Binding KeyboardHotkey.ShowUI, Converter={StaticResource Key}}" />
|
Command="{Binding KeyboardHotkey.AddCycleController}" />
|
||||||
</ToggleButton>
|
<Button
|
||||||
</StackPanel>
|
Content="{ext:Locale SettingsTabGeneralRemove}"
|
||||||
<StackPanel>
|
IsEnabled="{Binding KeyboardHotkey.CanRemoveCycleController}"
|
||||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysPauseHotkey}" />
|
Command="{Binding KeyboardHotkey.RemoveCycleController}" />
|
||||||
<ToggleButton Name="Pause">
|
</StackPanel>
|
||||||
<TextBlock Text="{Binding KeyboardHotkey.Pause, Converter={StaticResource Key}}" />
|
|
||||||
</ToggleButton>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysToggleMuteHotkey}" />
|
|
||||||
<ToggleButton Name="ToggleMute">
|
|
||||||
<TextBlock Text="{Binding KeyboardHotkey.ToggleMute, Converter={StaticResource Key}}" />
|
|
||||||
</ToggleButton>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysResScaleUpHotkey}" />
|
|
||||||
<ToggleButton Name="ResScaleUp">
|
|
||||||
<TextBlock Text="{Binding KeyboardHotkey.ResScaleUp, Converter={StaticResource Key}}" />
|
|
||||||
</ToggleButton>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysResScaleDownHotkey}" />
|
|
||||||
<ToggleButton Name="ResScaleDown">
|
|
||||||
<TextBlock Text="{Binding KeyboardHotkey.ResScaleDown, Converter={StaticResource Key}}" />
|
|
||||||
</ToggleButton>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysVolumeUpHotkey}" />
|
|
||||||
<ToggleButton Name="VolumeUp">
|
|
||||||
<TextBlock Text="{Binding KeyboardHotkey.VolumeUp, Converter={StaticResource Key}}" />
|
|
||||||
</ToggleButton>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysVolumeDownHotkey}" />
|
|
||||||
<ToggleButton Name="VolumeDown">
|
|
||||||
<TextBlock Text="{Binding KeyboardHotkey.VolumeDown, Converter={StaticResource Key}}" />
|
|
||||||
</ToggleButton>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysIncrementCustomVSyncIntervalHotkey}" />
|
|
||||||
<ToggleButton Name="CustomVSyncIntervalIncrement">
|
|
||||||
<TextBlock Text="{Binding KeyboardHotkey.CustomVSyncIntervalIncrement, Converter={StaticResource Key}}" />
|
|
||||||
</ToggleButton>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysDecrementCustomVSyncIntervalHotkey}" />
|
|
||||||
<ToggleButton Name="CustomVSyncIntervalDecrement">
|
|
||||||
<TextBlock Text="{Binding KeyboardHotkey.CustomVSyncIntervalDecrement, Converter={StaticResource Key}}" />
|
|
||||||
</ToggleButton>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<ItemsControl ItemsSource="{Binding KeyboardHotkey.CycleControllers}"
|
||||||
|
Name="CycleControllers">
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<StackPanel
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
Orientation="Vertical"
|
||||||
|
Spacing="10" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{Binding Player}" />
|
||||||
|
<ToggleButton>
|
||||||
|
<TextBlock
|
||||||
|
Text="{Binding Hotkey, Converter={StaticResource Key}}" />
|
||||||
|
</ToggleButton>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|||||||
@@ -3,11 +3,17 @@ using Avalonia.Controls.Primitives;
|
|||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.LogicalTree;
|
using Avalonia.LogicalTree;
|
||||||
|
using Avalonia.VisualTree;
|
||||||
|
using DynamicData.Kernel;
|
||||||
|
using FluentAvalonia.Core;
|
||||||
using Ryujinx.Ava.Input;
|
using Ryujinx.Ava.Input;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.ViewModels;
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
using Ryujinx.Input;
|
using Ryujinx.Input;
|
||||||
using Ryujinx.Input.Assigner;
|
using Ryujinx.Input.Assigner;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Specialized;
|
||||||
|
using System.Linq;
|
||||||
using Key = Ryujinx.Common.Configuration.Hid.Key;
|
using Key = Ryujinx.Common.Configuration.Hid.Key;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Views.Settings
|
namespace Ryujinx.Ava.UI.Views.Settings
|
||||||
@@ -20,16 +26,21 @@ namespace Ryujinx.Ava.UI.Views.Settings
|
|||||||
public SettingsHotkeysView()
|
public SettingsHotkeysView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
RegisterEvents();
|
||||||
|
_avaloniaKeyboardDriver = new AvaloniaKeyboardDriver(this);
|
||||||
|
CycleControllers.LayoutUpdated += (_, _1) => RegisterEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RegisterEvents()
|
||||||
|
{
|
||||||
foreach (ILogical visual in SettingButtons.GetLogicalDescendants())
|
foreach (ILogical visual in SettingButtons.GetLogicalDescendants())
|
||||||
{
|
{
|
||||||
if (visual is ToggleButton button and not CheckBox)
|
if (visual is ToggleButton button and not CheckBox)
|
||||||
{
|
{
|
||||||
|
button.IsCheckedChanged -= Button_IsCheckedChanged;
|
||||||
button.IsCheckedChanged += Button_IsCheckedChanged;
|
button.IsCheckedChanged += Button_IsCheckedChanged;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_avaloniaKeyboardDriver = new AvaloniaKeyboardDriver(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPointerReleased(PointerReleasedEventArgs e)
|
protected override void OnPointerReleased(PointerReleasedEventArgs e)
|
||||||
@@ -53,90 +64,96 @@ namespace Ryujinx.Ava.UI.Views.Settings
|
|||||||
|
|
||||||
private void Button_IsCheckedChanged(object sender, RoutedEventArgs e)
|
private void Button_IsCheckedChanged(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is ToggleButton button)
|
if (sender is not ToggleButton button)
|
||||||
{
|
{
|
||||||
if ((bool)button.IsChecked)
|
return;
|
||||||
{
|
|
||||||
if (_currentAssigner != null && button == _currentAssigner.ToggledButton)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_currentAssigner == null)
|
|
||||||
{
|
|
||||||
_currentAssigner = new ButtonKeyAssigner(button);
|
|
||||||
|
|
||||||
this.Focus(NavigationMethod.Pointer);
|
|
||||||
|
|
||||||
PointerPressed += MouseClick;
|
|
||||||
|
|
||||||
var keyboard = (IKeyboard)_avaloniaKeyboardDriver.GetGamepad("0");
|
|
||||||
IButtonAssigner assigner = new KeyboardKeyAssigner(keyboard);
|
|
||||||
|
|
||||||
_currentAssigner.ButtonAssigned += (sender, e) =>
|
|
||||||
{
|
|
||||||
if (e.ButtonValue.HasValue)
|
|
||||||
{
|
|
||||||
var viewModel = (DataContext) as SettingsViewModel;
|
|
||||||
var buttonValue = e.ButtonValue.Value;
|
|
||||||
|
|
||||||
switch (button.Name)
|
|
||||||
{
|
|
||||||
case "ToggleVSyncMode":
|
|
||||||
viewModel.KeyboardHotkey.ToggleVSyncMode = buttonValue.AsHidType<Key>();
|
|
||||||
break;
|
|
||||||
case "Screenshot":
|
|
||||||
viewModel.KeyboardHotkey.Screenshot = buttonValue.AsHidType<Key>();
|
|
||||||
break;
|
|
||||||
case "ShowUI":
|
|
||||||
viewModel.KeyboardHotkey.ShowUI = buttonValue.AsHidType<Key>();
|
|
||||||
break;
|
|
||||||
case "Pause":
|
|
||||||
viewModel.KeyboardHotkey.Pause = buttonValue.AsHidType<Key>();
|
|
||||||
break;
|
|
||||||
case "ToggleMute":
|
|
||||||
viewModel.KeyboardHotkey.ToggleMute = buttonValue.AsHidType<Key>();
|
|
||||||
break;
|
|
||||||
case "ResScaleUp":
|
|
||||||
viewModel.KeyboardHotkey.ResScaleUp = buttonValue.AsHidType<Key>();
|
|
||||||
break;
|
|
||||||
case "ResScaleDown":
|
|
||||||
viewModel.KeyboardHotkey.ResScaleDown = buttonValue.AsHidType<Key>();
|
|
||||||
break;
|
|
||||||
case "VolumeUp":
|
|
||||||
viewModel.KeyboardHotkey.VolumeUp = buttonValue.AsHidType<Key>();
|
|
||||||
break;
|
|
||||||
case "VolumeDown":
|
|
||||||
viewModel.KeyboardHotkey.VolumeDown = buttonValue.AsHidType<Key>();
|
|
||||||
break;
|
|
||||||
case "CustomVSyncIntervalIncrement":
|
|
||||||
viewModel.KeyboardHotkey.CustomVSyncIntervalIncrement = buttonValue.AsHidType<Key>();
|
|
||||||
break;
|
|
||||||
case "CustomVSyncIntervalDecrement":
|
|
||||||
viewModel.KeyboardHotkey.CustomVSyncIntervalDecrement = buttonValue.AsHidType<Key>();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
_currentAssigner.GetInputAndAssign(assigner, keyboard);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (_currentAssigner != null)
|
|
||||||
{
|
|
||||||
_currentAssigner.Cancel();
|
|
||||||
_currentAssigner = null;
|
|
||||||
button.IsChecked = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_currentAssigner?.Cancel();
|
|
||||||
_currentAssigner = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!button.IsChecked.ValueOr(default))
|
||||||
|
{
|
||||||
|
_currentAssigner?.Cancel();
|
||||||
|
_currentAssigner = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_currentAssigner != null && button == _currentAssigner.ToggledButton)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_currentAssigner != null)
|
||||||
|
{
|
||||||
|
_currentAssigner.Cancel();
|
||||||
|
_currentAssigner = null;
|
||||||
|
button.IsChecked = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentAssigner = new ButtonKeyAssigner(button);
|
||||||
|
|
||||||
|
this.Focus(NavigationMethod.Pointer);
|
||||||
|
|
||||||
|
PointerPressed += MouseClick;
|
||||||
|
|
||||||
|
var keyboard = (IKeyboard)_avaloniaKeyboardDriver.GetGamepad("0");
|
||||||
|
IButtonAssigner assigner = new KeyboardKeyAssigner(keyboard);
|
||||||
|
|
||||||
|
_currentAssigner.ButtonAssigned += (sender, e) =>
|
||||||
|
{
|
||||||
|
if (!e.ButtonValue.HasValue)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var viewModel = (DataContext) as SettingsViewModel;
|
||||||
|
var buttonValue = e.ButtonValue.Value;
|
||||||
|
|
||||||
|
switch (button.Name)
|
||||||
|
{
|
||||||
|
case "ToggleVSyncMode":
|
||||||
|
viewModel.KeyboardHotkey.ToggleVSyncMode = buttonValue.AsHidType<Key>();
|
||||||
|
break;
|
||||||
|
case "Screenshot":
|
||||||
|
viewModel.KeyboardHotkey.Screenshot = buttonValue.AsHidType<Key>();
|
||||||
|
break;
|
||||||
|
case "ShowUI":
|
||||||
|
viewModel.KeyboardHotkey.ShowUI = buttonValue.AsHidType<Key>();
|
||||||
|
break;
|
||||||
|
case "Pause":
|
||||||
|
viewModel.KeyboardHotkey.Pause = buttonValue.AsHidType<Key>();
|
||||||
|
break;
|
||||||
|
case "ToggleMute":
|
||||||
|
viewModel.KeyboardHotkey.ToggleMute = buttonValue.AsHidType<Key>();
|
||||||
|
break;
|
||||||
|
case "ResScaleUp":
|
||||||
|
viewModel.KeyboardHotkey.ResScaleUp = buttonValue.AsHidType<Key>();
|
||||||
|
break;
|
||||||
|
case "ResScaleDown":
|
||||||
|
viewModel.KeyboardHotkey.ResScaleDown = buttonValue.AsHidType<Key>();
|
||||||
|
break;
|
||||||
|
case "VolumeUp":
|
||||||
|
viewModel.KeyboardHotkey.VolumeUp = buttonValue.AsHidType<Key>();
|
||||||
|
break;
|
||||||
|
case "VolumeDown":
|
||||||
|
viewModel.KeyboardHotkey.VolumeDown = buttonValue.AsHidType<Key>();
|
||||||
|
break;
|
||||||
|
case "CustomVSyncIntervalIncrement":
|
||||||
|
viewModel.KeyboardHotkey.CustomVSyncIntervalIncrement = buttonValue.AsHidType<Key>();
|
||||||
|
break;
|
||||||
|
case "CustomVSyncIntervalDecrement":
|
||||||
|
viewModel.KeyboardHotkey.CustomVSyncIntervalDecrement = buttonValue.AsHidType<Key>();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
var index = button.FindAncestorOfType<ItemsControl>().GetLogicalDescendants().OfType<ToggleButton>().IndexOf(button);
|
||||||
|
if (index >= 0 && viewModel.KeyboardHotkey.CycleControllers != null)
|
||||||
|
{
|
||||||
|
viewModel.KeyboardHotkey.CycleControllers[index].Hotkey = buttonValue.AsHidType<Key>();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_currentAssigner.GetInputAndAssign(assigner, keyboard);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
|||||||
@@ -77,9 +77,6 @@
|
|||||||
<ComboBoxItem>
|
<ComboBoxItem>
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralThemeDark}" />
|
<TextBlock Text="{ext:Locale SettingsTabGeneralThemeDark}" />
|
||||||
</ComboBoxItem>
|
</ComboBoxItem>
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="AMOLED" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
Title = RyujinxApp.FormatTitle(LocaleKeys.Amiibo);
|
Title = App.FormatTitle(LocaleKeys.Amiibo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AmiiboWindow()
|
public AmiiboWindow()
|
||||||
@@ -27,7 +27,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
|
|
||||||
if (Program.PreviewerDetached)
|
if (Program.PreviewerDetached)
|
||||||
{
|
{
|
||||||
Title = RyujinxApp.FormatTitle(LocaleKeys.Amiibo);
|
Title = App.FormatTitle(LocaleKeys.Amiibo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
Title = RyujinxApp.FormatTitle(LocaleKeys.CheatWindowTitle);
|
Title = App.FormatTitle(LocaleKeys.CheatWindowTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CheatWindow(VirtualFileSystem virtualFileSystem, string titleId, string titleName, string titlePath)
|
public CheatWindow(VirtualFileSystem virtualFileSystem, string titleId, string titleName, string titlePath)
|
||||||
@@ -93,7 +93,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
|
|
||||||
DataContext = this;
|
DataContext = this;
|
||||||
|
|
||||||
Title = RyujinxApp.FormatTitle(LocaleKeys.CheatWindowTitle);
|
Title = App.FormatTitle(LocaleKeys.CheatWindowTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Save()
|
public void Save()
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
|
|
||||||
UiHandler = new AvaHostUIHandler(this);
|
UiHandler = new AvaHostUIHandler(this);
|
||||||
|
|
||||||
ViewModel.Title = RyujinxApp.FormatTitle();
|
ViewModel.Title = App.FormatTitle();
|
||||||
|
|
||||||
TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowTitleBar;
|
TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowTitleBar;
|
||||||
TitleBar.TitleBarHitTestType = (ConfigurationState.Instance.ShowTitleBar) ? TitleBarHitTestType.Simple : TitleBarHitTestType.Complex;
|
TitleBar.TitleBarHitTestType = (ConfigurationState.Instance.ShowTitleBar) ? TitleBarHitTestType.Simple : TitleBarHitTestType.Complex;
|
||||||
@@ -98,9 +98,6 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
StatusBarHeight = StatusBarView.StatusBar.MinHeight;
|
StatusBarHeight = StatusBarView.StatusBar.MinHeight;
|
||||||
MenuBarHeight = MenuBar.MinHeight;
|
MenuBarHeight = MenuBar.MinHeight;
|
||||||
|
|
||||||
ApplicationList.DataContext = DataContext;
|
|
||||||
ApplicationGrid.DataContext = DataContext;
|
|
||||||
|
|
||||||
SetWindowSizePosition();
|
SetWindowSizePosition();
|
||||||
|
|
||||||
if (Program.PreviewerDetached)
|
if (Program.PreviewerDetached)
|
||||||
@@ -117,7 +114,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private static void OnPlatformColorValuesChanged(object sender, PlatformColorValues e)
|
private static void OnPlatformColorValuesChanged(object sender, PlatformColorValues e)
|
||||||
{
|
{
|
||||||
if (Application.Current is RyujinxApp app)
|
if (Application.Current is App app)
|
||||||
app.ApplyConfiguredTheme(ConfigurationState.Instance.UI.BaseStyle);
|
app.ApplyConfiguredTheme(ConfigurationState.Instance.UI.BaseStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
|
|
||||||
public SettingsWindow(VirtualFileSystem virtualFileSystem, ContentManager contentManager)
|
public SettingsWindow(VirtualFileSystem virtualFileSystem, ContentManager contentManager)
|
||||||
{
|
{
|
||||||
Title = RyujinxApp.FormatTitle(LocaleKeys.Settings);
|
Title = App.FormatTitle(LocaleKeys.Settings);
|
||||||
|
|
||||||
DataContext = ViewModel = new SettingsViewModel(virtualFileSystem, contentManager);
|
DataContext = ViewModel = new SettingsViewModel(virtualFileSystem, contentManager);
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace Ryujinx.Ava
|
|||||||
|
|
||||||
if (!Version.TryParse(Program.Version, out Version currentVersion))
|
if (!Version.TryParse(Program.Version, out Version currentVersion))
|
||||||
{
|
{
|
||||||
Logger.Error?.Print(LogClass.Application, $"Failed to convert the current {RyujinxApp.FullAppName} version!");
|
Logger.Error?.Print(LogClass.Application, $"Failed to convert the current {App.FullAppName} version!");
|
||||||
|
|
||||||
await ContentDialogHelper.CreateWarningDialog(
|
await ContentDialogHelper.CreateWarningDialog(
|
||||||
LocaleManager.Instance[LocaleKeys.DialogUpdaterConvertFailedMessage],
|
LocaleManager.Instance[LocaleKeys.DialogUpdaterConvertFailedMessage],
|
||||||
@@ -159,7 +159,7 @@ namespace Ryujinx.Ava
|
|||||||
|
|
||||||
if (!Version.TryParse(_buildVer, out Version newVersion))
|
if (!Version.TryParse(_buildVer, out Version newVersion))
|
||||||
{
|
{
|
||||||
Logger.Error?.Print(LogClass.Application, $"Failed to convert the received {RyujinxApp.FullAppName} version from GitHub!");
|
Logger.Error?.Print(LogClass.Application, $"Failed to convert the received {App.FullAppName} version from GitHub!");
|
||||||
|
|
||||||
await ContentDialogHelper.CreateWarningDialog(
|
await ContentDialogHelper.CreateWarningDialog(
|
||||||
LocaleManager.Instance[LocaleKeys.DialogUpdaterConvertFailedGithubMessage],
|
LocaleManager.Instance[LocaleKeys.DialogUpdaterConvertFailedGithubMessage],
|
||||||
@@ -266,7 +266,7 @@ namespace Ryujinx.Ava
|
|||||||
SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterDownloading],
|
SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterDownloading],
|
||||||
IconSource = new SymbolIconSource { Symbol = Symbol.Download },
|
IconSource = new SymbolIconSource { Symbol = Symbol.Download },
|
||||||
ShowProgressBar = true,
|
ShowProgressBar = true,
|
||||||
XamlRoot = RyujinxApp.MainWindow,
|
XamlRoot = App.MainWindow,
|
||||||
};
|
};
|
||||||
|
|
||||||
taskDialog.Opened += (s, e) =>
|
taskDialog.Opened += (s, e) =>
|
||||||
@@ -490,7 +490,7 @@ namespace Ryujinx.Ava
|
|||||||
bytesWritten += readSize;
|
bytesWritten += readSize;
|
||||||
|
|
||||||
taskDialog.SetProgressBarState(GetPercentage(bytesWritten, totalBytes), TaskDialogProgressState.Normal);
|
taskDialog.SetProgressBarState(GetPercentage(bytesWritten, totalBytes), TaskDialogProgressState.Normal);
|
||||||
RyujinxApp.SetTaskbarProgressValue(bytesWritten, totalBytes);
|
App.SetTaskbarProgressValue(bytesWritten, totalBytes);
|
||||||
|
|
||||||
updateFileStream.Write(buffer, 0, readSize);
|
updateFileStream.Write(buffer, 0, readSize);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user