Compare commits
69 Commits
86f0159e65
...
de58aec23e
| Author | SHA1 | Date | |
|---|---|---|---|
| de58aec23e | |||
|
|
734c6f933d | ||
|
|
ac213c90cb | ||
|
|
74ca87c252 | ||
|
|
032912e62b | ||
|
|
1e79c56240 | ||
|
|
82256ae2de | ||
|
|
1142be45ec | ||
|
|
dcb6d71287 | ||
|
|
881a35b382 | ||
|
|
89d8b402af | ||
|
|
1d351002df | ||
|
|
2606f3a0b5 | ||
|
|
1c463aa060 | ||
|
|
7853abe8aa | ||
|
|
1aff418981 | ||
|
|
62e92bb242 | ||
|
|
79151ae5b4 | ||
|
|
c17db2cdd0 | ||
|
|
bbdd70c843 | ||
|
|
4250a54245 | ||
|
|
40fdb8662e | ||
|
|
6ce8b0a4bc | ||
|
|
b30047def6 | ||
|
|
0ffb86262f | ||
|
|
f71eb4b980 | ||
|
|
1faf02e860 | ||
|
|
d700375e55 | ||
|
|
095a67c24e | ||
|
|
86054497d0 | ||
|
|
c4f7dee82b | ||
|
|
22825f6509 | ||
|
|
691e8bcd05 | ||
|
|
e68bab4f4b | ||
|
|
9430a62af4 | ||
|
|
bdac75e542 | ||
|
|
5c2df50714 | ||
|
|
887d280bfa | ||
|
|
84db289779 | ||
|
|
4c0522b795 | ||
|
|
07ea9fe2a4 | ||
|
|
f73307876e | ||
|
|
4e4aa44a02 | ||
|
|
a6c001244f | ||
|
|
107098314a | ||
|
|
d1d76a76ba | ||
|
|
2a7e71d7fd | ||
|
|
0b4f96efc8 | ||
|
|
78c6973298 | ||
|
|
d8d7c80832 | ||
|
|
ae33690632 | ||
|
|
9e2ea63e70 | ||
|
|
79bfe7880a | ||
|
|
80fbcd5fbd | ||
|
|
9c2319b989 | ||
|
|
a040143825 | ||
|
|
1867aad1a6 | ||
|
|
b1bc5cae87 | ||
|
|
038bf3fdda | ||
|
|
61c3aad537 | ||
|
|
3aad0868af | ||
|
|
973c4c8319 | ||
|
|
ac21f8b960 | ||
|
|
0b3b6468a5 | ||
|
|
7d1c54f045 | ||
|
|
fd504e5641 | ||
|
|
93ed0483b6 | ||
|
|
4dd0672aa5 | ||
|
|
66eff14d2b |
@@ -21,7 +21,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ppy.localisationanalyser.tools": {
|
"ppy.localisationanalyser.tools": {
|
||||||
"version": "2024.802.0",
|
"version": "2025.1208.0",
|
||||||
"commands": [
|
"commands": [
|
||||||
"localisation"
|
"localisation"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
|
|||||||
leaderboard.Origin = Anchor.CentreLeft;
|
leaderboard.Origin = Anchor.CentreLeft;
|
||||||
leaderboard.X = 10;
|
leaderboard.X = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var d in container.OfType<ISerialisableDrawable>())
|
||||||
|
d.UsesFixedAnchor = true;
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
|
|||||||
|
|
||||||
if (spectatorList != null)
|
if (spectatorList != null)
|
||||||
spectatorList.Position = new Vector2(36, -66);
|
spectatorList.Position = new Vector2(36, -66);
|
||||||
|
|
||||||
|
foreach (var d in container.OfType<ISerialisableDrawable>())
|
||||||
|
d.UsesFixedAnchor = true;
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
new DrawableGameplayLeaderboard(),
|
new DrawableGameplayLeaderboard(),
|
||||||
|
|||||||
@@ -122,6 +122,9 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
|
|||||||
leaderboard.Origin = Anchor.CentreLeft;
|
leaderboard.Origin = Anchor.CentreLeft;
|
||||||
leaderboard.X = 10;
|
leaderboard.X = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var d in container.OfType<ISerialisableDrawable>())
|
||||||
|
d.UsesFixedAnchor = true;
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
new LegacyManiaComboCounter(),
|
new LegacyManiaComboCounter(),
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
using osu.Game.Tests.Visual;
|
||||||
|
using osuTK.Input;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Osu.Tests
|
||||||
|
{
|
||||||
|
public partial class TestSceneGameplayCursorSizeChange : PlayerTestScene
|
||||||
|
{
|
||||||
|
private const float initial_cursor_size = 1f;
|
||||||
|
protected override Ruleset CreatePlayerRuleset() => new OsuRuleset();
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private SkinManager? skins { get; set; }
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
if (skins != null) skins.CurrentSkinInfo.Value = skins.DefaultClassicSkin.SkinInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[SetUpSteps]
|
||||||
|
public override void SetUpSteps()
|
||||||
|
{
|
||||||
|
base.SetUpSteps();
|
||||||
|
|
||||||
|
AddStep("Set gameplay cursor size: 1", () => LocalConfig.SetValue(OsuSetting.GameplayCursorSize, initial_cursor_size));
|
||||||
|
AddStep("resume player", () => Player.GameplayClockContainer.Start());
|
||||||
|
AddUntilStep("clock running", () => Player.GameplayClockContainer.IsRunning);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestPausedChangeCursorSize()
|
||||||
|
{
|
||||||
|
AddStep("move cursor to center", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.Centre));
|
||||||
|
AddStep("move cursor to top left", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.TopLeft));
|
||||||
|
AddStep("move cursor to center", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.Centre));
|
||||||
|
AddStep("move cursor to top right", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.TopRight));
|
||||||
|
AddStep("press escape", () => InputManager.Key(Key.Escape));
|
||||||
|
|
||||||
|
AddSliderStep("cursor size", 0.1f, 2f, 1f, v => LocalConfig.SetValue(OsuSetting.GameplayCursorSize, v));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override TestPlayer CreatePlayer(Ruleset ruleset) => new TestPlayer(true, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -103,6 +103,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|||||||
leaderboard.Origin = Anchor.BottomLeft;
|
leaderboard.Origin = Anchor.BottomLeft;
|
||||||
leaderboard.Position = pos;
|
leaderboard.Position = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var d in container.OfType<ISerialisableDrawable>())
|
||||||
|
d.UsesFixedAnchor = true;
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
|||||||
@@ -49,6 +49,18 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected bool AllowPartRotation { get; set; }
|
protected bool AllowPartRotation { get; set; }
|
||||||
|
|
||||||
|
private Vector2 cursorScale;
|
||||||
|
|
||||||
|
public Vector2 CursorScale
|
||||||
|
{
|
||||||
|
get => cursorScale;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
cursorScale = value;
|
||||||
|
Invalidate(Invalidation.DrawNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The trail part texture origin.
|
/// The trail part texture origin.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -233,6 +245,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
private float time;
|
private float time;
|
||||||
private float fadeExponent;
|
private float fadeExponent;
|
||||||
private float angle;
|
private float angle;
|
||||||
|
private Vector2 cursorScale;
|
||||||
|
|
||||||
private readonly TrailPart[] parts = new TrailPart[max_sprites];
|
private readonly TrailPart[] parts = new TrailPart[max_sprites];
|
||||||
private Vector2 originPosition;
|
private Vector2 originPosition;
|
||||||
@@ -253,6 +266,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
time = Source.time;
|
time = Source.time;
|
||||||
fadeExponent = Source.FadeExponent;
|
fadeExponent = Source.FadeExponent;
|
||||||
angle = Source.AllowPartRotation ? float.DegreesToRadians(Source.PartRotation) : 0;
|
angle = Source.AllowPartRotation ? float.DegreesToRadians(Source.PartRotation) : 0;
|
||||||
|
cursorScale = Source.cursorScale;
|
||||||
|
|
||||||
originPosition = Vector2.Zero;
|
originPosition = Vector2.Zero;
|
||||||
|
|
||||||
@@ -307,7 +321,9 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
vertexBatch.Add(new TexturedTrailVertex
|
vertexBatch.Add(new TexturedTrailVertex
|
||||||
{
|
{
|
||||||
Position = rotateAround(
|
Position = rotateAround(
|
||||||
new Vector2(part.Position.X - texture.DisplayWidth * originPosition.X * part.Scale.X, part.Position.Y + texture.DisplayHeight * (1 - originPosition.Y) * part.Scale.Y),
|
new Vector2(
|
||||||
|
part.Position.X - texture.DisplayWidth * originPosition.X * part.Scale.X * cursorScale.X,
|
||||||
|
part.Position.Y + texture.DisplayHeight * (1 - originPosition.Y) * part.Scale.Y * cursorScale.Y),
|
||||||
part.Position, sin, cos),
|
part.Position, sin, cos),
|
||||||
TexturePosition = textureRect.BottomLeft,
|
TexturePosition = textureRect.BottomLeft,
|
||||||
TextureRect = new Vector4(0, 0, 1, 1),
|
TextureRect = new Vector4(0, 0, 1, 1),
|
||||||
@@ -318,8 +334,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
vertexBatch.Add(new TexturedTrailVertex
|
vertexBatch.Add(new TexturedTrailVertex
|
||||||
{
|
{
|
||||||
Position = rotateAround(
|
Position = rotateAround(
|
||||||
new Vector2(part.Position.X + texture.DisplayWidth * (1 - originPosition.X) * part.Scale.X,
|
new Vector2(
|
||||||
part.Position.Y + texture.DisplayHeight * (1 - originPosition.Y) * part.Scale.Y), part.Position, sin, cos),
|
part.Position.X + texture.DisplayWidth * (1 - originPosition.X) * part.Scale.X * cursorScale.X,
|
||||||
|
part.Position.Y + texture.DisplayHeight * (1 - originPosition.Y) * part.Scale.Y * cursorScale.Y),
|
||||||
|
part.Position, sin, cos),
|
||||||
TexturePosition = textureRect.BottomRight,
|
TexturePosition = textureRect.BottomRight,
|
||||||
TextureRect = new Vector4(0, 0, 1, 1),
|
TextureRect = new Vector4(0, 0, 1, 1),
|
||||||
Colour = DrawColourInfo.Colour.BottomRight.Linear,
|
Colour = DrawColourInfo.Colour.BottomRight.Linear,
|
||||||
@@ -329,7 +347,9 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
vertexBatch.Add(new TexturedTrailVertex
|
vertexBatch.Add(new TexturedTrailVertex
|
||||||
{
|
{
|
||||||
Position = rotateAround(
|
Position = rotateAround(
|
||||||
new Vector2(part.Position.X + texture.DisplayWidth * (1 - originPosition.X) * part.Scale.X, part.Position.Y - texture.DisplayHeight * originPosition.Y * part.Scale.Y),
|
new Vector2(
|
||||||
|
part.Position.X + texture.DisplayWidth * (1 - originPosition.X) * part.Scale.X * cursorScale.X,
|
||||||
|
part.Position.Y - texture.DisplayHeight * originPosition.Y * part.Scale.Y * cursorScale.Y),
|
||||||
part.Position, sin, cos),
|
part.Position, sin, cos),
|
||||||
TexturePosition = textureRect.TopRight,
|
TexturePosition = textureRect.TopRight,
|
||||||
TextureRect = new Vector4(0, 0, 1, 1),
|
TextureRect = new Vector4(0, 0, 1, 1),
|
||||||
@@ -340,7 +360,9 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
vertexBatch.Add(new TexturedTrailVertex
|
vertexBatch.Add(new TexturedTrailVertex
|
||||||
{
|
{
|
||||||
Position = rotateAround(
|
Position = rotateAround(
|
||||||
new Vector2(part.Position.X - texture.DisplayWidth * originPosition.X * part.Scale.X, part.Position.Y - texture.DisplayHeight * originPosition.Y * part.Scale.Y),
|
new Vector2(
|
||||||
|
part.Position.X - texture.DisplayWidth * originPosition.X * part.Scale.X * cursorScale.X,
|
||||||
|
part.Position.Y - texture.DisplayHeight * originPosition.Y * part.Scale.Y * cursorScale.Y),
|
||||||
part.Position, sin, cos),
|
part.Position, sin, cos),
|
||||||
TexturePosition = textureRect.TopLeft,
|
TexturePosition = textureRect.TopLeft,
|
||||||
TextureRect = new Vector4(0, 0, 1, 1),
|
TextureRect = new Vector4(0, 0, 1, 1),
|
||||||
|
|||||||
@@ -64,8 +64,14 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
var newScale = new Vector2(e.NewValue);
|
var newScale = new Vector2(e.NewValue);
|
||||||
|
|
||||||
rippleVisualiser.CursorScale = newScale;
|
rippleVisualiser.CursorScale = newScale;
|
||||||
cursorTrail.Scale = newScale;
|
updateTrailScale();
|
||||||
}, true);
|
}, true);
|
||||||
|
cursorTrail.OnSkinChanged += updateTrailScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateTrailScale()
|
||||||
|
{
|
||||||
|
if (cursorTrail.Drawable is CursorTrail trail) trail.CursorScale = new Vector2(ActiveCursor.CursorScale.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int downCount;
|
private int downCount;
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Argon
|
|||||||
spectatorList.Anchor = Anchor.BottomLeft;
|
spectatorList.Anchor = Anchor.BottomLeft;
|
||||||
spectatorList.Origin = Anchor.TopLeft;
|
spectatorList.Origin = Anchor.TopLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var d in container.OfType<ISerialisableDrawable>())
|
||||||
|
d.UsesFixedAnchor = true;
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
|
|||||||
spectatorList.Origin = Anchor.TopLeft;
|
spectatorList.Origin = Anchor.TopLeft;
|
||||||
spectatorList.Position = new Vector2(320, -280);
|
spectatorList.Position = new Vector2(320, -280);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var d in container.OfType<ISerialisableDrawable>())
|
||||||
|
d.UsesFixedAnchor = true;
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
|||||||
@@ -79,6 +79,9 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
|
|||||||
spectatorList.Origin = Anchor.TopLeft;
|
spectatorList.Origin = Anchor.TopLeft;
|
||||||
spectatorList.Position = pos;
|
spectatorList.Position = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var d in container.OfType<ISerialisableDrawable>())
|
||||||
|
d.UsesFixedAnchor = true;
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
new LegacyDefaultComboCounter(),
|
new LegacyDefaultComboCounter(),
|
||||||
|
|||||||
BIN
osu.Game.Tests/Resources/Archives/modified-classic-20250827.osk
Normal file
BIN
osu.Game.Tests/Resources/special-skin/score-0@2x.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-1@2x.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-2@2x.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-3@2x.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-4@2x.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-5@2x.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-6@2x.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-7@2x.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-8@2x.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-9@2x.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-comma@2x.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-dot@2x.png
Normal file
|
After Width: | Height: | Size: 930 B |
BIN
osu.Game.Tests/Resources/special-skin/score-percent@2x.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-pp@2x.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
osu.Game.Tests/Resources/special-skin/score-x@2x.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
@@ -79,6 +79,8 @@ namespace osu.Game.Tests.Skins
|
|||||||
"Archives/modified-argon-20250424.osk",
|
"Archives/modified-argon-20250424.osk",
|
||||||
// Covers "Argon" unstable rate counter
|
// Covers "Argon" unstable rate counter
|
||||||
"Archives/modified-argon-20250809.osk",
|
"Archives/modified-argon-20250809.osk",
|
||||||
|
// Covers legacy style performance points counter
|
||||||
|
"Archives/modified-classic-20250827.osk",
|
||||||
// Covers "Argon" judgement counter
|
// Covers "Argon" judgement counter
|
||||||
"Archives/modified-argon-20250308.osk",
|
"Archives/modified-argon-20250308.osk",
|
||||||
// Covers "Argon" clicks/s counter, longest combo counter, skinnable SR display and beatmap status pill
|
// Covers "Argon" clicks/s counter, longest combo counter, skinnable SR display and beatmap status pill
|
||||||
|
|||||||
@@ -50,6 +50,34 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
sprites.All(sprite => sprite.ChildrenOfType<Sprite>().All(s => s.Texture == null)));
|
sprites.All(sprite => sprite.ChildrenOfType<Sprite>().All(s => s.Texture == null)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestSpriteFadeOverflowBehaviour()
|
||||||
|
{
|
||||||
|
AddStep("create sprite", () => SetContents(_ =>
|
||||||
|
{
|
||||||
|
var layer = storyboard.GetLayer("Background");
|
||||||
|
|
||||||
|
var sprite = new StoryboardSprite(lookup_name, Anchor.TopLeft, new Vector2(256, 192));
|
||||||
|
sprite.Commands.AddAlpha(Easing.None, Time.Current, Time.Current + 2000, 0, 2);
|
||||||
|
|
||||||
|
layer.Elements.Clear();
|
||||||
|
layer.Add(sprite);
|
||||||
|
|
||||||
|
return new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
storyboard.CreateDrawable()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}));
|
||||||
|
|
||||||
|
AddUntilStep("sprite reached high opacity once", () => sprites.All(sprite => sprite.ChildrenOfType<Sprite>().All(s => s.Alpha > 0.8f)));
|
||||||
|
AddUntilStep("sprite reset to low opacity", () => sprites.All(sprite => sprite.ChildrenOfType<Sprite>().All(s => s.Alpha < 0.2f)));
|
||||||
|
AddUntilStep("sprite reached high opacity twice", () => sprites.All(sprite => sprite.ChildrenOfType<Sprite>().All(s => s.Alpha > 0.8f)));
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLookupFromStoryboard()
|
public void TestLookupFromStoryboard()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ using osu.Game.Rulesets.Osu.Scoring;
|
|||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using osu.Game.Screens.Play.HUD;
|
using osu.Game.Screens.Play.HUD;
|
||||||
|
using osu.Game.Skinning;
|
||||||
using osu.Game.Skinning.Triangles;
|
using osu.Game.Skinning.Triangles;
|
||||||
using osu.Game.Tests.Gameplay;
|
using osu.Game.Tests.Gameplay;
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
protected override Drawable CreateDefaultImplementation() => new TrianglesPerformancePointsCounter();
|
protected override Drawable CreateDefaultImplementation() => new TrianglesPerformancePointsCounter();
|
||||||
protected override Drawable CreateArgonImplementation() => new ArgonPerformancePointsCounter();
|
protected override Drawable CreateArgonImplementation() => new ArgonPerformancePointsCounter();
|
||||||
protected override Drawable CreateLegacyImplementation() => Empty();
|
protected override Drawable CreateLegacyImplementation() => new LegacyPerformancePointsCounter();
|
||||||
|
|
||||||
private Bindable<JudgementResult> lastJudgementResult => (Bindable<JudgementResult>)gameplayState.LastJudgementResult;
|
private Bindable<JudgementResult> lastJudgementResult => (Bindable<JudgementResult>)gameplayState.LastJudgementResult;
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
@@ -378,6 +379,23 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
() => Is.EqualTo(3));
|
() => Is.EqualTo(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestCopyPasteIdempotency()
|
||||||
|
{
|
||||||
|
string state = null!;
|
||||||
|
AddStep("select everything", () => InputManager.Keys(PlatformAction.SelectAll));
|
||||||
|
AddStep("dump state", () =>
|
||||||
|
{
|
||||||
|
state = JsonConvert.SerializeObject(skinEditor.SelectedComponents.Cast<Drawable>().Select(s => s.CreateSerialisedInfo()).ToArray());
|
||||||
|
});
|
||||||
|
AddStep("copy", () => InputManager.Keys(PlatformAction.Copy));
|
||||||
|
AddStep("delete", () => InputManager.Keys(PlatformAction.Delete));
|
||||||
|
AddStep("paste", () => InputManager.Keys(PlatformAction.Paste));
|
||||||
|
AddAssert("pasted state equals dumped",
|
||||||
|
() => JsonConvert.SerializeObject(skinEditor.SelectedComponents.Cast<Drawable>().Select(s => s.CreateSerialisedInfo()).ToArray()),
|
||||||
|
() => Is.EqualTo(state));
|
||||||
|
}
|
||||||
|
|
||||||
private SkinnableContainer globalHUDTarget => Player.ChildrenOfType<SkinnableContainer>()
|
private SkinnableContainer globalHUDTarget => Player.ChildrenOfType<SkinnableContainer>()
|
||||||
.Single(c => c.Lookup.Lookup == GlobalSkinnableContainers.MainHUDComponents && c.Lookup.Ruleset == null);
|
.Single(c => c.Lookup.Lookup == GlobalSkinnableContainers.MainHUDComponents && c.Lookup.Ruleset == null);
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ using osu.Game.Configuration;
|
|||||||
using osu.Game.Extensions;
|
using osu.Game.Extensions;
|
||||||
using osu.Game.Graphics.Carousel;
|
using osu.Game.Graphics.Carousel;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.Notifications.WebSocket;
|
using osu.Game.Online.Notifications.WebSocket;
|
||||||
@@ -33,6 +34,7 @@ using osu.Game.Overlays.BeatmapListing;
|
|||||||
using osu.Game.Overlays.Mods;
|
using osu.Game.Overlays.Mods;
|
||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.Notifications;
|
||||||
using osu.Game.Overlays.Toolbar;
|
using osu.Game.Overlays.Toolbar;
|
||||||
|
using osu.Game.Overlays.Volume;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Mania;
|
using osu.Game.Rulesets.Mania;
|
||||||
using osu.Game.Rulesets.Mania.Configuration;
|
using osu.Game.Rulesets.Mania.Configuration;
|
||||||
@@ -1336,6 +1338,34 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
AddAssert("still nothing selected", () => Game.Beatmap.IsDefault);
|
AddAssert("still nothing selected", () => Game.Beatmap.IsDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestVolumeMeterDragDoesNotDismissFocusedOverlay()
|
||||||
|
{
|
||||||
|
AddStep("show beatmap overlay", () => Game.ShowBeatmapSet(1));
|
||||||
|
AddUntilStep("beatmap overlay still visible",
|
||||||
|
() => Game.ChildrenOfType<BeatmapSetOverlay>().SingleOrDefault()?.State.Value,
|
||||||
|
() => Is.EqualTo(Visibility.Visible));
|
||||||
|
AddStep("set game volume to max", () => Game.Dependencies.Get<FrameworkConfigManager>().SetValue(FrameworkSetting.VolumeUniversal, 1d));
|
||||||
|
AddStep("move to centre", () => InputManager.MoveMouseTo(Game));
|
||||||
|
AddStep("alt-scroll down", () =>
|
||||||
|
{
|
||||||
|
InputManager.PressKey(Key.AltLeft);
|
||||||
|
InputManager.ScrollVerticalBy(-1);
|
||||||
|
InputManager.ReleaseKey(Key.AltLeft);
|
||||||
|
});
|
||||||
|
AddUntilStep("wait for volume overlay to show", () => Game.ChildrenOfType<VolumeOverlay>().SingleOrDefault()?.State.Value, () => Is.EqualTo(Visibility.Visible));
|
||||||
|
AddStep("start dragging meter", () =>
|
||||||
|
{
|
||||||
|
InputManager.MoveMouseTo(Game.ChildrenOfType<VolumeMeter>().First().ChildrenOfType<OsuSpriteText>().First());
|
||||||
|
InputManager.PressButton(MouseButton.Left);
|
||||||
|
});
|
||||||
|
AddStep("drag away", () => InputManager.MoveMouseTo(Game.ChildrenOfType<VolumeMeter>().First().ChildrenOfType<OsuSpriteText>().First(), new Vector2(0, -100)));
|
||||||
|
AddStep("release mouse", () => InputManager.ReleaseButton(MouseButton.Left));
|
||||||
|
AddAssert("beatmap overlay still visible",
|
||||||
|
() => Game.ChildrenOfType<BeatmapSetOverlay>().SingleOrDefault()?.State.Value,
|
||||||
|
() => Is.EqualTo(Visibility.Visible));
|
||||||
|
}
|
||||||
|
|
||||||
private Func<Player> playToResults()
|
private Func<Player> playToResults()
|
||||||
{
|
{
|
||||||
var player = playToCompletion();
|
var player = playToCompletion();
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
|
using osu.Framework.Input.Handlers.Tablet;
|
||||||
using osu.Framework.Layout;
|
using osu.Framework.Layout;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
@@ -50,6 +52,8 @@ namespace osu.Game.Graphics.Containers
|
|||||||
private RectangleF? customRect;
|
private RectangleF? customRect;
|
||||||
private bool customRectIsRelativePosition;
|
private bool customRectIsRelativePosition;
|
||||||
|
|
||||||
|
private ITabletHandler? tabletHandler;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set a custom position and scale which overrides any user specification.
|
/// Set a custom position and scale which overrides any user specification.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -123,7 +127,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config, ISafeArea safeArea)
|
private void load(GameHost host, OsuConfigManager config, ISafeArea safeArea)
|
||||||
{
|
{
|
||||||
scalingMode = config.GetBindable<ScalingMode>(OsuSetting.Scaling);
|
scalingMode = config.GetBindable<ScalingMode>(OsuSetting.Scaling);
|
||||||
scalingMode.ValueChanged += _ => Scheduler.AddOnce(updateSize);
|
scalingMode.ValueChanged += _ => Scheduler.AddOnce(updateSize);
|
||||||
@@ -148,6 +152,8 @@ namespace osu.Game.Graphics.Containers
|
|||||||
|
|
||||||
scalingMenuBackgroundDim = config.GetBindable<float>(OsuSetting.ScalingBackgroundDim);
|
scalingMenuBackgroundDim = config.GetBindable<float>(OsuSetting.ScalingBackgroundDim);
|
||||||
scalingMenuBackgroundDim.ValueChanged += _ => Scheduler.AddOnce(updateSize);
|
scalingMenuBackgroundDim.ValueChanged += _ => Scheduler.AddOnce(updateSize);
|
||||||
|
|
||||||
|
tabletHandler = host.AvailableInputHandlers.OfType<ITabletHandler>().SingleOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@@ -222,6 +228,13 @@ namespace osu.Game.Graphics.Containers
|
|||||||
// An example of how this can occur is when the skin editor is visible and the game screen scaling is set to "Everything".
|
// An example of how this can occur is when the skin editor is visible and the game screen scaling is set to "Everything".
|
||||||
sizableContainer.TransformTo(nameof(CornerRadius), requiresMasking ? corner_radius : 0, TRANSITION_DURATION, requiresMasking ? Easing.OutQuart : Easing.None)
|
sizableContainer.TransformTo(nameof(CornerRadius), requiresMasking ? corner_radius : 0, TRANSITION_DURATION, requiresMasking ? Easing.OutQuart : Easing.None)
|
||||||
.OnComplete(_ => { sizableContainer.Masking = requiresMasking; });
|
.OnComplete(_ => { sizableContainer.Masking = requiresMasking; });
|
||||||
|
|
||||||
|
// when "everything" scaling mode is active, tablets are expected to constrain output area to the scaled size of the game
|
||||||
|
if (tabletHandler != null)
|
||||||
|
{
|
||||||
|
tabletHandler.OutputAreaSize.Value = scalingMode.Value == ScalingMode.Everything ? new Vector2(sizeX.Value, sizeY.Value) : Vector2.One;
|
||||||
|
tabletHandler.OutputAreaOffset.Value = scalingMode.Value == ScalingMode.Everything ? new Vector2(posX.Value, posY.Value) : new Vector2(0.5f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private partial class ScalingBackgroundScreen : BackgroundScreenDefault
|
private partial class ScalingBackgroundScreen : BackgroundScreenDefault
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Request to leave the currently joined room.
|
/// Request to leave the currently joined room.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <exception cref="NotJoinedRoomException">If the user is not in a room.</exception>
|
|
||||||
Task LeaveRoom();
|
Task LeaveRoom();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -319,9 +319,6 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
|
|
||||||
public Task LeaveRoom()
|
public Task LeaveRoom()
|
||||||
{
|
{
|
||||||
if (Room == null)
|
|
||||||
return Task.CompletedTask;
|
|
||||||
|
|
||||||
// The join may have not completed yet, so certain tasks that either update the room or reference the room should be cancelled.
|
// The join may have not completed yet, so certain tasks that either update the room or reference the room should be cancelled.
|
||||||
// This includes the setting of Room itself along with the initial update of the room settings on join.
|
// This includes the setting of Room itself along with the initial update of the room settings on join.
|
||||||
joinCancellationSource?.Cancel();
|
joinCancellationSource?.Cancel();
|
||||||
|
|||||||
@@ -33,7 +33,27 @@ namespace osu.Game.Overlays.Chat
|
|||||||
{
|
{
|
||||||
var request = new ChatReportRequest(message.Id, reason, comments);
|
var request = new ChatReportRequest(message.Id, reason, comments);
|
||||||
|
|
||||||
request.Success += () => channelManager.CurrentChannel.Value.AddNewMessages(new InfoMessage(UsersStrings.ReportThanks.ToString()));
|
request.Success += () =>
|
||||||
|
{
|
||||||
|
string thanksMessage;
|
||||||
|
|
||||||
|
switch (channelManager.CurrentChannel.Value.Type)
|
||||||
|
{
|
||||||
|
case ChannelType.PM:
|
||||||
|
thanksMessage = """
|
||||||
|
Chat moderators have been alerted. You have reported a private message so they will not be able to read history to maintain your privacy. Please make sure to include as much details as you can.
|
||||||
|
You can submit a second report with more details if required, or contact abuse@ppy.sh if a user is being extremely offensive.
|
||||||
|
You can also block a user via the block button on their user profile, or by right-clicking on their name in the chat and selecting "Block".
|
||||||
|
""";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
thanksMessage = @"Chat moderators have been alerted. Thanks for your help.";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
channelManager.CurrentChannel.Value.AddNewMessages(new InfoMessage(thanksMessage));
|
||||||
|
};
|
||||||
|
|
||||||
api.Queue(request);
|
api.Queue(request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,10 +61,15 @@ namespace osu.Game.Overlays
|
|||||||
audio.Samples.AddAdjustment(AdjustableProperty.Volume, audioVolume);
|
audio.Samples.AddAdjustment(AdjustableProperty.Volume, audioVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected void RemoveAudioAdjustments()
|
||||||
{
|
{
|
||||||
audio?.Tracks.RemoveAdjustment(AdjustableProperty.Volume, audioVolume);
|
audio?.Tracks.RemoveAdjustment(AdjustableProperty.Volume, audioVolume);
|
||||||
audio?.Samples.RemoveAdjustment(AdjustableProperty.Volume, audioVolume);
|
audio?.Samples.RemoveAdjustment(AdjustableProperty.Volume, audioVolume);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
RemoveAudioAdjustments();
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private void onSeek(double progress)
|
private void onSeek(double progress)
|
||||||
{
|
{
|
||||||
if (lastSeekTime == null || Time.Current - lastSeekTime > TRACK_DRAG_SEEK_DEBOUNCE)
|
if (!musicController.IsPlaying || lastSeekTime == null || Time.Current - lastSeekTime > TRACK_DRAG_SEEK_DEBOUNCE)
|
||||||
{
|
{
|
||||||
musicController.SeekTo(progress);
|
musicController.SeekTo(progress);
|
||||||
lastSeekTime = Time.Current;
|
lastSeekTime = Time.Current;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
case RankingsScope.Performance:
|
case RankingsScope.Performance:
|
||||||
case RankingsScope.Score:
|
case RankingsScope.Score:
|
||||||
case RankingsScope.Country:
|
case RankingsScope.Country:
|
||||||
case RankingsScope.Spotlights:
|
case RankingsScope.Playlists:
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
[LocalisableDescription(typeof(RankingsStrings), nameof(RankingsStrings.TypeCountry))]
|
[LocalisableDescription(typeof(RankingsStrings), nameof(RankingsStrings.TypeCountry))]
|
||||||
Country,
|
Country,
|
||||||
|
|
||||||
[LocalisableDescription(typeof(RankingsStrings), nameof(RankingsStrings.TypeCharts))]
|
[LocalisableDescription(typeof(RankingsStrings), nameof(RankingsStrings.TypePlaylists))]
|
||||||
Spotlights,
|
Playlists,
|
||||||
|
|
||||||
[LocalisableDescription(typeof(RankingsStrings), nameof(RankingsStrings.TypeKudosu))]
|
[LocalisableDescription(typeof(RankingsStrings), nameof(RankingsStrings.TypeKudosu))]
|
||||||
Kudosu,
|
Kudosu,
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
ruleset.BindValueChanged(_ =>
|
ruleset.BindValueChanged(_ =>
|
||||||
{
|
{
|
||||||
if (Header.Current.Value == RankingsScope.Spotlights)
|
if (Header.Current.Value == RankingsScope.Playlists)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Scheduler.AddOnce(triggerTabChanged);
|
Scheduler.AddOnce(triggerTabChanged);
|
||||||
@@ -99,7 +99,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
lastRequest?.Cancel();
|
lastRequest?.Cancel();
|
||||||
|
|
||||||
if (Header.Current.Value == RankingsScope.Spotlights)
|
if (Header.Current.Value == RankingsScope.Playlists)
|
||||||
{
|
{
|
||||||
LoadDisplay(new SpotlightsLayout
|
LoadDisplay(new SpotlightsLayout
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using osu.Framework.Input.Handlers.Tablet;
|
|||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@@ -34,6 +35,8 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
|
|
||||||
private readonly Bindable<Vector2> areaOffset = new Bindable<Vector2>();
|
private readonly Bindable<Vector2> areaOffset = new Bindable<Vector2>();
|
||||||
private readonly Bindable<Vector2> areaSize = new Bindable<Vector2>();
|
private readonly Bindable<Vector2> areaSize = new Bindable<Vector2>();
|
||||||
|
private readonly Bindable<Vector2> outputAreaSize = new Bindable<Vector2>();
|
||||||
|
private readonly Bindable<Vector2> outputAreaOffset = new Bindable<Vector2>();
|
||||||
private readonly IBindable<TabletInfo> tablet = new Bindable<TabletInfo>();
|
private readonly IBindable<TabletInfo> tablet = new Bindable<TabletInfo>();
|
||||||
|
|
||||||
private readonly BindableNumber<float> offsetX = new BindableNumber<float> { MinValue = 0, Precision = 1 };
|
private readonly BindableNumber<float> offsetX = new BindableNumber<float> { MinValue = 0, Precision = 1 };
|
||||||
@@ -46,6 +49,10 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
|
|
||||||
private readonly BindableNumber<float> pressureThreshold = new BindableNumber<float> { MinValue = 0.0f, MaxValue = 1.0f, Precision = 0.005f };
|
private readonly BindableNumber<float> pressureThreshold = new BindableNumber<float> { MinValue = 0.0f, MaxValue = 1.0f, Precision = 0.005f };
|
||||||
|
|
||||||
|
private Bindable<ScalingMode> scalingMode = null!;
|
||||||
|
private Bindable<float> scalingSizeX = null!;
|
||||||
|
private Bindable<float> scalingSizeY = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private GameHost host { get; set; }
|
private GameHost host { get; set; }
|
||||||
|
|
||||||
@@ -77,8 +84,12 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours, LocalisationManager localisation)
|
private void load(OsuColour colours, LocalisationManager localisation, OsuConfigManager osuConfig)
|
||||||
{
|
{
|
||||||
|
scalingMode = osuConfig.GetBindable<ScalingMode>(OsuSetting.Scaling);
|
||||||
|
scalingSizeX = osuConfig.GetBindable<float>(OsuSetting.ScalingSizeX);
|
||||||
|
scalingSizeY = osuConfig.GetBindable<float>(OsuSetting.ScalingSizeY);
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
@@ -152,7 +163,16 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
Text = TabletSettingsStrings.ConformToCurrentGameAspectRatio,
|
Text = TabletSettingsStrings.ConformToCurrentGameAspectRatio,
|
||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
forceAspectRatio((float)host.Window.ClientSize.Width / host.Window.ClientSize.Height);
|
float gameplayWidth = host.Window.ClientSize.Width;
|
||||||
|
float gameplayHeight = host.Window.ClientSize.Height;
|
||||||
|
|
||||||
|
if (scalingMode.Value == ScalingMode.Everything)
|
||||||
|
{
|
||||||
|
gameplayWidth *= scalingSizeX.Value;
|
||||||
|
gameplayHeight *= scalingSizeY.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
forceAspectRatio(gameplayWidth / gameplayHeight);
|
||||||
},
|
},
|
||||||
CanBeShown = { BindTarget = enabled }
|
CanBeShown = { BindTarget = enabled }
|
||||||
},
|
},
|
||||||
@@ -249,6 +269,9 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
sizeY.Value = val.NewValue.Y;
|
sizeY.Value = val.NewValue.Y;
|
||||||
}), true);
|
}), true);
|
||||||
|
|
||||||
|
outputAreaSize.BindTo(tabletHandler.OutputAreaSize);
|
||||||
|
outputAreaOffset.BindTo(tabletHandler.OutputAreaOffset);
|
||||||
|
|
||||||
sizeX.BindValueChanged(val =>
|
sizeX.BindValueChanged(val =>
|
||||||
{
|
{
|
||||||
areaSize.Value = new Vector2(val.NewValue, areaSize.Value.Y);
|
areaSize.Value = new Vector2(val.NewValue, areaSize.Value.Y);
|
||||||
|
|||||||
@@ -529,7 +529,9 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
}
|
}
|
||||||
|
|
||||||
SelectedComponents.Add(component);
|
SelectedComponents.Add(component);
|
||||||
SkinSelectionHandler.ApplyClosestAnchorOrigin(drawableComponent);
|
|
||||||
|
if (!component.UsesFixedAnchor)
|
||||||
|
SkinSelectionHandler.ApplyClosestAnchorOrigin(drawableComponent);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -318,6 +318,8 @@ namespace osu.Game.Overlays.Volume
|
|||||||
|
|
||||||
private float dragDelta;
|
private float dragDelta;
|
||||||
|
|
||||||
|
protected override bool OnMouseDown(MouseDownEvent e) => true; // handle to prevent drawables behind from potentially receiving the mouse down
|
||||||
|
|
||||||
protected override bool OnDragStart(DragStartEvent e)
|
protected override bool OnDragStart(DragStartEvent e)
|
||||||
{
|
{
|
||||||
dragDelta = 0;
|
dragDelta = 0;
|
||||||
|
|||||||
@@ -13,12 +13,14 @@ using osu.Game.Beatmaps;
|
|||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Backgrounds;
|
using osu.Game.Graphics.Backgrounds;
|
||||||
|
using osu.Game.Screens.Edit;
|
||||||
using osu.Game.Storyboards.Drawables;
|
using osu.Game.Storyboards.Drawables;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Backgrounds
|
namespace osu.Game.Screens.Backgrounds
|
||||||
{
|
{
|
||||||
public partial class EditorBackgroundScreen : BackgroundScreen
|
public partial class EditorBackgroundScreen : BackgroundScreen
|
||||||
{
|
{
|
||||||
|
private readonly EditorBeatmap editorBeatmap;
|
||||||
private readonly Container dimContainer;
|
private readonly Container dimContainer;
|
||||||
|
|
||||||
private CancellationTokenSource? cancellationTokenSource;
|
private CancellationTokenSource? cancellationTokenSource;
|
||||||
@@ -36,8 +38,9 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private IBindable<WorkingBeatmap> beatmap { get; set; } = null!;
|
private IBindable<WorkingBeatmap> beatmap { get; set; } = null!;
|
||||||
|
|
||||||
public EditorBackgroundScreen()
|
public EditorBackgroundScreen(EditorBeatmap editorBeatmap)
|
||||||
{
|
{
|
||||||
|
this.editorBeatmap = editorBeatmap;
|
||||||
InternalChild = dimContainer = new Container
|
InternalChild = dimContainer = new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@@ -58,10 +61,11 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
private IEnumerable<Drawable> createContent() =>
|
private IEnumerable<Drawable> createContent() =>
|
||||||
[
|
[
|
||||||
new BeatmapBackground(beatmap.Value) { RelativeSizeAxes = Axes.Both, },
|
new BeatmapBackground(beatmap.Value) { RelativeSizeAxes = Axes.Both, },
|
||||||
// this kooky container nesting is here because the storyboard needs a custom clock
|
// one reason for this kooky container nesting being here is that the storyboard needs a custom clock
|
||||||
// but also needs it on an isolated-enough level that doesn't break screen stack expiry logic (which happens if the clock was put on `this`),
|
// but also needs it on an isolated-enough level that doesn't break screen stack expiry logic (which happens if the clock was put on `this`),
|
||||||
// or doesn't make it literally impossible to fade the storyboard in/out in real time (which happens if the fade transforms were to be applied directly to the storyboard).
|
// or doesn't make it literally impossible to fade the storyboard in/out in real time (which happens if the fade transforms were to be applied directly to the storyboard).
|
||||||
new Container
|
// another is that we need `EditorSkinProvidingContainer` so that storyboard sample lookups succeed.
|
||||||
|
new EditorSkinProvidingContainer(editorBeatmap)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = new DrawableStoryboard(beatmap.Value.Storyboard)
|
Child = new DrawableStoryboard(beatmap.Value.Storyboard)
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
|||||||
double seekDestination = markerPos / DrawWidth * editorClock.TrackLength;
|
double seekDestination = markerPos / DrawWidth * editorClock.TrackLength;
|
||||||
marker.X = (float)seekDestination;
|
marker.X = (float)seekDestination;
|
||||||
|
|
||||||
if (!instant && lastSeekTime != null && Time.Current - lastSeekTime < NowPlayingOverlay.TRACK_DRAG_SEEK_DEBOUNCE)
|
if (editorClock.IsRunning && !instant && lastSeekTime != null && Time.Current - lastSeekTime < NowPlayingOverlay.TRACK_DRAG_SEEK_DEBOUNCE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
editorClock.SeekSmoothlyTo(seekDestination);
|
editorClock.SeekSmoothlyTo(seekDestination);
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private MusicController musicController { get; set; }
|
private MusicController musicController { get; set; }
|
||||||
|
|
||||||
protected override BackgroundScreen CreateBackground() => new EditorBackgroundScreen();
|
protected override BackgroundScreen CreateBackground() => new EditorBackgroundScreen(editorBeatmap);
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -169,6 +169,20 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue
|
|||||||
{
|
{
|
||||||
Text = "Searching for opponents...";
|
Text = "Searching for opponents...";
|
||||||
|
|
||||||
|
Activated = () =>
|
||||||
|
{
|
||||||
|
performer?.PerformFromScreen(s =>
|
||||||
|
{
|
||||||
|
if (s is ScreenIntro || s is ScreenQueue)
|
||||||
|
return;
|
||||||
|
|
||||||
|
s.Push(new ScreenIntro());
|
||||||
|
}, [typeof(ScreenIntro), typeof(ScreenQueue)]);
|
||||||
|
|
||||||
|
// Closed when appropriate by SearchInForeground().
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
CompletionClickAction = () =>
|
CompletionClickAction = () =>
|
||||||
{
|
{
|
||||||
client.MatchmakingAcceptInvitation().FireAndForget();
|
client.MatchmakingAcceptInvitation().FireAndForget();
|
||||||
|
|||||||
@@ -354,37 +354,9 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MatchmakingScreenState.PendingAccept:
|
case MatchmakingScreenState.PendingAccept:
|
||||||
mainContent.Child = new FillFlowContainer
|
client.MatchmakingAcceptInvitation().FireAndForget();
|
||||||
{
|
SetState(MatchmakingScreenState.AcceptedWaitingForRoom);
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Direction = FillDirection.Vertical,
|
|
||||||
Spacing = new Vector2(20),
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Text = "Found a match!",
|
|
||||||
Font = OsuFont.GetFont(size: 32, weight: FontWeight.Regular, typeface: Typeface.TorusAlternate),
|
|
||||||
},
|
|
||||||
new SelectionButton(200)
|
|
||||||
{
|
|
||||||
DarkerColour = colours.YellowDark,
|
|
||||||
LighterColour = colours.YellowLight,
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Action = () =>
|
|
||||||
{
|
|
||||||
client.MatchmakingAcceptInvitation().FireAndForget();
|
|
||||||
SetState(MatchmakingScreenState.AcceptedWaitingForRoom);
|
|
||||||
},
|
|
||||||
Text = "Join match!",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
matchFoundSample?.Play();
|
matchFoundSample?.Play();
|
||||||
musicController.DuckMomentarily(1250);
|
musicController.DuckMomentarily(1250);
|
||||||
break;
|
break;
|
||||||
@@ -403,7 +375,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Text = "Waiting for all players...",
|
Text = "Waiting for opponents...",
|
||||||
Font = OsuFont.GetFont(size: 32, weight: FontWeight.Light, typeface: Typeface.TorusAlternate),
|
Font = OsuFont.GetFont(size: 32, weight: FontWeight.Light, typeface: Typeface.TorusAlternate),
|
||||||
},
|
},
|
||||||
new LoadingSpinner
|
new LoadingSpinner
|
||||||
|
|||||||
@@ -90,6 +90,15 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
client.ChangeState(MultiplayerUserState.Idle).FireAndForget();
|
client.ChangeState(MultiplayerUserState.Idle).FireAndForget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool OnExiting(ScreenExitEvent e)
|
||||||
|
{
|
||||||
|
if (base.OnExiting(e))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
client.LeaveRoom().FireAndForget();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
protected override string ScreenTitle => "Multiplayer";
|
protected override string ScreenTitle => "Multiplayer";
|
||||||
|
|
||||||
protected override LoungeSubScreen CreateLounge() => new MultiplayerLoungeSubScreen();
|
protected override LoungeSubScreen CreateLounge() => new MultiplayerLoungeSubScreen();
|
||||||
|
|||||||
@@ -42,10 +42,11 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override OsuClickableContainer CreateButton() => skipButton = new Button
|
protected override OsuClickableContainer CreateButton(IBindable<bool> inSkipPeriod) => skipButton = new Button
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
InSkipPeriod = { BindTarget = inSkipPeriod },
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@@ -119,6 +120,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
|
|
||||||
public readonly BindableInt SkippedCount = new BindableInt();
|
public readonly BindableInt SkippedCount = new BindableInt();
|
||||||
public readonly BindableInt RequiredCount = new BindableInt();
|
public readonly BindableInt RequiredCount = new BindableInt();
|
||||||
|
public readonly BindableBool InSkipPeriod = new BindableBool();
|
||||||
|
|
||||||
|
private readonly BindableBool clicked = new BindableBool();
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; } = null!;
|
private OsuColour colours { get; set; } = null!;
|
||||||
@@ -201,11 +205,17 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
|
|
||||||
SkippedCount.BindValueChanged(_ => updateCount());
|
SkippedCount.BindValueChanged(_ => updateCount());
|
||||||
RequiredCount.BindValueChanged(_ => updateCount(), true);
|
RequiredCount.BindValueChanged(_ => updateCount(), true);
|
||||||
|
|
||||||
|
InSkipPeriod.BindValueChanged(_ => updateEnabledState());
|
||||||
|
clicked.BindValueChanged(_ => updateEnabledState(), true);
|
||||||
|
|
||||||
Enabled.BindValueChanged(_ => updateColours(), true);
|
Enabled.BindValueChanged(_ => updateColours(), true);
|
||||||
|
|
||||||
FinishTransforms(true);
|
FinishTransforms(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateEnabledState() => Enabled.Value = InSkipPeriod.Value && !clicked.Value;
|
||||||
|
|
||||||
private void updateChevronsSpacing()
|
private void updateChevronsSpacing()
|
||||||
{
|
{
|
||||||
if (SkippedCount.Value > 0 && RequiredCount.Value > 1)
|
if (SkippedCount.Value > 0 && RequiredCount.Value > 1)
|
||||||
@@ -300,7 +310,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
|
|
||||||
base.OnClick(e);
|
base.OnClick(e);
|
||||||
|
|
||||||
Enabled.Value = false;
|
clicked.Value = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
public partial class FailOverlay : GameplayMenuOverlay
|
public partial class FailOverlay : GameplayMenuOverlay
|
||||||
{
|
{
|
||||||
public Func<Task<ScoreInfo>>? SaveReplay;
|
public Func<Task<ScoreInfo>>? SaveReplay { get; init; }
|
||||||
|
|
||||||
public override LocalisableString Header => GameplayMenuOverlayStrings.FailedHeader;
|
public override LocalisableString Header => GameplayMenuOverlayStrings.FailedHeader;
|
||||||
|
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
else if (Tracked)
|
else if (Tracked)
|
||||||
{
|
{
|
||||||
widthExtension = true;
|
widthExtension = true;
|
||||||
setTrackedPanelColour(BackgroundColour);
|
setPanelColour(BackgroundColour ?? colours.Orange2);
|
||||||
}
|
}
|
||||||
else if (isFriend)
|
else if (isFriend)
|
||||||
{
|
{
|
||||||
@@ -380,13 +380,6 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
scorePanel.BorderColour = ColourInfo.GradientVertical(baseColour.Opacity(0.2f), baseColour);
|
scorePanel.BorderColour = ColourInfo.GradientVertical(baseColour.Opacity(0.2f), baseColour);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setTrackedPanelColour(Color4? backgroundColour)
|
|
||||||
{
|
|
||||||
leftLayerGradient.Colour = ColourInfo.GradientVertical((backgroundColour ?? colours.Blue2).Opacity(0.3f), backgroundColour ?? colours.Blue2);
|
|
||||||
rightLayerGradient.Colour = ColourInfo.GradientVertical((backgroundColour ?? colours.Blue4).Opacity(0.25f), (backgroundColour ?? colours.Blue3).Opacity(0.6f));
|
|
||||||
scorePanel.BorderColour = ColourInfo.GradientVertical((backgroundColour ?? colours.Blue1).Opacity(0.2f), backgroundColour ?? colours.Blue1);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|||||||
@@ -27,5 +27,14 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
AbortConfirm();
|
AbortConfirm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Confirm()
|
||||||
|
{
|
||||||
|
base.Confirm();
|
||||||
|
|
||||||
|
// Not removing immediately can lead to delays due to async disposal.
|
||||||
|
// This is done here rather than in `Player` because it's simpler to handle.
|
||||||
|
RemoveAudioAdjustments();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,5 +27,14 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
AbortConfirm();
|
AbortConfirm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Confirm()
|
||||||
|
{
|
||||||
|
base.Confirm();
|
||||||
|
|
||||||
|
// Not removing immediately can lead to delays due to async disposal.
|
||||||
|
// This is done here rather than in `Player` because it's simpler to handle.
|
||||||
|
RemoveAudioAdjustments();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ namespace osu.Game.Screens.Play
|
|||||||
},
|
},
|
||||||
FailOverlay = new FailOverlay
|
FailOverlay = new FailOverlay
|
||||||
{
|
{
|
||||||
SaveReplay = async () => await prepareAndImportScoreAsync(true).ConfigureAwait(false),
|
SaveReplay = Configuration.AllowUserInteraction ? async () => await prepareAndImportScoreAsync(true).ConfigureAwait(false) : null,
|
||||||
OnRetry = Configuration.AllowUserInteraction ? () => Restart() : null,
|
OnRetry = Configuration.AllowUserInteraction ? () => Restart() : null,
|
||||||
OnQuit = () => PerformExitWithConfirmation(),
|
OnQuit = () => PerformExitWithConfirmation(),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ using osu.Game.Scoring;
|
|||||||
using osu.Game.Screens.Play.PlayerSettings;
|
using osu.Game.Screens.Play.PlayerSettings;
|
||||||
using osu.Game.Screens.Ranking;
|
using osu.Game.Screens.Ranking;
|
||||||
using osu.Game.Screens.Select.Leaderboards;
|
using osu.Game.Screens.Select.Leaderboards;
|
||||||
|
using osu.Game.Skinning;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
@@ -100,15 +101,18 @@ namespace osu.Game.Screens.Play
|
|||||||
playbackSettings.UserPlaybackRate.BindTo(master.UserPlaybackRate);
|
playbackSettings.UserPlaybackRate.BindTo(master.UserPlaybackRate);
|
||||||
|
|
||||||
HUDOverlay.PlayerSettingsOverlay.AddAtStart(playbackSettings);
|
HUDOverlay.PlayerSettingsOverlay.AddAtStart(playbackSettings);
|
||||||
AddInternal(failIndicator = new ReplayFailIndicator(GameplayClockContainer)
|
AddInternal(new RulesetSkinProvidingContainer(GameplayState.Ruleset, GameplayState.Beatmap, Beatmap.Value.Skin)
|
||||||
{
|
{
|
||||||
GoToResults = () =>
|
Child = failIndicator = new ReplayFailIndicator(GameplayClockContainer)
|
||||||
{
|
{
|
||||||
if (!this.IsCurrentScreen())
|
GoToResults = () =>
|
||||||
return;
|
{
|
||||||
|
if (!this.IsCurrentScreen())
|
||||||
|
return;
|
||||||
|
|
||||||
ValidForResume = false;
|
ValidForResume = false;
|
||||||
this.Push(new SoloResultsScreen(Score.ScoreInfo));
|
this.Push(new SoloResultsScreen(Score.ScoreInfo));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,8 +96,17 @@ namespace osu.Game.Screens.Play
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
button.TooltipText = @"save score";
|
if (importFailedScore != null)
|
||||||
button.Enabled.Value = true;
|
{
|
||||||
|
button.TooltipText = @"save score";
|
||||||
|
button.Enabled.Value = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
button.TooltipText = @"replay unavailable";
|
||||||
|
button.Enabled.Value = false;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
@@ -52,9 +53,9 @@ namespace osu.Game.Screens.Play
|
|||||||
private double displayTime;
|
private double displayTime;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Becomes <see langword="false"/> when the overlay starts fading out.
|
/// Whether the gameplay clock is currently at the skippable period.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private bool isClickable;
|
private readonly BindableBool inSkipPeriod = new BindableBool();
|
||||||
|
|
||||||
private bool skipQueued;
|
private bool skipQueued;
|
||||||
|
|
||||||
@@ -92,7 +93,7 @@ namespace osu.Game.Screens.Play
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
button = CreateButton(),
|
button = CreateButton(inSkipPeriod),
|
||||||
RemainingTimeBox = new Circle
|
RemainingTimeBox = new Circle
|
||||||
{
|
{
|
||||||
Height = 5,
|
Height = 5,
|
||||||
@@ -106,10 +107,15 @@ namespace osu.Game.Screens.Play
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual OsuClickableContainer CreateButton() => new Button
|
/// <summary>
|
||||||
|
/// Creates a skip button.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inSkipPeriod">Whether the gameplay clock is currently at the skippable period.</param>
|
||||||
|
protected virtual OsuClickableContainer CreateButton(IBindable<bool> inSkipPeriod) => new Button
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
Enabled = { BindTarget = inSkipPeriod },
|
||||||
};
|
};
|
||||||
|
|
||||||
private const double fade_time = 300;
|
private const double fade_time = 300;
|
||||||
@@ -187,17 +193,13 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
RemainingTimeBox.Width = (float)Interpolation.Lerp(RemainingTimeBox.Width, progress, Math.Clamp(Time.Elapsed / 40, 0, 1));
|
RemainingTimeBox.Width = (float)Interpolation.Lerp(RemainingTimeBox.Width, progress, Math.Clamp(Time.Elapsed / 40, 0, 1));
|
||||||
|
|
||||||
isClickable = progress > 0;
|
inSkipPeriod.Value = progress > 0;
|
||||||
|
buttonContainer.State.Value = inSkipPeriod.Value ? Visibility.Visible : Visibility.Hidden;
|
||||||
if (!isClickable)
|
|
||||||
button.Enabled.Value = false;
|
|
||||||
|
|
||||||
buttonContainer.State.Value = isClickable ? Visibility.Visible : Visibility.Hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseMove(MouseMoveEvent e)
|
protected override bool OnMouseMove(MouseMoveEvent e)
|
||||||
{
|
{
|
||||||
if (isClickable && !e.HasAnyButtonPressed)
|
if (inSkipPeriod.Value && !e.HasAnyButtonPressed)
|
||||||
FadingContent.TriggerShow();
|
FadingContent.TriggerShow();
|
||||||
|
|
||||||
return base.OnMouseMove(e);
|
return base.OnMouseMove(e);
|
||||||
|
|||||||
@@ -407,15 +407,27 @@ namespace osu.Game.Screens.SelectV2
|
|||||||
|
|
||||||
private LeaderboardState displayedState;
|
private LeaderboardState displayedState;
|
||||||
|
|
||||||
|
private ScheduledDelegate? loadingShowDelegate;
|
||||||
|
|
||||||
protected void SetState(LeaderboardState state)
|
protected void SetState(LeaderboardState state)
|
||||||
{
|
{
|
||||||
if (state == displayedState)
|
if (state == displayedState)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (state == LeaderboardState.Retrieving)
|
if (state == LeaderboardState.Retrieving)
|
||||||
loading.Show();
|
{
|
||||||
|
// Slight delay so this doesn't display for a few silly frames for local score retrievals.
|
||||||
|
loadingShowDelegate ??= Scheduler.AddDelayed(() => loading.Show(), 200);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
loadingShowDelegate?.Cancel();
|
||||||
|
loadingShowDelegate = null;
|
||||||
|
|
||||||
loading.Hide();
|
loading.Hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
loading.Hide();
|
||||||
|
|
||||||
displayedState = state;
|
displayedState = state;
|
||||||
|
|
||||||
|
|||||||
@@ -128,6 +128,9 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
if (spectatorList != null)
|
if (spectatorList != null)
|
||||||
spectatorList.Position = pos;
|
spectatorList.Position = pos;
|
||||||
|
|
||||||
|
foreach (var d in container.OfType<ISerialisableDrawable>())
|
||||||
|
d.UsesFixedAnchor = true;
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@@ -238,6 +241,9 @@ namespace osu.Game.Skinning
|
|||||||
keyCounter.Position = new Vector2(-(hitError.Width + padding), -(padding * 2 + song_progress_offset_height));
|
keyCounter.Position = new Vector2(-(hitError.Width + padding), -(padding * 2 + song_progress_offset_height));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var d in container.OfType<ISerialisableDrawable>())
|
||||||
|
d.UsesFixedAnchor = true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
|
|||||||
44
osu.Game/Skinning/LegacyPerformancePointsCounter.cs
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Screens.Play.HUD;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Skinning
|
||||||
|
{
|
||||||
|
public partial class LegacyPerformancePointsCounter : PerformancePointsCounter, ISerialisableDrawable
|
||||||
|
{
|
||||||
|
protected override double RollingDuration => 1000;
|
||||||
|
protected override Easing RollingEasing => Easing.Out;
|
||||||
|
|
||||||
|
private const float alpha_when_invalid = 0.3f;
|
||||||
|
|
||||||
|
public LegacyPerformancePointsCounter()
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopRight;
|
||||||
|
Origin = Anchor.TopRight;
|
||||||
|
|
||||||
|
Scale = new Vector2(0.96f);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool IsValid
|
||||||
|
{
|
||||||
|
get => base.IsValid;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == IsValid)
|
||||||
|
return;
|
||||||
|
|
||||||
|
base.IsValid = value;
|
||||||
|
DrawableCount.FadeTo(value ? 1 : alpha_when_invalid, 1000, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override LocalisableString FormatCount(int count) => count.ToString($@"0'{LegacySpriteText.PP_SUFFIX_CHAR}'");
|
||||||
|
|
||||||
|
protected sealed override OsuSpriteText CreateSpriteText() => new LegacySpriteText(LegacyFont.Score);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -412,6 +412,9 @@ namespace osu.Game.Skinning
|
|||||||
leaderboard.Origin = Anchor.CentreLeft;
|
leaderboard.Origin = Anchor.CentreLeft;
|
||||||
leaderboard.X = 10;
|
leaderboard.X = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var d in container.OfType<ISerialisableDrawable>())
|
||||||
|
d.UsesFixedAnchor = true;
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
new LegacyDefaultComboCounter(),
|
new LegacyDefaultComboCounter(),
|
||||||
@@ -448,6 +451,9 @@ namespace osu.Game.Skinning
|
|||||||
hitError.Origin = Anchor.CentreLeft;
|
hitError.Origin = Anchor.CentreLeft;
|
||||||
hitError.Rotation = -90;
|
hitError.Rotation = -90;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var d in container.OfType<ISerialisableDrawable>())
|
||||||
|
d.UsesFixedAnchor = true;
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ namespace osu.Game.Skinning
|
|||||||
{
|
{
|
||||||
public sealed partial class LegacySpriteText : OsuSpriteText
|
public sealed partial class LegacySpriteText : OsuSpriteText
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The Private Use Area character for internally representing the "pp" suffix for performance counters.
|
||||||
|
/// </summary>
|
||||||
|
public const char PP_SUFFIX_CHAR = '\uebd9';
|
||||||
|
|
||||||
public Vector2? MaxSizePerGlyph { get; init; }
|
public Vector2? MaxSizePerGlyph { get; init; }
|
||||||
public bool FixedWidth { get; init; }
|
public bool FixedWidth { get; init; }
|
||||||
|
|
||||||
@@ -23,7 +28,7 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
protected override char FixedWidthReferenceCharacter => '5';
|
protected override char FixedWidthReferenceCharacter => '5';
|
||||||
|
|
||||||
protected override char[] FixedWidthExcludeCharacters => new[] { ',', '.', '%', 'x' };
|
protected override char[] FixedWidthExcludeCharacters => new[] { ',', '.', '%', 'x', PP_SUFFIX_CHAR };
|
||||||
|
|
||||||
// ReSharper disable once UnusedMember.Global
|
// ReSharper disable once UnusedMember.Global
|
||||||
// being unused is the point here
|
// being unused is the point here
|
||||||
@@ -116,6 +121,9 @@ namespace osu.Game.Skinning
|
|||||||
case '%':
|
case '%':
|
||||||
return "percent";
|
return "percent";
|
||||||
|
|
||||||
|
case PP_SUFFIX_CHAR:
|
||||||
|
return "pp";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return character.ToString();
|
return character.ToString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,6 +106,9 @@ namespace osu.Game.Skinning
|
|||||||
spectatorList.Origin = Anchor.BottomLeft;
|
spectatorList.Origin = Anchor.BottomLeft;
|
||||||
spectatorList.Position = new Vector2(screen_edge_padding, -(song_progress_offset_height + screen_edge_padding));
|
spectatorList.Position = new Vector2(screen_edge_padding, -(song_progress_offset_height + screen_edge_padding));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var d in container.OfType<ISerialisableDrawable>())
|
||||||
|
d.UsesFixedAnchor = true;
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@@ -178,6 +181,9 @@ namespace osu.Game.Skinning
|
|||||||
keyCounter.Origin = Anchor.BottomRight;
|
keyCounter.Origin = Anchor.BottomRight;
|
||||||
keyCounter.Position = new Vector2(-screen_edge_padding, -(song_progress_offset_height + screen_edge_padding));
|
keyCounter.Position = new Vector2(-screen_edge_padding, -(song_progress_offset_height + screen_edge_padding));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var d in container.OfType<ISerialisableDrawable>())
|
||||||
|
d.UsesFixedAnchor = true;
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
|||||||
@@ -89,6 +89,21 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
LifetimeEnd = animation.EndTimeForDisplay;
|
LifetimeEnd = animation.EndTimeForDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
// In stable, alpha transforms exceeding values of 1 would result in sprites disappearing from view.
|
||||||
|
// See https://github.com/peppy/osu-stable-reference/blob/08e3dafd525934cf48880b08e91c24ce4ad8b761/osu!/Graphics/Sprites/pSprite.cs#L413-L414
|
||||||
|
//
|
||||||
|
// Over the years, storyboard(ers) have taken advantage of this to create "flicker" patterns.
|
||||||
|
// This is quite a common technique, so we are reproducing it here for now.
|
||||||
|
//
|
||||||
|
// NOTE TO FUTURE VISTIORS: If we do ever update the storyboard spec, we may want to move such flicker effects to their
|
||||||
|
// own transform type, and make this a legacy behaviour. It feels very flimsy.
|
||||||
|
if (Alpha > 1) Alpha %= 1;
|
||||||
|
}
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private ISkinSource skin { get; set; }
|
private ISkinSource skin { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,21 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
public override bool IsPresent
|
public override bool IsPresent
|
||||||
=> !float.IsNaN(DrawPosition.X) && !float.IsNaN(DrawPosition.Y) && base.IsPresent;
|
=> !float.IsNaN(DrawPosition.X) && !float.IsNaN(DrawPosition.Y) && base.IsPresent;
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
// In stable, alpha transforms exceeding values of 1 would result in sprites disappearing from view.
|
||||||
|
// See https://github.com/peppy/osu-stable-reference/blob/08e3dafd525934cf48880b08e91c24ce4ad8b761/osu!/Graphics/Sprites/pSprite.cs#L413-L414
|
||||||
|
//
|
||||||
|
// Over the years, storyboard(ers) have taken advantage of this to create "flicker" patterns.
|
||||||
|
// This is quite a common technique, so we are reproducing it here for now.
|
||||||
|
//
|
||||||
|
// NOTE TO FUTURE VISITORS: If we do ever update the storyboard spec, we may want to move such flicker effects to their
|
||||||
|
// own transform type, and make this a legacy behaviour. It feels very flimsy.
|
||||||
|
if (Alpha > 1) Alpha %= 1;
|
||||||
|
}
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private ISkinSource skin { get; set; } = null!;
|
private ISkinSource skin { get; set; } = null!;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.2" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.2" />
|
||||||
<PackageReference Include="Microsoft.Toolkit.HighPerformance" Version="7.1.2" />
|
<PackageReference Include="Microsoft.Toolkit.HighPerformance" Version="7.1.2" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
<PackageReference Include="ppy.LocalisationAnalyser" Version="2024.802.0">
|
<PackageReference Include="ppy.LocalisationAnalyser" Version="2025.1208.0">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|||||||