mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Merge branch 'master' into fix-profile-graph-crash
This commit is contained in:
50
.vscode/tasks.json
vendored
50
.vscode/tasks.json
vendored
@ -11,9 +11,9 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Desktop",
|
"osu.Desktop",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
@ -26,10 +26,10 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Desktop",
|
"osu.Desktop",
|
||||||
"/p:Configuration=Release",
|
"-p:Configuration=Release",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
@ -42,9 +42,9 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Tests",
|
"osu.Game.Tests",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
@ -57,10 +57,10 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Tests",
|
"osu.Game.Tests",
|
||||||
"/p:Configuration=Release",
|
"-p:Configuration=Release",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
@ -73,9 +73,9 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Tournament.Tests",
|
"osu.Game.Tournament.Tests",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
@ -88,10 +88,10 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Tournament.Tests",
|
"osu.Game.Tournament.Tests",
|
||||||
"/p:Configuration=Release",
|
"-p:Configuration=Release",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
@ -104,10 +104,10 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Benchmarks",
|
"osu.Game.Benchmarks",
|
||||||
"/p:Configuration=Release",
|
"-p:Configuration=Release",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
|
@ -135,6 +135,9 @@ namespace osu.Desktop
|
|||||||
|
|
||||||
case UserActivity.Editing edit:
|
case UserActivity.Editing edit:
|
||||||
return edit.Beatmap.ToString();
|
return edit.Beatmap.ToString();
|
||||||
|
|
||||||
|
case UserActivity.InLobby lobby:
|
||||||
|
return lobby.Room.Name.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
|
14
osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json
vendored
14
osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json
vendored
@ -11,9 +11,9 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Rulesets.Catch.Tests.csproj",
|
"osu.Game.Rulesets.Catch.Tests.csproj",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
@ -26,10 +26,10 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Rulesets.Catch.Tests.csproj",
|
"osu.Game.Rulesets.Catch.Tests.csproj",
|
||||||
"/p:Configuration=Release",
|
"-p:Configuration=Release",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
|
14
osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json
vendored
14
osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json
vendored
@ -11,9 +11,9 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Rulesets.Mania.Tests.csproj",
|
"osu.Game.Rulesets.Mania.Tests.csproj",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
@ -26,10 +26,10 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Rulesets.Mania.Tests.csproj",
|
"osu.Game.Rulesets.Mania.Tests.csproj",
|
||||||
"/p:Configuration=Release",
|
"-p:Configuration=Release",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
|
14
osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json
vendored
14
osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json
vendored
@ -11,9 +11,9 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Rulesets.Osu.Tests.csproj",
|
"osu.Game.Rulesets.Osu.Tests.csproj",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
@ -26,10 +26,10 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Rulesets.Osu.Tests.csproj",
|
"osu.Game.Rulesets.Osu.Tests.csproj",
|
||||||
"/p:Configuration=Release",
|
"-p:Configuration=Release",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
|
@ -280,8 +280,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
|
|||||||
|
|
||||||
private void addClickStep(MouseButton button)
|
private void addClickStep(MouseButton button)
|
||||||
{
|
{
|
||||||
AddStep($"press {button}", () => InputManager.PressButton(button));
|
AddStep($"click {button}", () => InputManager.Click(button));
|
||||||
AddStep($"release {button}", () => InputManager.ReleaseButton(button));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertPlaced(bool expected) => AddAssert($"slider {(expected ? "placed" : "not placed")}", () => (getSlider() != null) == expected);
|
private void assertPlaced(bool expected) => AddAssert($"slider {(expected ? "placed" : "not placed")}", () => (getSlider() != null) == expected);
|
||||||
|
14
osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json
vendored
14
osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json
vendored
@ -11,9 +11,9 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Rulesets.Taiko.Tests.csproj",
|
"osu.Game.Rulesets.Taiko.Tests.csproj",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
@ -26,10 +26,10 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Rulesets.Taiko.Tests.csproj",
|
"osu.Game.Rulesets.Taiko.Tests.csproj",
|
||||||
"/p:Configuration=Release",
|
"-p:Configuration=Release",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
|
@ -41,11 +41,11 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddStep("store time", () => time = Player.GameplayClockContainer.GameplayClock.CurrentTime);
|
AddStep("store time", () => time = Player.GameplayClockContainer.GameplayClock.CurrentTime);
|
||||||
|
|
||||||
// test seek via keyboard
|
// test seek via keyboard
|
||||||
AddStep("seek with right arrow key", () => press(Key.Right));
|
AddStep("seek with right arrow key", () => InputManager.Key(Key.Right));
|
||||||
AddAssert("time seeked forward", () => Player.GameplayClockContainer.GameplayClock.CurrentTime > time + 2000);
|
AddAssert("time seeked forward", () => Player.GameplayClockContainer.GameplayClock.CurrentTime > time + 2000);
|
||||||
|
|
||||||
AddStep("store time", () => time = Player.GameplayClockContainer.GameplayClock.CurrentTime);
|
AddStep("store time", () => time = Player.GameplayClockContainer.GameplayClock.CurrentTime);
|
||||||
AddStep("seek with left arrow key", () => press(Key.Left));
|
AddStep("seek with left arrow key", () => InputManager.Key(Key.Left));
|
||||||
AddAssert("time seeked backward", () => Player.GameplayClockContainer.GameplayClock.CurrentTime < time);
|
AddAssert("time seeked backward", () => Player.GameplayClockContainer.GameplayClock.CurrentTime < time);
|
||||||
|
|
||||||
seekToBreak(0);
|
seekToBreak(0);
|
||||||
@ -67,11 +67,5 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
BreakPeriod destBreak() => Beatmap.Value.Beatmap.Breaks.ElementAt(breakIndex);
|
BreakPeriod destBreak() => Beatmap.Value.Beatmap.Breaks.ElementAt(breakIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void press(Key key)
|
|
||||||
{
|
|
||||||
InputManager.PressKey(key);
|
|
||||||
InputManager.ReleaseKey(key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
showOverlay();
|
showOverlay();
|
||||||
|
|
||||||
AddStep("Up arrow", () => press(Key.Up));
|
AddStep("Up arrow", () => InputManager.Key(Key.Up));
|
||||||
AddAssert("Last button selected", () => pauseOverlay.Buttons.Last().Selected.Value);
|
AddAssert("Last button selected", () => pauseOverlay.Buttons.Last().Selected.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
showOverlay();
|
showOverlay();
|
||||||
|
|
||||||
AddStep("Down arrow", () => press(Key.Down));
|
AddStep("Down arrow", () => InputManager.Key(Key.Down));
|
||||||
AddAssert("First button selected", () => getButton(0).Selected.Value);
|
AddAssert("First button selected", () => getButton(0).Selected.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,11 +110,11 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
AddStep("Show overlay", () => failOverlay.Show());
|
AddStep("Show overlay", () => failOverlay.Show());
|
||||||
|
|
||||||
AddStep("Up arrow", () => press(Key.Up));
|
AddStep("Up arrow", () => InputManager.Key(Key.Up));
|
||||||
AddAssert("Last button selected", () => failOverlay.Buttons.Last().Selected.Value);
|
AddAssert("Last button selected", () => failOverlay.Buttons.Last().Selected.Value);
|
||||||
AddStep("Up arrow", () => press(Key.Up));
|
AddStep("Up arrow", () => InputManager.Key(Key.Up));
|
||||||
AddAssert("First button selected", () => failOverlay.Buttons.First().Selected.Value);
|
AddAssert("First button selected", () => failOverlay.Buttons.First().Selected.Value);
|
||||||
AddStep("Up arrow", () => press(Key.Up));
|
AddStep("Up arrow", () => InputManager.Key(Key.Up));
|
||||||
AddAssert("Last button selected", () => failOverlay.Buttons.Last().Selected.Value);
|
AddAssert("Last button selected", () => failOverlay.Buttons.Last().Selected.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,11 +126,11 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
AddStep("Show overlay", () => failOverlay.Show());
|
AddStep("Show overlay", () => failOverlay.Show());
|
||||||
|
|
||||||
AddStep("Down arrow", () => press(Key.Down));
|
AddStep("Down arrow", () => InputManager.Key(Key.Down));
|
||||||
AddAssert("First button selected", () => failOverlay.Buttons.First().Selected.Value);
|
AddAssert("First button selected", () => failOverlay.Buttons.First().Selected.Value);
|
||||||
AddStep("Down arrow", () => press(Key.Down));
|
AddStep("Down arrow", () => InputManager.Key(Key.Down));
|
||||||
AddAssert("Last button selected", () => failOverlay.Buttons.Last().Selected.Value);
|
AddAssert("Last button selected", () => failOverlay.Buttons.Last().Selected.Value);
|
||||||
AddStep("Down arrow", () => press(Key.Down));
|
AddStep("Down arrow", () => InputManager.Key(Key.Down));
|
||||||
AddAssert("First button selected", () => failOverlay.Buttons.First().Selected.Value);
|
AddAssert("First button selected", () => failOverlay.Buttons.First().Selected.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
showOverlay();
|
showOverlay();
|
||||||
|
|
||||||
AddStep("Down arrow", () => press(Key.Down));
|
AddStep("Down arrow", () => InputManager.Key(Key.Down));
|
||||||
AddStep("Hover second button", () => InputManager.MoveMouseTo(getButton(1)));
|
AddStep("Hover second button", () => InputManager.MoveMouseTo(getButton(1)));
|
||||||
AddAssert("First button not selected", () => !getButton(0).Selected.Value);
|
AddAssert("First button not selected", () => !getButton(0).Selected.Value);
|
||||||
AddAssert("Second button selected", () => getButton(1).Selected.Value);
|
AddAssert("Second button selected", () => getButton(1).Selected.Value);
|
||||||
@ -195,7 +195,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
});
|
});
|
||||||
|
|
||||||
AddStep("Hover second button", () => InputManager.MoveMouseTo(getButton(1)));
|
AddStep("Hover second button", () => InputManager.MoveMouseTo(getButton(1)));
|
||||||
AddStep("Up arrow", () => press(Key.Up));
|
AddStep("Up arrow", () => InputManager.Key(Key.Up));
|
||||||
AddAssert("Second button not selected", () => !getButton(1).Selected.Value);
|
AddAssert("Second button not selected", () => !getButton(1).Selected.Value);
|
||||||
AddAssert("First button selected", () => getButton(0).Selected.Value);
|
AddAssert("First button selected", () => getButton(0).Selected.Value);
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
AddStep("Hover second button", () => InputManager.MoveMouseTo(getButton(1)));
|
AddStep("Hover second button", () => InputManager.MoveMouseTo(getButton(1)));
|
||||||
AddStep("Unhover second button", () => InputManager.MoveMouseTo(Vector2.Zero));
|
AddStep("Unhover second button", () => InputManager.MoveMouseTo(Vector2.Zero));
|
||||||
AddStep("Down arrow", () => press(Key.Down));
|
AddStep("Down arrow", () => InputManager.Key(Key.Down));
|
||||||
AddAssert("First button selected", () => getButton(0).Selected.Value); // Initial state condition
|
AddAssert("First button selected", () => getButton(0).Selected.Value); // Initial state condition
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,8 +246,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
AddStep("Select second button", () =>
|
AddStep("Select second button", () =>
|
||||||
{
|
{
|
||||||
press(Key.Down);
|
InputManager.Key(Key.Down);
|
||||||
press(Key.Down);
|
InputManager.Key(Key.Down);
|
||||||
});
|
});
|
||||||
|
|
||||||
bool triggered = false;
|
bool triggered = false;
|
||||||
@ -256,7 +256,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
lastAction = pauseOverlay.OnRetry;
|
lastAction = pauseOverlay.OnRetry;
|
||||||
pauseOverlay.OnRetry = () => triggered = true;
|
pauseOverlay.OnRetry = () => triggered = true;
|
||||||
press(Key.Enter);
|
InputManager.Key(Key.Enter);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("Action was triggered", () =>
|
AddAssert("Action was triggered", () =>
|
||||||
@ -290,12 +290,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
private DialogButton getButton(int index) => pauseOverlay.Buttons.Skip(index).First();
|
private DialogButton getButton(int index) => pauseOverlay.Buttons.Skip(index).First();
|
||||||
|
|
||||||
private void press(Key key)
|
|
||||||
{
|
|
||||||
InputManager.PressKey(key);
|
|
||||||
InputManager.ReleaseKey(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void press(GlobalAction action)
|
private void press(GlobalAction action)
|
||||||
{
|
{
|
||||||
globalActionContainer.TriggerPressed(action);
|
globalActionContainer.TriggerPressed(action);
|
||||||
|
@ -32,11 +32,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestDefaultsWhenNotDatabased()
|
public void TestDefaultsWhenNotDatabased()
|
||||||
{
|
{
|
||||||
AddStep("fire key", () =>
|
AddStep("fire key", () => InputManager.Key(Key.A));
|
||||||
{
|
|
||||||
InputManager.PressKey(Key.A);
|
|
||||||
InputManager.ReleaseKey(Key.A);
|
|
||||||
});
|
|
||||||
|
|
||||||
AddAssert("received key", () => receiver.ReceivedAction);
|
AddAssert("received key", () => receiver.ReceivedAction);
|
||||||
}
|
}
|
||||||
|
@ -40,11 +40,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
void addPressKeyStep()
|
void addPressKeyStep()
|
||||||
{
|
{
|
||||||
AddStep($"Press {testKey} key", () =>
|
AddStep($"Press {testKey} key", () => InputManager.Key(testKey));
|
||||||
{
|
|
||||||
InputManager.PressKey(testKey);
|
|
||||||
InputManager.ReleaseKey(testKey);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addPressKeyStep();
|
addPressKeyStep();
|
||||||
|
@ -59,11 +59,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
confirmClockRunning(false);
|
confirmClockRunning(false);
|
||||||
confirmPauseOverlayShown(false);
|
confirmPauseOverlayShown(false);
|
||||||
|
|
||||||
AddStep("click to resume", () =>
|
AddStep("click to resume", () => InputManager.Click(MouseButton.Left));
|
||||||
{
|
|
||||||
InputManager.PressButton(MouseButton.Left);
|
|
||||||
InputManager.ReleaseButton(MouseButton.Left);
|
|
||||||
});
|
|
||||||
|
|
||||||
confirmClockRunning(true);
|
confirmClockRunning(true);
|
||||||
}
|
}
|
||||||
|
@ -158,8 +158,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddStep("much move with press", () => moveFunction = Scheduler.AddDelayed(() =>
|
AddStep("much move with press", () => moveFunction = Scheduler.AddDelayed(() =>
|
||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(InputManager.CurrentState.Mouse.Position + new Vector2(-1, 0));
|
InputManager.MoveMouseTo(InputManager.CurrentState.Mouse.Position + new Vector2(-1, 0));
|
||||||
InputManager.PressButton(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
InputManager.ReleaseButton(MouseButton.Left);
|
|
||||||
}, 10, true));
|
}, 10, true));
|
||||||
AddWaitStep("move", 10);
|
AddWaitStep("move", 10);
|
||||||
AddStep("stop move", () => moveFunction.Cancel());
|
AddStep("stop move", () => moveFunction.Cancel());
|
||||||
|
@ -65,10 +65,8 @@ namespace osu.Game.Tests.Visual.Menus
|
|||||||
AddStep($"switch to ruleset {i} via shortcut", () =>
|
AddStep($"switch to ruleset {i} via shortcut", () =>
|
||||||
{
|
{
|
||||||
InputManager.PressKey(Key.ControlLeft);
|
InputManager.PressKey(Key.ControlLeft);
|
||||||
InputManager.PressKey(numberKey);
|
InputManager.Key(numberKey);
|
||||||
|
|
||||||
InputManager.ReleaseKey(Key.ControlLeft);
|
InputManager.ReleaseKey(Key.ControlLeft);
|
||||||
InputManager.ReleaseKey(numberKey);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("ruleset switched", () => rulesetSelector.Current.Value.Equals(expected));
|
AddUntilStep("ruleset switched", () => rulesetSelector.Current.Value.Equals(expected));
|
||||||
|
@ -71,11 +71,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
private void press(Key down)
|
private void press(Key down)
|
||||||
{
|
{
|
||||||
AddStep($"press {down}", () =>
|
AddStep($"press {down}", () => InputManager.Key(down));
|
||||||
{
|
|
||||||
InputManager.PressKey(down);
|
|
||||||
InputManager.ReleaseKey(down);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -58,7 +58,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
if (withUserPause)
|
if (withUserPause)
|
||||||
AddStep("pause", () => Game.Dependencies.Get<MusicController>().Stop(true));
|
AddStep("pause", () => Game.Dependencies.Get<MusicController>().Stop(true));
|
||||||
|
|
||||||
AddStep("press enter", () => pressAndRelease(Key.Enter));
|
AddStep("press enter", () => InputManager.Key(Key.Enter));
|
||||||
|
|
||||||
AddUntilStep("wait for player", () => (player = Game.ScreenStack.CurrentScreen as Player) != null);
|
AddUntilStep("wait for player", () => (player = Game.ScreenStack.CurrentScreen as Player) != null);
|
||||||
AddUntilStep("wait for fail", () => player.HasFailed);
|
AddUntilStep("wait for fail", () => player.HasFailed);
|
||||||
@ -122,11 +122,11 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
public void TestOpenOptionsAndExitWithEscape()
|
public void TestOpenOptionsAndExitWithEscape()
|
||||||
{
|
{
|
||||||
AddUntilStep("Wait for options to load", () => Game.Settings.IsLoaded);
|
AddUntilStep("Wait for options to load", () => Game.Settings.IsLoaded);
|
||||||
AddStep("Enter menu", () => pressAndRelease(Key.Enter));
|
AddStep("Enter menu", () => InputManager.Key(Key.Enter));
|
||||||
AddStep("Move mouse to options overlay", () => InputManager.MoveMouseTo(optionsButtonPosition));
|
AddStep("Move mouse to options overlay", () => InputManager.MoveMouseTo(optionsButtonPosition));
|
||||||
AddStep("Click options overlay", () => InputManager.Click(MouseButton.Left));
|
AddStep("Click options overlay", () => InputManager.Click(MouseButton.Left));
|
||||||
AddAssert("Options overlay was opened", () => Game.Settings.State.Value == Visibility.Visible);
|
AddAssert("Options overlay was opened", () => Game.Settings.State.Value == Visibility.Visible);
|
||||||
AddStep("Hide options overlay using escape", () => pressAndRelease(Key.Escape));
|
AddStep("Hide options overlay using escape", () => InputManager.Key(Key.Escape));
|
||||||
AddAssert("Options overlay was closed", () => Game.Settings.State.Value == Visibility.Hidden);
|
AddAssert("Options overlay was closed", () => Game.Settings.State.Value == Visibility.Hidden);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,10 +158,8 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
AddStep("Change ruleset to osu!taiko", () =>
|
AddStep("Change ruleset to osu!taiko", () =>
|
||||||
{
|
{
|
||||||
InputManager.PressKey(Key.ControlLeft);
|
InputManager.PressKey(Key.ControlLeft);
|
||||||
InputManager.PressKey(Key.Number2);
|
InputManager.Key(Key.Number2);
|
||||||
|
|
||||||
InputManager.ReleaseKey(Key.ControlLeft);
|
InputManager.ReleaseKey(Key.ControlLeft);
|
||||||
InputManager.ReleaseKey(Key.Number2);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("Ruleset changed to osu!taiko", () => Game.Toolbar.ChildrenOfType<ToolbarRulesetSelector>().Single().Current.Value.ID == 1);
|
AddAssert("Ruleset changed to osu!taiko", () => Game.Toolbar.ChildrenOfType<ToolbarRulesetSelector>().Single().Current.Value.ID == 1);
|
||||||
@ -181,10 +179,8 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
AddStep("Change ruleset to osu!taiko", () =>
|
AddStep("Change ruleset to osu!taiko", () =>
|
||||||
{
|
{
|
||||||
InputManager.PressKey(Key.ControlLeft);
|
InputManager.PressKey(Key.ControlLeft);
|
||||||
InputManager.PressKey(Key.Number2);
|
InputManager.Key(Key.Number2);
|
||||||
|
|
||||||
InputManager.ReleaseKey(Key.ControlLeft);
|
InputManager.ReleaseKey(Key.ControlLeft);
|
||||||
InputManager.ReleaseKey(Key.Number2);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("Ruleset changed to osu!taiko", () => Game.Toolbar.ChildrenOfType<ToolbarRulesetSelector>().Single().Current.Value.ID == 1);
|
AddAssert("Ruleset changed to osu!taiko", () => Game.Toolbar.ChildrenOfType<ToolbarRulesetSelector>().Single().Current.Value.ID == 1);
|
||||||
@ -193,7 +189,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void pushEscape() =>
|
private void pushEscape() =>
|
||||||
AddStep("Press escape", () => pressAndRelease(Key.Escape));
|
AddStep("Press escape", () => InputManager.Key(Key.Escape));
|
||||||
|
|
||||||
private void exitViaEscapeAndConfirm()
|
private void exitViaEscapeAndConfirm()
|
||||||
{
|
{
|
||||||
@ -208,12 +204,6 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
ConfirmAtMainMenu();
|
ConfirmAtMainMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pressAndRelease(Key key)
|
|
||||||
{
|
|
||||||
InputManager.PressKey(key);
|
|
||||||
InputManager.ReleaseKey(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class TestSongSelect : PlaySongSelect
|
private class TestSongSelect : PlaySongSelect
|
||||||
{
|
{
|
||||||
public ModSelectOverlay ModSelectOverlay => ModSelect;
|
public ModSelectOverlay ModSelectOverlay => ModSelect;
|
||||||
|
@ -103,11 +103,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
public void TestChannelShortcutKeys()
|
public void TestChannelShortcutKeys()
|
||||||
{
|
{
|
||||||
AddStep("Join channels", () => channels.ForEach(channel => channelManager.JoinChannel(channel)));
|
AddStep("Join channels", () => channels.ForEach(channel => channelManager.JoinChannel(channel)));
|
||||||
AddStep("Close channel selector", () =>
|
AddStep("Close channel selector", () => InputManager.Key(Key.Escape));
|
||||||
{
|
|
||||||
InputManager.PressKey(Key.Escape);
|
|
||||||
InputManager.ReleaseKey(Key.Escape);
|
|
||||||
});
|
|
||||||
AddUntilStep("Wait for close", () => chatOverlay.SelectionOverlayState == Visibility.Hidden);
|
AddUntilStep("Wait for close", () => chatOverlay.SelectionOverlayState == Visibility.Hidden);
|
||||||
|
|
||||||
for (int zeroBasedIndex = 0; zeroBasedIndex < 10; ++zeroBasedIndex)
|
for (int zeroBasedIndex = 0; zeroBasedIndex < 10; ++zeroBasedIndex)
|
||||||
@ -216,9 +212,8 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
{
|
{
|
||||||
var channelKey = Key.Number0 + number;
|
var channelKey = Key.Number0 + number;
|
||||||
InputManager.PressKey(Key.AltLeft);
|
InputManager.PressKey(Key.AltLeft);
|
||||||
InputManager.PressKey(channelKey);
|
InputManager.Key(channelKey);
|
||||||
InputManager.ReleaseKey(Key.AltLeft);
|
InputManager.ReleaseKey(Key.AltLeft);
|
||||||
InputManager.ReleaseKey(channelKey);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clickDrawable(Drawable d)
|
private void clickDrawable(Drawable d)
|
||||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestGenericActivity()
|
public void TestGenericActivity()
|
||||||
{
|
{
|
||||||
AddStep("Set activity", () => API.Activity.Value = new UserActivity.InLobby());
|
AddStep("Set activity", () => API.Activity.Value = new UserActivity.InLobby(null));
|
||||||
|
|
||||||
AddStep("Run command", () => Add(new NowPlayingCommand()));
|
AddStep("Run command", () => Add(new NowPlayingCommand()));
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
[TestCase(false)]
|
[TestCase(false)]
|
||||||
public void TestLinkPresence(bool hasOnlineId)
|
public void TestLinkPresence(bool hasOnlineId)
|
||||||
{
|
{
|
||||||
AddStep("Set activity", () => API.Activity.Value = new UserActivity.InLobby());
|
AddStep("Set activity", () => API.Activity.Value = new UserActivity.InLobby(null));
|
||||||
|
|
||||||
AddStep("Set beatmap", () => Beatmap.Value = new DummyWorkingBeatmap(Audio, null)
|
AddStep("Set beatmap", () => Beatmap.Value = new DummyWorkingBeatmap(Audio, null)
|
||||||
{
|
{
|
||||||
|
@ -51,8 +51,7 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
|
|
||||||
clickDelegate = Scheduler.AddDelayed(() =>
|
clickDelegate = Scheduler.AddDelayed(() =>
|
||||||
{
|
{
|
||||||
InputManager.PressButton(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
InputManager.ReleaseButton(MouseButton.Left);
|
|
||||||
|
|
||||||
if (++buttonClicks == 2)
|
if (++buttonClicks == 2)
|
||||||
{
|
{
|
||||||
|
@ -98,10 +98,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
AddStep("select next and enter", () =>
|
AddStep("select next and enter", () =>
|
||||||
{
|
{
|
||||||
InputManager.PressKey(Key.Down);
|
InputManager.Key(Key.Down);
|
||||||
InputManager.ReleaseKey(Key.Down);
|
InputManager.Key(Key.Enter);
|
||||||
InputManager.PressKey(Key.Enter);
|
|
||||||
InputManager.ReleaseKey(Key.Enter);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for not current", () => !songSelect.IsCurrentScreen());
|
AddUntilStep("wait for not current", () => !songSelect.IsCurrentScreen());
|
||||||
@ -123,10 +121,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
AddStep("select next and enter", () =>
|
AddStep("select next and enter", () =>
|
||||||
{
|
{
|
||||||
InputManager.PressKey(Key.Enter);
|
InputManager.Key(Key.Enter);
|
||||||
InputManager.ReleaseKey(Key.Enter);
|
InputManager.Key(Key.Down);
|
||||||
InputManager.PressKey(Key.Down);
|
|
||||||
InputManager.ReleaseKey(Key.Down);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for not current", () => !songSelect.IsCurrentScreen());
|
AddUntilStep("wait for not current", () => !songSelect.IsCurrentScreen());
|
||||||
@ -151,11 +147,9 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
InputManager.MoveMouseTo(songSelect.Carousel.ChildrenOfType<DrawableCarouselBeatmap>()
|
InputManager.MoveMouseTo(songSelect.Carousel.ChildrenOfType<DrawableCarouselBeatmap>()
|
||||||
.First(b => ((CarouselBeatmap)b.Item).Beatmap != songSelect.Carousel.SelectedBeatmap));
|
.First(b => ((CarouselBeatmap)b.Item).Beatmap != songSelect.Carousel.SelectedBeatmap));
|
||||||
|
|
||||||
InputManager.PressButton(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
InputManager.ReleaseButton(MouseButton.Left);
|
|
||||||
|
|
||||||
InputManager.PressKey(Key.Enter);
|
InputManager.Key(Key.Enter);
|
||||||
InputManager.ReleaseKey(Key.Enter);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for not current", () => !songSelect.IsCurrentScreen());
|
AddUntilStep("wait for not current", () => !songSelect.IsCurrentScreen());
|
||||||
@ -182,8 +176,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
InputManager.PressButton(MouseButton.Left);
|
InputManager.PressButton(MouseButton.Left);
|
||||||
|
|
||||||
InputManager.PressKey(Key.Enter);
|
InputManager.Key(Key.Enter);
|
||||||
InputManager.ReleaseKey(Key.Enter);
|
|
||||||
|
|
||||||
InputManager.ReleaseButton(MouseButton.Left);
|
InputManager.ReleaseButton(MouseButton.Left);
|
||||||
});
|
});
|
||||||
@ -567,10 +560,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
AddStep("press ctrl+enter", () =>
|
AddStep("press ctrl+enter", () =>
|
||||||
{
|
{
|
||||||
InputManager.PressKey(Key.ControlLeft);
|
InputManager.PressKey(Key.ControlLeft);
|
||||||
InputManager.PressKey(Key.Enter);
|
InputManager.Key(Key.Enter);
|
||||||
|
|
||||||
InputManager.ReleaseKey(Key.ControlLeft);
|
InputManager.ReleaseKey(Key.ControlLeft);
|
||||||
InputManager.ReleaseKey(Key.Enter);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for player", () => Stack.CurrentScreen is PlayerLoader);
|
AddUntilStep("wait for player", () => Stack.CurrentScreen is PlayerLoader);
|
||||||
@ -617,8 +608,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(difficultyIcon);
|
InputManager.MoveMouseTo(difficultyIcon);
|
||||||
|
|
||||||
InputManager.PressButton(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
InputManager.ReleaseButton(MouseButton.Left);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("Selected beatmap correct", () => getCurrentBeatmapIndex() == getDifficultyIconIndex(set, difficultyIcon));
|
AddAssert("Selected beatmap correct", () => getCurrentBeatmapIndex() == getDifficultyIconIndex(set, difficultyIcon));
|
||||||
@ -647,8 +637,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(filteredIcon);
|
InputManager.MoveMouseTo(filteredIcon);
|
||||||
|
|
||||||
InputManager.PressButton(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
InputManager.ReleaseButton(MouseButton.Left);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("Selected beatmap correct", () => songSelect.Carousel.SelectedBeatmap == filteredBeatmap);
|
AddAssert("Selected beatmap correct", () => songSelect.Carousel.SelectedBeatmap == filteredBeatmap);
|
||||||
@ -691,8 +680,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(difficultyIcon);
|
InputManager.MoveMouseTo(difficultyIcon);
|
||||||
|
|
||||||
InputManager.PressButton(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
InputManager.ReleaseButton(MouseButton.Left);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("Check ruleset changed to mania", () => Ruleset.Value.ID == 3);
|
AddUntilStep("Check ruleset changed to mania", () => Ruleset.Value.ID == 3);
|
||||||
@ -738,8 +726,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(groupIcon);
|
InputManager.MoveMouseTo(groupIcon);
|
||||||
|
|
||||||
InputManager.PressButton(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
InputManager.ReleaseButton(MouseButton.Left);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("Check ruleset changed to mania", () => Ruleset.Value.ID == 3);
|
AddUntilStep("Check ruleset changed to mania", () => Ruleset.Value.ID == 3);
|
||||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
});
|
});
|
||||||
AddStep("enter text", () => commentEditor.Current.Value = "text");
|
AddStep("enter text", () => commentEditor.Current.Value = "text");
|
||||||
|
|
||||||
AddStep("press Enter", () => press(Key.Enter));
|
AddStep("press Enter", () => InputManager.Key(Key.Enter));
|
||||||
|
|
||||||
AddAssert("text committed", () => commentEditor.CommittedText == "text");
|
AddAssert("text committed", () => commentEditor.CommittedText == "text");
|
||||||
AddAssert("button is loading", () => commentEditor.IsLoading);
|
AddAssert("button is loading", () => commentEditor.IsLoading);
|
||||||
@ -63,7 +63,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("press Enter", () => press(Key.Enter));
|
AddStep("press Enter", () => InputManager.Key(Key.Enter));
|
||||||
|
|
||||||
AddAssert("no text committed", () => commentEditor.CommittedText == null);
|
AddAssert("no text committed", () => commentEditor.CommittedText == null);
|
||||||
AddAssert("button is not loading", () => !commentEditor.IsLoading);
|
AddAssert("button is not loading", () => !commentEditor.IsLoading);
|
||||||
@ -101,12 +101,6 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
AddAssert("cancel action fired", () => cancellableCommentEditor.Cancelled);
|
AddAssert("cancel action fired", () => cancellableCommentEditor.Cancelled);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void press(Key key)
|
|
||||||
{
|
|
||||||
InputManager.PressKey(key);
|
|
||||||
InputManager.ReleaseKey(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class TestCommentEditor : CommentEditor
|
private class TestCommentEditor : CommentEditor
|
||||||
{
|
{
|
||||||
public new Bindable<string> Current => base.Current;
|
public new Bindable<string> Current => base.Current;
|
||||||
|
14
osu.Game.Tournament.Tests/.vscode/tasks.json
vendored
14
osu.Game.Tournament.Tests/.vscode/tasks.json
vendored
@ -11,9 +11,9 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Tournament.Tests.csproj",
|
"osu.Game.Tournament.Tests.csproj",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
@ -26,10 +26,10 @@
|
|||||||
"build",
|
"build",
|
||||||
"--no-restore",
|
"--no-restore",
|
||||||
"osu.Game.Tournament.Tests.csproj",
|
"osu.Game.Tournament.Tests.csproj",
|
||||||
"/p:Configuration=Release",
|
"-p:Configuration=Release",
|
||||||
"/p:GenerateFullPaths=true",
|
"-p:GenerateFullPaths=true",
|
||||||
"/m",
|
"-m",
|
||||||
"/verbosity:m"
|
"-verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
|
@ -30,8 +30,22 @@ namespace osu.Game.Beatmaps
|
|||||||
// Too many simultaneous updates can lead to stutters. One thread seems to work fine for song select display purposes.
|
// Too many simultaneous updates can lead to stutters. One thread seems to work fine for song select display purposes.
|
||||||
private readonly ThreadedTaskScheduler updateScheduler = new ThreadedTaskScheduler(1, nameof(BeatmapDifficultyCache));
|
private readonly ThreadedTaskScheduler updateScheduler = new ThreadedTaskScheduler(1, nameof(BeatmapDifficultyCache));
|
||||||
|
|
||||||
// All bindables that should be updated along with the current ruleset + mods.
|
/// <summary>
|
||||||
private readonly LockedWeakList<BindableStarDifficulty> trackedBindables = new LockedWeakList<BindableStarDifficulty>();
|
/// All bindables that should be updated along with the current ruleset + mods.
|
||||||
|
/// </summary>
|
||||||
|
private readonly WeakList<BindableStarDifficulty> trackedBindables = new WeakList<BindableStarDifficulty>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cancellation sources used by tracked bindables.
|
||||||
|
/// </summary>
|
||||||
|
private readonly List<CancellationTokenSource> linkedCancellationSources = new List<CancellationTokenSource>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lock to be held when operating on <see cref="trackedBindables"/> or <see cref="linkedCancellationSources"/>.
|
||||||
|
/// </summary>
|
||||||
|
private readonly object bindableUpdateLock = new object();
|
||||||
|
|
||||||
|
private CancellationTokenSource trackedUpdateCancellationSource;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private BeatmapManager beatmapManager { get; set; }
|
private BeatmapManager beatmapManager { get; set; }
|
||||||
@ -59,7 +73,10 @@ namespace osu.Game.Beatmaps
|
|||||||
public IBindable<StarDifficulty> GetBindableDifficulty([NotNull] BeatmapInfo beatmapInfo, CancellationToken cancellationToken = default)
|
public IBindable<StarDifficulty> GetBindableDifficulty([NotNull] BeatmapInfo beatmapInfo, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
var bindable = createBindable(beatmapInfo, currentRuleset.Value, currentMods.Value, cancellationToken);
|
var bindable = createBindable(beatmapInfo, currentRuleset.Value, currentMods.Value, cancellationToken);
|
||||||
|
|
||||||
|
lock (bindableUpdateLock)
|
||||||
trackedBindables.Add(bindable);
|
trackedBindables.Add(bindable);
|
||||||
|
|
||||||
return bindable;
|
return bindable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +103,8 @@ namespace osu.Game.Beatmaps
|
|||||||
/// <param name="mods">The <see cref="Mod"/>s to get the difficulty with.</param>
|
/// <param name="mods">The <see cref="Mod"/>s to get the difficulty with.</param>
|
||||||
/// <param name="cancellationToken">An optional <see cref="CancellationToken"/> which stops computing the star difficulty.</param>
|
/// <param name="cancellationToken">An optional <see cref="CancellationToken"/> which stops computing the star difficulty.</param>
|
||||||
/// <returns>The <see cref="StarDifficulty"/>.</returns>
|
/// <returns>The <see cref="StarDifficulty"/>.</returns>
|
||||||
public Task<StarDifficulty> GetDifficultyAsync([NotNull] BeatmapInfo beatmapInfo, [CanBeNull] RulesetInfo rulesetInfo = null, [CanBeNull] IEnumerable<Mod> mods = null, CancellationToken cancellationToken = default)
|
public Task<StarDifficulty> GetDifficultyAsync([NotNull] BeatmapInfo beatmapInfo, [CanBeNull] RulesetInfo rulesetInfo = null, [CanBeNull] IEnumerable<Mod> mods = null,
|
||||||
|
CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
// In the case that the user hasn't given us a ruleset, use the beatmap's default ruleset.
|
// In the case that the user hasn't given us a ruleset, use the beatmap's default ruleset.
|
||||||
rulesetInfo ??= beatmapInfo.Ruleset;
|
rulesetInfo ??= beatmapInfo.Ruleset;
|
||||||
@ -140,13 +158,12 @@ namespace osu.Game.Beatmaps
|
|||||||
return DifficultyRating.Easy;
|
return DifficultyRating.Easy;
|
||||||
}
|
}
|
||||||
|
|
||||||
private CancellationTokenSource trackedUpdateCancellationSource;
|
|
||||||
private readonly List<CancellationTokenSource> linkedCancellationSources = new List<CancellationTokenSource>();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates all tracked <see cref="BindableStarDifficulty"/> using the current ruleset and mods.
|
/// Updates all tracked <see cref="BindableStarDifficulty"/> using the current ruleset and mods.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void updateTrackedBindables()
|
private void updateTrackedBindables()
|
||||||
|
{
|
||||||
|
lock (bindableUpdateLock)
|
||||||
{
|
{
|
||||||
cancelTrackedBindableUpdate();
|
cancelTrackedBindableUpdate();
|
||||||
trackedUpdateCancellationSource = new CancellationTokenSource();
|
trackedUpdateCancellationSource = new CancellationTokenSource();
|
||||||
@ -159,11 +176,14 @@ namespace osu.Game.Beatmaps
|
|||||||
updateBindable(b, currentRuleset.Value, currentMods.Value, linkedSource.Token);
|
updateBindable(b, currentRuleset.Value, currentMods.Value, linkedSource.Token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Cancels the existing update of all tracked <see cref="BindableStarDifficulty"/> via <see cref="updateTrackedBindables"/>.
|
/// Cancels the existing update of all tracked <see cref="BindableStarDifficulty"/> via <see cref="updateTrackedBindables"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void cancelTrackedBindableUpdate()
|
private void cancelTrackedBindableUpdate()
|
||||||
|
{
|
||||||
|
lock (bindableUpdateLock)
|
||||||
{
|
{
|
||||||
trackedUpdateCancellationSource?.Cancel();
|
trackedUpdateCancellationSource?.Cancel();
|
||||||
trackedUpdateCancellationSource = null;
|
trackedUpdateCancellationSource = null;
|
||||||
@ -176,6 +196,7 @@ namespace osu.Game.Beatmaps
|
|||||||
linkedCancellationSources.Clear();
|
linkedCancellationSources.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new <see cref="BindableStarDifficulty"/> and triggers an initial value update.
|
/// Creates a new <see cref="BindableStarDifficulty"/> and triggers an initial value update.
|
||||||
|
@ -51,6 +51,7 @@ using osu.Game.Screens.Select;
|
|||||||
using osu.Game.Updater;
|
using osu.Game.Updater;
|
||||||
using osu.Game.Utils;
|
using osu.Game.Utils;
|
||||||
using LogLevel = osu.Framework.Logging.LogLevel;
|
using LogLevel = osu.Framework.Logging.LogLevel;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game
|
namespace osu.Game
|
||||||
{
|
{
|
||||||
@ -961,11 +962,15 @@ namespace osu.Game
|
|||||||
LocalUserPlaying.Value = false;
|
LocalUserPlaying.Value = false;
|
||||||
|
|
||||||
if (current is IOsuScreen currentOsuScreen)
|
if (current is IOsuScreen currentOsuScreen)
|
||||||
|
{
|
||||||
OverlayActivationMode.UnbindFrom(currentOsuScreen.OverlayActivationMode);
|
OverlayActivationMode.UnbindFrom(currentOsuScreen.OverlayActivationMode);
|
||||||
|
API.Activity.UnbindFrom(currentOsuScreen.Activity);
|
||||||
|
}
|
||||||
|
|
||||||
if (newScreen is IOsuScreen newOsuScreen)
|
if (newScreen is IOsuScreen newOsuScreen)
|
||||||
{
|
{
|
||||||
OverlayActivationMode.BindTo(newOsuScreen.OverlayActivationMode);
|
OverlayActivationMode.BindTo(newOsuScreen.OverlayActivationMode);
|
||||||
|
((IBindable<UserActivity>)API.Activity).BindTo(newOsuScreen.Activity);
|
||||||
|
|
||||||
MusicController.AllowRateAdjustments = newOsuScreen.AllowRateAdjustments;
|
MusicController.AllowRateAdjustments = newOsuScreen.AllowRateAdjustments;
|
||||||
|
|
||||||
|
@ -32,6 +32,11 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Action SearchStarted;
|
public Action SearchStarted;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Any time the search text box receives key events (even while masked).
|
||||||
|
/// </summary>
|
||||||
|
public Action TypingStarted;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// True when pagination has reached the end of available results.
|
/// True when pagination has reached the end of available results.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -82,7 +87,10 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
Radius = 3,
|
Radius = 3,
|
||||||
Offset = new Vector2(0f, 1f),
|
Offset = new Vector2(0f, 1f),
|
||||||
},
|
},
|
||||||
Child = searchControl = new BeatmapListingSearchControl(),
|
Child = searchControl = new BeatmapListingSearchControl
|
||||||
|
{
|
||||||
|
TypingStarted = () => TypingStarted?.Invoke()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
// 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;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -19,6 +21,11 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
{
|
{
|
||||||
public class BeatmapListingSearchControl : CompositeDrawable
|
public class BeatmapListingSearchControl : CompositeDrawable
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Any time the text box receives key events (even while masked).
|
||||||
|
/// </summary>
|
||||||
|
public Action TypingStarted;
|
||||||
|
|
||||||
public Bindable<string> Query => textBox.Current;
|
public Bindable<string> Query => textBox.Current;
|
||||||
|
|
||||||
public Bindable<RulesetInfo> Ruleset => modeFilter.Current;
|
public Bindable<RulesetInfo> Ruleset => modeFilter.Current;
|
||||||
@ -102,6 +109,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
textBox = new BeatmapSearchTextBox
|
textBox = new BeatmapSearchTextBox
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
|
TypingStarted = () => TypingStarted?.Invoke(),
|
||||||
},
|
},
|
||||||
new ReverseChildIDFillFlowContainer<Drawable>
|
new ReverseChildIDFillFlowContainer<Drawable>
|
||||||
{
|
{
|
||||||
@ -138,12 +146,26 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
|
|
||||||
private class BeatmapSearchTextBox : SearchTextBox
|
private class BeatmapSearchTextBox : SearchTextBox
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Any time the text box receives key events (even while masked).
|
||||||
|
/// </summary>
|
||||||
|
public Action TypingStarted;
|
||||||
|
|
||||||
protected override Color4 SelectionColour => Color4.Gray;
|
protected override Color4 SelectionColour => Color4.Gray;
|
||||||
|
|
||||||
public BeatmapSearchTextBox()
|
public BeatmapSearchTextBox()
|
||||||
{
|
{
|
||||||
PlaceholderText = @"type in keywords...";
|
PlaceholderText = @"type in keywords...";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
|
{
|
||||||
|
if (!base.OnKeyDown(e))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
TypingStarted?.Invoke();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,7 @@ namespace osu.Game.Overlays
|
|||||||
Header,
|
Header,
|
||||||
filterControl = new BeatmapListingFilterControl
|
filterControl = new BeatmapListingFilterControl
|
||||||
{
|
{
|
||||||
|
TypingStarted = onTypingStarted,
|
||||||
SearchStarted = onSearchStarted,
|
SearchStarted = onSearchStarted,
|
||||||
SearchFinished = onSearchFinished,
|
SearchFinished = onSearchFinished,
|
||||||
},
|
},
|
||||||
@ -102,6 +103,12 @@ namespace osu.Game.Overlays
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onTypingStarted()
|
||||||
|
{
|
||||||
|
// temporary until the textbox/header is updated to always stay on screen.
|
||||||
|
resultScrollContainer.ScrollToStart();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnFocus(FocusEvent e)
|
protected override void OnFocus(FocusEvent e)
|
||||||
{
|
{
|
||||||
base.OnFocus(e);
|
base.OnFocus(e);
|
||||||
|
@ -110,7 +110,11 @@ namespace osu.Game.Overlays.Dashboard
|
|||||||
User = user;
|
User = user;
|
||||||
|
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(IAPIProvider api)
|
||||||
|
{
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
@ -121,7 +125,7 @@ namespace osu.Game.Overlays.Dashboard
|
|||||||
Width = 290,
|
Width = 290,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new UserGridPanel(user)
|
new UserGridPanel(User)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
@ -133,7 +137,8 @@ namespace osu.Game.Overlays.Dashboard
|
|||||||
Text = "Watch",
|
Text = "Watch",
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Action = () => game?.PerformFromScreen(s => s.Push(new Spectator(user)))
|
Action = () => game?.PerformFromScreen(s => s.Push(new Spectator(User))),
|
||||||
|
Enabled = { Value = User.Id != api.LocalUser.Value.Id }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -303,7 +303,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
{
|
{
|
||||||
if (blueprint.IsHovered)
|
if (blueprint.IsHovered)
|
||||||
{
|
{
|
||||||
selectedPerformed &= SelectionHandler.HandleSelectionRequested(blueprint, e.CurrentState);
|
selectedPerformed &= SelectionHandler.HandleSelectionRequested(blueprint, e);
|
||||||
clickSelectionBegan = true;
|
clickSelectionBegan = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.Input.States;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@ -218,17 +218,17 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// Handle a blueprint requesting selection.
|
/// Handle a blueprint requesting selection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="blueprint">The blueprint.</param>
|
/// <param name="blueprint">The blueprint.</param>
|
||||||
/// <param name="state">The input state at the point of selection.</param>
|
/// <param name="e">The mouse event responsible for selection.</param>
|
||||||
/// <returns>Whether a selection was performed.</returns>
|
/// <returns>Whether a selection was performed.</returns>
|
||||||
internal bool HandleSelectionRequested(SelectionBlueprint blueprint, InputState state)
|
internal bool HandleSelectionRequested(SelectionBlueprint blueprint, MouseButtonEvent e)
|
||||||
{
|
{
|
||||||
if (state.Keyboard.ShiftPressed && state.Mouse.IsPressed(MouseButton.Right))
|
if (e.ShiftPressed && e.Button == MouseButton.Right)
|
||||||
{
|
{
|
||||||
handleQuickDeletion(blueprint);
|
handleQuickDeletion(blueprint);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.Keyboard.ControlPressed && state.Mouse.IsPressed(MouseButton.Left))
|
if (e.ControlPressed && e.Button == MouseButton.Left)
|
||||||
blueprint.ToggleSelection();
|
blueprint.ToggleSelection();
|
||||||
else
|
else
|
||||||
ensureSelected(blueprint);
|
ensureSelected(blueprint);
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Screens;
|
|||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Screens
|
namespace osu.Game.Screens
|
||||||
{
|
{
|
||||||
@ -43,6 +44,11 @@ namespace osu.Game.Screens
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
IBindable<OverlayActivation> OverlayActivationMode { get; }
|
IBindable<OverlayActivation> OverlayActivationMode { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The current <see cref="UserActivity"/> for this screen.
|
||||||
|
/// </summary>
|
||||||
|
IBindable<UserActivity> Activity { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The amount of parallax to be applied while this screen is displayed.
|
/// The amount of parallax to be applied while this screen is displayed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -14,6 +14,7 @@ using osu.Game.Online.Multiplayer;
|
|||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Screens.Multi.Lounge.Components;
|
using osu.Game.Screens.Multi.Lounge.Components;
|
||||||
using osu.Game.Screens.Multi.Match;
|
using osu.Game.Screens.Multi.Match;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Multi.Lounge
|
namespace osu.Game.Screens.Multi.Lounge
|
||||||
{
|
{
|
||||||
@ -24,6 +25,8 @@ namespace osu.Game.Screens.Multi.Lounge
|
|||||||
|
|
||||||
protected FilterControl Filter;
|
protected FilterControl Filter;
|
||||||
|
|
||||||
|
protected override UserActivity InitialActivity => new UserActivity.SearchingForLobby();
|
||||||
|
|
||||||
private readonly Bindable<bool> initialRoomsReceived = new Bindable<bool>();
|
private readonly Bindable<bool> initialRoomsReceived = new Bindable<bool>();
|
||||||
|
|
||||||
private Container content;
|
private Container content;
|
||||||
|
@ -21,6 +21,7 @@ using osu.Game.Screens.Multi.Play;
|
|||||||
using osu.Game.Screens.Multi.Ranking;
|
using osu.Game.Screens.Multi.Ranking;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using osu.Game.Screens.Select;
|
using osu.Game.Screens.Select;
|
||||||
|
using osu.Game.Users;
|
||||||
using Footer = osu.Game.Screens.Multi.Match.Components.Footer;
|
using Footer = osu.Game.Screens.Multi.Match.Components.Footer;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Multi.Match
|
namespace osu.Game.Screens.Multi.Match
|
||||||
@ -60,6 +61,7 @@ namespace osu.Game.Screens.Multi.Match
|
|||||||
public MatchSubScreen(Room room)
|
public MatchSubScreen(Room room)
|
||||||
{
|
{
|
||||||
Title = room.RoomID.Value == null ? "New room" : room.Name.Value;
|
Title = room.RoomID.Value == null ? "New room" : room.Name.Value;
|
||||||
|
Activity.Value = new UserActivity.InLobby(room);
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
@ -24,6 +24,7 @@ using osu.Game.Screens.Multi.Lounge;
|
|||||||
using osu.Game.Screens.Multi.Lounge.Components;
|
using osu.Game.Screens.Multi.Lounge.Components;
|
||||||
using osu.Game.Screens.Multi.Match;
|
using osu.Game.Screens.Multi.Match;
|
||||||
using osu.Game.Screens.Multi.Match.Components;
|
using osu.Game.Screens.Multi.Match.Components;
|
||||||
|
using osu.Game.Users;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Multi
|
namespace osu.Game.Screens.Multi
|
||||||
@ -140,10 +141,10 @@ namespace osu.Game.Screens.Multi
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
screenStack.Push(loungeSubScreen = new LoungeSubScreen());
|
|
||||||
|
|
||||||
screenStack.ScreenPushed += screenPushed;
|
screenStack.ScreenPushed += screenPushed;
|
||||||
screenStack.ScreenExited += screenExited;
|
screenStack.ScreenExited += screenExited;
|
||||||
|
|
||||||
|
screenStack.Push(loungeSubScreen = new LoungeSubScreen());
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly IBindable<APIState> apiState = new Bindable<APIState>();
|
private readonly IBindable<APIState> apiState = new Bindable<APIState>();
|
||||||
@ -311,18 +312,18 @@ namespace osu.Game.Screens.Multi
|
|||||||
|
|
||||||
private void screenPushed(IScreen lastScreen, IScreen newScreen)
|
private void screenPushed(IScreen lastScreen, IScreen newScreen)
|
||||||
{
|
{
|
||||||
subScreenChanged(newScreen);
|
subScreenChanged(lastScreen, newScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void screenExited(IScreen lastScreen, IScreen newScreen)
|
private void screenExited(IScreen lastScreen, IScreen newScreen)
|
||||||
{
|
{
|
||||||
subScreenChanged(newScreen);
|
subScreenChanged(lastScreen, newScreen);
|
||||||
|
|
||||||
if (screenStack.CurrentScreen == null && this.IsCurrentScreen())
|
if (screenStack.CurrentScreen == null && this.IsCurrentScreen())
|
||||||
this.Exit();
|
this.Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void subScreenChanged(IScreen newScreen)
|
private void subScreenChanged(IScreen lastScreen, IScreen newScreen)
|
||||||
{
|
{
|
||||||
switch (newScreen)
|
switch (newScreen)
|
||||||
{
|
{
|
||||||
@ -337,6 +338,12 @@ namespace osu.Game.Screens.Multi
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lastScreen is IOsuScreen lastOsuScreen)
|
||||||
|
Activity.UnbindFrom(lastOsuScreen.Activity);
|
||||||
|
|
||||||
|
if (newScreen is IOsuScreen newOsuScreen)
|
||||||
|
((IBindable<UserActivity>)Activity).BindTo(newOsuScreen.Activity);
|
||||||
|
|
||||||
updatePollingRate(isIdle.Value);
|
updatePollingRate(isIdle.Value);
|
||||||
createButton.FadeTo(newScreen is LoungeSubScreen ? 1 : 0, 200);
|
createButton.FadeTo(newScreen is LoungeSubScreen ? 1 : 0, 200);
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ using osu.Game.Rulesets;
|
|||||||
using osu.Game.Screens.Menu;
|
using osu.Game.Screens.Menu;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
using osu.Game.Online.API;
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
namespace osu.Game.Screens
|
namespace osu.Game.Screens
|
||||||
@ -57,28 +56,18 @@ namespace osu.Game.Screens
|
|||||||
protected new OsuGameBase Game => base.Game as OsuGameBase;
|
protected new OsuGameBase Game => base.Game as OsuGameBase;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The <see cref="UserActivity"/> to set the user's activity automatically to when this screen is entered
|
/// The <see cref="UserActivity"/> to set the user's activity automatically to when this screen is entered.
|
||||||
/// <para>This <see cref="Activity"/> will be automatically set to <see cref="InitialActivity"/> for this screen on entering unless
|
/// <para>This <see cref="Activity"/> will be automatically set to <see cref="InitialActivity"/> for this screen on entering for the first time
|
||||||
/// <see cref="Activity"/> is manually set before.</para>
|
/// unless <see cref="Activity"/> is manually set before.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual UserActivity InitialActivity => null;
|
protected virtual UserActivity InitialActivity => null;
|
||||||
|
|
||||||
private UserActivity activity;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current <see cref="UserActivity"/> for this screen.
|
/// The current <see cref="UserActivity"/> for this screen.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected UserActivity Activity
|
protected readonly Bindable<UserActivity> Activity = new Bindable<UserActivity>();
|
||||||
{
|
|
||||||
get => activity;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value == activity) return;
|
|
||||||
|
|
||||||
activity = value;
|
IBindable<UserActivity> IOsuScreen.Activity => Activity;
|
||||||
updateActivity();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether to disallow changes to game-wise Beatmap/Ruleset bindables for this screen (and all children).
|
/// Whether to disallow changes to game-wise Beatmap/Ruleset bindables for this screen (and all children).
|
||||||
@ -135,9 +124,6 @@ namespace osu.Game.Screens
|
|||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
private OsuLogo logo { get; set; }
|
private OsuLogo logo { get; set; }
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
|
||||||
private IAPIProvider api { get; set; }
|
|
||||||
|
|
||||||
protected OsuScreen()
|
protected OsuScreen()
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
@ -150,6 +136,8 @@ namespace osu.Game.Screens
|
|||||||
private void load(OsuGame osu, AudioManager audio)
|
private void load(OsuGame osu, AudioManager audio)
|
||||||
{
|
{
|
||||||
sampleExit = audio.Samples.Get(@"UI/screen-back");
|
sampleExit = audio.Samples.Get(@"UI/screen-back");
|
||||||
|
|
||||||
|
Activity.Value ??= InitialActivity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnResuming(IScreen last)
|
public override void OnResuming(IScreen last)
|
||||||
@ -158,8 +146,6 @@ namespace osu.Game.Screens
|
|||||||
sampleExit?.Play();
|
sampleExit?.Play();
|
||||||
applyArrivingDefaults(true);
|
applyArrivingDefaults(true);
|
||||||
|
|
||||||
updateActivity();
|
|
||||||
|
|
||||||
base.OnResuming(last);
|
base.OnResuming(last);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,9 +162,6 @@ namespace osu.Game.Screens
|
|||||||
|
|
||||||
backgroundStack?.Push(localBackground = CreateBackground());
|
backgroundStack?.Push(localBackground = CreateBackground());
|
||||||
|
|
||||||
if (activity == null)
|
|
||||||
Activity = InitialActivity;
|
|
||||||
|
|
||||||
base.OnEntering(last);
|
base.OnEntering(last);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,12 +179,6 @@ namespace osu.Game.Screens
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateActivity()
|
|
||||||
{
|
|
||||||
if (api != null)
|
|
||||||
api.Activity.Value = activity;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fired when this screen was entered or resumed and the logo state is required to be adjusted.
|
/// Fired when this screen was entered or resumed and the logo state is required to be adjusted.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -80,7 +80,7 @@ namespace osu.Game.Skinning
|
|||||||
Math.Clamp(Clock.ElapsedFrameTime, 0, 200),
|
Math.Clamp(Clock.ElapsedFrameTime, 0, 200),
|
||||||
fill.Width, (float)Current.Value * maxFillWidth, 0, 200, Easing.OutQuint);
|
fill.Width, (float)Current.Value * maxFillWidth, 0, 200, Easing.OutQuint);
|
||||||
|
|
||||||
marker.Position = fill.Position + new Vector2(fill.DrawWidth, fill.DrawHeight / 2);
|
marker.Position = fill.Position + new Vector2(fill.DrawWidth, isNewStyle ? fill.DrawHeight / 2 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Flash(JudgementResult result) => marker.Flash(result);
|
public void Flash(JudgementResult result) => marker.Flash(result);
|
||||||
|
@ -186,7 +186,7 @@ namespace osu.Game.Users
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonProperty(@"rankHistory")]
|
[JsonProperty(@"rank_history")]
|
||||||
private RankHistoryData rankHistory
|
private RankHistoryData rankHistory
|
||||||
{
|
{
|
||||||
set => statistics.RankHistory = value;
|
set => statistics.RankHistory = value;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -61,9 +62,21 @@ namespace osu.Game.Users
|
|||||||
public override string Status => @"Spectating a game";
|
public override string Status => @"Spectating a game";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class SearchingForLobby : UserActivity
|
||||||
|
{
|
||||||
|
public override string Status => @"Looking for a lobby";
|
||||||
|
}
|
||||||
|
|
||||||
public class InLobby : UserActivity
|
public class InLobby : UserActivity
|
||||||
{
|
{
|
||||||
public override string Status => @"In a multiplayer lobby";
|
public override string Status => @"In a multiplayer lobby";
|
||||||
|
|
||||||
|
public readonly Room Room;
|
||||||
|
|
||||||
|
public InLobby(Room room)
|
||||||
|
{
|
||||||
|
Room = room;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user