Replicate osu!(stable)'s hit target position with "Classic" mod

This commit is contained in:
Salman Ahmed 2022-04-03 01:31:51 +03:00
parent a2829b4fc7
commit ac32966427
2 changed files with 10 additions and 1 deletions

View File

@ -16,6 +16,9 @@ namespace osu.Game.Rulesets.Taiko.Mods
{ {
drawableTaikoRuleset = (DrawableTaikoRuleset)drawableRuleset; drawableTaikoRuleset = (DrawableTaikoRuleset)drawableRuleset;
drawableTaikoRuleset.LockPlayfieldAspect.Value = false; drawableTaikoRuleset.LockPlayfieldAspect.Value = false;
var playfield = (TaikoPlayfield)drawableRuleset.Playfield;
playfield.ClassicHitTargetPosition.Value = true;
} }
public void Update(Playfield playfield) public void Update(Playfield playfield)

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Pooling; using osu.Framework.Graphics.Pooling;
@ -31,6 +32,11 @@ namespace osu.Game.Rulesets.Taiko.UI
/// </summary> /// </summary>
public const float DEFAULT_HEIGHT = 200; public const float DEFAULT_HEIGHT = 200;
/// <summary>
/// Whether the hit target should be nudged further towards the left area, matching the stable "classic" position.
/// </summary>
public Bindable<bool> ClassicHitTargetPosition = new BindableBool();
private Container<HitExplosion> hitExplosionContainer; private Container<HitExplosion> hitExplosionContainer;
private Container<KiaiHitExplosion> kiaiExplosionContainer; private Container<KiaiHitExplosion> kiaiExplosionContainer;
private JudgementContainer<DrawableTaikoJudgement> judgementContainer; private JudgementContainer<DrawableTaikoJudgement> judgementContainer;
@ -190,7 +196,7 @@ namespace osu.Game.Rulesets.Taiko.UI
// Padding is required to be updated for elements which are based on "absolute" X sized elements. // Padding is required to be updated for elements which are based on "absolute" X sized elements.
// This is basically allowing for correct alignment as relative pieces move around them. // This is basically allowing for correct alignment as relative pieces move around them.
rightArea.Padding = new MarginPadding { Left = leftArea.DrawWidth }; rightArea.Padding = new MarginPadding { Left = leftArea.DrawWidth - (ClassicHitTargetPosition.Value ? 45 : 0) };
hitTargetOffsetContent.Padding = new MarginPadding { Left = HitTarget.DrawWidth / 2 }; hitTargetOffsetContent.Padding = new MarginPadding { Left = HitTarget.DrawWidth / 2 };
mascot.Scale = new Vector2(DrawHeight / DEFAULT_HEIGHT); mascot.Scale = new Vector2(DrawHeight / DEFAULT_HEIGHT);