fixt pop up box about unsaved porgrass

This commit is contained in:
Björn Blomberg
2025-10-17 15:58:42 +02:00
parent ed4ce28921
commit 099110cdb7
6 changed files with 101 additions and 20 deletions

View File

@@ -108,12 +108,18 @@ namespace TheGame
public override void _Input(InputEvent @event)
{
if (!IsInsideTree())
return;
if (@event is InputEventKey keyEvent && keyEvent.Pressed)
{
if (keyEvent.Keycode == Key.Escape)
{
OnCancelPressed();
GetViewport().SetInputAsHandled();
if (IsInsideTree())
{
GetViewport().SetInputAsHandled();
}
}
}
}