mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-05-12 03:47:42 +02:00

* 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>
73 lines
1.7 KiB
C#
73 lines
1.7 KiB
C#
using Avalonia.Svg.Skia;
|
|
using Ryujinx.Ava.UI.Models.Input;
|
|
|
|
namespace Ryujinx.Ava.UI.ViewModels.Input
|
|
{
|
|
public class KeyboardInputViewModel : BaseModel
|
|
{
|
|
private KeyboardInputConfig _config;
|
|
public KeyboardInputConfig Config
|
|
{
|
|
get => _config;
|
|
set
|
|
{
|
|
_config = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private bool _isLeft;
|
|
public bool IsLeft
|
|
{
|
|
get => _isLeft;
|
|
set
|
|
{
|
|
_isLeft = value;
|
|
OnPropertyChanged();
|
|
OnPropertyChanged(nameof(HasSides));
|
|
}
|
|
}
|
|
|
|
private bool _isRight;
|
|
public bool IsRight
|
|
{
|
|
get => _isRight;
|
|
set
|
|
{
|
|
_isRight = value;
|
|
OnPropertyChanged();
|
|
OnPropertyChanged(nameof(HasSides));
|
|
}
|
|
}
|
|
|
|
public bool HasSides => IsLeft ^ IsRight;
|
|
|
|
private SvgImage _image;
|
|
public SvgImage Image
|
|
{
|
|
get => _image;
|
|
set
|
|
{
|
|
_image = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
public InputViewModel parentModel;
|
|
|
|
public KeyboardInputViewModel(InputViewModel model, KeyboardInputConfig config)
|
|
{
|
|
parentModel = model;
|
|
model.NotifyChangesEvent += OnParentModelChanged;
|
|
OnParentModelChanged();
|
|
Config = config;
|
|
}
|
|
|
|
public void OnParentModelChanged()
|
|
{
|
|
IsLeft = parentModel.IsLeft;
|
|
IsRight = parentModel.IsRight;
|
|
Image = parentModel.Image;
|
|
}
|
|
}
|
|
}
|