WIP fixing menu rendering in CLI ASCII mode
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user