Skip to content

Commit 8b7888f

Browse files
committed
Fix 'return to main menu', 'quit', and 'load' not working in choices
- Not all chapters are broken in the same way - See #106 - See 07th-mod/higurashi-rei#2 (comment) - This was semi-applied in Rei (5796215), but it did not fix loading during a choice, and had some issues, so I'm going to revert that in Rei
1 parent 2c738f9 commit 8b7888f

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Assets.Scripts.Core/GameSystem.cs

+11-2
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,17 @@ public void CloseChoiceIfExists()
492492
{
493493
if (ChoiceController != null)
494494
{
495-
ChoiceController.Destroy();
496-
ChoiceController = null;
495+
if (GameSystem.Instance.GameState == GameState.ChoiceScreen)
496+
{
497+
// If you're currently on the choice screen, then cleanly leave the choices state and delete the choice controller
498+
LeaveChoices();
499+
}
500+
else
501+
{
502+
// If you're on another screen layered ontop of the choice screen (eg the load screen), just delete the choice controller and hope for the best.
503+
ChoiceController.Destroy();
504+
ChoiceController = null;
505+
}
497506
}
498507
}
499508

Assets.Scripts.UI.Menu/MenuUIButton.cs

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ private void OnClick()
5151
gameSystem.PopStateStack();
5252
GameSystem.Instance.PushStateObject(new StateDialogPrompt(PromptType.DialogTitle, delegate
5353
{
54+
gameSystem.CloseChoiceIfExists();
5455
gameSystem.ClearActions();
5556
gameSystem.ClearAllWaits();
5657
gameSystem.TextController.ClearText();
@@ -74,6 +75,7 @@ private void OnClick()
7475
gameSystem.PopStateStack();
7576
GameSystem.Instance.PushStateObject(new StateDialogPrompt(PromptType.DialogExit, delegate
7677
{
78+
gameSystem.CloseChoiceIfExists();
7779
gameSystem.CanExit = true;
7880
Application.Quit();
7981
}, delegate

0 commit comments

Comments
 (0)