Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add combo colour override control to editor #31473

Merged
merged 4 commits into from
Jan 14, 2025
Merged

Add combo colour override control to editor #31473

merged 4 commits into from
Jan 14, 2025

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Jan 10, 2025

Closes #25608.

2025-01-10.13-33-08.mp4

Logic mostly matching stable. All operations are done on ComboOffset which still makes overridden combo colours weirdly relatively dependent on each other rather than them be an "absolute" choice, but alas...

As per stable, two consecutive new combos can use the same colour only if they are separated by a break.

This control is only available once the user has changed the combo colours from defaults; additionally, only a single new combo object must be selected for the colour selector to show up.

Closes ppy#25608.

Logic mostly matching stable. All operations are done on `ComboOffset`
which still makes overridden combo colours weirdly relatively dependent
on each other rather than them be an "absolute" choice, but alas...

As per stable, two consecutive new combos can use the same colour only
if they are separated by a break:

    https://github.com/peppy/osu-stable-reference/blob/52f3f75ed7efd7b9eb56e1e45c95bb91504337be/osu!/GameModes/Edit/Modes/EditorModeCompose.cs#L4564-L4571

This control is only available once the user has changed the combo
colours from defaults; additionally, only a single new combo object
must be selected for the colour selector to show up.
@peppy peppy self-requested a review January 14, 2025 05:33
@peppy
Copy link
Member

peppy commented Jan 14, 2025

This control is only available once the user has changed the combo colours from defaults

Is this a requirement due to how it works internally? It's a super rare case that a user hasn't changed from the defaults anyway, but just curious.

Copy link
Member

@peppy peppy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the single minor issue raised, this is so good. Both the code and the UI/UX are spot on. Surprised it was so simply implemented (although I guess there was a dependent fix to make that happen).

Comment on lines 53 to 70
mainButtonContainer = new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Right = 30 },
Child = new DrawableTernaryButton
{
Current = Current,
Description = "New combo",
CreateIcon = () => new SpriteIcon { Icon = OsuIcon.EditorNewComboA },
},
},
pickerButton = new ColourPickerButton
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
Width = 25,
ComboColours = { BindTarget = comboColours }
Copy link
Member

@peppy peppy Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably change the default state to the one where the button is hidden, I think this is generally how we handle these cases:

diff --git a/osu.Game/Screens/Edit/Components/TernaryButtons/NewComboTernaryButton.cs b/osu.Game/Screens/Edit/Components/TernaryButtons/NewComboTernaryButton.cs
index 8c64480b43..1f95d5f239 100644
--- a/osu.Game/Screens/Edit/Components/TernaryButtons/NewComboTernaryButton.cs
+++ b/osu.Game/Screens/Edit/Components/TernaryButtons/NewComboTernaryButton.cs
@@ -54,7 +54,6 @@ private void load(EditorBeatmap editorBeatmap)
                 {
                     RelativeSizeAxes = Axes.X,
                     AutoSizeAxes = Axes.Y,
-                    Padding = new MarginPadding { Right = 30 },
                     Child = new DrawableTernaryButton
                     {
                         Current = Current,
@@ -66,6 +65,7 @@ private void load(EditorBeatmap editorBeatmap)
                 {
                     Anchor = Anchor.CentreRight,
                     Origin = Anchor.CentreRight,
+                    Alpha = 0,
                     Width = 25,
                     ComboColours = { BindTarget = comboColours }
                 }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied in 8ffd254 👍

@bdach
Copy link
Collaborator Author

bdach commented Jan 14, 2025

Is this a requirement due to how it works internally?

This "combo index with offsets" stuff can only ever work for combo colour lookups on the beatmap skin, and the beatmap skin won't be present until the user actually changes combo colours. See also: #12683.

@peppy peppy merged commit 0e20c0e into ppy:master Jan 14, 2025
8 of 10 checks passed
@bdach bdach deleted the colorhax branch January 15, 2025 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add combo colour override control to editor
2 participants