mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Update ToLive
usages in line with recent changes
This commit is contained in:
@ -62,7 +62,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
private void load(GameHost host, AudioManager audio)
|
private void load(GameHost host, AudioManager audio)
|
||||||
{
|
{
|
||||||
Dependencies.Cache(rulesets = new RulesetStore(ContextFactory));
|
Dependencies.Cache(rulesets = new RulesetStore(ContextFactory));
|
||||||
Dependencies.Cache(beatmaps = new BeatmapManager(LocalStorage, ContextFactory, rulesets, null, audio, Resources, host, Beatmap.Default));
|
Dependencies.Cache(beatmaps = new BeatmapManager(LocalStorage, ContextFactory, rulesets, API, audio, Resources, host, Beatmap.Default));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetUpSteps()
|
public override void SetUpSteps()
|
||||||
@ -827,7 +827,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
AddStep("join other user", () => client.AddUser(new APIUser { Id = 1234 }));
|
AddStep("join other user", () => client.AddUser(new APIUser { Id = 1234 }));
|
||||||
AddStep("add item as other user", () => client.AddUserPlaylistItem(1234, new MultiplayerPlaylistItem(new PlaylistItem
|
AddStep("add item as other user", () => client.AddUserPlaylistItem(1234, new MultiplayerPlaylistItem(new PlaylistItem
|
||||||
{
|
{
|
||||||
BeatmapID = beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.RulesetID == 0)).BeatmapInfo.OnlineID ?? -1
|
BeatmapID = beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.RulesetID == 0)).BeatmapInfo.OnlineID
|
||||||
})));
|
})));
|
||||||
|
|
||||||
AddUntilStep("item arrived in playlist", () => client.Room?.Playlist.Count == 2);
|
AddUntilStep("item arrived in playlist", () => client.Room?.Playlist.Count == 2);
|
||||||
@ -858,7 +858,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
AddStep("join other user", () => client.AddUser(new APIUser { Id = 1234 }));
|
AddStep("join other user", () => client.AddUser(new APIUser { Id = 1234 }));
|
||||||
AddStep("add item as other user", () => client.AddUserPlaylistItem(1234, new MultiplayerPlaylistItem(new PlaylistItem
|
AddStep("add item as other user", () => client.AddUserPlaylistItem(1234, new MultiplayerPlaylistItem(new PlaylistItem
|
||||||
{
|
{
|
||||||
BeatmapID = beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.RulesetID == 0)).BeatmapInfo.OnlineID ?? -1
|
BeatmapID = beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.RulesetID == 0)).BeatmapInfo.OnlineID
|
||||||
})));
|
})));
|
||||||
|
|
||||||
AddUntilStep("item arrived in playlist", () => client.Room?.Playlist.Count == 2);
|
AddUntilStep("item arrived in playlist", () => client.Room?.Playlist.Count == 2);
|
||||||
|
@ -166,7 +166,7 @@ namespace osu.Game.Beatmaps
|
|||||||
return context.All<BeatmapSetInfo>()
|
return context.All<BeatmapSetInfo>()
|
||||||
.Where(b => !b.DeletePending)
|
.Where(b => !b.DeletePending)
|
||||||
.Where(query)
|
.Where(query)
|
||||||
.ToLive();
|
.ToLive(contextFactory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ namespace osu.Game.Beatmaps
|
|||||||
public ILive<BeatmapSetInfo>? QueryBeatmapSet(Expression<Func<BeatmapSetInfo, bool>> query)
|
public ILive<BeatmapSetInfo>? QueryBeatmapSet(Expression<Func<BeatmapSetInfo, bool>> query)
|
||||||
{
|
{
|
||||||
using (var context = contextFactory.CreateContext())
|
using (var context = contextFactory.CreateContext())
|
||||||
return context.All<BeatmapSetInfo>().FirstOrDefault(query)?.ToLive();
|
return context.All<BeatmapSetInfo>().FirstOrDefault(query)?.ToLive(contextFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -52,7 +52,7 @@ namespace osu.Game.Scoring
|
|||||||
public ILive<ScoreInfo> Query(Expression<Func<ScoreInfo, bool>> query)
|
public ILive<ScoreInfo> Query(Expression<Func<ScoreInfo, bool>> query)
|
||||||
{
|
{
|
||||||
using (var context = contextFactory.CreateContext())
|
using (var context = contextFactory.CreateContext())
|
||||||
return context.All<ScoreInfo>().FirstOrDefault(query)?.ToLive();
|
return context.All<ScoreInfo>().FirstOrDefault(query)?.ToLive(contextFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -82,9 +82,9 @@ namespace osu.Game.Screens.Menu
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config, SkinManager skinManager, BeatmapManager beatmaps, Framework.Game game)
|
private void load(OsuConfigManager config, SkinManager skinManager, BeatmapManager beatmaps, Framework.Game game, RealmContextFactory realmContextFactory)
|
||||||
{
|
{
|
||||||
// prevent user from changing beatmap while the intro is still runnning.
|
// prevent user from changing beatmap while the intro is still running.
|
||||||
beatmap = Beatmap.BeginLease(false);
|
beatmap = Beatmap.BeginLease(false);
|
||||||
|
|
||||||
MenuVoice = config.GetBindable<bool>(OsuSetting.MenuVoice);
|
MenuVoice = config.GetBindable<bool>(OsuSetting.MenuVoice);
|
||||||
@ -101,7 +101,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
if (sets.Count > 0)
|
if (sets.Count > 0)
|
||||||
{
|
{
|
||||||
setInfo = beatmaps.QueryBeatmapSet(s => s.ID == sets[RNG.Next(0, sets.Count - 1)].ID);
|
setInfo = beatmaps.QueryBeatmapSet(s => s.ID == sets[RNG.Next(0, sets.Count - 1)].ID);
|
||||||
initialBeatmap = beatmaps.GetWorkingBeatmap(setInfo?.PerformRead(s => s.Beatmaps[0].ToLive()));
|
initialBeatmap = beatmaps.GetWorkingBeatmap(setInfo?.PerformRead(s => s.Beatmaps[0].ToLive(realmContextFactory)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
if (setInfo == null)
|
if (setInfo == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
initialBeatmap = beatmaps.GetWorkingBeatmap(setInfo.PerformRead(s => s.Beatmaps[0].ToLive()));
|
initialBeatmap = beatmaps.GetWorkingBeatmap(setInfo.PerformRead(s => s.Beatmaps[0].ToLive(realmContextFactory)));
|
||||||
|
|
||||||
return UsingThemedIntro = initialBeatmap != null;
|
return UsingThemedIntro = initialBeatmap != null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user