mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Merge branch 'master' into patch-1
This commit is contained in:
commit
0ad049976b
@ -373,17 +373,18 @@ namespace osu.Game.Beatmaps.Formats
|
||||
if (parser == null)
|
||||
parser = new Rulesets.Objects.Legacy.Osu.ConvertHitObjectParser();
|
||||
|
||||
var obj = parser.Parse(line);
|
||||
var obj = parser.Parse(line, getOffsetTime());
|
||||
|
||||
if (obj != null)
|
||||
{
|
||||
obj.StartTime = getOffsetTime(obj.StartTime);
|
||||
beatmap.HitObjects.Add(obj);
|
||||
}
|
||||
}
|
||||
|
||||
private int getOffsetTime(int time) => time + (ApplyOffsets ? offset : 0);
|
||||
|
||||
private double getOffsetTime() => ApplyOffsets ? offset : 0;
|
||||
|
||||
private double getOffsetTime(double time) => time + (ApplyOffsets ? offset : 0);
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
base.PopOut();
|
||||
FadeEdgeEffectTo(0, WaveContainer.DISAPPEAR_DURATION, Easing.Out);
|
||||
cleanup();
|
||||
}
|
||||
|
||||
public void ShowUser(long userId)
|
||||
@ -83,9 +84,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
public void ShowUser(User user, bool fetchOnline = true)
|
||||
{
|
||||
userReq?.Cancel();
|
||||
Clear();
|
||||
lastSection = null;
|
||||
cleanup();
|
||||
|
||||
sections = new ProfileSection[]
|
||||
{
|
||||
@ -165,6 +164,13 @@ namespace osu.Game.Overlays
|
||||
sectionsContainer.ScrollToTop();
|
||||
}
|
||||
|
||||
private void cleanup()
|
||||
{
|
||||
userReq?.Cancel();
|
||||
Clear();
|
||||
lastSection = null;
|
||||
}
|
||||
|
||||
private void userLoadComplete(User user)
|
||||
{
|
||||
Header.User = user;
|
||||
|
@ -19,6 +19,11 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
public abstract class ConvertHitObjectParser : HitObjectParser
|
||||
{
|
||||
public override HitObject Parse(string text)
|
||||
{
|
||||
return Parse(text, 0);
|
||||
}
|
||||
|
||||
public HitObject Parse(string text, double offset)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -146,7 +151,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
}
|
||||
else if ((type & ConvertHitObjectType.Spinner) > 0)
|
||||
{
|
||||
result = CreateSpinner(new Vector2(512, 384) / 2, Convert.ToDouble(split[5], CultureInfo.InvariantCulture));
|
||||
result = CreateSpinner(new Vector2(512, 384) / 2, Convert.ToDouble(split[5], CultureInfo.InvariantCulture) + offset);
|
||||
|
||||
if (split.Length > 6)
|
||||
readCustomSampleBanks(split[6], bankInfo);
|
||||
@ -164,13 +169,13 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
readCustomSampleBanks(string.Join(":", ss.Skip(1)), bankInfo);
|
||||
}
|
||||
|
||||
result = CreateHold(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo, endTime);
|
||||
result = CreateHold(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo, endTime + offset);
|
||||
}
|
||||
|
||||
if (result == null)
|
||||
throw new InvalidOperationException($@"Unknown hit object type {type}.");
|
||||
|
||||
result.StartTime = Convert.ToDouble(split[2], CultureInfo.InvariantCulture);
|
||||
result.StartTime = Convert.ToDouble(split[2], CultureInfo.InvariantCulture) + offset;
|
||||
result.Samples = convertSoundType(soundType, bankInfo);
|
||||
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user