mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Merge remote-tracking branch 'upstream/master' into spin-in
This commit is contained in:
@ -96,7 +96,8 @@ namespace osu.Game.Database
|
|||||||
private void handleEvent(Action a)
|
private void handleEvent(Action a)
|
||||||
{
|
{
|
||||||
if (delayingEvents)
|
if (delayingEvents)
|
||||||
lock (queuedEvents) queuedEvents.Add(a);
|
lock (queuedEvents)
|
||||||
|
queuedEvents.Add(a);
|
||||||
else
|
else
|
||||||
a.Invoke();
|
a.Invoke();
|
||||||
}
|
}
|
||||||
@ -438,6 +439,13 @@ namespace osu.Game.Database
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!stable.ExistsDirectory(ImportFromStablePath))
|
||||||
|
{
|
||||||
|
// This handles situations like when the user does not have a Skins folder
|
||||||
|
Logger.Log($"No {ImportFromStablePath} folder available in osu!stable installation", LoggingTarget.Information, LogLevel.Error);
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
return Task.Factory.StartNew(() => Import(stable.GetDirectories(ImportFromStablePath).Select(f => stable.GetFullPath(f)).ToArray()), TaskCreationOptions.LongRunning);
|
return Task.Factory.StartNew(() => Import(stable.GetDirectories(ImportFromStablePath).Select(f => stable.GetFullPath(f)).ToArray()), TaskCreationOptions.LongRunning);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using OpenTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Backgrounds
|
namespace osu.Game.Graphics.Backgrounds
|
||||||
{
|
{
|
||||||
@ -28,7 +27,6 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Colour = Color4.DarkGray,
|
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -13,57 +13,59 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
{
|
{
|
||||||
public class GeneralSettings : SettingsSubsection
|
public class GeneralSettings : SettingsSubsection
|
||||||
{
|
{
|
||||||
private TriangleButton importButton;
|
protected override string Header => "General";
|
||||||
private TriangleButton deleteButton;
|
|
||||||
|
private TriangleButton importBeatmapsButton;
|
||||||
|
private TriangleButton importSkinsButton;
|
||||||
|
private TriangleButton deleteSkinsButton;
|
||||||
|
private TriangleButton deleteBeatmapsButton;
|
||||||
private TriangleButton restoreButton;
|
private TriangleButton restoreButton;
|
||||||
private TriangleButton undeleteButton;
|
private TriangleButton undeleteButton;
|
||||||
|
|
||||||
protected override string Header => "General";
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(BeatmapManager beatmaps, SkinManager skins, DialogOverlay dialogOverlay)
|
private void load(BeatmapManager beatmaps, SkinManager skins, DialogOverlay dialogOverlay)
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
importButton = new SettingsButton
|
importBeatmapsButton = new SettingsButton
|
||||||
{
|
{
|
||||||
Text = "Import beatmaps from stable",
|
Text = "Import beatmaps from stable",
|
||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
importButton.Enabled.Value = false;
|
importBeatmapsButton.Enabled.Value = false;
|
||||||
beatmaps.ImportFromStableAsync().ContinueWith(t => Schedule(() => importButton.Enabled.Value = true));
|
beatmaps.ImportFromStableAsync().ContinueWith(t => Schedule(() => importBeatmapsButton.Enabled.Value = true));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteButton = new DangerousSettingsButton
|
deleteBeatmapsButton = new DangerousSettingsButton
|
||||||
{
|
{
|
||||||
Text = "Delete ALL beatmaps",
|
Text = "Delete ALL beatmaps",
|
||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
dialogOverlay?.Push(new DeleteAllBeatmapsDialog(() =>
|
dialogOverlay?.Push(new DeleteAllBeatmapsDialog(() =>
|
||||||
{
|
{
|
||||||
deleteButton.Enabled.Value = false;
|
deleteBeatmapsButton.Enabled.Value = false;
|
||||||
Task.Run(() => beatmaps.Delete(beatmaps.GetAllUsableBeatmapSets())).ContinueWith(t => Schedule(() => deleteButton.Enabled.Value = true));
|
Task.Run(() => beatmaps.Delete(beatmaps.GetAllUsableBeatmapSets())).ContinueWith(t => Schedule(() => deleteBeatmapsButton.Enabled.Value = true));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
importButton = new SettingsButton
|
importSkinsButton = new SettingsButton
|
||||||
{
|
{
|
||||||
Text = "Import skins from stable",
|
Text = "Import skins from stable",
|
||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
importButton.Enabled.Value = false;
|
importSkinsButton.Enabled.Value = false;
|
||||||
skins.ImportFromStableAsync().ContinueWith(t => Schedule(() => importButton.Enabled.Value = true));
|
skins.ImportFromStableAsync().ContinueWith(t => Schedule(() => importSkinsButton.Enabled.Value = true));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteButton = new DangerousSettingsButton
|
deleteSkinsButton = new DangerousSettingsButton
|
||||||
{
|
{
|
||||||
Text = "Delete ALL skins",
|
Text = "Delete ALL skins",
|
||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
dialogOverlay?.Push(new DeleteAllBeatmapsDialog(() =>
|
dialogOverlay?.Push(new DeleteAllBeatmapsDialog(() =>
|
||||||
{
|
{
|
||||||
deleteButton.Enabled.Value = false;
|
deleteSkinsButton.Enabled.Value = false;
|
||||||
Task.Run(() => skins.Delete(skins.GetAllUserSkins())).ContinueWith(t => Schedule(() => deleteButton.Enabled.Value = true));
|
Task.Run(() => skins.Delete(skins.GetAllUserSkins())).ContinueWith(t => Schedule(() => deleteSkinsButton.Enabled.Value = true));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -4,19 +4,14 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Graphics.Transforms;
|
|
||||||
using OpenTK;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.Backgrounds;
|
using osu.Game.Graphics.Backgrounds;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Backgrounds
|
namespace osu.Game.Screens.Backgrounds
|
||||||
{
|
{
|
||||||
public class BackgroundScreenBeatmap : BackgroundScreen
|
public class BackgroundScreenBeatmap : BlurrableBackgroundScreen
|
||||||
{
|
{
|
||||||
private Background background;
|
|
||||||
|
|
||||||
private WorkingBeatmap beatmap;
|
private WorkingBeatmap beatmap;
|
||||||
private Vector2 blurTarget;
|
|
||||||
|
|
||||||
public WorkingBeatmap Beatmap
|
public WorkingBeatmap Beatmap
|
||||||
{
|
{
|
||||||
@ -30,21 +25,21 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
|
|
||||||
Schedule(() =>
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
LoadComponentAsync(new BeatmapBackground(beatmap), b =>
|
LoadComponentAsync(new BeatmapBackground(beatmap), b => Schedule(() =>
|
||||||
{
|
{
|
||||||
float newDepth = 0;
|
float newDepth = 0;
|
||||||
if (background != null)
|
if (Background != null)
|
||||||
{
|
{
|
||||||
newDepth = background.Depth + 1;
|
newDepth = Background.Depth + 1;
|
||||||
background.FinishTransforms();
|
Background.FinishTransforms();
|
||||||
background.FadeOut(250);
|
Background.FadeOut(250);
|
||||||
background.Expire();
|
Background.Expire();
|
||||||
}
|
}
|
||||||
|
|
||||||
b.Depth = newDepth;
|
b.Depth = newDepth;
|
||||||
Add(background = b);
|
Add(Background = b);
|
||||||
background.BlurSigma = blurTarget;
|
Background.BlurSigma = BlurTarget;
|
||||||
});
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -54,9 +49,6 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
Beatmap = beatmap;
|
Beatmap = beatmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TransformSequence<Background> BlurTo(Vector2 sigma, double duration, Easing easing = Easing.None)
|
|
||||||
=> background?.BlurTo(blurTarget = sigma, duration, easing);
|
|
||||||
|
|
||||||
public override bool Equals(BackgroundScreen other)
|
public override bool Equals(BackgroundScreen other)
|
||||||
{
|
{
|
||||||
var otherBeatmapBackground = other as BackgroundScreenBeatmap;
|
var otherBeatmapBackground = other as BackgroundScreenBeatmap;
|
||||||
|
@ -3,32 +3,32 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.MathUtils;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Graphics.Backgrounds;
|
using osu.Game.Graphics.Backgrounds;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Backgrounds
|
namespace osu.Game.Screens.Backgrounds
|
||||||
{
|
{
|
||||||
public class BackgroundScreenDefault : BackgroundScreen
|
public class BackgroundScreenDefault : BlurrableBackgroundScreen
|
||||||
{
|
{
|
||||||
private int currentDisplay;
|
private int currentDisplay;
|
||||||
private const int background_count = 5;
|
private const int background_count = 5;
|
||||||
|
|
||||||
private string backgroundName => $@"Menu/menu-background-{currentDisplay % background_count + 1}";
|
private string backgroundName => $@"Menu/menu-background-{currentDisplay % background_count + 1}";
|
||||||
|
|
||||||
private Background current;
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
|
currentDisplay = RNG.Next(0, background_count);
|
||||||
display(new Background(backgroundName));
|
display(new Background(backgroundName));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void display(Background newBackground)
|
private void display(Background newBackground)
|
||||||
{
|
{
|
||||||
current?.FadeOut(800, Easing.InOutSine);
|
Background?.FadeOut(800, Easing.InOutSine);
|
||||||
current?.Expire();
|
Background?.Expire();
|
||||||
|
|
||||||
Add(current = newBackground);
|
Add(Background = newBackground);
|
||||||
currentDisplay++;
|
currentDisplay++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
20
osu.Game/Screens/BlurrableBackgroundScreen.cs
Normal file
20
osu.Game/Screens/BlurrableBackgroundScreen.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (c) 2007-2018 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.Transforms;
|
||||||
|
using osu.Game.Graphics.Backgrounds;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Screens
|
||||||
|
{
|
||||||
|
public abstract class BlurrableBackgroundScreen : BackgroundScreen
|
||||||
|
{
|
||||||
|
protected Background Background;
|
||||||
|
|
||||||
|
protected Vector2 BlurTarget;
|
||||||
|
|
||||||
|
public TransformSequence<Background> BlurTo(Vector2 sigma, double duration, Easing easing = Easing.None)
|
||||||
|
=> Background?.BlurTo(BlurTarget = sigma, duration, easing);
|
||||||
|
}
|
||||||
|
}
|
@ -10,6 +10,7 @@ using osu.Framework.Input.EventArgs;
|
|||||||
using osu.Framework.Input.States;
|
using osu.Framework.Input.States;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Screens.Backgrounds;
|
using osu.Game.Screens.Backgrounds;
|
||||||
using osu.Game.Screens.Charts;
|
using osu.Game.Screens.Charts;
|
||||||
@ -64,6 +65,20 @@ namespace osu.Game.Screens.Menu
|
|||||||
},
|
},
|
||||||
sideFlashes = new MenuSideFlashes(),
|
sideFlashes = new MenuSideFlashes(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
buttons.StateChanged += state =>
|
||||||
|
{
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case ButtonSystemState.Initial:
|
||||||
|
case ButtonSystemState.Exit:
|
||||||
|
background.FadeColour(Color4.White, 500, Easing.OutSine);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
background.FadeColour(OsuColour.Gray(0.8f), 500, Easing.OutSine);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
|
Reference in New Issue
Block a user