mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 04:02:59 +08:00
Move BackgroundModes to their own files.
This commit is contained in:
parent
d6042bd689
commit
d1dfa120d1
@ -8,7 +8,6 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Game.Graphics.Background;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.GameModes
|
||||
@ -61,35 +60,4 @@ namespace osu.Game.GameModes
|
||||
base.OnResuming(last);
|
||||
}
|
||||
}
|
||||
|
||||
public class BackgroundModeDefault : BackgroundMode
|
||||
{
|
||||
public override void Load()
|
||||
{
|
||||
base.Load();
|
||||
|
||||
Add(new Background());
|
||||
}
|
||||
}
|
||||
|
||||
public class BackgroundModeCustom : BackgroundMode
|
||||
{
|
||||
private readonly string textureName;
|
||||
|
||||
public BackgroundModeCustom(string textureName)
|
||||
{
|
||||
this.textureName = textureName;
|
||||
}
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
base.Load();
|
||||
Add(new Background(textureName));
|
||||
}
|
||||
|
||||
public override bool Equals(BackgroundMode other)
|
||||
{
|
||||
return base.Equals(other) && textureName == ((BackgroundModeCustom)other).textureName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
28
osu.Game/GameModes/Backgrounds/BackgroundModeCustom.cs
Normal file
28
osu.Game/GameModes/Backgrounds/BackgroundModeCustom.cs
Normal file
@ -0,0 +1,28 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Graphics.Background;
|
||||
|
||||
namespace osu.Game.GameModes.Backgrounds
|
||||
{
|
||||
public class BackgroundModeCustom : BackgroundMode
|
||||
{
|
||||
private readonly string textureName;
|
||||
|
||||
public BackgroundModeCustom(string textureName)
|
||||
{
|
||||
this.textureName = textureName;
|
||||
}
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
base.Load();
|
||||
Add(new Background(textureName));
|
||||
}
|
||||
|
||||
public override bool Equals(BackgroundMode other)
|
||||
{
|
||||
return base.Equals(other) && textureName == ((BackgroundModeCustom)other).textureName;
|
||||
}
|
||||
}
|
||||
}
|
17
osu.Game/GameModes/Backgrounds/BackgroundModeDefault.cs
Normal file
17
osu.Game/GameModes/Backgrounds/BackgroundModeDefault.cs
Normal file
@ -0,0 +1,17 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Graphics.Background;
|
||||
|
||||
namespace osu.Game.GameModes.Backgrounds
|
||||
{
|
||||
public class BackgroundModeDefault : BackgroundMode
|
||||
{
|
||||
public override void Load()
|
||||
{
|
||||
base.Load();
|
||||
|
||||
Add(new Background());
|
||||
}
|
||||
}
|
||||
}
|
10
osu.Game/GameModes/Backgrounds/BackgroundModeEmpty.cs
Normal file
10
osu.Game/GameModes/Backgrounds/BackgroundModeEmpty.cs
Normal file
@ -0,0 +1,10 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.GameModes.Backgrounds
|
||||
{
|
||||
public class BackgroundModeEmpty : BackgroundMode
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
|
||||
namespace osu.Game.GameModes.Edit
|
||||
{
|
||||
|
@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.GameModes.Edit
|
||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Drawables;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
|
@ -5,11 +5,14 @@ using System;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
|
||||
namespace osu.Game.GameModes.Menu
|
||||
{
|
||||
class Intro : OsuGameMode
|
||||
{
|
||||
protected override BackgroundMode CreateBackground() => new BackgroundModeEmpty();
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
base.Load();
|
||||
|
@ -7,6 +7,7 @@ using osu.Framework.GameModes;
|
||||
using osu.Framework.GameModes.Testing;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Game.GameModes.Charts;
|
||||
using osu.Game.GameModes.Direct;
|
||||
using osu.Game.GameModes.Edit;
|
||||
|
@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Game.GameModes.Play;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
|
@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.GameModes.Multiplayer
|
||||
|
@ -8,6 +8,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
{
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
{
|
||||
|
@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
|
@ -70,6 +70,9 @@
|
||||
<Compile Include="Beatmaps\Timing\TimingChange.cs" />
|
||||
<Compile Include="Configuration\OsuConfigManager.cs" />
|
||||
<Compile Include="GameModes\BackgroundMode.cs" />
|
||||
<Compile Include="GameModes\Backgrounds\BackgroundModeCustom.cs" />
|
||||
<Compile Include="GameModes\Backgrounds\BackgroundModeDefault.cs" />
|
||||
<Compile Include="GameModes\Backgrounds\BackgroundModeEmpty.cs" />
|
||||
<Compile Include="GameModes\Charts\ChartInfo.cs" />
|
||||
<Compile Include="GameModes\Edit\Editor.cs" />
|
||||
<Compile Include="GameModes\GameModeWhiteBox.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user