Closes https://github.com/ppy/osu/issues/32920.
I don't know if there's going to be other cases of breakage, but from
what I can tell these settings *not* showing infinite precision
representations was a bug with the previous implementation of number
formatting.
Closes https://github.com/ppy/osu/issues/32908.
Have you ever been in a situation wherein you find out you fixed a bug
that you didn't know existed, but that makes *another* bug appear
because it was relying on the other bug? This is where I'm at right now.
But, to start from the top.
`TextFlowContainer.Text` (the setter) is a convenience property that you
use to set the text in one go. Internally it uses `AddText()`:
https://github.com/ppy/osu-framework/blob/681900ffb70adfeede4e3fa32a69da66252691ee/osu.Framework/Graphics/Containers/TextFlowContainer.cs#L81-L94
`AddText()`'s xmldoc says:
The \n character will create a new paragraph, not just a line break.
If you need \n to be a line break, use <see cref="AddParagraph{TSpriteText}(LocalisableString, Action{TSpriteText})"/> instead.
https://github.com/ppy/osu-framework/blob/681900ffb70adfeede4e3fa32a69da66252691ee/osu.Framework/Graphics/Containers/TextFlowContainer.cs#L226-L239
That's right. This portion of xmldoc was *straight up false* and
*silently broken* before https://github.com/ppy/osu-framework/pull/6556.
If you want to check that out yourself, apply the following patch to
framework:
diff --git a/osu.Framework.Tests/Visual/Containers/TestSceneTextFlowContainer.cs b/osu.Framework.Tests/Visual/Containers/TestSceneTextFlowContainer.cs
index 464f47c2c..e1ad521a7 100644
--- a/osu.Framework.Tests/Visual/Containers/TestSceneTextFlowContainer.cs
+++ b/osu.Framework.Tests/Visual/Containers/TestSceneTextFlowContainer.cs
@@ -180,6 +180,22 @@ public void TestAlignmentIsCorrectWhenLineBreaksAtLastWordOfParagraph(Anchor tex
});
}
+ [Test]
+ public void TestSetTextWithNewLine()
+ {
+ AddStep("set text", () => textContainer.Text = "this text\nhas a newline");
+ AddStep("clear and add text", () =>
+ {
+ textContainer.Clear();
+ textContainer.AddText("this text\nhas a newline");
+ });
+ AddStep("clear and add paragraph", () =>
+ {
+ textContainer.Clear();
+ textContainer.AddParagraph("this text\nhas a newline");
+ });
+ }
+
private void assertSpriteTextCount(int count)
=> AddAssert($"text flow has {count} sprite texts", () => textContainer.ChildrenOfType<SpriteText>().Count() == count);
On `master`, there will be a difference between the first two steps, and
the third. On 2025.321.0, *there will be none*.
My working theory as to why this was always busted is that the
corresponding code that was there before in
https://github.com/bdach/osu-framework/blob/c31a48178889ca2f9b4d257d2d64915eee90338a/osu.Framework/Graphics/Containers/TextFlowContainer.cs#L454-L458
just straight up ran too late. *The height of the container is being
changed after the flow has laid itself out, without adjusting subsequent
children in any way.*
There is potentially a discussion to be had as to whether the emergent
behaviour of `TextFlowContainer.Text` with respect to `\n` character is
correct, but I'm just going to start with this diff and see what the
reaction is.
Audio offset is integer based in configuration, so let's make sure not
to show that there's an applicable offset when the value difference is
too low.
I've also fixed rounding to match expectations (`AudioOffset` is
precision limited to integer), and handled the case where a user adjusts
the slider but also has a suggested offset – previously it would not
enable the button after slider adjustments but now it will work as
expected.
Saves having this defined in 20+ places. If we ever make any changes to
shear, it's 100% going to need to be applied to every usage (there will
never be a case of multiple different shears in the game).
Also fixes a mismatching definition in `ShearedNub`.
Band-aid fix for https://github.com/ppy/osu/issues/32671.
Removes all `BindableList.BindTo` from `load()` methods (except one
editor one which looks safe and is kinda hard to fix without moving
drawable load to a blocking operation).
Resolves one part of
https://github.com/ppy/osu/discussions/32568#discussioncomment-12612928
A few caveats:
- Layout is slightly different than web intentionally. Web does things
that I think will be difficult to reproduce or just plain look bad in
client, such as:
- On web, the metadata info box has 200px min height and 300px max
height. I just hardcoded 300 units.
- On web, user tags and mapper tags are individually scrollable, and
the amount of space taken up by each is calculated in a way that
is - as far as I can tell - indeterminate, and probably influenced
by some flexbox magic. I just made the entire thing scrollable
instead.
- Because song select shares controls with the beatmap set overlay, now
song select says "Mapper Tags" in the header instead of just "Tags"
too. I think this is fine, because people asked for user tags to be
shown in song select too.
- Search query syntax lifted from
https://github.com/ppy/osu-web/pull/12047.
- Using hardcoded English strings for now, will update to the
translations after the next osu-resources localisations update.
This was causing a performance issue due to transforms bunching up for
off-screen toolboxes. It's much simpler to just update these values
every frame.
Closes https://github.com/ppy/osu/issues/32474.