mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-12-24 17:55:49 +00:00
46c8129bf5
* Avalonia: Another Cleanup This PR is a cleanup to the avalonia code recently added: - Some XAML file are autoformatted like a previous PR. - Dlc is renamed to DownloadableContent (Locale exclude). - DownloadableContentManagerWindow is a bit improved (Fixes #3491). - Some nits here and there. * Fix GTK * Remove AttachDebugDevTools * Fix last warning * Fix JSON fields
57 lines
No EOL
2 KiB
C#
57 lines
No EOL
2 KiB
C#
using Avalonia.Controls;
|
|
using FluentAvalonia.UI.Controls;
|
|
using Ryujinx.Ava.Common.Locale;
|
|
using Ryujinx.Ava.Ui.Models;
|
|
using Ryujinx.Ava.Ui.ViewModels;
|
|
using Ryujinx.Common.Configuration.Hid.Controller;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Ryujinx.Ava.Ui.Windows
|
|
{
|
|
public partial class RumbleSettingsWindow : UserControl
|
|
{
|
|
private readonly InputConfiguration<GamepadInputId, StickInputId> _viewmodel;
|
|
|
|
public RumbleSettingsWindow()
|
|
{
|
|
InitializeComponent();
|
|
DataContext = _viewmodel;
|
|
}
|
|
|
|
public RumbleSettingsWindow(ControllerSettingsViewModel viewmodel)
|
|
{
|
|
var config = viewmodel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
|
|
|
_viewmodel = new InputConfiguration<GamepadInputId, StickInputId>()
|
|
{
|
|
StrongRumble = config.StrongRumble, WeakRumble = config.WeakRumble
|
|
};
|
|
|
|
InitializeComponent();
|
|
DataContext = _viewmodel;
|
|
}
|
|
|
|
public static async Task Show(ControllerSettingsViewModel viewmodel)
|
|
{
|
|
RumbleSettingsWindow content = new RumbleSettingsWindow(viewmodel);
|
|
|
|
ContentDialog contentDialog = new ContentDialog
|
|
{
|
|
Title = LocaleManager.Instance["ControllerRumbleTitle"],
|
|
PrimaryButtonText = LocaleManager.Instance["ControllerSettingsSave"],
|
|
SecondaryButtonText = "",
|
|
CloseButtonText = LocaleManager.Instance["ControllerSettingsClose"],
|
|
Content = content,
|
|
};
|
|
|
|
contentDialog.PrimaryButtonClick += (sender, args) =>
|
|
{
|
|
var config = viewmodel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
|
config.StrongRumble = content._viewmodel.StrongRumble;
|
|
config.WeakRumble = content._viewmodel.WeakRumble;
|
|
};
|
|
|
|
await contentDialog.ShowAsync();
|
|
}
|
|
}
|
|
} |