mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 03:27:21 +09:00
Merge branch 'master' into scrolling-lifetime-safety
This commit is contained in:
commit
07380af877
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Replays;
|
using osu.Game.Replays;
|
||||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
|
|
||||||
@ -77,13 +78,37 @@ namespace osu.Game.Rulesets.Mania.Replays
|
|||||||
|
|
||||||
private IEnumerable<IActionPoint> generateActionPoints()
|
private IEnumerable<IActionPoint> generateActionPoints()
|
||||||
{
|
{
|
||||||
foreach (var obj in Beatmap.HitObjects)
|
for (int i = 0; i < Beatmap.HitObjects.Count; i++)
|
||||||
{
|
{
|
||||||
yield return new HitPoint { Time = obj.StartTime, Column = obj.Column };
|
var currentObject = Beatmap.HitObjects[i];
|
||||||
yield return new ReleasePoint { Time = ((obj as IHasEndTime)?.EndTime ?? obj.StartTime) + RELEASE_DELAY, Column = obj.Column };
|
var nextObjectInColumn = GetNextObject(i); // Get the next object that requires pressing the same button
|
||||||
|
|
||||||
|
double endTime = (currentObject as IHasEndTime)?.EndTime ?? currentObject.StartTime;
|
||||||
|
|
||||||
|
bool canDelayKeyUp = nextObjectInColumn == null ||
|
||||||
|
nextObjectInColumn.StartTime > endTime + RELEASE_DELAY;
|
||||||
|
|
||||||
|
double calculatedDelay = canDelayKeyUp ? RELEASE_DELAY : (nextObjectInColumn.StartTime - endTime) * 0.9;
|
||||||
|
|
||||||
|
yield return new HitPoint { Time = currentObject.StartTime, Column = currentObject.Column };
|
||||||
|
|
||||||
|
yield return new ReleasePoint { Time = endTime + calculatedDelay, Column = currentObject.Column };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override HitObject GetNextObject(int currentIndex)
|
||||||
|
{
|
||||||
|
int desiredColumn = Beatmap.HitObjects[currentIndex].Column;
|
||||||
|
|
||||||
|
for (int i = currentIndex + 1; i < Beatmap.HitObjects.Count; i++)
|
||||||
|
{
|
||||||
|
if (Beatmap.HitObjects[i].Column == desiredColumn)
|
||||||
|
return Beatmap.HitObjects[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private interface IActionPoint
|
private interface IActionPoint
|
||||||
{
|
{
|
||||||
double Time { get; set; }
|
double Time { get; set; }
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
@ -10,6 +10,7 @@ using osu.Game.Rulesets.Objects.Types;
|
|||||||
using osu.Game.Rulesets.Taiko.Objects;
|
using osu.Game.Rulesets.Taiko.Objects;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
using osu.Game.Rulesets.Taiko.Beatmaps;
|
using osu.Game.Rulesets.Taiko.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Replays
|
namespace osu.Game.Rulesets.Taiko.Replays
|
||||||
{
|
{
|
||||||
@ -113,7 +114,13 @@ namespace osu.Game.Rulesets.Taiko.Replays
|
|||||||
else
|
else
|
||||||
throw new InvalidOperationException("Unknown hit object type.");
|
throw new InvalidOperationException("Unknown hit object type.");
|
||||||
|
|
||||||
Frames.Add(new TaikoReplayFrame(endTime + KEY_UP_DELAY));
|
var nextHitObject = GetNextObject(i); // Get the next object that requires pressing the same button
|
||||||
|
|
||||||
|
bool canDelayKeyUp = nextHitObject == null || nextHitObject.StartTime > endTime + KEY_UP_DELAY;
|
||||||
|
|
||||||
|
double calculatedDelay = canDelayKeyUp ? KEY_UP_DELAY : (nextHitObject.StartTime - endTime) * 0.9;
|
||||||
|
|
||||||
|
Frames.Add(new TaikoReplayFrame(endTime + calculatedDelay));
|
||||||
|
|
||||||
if (i < Beatmap.HitObjects.Count - 1)
|
if (i < Beatmap.HitObjects.Count - 1)
|
||||||
{
|
{
|
||||||
@ -127,5 +134,24 @@ namespace osu.Game.Rulesets.Taiko.Replays
|
|||||||
|
|
||||||
return Replay;
|
return Replay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override HitObject GetNextObject(int currentIndex)
|
||||||
|
{
|
||||||
|
Type desiredType = Beatmap.HitObjects[currentIndex].GetType();
|
||||||
|
|
||||||
|
for (int i = currentIndex + 1; i < Beatmap.HitObjects.Count; i++)
|
||||||
|
{
|
||||||
|
var currentObj = Beatmap.HitObjects[i];
|
||||||
|
|
||||||
|
if (currentObj.GetType() == desiredType ||
|
||||||
|
// Un-press all keys before a DrumRoll or Swell
|
||||||
|
currentObj is DrumRoll || currentObj is Swell)
|
||||||
|
{
|
||||||
|
return Beatmap.HitObjects[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,19 +138,15 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
protected override Skin GetSkin()
|
protected override Skin GetSkin()
|
||||||
{
|
{
|
||||||
Skin skin;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
skin = new LegacyBeatmapSkin(BeatmapInfo, store, AudioManager);
|
return new LegacyBeatmapSkin(BeatmapInfo, store, AudioManager);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logger.Error(e, "Skin failed to load");
|
Logger.Error(e, "Skin failed to load");
|
||||||
skin = new DefaultSkin();
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return skin;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Replays;
|
using osu.Game.Replays;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Replays
|
namespace osu.Game.Rulesets.Replays
|
||||||
{
|
{
|
||||||
@ -34,5 +35,13 @@ namespace osu.Game.Rulesets.Replays
|
|||||||
protected const double KEY_UP_DELAY = 50;
|
protected const double KEY_UP_DELAY = 50;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
protected virtual HitObject GetNextObject(int currentIndex)
|
||||||
|
{
|
||||||
|
if (currentIndex >= Beatmap.HitObjects.Count - 1)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return Beatmap.HitObjects[currentIndex + 1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets
|
|||||||
public IRulesetConfigManager GetConfigFor(Ruleset ruleset)
|
public IRulesetConfigManager GetConfigFor(Ruleset ruleset)
|
||||||
{
|
{
|
||||||
if (ruleset.RulesetInfo.ID == null)
|
if (ruleset.RulesetInfo.ID == null)
|
||||||
throw new InvalidOperationException("The provided ruleset doesn't have a valid id.");
|
return null;
|
||||||
|
|
||||||
return configCache.GetOrAdd(ruleset.RulesetInfo.ID.Value, _ => ruleset.CreateConfig(settingsStore));
|
return configCache.GetOrAdd(ruleset.RulesetInfo.ID.Value, _ => ruleset.CreateConfig(settingsStore));
|
||||||
}
|
}
|
||||||
|
@ -62,13 +62,20 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
public override GameplayClock FrameStableClock => frameStabilityContainer.GameplayClock;
|
public override GameplayClock FrameStableClock => frameStabilityContainer.GameplayClock;
|
||||||
|
|
||||||
|
private bool frameStablePlayback = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether to enable frame-stable playback.
|
/// Whether to enable frame-stable playback.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal bool FrameStablePlayback
|
internal bool FrameStablePlayback
|
||||||
{
|
{
|
||||||
get => frameStabilityContainer.FrameStablePlayback;
|
get => frameStablePlayback;
|
||||||
set => frameStabilityContainer.FrameStablePlayback = value;
|
set
|
||||||
|
{
|
||||||
|
frameStablePlayback = false;
|
||||||
|
if (frameStabilityContainer != null)
|
||||||
|
frameStabilityContainer.FrameStablePlayback = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -156,6 +163,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
{
|
{
|
||||||
frameStabilityContainer = new FrameStabilityContainer(GameplayStartTime)
|
frameStabilityContainer = new FrameStabilityContainer(GameplayStartTime)
|
||||||
{
|
{
|
||||||
|
FrameStablePlayback = FrameStablePlayback,
|
||||||
Child = KeyBindingInputManager
|
Child = KeyBindingInputManager
|
||||||
.WithChild(CreatePlayfieldAdjustmentContainer()
|
.WithChild(CreatePlayfieldAdjustmentContainer()
|
||||||
.WithChild(Playfield)
|
.WithChild(Playfield)
|
||||||
|
@ -155,6 +155,11 @@ namespace osu.Game.Skinning
|
|||||||
// Spacing value was reverse-engineered from the ratio of the rendered sprite size in the visual inspector vs the actual texture size
|
// Spacing value was reverse-engineered from the ratio of the rendered sprite size in the visual inspector vs the actual texture size
|
||||||
Spacing = new Vector2(-Configuration.HitCircleOverlap * 0.89f, 0)
|
Spacing = new Vector2(-Configuration.HitCircleOverlap * 0.89f, 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
default:
|
||||||
|
string lastPiece = componentName.Split('/').Last();
|
||||||
|
componentName = componentName.StartsWith("Gameplay/taiko/") ? "taiko-" + lastPiece : lastPiece;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return getAnimation(componentName, animatable, looping);
|
return getAnimation(componentName, animatable, looping);
|
||||||
@ -226,11 +231,8 @@ namespace osu.Game.Skinning
|
|||||||
{
|
{
|
||||||
bool hasExtension = filename.Contains('.');
|
bool hasExtension = filename.Contains('.');
|
||||||
|
|
||||||
string lastPiece = filename.Split('/').Last();
|
|
||||||
var legacyName = filename.StartsWith("Gameplay/taiko/") ? "taiko-" + lastPiece : lastPiece;
|
|
||||||
|
|
||||||
var file = source.Files.Find(f =>
|
var file = source.Files.Find(f =>
|
||||||
string.Equals(hasExtension ? f.Filename : Path.ChangeExtension(f.Filename, null), legacyName, StringComparison.InvariantCultureIgnoreCase));
|
string.Equals(hasExtension ? f.Filename : Path.ChangeExtension(f.Filename, null), filename, StringComparison.InvariantCultureIgnoreCase));
|
||||||
return file?.FileInfo.StoragePath;
|
return file?.FileInfo.StoragePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user