mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Use colour fade transform for selection box controls
To become harminous with the fade transforms of the rotation control
This commit is contained in:
@ -55,7 +55,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
protected override void UpdateHoverState()
|
protected override void UpdateHoverState()
|
||||||
{
|
{
|
||||||
base.UpdateHoverState();
|
base.UpdateHoverState();
|
||||||
icon.Colour = !HandlingMouse && IsHovered ? Color4.White : Color4.Black;
|
icon.FadeColour(!HandlingMouse && IsHovered ? Color4.White : Color4.Black, TRANSFORM_DURATION, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string TooltipText { get; }
|
public string TooltipText { get; }
|
||||||
|
@ -17,6 +17,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class SelectionBoxControl : CompositeDrawable
|
public abstract class SelectionBoxControl : CompositeDrawable
|
||||||
{
|
{
|
||||||
|
public const double TRANSFORM_DURATION = 100;
|
||||||
|
|
||||||
public event Action OperationStarted;
|
public event Action OperationStarted;
|
||||||
public event Action OperationEnded;
|
public event Action OperationEnded;
|
||||||
|
|
||||||
@ -90,8 +92,12 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
protected virtual void UpdateHoverState()
|
protected virtual void UpdateHoverState()
|
||||||
{
|
{
|
||||||
circle.Colour = HandlingMouse ? Colours.GrayF : (IsHovered ? Colours.Red : Colours.YellowDark);
|
if (HandlingMouse)
|
||||||
this.ScaleTo(HandlingMouse || IsHovered ? 1.5f : 1, 100, Easing.OutQuint);
|
circle.FadeColour(Colours.GrayF, TRANSFORM_DURATION, Easing.OutQuint);
|
||||||
|
else
|
||||||
|
circle.FadeColour(IsHovered ? Colours.Red : Colours.YellowDark, TRANSFORM_DURATION, Easing.OutQuint);
|
||||||
|
|
||||||
|
this.ScaleTo(HandlingMouse || IsHovered ? 1.5f : 1, TRANSFORM_DURATION, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void OnOperationStarted()
|
protected void OnOperationStarted()
|
||||||
|
@ -35,8 +35,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
protected override void UpdateHoverState()
|
protected override void UpdateHoverState()
|
||||||
{
|
{
|
||||||
icon.Colour = !HandlingMouse && IsHovered ? Color4.White : Color4.Black;
|
|
||||||
base.UpdateHoverState();
|
base.UpdateHoverState();
|
||||||
|
icon.FadeColour(!HandlingMouse && IsHovered ? Color4.White : Color4.Black, TRANSFORM_DURATION, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user