github ppy/osu-framework 2021.916.1

latest releases: 2024.513.0, 2024.509.0, 2024.423.0...
2 years ago

Thanks for following along! This is a tagged release (2021.916.1).

Breaking changes

IKeyBindingHandler<T> and IScrollBindingHandler<T> now provide UIEvents

To allow for more arguments without changing the signature of the handling methods, and also for consistency with the input flow in general, both interfaces now provide UIEvents rather than placing each parameter directly on the methods.

- public bool OnPressed(T action) { }
- public bool OnScroll(T action, float amount, bool isPrecise) { }
- public void OnReleased(T action) { }
+ public bool OnPressed(KeyBindingPressEvent<T> e) { }
+ public bool OnScroll(KeyBindingScrollEvent<T> e) { }
+ public void OnReleased(KeyBindingReleaseEvent<T> e) { }

The following regex replacements can be used to simplify migration:

Find: bool OnPressed\((\w+)\s+(\w+)\)
Replace: bool OnPressed(KeyBindingPressEvent<$1> e)

Find: void OnReleased\((\w+)\s+(\w+)\)
Replace: void OnReleased(KeyBindingReleaseEvent<$1> e)

Find: bool OnScroll\((\w+) (\w+), float \w+, bool \w+\)
Replace: bool OnScroll(KeyBindingScrollEvent<$1> e)

Don't miss a new osu-framework release

NewReleases is sending notifications on new releases.