Replays: final boss (#17621)
* Replays: final boss * Undo formatting change in EntryPoint
This commit is contained in:
committed by
GitHub
parent
204f6ca5c2
commit
bbd8ce8885
@@ -27,12 +27,16 @@ using Content.Shared.Localizations;
|
||||
using Robust.Client;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Input;
|
||||
using Robust.Client.Replays.Loading;
|
||||
using Robust.Client.Replays.Playback;
|
||||
using Robust.Client.State;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Shared;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.ContentPack;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Replays;
|
||||
|
||||
namespace Content.Client.Entry
|
||||
{
|
||||
@@ -64,6 +68,9 @@ namespace Content.Client.Entry
|
||||
[Dependency] private readonly JobRequirementsManager _jobRequirements = default!;
|
||||
[Dependency] private readonly ContentLocalizationManager _contentLoc = default!;
|
||||
[Dependency] private readonly ContentReplayPlaybackManager _playbackMan = default!;
|
||||
[Dependency] private readonly IResourceManager _resourceManager = default!;
|
||||
[Dependency] private readonly IReplayLoadManager _replayLoad = default!;
|
||||
[Dependency] private readonly ILogManager _logManager = default!;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
@@ -183,7 +190,20 @@ namespace Content.Client.Entry
|
||||
{
|
||||
// Fire off into state dependent on launcher or not.
|
||||
|
||||
if (_gameController.LaunchState.FromLauncher)
|
||||
// Check if we're loading a replay via content bundle!
|
||||
if (_configManager.GetCVar(CVars.LaunchContentBundle)
|
||||
&& _resourceManager.ContentFileExists(
|
||||
ReplayConstants.ReplayZipFolder.ToRootedPath() / ReplayConstants.FileMeta))
|
||||
{
|
||||
_logManager.GetSawmill("entry").Info("Loading content bundle replay from VFS!");
|
||||
|
||||
var reader = new ReplayFileReaderResources(
|
||||
_resourceManager,
|
||||
ReplayConstants.ReplayZipFolder.ToRootedPath());
|
||||
|
||||
_replayLoad.LoadAndStartReplay(reader);
|
||||
}
|
||||
else if (_gameController.LaunchState.FromLauncher)
|
||||
{
|
||||
_stateManager.RequestStateChange<LauncherConnecting>();
|
||||
var state = (LauncherConnecting) _stateManager.CurrentState;
|
||||
|
||||
@@ -59,10 +59,10 @@ public sealed class ContentReplayPlaybackManager
|
||||
_loadMan.LoadOverride += LoadOverride;
|
||||
}
|
||||
|
||||
private void LoadOverride(IWritableDirProvider dir, ResPath resPath)
|
||||
private void LoadOverride(IReplayFileReader fileReader)
|
||||
{
|
||||
var screen = _stateMan.RequestStateChange<LoadingScreen<bool>>();
|
||||
screen.Job = new ContentLoadReplayJob(1/60f, dir, resPath, _loadMan, screen);
|
||||
screen.Job = new ContentLoadReplayJob(1/60f, fileReader, _loadMan, screen);
|
||||
screen.OnJobFinished += (_, e) => OnFinishedLoading(e);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,11 +12,10 @@ public sealed class ContentLoadReplayJob : LoadReplayJob
|
||||
|
||||
public ContentLoadReplayJob(
|
||||
float maxTime,
|
||||
IWritableDirProvider dir,
|
||||
ResPath path,
|
||||
IReplayFileReader fileReader,
|
||||
IReplayLoadManager loadMan,
|
||||
LoadingScreen<bool> screen)
|
||||
: base(maxTime, dir, path, loadMan)
|
||||
: base(maxTime, fileReader, loadMan)
|
||||
{
|
||||
_screen = screen;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user