mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 13:23:21 +08:00
commit
927143ae3a
@ -1 +1 @@
|
|||||||
Subproject commit 1490f003273d7aab6589e489f6e4b02d204c9f27
|
Subproject commit 4caf0c918edfd9d3be0358e2b2cfc4d40908e330
|
@ -83,10 +83,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
});
|
});
|
||||||
|
|
||||||
Add(new PlayerLoader(Player = CreatePlayer(beatmap))
|
Add(Player = CreatePlayer(beatmap));
|
||||||
{
|
|
||||||
Beatmap = beatmap
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual Player CreatePlayer(WorkingBeatmap beatmap)
|
protected virtual Player CreatePlayer(WorkingBeatmap beatmap)
|
||||||
|
@ -189,19 +189,24 @@ namespace osu.Desktop.Overlays
|
|||||||
|
|
||||||
private class UpdateProgressNotification : ProgressNotification
|
private class UpdateProgressNotification : ProgressNotification
|
||||||
{
|
{
|
||||||
|
private OsuGame game;
|
||||||
|
|
||||||
protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification()
|
protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification()
|
||||||
{
|
{
|
||||||
Text = @"Update ready to install. Click to restart!",
|
Text = @"Update ready to install. Click to restart!",
|
||||||
Activated = () =>
|
Activated = () =>
|
||||||
{
|
{
|
||||||
UpdateManager.RestartApp();
|
UpdateManager.RestartAppWhenExited();
|
||||||
|
game.GracefullyExit();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours, OsuGame game)
|
||||||
{
|
{
|
||||||
|
this.game = game;
|
||||||
|
|
||||||
IconContent.Add(new Drawable[]
|
IconContent.Add(new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
|
@ -35,11 +35,9 @@ namespace osu.Game.Modes.Osu.Scoring
|
|||||||
switch (judgement.Result)
|
switch (judgement.Result)
|
||||||
{
|
{
|
||||||
case HitResult.Hit:
|
case HitResult.Hit:
|
||||||
Combo.Value++;
|
|
||||||
Health.Value += 0.1f;
|
Health.Value += 0.1f;
|
||||||
break;
|
break;
|
||||||
case HitResult.Miss:
|
case HitResult.Miss:
|
||||||
Combo.Value = 0;
|
|
||||||
Health.Value -= 0.2f;
|
Health.Value -= 0.2f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -80,14 +80,12 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
protected override void PopIn()
|
protected override void PopIn()
|
||||||
{
|
{
|
||||||
ActiveCursor.FadeTo(1, 250, EasingTypes.OutQuint);
|
ActiveCursor.FadeTo(1, 250, EasingTypes.OutQuint);
|
||||||
ActiveCursor.ScaleTo(1, 1000, EasingTypes.OutElastic);
|
ActiveCursor.ScaleTo(1, 400, EasingTypes.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PopOut()
|
protected override void PopOut()
|
||||||
{
|
{
|
||||||
ActiveCursor.FadeTo(0, 1400, EasingTypes.OutQuint);
|
ActiveCursor.FadeTo(0, 900, EasingTypes.OutQuint);
|
||||||
ActiveCursor.ScaleTo(1.1f, 100, EasingTypes.Out);
|
|
||||||
ActiveCursor.Delay(100);
|
|
||||||
ActiveCursor.ScaleTo(0, 500, EasingTypes.In);
|
ActiveCursor.ScaleTo(0, 500, EasingTypes.In);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Graphics
|
|||||||
/// <param name="easing">The tween easing.</param>
|
/// <param name="easing">The tween easing.</param>
|
||||||
public static void FadeAccent(this IHasAccentColour accentedDrawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None)
|
public static void FadeAccent(this IHasAccentColour accentedDrawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None)
|
||||||
{
|
{
|
||||||
accentedDrawable.TransformTo(accentedDrawable.AccentColour, newColour, duration, easing, new TransformAccent());
|
accentedDrawable.TransformTo(() => accentedDrawable.AccentColour, newColour, duration, easing, new TransformAccent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,8 +108,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
Flush(false, TransformType);
|
|
||||||
|
|
||||||
DisplayedCountSpriteText.Text = FormatCount(Current);
|
DisplayedCountSpriteText.Text = FormatCount(Current);
|
||||||
DisplayedCountSpriteText.Anchor = Anchor;
|
DisplayedCountSpriteText.Anchor = Anchor;
|
||||||
DisplayedCountSpriteText.Origin = Origin;
|
DisplayedCountSpriteText.Origin = Origin;
|
||||||
@ -205,8 +203,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
? GetProportionalDuration(currentValue, newValue)
|
? GetProportionalDuration(currentValue, newValue)
|
||||||
: RollingDuration;
|
: RollingDuration;
|
||||||
|
|
||||||
transform.StartTime = Time.Current;
|
transform.StartTime = TransformStartTime;
|
||||||
transform.EndTime = Time.Current + rollingTotalDuration;
|
transform.EndTime = TransformStartTime + rollingTotalDuration;
|
||||||
transform.StartValue = currentValue;
|
transform.StartValue = currentValue;
|
||||||
transform.EndValue = newValue;
|
transform.EndValue = newValue;
|
||||||
transform.Easing = RollingEasing;
|
transform.Easing = RollingEasing;
|
||||||
|
@ -307,6 +307,18 @@ namespace osu.Game
|
|||||||
return base.OnExiting();
|
return base.OnExiting();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use to programatically exit the game as if the user was triggering via alt-f4.
|
||||||
|
/// Will keep persisting until an exit occurs (exit may be blocked multiple times).
|
||||||
|
/// </summary>
|
||||||
|
public void GracefullyExit()
|
||||||
|
{
|
||||||
|
if (!OnExiting())
|
||||||
|
Exit();
|
||||||
|
else
|
||||||
|
Scheduler.AddDelayed(GracefullyExit, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void UpdateAfterChildren()
|
protected override void UpdateAfterChildren()
|
||||||
{
|
{
|
||||||
base.UpdateAfterChildren();
|
base.UpdateAfterChildren();
|
||||||
|
@ -65,7 +65,7 @@ namespace osu.Game.Overlays
|
|||||||
private void updatePosition(float position)
|
private void updatePosition(float position)
|
||||||
{
|
{
|
||||||
position = MathHelper.Clamp(position, 0, 1);
|
position = MathHelper.Clamp(position, 0, 1);
|
||||||
fill.TransformTo(fill.Width, position, 200, EasingTypes.OutQuint, new TransformSeek());
|
fill.TransformTo(() => fill.Width, position, 200, EasingTypes.OutQuint, new TransformSeek());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
||||||
|
@ -116,7 +116,12 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
scoreProcessor = HitRenderer.CreateScoreProcessor();
|
scoreProcessor = HitRenderer.CreateScoreProcessor();
|
||||||
|
|
||||||
hudOverlay = new StandardHudOverlay();
|
hudOverlay = new StandardHudOverlay()
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre
|
||||||
|
};
|
||||||
|
|
||||||
hudOverlay.KeyCounter.Add(ruleset.CreateGameplayKeys());
|
hudOverlay.KeyCounter.Add(ruleset.CreateGameplayKeys());
|
||||||
hudOverlay.BindProcessor(scoreProcessor);
|
hudOverlay.BindProcessor(scoreProcessor);
|
||||||
hudOverlay.BindHitRenderer(HitRenderer);
|
hudOverlay.BindHitRenderer(HitRenderer);
|
||||||
@ -160,7 +165,12 @@ namespace osu.Game.Screens.Play
|
|||||||
},
|
},
|
||||||
new HotkeyRetryOverlay
|
new HotkeyRetryOverlay
|
||||||
{
|
{
|
||||||
Action = Restart,
|
Action = () => {
|
||||||
|
//we want to hide the hitrenderer immediately (looks better).
|
||||||
|
//we may be able to remove this once the mouse cursor trail is improved.
|
||||||
|
HitRenderer?.Hide();
|
||||||
|
Restart();
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -304,8 +314,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
protected override void OnSuspending(Screen next)
|
protected override void OnSuspending(Screen next)
|
||||||
{
|
{
|
||||||
Content.FadeOut(350);
|
fadeOut();
|
||||||
Content.ScaleTo(0.7f, 750, EasingTypes.InQuint);
|
|
||||||
|
|
||||||
base.OnSuspending(next);
|
base.OnSuspending(next);
|
||||||
}
|
}
|
||||||
@ -324,14 +333,22 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HitRenderer?.FadeOut(60);
|
fadeOut();
|
||||||
|
|
||||||
FadeOut(250);
|
|
||||||
Content.ScaleTo(0.7f, 750, EasingTypes.InQuint);
|
|
||||||
Background?.FadeTo(1f, 200);
|
|
||||||
return base.OnExiting(next);
|
return base.OnExiting(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void fadeOut()
|
||||||
|
{
|
||||||
|
const float fade_out_duration = 250;
|
||||||
|
|
||||||
|
HitRenderer?.FadeOut(fade_out_duration);
|
||||||
|
Content.FadeOut(fade_out_duration);
|
||||||
|
|
||||||
|
hudOverlay.ScaleTo(0.7f, fade_out_duration * 3, EasingTypes.In);
|
||||||
|
|
||||||
|
Background?.FadeTo(1f, fade_out_duration);
|
||||||
|
}
|
||||||
|
|
||||||
private Bindable<bool> mouseWheelDisabled;
|
private Bindable<bool> mouseWheelDisabled;
|
||||||
|
|
||||||
protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused;
|
protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused;
|
||||||
|
@ -298,7 +298,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
private void speedTo(float value, double duration = 0, EasingTypes easing = EasingTypes.None)
|
private void speedTo(float value, double duration = 0, EasingTypes easing = EasingTypes.None)
|
||||||
{
|
{
|
||||||
DelayReset();
|
DelayReset();
|
||||||
TransformTo(speed, value, duration, easing, new TransformScrollSpeed());
|
TransformTo(() => speed, value, duration, easing, new TransformScrollSpeed());
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum ScrollState
|
private enum ScrollState
|
||||||
|
Loading…
Reference in New Issue
Block a user