mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 08:03:52 +09:00
Merge pull request #41 from peppy/game-modes-layout
Basic white-boxing of all game modes.
This commit is contained in:
Submodule osu-framework updated: 3f68cf9d03...4d78fdfbe0
Submodule osu-resources updated: fd4a3dd522...cc107f9bcf
@ -54,7 +54,7 @@ namespace osu.Desktop.Tests
|
|||||||
flow = new FlowContainer
|
flow = new FlowContainer
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirection.VerticalOnly,
|
||||||
SizeMode = InheritMode.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
LayoutDuration = 100,
|
LayoutDuration = 100,
|
||||||
LayoutEasing = EasingTypes.Out,
|
LayoutEasing = EasingTypes.Out,
|
||||||
Padding = new Vector2(1, 1)
|
Padding = new Vector2(1, 1)
|
||||||
|
@ -31,8 +31,10 @@ namespace osu.Desktop.Tests
|
|||||||
{
|
{
|
||||||
base.Reset();
|
base.Reset();
|
||||||
|
|
||||||
///create a new clock offset to 0.
|
//ensure we are at offset 0
|
||||||
localClock = new FramedOffsetClock(base.Clock) { Offset = -base.Clock.CurrentTime };
|
if (localClock == null)
|
||||||
|
localClock = new FramedOffsetClock(base.Clock);
|
||||||
|
localClock.Offset = -base.Clock.CurrentTime;
|
||||||
|
|
||||||
List<HitObject> objects = new List<HitObject>();
|
List<HitObject> objects = new List<HitObject>();
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace osu.Desktop.Tests
|
|||||||
|
|
||||||
Add(flow = new FlowContainer()
|
Add(flow = new FlowContainer()
|
||||||
{
|
{
|
||||||
SizeMode = InheritMode.XY,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Size = new Vector2(0.5f),
|
Size = new Vector2(0.5f),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
|
@ -6,12 +6,10 @@ 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;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Containers
|
namespace osu.Game.GameModes.Charts
|
||||||
{
|
{
|
||||||
class OsuGameMode : GameMode
|
class ChartInfo : GameModeWhiteBox
|
||||||
{
|
{
|
||||||
public new OsuGame Game => base.Game as OsuGame;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
15
osu.Game/GameModes/Charts/ChartListing.cs
Normal file
15
osu.Game/GameModes/Charts/ChartListing.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Charts
|
||||||
|
{
|
||||||
|
class ChartListing : GameModeWhiteBox
|
||||||
|
{
|
||||||
|
protected override IEnumerable<Type> PossibleChildren => new[] {
|
||||||
|
typeof(ChartInfo)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
9
osu.Game/GameModes/Direct/OnlineListing.cs
Normal file
9
osu.Game/GameModes/Direct/OnlineListing.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//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.Direct
|
||||||
|
{
|
||||||
|
class OnlineListing : GameModeWhiteBox
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
15
osu.Game/GameModes/Edit/Editor.cs
Normal file
15
osu.Game/GameModes/Edit/Editor.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Edit
|
||||||
|
{
|
||||||
|
class Editor : GameModeWhiteBox
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
15
osu.Game/GameModes/Edit/SongSelectEdit.cs
Normal file
15
osu.Game/GameModes/Edit/SongSelectEdit.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Edit
|
||||||
|
{
|
||||||
|
class SongSelectEdit : GameModeWhiteBox
|
||||||
|
{
|
||||||
|
protected override IEnumerable<Type> PossibleChildren => new[] {
|
||||||
|
typeof(Editor)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
156
osu.Game/GameModes/GameModeWhiteBox.cs
Normal file
156
osu.Game/GameModes/GameModeWhiteBox.cs
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.GameModes;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Drawables;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Graphics.Transformations;
|
||||||
|
using osu.Framework.Graphics.UserInterface;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes
|
||||||
|
{
|
||||||
|
public class GameModeWhiteBox : GameMode
|
||||||
|
{
|
||||||
|
private Button popButton;
|
||||||
|
|
||||||
|
const int transition_time = 1000;
|
||||||
|
|
||||||
|
protected virtual IEnumerable<Type> PossibleChildren => null;
|
||||||
|
|
||||||
|
private FlowContainer childModeButtons;
|
||||||
|
private Container textContainer;
|
||||||
|
|
||||||
|
protected override double OnEntering(GameMode last)
|
||||||
|
{
|
||||||
|
//only show the pop button if we are entered form another gamemode.
|
||||||
|
if (last != null)
|
||||||
|
popButton.Alpha = 1;
|
||||||
|
|
||||||
|
Content.Alpha = 0;
|
||||||
|
textContainer.Position = new Vector2(Size.X / 16, 0);
|
||||||
|
|
||||||
|
Content.Delay(300);
|
||||||
|
textContainer.MoveTo(Vector2.Zero, transition_time, EasingTypes.OutExpo);
|
||||||
|
Content.FadeIn(transition_time, EasingTypes.OutExpo);
|
||||||
|
return 0;// transition_time * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override double OnExiting(GameMode next)
|
||||||
|
{
|
||||||
|
textContainer.MoveTo(new Vector2((Size.X / 16), 0), transition_time, EasingTypes.OutExpo);
|
||||||
|
Content.FadeOut(transition_time, EasingTypes.OutExpo);
|
||||||
|
return transition_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override double OnSuspending(GameMode next)
|
||||||
|
{
|
||||||
|
textContainer.MoveTo(new Vector2(-(Size.X / 16), 0), transition_time, EasingTypes.OutExpo);
|
||||||
|
Content.FadeOut(transition_time, EasingTypes.OutExpo);
|
||||||
|
return transition_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override double OnResuming(GameMode last)
|
||||||
|
{
|
||||||
|
textContainer.MoveTo(Vector2.Zero, transition_time, EasingTypes.OutExpo);
|
||||||
|
Content.FadeIn(transition_time, EasingTypes.OutExpo);
|
||||||
|
return transition_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Size = new Vector2(0.7f),
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Colour = getColourFor(GetType()),
|
||||||
|
Alpha = 0.6f,
|
||||||
|
Additive = true
|
||||||
|
},
|
||||||
|
textContainer = new AutoSizeContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new SpriteText
|
||||||
|
{
|
||||||
|
Text = GetType().Name,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
TextSize = 50,
|
||||||
|
},
|
||||||
|
new SpriteText
|
||||||
|
{
|
||||||
|
Text = GetType().Namespace,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Position = new Vector2(0, 30)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
popButton = new Button
|
||||||
|
{
|
||||||
|
Text = @"Back",
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Size = new Vector2(0.1f, 40),
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
|
Colour = new Color4(235, 51, 153, 255),
|
||||||
|
Alpha = 0,
|
||||||
|
Action = delegate {
|
||||||
|
Exit();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
childModeButtons = new FlowContainer
|
||||||
|
{
|
||||||
|
Direction = FlowDirection.VerticalOnly,
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Size = new Vector2(0.1f, 1)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (PossibleChildren != null)
|
||||||
|
{
|
||||||
|
foreach (Type t in PossibleChildren)
|
||||||
|
{
|
||||||
|
childModeButtons.Add(new Button
|
||||||
|
{
|
||||||
|
Text = $@"{t.Name}",
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Size = new Vector2(1, 40),
|
||||||
|
Anchor = Anchor.BottomRight,
|
||||||
|
Origin = Anchor.BottomRight,
|
||||||
|
Colour = getColourFor(t),
|
||||||
|
Action = delegate
|
||||||
|
{
|
||||||
|
Push(Activator.CreateInstance(t) as GameMode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Color4 getColourFor(Type type)
|
||||||
|
{
|
||||||
|
int hash = type.Name.GetHashCode();
|
||||||
|
byte r = (byte)MathHelper.Clamp(((hash & 0xFF0000) >> 16) * 0.8f, 20, 255);
|
||||||
|
byte g = (byte)MathHelper.Clamp(((hash & 0x00FF00) >> 8) * 0.8f, 20, 255);
|
||||||
|
byte b = (byte)MathHelper.Clamp((hash & 0x0000FF) * 0.8f, 20, 255);
|
||||||
|
return new Color4(r, g, b, 255);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -19,17 +19,29 @@ using OpenTK.Input;
|
|||||||
|
|
||||||
namespace osu.Game.GameModes.Menu
|
namespace osu.Game.GameModes.Menu
|
||||||
{
|
{
|
||||||
public class ButtonSystem : OsuLargeComponent
|
public class ButtonSystem : Container
|
||||||
{
|
{
|
||||||
|
public Action OnEdit;
|
||||||
|
public Action OnExit;
|
||||||
|
public Action OnDirect;
|
||||||
|
public Action OnSolo;
|
||||||
|
public Action OnSettings;
|
||||||
|
public Action OnMulti;
|
||||||
|
public Action OnChart;
|
||||||
|
public Action OnTest;
|
||||||
|
|
||||||
private FlowContainerWithOrigin buttonFlow;
|
private FlowContainerWithOrigin buttonFlow;
|
||||||
|
|
||||||
const float button_area_height = 128;
|
const float button_area_height = 100;
|
||||||
const float button_width = 180f;
|
const float button_width = 140f;
|
||||||
const float wedge_width = 25.6f;
|
const float wedge_width = 20;
|
||||||
|
|
||||||
|
public const int EXIT_DELAY = 3000;
|
||||||
|
|
||||||
private OsuLogo osuLogo;
|
private OsuLogo osuLogo;
|
||||||
private Drawable iconFacade;
|
private Drawable iconFacade;
|
||||||
private Container buttonArea;
|
private Container buttonArea;
|
||||||
|
private Box buttonAreaBackground;
|
||||||
|
|
||||||
private Button backButton;
|
private Button backButton;
|
||||||
private Button settingsButton;
|
private Button settingsButton;
|
||||||
@ -40,9 +52,15 @@ namespace osu.Game.GameModes.Menu
|
|||||||
public enum MenuState
|
public enum MenuState
|
||||||
{
|
{
|
||||||
Initial,
|
Initial,
|
||||||
Exit,
|
|
||||||
TopLevel,
|
TopLevel,
|
||||||
Play,
|
Play,
|
||||||
|
EnteringMode,
|
||||||
|
Exit,
|
||||||
|
}
|
||||||
|
|
||||||
|
public ButtonSystem()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load()
|
||||||
@ -55,15 +73,18 @@ namespace osu.Game.GameModes.Menu
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
SizeMode = InheritMode.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Size = new Vector2(1, button_area_height),
|
Size = new Vector2(1, button_area_height),
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
buttonAreaBackground = new Box
|
||||||
{
|
{
|
||||||
SizeMode = InheritMode.XY,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = new Color4(50, 50, 50, 255)
|
Size = new Vector2(2, 1),
|
||||||
|
Colour = new Color4(50, 50, 50, 255),
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
},
|
},
|
||||||
buttonFlow = new FlowContainerWithOrigin
|
buttonFlow = new FlowContainerWithOrigin
|
||||||
{
|
{
|
||||||
@ -71,7 +92,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
Padding = new Vector2(-wedge_width, 0),
|
Padding = new Vector2(-wedge_width, 0),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
settingsButton = new Button(@"settings", @"options", FontAwesome.gear, new Color4(85, 85, 85, 255), onSettings, -wedge_width, Key.O),
|
settingsButton = new Button(@"settings", @"options", FontAwesome.gear, new Color4(85, 85, 85, 255), OnSettings, -wedge_width, Key.O),
|
||||||
backButton = new Button(@"back", @"back", FontAwesome.fa_osu_left_o, new Color4(51, 58, 94, 255), onBack, -wedge_width, Key.Escape),
|
backButton = new Button(@"back", @"back", FontAwesome.fa_osu_left_o, new Color4(51, 58, 94, 255), onBack, -wedge_width, Key.Escape),
|
||||||
iconFacade = new Container //need a container to make the osu! icon flow properly.
|
iconFacade = new Container //need a container to make the osu! icon flow properly.
|
||||||
{
|
{
|
||||||
@ -91,14 +112,14 @@ namespace osu.Game.GameModes.Menu
|
|||||||
|
|
||||||
buttonFlow.Position = new Vector2(wedge_width * 2 - (button_width + osuLogo.SizeForFlow / 4), 0);
|
buttonFlow.Position = new Vector2(wedge_width * 2 - (button_width + osuLogo.SizeForFlow / 4), 0);
|
||||||
|
|
||||||
buttonsPlay.Add((Button)buttonFlow.Add(new Button(@"solo", @"freeplay", FontAwesome.user, new Color4(102, 68, 204, 255), onSolo, wedge_width, Key.P)));
|
buttonsPlay.Add((Button)buttonFlow.Add(new Button(@"solo", @"freeplay", FontAwesome.user, new Color4(102, 68, 204, 255), OnSolo, wedge_width, Key.P)));
|
||||||
buttonsPlay.Add((Button)buttonFlow.Add(new Button(@"multi", @"multiplayer", FontAwesome.users, new Color4(94, 63, 186, 255), onMulti, 0, Key.M)));
|
buttonsPlay.Add((Button)buttonFlow.Add(new Button(@"multi", @"multiplayer", FontAwesome.users, new Color4(94, 63, 186, 255), OnMulti, 0, Key.M)));
|
||||||
buttonsPlay.Add((Button)buttonFlow.Add(new Button(@"chart", @"charts", FontAwesome.fa_osu_charts, new Color4(80, 53, 160, 255), onChart)));
|
buttonsPlay.Add((Button)buttonFlow.Add(new Button(@"chart", @"charts", FontAwesome.fa_osu_charts, new Color4(80, 53, 160, 255), OnChart)));
|
||||||
buttonsPlay.Add((Button)buttonFlow.Add(new Button(@"tests", @"tests", FontAwesome.terminal, new Color4(80, 53, 160, 255), onTest, 0, Key.T)));
|
buttonsPlay.Add((Button)buttonFlow.Add(new Button(@"tests", @"tests", FontAwesome.terminal, new Color4(80, 53, 160, 255), OnTest, 0, Key.T)));
|
||||||
|
|
||||||
buttonsTopLevel.Add((Button)buttonFlow.Add(new Button(@"play", @"play", FontAwesome.fa_osu_logo, new Color4(102, 68, 204, 255), onPlay, wedge_width, Key.P)));
|
buttonsTopLevel.Add((Button)buttonFlow.Add(new Button(@"play", @"play", FontAwesome.fa_osu_logo, new Color4(102, 68, 204, 255), onPlay, wedge_width, Key.P)));
|
||||||
buttonsTopLevel.Add((Button)buttonFlow.Add(new Button(@"osu!editor", @"edit", FontAwesome.fa_osu_edit_o, new Color4(238, 170, 0, 255), onEdit, 0, Key.E)));
|
buttonsTopLevel.Add((Button)buttonFlow.Add(new Button(@"osu!editor", @"edit", FontAwesome.fa_osu_edit_o, new Color4(238, 170, 0, 255), OnEdit, 0, Key.E)));
|
||||||
buttonsTopLevel.Add((Button)buttonFlow.Add(new Button(@"osu!direct", @"direct", FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), onDirect, 0, Key.D)));
|
buttonsTopLevel.Add((Button)buttonFlow.Add(new Button(@"osu!direct", @"direct", FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), OnDirect, 0, Key.D)));
|
||||||
buttonsTopLevel.Add((Button)buttonFlow.Add(new Button(@"exit", @"exit", FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), onExit, 0, Key.Q)));
|
buttonsTopLevel.Add((Button)buttonFlow.Add(new Button(@"exit", @"exit", FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), onExit, 0, Key.Q)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,31 +129,15 @@ namespace osu.Game.GameModes.Menu
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onSettings()
|
|
||||||
{
|
|
||||||
//OsuGame.Options.LoginOnly = false;
|
|
||||||
//OsuGame.Options.Expanded = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onPlay()
|
private void onPlay()
|
||||||
{
|
{
|
||||||
State = MenuState.Play;
|
State = MenuState.Play;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onEdit()
|
|
||||||
{
|
|
||||||
//OsuGame.ChangeMode(OsuModes.SelectEdit);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onDirect()
|
|
||||||
{
|
|
||||||
//OsuGame.ChangeMode(OsuModes.OnlineSelection);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onExit()
|
private void onExit()
|
||||||
{
|
{
|
||||||
//OsuGame.ChangeMode(OsuModes.Exit);
|
|
||||||
State = MenuState.Exit;
|
State = MenuState.Exit;
|
||||||
|
OnExit?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onBack()
|
private void onBack()
|
||||||
@ -140,27 +145,6 @@ namespace osu.Game.GameModes.Menu
|
|||||||
State = MenuState.TopLevel;
|
State = MenuState.TopLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onSolo()
|
|
||||||
{
|
|
||||||
//OsuGame.ChangeMode(OsuModes.SelectPlay);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onMulti()
|
|
||||||
{
|
|
||||||
//OsuGame.ChangeMode(OsuModes.Lobby);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onChart()
|
|
||||||
{
|
|
||||||
//OsuGame.ChangeMode(OsuModes.Charts);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onTest()
|
|
||||||
{
|
|
||||||
|
|
||||||
//OsuGame.ChangeMode(OsuModes.FieldTest);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onOsuLogo()
|
private void onOsuLogo()
|
||||||
{
|
{
|
||||||
switch (state)
|
switch (state)
|
||||||
@ -195,11 +179,16 @@ namespace osu.Game.GameModes.Menu
|
|||||||
MenuState lastState = state;
|
MenuState lastState = state;
|
||||||
state = value;
|
state = value;
|
||||||
|
|
||||||
|
//todo: figure a more elegant way of doing this.
|
||||||
|
buttonsTopLevel.ForEach(b => b.ContractStyle = 0);
|
||||||
|
buttonsPlay.ForEach(b => b.ContractStyle = 0);
|
||||||
|
backButton.ContractStyle = 0;
|
||||||
|
settingsButton.ContractStyle = 0;
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case MenuState.Initial:
|
case MenuState.Initial:
|
||||||
backButton.State = Button.ButtonState.Contracted;
|
buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out);
|
||||||
|
|
||||||
buttonArea.FadeOut(500);
|
buttonArea.FadeOut(500);
|
||||||
|
|
||||||
osuLogo.Delay(150);
|
osuLogo.Delay(150);
|
||||||
@ -213,7 +202,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
b.State = Button.ButtonState.Contracted;
|
b.State = Button.ButtonState.Contracted;
|
||||||
break;
|
break;
|
||||||
case MenuState.TopLevel:
|
case MenuState.TopLevel:
|
||||||
backButton.State = Button.ButtonState.Contracted;
|
buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out);
|
||||||
|
|
||||||
osuLogo.MoveTo(buttonFlow.Position, 200, EasingTypes.In);
|
osuLogo.MoveTo(buttonFlow.Position, 200, EasingTypes.In);
|
||||||
osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
|
osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
|
||||||
@ -231,14 +220,26 @@ namespace osu.Game.GameModes.Menu
|
|||||||
b.State = Button.ButtonState.Contracted;
|
b.State = Button.ButtonState.Contracted;
|
||||||
break;
|
break;
|
||||||
case MenuState.Play:
|
case MenuState.Play:
|
||||||
backButton.State = Button.ButtonState.Expanded;
|
|
||||||
|
|
||||||
foreach (Button b in buttonsTopLevel)
|
foreach (Button b in buttonsTopLevel)
|
||||||
b.State = Button.ButtonState.Exploded;
|
b.State = Button.ButtonState.Exploded;
|
||||||
|
|
||||||
foreach (Button b in buttonsPlay)
|
foreach (Button b in buttonsPlay)
|
||||||
b.State = Button.ButtonState.Expanded;
|
b.State = Button.ButtonState.Expanded;
|
||||||
break;
|
break;
|
||||||
|
case MenuState.EnteringMode:
|
||||||
|
buttonAreaBackground.ScaleTo(new Vector2(2, 0), 300, EasingTypes.InSine);
|
||||||
|
|
||||||
|
buttonsTopLevel.ForEach(b => b.ContractStyle = 1);
|
||||||
|
buttonsPlay.ForEach(b => b.ContractStyle = 1);
|
||||||
|
backButton.ContractStyle = 1;
|
||||||
|
settingsButton.ContractStyle = 1;
|
||||||
|
|
||||||
|
foreach (Button b in buttonsTopLevel)
|
||||||
|
b.State = Button.ButtonState.Contracted;
|
||||||
|
|
||||||
|
foreach (Button b in buttonsPlay)
|
||||||
|
b.State = Button.ButtonState.Contracted;
|
||||||
|
break;
|
||||||
case MenuState.Exit:
|
case MenuState.Exit:
|
||||||
buttonArea.FadeOut(200);
|
buttonArea.FadeOut(200);
|
||||||
|
|
||||||
@ -249,13 +250,14 @@ namespace osu.Game.GameModes.Menu
|
|||||||
b.State = Button.ButtonState.Contracted;
|
b.State = Button.ButtonState.Contracted;
|
||||||
|
|
||||||
osuLogo.Delay(150);
|
osuLogo.Delay(150);
|
||||||
osuLogo.ScaleTo(1f, 4000);
|
|
||||||
osuLogo.RotateTo(20, 4000);
|
osuLogo.ScaleTo(1f, EXIT_DELAY * 1.5f);
|
||||||
osuLogo.FadeOut(4000);
|
osuLogo.RotateTo(20, EXIT_DELAY * 1.5f);
|
||||||
|
osuLogo.FadeOut(EXIT_DELAY);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
backButton.State = state >= MenuState.Play ? Button.ButtonState.Expanded : Button.ButtonState.Contracted;
|
backButton.State = state == MenuState.Play ? Button.ButtonState.Expanded : Button.ButtonState.Contracted;
|
||||||
settingsButton.State = state == MenuState.TopLevel ? Button.ButtonState.Expanded : Button.ButtonState.Contracted;
|
settingsButton.State = state == MenuState.TopLevel ? Button.ButtonState.Expanded : Button.ButtonState.Contracted;
|
||||||
|
|
||||||
if (lastState == MenuState.Initial)
|
if (lastState == MenuState.Initial)
|
||||||
@ -275,14 +277,14 @@ namespace osu.Game.GameModes.Menu
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// osu! logo and its attachments (pulsing, visualiser etc.)
|
/// osu! logo and its attachments (pulsing, visualiser etc.)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class OsuLogo : OsuComponent
|
class OsuLogo : AutoSizeContainer
|
||||||
{
|
{
|
||||||
private Sprite logo;
|
private Sprite logo;
|
||||||
private Container logoBounceContainer;
|
private Container logoBounceContainer;
|
||||||
private MenuVisualisation vis;
|
private MenuVisualisation vis;
|
||||||
private Action clickAction;
|
private Action clickAction;
|
||||||
|
|
||||||
public float SizeForFlow => logo == null ? 0 : logo.ActualSize.X * logo.Scale.X * logoBounceContainer.Scale.X * 0.8f;
|
public float SizeForFlow => logo == null ? 0 : logo.Size.X * logo.Scale.X * logoBounceContainer.Scale.X * 0.8f;
|
||||||
|
|
||||||
public override void Load()
|
public override void Load()
|
||||||
{
|
{
|
||||||
@ -298,13 +300,13 @@ namespace osu.Game.GameModes.Menu
|
|||||||
{
|
{
|
||||||
logo = new Sprite()
|
logo = new Sprite()
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"menu-osu"),
|
Texture = Game.Textures.Get(@"Menu/logo"),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
},
|
},
|
||||||
ripple = new Sprite()
|
ripple = new Sprite()
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"menu-osu"),
|
Texture = Game.Textures.Get(@"Menu/logo"),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Alpha = 0.4f
|
Alpha = 0.4f
|
||||||
@ -395,7 +397,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
/// Button designed specifically for the osu!next main menu.
|
/// Button designed specifically for the osu!next main menu.
|
||||||
/// In order to correctly flow, we have to use a negative margin on the parent container (due to the parallelogram shape).
|
/// In order to correctly flow, we have to use a negative margin on the parent container (due to the parallelogram shape).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private class Button : OsuComponent
|
private class Button : AutoSizeContainer
|
||||||
{
|
{
|
||||||
private Container iconText;
|
private Container iconText;
|
||||||
private WedgedBox box;
|
private WedgedBox box;
|
||||||
@ -445,7 +447,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
icon = new TextAwesome
|
icon = new TextAwesome
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
TextSize = 40,
|
TextSize = 30,
|
||||||
Position = new Vector2(0, 0),
|
Position = new Vector2(0, 0),
|
||||||
Icon = symbol
|
Icon = symbol
|
||||||
},
|
},
|
||||||
@ -454,6 +456,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirection.HorizontalOnly,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
TextSize = 16,
|
||||||
Position = new Vector2(0, 35),
|
Position = new Vector2(0, 35),
|
||||||
Text = text
|
Text = text
|
||||||
}
|
}
|
||||||
@ -601,8 +604,9 @@ namespace osu.Game.GameModes.Menu
|
|||||||
base.Update();
|
base.Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonState state;
|
public int ContractStyle;
|
||||||
|
|
||||||
|
ButtonState state;
|
||||||
public ButtonState State
|
public ButtonState State
|
||||||
{
|
{
|
||||||
get { return state; }
|
get { return state; }
|
||||||
@ -612,15 +616,25 @@ namespace osu.Game.GameModes.Menu
|
|||||||
if (state == value)
|
if (state == value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ButtonState lastState = state;
|
|
||||||
state = value;
|
state = value;
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case ButtonState.Contracted:
|
case ButtonState.Contracted:
|
||||||
const int contract_duration = 500;
|
switch (ContractStyle)
|
||||||
box.ScaleTo(new Vector2(0, 1), contract_duration, EasingTypes.OutExpo);
|
{
|
||||||
FadeOut(contract_duration);
|
default:
|
||||||
|
box.ScaleTo(new Vector2(0, 1), 500, EasingTypes.OutExpo);
|
||||||
|
FadeOut(500);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
box.ScaleTo(new Vector2(0, 1), 400, EasingTypes.InSine);
|
||||||
|
FadeOut(800);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ButtonState.Contracted2:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ButtonState.Expanded:
|
case ButtonState.Expanded:
|
||||||
const int expand_duration = 500;
|
const int expand_duration = 500;
|
||||||
@ -641,6 +655,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
public enum ButtonState
|
public enum ButtonState
|
||||||
{
|
{
|
||||||
Contracted,
|
Contracted,
|
||||||
|
Contracted2,
|
||||||
Expanded,
|
Expanded,
|
||||||
Exploded
|
Exploded
|
||||||
}
|
}
|
||||||
|
@ -4,26 +4,87 @@
|
|||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
using osu.Framework.GameModes;
|
using osu.Framework.GameModes;
|
||||||
|
using osu.Framework.GameModes.Testing;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Transformations;
|
||||||
|
using osu.Game.GameModes.Charts;
|
||||||
|
using osu.Game.GameModes.Direct;
|
||||||
|
using osu.Game.GameModes.Edit;
|
||||||
|
using osu.Game.GameModes.Multiplayer;
|
||||||
|
using osu.Game.GameModes.Play;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
namespace osu.Game.GameModes.Menu
|
namespace osu.Game.GameModes.Menu
|
||||||
{
|
{
|
||||||
internal class MainMenu : GameMode
|
internal class MainMenu : GameMode
|
||||||
{
|
{
|
||||||
|
private ButtonSystem buttons;
|
||||||
public override string Name => @"Main Menu";
|
public override string Name => @"Main Menu";
|
||||||
|
|
||||||
//private AudioTrackBass bgm;
|
//private AudioTrack bgm;
|
||||||
|
|
||||||
public override void Load()
|
public override void Load()
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load();
|
||||||
|
|
||||||
AudioSample welcome = Game.Audio.Sample.Get(@"welcome");
|
OsuGame osu = (OsuGame)Game;
|
||||||
|
|
||||||
Children = new Drawable[]
|
AudioSample welcome = Game.Audio.Sample.Get(@"welcome");
|
||||||
{
|
welcome.Play();
|
||||||
new ButtonSystem(),
|
|
||||||
};
|
//bgm = Game.Audio.Track.Get(@"circles");
|
||||||
}
|
//bgm.Start();
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new ParallaxContainer
|
||||||
|
{
|
||||||
|
ParallaxAmount = 0.01f,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
buttons = new ButtonSystem()
|
||||||
|
{
|
||||||
|
OnChart = delegate { Push(new ChartListing()); },
|
||||||
|
OnDirect = delegate { Push(new OnlineListing()); },
|
||||||
|
OnEdit = delegate { Push(new SongSelectEdit()); },
|
||||||
|
OnSolo = delegate { Push(new SongSelectPlay()); },
|
||||||
|
OnMulti = delegate { Push(new Lobby()); },
|
||||||
|
OnTest = delegate { Push(new TestBrowser()); },
|
||||||
|
OnExit = delegate {
|
||||||
|
Game.Scheduler.AddDelayed(delegate {
|
||||||
|
Game.Host.Exit();
|
||||||
|
}, ButtonSystem.EXIT_DELAY);
|
||||||
|
},
|
||||||
|
OnSettings = delegate {
|
||||||
|
osu.Options.PoppedOut = !osu.Options.PoppedOut;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override double OnSuspending(GameMode next)
|
||||||
|
{
|
||||||
|
const float length = 400;
|
||||||
|
|
||||||
|
buttons.State = ButtonSystem.MenuState.EnteringMode;
|
||||||
|
|
||||||
|
Content.FadeOut(length, EasingTypes.InSine);
|
||||||
|
Content.MoveTo(new Vector2(-800, 0), length, EasingTypes.InSine);
|
||||||
|
|
||||||
|
return base.OnSuspending(next);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override double OnResuming(GameMode last)
|
||||||
|
{
|
||||||
|
const float length = 300;
|
||||||
|
|
||||||
|
buttons.State = ButtonSystem.MenuState.TopLevel;
|
||||||
|
|
||||||
|
Content.FadeIn(length, EasingTypes.OutQuint);
|
||||||
|
Content.MoveTo(new Vector2(0, 0), length, EasingTypes.OutQuint);
|
||||||
|
return base.OnResuming(last);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
19
osu.Game/GameModes/Multiplayer/Lobby.cs
Normal file
19
osu.Game/GameModes/Multiplayer/Lobby.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Multiplayer
|
||||||
|
{
|
||||||
|
class Lobby : GameModeWhiteBox
|
||||||
|
{
|
||||||
|
protected override IEnumerable<Type> PossibleChildren => new[] {
|
||||||
|
typeof(MatchCreate),
|
||||||
|
typeof(Match)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
20
osu.Game/GameModes/Multiplayer/Match.cs
Normal file
20
osu.Game/GameModes/Multiplayer/Match.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using osu.Game.GameModes.Play;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Multiplayer
|
||||||
|
{
|
||||||
|
class Match : GameModeWhiteBox
|
||||||
|
{
|
||||||
|
protected override IEnumerable<Type> PossibleChildren => new[] {
|
||||||
|
typeof(MatchSongSelect),
|
||||||
|
typeof(Player),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
18
osu.Game/GameModes/Multiplayer/MatchCreate.cs
Normal file
18
osu.Game/GameModes/Multiplayer/MatchCreate.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Multiplayer
|
||||||
|
{
|
||||||
|
class MatchCreate : GameModeWhiteBox
|
||||||
|
{
|
||||||
|
protected override IEnumerable<Type> PossibleChildren => new[] {
|
||||||
|
typeof(Match)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
15
osu.Game/GameModes/Multiplayer/MatchSongSelect.cs
Normal file
15
osu.Game/GameModes/Multiplayer/MatchSongSelect.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Multiplayer
|
||||||
|
{
|
||||||
|
class MatchSongSelect : GameModeWhiteBox
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -66,10 +66,10 @@ namespace osu.Game.GameModes.Play.Catch
|
|||||||
//render stuff!
|
//render stuff!
|
||||||
Sprite s = new Sprite
|
Sprite s = new Sprite
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"menu-osu"),
|
Texture = Game.Textures.Get(@"Menu/logo"),
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Scale = new Vector2(0.1f),
|
Scale = new Vector2(0.1f),
|
||||||
PositionMode = InheritMode.Y,
|
RelativePositionAxes = Axes.Y,
|
||||||
Position = new Vector2(h.Position, -0.1f)
|
Position = new Vector2(h.Position, -0.1f)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ namespace osu.Game.GameModes.Play.Catch
|
|||||||
{
|
{
|
||||||
public CatchPlayfield()
|
public CatchPlayfield()
|
||||||
{
|
{
|
||||||
SizeMode = InheritMode.Y;
|
RelativeSizeAxes = Axes.Y;
|
||||||
Size = new Vector2(512, 0.9f);
|
Size = new Vector2(512, 0.9f);
|
||||||
Anchor = Anchor.BottomCentre;
|
Anchor = Anchor.BottomCentre;
|
||||||
Origin = Anchor.BottomCentre;
|
Origin = Anchor.BottomCentre;
|
||||||
@ -24,7 +24,7 @@ namespace osu.Game.GameModes.Play.Catch
|
|||||||
{
|
{
|
||||||
base.Load();
|
base.Load();
|
||||||
|
|
||||||
Add(new Box { SizeMode = InheritMode.XY, Alpha = 0.5f });
|
Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,15 +11,20 @@ using OpenTK;
|
|||||||
|
|
||||||
namespace osu.Game.GameModes.Play
|
namespace osu.Game.GameModes.Play
|
||||||
{
|
{
|
||||||
public abstract class HitRenderer : LargeContainer
|
public abstract class HitRenderer : Container
|
||||||
{
|
{
|
||||||
public abstract List<HitObject> Objects { set; }
|
public abstract List<HitObject> Objects { set; }
|
||||||
|
|
||||||
|
public HitRenderer()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
}
|
||||||
|
|
||||||
public override void Load()
|
public override void Load()
|
||||||
{
|
{
|
||||||
base.Load();
|
base.Load();
|
||||||
|
|
||||||
Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.1f, Scale = new Vector2(0.99f) });
|
Add(new Box() { RelativeSizeAxes = Axes.Both, Alpha = 0.1f, Scale = new Vector2(0.99f) });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,10 +72,10 @@ namespace osu.Game.GameModes.Play.Mania
|
|||||||
//render stuff!
|
//render stuff!
|
||||||
Sprite s = new Sprite
|
Sprite s = new Sprite
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"menu-osu"),
|
Texture = Game.Textures.Get(@"Menu/logo"),
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Scale = new Vector2(0.1f),
|
Scale = new Vector2(0.1f),
|
||||||
PositionMode = InheritMode.XY,
|
RelativePositionAxes = Axes.Both,
|
||||||
Position = new Vector2((float)(h.Column + 0.5) / columns, -0.1f)
|
Position = new Vector2((float)(h.Column + 0.5) / columns, -0.1f)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.GameModes.Play.Mania
|
|||||||
public ManiaPlayfield(int columns)
|
public ManiaPlayfield(int columns)
|
||||||
{
|
{
|
||||||
this.columns = columns;
|
this.columns = columns;
|
||||||
SizeMode = InheritMode.XY;
|
RelativeSizeAxes = Axes.Both;
|
||||||
Size = new Vector2(columns / 20f, 1f);
|
Size = new Vector2(columns / 20f, 1f);
|
||||||
Anchor = Anchor.BottomCentre;
|
Anchor = Anchor.BottomCentre;
|
||||||
Origin = Anchor.BottomCentre;
|
Origin = Anchor.BottomCentre;
|
||||||
@ -27,14 +27,14 @@ namespace osu.Game.GameModes.Play.Mania
|
|||||||
{
|
{
|
||||||
base.Load();
|
base.Load();
|
||||||
|
|
||||||
Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f });
|
Add(new Box() { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
||||||
|
|
||||||
for (int i = 0; i < columns; i++)
|
for (int i = 0; i < columns; i++)
|
||||||
Add(new Box()
|
Add(new Box()
|
||||||
{
|
{
|
||||||
SizeMode = InheritMode.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Size = new Vector2(2, 1),
|
Size = new Vector2(2, 1),
|
||||||
PositionMode = InheritMode.XY,
|
RelativePositionAxes = Axes.Both,
|
||||||
Position = new Vector2((float)i / columns, 0),
|
Position = new Vector2((float)i / columns, 0),
|
||||||
Alpha = 0.5f,
|
Alpha = 0.5f,
|
||||||
Colour = Color4.Black
|
Colour = Color4.Black
|
||||||
|
15
osu.Game/GameModes/Play/ModSelect.cs
Normal file
15
osu.Game/GameModes/Play/ModSelect.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play
|
||||||
|
{
|
||||||
|
class ModSelect : GameModeWhiteBox
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -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-osu"),
|
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,
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.GameModes.Play.Osu
|
|||||||
{
|
{
|
||||||
public OsuPlayfield()
|
public OsuPlayfield()
|
||||||
{
|
{
|
||||||
SizeMode = InheritMode.None;
|
RelativeSizeAxes = Axes.None;
|
||||||
Size = new Vector2(512, 384);
|
Size = new Vector2(512, 384);
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
@ -26,7 +26,7 @@ namespace osu.Game.GameModes.Play.Osu
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
SizeMode = InheritMode.XY,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Alpha = 0.5f
|
Alpha = 0.5f
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
18
osu.Game/GameModes/Play/Player.cs
Normal file
18
osu.Game/GameModes/Play/Player.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play
|
||||||
|
{
|
||||||
|
class Player : GameModeWhiteBox
|
||||||
|
{
|
||||||
|
protected override IEnumerable<Type> PossibleChildren => new[] {
|
||||||
|
typeof(Results)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
15
osu.Game/GameModes/Play/Results.cs
Normal file
15
osu.Game/GameModes/Play/Results.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play
|
||||||
|
{
|
||||||
|
class Results : GameModeWhiteBox
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
16
osu.Game/GameModes/Play/SongSelectPlay.cs
Normal file
16
osu.Game/GameModes/Play/SongSelectPlay.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play
|
||||||
|
{
|
||||||
|
class SongSelectPlay : GameModeWhiteBox
|
||||||
|
{
|
||||||
|
protected override IEnumerable<Type> PossibleChildren => new[] {
|
||||||
|
typeof(ModSelect),
|
||||||
|
typeof(Player)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -65,10 +65,10 @@ namespace osu.Game.GameModes.Play.Taiko
|
|||||||
//render stuff!
|
//render stuff!
|
||||||
Sprite s = new Sprite
|
Sprite s = new Sprite
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"menu-osu"),
|
Texture = Game.Textures.Get(@"Menu/logo"),
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Scale = new Vector2(0.2f),
|
Scale = new Vector2(0.2f),
|
||||||
PositionMode = InheritMode.XY,
|
RelativePositionAxes = Axes.Both,
|
||||||
Position = new Vector2(1.1f, 0.5f)
|
Position = new Vector2(1.1f, 0.5f)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ namespace osu.Game.GameModes.Play.Taiko
|
|||||||
{
|
{
|
||||||
public TaikoPlayfield()
|
public TaikoPlayfield()
|
||||||
{
|
{
|
||||||
SizeMode = InheritMode.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Size = new Vector2(1, 100);
|
Size = new Vector2(1, 100);
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
@ -24,14 +24,14 @@ namespace osu.Game.GameModes.Play.Taiko
|
|||||||
{
|
{
|
||||||
base.Load();
|
base.Load();
|
||||||
|
|
||||||
Add(new Box { SizeMode = InheritMode.XY, Alpha = 0.5f });
|
Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
||||||
|
|
||||||
Add(new Sprite
|
Add(new Sprite
|
||||||
{
|
{
|
||||||
Texture = Game.Textures.Get(@"menu-osu"),
|
Texture = Game.Textures.Get(@"Menu/logo"),
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Scale = new Vector2(0.2f),
|
Scale = new Vector2(0.2f),
|
||||||
PositionMode = InheritMode.XY,
|
RelativePositionAxes = Axes.Both,
|
||||||
Position = new Vector2(0.1f, 0.5f),
|
Position = new Vector2(0.1f, 0.5f),
|
||||||
Colour = Color4.Gray
|
Colour = Color4.Gray
|
||||||
});
|
});
|
||||||
|
42
osu.Game/Graphics/Background/Background.cs
Normal file
42
osu.Game/Graphics/Background/Background.cs
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.Background
|
||||||
|
{
|
||||||
|
class Background : Container
|
||||||
|
{
|
||||||
|
protected Sprite BackgroundSprite;
|
||||||
|
|
||||||
|
public Background()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
Add(BackgroundSprite = new Sprite
|
||||||
|
{
|
||||||
|
Texture = Game.Textures.Get(@"Menu/background"),
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Colour = Color4.DarkGray
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
BackgroundSprite.Scale = new Vector2(Math.Max(Size.X / BackgroundSprite.Size.X, Size.Y / BackgroundSprite.Size.Y));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
//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.Framework.Graphics.Containers;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Containers
|
|
||||||
{
|
|
||||||
class OsuComponent : AutoSizeContainer
|
|
||||||
{
|
|
||||||
public new OsuGameBase Game => base.Game as OsuGameBase;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
//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.Framework.Graphics.Containers;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Containers
|
|
||||||
{
|
|
||||||
public class OsuLargeComponent : LargeContainer
|
|
||||||
{
|
|
||||||
public new OsuGameBase Game => base.Game as OsuGameBase;
|
|
||||||
}
|
|
||||||
}
|
|
46
osu.Game/Graphics/Containers/ParallaxContainer.cs
Normal file
46
osu.Game/Graphics/Containers/ParallaxContainer.cs
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Input;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.Containers
|
||||||
|
{
|
||||||
|
class ParallaxContainer : Container
|
||||||
|
{
|
||||||
|
public float ParallaxAmount = 0.02f;
|
||||||
|
|
||||||
|
public override bool Contains(Vector2 screenSpacePos) => true;
|
||||||
|
|
||||||
|
public ParallaxContainer()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Container content = new Container()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre
|
||||||
|
};
|
||||||
|
|
||||||
|
protected override Container AddTarget => content;
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
Add(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnMouseMove(InputState state)
|
||||||
|
{
|
||||||
|
content.Position = (state.Mouse.Position - Size / 2) * ParallaxAmount;
|
||||||
|
return base.OnMouseMove(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
content.Scale = new Vector2(1 + ParallaxAmount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,19 +1,28 @@
|
|||||||
//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 System;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Processing
|
namespace osu.Game.Graphics.Processing
|
||||||
{
|
{
|
||||||
class RatioAdjust : LargeContainer
|
class RatioAdjust : Container
|
||||||
{
|
{
|
||||||
public override bool Contains(Vector2 screenSpacePos) => true;
|
public override bool Contains(Vector2 screenSpacePos) => true;
|
||||||
|
|
||||||
|
public RatioAdjust()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
Scale = new Vector2(Parent.ActualSize.Y / 768f);
|
Vector2 parent = Parent.Size;
|
||||||
|
|
||||||
|
Scale = new Vector2(Math.Min(parent.Y / 768f, parent.X / 1024f));
|
||||||
Size = new Vector2(1 / Scale.X);
|
Size = new Vector2(1 / Scale.X);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
SizeMode = InheritMode.XY,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new SpriteText
|
new SpriteText
|
||||||
@ -88,7 +88,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Text = Name,
|
Text = Name,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
PositionMode = InheritMode.XY,
|
RelativePositionAxes = Axes.Both,
|
||||||
Position = new Vector2(0, -0.25f),
|
Position = new Vector2(0, -0.25f),
|
||||||
Colour = KeyUpTextColor
|
Colour = KeyUpTextColor
|
||||||
},
|
},
|
||||||
@ -97,7 +97,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Text = Count.ToString(@"#,0"),
|
Text = Count.ToString(@"#,0"),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
PositionMode = InheritMode.XY,
|
RelativePositionAxes = Axes.Both,
|
||||||
Position = new Vector2(0, 0.25f),
|
Position = new Vector2(0, 0.25f),
|
||||||
Colour = KeyUpTextColor
|
Colour = KeyUpTextColor
|
||||||
}
|
}
|
||||||
|
@ -25,11 +25,11 @@ namespace osu.Game.Online.Chat.Display
|
|||||||
{
|
{
|
||||||
base.Load();
|
base.Load();
|
||||||
|
|
||||||
SizeMode = InheritMode.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
|
|
||||||
Add(new Box
|
Add(new Box
|
||||||
{
|
{
|
||||||
SizeMode = InheritMode.XY,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4.Aqua,
|
Colour = Color4.Aqua,
|
||||||
Alpha = 0.2f
|
Alpha = 0.2f
|
||||||
});
|
});
|
||||||
@ -44,16 +44,16 @@ namespace osu.Game.Online.Chat.Display
|
|||||||
{
|
{
|
||||||
Text = msg.User.Name,
|
Text = msg.User.Name,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
PositionMode = InheritMode.X,
|
RelativePositionAxes = Axes.X,
|
||||||
Position = new Vector2(0.14f,0),
|
Position = new Vector2(0.14f,0),
|
||||||
});
|
});
|
||||||
|
|
||||||
Add(new SpriteText
|
Add(new SpriteText
|
||||||
{
|
{
|
||||||
Text = msg.Content,
|
Text = msg.Content,
|
||||||
PositionMode = InheritMode.X,
|
RelativePositionAxes = Axes.X,
|
||||||
Position = new Vector2(0.15f, 0),
|
Position = new Vector2(0.15f, 0),
|
||||||
SizeMode = InheritMode.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Size = new Vector2(0.85f, 1),
|
Size = new Vector2(0.85f, 1),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -5,13 +5,19 @@ using osu.Game.Configuration;
|
|||||||
using osu.Game.GameModes.Menu;
|
using osu.Game.GameModes.Menu;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.OS;
|
using osu.Framework.OS;
|
||||||
|
using osu.Game.Graphics.Background;
|
||||||
using osu.Game.GameModes.Play;
|
using osu.Game.GameModes.Play;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
|
||||||
namespace osu.Game
|
namespace osu.Game
|
||||||
{
|
{
|
||||||
public class OsuGame : OsuGameBase
|
public class OsuGame : OsuGameBase
|
||||||
{
|
{
|
||||||
|
public Toolbar Toolbar;
|
||||||
|
|
||||||
public override void SetHost(BasicGameHost host)
|
public override void SetHost(BasicGameHost host)
|
||||||
{
|
{
|
||||||
base.SetHost(host);
|
base.SetHost(host);
|
||||||
@ -23,7 +29,18 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
base.Load();
|
base.Load();
|
||||||
|
|
||||||
Add(new MainMenu());
|
ShowPerformanceOverlay = true;
|
||||||
|
|
||||||
|
Add(new Drawable[] {
|
||||||
|
new ParallaxContainer
|
||||||
|
{
|
||||||
|
Children = new [] {
|
||||||
|
new Background()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new MainMenu(),
|
||||||
|
Toolbar = new Toolbar(),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true)
|
public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true)
|
||||||
@ -32,8 +49,8 @@ namespace osu.Game
|
|||||||
|
|
||||||
if (Parent != null)
|
if (Parent != null)
|
||||||
{
|
{
|
||||||
Config.Set(OsuConfig.Width, ActualSize.X);
|
Config.Set(OsuConfig.Width, Size.X);
|
||||||
Config.Set(OsuConfig.Height, ActualSize.Y);
|
Config.Set(OsuConfig.Height, Size.Y);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.GameModes;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
@ -7,6 +8,7 @@ using osu.Game.Configuration;
|
|||||||
using osu.Game.Graphics.Cursor;
|
using osu.Game.Graphics.Cursor;
|
||||||
using osu.Game.Graphics.Processing;
|
using osu.Game.Graphics.Processing;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
|
||||||
namespace osu.Game
|
namespace osu.Game
|
||||||
{
|
{
|
||||||
@ -16,6 +18,7 @@ namespace osu.Game
|
|||||||
|
|
||||||
protected override string MainResourceFile => @"osu.Game.Resources.dll";
|
protected override string MainResourceFile => @"osu.Game.Resources.dll";
|
||||||
|
|
||||||
|
public Options Options;
|
||||||
public APIAccess API;
|
public APIAccess API;
|
||||||
|
|
||||||
protected override Container AddTarget => ratioContainer?.IsLoaded == true ? ratioContainer : base.AddTarget;
|
protected override Container AddTarget => ratioContainer?.IsLoaded == true ? ratioContainer : base.AddTarget;
|
||||||
@ -45,6 +48,7 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
Options = new Options(),
|
||||||
new OsuCursorContainer()
|
new OsuCursorContainer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
75
osu.Game/Overlays/Options.cs
Normal file
75
osu.Game/Overlays/Options.cs
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
//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.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Drawables;
|
||||||
|
using osu.Framework.Graphics.Transformations;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework.Input;
|
||||||
|
using OpenTK.Input;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays
|
||||||
|
{
|
||||||
|
public class Options : Container
|
||||||
|
{
|
||||||
|
const float width = 300;
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
Depth = float.MaxValue;
|
||||||
|
RelativeSizeAxes = Axes.Y;
|
||||||
|
Size = new Vector2(width, 1);
|
||||||
|
Position = new Vector2(-width, 0);
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = new Color4(0.1f, 0.1f, 0.1f, 0.9f)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||||
|
{
|
||||||
|
switch (args.Key)
|
||||||
|
{
|
||||||
|
case Key.Escape:
|
||||||
|
if (!poppedOut) return false;
|
||||||
|
|
||||||
|
PoppedOut = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return base.OnKeyDown(state, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool poppedOut;
|
||||||
|
|
||||||
|
public bool PoppedOut
|
||||||
|
{
|
||||||
|
get { return poppedOut; }
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == poppedOut) return;
|
||||||
|
|
||||||
|
poppedOut = value;
|
||||||
|
|
||||||
|
if (poppedOut)
|
||||||
|
{
|
||||||
|
MoveTo(new Vector2(0, 0), 300, EasingTypes.Out);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MoveTo(new Vector2(-width, 0), 300, EasingTypes.Out);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
38
osu.Game/Overlays/Toolbar.cs
Normal file
38
osu.Game/Overlays/Toolbar.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Drawables;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays
|
||||||
|
{
|
||||||
|
public class Toolbar : Container
|
||||||
|
{
|
||||||
|
const float height = 50;
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
Size = new Vector2(1, height);
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = new Color4(0.1f, 0.1f, 0.1f, 0.9f)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -69,8 +69,21 @@
|
|||||||
<Compile Include="Beatmaps\Timing\SampleChange.cs" />
|
<Compile Include="Beatmaps\Timing\SampleChange.cs" />
|
||||||
<Compile Include="Beatmaps\Timing\TimingChange.cs" />
|
<Compile Include="Beatmaps\Timing\TimingChange.cs" />
|
||||||
<Compile Include="Configuration\OsuConfigManager.cs" />
|
<Compile Include="Configuration\OsuConfigManager.cs" />
|
||||||
|
<Compile Include="GameModes\Charts\ChartInfo.cs" />
|
||||||
|
<Compile Include="GameModes\Edit\Editor.cs" />
|
||||||
|
<Compile Include="GameModes\GameModeWhiteBox.cs" />
|
||||||
<Compile Include="GameModes\Menu\ButtonSystem.cs" />
|
<Compile Include="GameModes\Menu\ButtonSystem.cs" />
|
||||||
<Compile Include="GameModes\Menu\MainMenu.cs" />
|
<Compile Include="GameModes\Menu\MainMenu.cs" />
|
||||||
|
<Compile Include="GameModes\Multiplayer\Lobby.cs" />
|
||||||
|
<Compile Include="GameModes\Multiplayer\Match.cs" />
|
||||||
|
<Compile Include="GameModes\Multiplayer\MatchCreate.cs" />
|
||||||
|
<Compile Include="GameModes\Multiplayer\MatchSongSelect.cs" />
|
||||||
|
<Compile Include="GameModes\Play\ModSelect.cs" />
|
||||||
|
<Compile Include="GameModes\Play\Player.cs" />
|
||||||
|
<Compile Include="GameModes\Charts\ChartListing.cs" />
|
||||||
|
<Compile Include="GameModes\Play\Results.cs" />
|
||||||
|
<Compile Include="GameModes\Direct\OnlineListing.cs" />
|
||||||
|
<Compile Include="GameModes\Play\SongSelectPlay.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" />
|
||||||
@ -81,9 +94,9 @@
|
|||||||
<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="Graphics\Containers\OsuComponent.cs" />
|
<Compile Include="GameModes\Edit\SongSelectEdit.cs" />
|
||||||
<Compile Include="Graphics\Containers\OsuGameMode.cs" />
|
<Compile Include="Graphics\Background\Background.cs" />
|
||||||
<Compile Include="Graphics\Containers\OsuLargeComponent.cs" />
|
<Compile Include="Graphics\Containers\ParallaxContainer.cs" />
|
||||||
<Compile Include="Graphics\Cursor\OsuCursorContainer.cs" />
|
<Compile Include="Graphics\Cursor\OsuCursorContainer.cs" />
|
||||||
<Compile Include="Graphics\Processing\RatioAdjust.cs" />
|
<Compile Include="Graphics\Processing\RatioAdjust.cs" />
|
||||||
<Compile Include="Graphics\TextAwesome.cs" />
|
<Compile Include="Graphics\TextAwesome.cs" />
|
||||||
@ -104,6 +117,8 @@
|
|||||||
<Compile Include="Online\User.cs" />
|
<Compile Include="Online\User.cs" />
|
||||||
<Compile Include="OsuGame.cs" />
|
<Compile Include="OsuGame.cs" />
|
||||||
<Compile Include="OsuGameBase.cs" />
|
<Compile Include="OsuGameBase.cs" />
|
||||||
|
<Compile Include="Overlays\Options.cs" />
|
||||||
|
<Compile Include="Overlays\Toolbar.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Users\User.cs" />
|
<Compile Include="Users\User.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Reference in New Issue
Block a user