From b8e87e3a08d0cc92363a24d7bf32127509a67311 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Mar 2023 19:58:05 +0900 Subject: [PATCH 1/4] Update osu!mania argon colours to match new proposal --- .../Argon/ManiaArgonSkinTransformer.cs | 249 +++++++++++++++--- 1 file changed, 207 insertions(+), 42 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs index 057b7eb0d9..75ecd53cd1 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs @@ -69,6 +69,17 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon return base.GetDrawableComponent(lookup); } + private static readonly Color4 colour_special_column = new Color4(169, 106, 255, 255); + + private const int total_colours = 6; + + private static readonly Color4 colour_yellow = new Color4(255, 197, 40, 255); + private static readonly Color4 colour_orange = new Color4(252, 109, 1, 255); + private static readonly Color4 colour_pink = new Color4(213, 35, 90, 255); + private static readonly Color4 colour_purple = new Color4(203, 60, 236, 255); + private static readonly Color4 colour_cyan = new Color4(72, 198, 255, 255); + private static readonly Color4 colour_green = new Color4(100, 192, 92, 255); + public override IBindable? GetConfig(TLookup lookup) { if (lookup is ManiaSkinConfigurationLookup maniaLookup) @@ -92,48 +103,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon case LegacyManiaSkinConfigurationLookups.ColumnBackgroundColour: - Color4 colour; - - const int total_colours = 7; - - if (stage.IsSpecialColumn(column)) - colour = new Color4(159, 101, 255, 255); - else - { - switch (column % total_colours) - { - case 0: - colour = new Color4(240, 216, 0, 255); - break; - - case 1: - colour = new Color4(240, 101, 0, 255); - break; - - case 2: - colour = new Color4(240, 0, 130, 255); - break; - - case 3: - colour = new Color4(192, 0, 240, 255); - break; - - case 4: - colour = new Color4(0, 96, 240, 255); - break; - - case 5: - colour = new Color4(0, 226, 240, 255); - break; - - case 6: - colour = new Color4(0, 240, 96, 255); - break; - - default: - throw new ArgumentOutOfRangeException(); - } - } + var colour = getColourForLayout(column, stage); return SkinUtils.As(new Bindable(colour)); } @@ -141,5 +111,200 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon return base.GetConfig(lookup); } + + private Color4 getColourForLayout(int column, StageDefinition stage) + { + // For now, these are defined per column count as per https://user-images.githubusercontent.com/50823728/218038463-b450f46c-ef21-4551-b133-f866be59970c.png + // See https://github.com/ppy/osu/discussions/21996 for discussion. + switch (stage.Columns) + { + case 1: + return colour_yellow; + + case 2: + switch (column) + { + case 0: return colour_green; + + case 1: return colour_cyan; + + default: throw new ArgumentOutOfRangeException(); + } + + case 3: + switch (column) + { + case 0: return colour_pink; + + case 1: return colour_purple; + + case 2: return colour_special_column; + + default: throw new ArgumentOutOfRangeException(); + } + + case 4: + switch (column) + { + case 0: return colour_yellow; + + case 1: return colour_orange; + + case 2: return colour_pink; + + case 3: return colour_purple; + + default: throw new ArgumentOutOfRangeException(); + } + + case 5: + switch (column) + { + case 0: return colour_pink; + + case 1: return colour_orange; + + case 2: return colour_yellow; + + case 3: return colour_green; + + case 4: return colour_cyan; + + default: throw new ArgumentOutOfRangeException(); + } + + case 6: + switch (column) + { + case 0: return colour_pink; + + case 1: return colour_orange; + + case 2: return colour_yellow; + + case 3: return colour_cyan; + + case 4: return colour_purple; + + case 5: return colour_pink; + + default: throw new ArgumentOutOfRangeException(); + } + + case 7: + switch (column) + { + case 0: return colour_pink; + + case 1: return colour_cyan; + + case 2: return colour_pink; + + case 3: return colour_special_column; + + case 4: return colour_green; + + case 5: return colour_cyan; + + case 6: return colour_green; + + default: throw new ArgumentOutOfRangeException(); + } + + case 8: + switch (column) + { + case 0: return colour_purple; + + case 1: return colour_pink; + + case 2: return colour_orange; + + case 3: return colour_yellow; + + case 4: return colour_yellow; + + case 5: return colour_orange; + + case 6: return colour_pink; + + case 7: return colour_purple; + + default: throw new ArgumentOutOfRangeException(); + } + + case 9: + switch (column) + { + case 0: return colour_purple; + + case 1: return colour_pink; + + case 2: return colour_orange; + + case 3: return colour_yellow; + + case 4: return colour_special_column; + + case 5: return colour_yellow; + + case 6: return colour_orange; + + case 7: return colour_pink; + + case 8: return colour_purple; + + default: throw new ArgumentOutOfRangeException(); + } + + case 10: + switch (column) + { + case 0: return colour_purple; + + case 1: return colour_pink; + + case 2: return colour_orange; + + case 3: return colour_yellow; + + case 4: return colour_cyan; + + case 5: return colour_green; + + case 6: return colour_yellow; + + case 7: return colour_orange; + + case 8: return colour_pink; + + case 9: return colour_purple; + + default: throw new ArgumentOutOfRangeException(); + } + } + + // fallback for unhandled scenarios + + if (stage.IsSpecialColumn(column)) + return colour_special_column; + + switch (column % total_colours) + { + case 0: return new Color4(255, 197, 40, 255); + + case 1: return new Color4(252, 109, 1, 255); + + case 2: return new Color4(213, 35, 90, 255); + + case 3: return new Color4(203, 60, 236, 255); + + case 4: return new Color4(72, 198, 255, 255); + + case 5: return new Color4(100, 192, 92, 255); + + default: throw new ArgumentOutOfRangeException(); + } + } } } From e2467848679538557c64608152dc4ad3872223d0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 Mar 2023 18:25:30 +0900 Subject: [PATCH 2/4] Fix dual stage column colours not being looked up correctly --- .../Argon/ManiaArgonSkinTransformer.cs | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs index 75ecd53cd1..0beca815b2 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs @@ -84,8 +84,8 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon { if (lookup is ManiaSkinConfigurationLookup maniaLookup) { - int column = maniaLookup.ColumnIndex ?? 0; - var stage = beatmap.GetStageForColumnIndex(column); + int columnIndex = maniaLookup.ColumnIndex ?? 0; + var stage = beatmap.GetStageForColumnIndex(columnIndex); switch (maniaLookup.Lookup) { @@ -98,12 +98,12 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon case LegacyManiaSkinConfigurationLookups.ColumnWidth: return SkinUtils.As(new Bindable( - stage.IsSpecialColumn(column) ? 120 : 60 + stage.IsSpecialColumn(columnIndex) ? 120 : 60 )); case LegacyManiaSkinConfigurationLookups.ColumnBackgroundColour: - var colour = getColourForLayout(column, stage); + var colour = getColourForLayout(columnIndex, stage); return SkinUtils.As(new Bindable(colour)); } @@ -112,8 +112,11 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon return base.GetConfig(lookup); } - private Color4 getColourForLayout(int column, StageDefinition stage) + private Color4 getColourForLayout(int columnIndex, StageDefinition stage) { + // Account for cases like dual-stage (assume that all stages have the same column count for now). + columnIndex %= stage.Columns; + // For now, these are defined per column count as per https://user-images.githubusercontent.com/50823728/218038463-b450f46c-ef21-4551-b133-f866be59970c.png // See https://github.com/ppy/osu/discussions/21996 for discussion. switch (stage.Columns) @@ -122,7 +125,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon return colour_yellow; case 2: - switch (column) + switch (columnIndex) { case 0: return colour_green; @@ -132,7 +135,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon } case 3: - switch (column) + switch (columnIndex) { case 0: return colour_pink; @@ -144,7 +147,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon } case 4: - switch (column) + switch (columnIndex) { case 0: return colour_yellow; @@ -158,7 +161,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon } case 5: - switch (column) + switch (columnIndex) { case 0: return colour_pink; @@ -174,7 +177,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon } case 6: - switch (column) + switch (columnIndex) { case 0: return colour_pink; @@ -192,7 +195,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon } case 7: - switch (column) + switch (columnIndex) { case 0: return colour_pink; @@ -212,7 +215,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon } case 8: - switch (column) + switch (columnIndex) { case 0: return colour_purple; @@ -234,7 +237,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon } case 9: - switch (column) + switch (columnIndex) { case 0: return colour_purple; @@ -258,7 +261,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon } case 10: - switch (column) + switch (columnIndex) { case 0: return colour_purple; @@ -286,10 +289,10 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon // fallback for unhandled scenarios - if (stage.IsSpecialColumn(column)) + if (stage.IsSpecialColumn(columnIndex)) return colour_special_column; - switch (column % total_colours) + switch (columnIndex % total_colours) { case 0: return new Color4(255, 197, 40, 255); From d87f0557cef3288a72eb0ba9d21610a2433c2124 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Mar 2023 17:18:45 +0900 Subject: [PATCH 3/4] Update colours for 3k to not use double-purples --- .../Skinning/Argon/ManiaArgonSkinTransformer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs index 0beca815b2..ca9cd83a63 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs @@ -139,9 +139,9 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon { case 0: return colour_pink; - case 1: return colour_purple; + case 1: return colour_orange; - case 2: return colour_special_column; + case 2: return colour_yellow; default: throw new ArgumentOutOfRangeException(); } From fe91f85f6fe9afea0139408fc07c0b21d8dc93d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 20 Mar 2023 18:16:33 +0100 Subject: [PATCH 4/4] Reuse colour constants in fallback path --- .../Skinning/Argon/ManiaArgonSkinTransformer.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs index ca9cd83a63..dbea9c7c88 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs @@ -294,17 +294,17 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon switch (columnIndex % total_colours) { - case 0: return new Color4(255, 197, 40, 255); + case 0: return colour_yellow; - case 1: return new Color4(252, 109, 1, 255); + case 1: return colour_orange; - case 2: return new Color4(213, 35, 90, 255); + case 2: return colour_pink; - case 3: return new Color4(203, 60, 236, 255); + case 3: return colour_purple; - case 4: return new Color4(72, 198, 255, 255); + case 4: return colour_cyan; - case 5: return new Color4(100, 192, 92, 255); + case 5: return colour_green; default: throw new ArgumentOutOfRangeException(); }