1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Fix catch combo colouring

This commit is contained in:
Dean Herbert 2020-02-19 10:28:20 +09:00
parent ab863cdfd9
commit f245fe5934
2 changed files with 21 additions and 37 deletions

View File

@ -8,7 +8,6 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Utils; using osu.Framework.Utils;
using osu.Game.Skinning; using osu.Game.Skinning;
using osuTK; using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Catch.Objects.Drawable namespace osu.Game.Rulesets.Catch.Objects.Drawable
{ {
@ -46,8 +45,6 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
} }
}); });
AccentColour.Value = colourForRepresentation(HitObject.VisualRepresentation);
scaleContainer.Scale = new Vector2(HitObject.Scale); scaleContainer.Scale = new Vector2(HitObject.Scale);
} }
@ -74,37 +71,5 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
throw new ArgumentOutOfRangeException(nameof(hitObjectVisualRepresentation), hitObjectVisualRepresentation, null); throw new ArgumentOutOfRangeException(nameof(hitObjectVisualRepresentation), hitObjectVisualRepresentation, null);
} }
} }
private Color4 colourForRepresentation(FruitVisualRepresentation representation)
{
switch (representation)
{
default:
case FruitVisualRepresentation.Pear:
return new Color4(17, 136, 170, 255);
case FruitVisualRepresentation.Grape:
return new Color4(204, 102, 0, 255);
case FruitVisualRepresentation.Raspberry:
return new Color4(121, 9, 13, 255);
case FruitVisualRepresentation.Pineapple:
return new Color4(102, 136, 0, 255);
case FruitVisualRepresentation.Banana:
switch (RNG.Next(0, 3))
{
default:
return new Color4(255, 240, 0, 255);
case 1:
return new Color4(255, 192, 0, 255);
case 2:
return new Color4(214, 221, 28, 255);
}
}
}
} }
} }

View File

@ -7,6 +7,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Utils;
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces; using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
using osuTK; using osuTK;
@ -249,6 +250,9 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
}; };
case FruitVisualRepresentation.Banana: case FruitVisualRepresentation.Banana:
Color4 bananaColour = getBananaColour();
return new Container return new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -256,13 +260,13 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
{ {
new Pulp new Pulp
{ {
AccentColour = accentColour.Value, AccentColour = bananaColour,
Size = new Vector2(small_pulp), Size = new Vector2(small_pulp),
Y = -0.3f Y = -0.3f
}, },
new Pulp new Pulp
{ {
AccentColour = accentColour.Value, AccentColour = bananaColour,
Size = new Vector2(large_pulp_4 * 0.8f, large_pulp_4 * 2.5f), Size = new Vector2(large_pulp_4 * 0.8f, large_pulp_4 * 2.5f),
Y = 0.05f, Y = 0.05f,
}, },
@ -270,5 +274,20 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
}; };
} }
} }
private Color4 getBananaColour()
{
switch (RNG.Next(0, 3))
{
default:
return new Color4(255, 240, 0, 255);
case 1:
return new Color4(255, 192, 0, 255);
case 2:
return new Color4(214, 221, 28, 255);
}
}
} }
} }