1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 01:59:53 +08:00

Adjust x offsets to work again for keyboard selection

This commit is contained in:
Dean Herbert
2025-02-28 16:06:12 +09:00
Unverified
parent 7f99e60cfd
commit 02b950223c
2 changed files with 6 additions and 9 deletions
+6 -7
View File
@@ -23,8 +23,6 @@ namespace osu.Game.Screens.SelectV2
{
private const float corner_radius = 10;
private const float left_edge_x_offset = 20f;
private const float keyboard_active_x_offset = 25f;
private const float active_x_offset = 50f;
private const float duration = 500;
@@ -162,6 +160,7 @@ namespace osu.Game.Screens.SelectV2
base.LoadComplete();
Expanded.BindValueChanged(_ => updateDisplay());
Selected.BindValueChanged(_ => updateDisplay());
KeyboardSelected.BindValueChanged(_ => updateDisplay(), true);
}
@@ -199,13 +198,13 @@ namespace osu.Game.Screens.SelectV2
private void updateXOffset()
{
float x = PanelXOffset + active_x_offset + keyboard_active_x_offset + left_edge_x_offset;
float x = PanelXOffset;
if (Expanded.Value)
x -= active_x_offset;
if (!Expanded.Value && !Selected.Value)
x += active_x_offset;
if (KeyboardSelected.Value)
x -= keyboard_active_x_offset;
if (!KeyboardSelected.Value)
x += active_x_offset * 0.5f;
this.TransformTo(nameof(Padding), new MarginPadding { Left = x }, duration, Easing.OutQuint);
}
@@ -163,8 +163,6 @@ namespace osu.Game.Screens.SelectV2
computeStarRating();
updateKeyCount();
}, true);
Selected.BindValueChanged(s => Expanded.Value = s.NewValue, true);
}
protected override void PrepareForUse()