Skip to content

Commit

Permalink
Merge pull request #1944 from andy840119/adjust-the-playfield-with-note
Browse files Browse the repository at this point in the history
Should add the preempt time in the interface.
  • Loading branch information
andy840119 authored Apr 21, 2023
2 parents 8261d17 + 1acf962 commit dfc9170
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ namespace osu.Game.Rulesets.Karaoke.Objects.Stages;

public interface IStageEffectApplier
{
double PreemptTime { get; }

void UpdateInitialTransforms(DrawableHitObject drawableHitObject);

void UpdateStartTimeStateTransforms(DrawableHitObject drawableHitObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public abstract class StageEffectApplier<TStageDefinition, TDrawableHitObject> :
private readonly StageElement[] elements;

protected readonly TStageDefinition Definition;
public readonly double PreemptTime;

public double PreemptTime { get; }

protected StageEffectApplier(IEnumerable<StageElement> elements, TStageDefinition definition)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,31 @@ protected override void UpdatePlayfieldArrangement(TransformSequence<KaraokePlay
{
transformSequence.TransformAddStageComponent(new BeatmapCoverInfo
{
Size = new Vector2(displayNotePlayfield ? 200 : 300),
Size = new Vector2(displayNotePlayfield ? 200 : 380),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
X = -200,
X = displayNotePlayfield ? -360 : -270,
Y = displayNotePlayfield ? 100 : 0,
}).FadeIn(300);
}

protected override void UpdateLyricPlayfieldArrangement(TransformSequence<LyricPlayfield> transformSequence, bool displayNotePlayfield)
{
transformSequence.TransformTo(nameof(LyricPlayfield.Anchor), Anchor.BottomRight)
.TransformTo(nameof(LyricPlayfield.Origin), Anchor.BottomRight)
transformSequence.TransformTo(nameof(LyricPlayfield.Anchor), Anchor.Centre)
.TransformTo(nameof(LyricPlayfield.Origin), Anchor.TopLeft)
.TransformTo(nameof(LyricPlayfield.Size), new Vector2(0.5f))
.MoveToX(displayNotePlayfield ? -190 : 0) // lyric and the beatmap cover should be closer if has note playfield.
.MoveToY(displayNotePlayfield ? 0 : -32) // lyric playfield should be upper if there's no note playfield.
.Then()
.FadeIn(100);
}

protected override void UpdateNotePlayfieldArrangement(TransformSequence<ScrollingNotePlayfield> transformSequence)
{
transformSequence.TransformTo(nameof(LyricPlayfield.Padding), new MarginPadding(50))
transformSequence.TransformTo(nameof(LyricPlayfield.Anchor), Anchor.Centre)
.TransformTo(nameof(LyricPlayfield.Origin), Anchor.Centre)
.MoveToY(-200)
.TransformTo(nameof(LyricPlayfield.Padding), new MarginPadding(50))
.Then()
.FadeIn(100);
}
Expand Down

0 comments on commit dfc9170

Please sign in to comment.