Conversation
|
Reminder that this setting should also be in First run setup as well. |
| fillMode = config.GetBindable<BackgroundFillMode>(OsuSetting.BackgroundFillMode); | ||
| fillMode.BindValueChanged(_ => loadBeatmapBackground(beatmap)); |
There was a problem hiding this comment.
Why is this change handling done here as opposed to inside BeatmapBackground?
Also, we never put BindValueChanged inside BDL methods as it is thread unsafe.
There was a problem hiding this comment.
it's really strange, don't remember why i did this, maybe something didn't work before that
should i use BindValueChanged inside LoadComplete instead?
There was a problem hiding this comment.
Yes, but also consider not reloading the whole beatmap to update the mode. I think the can be removed and handled exclusively in BeatmapBackground.
| { | ||
| base.LoadComplete(); | ||
|
|
||
| fillMode.ValueChanged += _ => updateBackgroundFillMode(); |
There was a problem hiding this comment.
now, BindValueChanged doesn't seem to work properly during and after playing beatmap
@peppy what could be the reason for this?
2025-12-26.13-53-45.mp4
No one in their right mind would want this.
|
@bdach if you want to give this 5 minutes that would be appreciated, since i changed over 50%. |
didn't want to cause problems, i'm just not very familiar with the codebase yet 🙌 |
it's fine, didn't mean it like that. just a standard practice that we get an extra review in such cases. |
|
This looks wonky in song select when progressing from main menu: Screen.Recording.2025-12-29.at.12.12.23.movNote left side of screen, where the old background from main menu is visible where the "letterbox" would be until it insta-fades out. |
|
Right, probably need to invoke some fake letterboxing boxes to fix that, which is going to be less fun. |
| this.textureName = textureName; | ||
| RelativeSizeAxes = Axes.Both; | ||
|
|
||
| AddInternal(Letterbox = new Box |
There was a problem hiding this comment.
This results in a performance regression, due to overdrawing of layers.
- Check something like
LetterboxOverlayfor how this needs to be done. - Should not result in any boxes unless required (ie. for fill screen it shouldn't be required).
There was a problem hiding this comment.
This results in a performance regression, due to overdrawing of layers.
- Check something like
LetterboxOverlayfor how this needs to be done.- Should not result in any boxes unless required (ie. for fill screen it shouldn't be required).
should be resolved in d2203d1
| case BackgroundScaleMode.ScaleToFit: | ||
| Sprite.FillMode = FillMode.Fit; | ||
|
|
||
| letterboxWidth.Value = (DrawWidth - Sprite.DrawWidth) / DrawWidth; |
There was a problem hiding this comment.
couldn't get this to work with RelativeSizeAxes
|
I can't find a test scene covering this, how are you testing? I specifically want a test so i can check the different scale modes and make sure there's no visible gap between the letterbox and the background. |
i was just changing the setting and watching the changes in SSV2, also using ctrl+f1 i'm not quite used to using visual tests yet, but i can try to write something when i get home |
|
Checking in song select likely hides some issues in edge case scenarios, so having a test scene would be good. Let me know if you have issues making it work. |
36534c8 to
7459dc0
Compare
| } | ||
|
|
||
| [Test] | ||
| public void TestBackgroundScaleModeSwitch() |
There was a problem hiding this comment.
The test doesn't show any changes visually. Nor does it run to completion in interactive mode.
There was a problem hiding this comment.
Nor does it run to completion in interactive mode.
it was fine for me but after some tests i realised that it might fail because of this line
AddUntilStep("default background fill mode is fill", () => getCurrentBackground()?.Sprite.FillMode == FillMode.Fill);because the "default background fill mode" may actually change after reading the game.ini
There was a problem hiding this comment.
The test doesn't show any changes visually.
there were also visual changes but now i decided to make them more visible
| Box leftLetterbox; | ||
| Box rightLetterbox; | ||
| Box topLetterbox; | ||
| Box bottomLetterbox; | ||
|
|
||
| AddInternal(new Container | ||
| { | ||
| RelativeSizeAxes = Axes.Both, | ||
| Children = new Drawable[] | ||
| { | ||
| leftLetterbox = new Box | ||
| { | ||
| Anchor = Anchor.CentreLeft, | ||
| Origin = Anchor.CentreLeft, | ||
| RelativeSizeAxes = Axes.Both, | ||
| Colour = Color4.Black, | ||
| }, | ||
| rightLetterbox = new Box | ||
| { | ||
| Anchor = Anchor.CentreRight, | ||
| Origin = Anchor.CentreRight, | ||
| RelativeSizeAxes = Axes.Both, | ||
| Colour = Color4.Black, | ||
| }, | ||
| topLetterbox = new Box | ||
| { | ||
| Anchor = Anchor.TopCentre, | ||
| Origin = Anchor.TopCentre, | ||
| RelativeSizeAxes = Axes.Both, | ||
| Colour = Color4.Black, | ||
| }, | ||
| bottomLetterbox = new Box | ||
| { | ||
| Anchor = Anchor.BottomCentre, | ||
| Origin = Anchor.BottomCentre, | ||
| RelativeSizeAxes = Axes.Both, | ||
| Colour = Color4.Black, | ||
| } | ||
| } | ||
| }); | ||
|
|
||
| letterboxWidth.BindValueChanged(margin => | ||
| { | ||
| leftLetterbox.ResizeWidthTo(margin.NewValue); | ||
| rightLetterbox.ResizeWidthTo(margin.NewValue); | ||
| }, true); | ||
|
|
||
| letterboxHeight.BindValueChanged(margin => | ||
| { | ||
| topLetterbox.ResizeHeightTo(margin.NewValue); | ||
| bottomLetterbox.ResizeHeightTo(margin.NewValue); | ||
| }, true); |

a slightly better version with localisation and code quality