1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 16:02:58 +08:00

Merge branch 'master' into fix-storyboard-video-offset

This commit is contained in:
Dan Balasescu 2020-04-07 14:30:37 +09:00 committed by GitHub
commit de99eab52a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 59 additions and 63 deletions

View File

@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Mania.Skinning
if (tmp is IFramedAnimation tmpAnimation && tmpAnimation.FrameCount > 0)
frameLength = Math.Max(1000 / 60.0, 170.0 / tmpAnimation.FrameCount);
explosion = skin.GetAnimation(imageName, true, false, startAtCurrentTime: true, frameLength: frameLength).With(d =>
explosion = skin.GetAnimation(imageName, true, false, frameLength: frameLength).With(d =>
{
if (d == null)
return;

View File

@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
Anchor = Anchor.Centre,
Alpha = 0.5f,
}
}, confineMode: ConfineMode.NoScaling);
});
}
public double AnimationStartTime { get; set; }

View File

@ -186,7 +186,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
base.ApplySkin(skin, allowFallback);
bool allowBallTint = skin.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.AllowSliderBallTint)?.Value ?? false;
Ball.Colour = allowBallTint ? AccentColour.Value : Color4.White;
Ball.AccentColour = allowBallTint ? AccentColour.Value : Color4.White;
}
protected override void CheckForResult(bool userTriggered, double timeOffset)

View File

@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
switch (osuComponent.Component)
{
case OsuSkinComponents.FollowPoint:
return this.GetAnimation(component.LookupName, true, false, true);
return this.GetAnimation(component.LookupName, true, false, true, startAtCurrentTime: false);
case OsuSkinComponents.SliderFollowCircle:
var followCircle = this.GetAnimation("sliderfollowcircle", true, true, true);

View File

@ -26,16 +26,8 @@ namespace osu.Game.Tests.Visual.Gameplay
private readonly IReadOnlyList<BreakPeriod> testBreaks = new List<BreakPeriod>
{
new BreakPeriod
{
StartTime = 1000,
EndTime = 5000,
},
new BreakPeriod
{
StartTime = 6000,
EndTime = 13500,
},
new BreakPeriod(1000, 5000),
new BreakPeriod(6000, 13500),
};
public TestSceneBreakTracker()
@ -70,7 +62,7 @@ namespace osu.Game.Tests.Visual.Gameplay
[Test]
public void TestNoEffectsBreak()
{
var shortBreak = new BreakPeriod { EndTime = 500 };
var shortBreak = new BreakPeriod(0, 500);
setClock(true);
loadBreaksStep("short break", new[] { shortBreak });
@ -127,13 +119,12 @@ namespace osu.Game.Tests.Visual.Gameplay
private void addShowBreakStep(double seconds)
{
AddStep($"show '{seconds}s' break", () => breakOverlay.Breaks = breakTracker.Breaks = new List<BreakPeriod>
AddStep($"show '{seconds}s' break", () =>
{
new BreakPeriod
breakOverlay.Breaks = breakTracker.Breaks = new List<BreakPeriod>
{
StartTime = Clock.CurrentTime,
EndTime = Clock.CurrentTime + seconds * 1000,
}
new BreakPeriod(Clock.CurrentTime, Clock.CurrentTime + seconds * 1000)
};
});
}

View File

@ -70,7 +70,7 @@ namespace osu.Game.Tests.Visual.UserInterface
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
AutoSizeAxes = Axes.Both,
Position = new Vector2(0, 25),
Position = new Vector2(-5, 25),
Current = { BindTarget = modSelect.SelectedMods }
}
};

View File

@ -305,12 +305,9 @@ namespace osu.Game.Beatmaps.Formats
case LegacyEventType.Break:
double start = getOffsetTime(Parsing.ParseDouble(split[1]));
double end = Math.Max(start, getOffsetTime(Parsing.ParseDouble(split[2])));
var breakEvent = new BreakPeriod
{
StartTime = start,
EndTime = Math.Max(start, getOffsetTime(Parsing.ParseDouble(split[2])))
};
var breakEvent = new BreakPeriod(start, end);
if (!breakEvent.HasEffect)
return;

View File

@ -32,6 +32,17 @@ namespace osu.Game.Beatmaps.Timing
/// </summary>
public bool HasEffect => Duration >= MIN_BREAK_DURATION;
/// <summary>
/// Constructs a new break period.
/// </summary>
/// <param name="startTime">The start time of the break period.</param>
/// <param name="endTime">The end time of the break period.</param>
public BreakPeriod(double startTime, double endTime)
{
StartTime = startTime;
EndTime = endTime;
}
/// <summary>
/// Whether this break contains a specified time.
/// </summary>

View File

