Realy made window closable
This commit is contained in:
parent
533a74c4fa
commit
c17cef8bfe
1 changed files with 3 additions and 2 deletions
|
|
@ -79,11 +79,12 @@ def main_loop() -> None:
|
|||
while g.screens:
|
||||
main_draw()
|
||||
for event in tcod.event.wait():
|
||||
if event.type == 'WindowClose':
|
||||
raise SystemExit()
|
||||
tile_event = g.context.convert_event(event)
|
||||
if g.screens:
|
||||
_apply_screen_result(g.screens[-1].on_event(tile_event))
|
||||
if isinstance(event, tcod.event.Quit):
|
||||
g.screens.pop()
|
||||
|
||||
|
||||
def get_previous_screen(screen: Screen) -> Screen | None:
|
||||
"""Return the screen before `screen` in the stack if it exists."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue