mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 15:22:55 +08:00
Merge remote-tracking branch 'origin/is-alive' into key-config-settings
This commit is contained in:
commit
89987229de
@ -1 +1 @@
|
||||
Subproject commit e5b0f1c9d0c98ee89563042071e516d5304a6d06
|
||||
Subproject commit fc13a4c2f1eff443ffe7d5ff3ca5caa17b98ffbf
|
@ -68,7 +68,7 @@ namespace osu.Desktop.Tests.Visual
|
||||
|
||||
while (progressingNotifications.Count(n => n.State == ProgressNotificationState.Active) < 3)
|
||||
{
|
||||
var p = progressingNotifications.FirstOrDefault(n => n.IsLoaded && n.State == ProgressNotificationState.Queued);
|
||||
var p = progressingNotifications.FirstOrDefault(n => n.IsAlive && n.State == ProgressNotificationState.Queued);
|
||||
if (p == null)
|
||||
break;
|
||||
|
||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
return;
|
||||
accentColour = value;
|
||||
|
||||
if (LoadState == LoadState.Loaded)
|
||||
if (LoadState == LoadState.Ready)
|
||||
Schedule(reloadTexture);
|
||||
}
|
||||
}
|
||||
|
@ -34,9 +34,8 @@ namespace osu.Game.Graphics.Containers
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(UserInputManager input, OsuConfigManager config)
|
||||
private void load(OsuConfigManager config)
|
||||
{
|
||||
this.input = input;
|
||||
parallaxEnabled = config.GetBindable<bool>(OsuSetting.MenuParallax);
|
||||
parallaxEnabled.ValueChanged += delegate
|
||||
{
|
||||
@ -48,6 +47,12 @@ namespace osu.Game.Graphics.Containers
|
||||
};
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
input = GetContainingInputManager();
|
||||
}
|
||||
|
||||
private bool firstUpdate = true;
|
||||
|
||||
protected override void Update()
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK.Input;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Input;
|
||||
using System;
|
||||
using System.Linq;
|
||||
@ -28,18 +27,10 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
focus = value;
|
||||
if (!focus && HasFocus)
|
||||
inputManager.ChangeFocus(null);
|
||||
GetContainingInputManager().ChangeFocus(null);
|
||||
}
|
||||
}
|
||||
|
||||
private InputManager inputManager;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(UserInputManager inputManager)
|
||||
{
|
||||
this.inputManager = inputManager;
|
||||
}
|
||||
|
||||
protected override void OnFocus(InputState state)
|
||||
{
|
||||
base.OnFocus(state);
|
||||
|
@ -6,7 +6,6 @@ using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
@ -31,12 +30,10 @@ namespace osu.Game.Overlays.Music
|
||||
private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();
|
||||
|
||||
public IEnumerable<BeatmapSetInfo> BeatmapSets;
|
||||
private InputManager inputManager;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGameBase game, BeatmapManager beatmaps, OsuColour colours, UserInputManager inputManager)
|
||||
private void load(OsuGameBase game, BeatmapManager beatmaps, OsuColour colours)
|
||||
{
|
||||
this.inputManager = inputManager;
|
||||
this.beatmaps = beatmaps;
|
||||
|
||||
Children = new Drawable[]
|
||||
@ -102,7 +99,7 @@ namespace osu.Game.Overlays.Music
|
||||
protected override void PopIn()
|
||||
{
|
||||
filter.Search.HoldFocus = true;
|
||||
Schedule(() => inputManager.ChangeFocus(filter.Search));
|
||||
Schedule(() => GetContainingInputManager().ChangeFocus(filter.Search));
|
||||
|
||||
this.ResizeTo(new Vector2(1, playlist_height), transition_duration, Easing.OutQuint);
|
||||
this.FadeIn(transition_duration, Easing.OutQuint);
|
||||
|
@ -57,12 +57,9 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
Spacing = new Vector2(0f, 5f);
|
||||
}
|
||||
|
||||
private InputManager inputManager;
|
||||
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(OsuColour colours, APIAccess api, UserInputManager inputManager)
|
||||
private void load(OsuColour colours, APIAccess api)
|
||||
{
|
||||
this.inputManager = inputManager;
|
||||
this.colours = colours;
|
||||
|
||||
api?.Register(this);
|
||||
@ -174,7 +171,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
break;
|
||||
}
|
||||
|
||||
if (form != null) inputManager.ChangeFocus(form);
|
||||
if (form != null) GetContainingInputManager().ChangeFocus(form);
|
||||
}
|
||||
|
||||
public override bool AcceptsFocus => true;
|
||||
@ -183,7 +180,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
|
||||
protected override void OnFocus(InputState state)
|
||||
{
|
||||
if (form != null) inputManager.ChangeFocus(form);
|
||||
if (form != null) GetContainingInputManager().ChangeFocus(form);
|
||||
base.OnFocus(state);
|
||||
}
|
||||
|
||||
@ -192,7 +189,6 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
private TextBox username;
|
||||
private TextBox password;
|
||||
private APIAccess api;
|
||||
private InputManager inputManager;
|
||||
|
||||
private void performLogin()
|
||||
{
|
||||
@ -201,9 +197,8 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(APIAccess api, OsuConfigManager config, UserInputManager inputManager)
|
||||
private void load(APIAccess api, OsuConfigManager config)
|
||||
{
|
||||
this.inputManager = inputManager;
|
||||
this.api = api;
|
||||
Direction = FillDirection.Vertical;
|
||||
Spacing = new Vector2(0, 5);
|
||||
@ -256,7 +251,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
|
||||
protected override void OnFocus(InputState state)
|
||||
{
|
||||
Schedule(() => { inputManager.ChangeFocus(string.IsNullOrEmpty(username.Text) ? username : password); });
|
||||
Schedule(() => { GetContainingInputManager().ChangeFocus(string.IsNullOrEmpty(username.Text) ? username : password); });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ namespace osu.Game.Screens
|
||||
}
|
||||
|
||||
// Make sure the in-progress loading is complete before pushing the screen.
|
||||
while (screen.LoadState < LoadState.Loaded)
|
||||
while (screen.LoadState < LoadState.Ready)
|
||||
Thread.Sleep(1);
|
||||
|
||||
base.Push(screen);
|
||||
|
@ -108,7 +108,7 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HandleInput => receptor?.IsAlive != true;
|
||||
public override bool HandleInput => receptor == null;
|
||||
|
||||
private Receptor receptor;
|
||||
|
||||
|
@ -227,9 +227,9 @@ namespace osu.Game.Screens.Play
|
||||
Direction = FillDirection.Horizontal,
|
||||
Children = new[]
|
||||
{
|
||||
new SpriteIcon { Icon = FontAwesome.fa_chevron_right },
|
||||
new SpriteIcon { Icon = FontAwesome.fa_chevron_right },
|
||||
new SpriteIcon { Icon = FontAwesome.fa_chevron_right },
|
||||
new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.fa_chevron_right },
|
||||
new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.fa_chevron_right },
|
||||
new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.fa_chevron_right },
|
||||
}
|
||||
},
|
||||
new OsuSpriteText
|
||||
|
@ -153,7 +153,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
searchTextBox.HoldFocus = false;
|
||||
if (searchTextBox.HasFocus)
|
||||
inputManager.ChangeFocus(searchTextBox);
|
||||
GetContainingInputManager().ChangeFocus(searchTextBox);
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
@ -163,13 +163,9 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||
|
||||
private InputManager inputManager;
|
||||
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(OsuColour colours, OsuGame osu, UserInputManager inputManager)
|
||||
private void load(OsuColour colours, OsuGame osu)
|
||||
{
|
||||
this.inputManager = inputManager;
|
||||
|
||||
sortTabs.AccentColour = colours.GreenLight;
|
||||
|
||||
if (osu != null)
|
||||
|
@ -156,11 +156,11 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuGame osu, OsuColour colours, UserInputManager input)
|
||||
private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuGame osu, OsuColour colours)
|
||||
{
|
||||
if (Footer != null)
|
||||
{
|
||||
Footer.AddButton(@"random", colours.Green, () => triggerRandom(input), Key.F2);
|
||||
Footer.AddButton(@"random", colours.Green, triggerRandom, Key.F2);
|
||||
Footer.AddButton(@"options", colours.Blue, BeatmapOptions.ToggleVisibility, Key.F3);
|
||||
|
||||
BeatmapOptions.AddButton(@"Delete", @"Beatmap", FontAwesome.fa_trash, colours.Pink, promptDelete, Key.Number4, float.MaxValue);
|
||||
@ -267,9 +267,9 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
}
|
||||
|
||||
private void triggerRandom(UserInputManager input)
|
||||
private void triggerRandom()
|
||||
{
|
||||
if (input.CurrentState.Keyboard.ShiftPressed)
|
||||
if (GetContainingInputManager().CurrentState.Keyboard.ShiftPressed)
|
||||
carousel.SelectPreviousRandom();
|
||||
else
|
||||
carousel.SelectNextRandom();
|
||||
|
Loading…
Reference in New Issue
Block a user