mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge branch 'master' into confine-during-gameplay
# Conflicts: # osu.Game/Configuration/OsuConfigManager.cs # osu.Game/OsuGame.cs # osu.Game/Screens/Play/Player.cs
This commit is contained in:
@ -1,12 +1,14 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Overlays.Settings.Sections.Gameplay;
|
||||
using osu.Game.Rulesets;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Logging;
|
||||
|
||||
namespace osu.Game.Overlays.Settings.Sections
|
||||
{
|
||||
@ -34,9 +36,17 @@ namespace osu.Game.Overlays.Settings.Sections
|
||||
{
|
||||
foreach (Ruleset ruleset in rulesets.AvailableRulesets.Select(info => info.CreateInstance()))
|
||||
{
|
||||
SettingsSubsection section = ruleset.CreateSettings();
|
||||
if (section != null)
|
||||
Add(section);
|
||||
try
|
||||
{
|
||||
SettingsSubsection section = ruleset.CreateSettings();
|
||||
|
||||
if (section != null)
|
||||
Add(section);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Error(e, "Failed to load ruleset settings");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -236,7 +236,6 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
PlaceholderText = "password",
|
||||
RelativeSizeAxes = Axes.X,
|
||||
TabbableContentContainer = this,
|
||||
OnCommit = (sender, newText) => performLogin()
|
||||
},
|
||||
new SettingsCheckbox
|
||||
{
|
||||
@ -276,6 +275,8 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
password.OnCommit += (sender, newText) => performLogin();
|
||||
}
|
||||
|
||||
public override bool AcceptsFocus => true;
|
||||
|
@ -163,8 +163,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
scalingSettings.ForEach(s => s.TransferValueOnCommit = mode.NewValue == ScalingMode.Everything);
|
||||
}, true);
|
||||
|
||||
windowModes.ItemsAdded += _ => windowModesChanged();
|
||||
windowModes.ItemsRemoved += _ => windowModesChanged();
|
||||
windowModes.CollectionChanged += (sender, args) => windowModesChanged();
|
||||
|
||||
windowModesChanged();
|
||||
}
|
||||
|
@ -3,9 +3,11 @@
|
||||
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Collections;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Skinning;
|
||||
@ -19,14 +21,15 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
private TriangleButton importBeatmapsButton;
|
||||
private TriangleButton importScoresButton;
|
||||
private TriangleButton importSkinsButton;
|
||||
private TriangleButton importCollectionsButton;
|
||||
private TriangleButton deleteBeatmapsButton;
|
||||
private TriangleButton deleteScoresButton;
|
||||
private TriangleButton deleteSkinsButton;
|
||||
private TriangleButton restoreButton;
|
||||
private TriangleButton undeleteButton;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(BeatmapManager beatmaps, ScoreManager scores, SkinManager skins, DialogOverlay dialogOverlay)
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(BeatmapManager beatmaps, ScoreManager scores, SkinManager skins, [CanBeNull] CollectionManager collectionManager, DialogOverlay dialogOverlay)
|
||||
{
|
||||
if (beatmaps.SupportsImportFromStable)
|
||||
{
|
||||
@ -93,20 +96,46 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
});
|
||||
}
|
||||
|
||||
AddRange(new Drawable[]
|
||||
Add(deleteSkinsButton = new DangerousSettingsButton
|
||||
{
|
||||
deleteSkinsButton = new DangerousSettingsButton
|
||||
Text = "Delete ALL skins",
|
||||
Action = () =>
|
||||
{
|
||||
Text = "Delete ALL skins",
|
||||
dialogOverlay?.Push(new DeleteAllBeatmapsDialog(() =>
|
||||
{
|
||||
deleteSkinsButton.Enabled.Value = false;
|
||||
Task.Run(() => skins.Delete(skins.GetAllUserSkins())).ContinueWith(t => Schedule(() => deleteSkinsButton.Enabled.Value = true));
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
if (collectionManager != null)
|
||||
{
|
||||
if (collectionManager.SupportsImportFromStable)
|
||||
{
|
||||
Add(importCollectionsButton = new SettingsButton
|
||||
{
|
||||
Text = "Import collections from stable",
|
||||
Action = () =>
|
||||
{
|
||||
importCollectionsButton.Enabled.Value = false;
|
||||
collectionManager.ImportFromStableAsync().ContinueWith(t => Schedule(() => importCollectionsButton.Enabled.Value = true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Add(new DangerousSettingsButton
|
||||
{
|
||||
Text = "Delete ALL collections",
|
||||
Action = () =>
|
||||
{
|
||||
dialogOverlay?.Push(new DeleteAllBeatmapsDialog(() =>
|
||||
{
|
||||
deleteSkinsButton.Enabled.Value = false;
|
||||
Task.Run(() => skins.Delete(skins.GetAllUserSkins())).ContinueWith(t => Schedule(() => deleteSkinsButton.Enabled.Value = true));
|
||||
}));
|
||||
dialogOverlay?.Push(new DeleteAllBeatmapsDialog(collectionManager.DeleteAll));
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
AddRange(new Drawable[]
|
||||
{
|
||||
restoreButton = new SettingsButton
|
||||
{
|
||||
Text = "Restore all hidden difficulties",
|
||||
|
@ -106,7 +106,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
|
||||
private void start()
|
||||
{
|
||||
var target = directorySelector.CurrentDirectory.Value;
|
||||
var target = directorySelector.CurrentPath.Value;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -4,22 +4,21 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Framework;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Overlays.Toolbar;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Settings
|
||||
{
|
||||
public class Sidebar : Container<SidebarButton>, IStateful<ExpandedState>
|
||||
{
|
||||
private readonly FillFlowContainer<SidebarButton> content;
|
||||
public const float DEFAULT_WIDTH = ToolbarButton.WIDTH;
|
||||
public const float DEFAULT_WIDTH = Toolbar.Toolbar.HEIGHT * 1.4f;
|
||||
public const int EXPANDED_WIDTH = 200;
|
||||
|
||||
public event Action<ExpandedState> StateChanged;
|
||||
|
Reference in New Issue
Block a user