Skip to content

Commit

Permalink
Dirty on input map bindings change
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacMarovitz committed Apr 27, 2024
1 parent 62cb423 commit 932653d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/Ryujinx/UI/ViewModels/Settings/SettingsInputViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ public class SettingsInputViewModel : BaseModel, IDisposable

private static readonly InputConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());

private bool _isModified;
public bool IsModified
{
get => _isModified;
set
{
_isModified = value;
DirtyEvent?.Invoke();
}
}

public IGamepadDriver AvaloniaKeyboardDriver { get; }
public IGamepad SelectedGamepad { get; private set; }

Expand Down Expand Up @@ -838,6 +849,7 @@ public bool CheckIfModified(ConfigurationState config)
{
bool isDirty = false;

isDirty |= IsModified;
isDirty |= config.System.EnableDockedMode.Value != EnableDockedMode;
isDirty |= config.Hid.EnableKeyboard.Value != EnableKeyboard;
isDirty |= config.Hid.EnableMouse.Value != EnableMouse;
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx/UI/Views/Input/ControllerInputView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private void Button_IsCheckedChanged(object sender, RoutedEventArgs e)
if (e.ButtonValue.HasValue)
{
var buttonValue = e.ButtonValue.Value;
//viewModel.ParentModel.SettingsViewModel.CheckIfModified();
viewModel.ParentModel.IsModified = true;
switch (button.Name)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx/UI/Views/Input/KeyboardInputView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void Button_IsCheckedChanged(object sender, RoutedEventArgs e)
if (e.ButtonValue.HasValue)
{
var buttonValue = e.ButtonValue.Value;
// viewModel.ParentModel.SettingsViewModel.CheckIfModified();
viewModel.ParentModel.IsModified = true;
switch (button.Name)
{
Expand Down

0 comments on commit 932653d

Please sign in to comment.