feat: Add quit callback support to engine and UI components

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-20 10:04:01 +01:00
parent 9b053e1c02
commit e060aef3f1
5 changed files with 59 additions and 3 deletions

View File

@@ -61,6 +61,7 @@ void main() async {
),
input: CliInput(),
onGameWon: () => stopAndExit(0),
onQuit: () => stopAndExit(0),
);
engine.init();

View File

@@ -45,6 +45,9 @@ class _GameScreenState extends State<GameScreen> {
widget.wolf3d.clearActiveDifficulty();
Navigator.of(context).pop();
},
onQuit: () {
SystemNavigator.pop();
},
);
}