github ppy/osu-framework 2019.221.0

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

Thanks for following along! This is a tagged release (2019.221.0). For more information check out the osu! changelog page and dev blog.

IMPORTANT NOTES FOR THIS RELEASE

Implicit operator removed from Bindable (#2152)

In order to avoid accidental misuse / misunderstandings, .Value must always be added to Bindable when requesting its value. One such case which used to be confusing:

Bindable<Drawable> bindableDrawable = new Bindable<Drawable>();

if (bindableDrawable != null)
{
    // true
}

if (bindableDrawable.Value != null)
{
    // false
}

Drawable drawable = null;

if (bindableDrawable == drawable)
{
    // ???
}

Bindable.ValueChanged now provides ValueChangedEvent (#2012)

It is now possible to access the old value. This was a common requirement in bindable usage which we had issues with until now.

bindable.ValueChanged += e =>
{
    Console.WriteLine($"Value changed from {e.OldValue} to {e.NewValue}");
}

Introduction of FontUsage (#2043)

While old methods of setting font attributes will still work, they are now marked as [Obsoleted]. You should use Font = new FontUsage(size: 200) going forward. For convenience, you can adjust existing fonts like so:

var font = new FontUsage(family: "SourceCodePro");

var fontWithSize = font.With(size: 24);

Don't miss a new osu-framework release

NewReleases is sending notifications on new releases.