Compare commits
6 Commits
a280f6907d
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b55d158b7 | ||
|
|
91f73a4891 | ||
|
|
883d4d863a | ||
|
|
ca5de909a1 | ||
|
|
5172567b08 | ||
|
|
6fe4cee7c0 |
@@ -2988,8 +2988,8 @@
|
||||
010015D003EE4000,"The Jackbox Party Pack 2",online-working,playable,2022-08-22 18:23:40
|
||||
0100CC80013D6000,"The Jackbox Party Pack 3",slow;online-working,playable,2022-08-22 18:41:06
|
||||
0100E1F003EE8000,"The Jackbox Party Pack 4",online-working,playable,2022-08-22 18:56:34
|
||||
01006fe0096ac000,"The Jackbox Party Pack 5",ldn-untested,boots,2025-02-03 22:32:00
|
||||
01005a400db52000,"The Jackbox Party Pack 6",ldn-untested,boots,2025-02-03 22:32:00
|
||||
01006fe0096ac000,"The Jackbox Party Pack 5",slow;online-working,ingame,2025-02-14 05:32:00
|
||||
01005a400db52000,"The Jackbox Party Pack 6",slow;online-working,ingame,2025-02-14 05:26:00
|
||||
010052C00B184000,"The Journey Down: Chapter One",nvdec,playable,2021-02-24 13:32:41
|
||||
01006BC00B188000,"The Journey Down: Chapter Three",nvdec,playable,2021-02-24 13:45:27
|
||||
01009AB00B186000,"The Journey Down: Chapter Two",nvdec,playable,2021-02-24 13:32:13
|
||||
|
||||
|
@@ -1,5 +1,3 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.Common.Configuration.Hid
|
||||
{
|
||||
public class KeyboardHotkeys
|
||||
@@ -15,6 +13,5 @@ namespace Ryujinx.Common.Configuration.Hid
|
||||
public Key VolumeDown { get; set; }
|
||||
public Key CustomVSyncIntervalIncrement { get; set; }
|
||||
public Key CustomVSyncIntervalDecrement { get; set; }
|
||||
public List<Key> CycleControllers { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,6 @@ using Ryujinx.HLE;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.HOS;
|
||||
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||
using Ryujinx.HLE.HOS.Services.Hid;
|
||||
using Ryujinx.HLE.HOS.SystemState;
|
||||
using Ryujinx.Input;
|
||||
using Ryujinx.Input.HLE;
|
||||
@@ -50,7 +49,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -1311,18 +1309,6 @@ namespace Ryujinx.Ava
|
||||
|
||||
_viewModel.Volume = Device.GetVolume();
|
||||
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:
|
||||
(_keyboardInterface as AvaloniaKeyboard).Clear();
|
||||
break;
|
||||
@@ -1405,15 +1391,6 @@ namespace Ryujinx.Ava
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,13 +14,5 @@ namespace Ryujinx.Ava.Common
|
||||
VolumeDown,
|
||||
CustomVSyncIntervalIncrement,
|
||||
CustomVSyncIntervalDecrement,
|
||||
CycleControllersPlayer1,
|
||||
CycleControllersPlayer2,
|
||||
CycleControllersPlayer3,
|
||||
CycleControllersPlayer4,
|
||||
CycleControllersPlayer5,
|
||||
CycleControllersPlayer6,
|
||||
CycleControllersPlayer7,
|
||||
CycleControllersPlayer8
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using DynamicData;
|
||||
using Ryujinx.Ava.UI.Helpers;
|
||||
using Ryujinx.Ava.UI.ViewModels;
|
||||
using Ryujinx.Common.Configuration.Hid;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace Ryujinx.Ava.UI.Models.Input
|
||||
{
|
||||
@@ -33,15 +28,8 @@ namespace Ryujinx.Ava.UI.Models.Input
|
||||
|
||||
[ObservableProperty] private Key _customVSyncIntervalDecrement;
|
||||
|
||||
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)
|
||||
{
|
||||
AddCycleController = MiniCommand.Create(() => CycleControllers.Add(new CycleController(CycleControllers.Count + 1, Key.Unbound)));
|
||||
RemoveCycleController = MiniCommand.Create(() => CycleControllers.Remove(CycleControllers.Last()));
|
||||
if (config == null)
|
||||
return;
|
||||
|
||||
@@ -56,7 +44,6 @@ namespace Ryujinx.Ava.UI.Models.Input
|
||||
VolumeDown = config.VolumeDown;
|
||||
CustomVSyncIntervalIncrement = config.CustomVSyncIntervalIncrement;
|
||||
CustomVSyncIntervalDecrement = config.CustomVSyncIntervalDecrement;
|
||||
CycleControllers.AddRange((config.CycleControllers ?? []).Select((x, i) => new CycleController(i + 1, x)));
|
||||
}
|
||||
|
||||
public KeyboardHotkeys GetConfig() =>
|
||||
@@ -73,7 +60,6 @@ namespace Ryujinx.Ava.UI.Models.Input
|
||||
VolumeDown = VolumeDown,
|
||||
CustomVSyncIntervalIncrement = CustomVSyncIntervalIncrement,
|
||||
CustomVSyncIntervalDecrement = CustomVSyncIntervalDecrement,
|
||||
CycleControllers = CycleControllers.Select(x => x.Hotkey).ToList()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -897,13 +897,5 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
|
||||
AvaloniaKeyboardDriver.Dispose();
|
||||
}
|
||||
|
||||
public void CyclePlayerDevice(int player)
|
||||
{
|
||||
LoadDevices();
|
||||
PlayerId = (PlayerIndex)player;
|
||||
Device = (Device + 1) % Devices.Count;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<UserControl
|
||||
<UserControl
|
||||
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsHotkeysView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -15,18 +15,17 @@
|
||||
<viewModels:SettingsViewModel />
|
||||
</Design.DataContext>
|
||||
<UserControl.Styles>
|
||||
<Style Selector="StackPanel StackPanel">
|
||||
<Style Selector="StackPanel > StackPanel">
|
||||
<Setter Property="Margin" Value="10, 0, 0, 0" />
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
</Style>
|
||||
<Style Selector="StackPanel StackPanel > TextBlock">
|
||||
<Style Selector="StackPanel > StackPanel > TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Width" Value="230" />
|
||||
</Style>
|
||||
<Style Selector="ToggleButton, Button">
|
||||
<Style Selector="ToggleButton">
|
||||
<Setter Property="Width" Value="90" />
|
||||
<Setter Property="Height" Value="27" />
|
||||
<Setter Property="Padding" Value="0,5,0,5" /> <!-- Added vertical padding -->
|
||||
</Style>
|
||||
<Style Selector="ToggleButton > TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
@@ -40,123 +39,79 @@
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<Border Classes="settings">
|
||||
<StackPanel
|
||||
Name="SettingButtons"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Stretch"
|
||||
Orientation="Vertical"
|
||||
Spacing="10"
|
||||
Name="SettingButtons">
|
||||
Spacing="10">
|
||||
<TextBlock
|
||||
Classes="h1"
|
||||
Text="{ext:Locale SettingsTabHotkeysHotkeys}" />
|
||||
<StackPanel
|
||||
Margin="10,0,0,0"
|
||||
Spacing="10"
|
||||
Orientation="Vertical">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysToggleVSyncModeHotkey}" />
|
||||
<ToggleButton Name="ToggleVSyncMode">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.ToggleVSyncMode, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysScreenshotHotkey}" />
|
||||
<ToggleButton Name="Screenshot">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.Screenshot, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysShowUiHotkey}" />
|
||||
<ToggleButton Name="ShowUI">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.ShowUI, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysPauseHotkey}" />
|
||||
<ToggleButton Name="Pause">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.Pause, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysToggleMuteHotkey}" />
|
||||
<ToggleButton Name="ToggleMute">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.ToggleMute, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysResScaleUpHotkey}" />
|
||||
<ToggleButton Name="ResScaleUp">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.ResScaleUp, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysResScaleDownHotkey}" />
|
||||
<ToggleButton Name="ResScaleDown">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.ResScaleDown, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysVolumeUpHotkey}" />
|
||||
<ToggleButton Name="VolumeUp">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.VolumeUp, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysVolumeDownHotkey}" />
|
||||
<ToggleButton Name="VolumeDown">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.VolumeDown, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysIncrementCustomVSyncIntervalHotkey}" />
|
||||
<ToggleButton Name="CustomVSyncIntervalIncrement">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.CustomVSyncIntervalIncrement, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysDecrementCustomVSyncIntervalHotkey}" />
|
||||
<ToggleButton Name="CustomVSyncIntervalDecrement">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.CustomVSyncIntervalDecrement, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysToggleVSyncModeHotkey}" />
|
||||
<ToggleButton Name="ToggleVSyncMode">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.ToggleVSyncMode, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<Separator Height="1" />
|
||||
<StackPanel Margin="0">
|
||||
<TextBlock
|
||||
Classes="h1"
|
||||
Text="{ext:Locale SettingsTabHotkeysCycleControllers}" />
|
||||
<StackPanel Orientation="Horizontal" Spacing="10">
|
||||
<Button
|
||||
Content="{ext:Locale SettingsTabGeneralAdd}"
|
||||
Margin="10,0,0,0"
|
||||
Command="{Binding KeyboardHotkey.AddCycleController}" />
|
||||
<Button
|
||||
Content="{ext:Locale SettingsTabGeneralRemove}"
|
||||
IsEnabled="{Binding KeyboardHotkey.CanRemoveCycleController}"
|
||||
Command="{Binding KeyboardHotkey.RemoveCycleController}" />
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysScreenshotHotkey}" />
|
||||
<ToggleButton Name="Screenshot">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.Screenshot, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysShowUiHotkey}" />
|
||||
<ToggleButton Name="ShowUI">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.ShowUI, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysPauseHotkey}" />
|
||||
<ToggleButton Name="Pause">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.Pause, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysToggleMuteHotkey}" />
|
||||
<ToggleButton Name="ToggleMute">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.ToggleMute, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysResScaleUpHotkey}" />
|
||||
<ToggleButton Name="ResScaleUp">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.ResScaleUp, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysResScaleDownHotkey}" />
|
||||
<ToggleButton Name="ResScaleDown">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.ResScaleDown, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysVolumeUpHotkey}" />
|
||||
<ToggleButton Name="VolumeUp">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.VolumeUp, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysVolumeDownHotkey}" />
|
||||
<ToggleButton Name="VolumeDown">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.VolumeDown, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysIncrementCustomVSyncIntervalHotkey}" />
|
||||
<ToggleButton Name="CustomVSyncIntervalIncrement">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.CustomVSyncIntervalIncrement, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysDecrementCustomVSyncIntervalHotkey}" />
|
||||
<ToggleButton Name="CustomVSyncIntervalDecrement">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.CustomVSyncIntervalDecrement, Converter={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</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={x:Static helpers:KeyValueConverter.Instance}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ScrollViewer>
|
||||
|
||||
@@ -3,14 +3,11 @@ using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.LogicalTree;
|
||||
using Avalonia.VisualTree;
|
||||
using DynamicData;
|
||||
using Ryujinx.Ava.Input;
|
||||
using Ryujinx.Ava.UI.Helpers;
|
||||
using Ryujinx.Ava.UI.ViewModels;
|
||||
using Ryujinx.Input;
|
||||
using Ryujinx.Input.Assigner;
|
||||
using System.Linq;
|
||||
using Button = Ryujinx.Input.Button;
|
||||
using Key = Ryujinx.Common.Configuration.Hid.Key;
|
||||
|
||||
@@ -24,21 +21,16 @@ namespace Ryujinx.Ava.UI.Views.Settings
|
||||
public SettingsHotkeysView()
|
||||
{
|
||||
InitializeComponent();
|
||||
RegisterEvents();
|
||||
_avaloniaKeyboardDriver = new AvaloniaKeyboardDriver(this);
|
||||
CycleControllers.LayoutUpdated += (_, _1) => RegisterEvents();
|
||||
}
|
||||
|
||||
private void RegisterEvents()
|
||||
{
|
||||
foreach (ILogical visual in SettingButtons.GetLogicalDescendants())
|
||||
{
|
||||
if (visual is ToggleButton button and not CheckBox)
|
||||
{
|
||||
button.IsCheckedChanged -= Button_IsCheckedChanged;
|
||||
button.IsCheckedChanged += Button_IsCheckedChanged;
|
||||
}
|
||||
}
|
||||
|
||||
_avaloniaKeyboardDriver = new AvaloniaKeyboardDriver(this);
|
||||
}
|
||||
|
||||
protected override void OnPointerReleased(PointerReleasedEventArgs e)
|
||||
@@ -124,13 +116,6 @@ namespace Ryujinx.Ava.UI.Views.Settings
|
||||
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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user