Skip to content

Conversation

transcendtient
Copy link

Depends on #3457 , please review and merge that PR first.
This branch starts at 0af816d committed on May 19, 2025.
This PR aims to break out discrete pieces of EditorViewport.cs e.g.
FPS counter
Utility methods (ProjectPoint, ConvertMouseToRay, etc...)
CameraWidget
CameraViewpoints
The camera movement persistence (speed, orthographic scale, FOV)
The viewport input (and more complete implementation of gamepad bindings)
Among others...

The initial commit of this PR moves Input to its own namespace, InputConfig (so named to avoid conficts with Flaxengine.Input that is not namespaced. It also removes InputBindingList in favor of a simpler List.
The second commit in this PR has fixes from #3457 and moves some input options in the menus that I believe better reflect their categorization.

InputBinding rewrite to allow mouse and keyboard inputs.  InputTrigger handles the assignments. simplified many calls to InputBinding.Process for methods that are now unnecessary and can be handled entirely from the control or window context. Added preprocessor KeyboardKeysString and MouseButtonString to enable constant use for defaults in InputOptions.  Changed a few things in EditorViewport to show proof of concept.
added scrollwheel to inputtriggers, added GetMouseScrollDelta to RootControl to facilitate, modified bindings with no default to empty strings
Got this to a working state for now. Inputs fire like they should and are able to be bound in separate places to Callbacks.
This removed the InputActionsContainer and moved InputConfig to its own namespace.
Added InputBindingList and also moved Callback to InputBinding
Binding new inputs is now broken.
…perties

I want this work, but I'm realigning my goal to break out discrete pieces of EditorViewport.cs e.g.
FPS counter
Utility methods (ProjectPoint, ConvertMouseToRay, etc...)
CameraWidget
CameraViewpoints
The camera movement persistence (speed, orthographic scale, FOV)
The viewport input (and more complete implementation of gamepad bindings)
@Tryibion
Copy link
Member

.Flax files are needed binary files for the editor/engine so they should not be ignored in the gitignore. They also should not be pushed with a PR because they use a separate lfs server and will always fail in a PR because of lack of user access to that server. You will need to remove the file change to the .Flax files from this PR. There are several ways to do it, you can Google and pick your favorite.

@transcendtient
Copy link
Author

I'll look into it.

id like to get everything fixed before push, but i need to get this in there.
this moves alot of the widgets into a module, has the beginnings of removing the Input struct that should be elsewhere (I make the argument it should be a separate namespace). Fixes to InputBindingList  to ensure that the picked binding is the one that matches most completely instead of the first one that satisfies the key combination. still has many broken features, as well as cacheing of settings. features were removed for expediency from EditorViewport including gamepad and trackpad code. can be added back in at a later date. in order to unify the widget usage widgets will need to be removed from other classes extending EditorViewport
greatly simplified this with a new struct that decouples the input binding from the actions it triggers. this allows setting a ground truth for input bindings. made an enum as well as a static dictionary for the inputoptions to easily reference the bindings, allowing propagation to any part of the codebase that uses the bindings.
I continue to see no reason why the input should not be static... The same bindings are used everywhere and referencing them is substantially easier as static properties.
It's late. Also didn't fix my reflection for the dictionary I use for processing InputBindingList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants