Improve white-boxed game modes.

This commit is contained in:
Dean Herbert
2016-10-05 20:03:52 +09:00
parent 4eb310c3a5
commit c0f25a2683
14 changed files with 88 additions and 11 deletions

View File

@ -6,10 +6,12 @@ using System.Collections.Generic;
namespace osu.Game.GameModes.Edit namespace osu.Game.GameModes.Edit
{ {
class SongSelectEdit : GameModeWhiteBox class EditSongSelect : GameModeWhiteBox
{ {
protected override IEnumerable<Type> PossibleChildren => new[] { protected override IEnumerable<Type> PossibleChildren => new[] {
typeof(Editor) typeof(Editor)
}; };
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
} }
} }

View File

@ -6,10 +6,25 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using osu.Framework.GameModes;
using OpenTK.Graphics;
namespace osu.Game.GameModes.Edit namespace osu.Game.GameModes.Edit
{ {
class Editor : GameModeWhiteBox 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);
}
} }
} }

View File

@ -27,7 +27,7 @@ namespace osu.Game.GameModes
private Container textContainer; private Container textContainer;
private Box box; 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) protected override void OnEntering(GameMode last)
{ {

View File

@ -50,8 +50,8 @@ namespace osu.Game.GameModes.Menu
{ {
OnChart = delegate { Push(new ChartListing()); }, OnChart = delegate { Push(new ChartListing()); },
OnDirect = delegate { Push(new OnlineListing()); }, OnDirect = delegate { Push(new OnlineListing()); },
OnEdit = delegate { Push(new SongSelectEdit()); }, OnEdit = delegate { Push(new EditSongSelect()); },
OnSolo = delegate { Push(new SongSelectPlay()); }, OnSolo = delegate { Push(new PlaySongSelect()); },
OnMulti = delegate { Push(new Lobby()); }, OnMulti = delegate { Push(new Lobby()); },
OnTest = delegate { Push(new TestBrowser()); }, OnTest = delegate { Push(new TestBrowser()); },
OnExit = delegate { OnExit = delegate {

View File

@ -6,7 +6,9 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using osu.Framework.GameModes;
using osu.Game.GameModes.Play; using osu.Game.GameModes.Play;
using OpenTK.Graphics;
namespace osu.Game.GameModes.Multiplayer namespace osu.Game.GameModes.Multiplayer
{ {
@ -16,5 +18,19 @@ namespace osu.Game.GameModes.Multiplayer
typeof(MatchSongSelect), typeof(MatchSongSelect),
typeof(Player), 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);
}
} }
} }

View File

@ -6,10 +6,13 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using osu.Framework.GameModes;
using OpenTK.Graphics;
namespace osu.Game.GameModes.Multiplayer namespace osu.Game.GameModes.Multiplayer
{ {
class MatchSongSelect : GameModeWhiteBox class MatchSongSelect : GameModeWhiteBox
{ {
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
} }
} }

View File

@ -9,6 +9,7 @@ using System.Threading.Tasks;
using osu.Framework.GameModes; using osu.Framework.GameModes;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Background; using osu.Game.Graphics.Background;
using osu.Game.Graphics.Containers;
namespace osu.Game.GameModes namespace osu.Game.GameModes
{ {
@ -40,8 +41,14 @@ namespace osu.Game.GameModes
} }
else if (bg != null) else if (bg != null)
{ {
bg.Depth = float.MinValue; AddTopLevel(new ParallaxContainer
AddTopLevel(Background = bg); {
Depth = float.MinValue,
Children = new[]
{
Background = bg
}
});
} }

View File

@ -6,10 +6,25 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using OpenTK.Graphics;
using osu.Framework.GameModes;
namespace osu.Game.GameModes.Play namespace osu.Game.GameModes.Play
{ {
class ModSelect : GameModeWhiteBox 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);
}
} }
} }

View File

@ -6,8 +6,10 @@ using System.Collections.Generic;
namespace osu.Game.GameModes.Play namespace osu.Game.GameModes.Play
{ {
class SongSelectPlay : GameModeWhiteBox class PlaySongSelect : GameModeWhiteBox
{ {
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
protected override IEnumerable<Type> PossibleChildren => new[] { protected override IEnumerable<Type> PossibleChildren => new[] {
typeof(ModSelect), typeof(ModSelect),
typeof(Player) typeof(Player)

View File

@ -11,6 +11,8 @@ namespace osu.Game.GameModes.Play
{ {
class Player : GameModeWhiteBox class Player : GameModeWhiteBox
{ {
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
protected override IEnumerable<Type> PossibleChildren => new[] { protected override IEnumerable<Type> PossibleChildren => new[] {
typeof(Results) typeof(Results)
}; };

View File

@ -6,10 +6,25 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using osu.Framework.GameModes;
using OpenTK.Graphics;
namespace osu.Game.GameModes.Play namespace osu.Game.GameModes.Play
{ {
class Results : GameModeWhiteBox 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);
}
} }
} }

View File

@ -17,7 +17,7 @@ namespace osu.Game.Graphics.Background
string textureName; string textureName;
public Background(string textureName = @"Menu/background") public Background(string textureName = @"Backgrounds/bg1")
{ {
this.textureName = textureName; this.textureName = textureName;
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;

View File

@ -86,7 +86,7 @@
<Compile Include="GameModes\Play\PlayMode.cs" /> <Compile Include="GameModes\Play\PlayMode.cs" />
<Compile Include="GameModes\Play\Results.cs" /> <Compile Include="GameModes\Play\Results.cs" />
<Compile Include="GameModes\Direct\OnlineListing.cs" /> <Compile Include="GameModes\Direct\OnlineListing.cs" />
<Compile Include="GameModes\Play\SongSelectPlay.cs" /> <Compile Include="GameModes\Play\PlaySongSelect.cs" />
<Compile Include="GameModes\Play\Catch\CatchHitRenderer.cs" /> <Compile Include="GameModes\Play\Catch\CatchHitRenderer.cs" />
<Compile Include="GameModes\Play\Catch\CatchPlayfield.cs" /> <Compile Include="GameModes\Play\Catch\CatchPlayfield.cs" />
<Compile Include="GameModes\Play\HitRenderer.cs" /> <Compile Include="GameModes\Play\HitRenderer.cs" />
@ -97,7 +97,7 @@
<Compile Include="GameModes\Play\Playfield.cs" /> <Compile Include="GameModes\Play\Playfield.cs" />
<Compile Include="GameModes\Play\Taiko\TaikoHitRenderer.cs" /> <Compile Include="GameModes\Play\Taiko\TaikoHitRenderer.cs" />
<Compile Include="GameModes\Play\Taiko\TaikoPlayfield.cs" /> <Compile Include="GameModes\Play\Taiko\TaikoPlayfield.cs" />
<Compile Include="GameModes\Edit\SongSelectEdit.cs" /> <Compile Include="GameModes\Edit\EditSongSelect.cs" />
<Compile Include="Graphics\Background\Background.cs" /> <Compile Include="Graphics\Background\Background.cs" />
<Compile Include="Graphics\Containers\ParallaxContainer.cs" /> <Compile Include="Graphics\Containers\ParallaxContainer.cs" />
<Compile Include="Graphics\Cursor\OsuCursorContainer.cs" /> <Compile Include="Graphics\Cursor\OsuCursorContainer.cs" />