mirror of
https://git.ryujinx.app/kenji-nx/ryujinx.git
synced 2025-12-15 10:37:04 +00:00
Ava UI: Input Menu Refactor (#4998)
* 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>
This commit is contained in:
parent
a42f0bbb87
commit
49b37550ca
30 changed files with 2914 additions and 1150 deletions
48
src/Ryujinx.Input/ButtonValue.cs
Normal file
48
src/Ryujinx.Input/ButtonValue.cs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
using System.Diagnostics;
|
||||
|
||||
namespace Ryujinx.Input
|
||||
{
|
||||
public enum ButtonValueType { Key, GamepadButtonInputId, StickId }
|
||||
|
||||
public readonly struct ButtonValue
|
||||
{
|
||||
private readonly ButtonValueType _type;
|
||||
private readonly uint _rawValue;
|
||||
|
||||
public ButtonValue(Key key)
|
||||
{
|
||||
_type = ButtonValueType.Key;
|
||||
_rawValue = (uint)key;
|
||||
}
|
||||
|
||||
public ButtonValue(GamepadButtonInputId gamepad)
|
||||
{
|
||||
_type = ButtonValueType.GamepadButtonInputId;
|
||||
_rawValue = (uint)gamepad;
|
||||
}
|
||||
|
||||
public ButtonValue(StickInputId stick)
|
||||
{
|
||||
_type = ButtonValueType.StickId;
|
||||
_rawValue = (uint)stick;
|
||||
}
|
||||
|
||||
public Common.Configuration.Hid.Key AsKey()
|
||||
{
|
||||
Debug.Assert(_type == ButtonValueType.Key);
|
||||
return (Common.Configuration.Hid.Key)_rawValue;
|
||||
}
|
||||
|
||||
public Common.Configuration.Hid.Controller.GamepadInputId AsGamepadButtonInputId()
|
||||
{
|
||||
Debug.Assert(_type == ButtonValueType.GamepadButtonInputId);
|
||||
return (Common.Configuration.Hid.Controller.GamepadInputId)_rawValue;
|
||||
}
|
||||
|
||||
public Common.Configuration.Hid.Controller.StickInputId AsGamepadStickId()
|
||||
{
|
||||
Debug.Assert(_type == ButtonValueType.StickId);
|
||||
return (Common.Configuration.Hid.Controller.StickInputId)_rawValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue