mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Merge remote-tracking branch 'upstream/master' into tournament-tools
This commit is contained in:
@ -118,7 +118,6 @@ namespace osu.Game.Screens.Menu
|
||||
AllowMultiline = false,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
TextSize = 16,
|
||||
Position = new Vector2(0, 35),
|
||||
Text = text
|
||||
}
|
||||
@ -243,7 +242,7 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
public ButtonState State
|
||||
{
|
||||
get { return state; }
|
||||
get => state;
|
||||
|
||||
set
|
||||
{
|
||||
|
@ -8,11 +8,12 @@ using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Input;
|
||||
@ -90,19 +91,6 @@ namespace osu.Game.Screens.Menu
|
||||
});
|
||||
|
||||
buttonArea.Flow.CentreTarget = iconFacade;
|
||||
|
||||
buttonsPlay.Add(new Button(@"solo", @"button-solo-select", FontAwesome.fa_user, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), WEDGE_WIDTH, Key.P));
|
||||
buttonsPlay.Add(new Button(@"multi", @"button-generic-select", FontAwesome.fa_users, new Color4(94, 63, 186, 255), onMulti, 0, Key.M));
|
||||
buttonsPlay.Add(new Button(@"chart", @"button-generic-select", FontAwesome.fa_osu_charts, new Color4(80, 53, 160, 255), () => OnChart?.Invoke()));
|
||||
buttonsPlay.ForEach(b => b.VisibleState = ButtonSystemState.Play);
|
||||
|
||||
buttonsTopLevel.Add(new Button(@"play", @"button-play-select", FontAwesome.fa_osu_logo, new Color4(102, 68, 204, 255), () => State = ButtonSystemState.Play, WEDGE_WIDTH, Key.P));
|
||||
buttonsTopLevel.Add(new Button(@"osu!editor", @"button-generic-select", FontAwesome.fa_osu_edit_o, new Color4(238, 170, 0, 255), () => OnEdit?.Invoke(), 0, Key.E));
|
||||
buttonsTopLevel.Add(new Button(@"osu!direct", @"button-direct-select", FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), () => OnDirect?.Invoke(), 0, Key.D));
|
||||
buttonsTopLevel.Add(new Button(@"exit", string.Empty, FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), () => OnExit?.Invoke(), 0, Key.Q));
|
||||
|
||||
buttonArea.AddRange(buttonsPlay);
|
||||
buttonArea.AddRange(buttonsTopLevel);
|
||||
}
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
@ -115,9 +103,24 @@ namespace osu.Game.Screens.Menu
|
||||
private NotificationOverlay notifications { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(AudioManager audio, IdleTracker idleTracker)
|
||||
private void load(AudioManager audio, IdleTracker idleTracker, GameHost host)
|
||||
{
|
||||
isIdle.ValueChanged += updateIdleState;
|
||||
buttonsPlay.Add(new Button(@"solo", @"button-solo-select", FontAwesome.fa_user, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), WEDGE_WIDTH, Key.P));
|
||||
buttonsPlay.Add(new Button(@"multi", @"button-generic-select", FontAwesome.fa_users, new Color4(94, 63, 186, 255), onMulti, 0, Key.M));
|
||||
buttonsPlay.Add(new Button(@"chart", @"button-generic-select", FontAwesome.fa_osu_charts, new Color4(80, 53, 160, 255), () => OnChart?.Invoke()));
|
||||
buttonsPlay.ForEach(b => b.VisibleState = ButtonSystemState.Play);
|
||||
|
||||
buttonsTopLevel.Add(new Button(@"play", @"button-play-select", FontAwesome.fa_osu_logo, new Color4(102, 68, 204, 255), () => State = ButtonSystemState.Play, WEDGE_WIDTH, Key.P));
|
||||
buttonsTopLevel.Add(new Button(@"osu!editor", @"button-generic-select", FontAwesome.fa_osu_edit_o, new Color4(238, 170, 0, 255), () => OnEdit?.Invoke(), 0, Key.E));
|
||||
buttonsTopLevel.Add(new Button(@"osu!direct", @"button-direct-select", FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), () => OnDirect?.Invoke(), 0, Key.D));
|
||||
|
||||
if (host.CanExit)
|
||||
buttonsTopLevel.Add(new Button(@"exit", string.Empty, FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), () => OnExit?.Invoke(), 0, Key.Q));
|
||||
|
||||
buttonArea.AddRange(buttonsPlay);
|
||||
buttonArea.AddRange(buttonsTopLevel);
|
||||
|
||||
isIdle.ValueChanged += idle => updateIdleState(idle.NewValue);
|
||||
|
||||
if (idleTracker != null) isIdle.BindTo(idleTracker.IsIdle);
|
||||
|
||||
@ -203,7 +206,7 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
public ButtonSystemState State
|
||||
{
|
||||
get { return state; }
|
||||
get => state;
|
||||
|
||||
set
|
||||
{
|
||||
|
@ -64,31 +64,19 @@ namespace osu.Game.Screens.Menu
|
||||
}
|
||||
};
|
||||
|
||||
textFlow.AddText("This is an ", t =>
|
||||
{
|
||||
t.TextSize = 30;
|
||||
t.Font = @"Exo2.0-Light";
|
||||
});
|
||||
textFlow.AddText("early development build", t =>
|
||||
{
|
||||
t.TextSize = 30;
|
||||
t.Font = @"Exo2.0-SemiBold";
|
||||
});
|
||||
textFlow.AddText("This is an ", t => t.Font = t.Font.With(Typeface.Exo, 30, FontWeight.Light));
|
||||
textFlow.AddText("early development build", t => t.Font = t.Font.With(Typeface.Exo, 30, FontWeight.SemiBold));
|
||||
|
||||
textFlow.AddParagraph("Things may not work as expected", t => t.TextSize = 20);
|
||||
textFlow.AddParagraph("Things may not work as expected", t => t.Font = t.Font.With(size: 20));
|
||||
textFlow.NewParagraph();
|
||||
|
||||
Action<SpriteText> format = t =>
|
||||
{
|
||||
t.TextSize = 15;
|
||||
t.Font = @"Exo2.0-SemiBold";
|
||||
};
|
||||
Action<SpriteText> format = t => t.Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold);
|
||||
|
||||
textFlow.AddParagraph("Detailed bug reports are welcomed via github issues.", format);
|
||||
textFlow.NewParagraph();
|
||||
|
||||
textFlow.AddText("Visit ", format);
|
||||
textFlow.AddLink("discord.gg/ppy", "https://discord.gg/ppy", creationParameters:format);
|
||||
textFlow.AddLink("discord.gg/ppy", "https://discord.gg/ppy", creationParameters: format);
|
||||
textFlow.AddText(" to help out or follow progress!", format);
|
||||
|
||||
textFlow.NewParagraph();
|
||||
@ -102,7 +90,7 @@ namespace osu.Game.Screens.Menu
|
||||
supporterDrawables.Add(heart = textFlow.AddIcon(FontAwesome.fa_heart, t =>
|
||||
{
|
||||
t.Padding = new MarginPadding { Left = 5 };
|
||||
t.TextSize = 12;
|
||||
t.Font = t.Font.With(size: 12);
|
||||
t.Colour = colours.Pink;
|
||||
t.Origin = Anchor.Centre;
|
||||
}).First());
|
||||
|
@ -5,7 +5,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.MathUtils;
|
||||
@ -52,7 +52,7 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
BeatmapSetInfo setInfo = null;
|
||||
|
||||
if (!menuMusic)
|
||||
if (!menuMusic.Value)
|
||||
{
|
||||
var sets = beatmaps.GetAllUsableBeatmapSets();
|
||||
if (sets.Count > 0)
|
||||
@ -93,13 +93,13 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
Beatmap.Value = introBeatmap;
|
||||
|
||||
if (menuVoice)
|
||||
if (menuVoice.Value)
|
||||
welcome.Play();
|
||||
|
||||
Scheduler.AddDelayed(delegate
|
||||
{
|
||||
// Only start the current track if it is the menu music. A beatmap's track is started when entering the Main Manu.
|
||||
if (menuMusic)
|
||||
if (menuMusic.Value)
|
||||
track.Start();
|
||||
|
||||
LoadComponentAsync(mainMenu = new MainMenu());
|
||||
@ -112,7 +112,6 @@ namespace osu.Game.Screens.Menu
|
||||
}, delay_step_two);
|
||||
}
|
||||
|
||||
logo.RelativePositionAxes = Axes.Both;
|
||||
logo.Colour = Color4.White;
|
||||
logo.Ripple = false;
|
||||
|
||||
@ -159,7 +158,7 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
double fadeOutTime = EXIT_DELAY;
|
||||
//we also handle the exit transition.
|
||||
if (menuVoice)
|
||||
if (menuVoice.Value)
|
||||
seeya.Play();
|
||||
else
|
||||
fadeOutTime = 500;
|
||||
|
@ -57,7 +57,7 @@ namespace osu.Game.Screens.Menu
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Children = new []
|
||||
Children = new[]
|
||||
{
|
||||
lineTopLeft = new Box
|
||||
{
|
||||
@ -102,9 +102,8 @@ namespace osu.Game.Screens.Menu
|
||||
Origin = Anchor.Centre,
|
||||
Text = "welcome",
|
||||
Padding = new MarginPadding { Bottom = 10 },
|
||||
Font = @"Exo2.0-Light",
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Light, size: 42),
|
||||
Alpha = 0,
|
||||
TextSize = 42,
|
||||
Spacing = new Vector2(5),
|
||||
},
|
||||
new CircularContainer
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Batches;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
@ -15,6 +14,7 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
@ -156,7 +156,9 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
public Shader Shader;
|
||||
public Texture Texture;
|
||||
|
||||
public VisualiserSharedData Shared;
|
||||
|
||||
//Asuming the logo is a circle, we don't need a second dimension.
|
||||
public float Size;
|
||||
|
||||
@ -213,6 +215,7 @@ namespace osu.Game.Screens.Menu
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Shader.Unbind();
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,9 @@
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
@ -20,28 +22,31 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
public class MainMenu : OsuScreen
|
||||
{
|
||||
private readonly ButtonSystem buttons;
|
||||
private ButtonSystem buttons;
|
||||
|
||||
public override bool HideOverlaysOnEnter => buttons.State == ButtonSystemState.Initial;
|
||||
|
||||
protected override bool AllowBackButton => buttons.State != ButtonSystemState.Initial;
|
||||
protected override bool AllowBackButton => buttons.State != ButtonSystemState.Initial && host.CanExit;
|
||||
|
||||
public override bool AllowExternalScreenChange => true;
|
||||
|
||||
private Screen songSelect;
|
||||
|
||||
private readonly MenuSideFlashes sideFlashes;
|
||||
private MenuSideFlashes sideFlashes;
|
||||
|
||||
[Resolved]
|
||||
private GameHost host { get; set; }
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenDefault();
|
||||
|
||||
public MainMenu()
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuGame game = null)
|
||||
{
|
||||
InternalChildren = new Drawable[]
|
||||
if (host.CanExit)
|
||||
AddInternal(new ExitConfirmOverlay { Action = this.Exit });
|
||||
|
||||
AddRangeInternal(new Drawable[]
|
||||
{
|
||||
new ExitConfirmOverlay
|
||||
{
|
||||
Action = this.Exit,
|
||||
},
|
||||
new ParallaxContainer
|
||||
{
|
||||
ParallaxAmount = 0.01f,
|
||||
@ -50,16 +55,16 @@ namespace osu.Game.Screens.Menu
|
||||
buttons = new ButtonSystem
|
||||
{
|
||||
OnChart = delegate { this.Push(new ChartListing()); },
|
||||
OnDirect = delegate {this.Push(new OnlineListing()); },
|
||||
OnEdit = delegate {this.Push(new Editor()); },
|
||||
OnDirect = delegate { this.Push(new OnlineListing()); },
|
||||
OnEdit = delegate { this.Push(new Editor()); },
|
||||
OnSolo = onSolo,
|
||||
OnMulti = delegate {this.Push(new Multiplayer()); },
|
||||
OnMulti = delegate { this.Push(new Multiplayer()); },
|
||||
OnExit = this.Exit,
|
||||
}
|
||||
}
|
||||
},
|
||||
sideFlashes = new MenuSideFlashes(),
|
||||
};
|
||||
});
|
||||
|
||||
buttons.StateChanged += state =>
|
||||
{
|
||||
@ -74,11 +79,7 @@ namespace osu.Game.Screens.Menu
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuGame game = null)
|
||||
{
|
||||
if (game != null)
|
||||
{
|
||||
buttons.OnSettings = game.ToggleSettings;
|
||||
@ -96,7 +97,7 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
public void LoadToSolo() => Schedule(onSolo);
|
||||
|
||||
private void onSolo() =>this.Push(consumeSongSelect());
|
||||
private void onSolo() => this.Push(consumeSongSelect());
|
||||
|
||||
private Screen consumeSongSelect()
|
||||
{
|
||||
@ -154,7 +155,7 @@ namespace osu.Game.Screens.Menu
|
||||
.OnComplete(l => buttons.SetOsuLogo(null));
|
||||
}
|
||||
|
||||
private void beatmap_ValueChanged(WorkingBeatmap newValue)
|
||||
private void beatmap_ValueChanged(ValueChangedEvent<WorkingBeatmap> e)
|
||||
{
|
||||
if (!this.IsCurrentScreen())
|
||||
return;
|
||||
@ -180,7 +181,7 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
base.OnResuming(last);
|
||||
|
||||
((BackgroundScreenDefault)Background).Next();
|
||||
(Background as BackgroundScreenDefault)?.Next();
|
||||
|
||||
//we may have consumed our preloaded instance, so let's make another.
|
||||
preloadSongSelect();
|
||||
|
@ -4,7 +4,6 @@
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
@ -14,6 +13,7 @@ using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using System;
|
||||
using osu.Framework.Bindables;
|
||||
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
|
@ -62,7 +62,7 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
public bool Triangles
|
||||
{
|
||||
set { colourAndTriangles.FadeTo(value ? 1 : 0, transition_length, Easing.OutQuint); }
|
||||
set => colourAndTriangles.FadeTo(value ? 1 : 0, transition_length, Easing.OutQuint);
|
||||
}
|
||||
|
||||
public bool BeatMatching = true;
|
||||
@ -71,8 +71,8 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
public bool Ripple
|
||||
{
|
||||
get { return rippleContainer.Alpha > 0; }
|
||||
set { rippleContainer.FadeTo(value ? 1 : 0, transition_length, Easing.OutQuint); }
|
||||
get => rippleContainer.Alpha > 0;
|
||||
set => rippleContainer.FadeTo(value ? 1 : 0, transition_length, Easing.OutQuint);
|
||||
}
|
||||
|
||||
private readonly Box flashLayer;
|
||||
|
Reference in New Issue
Block a user