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

Allow LN tail to have an origin of TopCentre #27726

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

longnguyen2004
Copy link

@longnguyen2004 longnguyen2004 commented Mar 25, 2024

Originally discussed at #26470

This PR adds a new skin.ini setting HoldNoteTailOrigin, with a value of 0 for Bottom and 1 for Top, which allows the user to adjust the origin of the tail piece, avoiding the huge texture hack found in current skins.
(Should the setting be an array instead? Each column is independent, so theoretically it should be an array, but I'm not aware of any skins that mix and match different textures for each column)

Demo

topcentre.ln.tail.mp4

(Ignore the overlapped part, I didn't blank out the bottom half of the tail)

@longnguyen2004
Copy link
Author

Skin for testing (rename to osk): R Skin v3.1 (7k Fade LN).zip
Map for testing: https://osu.ppy.sh/beatmapsets/861816#mania/1802831

@longnguyen2004
Copy link
Author

Also, is there a chance that this will get backported to stable, like the new songselect-top and songselect-bottom element?

@frenzibyte
Copy link
Member

Also, is there a chance that this will get backported to stable, like the new songselect-top and songselect-bottom element?

That's off-topic in this PR, stable is generally feature-locked so it's unlikely that such a feature will be backported, but that should not be discussed in here anyway.

The name `Top` and `Bottom` does not make sense in combination with `ScrollingDirection` which already flips anchor/origin vertically.
frenzibyte
frenzibyte previously approved these changes Mar 29, 2024
Copy link
Member

@frenzibyte frenzibyte left a comment

Choose a reason for hiding this comment

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

From a code perspective, this looks acceptable to me after few tidy-ups. However, I'm not confident enough to merge and have this setting exist by myself. I'll leave that to @peppy considering this approach was proposed by him.

@frenzibyte frenzibyte requested a review from peppy March 29, 2024 20:21
Comment on lines 72 to 88
base.ApplySkin(skin, allowFallback);
tailOrigin.Value = skin.GetConfig<ManiaSkinConfigurationLookup, HoldNoteTailOrigin>(new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.HoldNoteTailOrigin))?.Value ?? HoldNoteTailOrigin.Regular;
}

protected override void OnDirectionChanged(ValueChangedEvent<ScrollingDirection> e)
{
base.OnDirectionChanged(e);
updateTailOrigin();
}

private void updateTailOrigin()
{
if (Direction.Value == ScrollingDirection.Up)
Origin = tailOrigin.Value == HoldNoteTailOrigin.Inverted ? Anchor.BottomCentre : Anchor.TopCentre;
else
Origin = tailOrigin.Value == HoldNoteTailOrigin.Inverted ? Anchor.TopCentre : Anchor.BottomCentre;
}
Copy link
Member

Choose a reason for hiding this comment

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

Any reason this needs to be bindable flow when it's only ever changed in one place, and not bound to?

Copy link
Author

Choose a reason for hiding this comment

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

Regular variable is probably fine, this is only used in DrawableHoldNote(Tail) anyway

Copy link
Author

@longnguyen2004 longnguyen2004 Apr 5, 2024

Choose a reason for hiding this comment

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

I just realized they're used in tests also, will try to find a way around it.


namespace osu.Game.Skinning
{
public enum HoldNoteTailOrigin
Copy link
Member

Choose a reason for hiding this comment

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

Is this the first time we're throwing a per-ruleset enum in this place? Not quite sure about this. Might be better to dump it in LegacyManiaSkinConfigurationLookup.cs?

Or alternatively naming it similar to LegacyNoteBodyStyle, ie. LegacyNoteTailOrigin.

Copy link
Author

Choose a reason for hiding this comment

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

Sounds fine to me.
Talking about that, I was wondering why there were mania-specific stuff inside osu.Game.Skinning, and not osu.Game.Rulesets.Mania.Skinning. I sometimes got confused when searching for stuff and having to switching between the 2 namespaces. Putting them all in osu.Game.Rulesets.Mania.Skinning would be nice, but there might be other reasons that I don't know.

@peppy peppy added the blocked Don't merge this. label Apr 10, 2024
@peppy
Copy link
Member

peppy commented Apr 10, 2024

Blocked pending #27773 merge / discussion.

@longnguyen2004
Copy link
Author

Since #27773 is now scrapped, how should this PR be progressed? Do we wait for the 2nd iteration of the new skinning format?

@peppy
Copy link
Member

peppy commented May 27, 2024

Since #27773 is now scrapped, how should this PR be progressed? Do we wait for the 2nd iteration of the new skinning format?

I'm not sure it's required, but it should arrive this week so stay tuned.

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.

4 participants