WIP fixing menu rendering in CLI ASCII mode

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-18 14:08:21 +01:00
parent dc1acb7a2f
commit 839fae700f
8 changed files with 413 additions and 301 deletions

View File

@@ -31,15 +31,19 @@ class _GameScreenState extends State<GameScreen> {
void initState() {
super.initState();
_engine = widget.wolf3d.launchEngine(
onGameWon: () => Navigator.of(context).pop(),
onGameWon: () {
_engine.difficulty = null;
widget.wolf3d.clearActiveDifficulty();
Navigator.of(context).pop();
},
);
}
@override
Widget build(BuildContext context) {
return PopScope<Object?>(
return PopScope(
canPop: _engine.difficulty != null,
onPopInvokedWithResult: (didPop, result) {
onPopInvokedWithResult: (didPop, _) {
if (!didPop && _engine.difficulty == null) {
widget.wolf3d.input.queueBackAction();
}