1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 07:32:55 +08:00

Improve UI a bit

This commit is contained in:
Dean Herbert 2022-10-21 23:35:53 +09:00
parent bb921ff9a7
commit f516e32949
2 changed files with 10 additions and 7 deletions

View File

@ -94,6 +94,7 @@ namespace osu.Game.Rulesets.Edit
Debug.Assert(objects != null);
DistanceSpacingMultiplier.Value = ReadCurrentDistanceSnap(objects.Value.before, objects.Value.after);
// TODO: This should probably also force distance spacing grid on.
},
RelativeSizeAxes = Axes.X,
}
@ -130,20 +131,22 @@ namespace osu.Game.Rulesets.Edit
(HitObject before, HitObject after)? objects = getObjectsOnEitherSideOfCurrentTime();
if (objects != null)
{
double currentSnap = ReadCurrentDistanceSnap(objects.Value.before, objects.Value.after);
double currentSnap = objects == null
? 0
: ReadCurrentDistanceSnap(objects.Value.before, objects.Value.after);
if (currentSnap > DistanceSpacingMultiplier.MinValue)
{
currentDistanceSpacingButton.Enabled.Value = currentDistanceSpacingButton.Expanded.Value
&& !Precision.AlmostEquals(currentSnap, DistanceSpacingMultiplier.Value, DistanceSpacingMultiplier.Precision / 2);
currentDistanceSpacingButton.ContractedLabelText = $"(current {currentSnap:N2}x)";
currentDistanceSpacingButton.ContractedLabelText = $"current {currentSnap:N2}x";
currentDistanceSpacingButton.ExpandedLabelText = $"Use current ({currentSnap:N2}x)";
}
else
{
currentDistanceSpacingButton.Enabled.Value = false;
currentDistanceSpacingButton.ContractedLabelText = "Current N/A";
currentDistanceSpacingButton.ExpandedLabelText = "Use current (N/A)";
currentDistanceSpacingButton.ContractedLabelText = string.Empty;
currentDistanceSpacingButton.ExpandedLabelText = "Use current (unavailable)";
}
}

View File

@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Edit
SpriteText.Anchor = Anchor.CentreLeft;
SpriteText.Origin = Anchor.CentreLeft;
SpriteText.Font = OsuFont.GetFont(weight: FontWeight.Regular);
base.Height = SpriteText.DrawHeight;
base.Height = actualHeight / 2;
Background.Hide();
}
}, true);