Compare commits

..

1 Commits

Author SHA1 Message Date
5189257935 Merge pull request 'savya' (#14) from savya into main
Reviewed-on: #14
2026-07-07 09:55:44 +02:00
4 changed files with 76 additions and 1986 deletions

View File

@@ -46,7 +46,6 @@ namespace Darkmatter.Features.GameplayFlow.Systems
private string _templateId;
private DrawingPhase _phase = DrawingPhase.ShapeBuilding;
private bool _allContentReported;
private bool _navigating;
private float _lastThumbnailTime = float.NegativeInfinity;
private IDisposable _assembledSub;
@@ -166,13 +165,6 @@ namespace Darkmatter.Features.GameplayFlow.Systems
}
public async UniTask BackAsync(CancellationToken ct)
{
// A second navigation while one runs (e.g. Back pressed during the completion
// animation inside NextAsync) would interleave two saves and two Colorbook loads,
// and Clear() would rip the celebration apart mid-flight. First navigation wins.
if (_navigating) return;
_navigating = true;
try
{
await SaveCurrentAsync(CancellationToken.None);
_loadingScreen.Show();
@@ -181,11 +173,6 @@ namespace Darkmatter.Features.GameplayFlow.Systems
await _scenes.LoadSceneAsync(nameof(GameScene.Colorbook), progress: null, cancellationToken: ct);
await _scenes.UnloadSceneAsync(nameof(GameScene.Gameplay), progress: null, cancellationToken: ct);
}
finally
{
_navigating = false;
}
}
public async UniTask SaveAsync(CancellationToken ct)
{
@@ -196,10 +183,6 @@ namespace Darkmatter.Features.GameplayFlow.Systems
}
public async UniTask NextAsync(CancellationToken ct)
{
if (_navigating) return;
_navigating = true;
try
{
// Drop any debounced autosave so it can't fire during/after the completion
// animation and capture the animation (or an empty paper) into the thumbnail.
@@ -227,19 +210,23 @@ namespace Darkmatter.Features.GameplayFlow.Systems
}
var nextId = _catalog.GetNextTemplate(_templateId);
if (string.IsNullOrEmpty(nextId))
{
_loadingScreen.Show();
_shapeBuilder.Clear();
_coloring.Clear();
await _scenes.LoadSceneAsync(nameof(GameScene.Colorbook), progress: null, cancellationToken: default);
await _scenes.UnloadSceneAsync(nameof(GameScene.Gameplay), progress: null, cancellationToken: default);
return;
}
_loadingScreen.Show();
_shapeBuilder.Clear();
_coloring.Clear();
await _scenes.LoadSceneAsync(nameof(GameScene.Colorbook), progress: null, cancellationToken: default);
await _scenes.UnloadSceneAsync(nameof(GameScene.Gameplay), progress: null, cancellationToken: default);
if (!string.IsNullOrEmpty(nextId))
_bus.Publish(new DrawingSelectedSignal(nextId));
}
finally
{
_navigating = false;
}
}
private void OnShapeAssembled(ShapeAssembledSignal signal)
@@ -282,10 +269,6 @@ namespace Darkmatter.Features.GameplayFlow.Systems
}
private async UniTaskVoid EditAsync(string newTemplateId)
{
if (_navigating) return;
_navigating = true;
try
{
await SaveCurrentAsync(CancellationToken.None);
_loadingScreen.Show();
@@ -295,11 +278,6 @@ namespace Darkmatter.Features.GameplayFlow.Systems
await _scenes.UnloadSceneAsync(nameof(GameScene.Gameplay), progress: null, cancellationToken: default);
_bus.Publish(new DrawingSelectedSignal(newTemplateId));
}
finally
{
_navigating = false;
}
}
private async UniTaskVoid DebouncedAutosaveAsync(CancellationToken ct)
{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long