@ -161,7 +161,7 @@ namespace osu.Game.Screens.Multi
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(10, 0),
Spacing = new Vector2(15, 0),
Children = new Drawable[]
{
authorText = new LinkFlowContainer { AutoSizeAxes = Axes.Both },

View File

@ -41,7 +41,7 @@ namespace osu.Game.Screens.Play.HUD
}
}
protected readonly FillFlowContainer<ModIcon> IconsContainer;
private readonly FillFlowContainer<ModIcon> iconsContainer;
private readonly OsuSpriteText unrankedText;
public ModDisplay()
@ -50,13 +50,12 @@ namespace osu.Game.Screens.Play.HUD
Children = new Drawable[]
{
IconsContainer = new ReverseChildIDFillFlowContainer<ModIcon>
iconsContainer = new ReverseChildIDFillFlowContainer<ModIcon>
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Margin = new MarginPadding { Left = 10, Right = 10 },
},
unrankedText = new OsuSpriteText
{
@ -69,11 +68,11 @@ namespace osu.Game.Screens.Play.HUD
Current.ValueChanged += mods =>
{
IconsContainer.Clear();
iconsContainer.Clear();
foreach (Mod mod in mods.NewValue)
{
IconsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.6f) });
iconsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.6f) });
}
if (IsLoaded)
@ -92,7 +91,7 @@ namespace osu.Game.Screens.Play.HUD
base.LoadComplete();
appearTransform();
IconsContainer.FadeInFromZero(fade_duration, Easing.OutQuint);
iconsContainer.FadeInFromZero(fade_duration, Easing.OutQuint);
}
private void appearTransform()
@ -104,20 +103,20 @@ namespace osu.Game.Screens.Play.HUD
expand();
using (IconsContainer.BeginDelayedSequence(1200))
using (iconsContainer.BeginDelayedSequence(1200))
contract();
}
private void expand()
{
if (ExpansionMode != ExpansionMode.AlwaysContracted)
IconsContainer.TransformSpacingTo(new Vector2(5, 0), 500, Easing.OutQuint);
iconsContainer.TransformSpacingTo(new Vector2(5, 0), 500, Easing.OutQuint);
}
private void contract()
{
if (ExpansionMode != ExpansionMode.AlwaysExpanded)
IconsContainer.TransformSpacingTo(new Vector2(-25, 0), 500, Easing.OutQuint);
iconsContainer.TransformSpacingTo(new Vector2(-25, 0), 500, Easing.OutQuint);
}
protected override bool OnHover(HoverEvent e)

View File

@ -285,7 +285,7 @@ namespace osu.Game.Screens.Play
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Top = 20, Right = 10 },
Margin = new MarginPadding { Top = 20, Right = 20 },
};
protected virtual HitErrorDisplay CreateHitErrorDisplayOverlay() => new HitErrorDisplay(scoreProcessor, drawableRuleset?.FirstAvailableHitWindows);

View File

@ -30,6 +30,9 @@ namespace osu.Game.Screens.Ranking.Expanded
private readonly ScoreInfo score;
private readonly List<StatisticDisplay> statisticDisplays = new List<StatisticDisplay>();
private FillFlowContainer starAndModDisplay;
private RollingCounter<long> scoreCounter;
/// <summary>
@ -119,11 +122,12 @@ namespace osu.Game.Screens.Ranking.Expanded
Alpha = 0,
AlwaysPresent = true
},
new FillFlowContainer
starAndModDisplay = new FillFlowContainer
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
AutoSizeAxes = Axes.Both,
Spacing = new Vector2(5, 0),
Children = new Drawable[]
{
new StarRatingDisplay(beatmap)
@ -131,15 +135,6 @@ namespace osu.Game.Screens.Ranking.Expanded
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft
},
new ModDisplay
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
DisplayUnrankedText = false,
ExpansionMode = ExpansionMode.AlwaysExpanded,
Scale = new Vector2(0.5f),
Current = { Value = score.Mods }
}
}
},
new FillFlowContainer
@ -214,6 +209,19 @@ namespace osu.Game.Screens.Ranking.Expanded
}
}
};
if (score.Mods.Any())
{
starAndModDisplay.Add(new ModDisplay
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
DisplayUnrankedText = false,
ExpansionMode = ExpansionMode.AlwaysExpanded,
Scale = new Vector2(0.5f),
Current = { Value = score.Mods }
});
}
}
protected override void LoadComplete()

View File

@ -27,18 +27,19 @@ namespace osu.Game.Screens.Select
}
protected readonly OsuSpriteText MultiplierText;
private readonly FooterModDisplay modDisplay;
private readonly ModDisplay modDisplay;
private Color4 lowMultiplierColour;
private Color4 highMultiplierColour;
public FooterButtonMods()
{
ButtonContentContainer.Add(modDisplay = new FooterModDisplay
ButtonContentContainer.Add(modDisplay = new ModDisplay
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
DisplayUnrankedText = false,
Scale = new Vector2(0.8f)
Scale = new Vector2(0.8f),
ExpansionMode = ExpansionMode.AlwaysContracted,
});
ButtonContentContainer.Add(MultiplierText = new OsuSpriteText
{
@ -84,16 +85,5 @@ namespace osu.Game.Screens.Select
else
modDisplay.FadeOut();
}
private class FooterModDisplay : ModDisplay
{
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Parent?.Parent?.ReceivePositionalInputAt(screenSpacePos) ?? false;
public FooterModDisplay()
{
ExpansionMode = ExpansionMode.AlwaysContracted;
IconsContainer.Margin = new MarginPadding();
}
}
}
}

View File

@ -14,7 +14,7 @@ namespace osu.Game.Skinning
public static class LegacySkinExtensions
{
public static Drawable GetAnimation(this ISkin source, string componentName, bool animatable, bool looping, bool applyConfigFrameRate = false, string animationSeparator = "-",
bool startAtCurrentTime = false, double? frameLength = null)
bool startAtCurrentTime = true, double? frameLength = null)
{
Texture texture;
@ -72,7 +72,7 @@ namespace osu.Game.Skinning
if (timeReference != null)
{
Clock = timeReference.Clock;
PlaybackPosition = timeReference.AnimationStartTime - timeReference.Clock.CurrentTime;
PlaybackPosition = timeReference.Clock.CurrentTime - timeReference.AnimationStartTime;
}
}
}