mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:52:55 +08:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into beatmap_scores
This commit is contained in:
commit
8688afecde
@ -233,7 +233,8 @@ namespace osu.Desktop.Overlays
|
||||
Text = @"Update ready to install. Click to restart!",
|
||||
Activated = () =>
|
||||
{
|
||||
UpdateManager.RestartAppWhenExited();
|
||||
// Squirrel returns execution to us after the update process is started, so it's safe to use Wait() here
|
||||
UpdateManager.RestartAppWhenExited().Wait();
|
||||
game.GracefullyExit();
|
||||
return true;
|
||||
}
|
||||
|
@ -341,6 +341,8 @@ namespace osu.Game.Beatmaps
|
||||
/// Returns a <see cref="BeatmapSetInfo"/> to a usable state if it has previously been deleted but not yet purged.
|
||||
/// Is a no-op for already usable beatmaps.
|
||||
/// </summary>
|
||||
/// <param name="beatmaps">The store to restore beatmaps from.</param>
|
||||
/// <param name="files">The store to restore beatmap files from.</param>
|
||||
/// <param name="beatmapSet">The beatmap to restore.</param>
|
||||
private void undelete(BeatmapStore beatmaps, FileStore files, BeatmapSetInfo beatmapSet)
|
||||
{
|
||||
@ -426,6 +428,8 @@ namespace osu.Game.Beatmaps
|
||||
/// Import a beamap into our local <see cref="FileStore"/> storage.
|
||||
/// If the beatmap is already imported, the existing instance will be returned.
|
||||
/// </summary>
|
||||
/// <param name="files">The store to import beatmap files to.</param>
|
||||
/// <param name="beatmaps">The store to import beatmaps to.</param>
|
||||
/// <param name="reader">The beatmap archive to be read.</param>
|
||||
/// <returns>The imported beatmap, or an existing instance if it is already present.</returns>
|
||||
private BeatmapSetInfo importToStorage(FileStore files, BeatmapStore beatmaps, ArchiveReader reader)
|
||||
|
@ -102,7 +102,7 @@ namespace osu.Game.Database
|
||||
return null;
|
||||
}
|
||||
|
||||
public new int SaveChanges(IDbContextTransaction transaction = null)
|
||||
public int SaveChanges(IDbContextTransaction transaction = null)
|
||||
{
|
||||
var ret = base.SaveChanges();
|
||||
transaction?.Commit();
|
||||
@ -262,7 +262,7 @@ namespace osu.Game.Database
|
||||
throw new MigrationFailedException(e);
|
||||
}
|
||||
}
|
||||
catch (MigrationFailedException e)
|
||||
catch (MigrationFailedException)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace osu.Game.IO
|
||||
{
|
||||
public readonly IResourceStore<byte[]> Store;
|
||||
|
||||
public Storage Storage => base.Storage;
|
||||
public new Storage Storage => base.Storage;
|
||||
|
||||
public FileStore(Func<OsuDbContext> createContext, Storage storage) : base(createContext, storage.GetStorageForDirectory(@"files"))
|
||||
{
|
||||
|
@ -26,6 +26,8 @@ namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
MostPlayed,
|
||||
Favourite,
|
||||
RankedAndApproved
|
||||
RankedAndApproved,
|
||||
Unranked,
|
||||
Graveyard
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ namespace osu.Game.Overlays.Direct
|
||||
|
||||
public DirectGridPanel(BeatmapSetInfo beatmap) : base(beatmap)
|
||||
{
|
||||
Width = 400;
|
||||
Height = 140 + vertical_padding; //full height of all the elements plus vertical padding (autosize uses the image)
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ namespace osu.Game.Overlays
|
||||
switch (displayStyle)
|
||||
{
|
||||
case PanelDisplayStyle.Grid:
|
||||
return new DirectGridPanel(b) { Width = 400 };
|
||||
return new DirectGridPanel(b);
|
||||
default:
|
||||
return new DirectListPanel(b);
|
||||
}
|
||||
|
@ -17,9 +17,9 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
|
||||
|
||||
private readonly BeatmapSetType type;
|
||||
|
||||
private DirectPanel playing;
|
||||
private DirectPanel currentlyPlaying;
|
||||
|
||||
public PaginatedBeatmapContainer(BeatmapSetType type, Bindable<User> user, string header, string missing)
|
||||
public PaginatedBeatmapContainer(BeatmapSetType type, Bindable<User> user, string header, string missing = "None... yet.")
|
||||
: base(user, header, missing)
|
||||
{
|
||||
this.type = type;
|
||||
@ -27,7 +27,6 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
|
||||
ItemsPerPage = 6;
|
||||
|
||||
ItemsContainer.Spacing = new Vector2(panel_padding);
|
||||
ItemsContainer.Margin = new MarginPadding { Bottom = panel_padding };
|
||||
}
|
||||
|
||||
protected override void ShowMore()
|
||||
@ -52,24 +51,18 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
|
||||
if (!s.OnlineBeatmapSetID.HasValue)
|
||||
continue;
|
||||
|
||||
var subReq = new GetBeatmapSetRequest(s.OnlineBeatmapSetID.Value);
|
||||
subReq.Success += b =>
|
||||
var panel = new DirectGridPanel(s.ToBeatmapSet(Rulesets));
|
||||
ItemsContainer.Add(panel);
|
||||
|
||||
panel.PreviewPlaying.ValueChanged += isPlaying =>
|
||||
{
|
||||
var panel = new DirectGridPanel(b.ToBeatmapSet(Rulesets)) { Width = 400 };
|
||||
ItemsContainer.Add(panel);
|
||||
if (!isPlaying) return;
|
||||
|
||||
panel.PreviewPlaying.ValueChanged += newValue =>
|
||||
{
|
||||
if (newValue)
|
||||
{
|
||||
if (playing != null && playing != panel)
|
||||
playing.PreviewPlaying.Value = false;
|
||||
playing = panel;
|
||||
}
|
||||
};
|
||||
if (currentlyPlaying != null && currentlyPlaying != panel)
|
||||
currentlyPlaying.PreviewPlaying.Value = false;
|
||||
|
||||
currentlyPlaying = panel;
|
||||
};
|
||||
|
||||
Api.Queue(subReq);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -16,8 +16,10 @@ namespace osu.Game.Overlays.Profile.Sections
|
||||
{
|
||||
Children = new[]
|
||||
{
|
||||
new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, "Favourite Beatmaps", "None... yet."),
|
||||
new PaginatedBeatmapContainer(BeatmapSetType.RankedAndApproved, User, "Ranked & Approved Beatmaps", "None... yet."),
|
||||
new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, "Favourite Beatmaps"),
|
||||
new PaginatedBeatmapContainer(BeatmapSetType.RankedAndApproved, User, "Ranked & Approved Beatmaps"),
|
||||
new PaginatedBeatmapContainer(BeatmapSetType.Unranked, User, "Pending Beatmaps"),
|
||||
new PaginatedBeatmapContainer(BeatmapSetType.Graveyard, User, "Graveyarded Beatmaps"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ namespace osu.Game.Overlays.Profile.Sections
|
||||
{
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Margin = new MarginPadding { Bottom = 10 }
|
||||
},
|
||||
ShowMoreButton = new OsuHoverContainer
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Overlays.Settings
|
||||
|
||||
private SpriteText text;
|
||||
|
||||
private readonly RestoreDefaultValueButton<T> restoreDefaultValueButton = new RestoreDefaultValueButton<T>();
|
||||
private readonly RestoreDefaultValueButton restoreDefaultValueButton = new RestoreDefaultValueButton();
|
||||
|
||||
public bool ShowsDefaultIndicator = true;
|
||||
|
||||
@ -132,7 +132,7 @@ namespace osu.Game.Overlays.Settings
|
||||
}
|
||||
}
|
||||
|
||||
private class RestoreDefaultValueButton<T> : Box, IHasTooltip
|
||||
private class RestoreDefaultValueButton : Box, IHasTooltip
|
||||
{
|
||||
private Bindable<T> bindable;
|
||||
internal Bindable<T> Bindable
|
||||
|
@ -1,20 +0,0 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace osu.Game.Tests.Resources
|
||||
{
|
||||
public static class Resource
|
||||
{
|
||||
public static Stream OpenResource(string name)
|
||||
{
|
||||
var localPath = Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path));
|
||||
|
||||
return Assembly.GetExecutingAssembly().GetManifestResourceStream($@"osu.Game.Tests.Resources.{name}") ??
|
||||
Assembly.LoadFrom(Path.Combine(localPath, @"osu.Game.Resources.dll")).GetManifestResourceStream($@"osu.Game.Resources.{name}");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -114,7 +114,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Zoom target as a relative position in the <see cref="Content"/> space.
|
||||
/// Zoom target as a relative position in the <see cref="ScrollingTimelineContainer.Content"/> space.
|
||||
/// </summary>
|
||||
private float? relativeContentZoomTarget;
|
||||
|
||||
|
@ -12,7 +12,6 @@ using osu.Framework.MathUtils;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.IO;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
@ -21,8 +20,6 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
public class Intro : OsuScreen
|
||||
{
|
||||
private readonly IntroSequence introSequence;
|
||||
|
||||
private const string menu_music_beatmap_hash = "3c8b1fcc9434dbb29e2fb613d3b9eada9d7bb6c125ceb32396c3b53437280c83";
|
||||
|
||||
/// <summary>
|
||||
@ -43,7 +40,6 @@ namespace osu.Game.Screens.Menu
|
||||
private Bindable<bool> menuVoice;
|
||||
private Bindable<bool> menuMusic;
|
||||
private Track track;
|
||||
private readonly ParallaxContainer parallax;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game)
|
||||
|
Loading…
Reference in New Issue
Block a user