View model improvements, load world checkpoints for more config options

This commit is contained in:
John Gross
2017-12-03 09:34:28 -08:00
parent 930f1d43e0
commit 1be1c938cc
25 changed files with 1284 additions and 602 deletions

View File

@@ -136,7 +136,7 @@ namespace Torch.Commands
{
Task.Run(() =>
{
var countdown = RestartCountdown(countdownSeconds).GetEnumerator();
var countdown = RestartCountdown(countdownSeconds, save).GetEnumerator();
while (countdown.MoveNext())
{
Thread.Sleep(1000);
@@ -144,7 +144,7 @@ namespace Torch.Commands
});
}
private IEnumerable RestartCountdown(int countdown)
private IEnumerable RestartCountdown(int countdown, bool save)
{
for (var i = countdown; i >= 0; i--)
{
@@ -163,10 +163,16 @@ namespace Torch.Commands
}
else
{
Context.Torch.Restart();
if (save)
Context.Torch.Save(Context.Player?.IdentityId ?? 0).ContinueWith(x => Restart());
else
Restart();
yield break;
}
}
void Restart() => Context.Torch.Invoke(() => Context.Torch.Restart());
}
private string Pluralize(int num)