From f245fe59345e5b0b35aad2aadd9351774921dfac Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 19 Feb 2020 10:28:20 +0900 Subject: [PATCH] Fix catch combo colouring --- .../Objects/Drawable/DrawableFruit.cs | 35 ------------------- .../Objects/Drawable/FruitPiece.cs | 23 ++++++++++-- 2 files changed, 21 insertions(+), 37 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index 0790e0234c..73ca58fd0a 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -8,7 +8,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Utils; using osu.Game.Skinning; using osuTK; -using osuTK.Graphics; 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); } @@ -74,37 +71,5 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable 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); - } - } - } } } diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/FruitPiece.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/FruitPiece.cs index e4c110802b..4098103569 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/FruitPiece.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/FruitPiece.cs @@ -7,6 +7,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Utils; using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces; using osu.Game.Rulesets.Objects.Drawables; using osuTK; @@ -249,6 +250,9 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable }; case FruitVisualRepresentation.Banana: + + Color4 bananaColour = getBananaColour(); + return new Container { RelativeSizeAxes = Axes.Both, @@ -256,13 +260,13 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { new Pulp { - AccentColour = accentColour.Value, + AccentColour = bananaColour, Size = new Vector2(small_pulp), Y = -0.3f }, new Pulp { - AccentColour = accentColour.Value, + AccentColour = bananaColour, Size = new Vector2(large_pulp_4 * 0.8f, large_pulp_4 * 2.5f), 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); + } + } } }