WIP pushing menu to game engine - improving menu text clarity in ASCII mode

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-18 12:45:04 +01:00
parent e39dfd5da0
commit dc1acb7a2f
9 changed files with 284 additions and 463 deletions

View File

@@ -37,13 +37,12 @@ class _GameScreenState extends State<GameScreen> {
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
if (_engine.isDifficultySelectionPending) {
return PopScope<Object?>(
canPop: _engine.difficulty != null,
onPopInvokedWithResult: (didPop, result) {
if (!didPop && _engine.difficulty == null) {
widget.wolf3d.input.queueBackAction();
return false;
}
return true;
},
child: Scaffold(
body: LayoutBuilder(
@@ -55,7 +54,7 @@ class _GameScreenState extends State<GameScreen> {
return Listener(
onPointerDown: (event) {
widget.wolf3d.input.onPointerDown(event);
if (_engine.isDifficultySelectionPending &&
if (_engine.difficulty == null &&
viewportRect.width > 0 &&
viewportRect.height > 0 &&
viewportRect.contains(event.localPosition)) {