mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 20:47:51 +08:00
Merge remote-tracking branch 'refs/remotes/upstream/master' into options-improvements
This commit is contained in:
commit
57c4314cae
@ -1 +1 @@
|
||||
Subproject commit 5c0e4edbbcdc26ab56c70676856477cd21e7afdc
|
||||
Subproject commit 1cb936a4fe9e699ee37deb34eed0b04bc06167e3
|
@ -21,8 +21,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
protected override IFrameBasedClock Clock => ourClock;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
public TestCaseHitObjects()
|
||||
{
|
||||
var swClock = new StopwatchClock(true) { Rate = 1 };
|
||||
ourClock = new FramedClock(swClock);
|
||||
|
@ -25,8 +25,7 @@ namespace osu.Desktop.Tests
|
||||
|
||||
protected MusicController mc;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
public TestCaseMusicController()
|
||||
{
|
||||
ourClock = new FramedClock();
|
||||
}
|
||||
|
@ -19,9 +19,12 @@ namespace osu.Desktop.VisualTests
|
||||
{
|
||||
class VisualTestGame : OsuGameBase
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
// Have to construct this here, rather than in the constructor, because
|
||||
// we depend on some dependencies to be loaded within OsuGameBase.load().
|
||||
Add(new TestBrowser());
|
||||
}
|
||||
}
|
||||
|
@ -43,13 +43,18 @@ namespace osu.Game.GameModes
|
||||
|
||||
public override bool Push(GameMode mode)
|
||||
{
|
||||
//don't actually push until we've finished loading.
|
||||
if (!mode.IsLoaded)
|
||||
// When trying to push a non-loaded GameMode, load it asynchronously and re-invoke Push
|
||||
// once it's done.
|
||||
if (mode.LoadState == LoadState.NotLoaded)
|
||||
{
|
||||
mode.Preload(game, d => Push((BackgroundMode)d));
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make sure the in-progress loading is complete before pushing the GameMode.
|
||||
while (mode.LoadState < LoadState.Loaded)
|
||||
Thread.Sleep(1);
|
||||
|
||||
base.Push(mode);
|
||||
|
||||
return true;
|
||||
|
@ -1,8 +1,6 @@
|
||||
//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;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics.Background;
|
||||
|
||||
namespace osu.Game.GameModes.Backgrounds
|
||||
@ -14,11 +12,6 @@ namespace osu.Game.GameModes.Backgrounds
|
||||
public BackgroundModeCustom(string textureName)
|
||||
{
|
||||
this.textureName = textureName;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Add(new Background(textureName));
|
||||
}
|
||||
|
||||
|
@ -78,8 +78,7 @@ namespace osu.Game.GameModes
|
||||
Content.FadeIn(transition_time, EasingTypes.OutExpo);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
public GameModeWhiteBox()
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
|
@ -47,11 +47,6 @@ namespace osu.Game.GameModes.Menu
|
||||
this.text = text;
|
||||
|
||||
AutoSizeAxes = Axes.Both;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Alpha = 0;
|
||||
|
||||
Vector2 boxSize = new Vector2(ButtonSystem.button_width + Math.Abs(extraWidth), ButtonSystem.button_area_height);
|
||||
|
@ -52,11 +52,7 @@ namespace osu.Game.GameModes.Menu
|
||||
public ButtonSystem()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
buttonArea = new Container
|
||||
@ -105,13 +101,13 @@ namespace osu.Game.GameModes.Menu
|
||||
|
||||
buttonFlow.Position = new Vector2(wedge_width * 2 - (button_width + osuLogo.SizeForFlow / 4), 0);
|
||||
|
||||
buttonsPlay.Add(new Button(@"solo", @"freeplay", FontAwesome.fa_user, new Color4(102, 68, 204, 255), OnSolo, wedge_width, Key.P));
|
||||
buttonsPlay.Add(new Button(@"multi", @"multiplayer", FontAwesome.fa_users, new Color4(94, 63, 186, 255), OnMulti, 0, Key.M));
|
||||
buttonsPlay.Add(new Button(@"chart", @"charts", FontAwesome.fa_osu_charts, new Color4(80, 53, 160, 255), OnChart));
|
||||
buttonsPlay.Add(new Button(@"solo", @"freeplay", FontAwesome.fa_user, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), wedge_width, Key.P));
|
||||
buttonsPlay.Add(new Button(@"multi", @"multiplayer", FontAwesome.fa_users, new Color4(94, 63, 186, 255), () => OnMulti?.Invoke(), 0, Key.M));
|
||||
buttonsPlay.Add(new Button(@"chart", @"charts", FontAwesome.fa_osu_charts, new Color4(80, 53, 160, 255), () => OnChart?.Invoke()));
|
||||
|
||||
buttonsTopLevel.Add(new Button(@"play", @"play", FontAwesome.fa_osu_logo, new Color4(102, 68, 204, 255), onPlay, wedge_width, Key.P));
|
||||
buttonsTopLevel.Add(new Button(@"osu!editor", @"edit", FontAwesome.fa_osu_edit_o, new Color4(238, 170, 0, 255), OnEdit, 0, Key.E));
|
||||
buttonsTopLevel.Add(new Button(@"osu!direct", @"direct", FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), OnDirect, 0, Key.D));
|
||||
buttonsTopLevel.Add(new Button(@"osu!editor", @"edit", FontAwesome.fa_osu_edit_o, new Color4(238, 170, 0, 255), () => OnEdit?.Invoke(), 0, Key.E));
|
||||
buttonsTopLevel.Add(new Button(@"osu!direct", @"direct", FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), () => OnDirect?.Invoke(), 0, Key.D));
|
||||
buttonsTopLevel.Add(new Button(@"exit", @"exit", FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), onExit, 0, Key.Q));
|
||||
|
||||
buttonFlow.Add(buttonsPlay);
|
||||
|
@ -19,11 +19,7 @@ namespace osu.Game.GameModes.Play.Catch
|
||||
Size = new Vector2(512, 0.9f);
|
||||
Anchor = Anchor.BottomCentre;
|
||||
Origin = Anchor.BottomCentre;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
||||
}
|
||||
}
|
||||
|
@ -119,11 +119,7 @@ namespace osu.Game.GameModes.Play
|
||||
};
|
||||
|
||||
TextSize = 80;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
DisplayedCountSpriteText.Text = FormatCount(Count);
|
||||
DisplayedCountSpriteText.Anchor = Anchor;
|
||||
DisplayedCountSpriteText.Origin = Origin;
|
||||
|
@ -43,11 +43,14 @@ namespace osu.Game.GameModes.Play
|
||||
|
||||
protected virtual List<T> Convert(List<HitObject> objects) => Converter.Convert(objects);
|
||||
|
||||
public HitRenderer()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
Playfield = CreatePlayfield()
|
||||
|
@ -2,12 +2,9 @@
|
||||
//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.Sprites;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Mania
|
||||
{
|
||||
@ -22,11 +19,7 @@ namespace osu.Game.GameModes.Play.Mania
|
||||
Size = new Vector2(columns / 20f, 1f);
|
||||
Anchor = Anchor.BottomCentre;
|
||||
Origin = Anchor.BottomCentre;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
||||
|
||||
for (int i = 0; i < columns; i++)
|
||||
|
@ -34,8 +34,7 @@ namespace osu.Game.GameModes.Play.Osu
|
||||
}
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
public OsuComboCounter()
|
||||
{
|
||||
PopOutSpriteText.Origin = Origin;
|
||||
PopOutSpriteText.Anchor = Anchor;
|
||||
|
@ -26,18 +26,19 @@ namespace osu.Game.Graphics.Background
|
||||
this.textureName = textureName;
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
Depth = float.MinValue;
|
||||
|
||||
Add(BackgroundSprite = new Sprite
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Colour = Color4.DarkGray
|
||||
});
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
Add(BackgroundSprite = new Sprite
|
||||
{
|
||||
Texture = textures.Get(textureName),
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Colour = Color4.DarkGray
|
||||
});
|
||||
BackgroundSprite.Texture = textures.Get(textureName);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
|
@ -118,11 +118,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
TextSize = 40;
|
||||
AutoSizeAxes = Axes.Both;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
DisplayedCount = Count;
|
||||
|
||||
DisplayedCountSpriteText.Text = FormatCount(count);
|
||||
|
@ -108,11 +108,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Origin = Anchor.CentreLeft,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
starContainer.Width = MaxStars * StarSize + Math.Max(MaxStars - 1, 0) * StarSpacing;
|
||||
starContainer.Height = StarSize;
|
||||
|
||||
|
@ -18,6 +18,9 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
||||
|
||||
private VolumeMeter volumeMeterMaster;
|
||||
|
||||
private FlowContainer content;
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
public override bool Contains(Vector2 screenSpacePos) => true;
|
||||
|
||||
private void volumeChanged(object sender, EventArgs e)
|
||||
@ -31,32 +34,31 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
||||
AutoSizeAxes = Axes.Both;
|
||||
Anchor = Anchor.BottomRight;
|
||||
Origin = Anchor.BottomRight;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
VolumeGlobal.ValueChanged += volumeChanged;
|
||||
VolumeSample.ValueChanged += volumeChanged;
|
||||
VolumeTrack.ValueChanged += volumeChanged;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new FlowContainer
|
||||
AddInternal(content = new FlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.BottomRight,
|
||||
Origin = Anchor.BottomRight,
|
||||
Position = new Vector2(10, 30),
|
||||
Spacing = new Vector2(15, 0),
|
||||
Children = new Drawable[]
|
||||
});
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
VolumeGlobal.ValueChanged += volumeChanged;
|
||||
VolumeSample.ValueChanged += volumeChanged;
|
||||
VolumeTrack.ValueChanged += volumeChanged;
|
||||
|
||||
Add(new[]
|
||||
{
|
||||
volumeMeterMaster = new VolumeMeter("Master", VolumeGlobal),
|
||||
new VolumeMeter("Effects", VolumeSample),
|
||||
new VolumeMeter("Music", VolumeTrack)
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
@ -20,17 +20,13 @@ namespace osu.Game.Online.Chat.Display
|
||||
{
|
||||
public readonly Message Message;
|
||||
|
||||
public ChatLine(Message message)
|
||||
{
|
||||
this.Message = message;
|
||||
}
|
||||
|
||||
const float padding = 200;
|
||||
const float text_size = 20;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
public ChatLine(Message message)
|
||||
{
|
||||
this.Message = message;
|
||||
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
|
||||
|
@ -80,8 +80,12 @@ namespace osu.Game
|
||||
Audio.VolumeTrack.Weld(Config.GetBindable<double>(OsuConfig.VolumeMusic));
|
||||
|
||||
PlayMode = Config.GetBindable<PlayMode>(OsuConfig.PlayMode);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
//todo: move to constructor or LoadComplete.
|
||||
Add(new Drawable[] {
|
||||
new VolumeControlReceptor
|
||||
{
|
||||
|
@ -37,10 +37,6 @@ namespace osu.Game
|
||||
|
||||
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
private void Beatmap_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
@ -66,15 +62,6 @@ namespace osu.Game
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Black"));
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BlackItalic"));
|
||||
|
||||
AddInternal(ratioContainer = new RatioAdjust());
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
Cursor = new OsuCursorContainer { Depth = float.MaxValue }
|
||||
};
|
||||
|
||||
Beatmap.ValueChanged += Beatmap_ValueChanged;
|
||||
|
||||
OszArchiveReader.Register();
|
||||
|
||||
Dependencies.Cache(API = new APIAccess
|
||||
@ -85,6 +72,19 @@ namespace osu.Game
|
||||
});
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
AddInternal(ratioContainer = new RatioAdjust
|
||||
{
|
||||
Children = new[]
|
||||
{
|
||||
Cursor = new OsuCursorContainer { Depth = float.MaxValue }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public override void SetHost(BasicGameHost host)
|
||||
{
|
||||
if (Config == null)
|
||||
|
@ -44,9 +44,9 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
DrawableIcon.TextSize *= 1.4f;
|
||||
}
|
||||
}
|
||||
|
@ -29,11 +29,7 @@ namespace osu.Game.Overlays
|
||||
public ToolbarModeSelector()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
@ -59,8 +55,11 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
};
|
||||
|
||||
int amountButtons = 0;
|
||||
foreach (PlayMode m in Enum.GetValues(typeof(PlayMode)))
|
||||
{
|
||||
++amountButtons;
|
||||
|
||||
var localMode = m;
|
||||
modeButtons.Add(new ToolbarModeButton
|
||||
{
|
||||
@ -73,8 +72,8 @@ namespace osu.Game.Overlays
|
||||
});
|
||||
}
|
||||
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
Size = new Vector2(modeButtons.Children.Count() * ToolbarButton.WIDTH + padding * 2, 1);
|
||||
// We need to set the size within LoadComplete, because
|
||||
Size = new Vector2(amountButtons * ToolbarButton.WIDTH + padding * 2, 1);
|
||||
}
|
||||
|
||||
public void SetGameMode(PlayMode mode)
|
||||
|
Loading…
Reference in New Issue
Block a user