Celeste64 icon indicating copy to clipboard operation
Celeste64 copied to clipboard

Adds Controls Config file as a JSON

Open Viv-0 opened this issue 1 year ago • 4 comments

Adds a controls config file as a JSON. Tested against Windows 10 with Controller and Keyboard Supports deadzones for joysticks/triggers Please send feedback if you have concerns

Viv-0 avatar Jan 30 '24 07:01 Viv-0

Hey thanks for writing this all out! This is a great start, but I also agree with steviegt6 on a few issues:

  • Using null checks/handling null is better than using pragma's to ignore them. Ideally (aside from external libs) we wouldn't ignore any warnings.
  • I think creating a typed class to automatically serialize into might be worth doing. It might also make parsing the end data a lot easier. Since we're trimming the exe it will need a JsonSerializerContext but that's fairly trivial to do (see how Save.cs does it)

NoelFB avatar Jan 30 '24 20:01 NoelFB

just tested this out, seems like the pause menu isn't working at least for keyboard

a quick look through the changes I'm not quite sure what the issue is

I have tried both a debug build and a release build on linux and both can't open it

bitten2up avatar Jan 30 '24 21:01 bitten2up

Regarding this, I think in order to use a Json-deserializing structure it would require rewriting things in terms of solely buttons, similar to the structure within Celeste itself, i.e.: "MoveUp": { "Controller": ["LeftStickUp", "DPadUp"], "Keyboard": ["Up"] }

I'm going to rewrite it terms of that but I'm not sure whether or not I should then include Deadzones for things like Joystick/Triggers edit: I'm going to add it as a "ControllerDetail" property and rewrite the structure a bit.

Viv-0 avatar Jan 30 '24 23:01 Viv-0

You can write your own (de)serializers.

steviegt6 avatar Jan 31 '24 17:01 steviegt6

I ended up doing an implementation getting it working, based on the ideas here! Appreciate the first pass that was done, thank you!

It's still missing Mouse to aim, but I think that could be added as a separate PR (and probably part of Foster somehow).

NoelFB avatar Feb 04 '24 22:02 NoelFB