mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Fix incorrect usages of Scheduler.AddOnce
This commit is contained in:
@ -60,7 +60,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
config.SetValue(OsuSetting.AutoCursorSize, true);
|
config.SetValue(OsuSetting.AutoCursorSize, true);
|
||||||
gameplayState.Beatmap.Difficulty.CircleSize = val;
|
gameplayState.Beatmap.Difficulty.CircleSize = val;
|
||||||
Scheduler.AddOnce(() => loadContent(false));
|
Scheduler.AddOnce(loadContent);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("test cursor container", () => loadContent(false));
|
AddStep("test cursor container", () => loadContent(false));
|
||||||
@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
AddStep($"adjust cs to {circleSize}", () => gameplayState.Beatmap.Difficulty.CircleSize = circleSize);
|
AddStep($"adjust cs to {circleSize}", () => gameplayState.Beatmap.Difficulty.CircleSize = circleSize);
|
||||||
AddStep("turn on autosizing", () => config.SetValue(OsuSetting.AutoCursorSize, true));
|
AddStep("turn on autosizing", () => config.SetValue(OsuSetting.AutoCursorSize, true));
|
||||||
|
|
||||||
AddStep("load content", () => loadContent());
|
AddStep("load content", loadContent);
|
||||||
|
|
||||||
AddUntilStep("cursor size correct", () => lastContainer.ActiveCursor.Scale.X == OsuCursorContainer.GetScaleForCircleSize(circleSize) * userScale);
|
AddUntilStep("cursor size correct", () => lastContainer.ActiveCursor.Scale.X == OsuCursorContainer.GetScaleForCircleSize(circleSize) * userScale);
|
||||||
|
|
||||||
@ -98,7 +98,9 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
AddStep("load content", () => loadContent(false, () => new SkinProvidingContainer(new TopLeftCursorSkin())));
|
AddStep("load content", () => loadContent(false, () => new SkinProvidingContainer(new TopLeftCursorSkin())));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadContent(bool automated = true, Func<SkinProvidingContainer> skinProvider = null)
|
private void loadContent() => loadContent(false);
|
||||||
|
|
||||||
|
private void loadContent(bool automated, Func<SkinProvidingContainer> skinProvider = null)
|
||||||
{
|
{
|
||||||
SetContents(_ =>
|
SetContents(_ =>
|
||||||
{
|
{
|
||||||
|
@ -31,10 +31,12 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
progress = value;
|
progress = value;
|
||||||
Scheduler.AddOnce(() => progressBar.Progress = progress);
|
Scheduler.AddOnce(updateProgress, progress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateProgress(float progress) => progressBar.Progress = progress;
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
@ -150,6 +150,11 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
|||||||
notifyRoomsUpdated();
|
notifyRoomsUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void notifyRoomsUpdated() => Scheduler.AddOnce(() => RoomsUpdated?.Invoke());
|
private void notifyRoomsUpdated()
|
||||||
|
{
|
||||||
|
Scheduler.AddOnce(invokeRoomsUpdated);
|
||||||
|
|
||||||
|
void invokeRoomsUpdated() => RoomsUpdated?.Invoke();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,11 +79,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
isConnected.BindTo(client.IsConnected);
|
isConnected.BindTo(client.IsConnected);
|
||||||
isConnected.BindValueChanged(c => Scheduler.AddOnce(() =>
|
isConnected.BindValueChanged(c => Scheduler.AddOnce(poll), true);
|
||||||
{
|
}
|
||||||
if (isConnected.Value && IsLoaded)
|
|
||||||
PollImmediately();
|
private void poll()
|
||||||
}), true);
|
{
|
||||||
|
if (isConnected.Value && IsLoaded)
|
||||||
|
PollImmediately();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Task Poll()
|
protected override Task Poll()
|
||||||
|
Reference in New Issue
Block a user