Merge branch 'master' into fix-taiko-doublehits

This commit is contained in:
Dean Herbert
2018-09-28 18:57:02 +09:00
committed by GitHub
7 changed files with 27 additions and 18 deletions

View File

@ -72,7 +72,8 @@ namespace osu.Game.Rulesets.Osu.UI
DrawableOsuJudgement explosion = new DrawableOsuJudgement(result, judgedObject) DrawableOsuJudgement explosion = new DrawableOsuJudgement(result, judgedObject)
{ {
Origin = Anchor.Centre, 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); judgementLayer.Add(explosion);

View File

@ -282,17 +282,19 @@ namespace osu.Game.Database
/// Is a no-op for already deleted items. /// Is a no-op for already deleted items.
/// </summary> /// </summary>
/// <param name="item">The item to delete.</param> /// <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()) using (ContextFactory.GetForWrite())
{ {
// re-fetch the model on the import context. // 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)) if (ModelStore.Delete(foundModel))
Files.Dereference(foundModel.Files.Select(f => f.FileInfo).ToArray()); Files.Dereference(foundModel.Files.Select(f => f.FileInfo).ToArray());
return true;
} }
} }

View File

@ -37,7 +37,7 @@ namespace osu.Game.IPC
return; return;
} }
if (importer.HandledExtensions.Contains(Path.GetExtension(path))) if (importer.HandledExtensions.Contains(Path.GetExtension(path)?.ToLowerInvariant()))
importer.Import(path); importer.Import(path);
} }
} }

View File

@ -154,7 +154,7 @@ namespace osu.Game
dependencies.Cache(RulesetStore = new RulesetStore(contextFactory)); dependencies.Cache(RulesetStore = new RulesetStore(contextFactory));
dependencies.Cache(FileStore = new FileStore(contextFactory, Host.Storage)); dependencies.Cache(FileStore = new FileStore(contextFactory, Host.Storage));
dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory, RulesetStore, api, Audio, Host)); 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(KeyBindingStore = new KeyBindingStore(contextFactory, RulesetStore));
dependencies.Cache(SettingsStore = new SettingsStore(contextFactory)); dependencies.Cache(SettingsStore = new SettingsStore(contextFactory));
dependencies.Cache(RulesetConfigCache = new RulesetConfigCache(SettingsStore)); dependencies.Cache(RulesetConfigCache = new RulesetConfigCache(SettingsStore));
@ -243,7 +243,7 @@ namespace osu.Game
public void Import(params string[] paths) public void Import(params string[] paths)
{ {
var extension = Path.GetExtension(paths.First()); var extension = Path.GetExtension(paths.First())?.ToLowerInvariant();
foreach (var importer in fileImporters) foreach (var importer in fileImporters)
if (importer.HandledExtensions.Contains(extension)) importer.Import(paths); if (importer.HandledExtensions.Contains(extension)) importer.Import(paths);

View File

@ -65,13 +65,15 @@ namespace osu.Game.Rulesets.Judgements
this.FadeInFromZero(100, Easing.OutQuint); this.FadeInFromZero(100, Easing.OutQuint);
var origScale = Scale;
switch (Result.Type) switch (Result.Type)
{ {
case HitResult.None: case HitResult.None:
break; break;
case HitResult.Miss: case HitResult.Miss:
this.ScaleTo(1.6f); this.ScaleTo(origScale * 1.6f);
this.ScaleTo(1, 100, Easing.In); this.ScaleTo(origScale, 100, Easing.In);
this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint); this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint);
this.RotateTo(40, 800, Easing.InQuint); this.RotateTo(40, 800, Easing.InQuint);
@ -79,8 +81,8 @@ namespace osu.Game.Rulesets.Judgements
this.Delay(600).FadeOut(200); this.Delay(600).FadeOut(200);
break; break;
default: default:
this.ScaleTo(0.9f); this.ScaleTo(origScale * 0.9f);
this.ScaleTo(1, 500, Easing.OutElastic); this.ScaleTo(origScale, 500, Easing.OutElastic);
this.Delay(100).FadeOut(400); this.Delay(100).FadeOut(400);
break; break;

View File

@ -3,6 +3,7 @@
using System; using System;
using System.IO; using System.IO;
using osu.Framework.Logging;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Database; using osu.Game.Database;
@ -13,8 +14,6 @@ namespace osu.Game.Rulesets.Scoring
{ {
public class ScoreStore : DatabaseBackedStore, ICanAcceptFiles public class ScoreStore : DatabaseBackedStore, ICanAcceptFiles
{ {
private readonly Storage storage;
private readonly BeatmapManager beatmaps; private readonly BeatmapManager beatmaps;
private readonly RulesetStore rulesets; 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) // ReSharper disable once NotAccessedField.Local (we should keep a reference to this so it is not finalised)
private ScoreIPCChannel ipc; 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.beatmaps = beatmaps;
this.rulesets = rulesets; this.rulesets = rulesets;
@ -49,8 +47,14 @@ namespace osu.Game.Rulesets.Scoring
public Score ReadReplayFile(string replayFilename) public Score ReadReplayFile(string replayFilename)
{ {
using (Stream s = storage.GetStream(Path.Combine(replay_folder, replayFilename))) if (File.Exists(replayFilename))
return new DatabasedLegacyScoreParser(rulesets, beatmaps).Parse(s); {
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;
} }
} }
} }

View File

@ -536,7 +536,7 @@ namespace osu.Game.Screens.Select
private void delete(BeatmapSetInfo beatmap) private void delete(BeatmapSetInfo beatmap)
{ {
if (beatmap == null) return; if (beatmap == null || beatmap.ID <= 0) return;
dialogOverlay?.Push(new BeatmapDeleteDialog(beatmap)); dialogOverlay?.Push(new BeatmapDeleteDialog(beatmap));
} }