mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Rename arrow direction method
This commit is contained in:
@ -41,11 +41,11 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestArrowRotation()
|
public void TestArrowDirection()
|
||||||
{
|
{
|
||||||
AddStep("Toggle icon up", () => button.ToggleIcon(true));
|
AddStep("Set upwards", () => button.SetIconDirection(true));
|
||||||
AddAssert("Icon facing upwards", () => button.Icon.Scale.Y == -1);
|
AddAssert("Icon facing upwards", () => button.Icon.Scale.Y == -1);
|
||||||
AddStep("Toggle icon down", () => button.ToggleIcon(false));
|
AddStep("Set downwards", () => button.SetIconDirection(false));
|
||||||
AddAssert("Icon facing downwards", () => button.Icon.Scale.Y == 1);
|
AddAssert("Icon facing downwards", () => button.Icon.Scale.Y == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
Text = "sample text";
|
Text = "sample text";
|
||||||
}
|
}
|
||||||
|
|
||||||
public new void ToggleIcon(bool upwards) => base.ToggleIcon(upwards);
|
public new void SetIconDirection(bool upwards) => base.SetIconDirection(upwards);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ namespace osu.Game.Overlays.Comments.Buttons
|
|||||||
icon.Colour = colourProvider.Foreground1;
|
icon.Colour = colourProvider.Foreground1;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void ToggleIcon(bool upwards) => icon.ScaleTo(new Vector2(1, upwards ? -1 : 1));
|
protected void SetIconDirection(bool upwards) => icon.ScaleTo(new Vector2(1, upwards ? -1 : 1));
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Comments.Buttons
|
|||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
Expanded.BindValueChanged(expanded => ToggleIcon(expanded.NewValue), true);
|
Expanded.BindValueChanged(expanded => SetIconDirection(expanded.NewValue), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnClick(ClickEvent e)
|
protected override bool OnClick(ClickEvent e)
|
||||||
|
Reference in New Issue
Block a user