mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 15:52:54 +08:00
Remove all non-load Game access.
This commit is contained in:
parent
48bd998f46
commit
4052a665bf
@ -16,6 +16,7 @@ using System.Diagnostics;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Online.Chat.Display.osu.Online.Social;
|
using osu.Game.Online.Chat.Display.osu.Online.Social;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Desktop.Tests
|
namespace osu.Desktop.Tests
|
||||||
{
|
{
|
||||||
@ -31,10 +32,17 @@ namespace osu.Desktop.Tests
|
|||||||
|
|
||||||
private Scheduler scheduler = new Scheduler();
|
private Scheduler scheduler = new Scheduler();
|
||||||
|
|
||||||
private APIAccess api => ((OsuGameBase)Game).API;
|
private APIAccess api;
|
||||||
|
|
||||||
private long? lastMessageId;
|
private long? lastMessageId;
|
||||||
|
|
||||||
|
public override void Load(BaseGame game)
|
||||||
|
{
|
||||||
|
base.Load(game);
|
||||||
|
|
||||||
|
api = ((OsuGameBase)game).API;
|
||||||
|
}
|
||||||
|
|
||||||
public override void Reset()
|
public override void Reset()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.Reset();
|
||||||
|
@ -9,9 +9,9 @@ namespace osu.Framework.VisualTests
|
|||||||
{
|
{
|
||||||
class VisualTestGame : OsuGameBase
|
class VisualTestGame : OsuGameBase
|
||||||
{
|
{
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Add(new TestBrowser());
|
Add(new TestBrowser());
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Transformations;
|
|||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes
|
namespace osu.Game.GameModes
|
||||||
{
|
{
|
||||||
@ -30,9 +31,9 @@ namespace osu.Game.GameModes
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Content.Scale *= 1 + (x_movement_amount / Size.X) * 2;
|
Content.Scale *= 1 + (x_movement_amount / Size.X) * 2;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework;
|
||||||
using osu.Game.Graphics.Background;
|
using osu.Game.Graphics.Background;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Backgrounds
|
namespace osu.Game.GameModes.Backgrounds
|
||||||
@ -14,9 +15,9 @@ namespace osu.Game.GameModes.Backgrounds
|
|||||||
this.textureName = textureName;
|
this.textureName = textureName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
Add(new Background(textureName));
|
Add(new Background(textureName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework;
|
||||||
using osu.Game.Graphics.Background;
|
using osu.Game.Graphics.Background;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Backgrounds
|
namespace osu.Game.GameModes.Backgrounds
|
||||||
{
|
{
|
||||||
public class BackgroundModeDefault : BackgroundMode
|
public class BackgroundModeDefault : BackgroundMode
|
||||||
{
|
{
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Add(new Background());
|
Add(new Background());
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ using osu.Framework.Graphics.UserInterface;
|
|||||||
using osu.Game.GameModes.Backgrounds;
|
using osu.Game.GameModes.Backgrounds;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes
|
namespace osu.Game.GameModes
|
||||||
{
|
{
|
||||||
@ -77,9 +78,9 @@ namespace osu.Game.GameModes
|
|||||||
Content.FadeIn(transition_time, EasingTypes.OutExpo);
|
Content.FadeIn(transition_time, EasingTypes.OutExpo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,7 @@ using osu.Game.Graphics.Containers;
|
|||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Menu
|
namespace osu.Game.GameModes.Menu
|
||||||
{
|
{
|
||||||
@ -63,9 +64,9 @@ namespace osu.Game.GameModes.Menu
|
|||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -346,9 +347,9 @@ namespace osu.Game.GameModes.Menu
|
|||||||
this.text = text;
|
this.text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
Alpha = 0;
|
Alpha = 0;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
@ -23,9 +23,9 @@ namespace osu.Game.GameModes.Menu
|
|||||||
|
|
||||||
protected override BackgroundMode CreateBackground() => new BackgroundModeEmpty();
|
protected override BackgroundMode CreateBackground() => new BackgroundModeEmpty();
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(Framework.BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -39,9 +39,9 @@ namespace osu.Game.GameModes.Menu
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AudioSample welcome = Game.Audio.Sample.Get(@"welcome");
|
AudioSample welcome = game.Audio.Sample.Get(@"welcome");
|
||||||
|
|
||||||
AudioTrack bgm = Game.Audio.Track.Get(@"circles");
|
AudioTrack bgm = game.Audio.Track.Get(@"circles");
|
||||||
bgm.Looping = true;
|
bgm.Looping = true;
|
||||||
|
|
||||||
Scheduler.Add(delegate
|
Scheduler.Add(delegate
|
||||||
|
@ -15,6 +15,7 @@ using osu.Game.GameModes.Multiplayer;
|
|||||||
using osu.Game.GameModes.Play;
|
using osu.Game.GameModes.Play;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Menu
|
namespace osu.Game.GameModes.Menu
|
||||||
{
|
{
|
||||||
@ -25,11 +26,11 @@ namespace osu.Game.GameModes.Menu
|
|||||||
|
|
||||||
protected override BackgroundMode CreateBackground() => new BackgroundModeDefault();
|
protected override BackgroundMode CreateBackground() => new BackgroundModeDefault();
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
OsuGame osu = (OsuGame)Game;
|
OsuGame osu = (OsuGame)game;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Transformations;
|
using osu.Framework.Graphics.Transformations;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Menu
|
namespace osu.Game.GameModes.Menu
|
||||||
{
|
{
|
||||||
@ -82,12 +83,12 @@ namespace osu.Game.GameModes.Menu
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
logo.Texture = Game.Textures.Get(@"Menu/logo");
|
logo.Texture = game.Textures.Get(@"Menu/logo");
|
||||||
ripple.Texture = Game.Textures.Get(@"Menu/logo");
|
ripple.Texture = game.Textures.Get(@"Menu/logo");
|
||||||
|
|
||||||
ripple.ScaleTo(1.1f, 500);
|
ripple.ScaleTo(1.1f, 500);
|
||||||
ripple.FadeOut(500);
|
ripple.FadeOut(500);
|
||||||
|
@ -10,6 +10,7 @@ using osu.Game.Beatmaps.Objects;
|
|||||||
using osu.Game.Beatmaps.Objects.Osu;
|
using osu.Game.Beatmaps.Objects.Osu;
|
||||||
using osu.Game.Beatmaps.Objects.Catch;
|
using osu.Game.Beatmaps.Objects.Catch;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Play.Catch
|
namespace osu.Game.GameModes.Play.Catch
|
||||||
{
|
{
|
||||||
@ -24,9 +25,6 @@ namespace osu.Game.GameModes.Play.Catch
|
|||||||
{
|
{
|
||||||
//osu! mode requires all objects to be of CatchBaseHit type.
|
//osu! mode requires all objects to be of CatchBaseHit type.
|
||||||
objects = value.ConvertAll(convertForCatch);
|
objects = value.ConvertAll(convertForCatch);
|
||||||
|
|
||||||
if (Parent != null)
|
|
||||||
Load();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,9 +48,9 @@ namespace osu.Game.GameModes.Play.Catch
|
|||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
if (playfield == null)
|
if (playfield == null)
|
||||||
Add(playfield = new CatchPlayfield());
|
Add(playfield = new CatchPlayfield());
|
||||||
@ -66,7 +64,7 @@ namespace osu.Game.GameModes.Play.Catch
|
|||||||
//render stuff!
|
//render stuff!
|
||||||
Sprite s = new Sprite
|
Sprite s = new Sprite
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"Menu/logo"),
|
Texture = game.Textures.Get(@"Menu/logo"),
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Scale = new Vector2(0.1f),
|
Scale = new Vector2(0.1f),
|
||||||
RelativePositionAxes = Axes.Y,
|
RelativePositionAxes = Axes.Y,
|
||||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics.Drawables;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Play.Catch
|
namespace osu.Game.GameModes.Play.Catch
|
||||||
{
|
{
|
||||||
@ -20,9 +21,9 @@ namespace osu.Game.GameModes.Play.Catch
|
|||||||
Origin = Anchor.BottomCentre;
|
Origin = Anchor.BottomCentre;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics.Drawables;
|
|||||||
using osu.Game.Beatmaps.Objects;
|
using osu.Game.Beatmaps.Objects;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Play
|
namespace osu.Game.GameModes.Play
|
||||||
{
|
{
|
||||||
@ -21,9 +22,9 @@ namespace osu.Game.GameModes.Play
|
|||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Add(new Box()
|
Add(new Box()
|
||||||
{
|
{
|
||||||
|
@ -10,6 +10,7 @@ using osu.Game.Beatmaps.Objects;
|
|||||||
using osu.Game.Beatmaps.Objects.Osu;
|
using osu.Game.Beatmaps.Objects.Osu;
|
||||||
using osu.Game.Beatmaps.Objects.Mania;
|
using osu.Game.Beatmaps.Objects.Mania;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Play.Mania
|
namespace osu.Game.GameModes.Play.Mania
|
||||||
{
|
{
|
||||||
@ -30,9 +31,6 @@ namespace osu.Game.GameModes.Play.Mania
|
|||||||
{
|
{
|
||||||
//osu! mode requires all objects to be of ManiaBaseHit type.
|
//osu! mode requires all objects to be of ManiaBaseHit type.
|
||||||
objects = value.ConvertAll(convertForMania);
|
objects = value.ConvertAll(convertForMania);
|
||||||
|
|
||||||
if (Parent != null)
|
|
||||||
Load();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,9 +54,9 @@ namespace osu.Game.GameModes.Play.Mania
|
|||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
if (playfield == null)
|
if (playfield == null)
|
||||||
Add(playfield = new ManiaPlayfield(columns));
|
Add(playfield = new ManiaPlayfield(columns));
|
||||||
@ -72,7 +70,7 @@ namespace osu.Game.GameModes.Play.Mania
|
|||||||
//render stuff!
|
//render stuff!
|
||||||
Sprite s = new Sprite
|
Sprite s = new Sprite
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"Menu/logo"),
|
Texture = game.Textures.Get(@"Menu/logo"),
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Scale = new Vector2(0.1f),
|
Scale = new Vector2(0.1f),
|
||||||
RelativePositionAxes = Axes.Both,
|
RelativePositionAxes = Axes.Both,
|
||||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics.Drawables;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Play.Mania
|
namespace osu.Game.GameModes.Play.Mania
|
||||||
{
|
{
|
||||||
@ -23,9 +24,9 @@ namespace osu.Game.GameModes.Play.Mania
|
|||||||
Origin = Anchor.BottomCentre;
|
Origin = Anchor.BottomCentre;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Add(new Box() { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
Add(new Box() { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ using osu.Framework.Graphics.Transformations;
|
|||||||
using osu.Game.Beatmaps.Objects;
|
using osu.Game.Beatmaps.Objects;
|
||||||
using osu.Game.Beatmaps.Objects.Osu;
|
using osu.Game.Beatmaps.Objects.Osu;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Play.Osu
|
namespace osu.Game.GameModes.Play.Osu
|
||||||
{
|
{
|
||||||
@ -20,17 +21,16 @@ namespace osu.Game.GameModes.Play.Osu
|
|||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
Debug.Assert(objects == null);
|
||||||
|
|
||||||
//osu! mode requires all objects to be of OsuBaseHit type.
|
//osu! mode requires all objects to be of OsuBaseHit type.
|
||||||
objects = value.ConvertAll(o => (OsuBaseHit)o);
|
objects = value.ConvertAll(o => (OsuBaseHit)o);
|
||||||
|
|
||||||
if (Parent != null)
|
|
||||||
Load();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(Framework.BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
if (playfield == null)
|
if (playfield == null)
|
||||||
Add(playfield = new OsuPlayfield());
|
Add(playfield = new OsuPlayfield());
|
||||||
@ -44,7 +44,7 @@ namespace osu.Game.GameModes.Play.Osu
|
|||||||
//render stuff!
|
//render stuff!
|
||||||
Sprite s = new Sprite
|
Sprite s = new Sprite
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"Menu/logo"),
|
Texture = game.Textures.Get(@"Menu/logo"),
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Scale = new Vector2(0.1f),
|
Scale = new Vector2(0.1f),
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
|
@ -5,6 +5,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Drawables;
|
using osu.Framework.Graphics.Drawables;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Play.Osu
|
namespace osu.Game.GameModes.Play.Osu
|
||||||
{
|
{
|
||||||
@ -18,9 +19,9 @@ namespace osu.Game.GameModes.Play.Osu
|
|||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Add(new Box()
|
Add(new Box()
|
||||||
{
|
{
|
||||||
|
@ -5,6 +5,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Game.GameModes.Backgrounds;
|
using osu.Game.GameModes.Backgrounds;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Play
|
namespace osu.Game.GameModes.Play
|
||||||
{
|
{
|
||||||
@ -19,11 +20,11 @@ namespace osu.Game.GameModes.Play
|
|||||||
typeof(Player)
|
typeof(Player)
|
||||||
};
|
};
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
OsuGame osu = Game as OsuGame;
|
OsuGame osu = game as OsuGame;
|
||||||
|
|
||||||
playMode = osu.PlayMode;
|
playMode = osu.PlayMode;
|
||||||
playMode.ValueChanged += PlayMode_ValueChanged;
|
playMode.ValueChanged += PlayMode_ValueChanged;
|
||||||
|
@ -20,6 +20,7 @@ using osu.Game.GameModes.Play.Taiko;
|
|||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Play
|
namespace osu.Game.GameModes.Play
|
||||||
{
|
{
|
||||||
@ -31,9 +32,9 @@ namespace osu.Game.GameModes.Play
|
|||||||
typeof(Results)
|
typeof(Results)
|
||||||
};
|
};
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
List<HitObject> objects = new List<HitObject>();
|
List<HitObject> objects = new List<HitObject>();
|
||||||
|
|
||||||
@ -54,7 +55,7 @@ namespace osu.Game.GameModes.Play
|
|||||||
HitObjects = objects
|
HitObjects = objects
|
||||||
};
|
};
|
||||||
|
|
||||||
OsuGame osu = Game as OsuGame;
|
OsuGame osu = game as OsuGame;
|
||||||
|
|
||||||
switch (osu.PlayMode.Value)
|
switch (osu.PlayMode.Value)
|
||||||
{
|
{
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Play
|
namespace osu.Game.GameModes.Play
|
||||||
{
|
{
|
||||||
public class Playfield : Container
|
public class Playfield : Container
|
||||||
{
|
{
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Masking = true;
|
Masking = true;
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ using osu.Game.Beatmaps.Objects;
|
|||||||
using osu.Game.Beatmaps.Objects.Osu;
|
using osu.Game.Beatmaps.Objects.Osu;
|
||||||
using osu.Game.Beatmaps.Objects.Taiko;
|
using osu.Game.Beatmaps.Objects.Taiko;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Play.Taiko
|
namespace osu.Game.GameModes.Play.Taiko
|
||||||
{
|
{
|
||||||
@ -24,9 +25,6 @@ namespace osu.Game.GameModes.Play.Taiko
|
|||||||
{
|
{
|
||||||
//osu! mode requires all objects to be of TaikoBaseHit type.
|
//osu! mode requires all objects to be of TaikoBaseHit type.
|
||||||
objects = value.ConvertAll(convertForTaiko);
|
objects = value.ConvertAll(convertForTaiko);
|
||||||
|
|
||||||
if (Parent != null)
|
|
||||||
Load();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,9 +47,9 @@ namespace osu.Game.GameModes.Play.Taiko
|
|||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
if (playfield == null)
|
if (playfield == null)
|
||||||
Add(playfield = new TaikoPlayfield());
|
Add(playfield = new TaikoPlayfield());
|
||||||
@ -65,7 +63,7 @@ namespace osu.Game.GameModes.Play.Taiko
|
|||||||
//render stuff!
|
//render stuff!
|
||||||
Sprite s = new Sprite
|
Sprite s = new Sprite
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"Menu/logo"),
|
Texture = game.Textures.Get(@"Menu/logo"),
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Scale = new Vector2(0.2f),
|
Scale = new Vector2(0.2f),
|
||||||
RelativePositionAxes = Axes.Both,
|
RelativePositionAxes = Axes.Both,
|
||||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics.Drawables;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Play.Taiko
|
namespace osu.Game.GameModes.Play.Taiko
|
||||||
{
|
{
|
||||||
@ -20,15 +21,15 @@ namespace osu.Game.GameModes.Play.Taiko
|
|||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
||||||
|
|
||||||
Add(new Sprite
|
Add(new Sprite
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"Menu/logo"),
|
Texture = game.Textures.Get(@"Menu/logo"),
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Scale = new Vector2(0.2f),
|
Scale = new Vector2(0.2f),
|
||||||
RelativePositionAxes = Axes.Both,
|
RelativePositionAxes = Axes.Both,
|
||||||
|
@ -8,6 +8,7 @@ using osu.Game.Graphics.Containers;
|
|||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Background
|
namespace osu.Game.Graphics.Background
|
||||||
{
|
{
|
||||||
@ -24,13 +25,13 @@ namespace osu.Game.Graphics.Background
|
|||||||
Depth = float.MinValue;
|
Depth = float.MinValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Add(BackgroundSprite = new Sprite
|
Add(BackgroundSprite = new Sprite
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(textureName),
|
Texture = game.Textures.Get(textureName),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Colour = Color4.DarkGray
|
Colour = Color4.DarkGray
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Containers
|
namespace osu.Game.Graphics.Containers
|
||||||
{
|
{
|
||||||
@ -26,9 +27,9 @@ namespace osu.Game.Graphics.Containers
|
|||||||
|
|
||||||
protected override Container Content => content;
|
protected override Container Content => content;
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseMove(InputState state)
|
protected override bool OnMouseMove(InputState state)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
@ -35,15 +36,15 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Sprite
|
new Sprite
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"Cursor/cursor")
|
Texture = game.Textures.Get(@"Cursor/cursor")
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
@ -58,20 +59,20 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Name = name;
|
Name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
buttonSprite = new Sprite
|
buttonSprite = new Sprite
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"KeyCounter/key-up"),
|
Texture = game.Textures.Get(@"KeyCounter/key-up"),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
},
|
},
|
||||||
glowSprite = new Sprite
|
glowSprite = new Sprite
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"KeyCounter/key-glow"),
|
Texture = game.Textures.Get(@"KeyCounter/key-glow"),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Alpha = 0
|
Alpha = 0
|
||||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics.Drawables;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.Online.Chat.Display
|
namespace osu.Game.Online.Chat.Display
|
||||||
{
|
{
|
||||||
@ -21,9 +22,9 @@ namespace osu.Game.Online.Chat.Display
|
|||||||
this.msg = msg;
|
this.msg = msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ using osu.Game.Graphics.Background;
|
|||||||
using osu.Game.GameModes.Play;
|
using osu.Game.GameModes.Play;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game
|
namespace osu.Game
|
||||||
{
|
{
|
||||||
@ -33,9 +34,9 @@ namespace osu.Game
|
|||||||
host.Size = new Vector2(Config.Get<int>(OsuConfig.Width), Config.Get<int>(OsuConfig.Height));
|
host.Size = new Vector2(Config.Get<int>(OsuConfig.Width), Config.Get<int>(OsuConfig.Height));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
//attach our bindables to the audio subsystem.
|
//attach our bindables to the audio subsystem.
|
||||||
Audio.Volume.Weld(Config.GetBindable<double>(OsuConfig.VolumeGlobal));
|
Audio.Volume.Weld(Config.GetBindable<double>(OsuConfig.VolumeGlobal));
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using osu.Framework.GameModes;
|
using osu.Framework;
|
||||||
|
using osu.Framework.GameModes;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
@ -12,7 +13,7 @@ using osu.Game.Overlays;
|
|||||||
|
|
||||||
namespace osu.Game
|
namespace osu.Game
|
||||||
{
|
{
|
||||||
public class OsuGameBase : Framework.Game
|
public class OsuGameBase : Framework.BaseGame
|
||||||
{
|
{
|
||||||
internal OsuConfigManager Config = new OsuConfigManager();
|
internal OsuConfigManager Config = new OsuConfigManager();
|
||||||
|
|
||||||
@ -27,9 +28,9 @@ namespace osu.Game
|
|||||||
|
|
||||||
public CursorContainer Cursor;
|
public CursorContainer Cursor;
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
||||||
Fonts = new TextureStore() { ScaleAdjust = 0.01f };
|
Fonts = new TextureStore() { ScaleAdjust = 0.01f };
|
||||||
|
@ -9,6 +9,7 @@ using OpenTK;
|
|||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
@ -16,9 +17,9 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
const float width = 300;
|
const float width = 300;
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Depth = float.MaxValue;
|
Depth = float.MaxValue;
|
||||||
RelativeSizeAxes = Axes.Y;
|
RelativeSizeAxes = Axes.Y;
|
||||||
|
@ -12,6 +12,7 @@ using System;
|
|||||||
using osu.Framework.Graphics.Transformations;
|
using osu.Framework.Graphics.Transformations;
|
||||||
using osu.Framework.Timing;
|
using osu.Framework.Timing;
|
||||||
using osu.Game.GameModes.Play;
|
using osu.Game.GameModes.Play;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
@ -42,9 +43,9 @@ namespace osu.Game.Overlays
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Size = new Vector2(1, height);
|
Size = new Vector2(1, height);
|
||||||
@ -97,7 +98,7 @@ namespace osu.Game.Overlays
|
|||||||
new ToolbarButton
|
new ToolbarButton
|
||||||
{
|
{
|
||||||
Icon = FontAwesome.user,
|
Icon = FontAwesome.user,
|
||||||
Text = ((OsuGame)Game).Config.Get<string>(OsuConfig.Username)
|
Text = ((OsuGame)game).Config.Get<string>(OsuConfig.Username)
|
||||||
},
|
},
|
||||||
new ToolbarButton
|
new ToolbarButton
|
||||||
{
|
{
|
||||||
|
@ -5,6 +5,7 @@ using osu.Framework.Extensions;
|
|||||||
using osu.Game.GameModes.Play;
|
using osu.Game.GameModes.Play;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
@ -42,9 +43,9 @@ namespace osu.Game.Overlays
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
DrawableIcon.TextSize *= 1.4f;
|
DrawableIcon.TextSize *= 1.4f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Transformations;
|
|||||||
using osu.Game.GameModes.Play;
|
using osu.Game.GameModes.Play;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
@ -29,9 +30,9 @@ namespace osu.Game.Overlays
|
|||||||
RelativeSizeAxes = Axes.Y;
|
RelativeSizeAxes = Axes.Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Drawables;
|
using osu.Framework.Graphics.Drawables;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Graphics.Transformations;
|
using osu.Framework.Graphics.Transformations;
|
||||||
|
using osu.Framework;
|
||||||
|
|
||||||
namespace osu.Game
|
namespace osu.Game
|
||||||
{
|
{
|
||||||
@ -24,9 +25,9 @@ namespace osu.Game
|
|||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load(game);
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
meterContainer = new Container {
|
meterContainer = new Container {
|
||||||
|
Loading…
Reference in New Issue
Block a user