From c0f25a26834b26e380b0a15ba5a478b6a646ea58 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 5 Oct 2016 20:03:52 +0900 Subject: [PATCH] Improve white-boxed game modes. --- osu-resources | 2 +- .../{SongSelectEdit.cs => EditSongSelect.cs} | 4 +++- osu.Game/GameModes/Edit/Editor.cs | 15 +++++++++++++++ osu.Game/GameModes/GameModeWhiteBox.cs | 2 +- osu.Game/GameModes/Menu/MainMenu.cs | 4 ++-- osu.Game/GameModes/Multiplayer/Match.cs | 16 ++++++++++++++++ .../GameModes/Multiplayer/MatchSongSelect.cs | 3 +++ osu.Game/GameModes/OsuGameMode.cs | 11 +++++++++-- osu.Game/GameModes/Play/ModSelect.cs | 15 +++++++++++++++ .../{SongSelectPlay.cs => PlaySongSelect.cs} | 4 +++- osu.Game/GameModes/Play/Player.cs | 2 ++ osu.Game/GameModes/Play/Results.cs | 15 +++++++++++++++ osu.Game/Graphics/Background/Background.cs | 2 +- osu.Game/osu.Game.csproj | 4 ++-- 14 files changed, 88 insertions(+), 11 deletions(-) rename osu.Game/GameModes/Edit/{SongSelectEdit.cs => EditSongSelect.cs} (68%) rename osu.Game/GameModes/Play/{SongSelectPlay.cs => PlaySongSelect.cs} (69%) diff --git a/osu-resources b/osu-resources index cc107f9bcf..6d9bbe6c83 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit cc107f9bcfc8efeeff88f19c2df8cec9755eda39 +Subproject commit 6d9bbe6c838e4b89b69d5ad49b37b434aa62281e diff --git a/osu.Game/GameModes/Edit/SongSelectEdit.cs b/osu.Game/GameModes/Edit/EditSongSelect.cs similarity index 68% rename from osu.Game/GameModes/Edit/SongSelectEdit.cs rename to osu.Game/GameModes/Edit/EditSongSelect.cs index a6c0f9fdf5..3578aecb35 100644 --- a/osu.Game/GameModes/Edit/SongSelectEdit.cs +++ b/osu.Game/GameModes/Edit/EditSongSelect.cs @@ -6,10 +6,12 @@ using System.Collections.Generic; namespace osu.Game.GameModes.Edit { - class SongSelectEdit : GameModeWhiteBox + class EditSongSelect : GameModeWhiteBox { protected override IEnumerable PossibleChildren => new[] { typeof(Editor) }; + + protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4"); } } diff --git a/osu.Game/GameModes/Edit/Editor.cs b/osu.Game/GameModes/Edit/Editor.cs index 779aa105f9..c7027a9479 100644 --- a/osu.Game/GameModes/Edit/Editor.cs +++ b/osu.Game/GameModes/Edit/Editor.cs @@ -6,10 +6,25 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using osu.Framework.GameModes; +using OpenTK.Graphics; namespace osu.Game.GameModes.Edit { class Editor : GameModeWhiteBox { + protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4"); + + protected override void OnEntering(GameMode last) + { + base.OnEntering(last); + Background.FadeColour(Color4.DarkGray, 500); + } + + protected override void OnExiting(GameMode next) + { + base.OnExiting(next); + Background.FadeColour(Color4.White, 500); + } } } diff --git a/osu.Game/GameModes/GameModeWhiteBox.cs b/osu.Game/GameModes/GameModeWhiteBox.cs index a36c46885c..4eb8945f04 100644 --- a/osu.Game/GameModes/GameModeWhiteBox.cs +++ b/osu.Game/GameModes/GameModeWhiteBox.cs @@ -27,7 +27,7 @@ namespace osu.Game.GameModes private Container textContainer; private Box box; - protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Menu/songselect"); + protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg2"); protected override void OnEntering(GameMode last) { diff --git a/osu.Game/GameModes/Menu/MainMenu.cs b/osu.Game/GameModes/Menu/MainMenu.cs index 599639ca82..a5122d1d7b 100644 --- a/osu.Game/GameModes/Menu/MainMenu.cs +++ b/osu.Game/GameModes/Menu/MainMenu.cs @@ -50,8 +50,8 @@ namespace osu.Game.GameModes.Menu { OnChart = delegate { Push(new ChartListing()); }, OnDirect = delegate { Push(new OnlineListing()); }, - OnEdit = delegate { Push(new SongSelectEdit()); }, - OnSolo = delegate { Push(new SongSelectPlay()); }, + OnEdit = delegate { Push(new EditSongSelect()); }, + OnSolo = delegate { Push(new PlaySongSelect()); }, OnMulti = delegate { Push(new Lobby()); }, OnTest = delegate { Push(new TestBrowser()); }, OnExit = delegate { diff --git a/osu.Game/GameModes/Multiplayer/Match.cs b/osu.Game/GameModes/Multiplayer/Match.cs index e8a476a37d..5e31976764 100644 --- a/osu.Game/GameModes/Multiplayer/Match.cs +++ b/osu.Game/GameModes/Multiplayer/Match.cs @@ -6,7 +6,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using osu.Framework.GameModes; using osu.Game.GameModes.Play; +using OpenTK.Graphics; namespace osu.Game.GameModes.Multiplayer { @@ -16,5 +18,19 @@ namespace osu.Game.GameModes.Multiplayer typeof(MatchSongSelect), typeof(Player), }; + + protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4"); + + protected override void OnEntering(GameMode last) + { + base.OnEntering(last); + Background.FadeColour(Color4.DarkGray, 500); + } + + protected override void OnExiting(GameMode next) + { + base.OnExiting(next); + Background.FadeColour(Color4.White, 500); + } } } diff --git a/osu.Game/GameModes/Multiplayer/MatchSongSelect.cs b/osu.Game/GameModes/Multiplayer/MatchSongSelect.cs index f58ce5f7d1..eebf8868e8 100644 --- a/osu.Game/GameModes/Multiplayer/MatchSongSelect.cs +++ b/osu.Game/GameModes/Multiplayer/MatchSongSelect.cs @@ -6,10 +6,13 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using osu.Framework.GameModes; +using OpenTK.Graphics; namespace osu.Game.GameModes.Multiplayer { class MatchSongSelect : GameModeWhiteBox { + protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4"); } } diff --git a/osu.Game/GameModes/OsuGameMode.cs b/osu.Game/GameModes/OsuGameMode.cs index a0ac4d4567..ad4a5b416b 100644 --- a/osu.Game/GameModes/OsuGameMode.cs +++ b/osu.Game/GameModes/OsuGameMode.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using osu.Framework.GameModes; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Background; +using osu.Game.Graphics.Containers; namespace osu.Game.GameModes { @@ -40,8 +41,14 @@ namespace osu.Game.GameModes } else if (bg != null) { - bg.Depth = float.MinValue; - AddTopLevel(Background = bg); + AddTopLevel(new ParallaxContainer + { + Depth = float.MinValue, + Children = new[] + { + Background = bg + } + }); } diff --git a/osu.Game/GameModes/Play/ModSelect.cs b/osu.Game/GameModes/Play/ModSelect.cs index 5254f9b1a0..e6db9dd60a 100644 --- a/osu.Game/GameModes/Play/ModSelect.cs +++ b/osu.Game/GameModes/Play/ModSelect.cs @@ -6,10 +6,25 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using OpenTK.Graphics; +using osu.Framework.GameModes; namespace osu.Game.GameModes.Play { class ModSelect : GameModeWhiteBox { + protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4"); + + protected override void OnEntering(GameMode last) + { + base.OnEntering(last); + Background.FadeColour(Color4.DarkGray, 500); + } + + protected override void OnExiting(GameMode next) + { + base.OnExiting(next); + Background.FadeColour(Color4.White, 500); + } } } diff --git a/osu.Game/GameModes/Play/SongSelectPlay.cs b/osu.Game/GameModes/Play/PlaySongSelect.cs similarity index 69% rename from osu.Game/GameModes/Play/SongSelectPlay.cs rename to osu.Game/GameModes/Play/PlaySongSelect.cs index f2547a028b..6ac557534d 100644 --- a/osu.Game/GameModes/Play/SongSelectPlay.cs +++ b/osu.Game/GameModes/Play/PlaySongSelect.cs @@ -6,8 +6,10 @@ using System.Collections.Generic; namespace osu.Game.GameModes.Play { - class SongSelectPlay : GameModeWhiteBox + class PlaySongSelect : GameModeWhiteBox { + protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4"); + protected override IEnumerable PossibleChildren => new[] { typeof(ModSelect), typeof(Player) diff --git a/osu.Game/GameModes/Play/Player.cs b/osu.Game/GameModes/Play/Player.cs index 37663dbc2f..f73ac0506a 100644 --- a/osu.Game/GameModes/Play/Player.cs +++ b/osu.Game/GameModes/Play/Player.cs @@ -11,6 +11,8 @@ namespace osu.Game.GameModes.Play { class Player : GameModeWhiteBox { + protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4"); + protected override IEnumerable PossibleChildren => new[] { typeof(Results) }; diff --git a/osu.Game/GameModes/Play/Results.cs b/osu.Game/GameModes/Play/Results.cs index cbfe4f1c4b..18811fd4d1 100644 --- a/osu.Game/GameModes/Play/Results.cs +++ b/osu.Game/GameModes/Play/Results.cs @@ -6,10 +6,25 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using osu.Framework.GameModes; +using OpenTK.Graphics; namespace osu.Game.GameModes.Play { class Results : GameModeWhiteBox { + protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4"); + + protected override void OnEntering(GameMode last) + { + base.OnEntering(last); + Background.FadeColour(Color4.DarkGray, 500); + } + + protected override void OnExiting(GameMode next) + { + base.OnExiting(next); + Background.FadeColour(Color4.White, 500); + } } } diff --git a/osu.Game/Graphics/Background/Background.cs b/osu.Game/Graphics/Background/Background.cs index b9e975f5db..8333d975f9 100644 --- a/osu.Game/Graphics/Background/Background.cs +++ b/osu.Game/Graphics/Background/Background.cs @@ -17,7 +17,7 @@ namespace osu.Game.Graphics.Background string textureName; - public Background(string textureName = @"Menu/background") + public Background(string textureName = @"Backgrounds/bg1") { this.textureName = textureName; RelativeSizeAxes = Axes.Both; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 806420e26c..5b9dacf34c 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -86,7 +86,7 @@ - + @@ -97,7 +97,7 @@ - +