forked from MeloNX/MeloNX
* So much boilerplate * Slow and steady * Restructure + Ack suggestions * Restructure + Ack suggestions * Restructure * Clean * Propogate those fields i forgot about * It builds * Progress * Almost there * Fix stupid mistake * Fix more stupid mistakes * Actually fix fuck ups * Start localising * r/therestofthefuckingowl * Localise ButtonKeyAssigner * Are you feeling it now mr krabs * We’re done at last * Crimes against code * Try me in the Hague * Please be quiet * Crimes are here to stay * Dispose stuff * Cleanup a couple things * Visual fixes and improvements One weird bug * Fix rebase errors * Fixes * Ack Suggestions Remaining ack suggestions Update src/Ryujinx.Ava/UI/Models/Input/ControllerInputConfig.cs Co-authored-by: Ac_K <Acoustik666@gmail.com> Update src/Ryujinx.Ava/UI/Models/Input/ControllerInputConfig.cs Co-authored-by: Ac_K <Acoustik666@gmail.com> * Formatting and error More Ava 11-ness Whoops * Code style fixes * Style fixes * Analyzer fix * Remove all ReflectionBindings * Remove ambigious object * Remove redundant property * Old man yells at formatter * r e a d o n l y * Fix profiles * Use new Sliders --------- Co-authored-by: Ac_K <Acoustik666@gmail.com>
62 lines
1.8 KiB
C#
62 lines
1.8 KiB
C#
using Avalonia.Controls;
|
|
using Ryujinx.Ava.Common.Locale;
|
|
using Ryujinx.Ava.UI.Helpers;
|
|
using Ryujinx.Ava.UI.Models;
|
|
using Ryujinx.Ava.UI.ViewModels.Input;
|
|
|
|
namespace Ryujinx.Ava.UI.Views.Input
|
|
{
|
|
public partial class InputView : UserControl
|
|
{
|
|
private bool _dialogOpen;
|
|
private InputViewModel ViewModel { get; set; }
|
|
|
|
public InputView()
|
|
{
|
|
DataContext = ViewModel = new InputViewModel(this);
|
|
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SaveCurrentProfile()
|
|
{
|
|
ViewModel.Save();
|
|
}
|
|
|
|
private async void PlayerIndexBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
if (ViewModel.IsModified && !_dialogOpen)
|
|
{
|
|
_dialogOpen = true;
|
|
|
|
var result = await ContentDialogHelper.CreateConfirmationDialog(
|
|
LocaleManager.Instance[LocaleKeys.DialogControllerSettingsModifiedConfirmMessage],
|
|
LocaleManager.Instance[LocaleKeys.DialogControllerSettingsModifiedConfirmSubMessage],
|
|
LocaleManager.Instance[LocaleKeys.InputDialogYes],
|
|
LocaleManager.Instance[LocaleKeys.InputDialogNo],
|
|
LocaleManager.Instance[LocaleKeys.RyujinxConfirm]);
|
|
|
|
if (result == UserResult.Yes)
|
|
{
|
|
ViewModel.Save();
|
|
}
|
|
|
|
_dialogOpen = false;
|
|
|
|
ViewModel.IsModified = false;
|
|
|
|
if (e.AddedItems.Count > 0)
|
|
{
|
|
var player = (PlayerModel)e.AddedItems[0];
|
|
ViewModel.PlayerId = player.Id;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
ViewModel.Dispose();
|
|
}
|
|
}
|
|
}
|