mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Fixed OsuColour shenanigans
This commit is contained in:
parent
b3e620c8e5
commit
362c9050df
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#pragma warning disable IDE0001 // Simplify Names
|
#pragma warning disable IDE0001 // Simplify Names
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -44,6 +43,9 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
|
|
||||||
private Bindable<TaikoTouchControlScheme> configTouchControlScheme = new Bindable<TaikoTouchControlScheme>();
|
private Bindable<TaikoTouchControlScheme> configTouchControlScheme = new Bindable<TaikoTouchControlScheme>();
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuColour colours { get; set; } = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(TaikoInputManager taikoInputManager, TaikoRulesetConfigManager config)
|
private void load(TaikoInputManager taikoInputManager, TaikoRulesetConfigManager config)
|
||||||
{
|
{
|
||||||
@ -75,27 +77,27 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
leftRim = new QuarterCircle(getTaikoActionFromInput(TaikoInput.LeftRim))
|
leftRim = new QuarterCircle(getTaikoActionFromInput(TaikoInput.LeftRim), getColourFromTaikoAction(getTaikoActionFromInput(TaikoInput.LeftRim)))
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomCentre,
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
X = -2,
|
X = -2,
|
||||||
},
|
},
|
||||||
rightRim = new QuarterCircle(getTaikoActionFromInput(TaikoInput.RightRim))
|
rightRim = new QuarterCircle(getTaikoActionFromInput(TaikoInput.RightRim), getColourFromTaikoAction(getTaikoActionFromInput(TaikoInput.RightRim)))
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomCentre,
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
X = 2,
|
X = 2,
|
||||||
Rotation = 90,
|
Rotation = 90,
|
||||||
},
|
},
|
||||||
leftCentre = new QuarterCircle(getTaikoActionFromInput(TaikoInput.LeftCentre))
|
leftCentre = new QuarterCircle(getTaikoActionFromInput(TaikoInput.LeftCentre), getColourFromTaikoAction(getTaikoActionFromInput(TaikoInput.LeftCentre)))
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomCentre,
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
X = -2,
|
X = -2,
|
||||||
Scale = new Vector2(centre_region),
|
Scale = new Vector2(centre_region),
|
||||||
},
|
},
|
||||||
rightCentre = new QuarterCircle(getTaikoActionFromInput(TaikoInput.RightCentre))
|
rightCentre = new QuarterCircle(getTaikoActionFromInput(TaikoInput.RightCentre), getColourFromTaikoAction(getTaikoActionFromInput(TaikoInput.RightCentre)))
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomCentre,
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
@ -216,6 +218,19 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
mainContent.FadeOut(300);
|
mainContent.FadeOut(300);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Color4 getColourFromTaikoAction(TaikoAction handledAction)
|
||||||
|
{
|
||||||
|
#pragma warning disable format
|
||||||
|
switch (handledAction)
|
||||||
|
{
|
||||||
|
case TaikoAction.LeftRim: return colours.Blue;
|
||||||
|
case TaikoAction.LeftCentre: return colours.Red;
|
||||||
|
case TaikoAction.RightCentre: return colours.Red;
|
||||||
|
case TaikoAction.RightRim: return colours.Blue;
|
||||||
|
}
|
||||||
|
#pragma warning restore format
|
||||||
|
return colours.Red;
|
||||||
|
}
|
||||||
private partial class QuarterCircle : CompositeDrawable, IKeyBindingHandler<TaikoAction>
|
private partial class QuarterCircle : CompositeDrawable, IKeyBindingHandler<TaikoAction>
|
||||||
{
|
{
|
||||||
private readonly Circle overlay;
|
private readonly Circle overlay;
|
||||||
@ -226,24 +241,8 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => circle.Contains(screenSpacePos);
|
public override bool Contains(Vector2 screenSpacePos) => circle.Contains(screenSpacePos);
|
||||||
|
|
||||||
[Resolved]
|
public QuarterCircle(TaikoAction handledAction, Color4 colour)
|
||||||
private OsuColour colours { get; set; } = null!;
|
|
||||||
|
|
||||||
public QuarterCircle(TaikoAction handledAction)
|
|
||||||
{
|
{
|
||||||
Color4 colour = ((Func<Color4>)(() =>
|
|
||||||
{
|
|
||||||
#pragma warning disable format
|
|
||||||
switch (handledAction)
|
|
||||||
{
|
|
||||||
case TaikoAction.LeftRim: return colours.Blue;
|
|
||||||
case TaikoAction.LeftCentre: return colours.Red;
|
|
||||||
case TaikoAction.RightCentre: return colours.Red;
|
|
||||||
case TaikoAction.RightRim: return colours.Blue;
|
|
||||||
}
|
|
||||||
#pragma warning restore format
|
|
||||||
return colours.Red;
|
|
||||||
}))();
|
|
||||||
|
|
||||||
this.handledAction = handledAction;
|
this.handledAction = handledAction;
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user