mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 03:25:11 +08:00
Merge branch 'master' into fix-taiko-doublehits
This commit is contained in:
commit
a355d342d4
@ -72,7 +72,8 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
DrawableOsuJudgement explosion = new DrawableOsuJudgement(result, judgedObject)
|
||||
{
|
||||
Origin = Anchor.Centre,
|
||||
Position = ((OsuHitObject)judgedObject.HitObject).StackedEndPosition
|
||||
Position = ((OsuHitObject)judgedObject.HitObject).StackedEndPosition,
|
||||
Scale = new Vector2(((OsuHitObject)judgedObject.HitObject).Scale * 1.65f)
|
||||
};
|
||||
|
||||
judgementLayer.Add(explosion);
|
||||
|
@ -282,17 +282,19 @@ namespace osu.Game.Database
|
||||
/// Is a no-op for already deleted items.
|
||||
/// </summary>
|
||||
/// <param name="item">The item to delete.</param>
|
||||
public void Delete(TModel item)
|
||||
/// <returns>false if no operation was performed</returns>
|
||||
public bool Delete(TModel item)
|
||||
{
|
||||
using (ContextFactory.GetForWrite())
|
||||
{
|
||||
// re-fetch the model on the import context.
|
||||
var foundModel = queryModel().Include(s => s.Files).ThenInclude(f => f.FileInfo).First(s => s.ID == item.ID);
|
||||
var foundModel = queryModel().Include(s => s.Files).ThenInclude(f => f.FileInfo).FirstOrDefault(s => s.ID == item.ID);
|
||||
|
||||
if (foundModel.DeletePending) return;
|
||||
if (foundModel == null || foundModel.DeletePending) return false;
|
||||
|
||||
if (ModelStore.Delete(foundModel))
|
||||
Files.Dereference(foundModel.Files.Select(f => f.FileInfo).ToArray());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ namespace osu.Game.IPC
|
||||
return;
|
||||
}
|
||||
|
||||
if (importer.HandledExtensions.Contains(Path.GetExtension(path)))
|
||||
if (importer.HandledExtensions.Contains(Path.GetExtension(path)?.ToLowerInvariant()))
|
||||
importer.Import(path);
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ namespace osu.Game
|
||||
dependencies.Cache(RulesetStore = new RulesetStore(contextFactory));
|
||||
dependencies.Cache(FileStore = new FileStore(contextFactory, Host.Storage));
|
||||
dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory, RulesetStore, api, Audio, Host));
|
||||
dependencies.Cache(ScoreStore = new ScoreStore(Host.Storage, contextFactory, Host, BeatmapManager, RulesetStore));
|
||||
dependencies.Cache(ScoreStore = new ScoreStore(contextFactory, Host, BeatmapManager, RulesetStore));
|
||||
dependencies.Cache(KeyBindingStore = new KeyBindingStore(contextFactory, RulesetStore));
|
||||
dependencies.Cache(SettingsStore = new SettingsStore(contextFactory));
|
||||
dependencies.Cache(RulesetConfigCache = new RulesetConfigCache(SettingsStore));
|
||||
@ -243,7 +243,7 @@ namespace osu.Game
|
||||
|
||||
public void Import(params string[] paths)
|
||||
{
|
||||
var extension = Path.GetExtension(paths.First());
|
||||
var extension = Path.GetExtension(paths.First())?.ToLowerInvariant();
|
||||
|
||||
foreach (var importer in fileImporters)
|
||||
if (importer.HandledExtensions.Contains(extension)) importer.Import(paths);
|
||||
|
@ -65,13 +65,15 @@ namespace osu.Game.Rulesets.Judgements
|
||||
|
||||
this.FadeInFromZero(100, Easing.OutQuint);
|
||||
|
||||
var origScale = Scale;
|
||||
|
||||
switch (Result.Type)
|
||||
{
|
||||
case HitResult.None:
|
||||
break;
|
||||
case HitResult.Miss:
|
||||
this.ScaleTo(1.6f);
|
||||
this.ScaleTo(1, 100, Easing.In);
|
||||
this.ScaleTo(origScale * 1.6f);
|
||||
this.ScaleTo(origScale, 100, Easing.In);
|
||||
|
||||
this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint);
|
||||
this.RotateTo(40, 800, Easing.InQuint);
|
||||
@ -79,8 +81,8 @@ namespace osu.Game.Rulesets.Judgements
|
||||
this.Delay(600).FadeOut(200);
|
||||
break;
|
||||
default:
|
||||
this.ScaleTo(0.9f);
|
||||
this.ScaleTo(1, 500, Easing.OutElastic);
|
||||
this.ScaleTo(origScale * 0.9f);
|
||||
this.ScaleTo(origScale, 500, Easing.OutElastic);
|
||||
|
||||
this.Delay(100).FadeOut(400);
|
||||
break;
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
@ -13,8 +14,6 @@ namespace osu.Game.Rulesets.Scoring
|
||||
{
|
||||
public class ScoreStore : DatabaseBackedStore, ICanAcceptFiles
|
||||
{
|
||||
private readonly Storage storage;
|
||||
|
||||
private readonly BeatmapManager beatmaps;
|
||||
private readonly RulesetStore rulesets;
|
||||
|
||||
@ -25,9 +24,8 @@ namespace osu.Game.Rulesets.Scoring
|
||||
// ReSharper disable once NotAccessedField.Local (we should keep a reference to this so it is not finalised)
|
||||
private ScoreIPCChannel ipc;
|
||||
|
||||
public ScoreStore(Storage storage, DatabaseContextFactory factory, IIpcHost importHost = null, BeatmapManager beatmaps = null, RulesetStore rulesets = null) : base(factory)
|
||||
public ScoreStore(DatabaseContextFactory factory, IIpcHost importHost = null, BeatmapManager beatmaps = null, RulesetStore rulesets = null) : base(factory)
|
||||
{
|
||||
this.storage = storage;
|
||||
this.beatmaps = beatmaps;
|
||||
this.rulesets = rulesets;
|
||||
|
||||
@ -49,8 +47,14 @@ namespace osu.Game.Rulesets.Scoring
|
||||
|
||||
public Score ReadReplayFile(string replayFilename)
|
||||
{
|
||||
using (Stream s = storage.GetStream(Path.Combine(replay_folder, replayFilename)))
|
||||
return new DatabasedLegacyScoreParser(rulesets, beatmaps).Parse(s);
|
||||
if (File.Exists(replayFilename))
|
||||
{
|
||||
using (var stream = File.OpenRead(replayFilename))
|
||||
return new DatabasedLegacyScoreParser(rulesets, beatmaps).Parse(stream);
|
||||
}
|
||||
|
||||
Logger.Log($"Replay file {replayFilename} cannot be found", LoggingTarget.Information, LogLevel.Error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -536,7 +536,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private void delete(BeatmapSetInfo beatmap)
|
||||
{
|
||||
if (beatmap == null) return;
|
||||
if (beatmap == null || beatmap.ID <= 0) return;
|
||||
dialogOverlay?.Push(new BeatmapDeleteDialog(beatmap));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user