summaryrefslogtreecommitdiff
path: root/tui
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-30 09:08:20 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-30 09:08:20 +0200
commit70df24894d1cb0f2897442c64a3b7e460ed6ff78 (patch)
treea73bd3554e6ad42b8c91c6e5aed7a224ad4118d8 /tui
parentdb3fd859e42fb3d6b3c1f98473b54e91d78b74e7 (diff)
Adding level-info on statusline.
Diffstat (limited to 'tui')
-rw-r--r--tui/ansi_draw.py4
-rw-r--r--tui/tui.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/tui/ansi_draw.py b/tui/ansi_draw.py
index dd304d0..143874d 100644
--- a/tui/ansi_draw.py
+++ b/tui/ansi_draw.py
@@ -5,8 +5,8 @@ from .static import TileTypes
class AnsiDraw():
""" AnsiDraw - "piirtelee" näytölle kirjailmilla """
- def __init__(self, height = 15):
- print(end="\n"*height)
+ def __init__(self, height = 9, name = ""):
+ print(end='\n'*height+name+": Peli alkaa.")
def __del__(self):
print()
diff --git a/tui/tui.py b/tui/tui.py
index 3369a61..5514ea3 100644
--- a/tui/tui.py
+++ b/tui/tui.py
@@ -42,7 +42,7 @@ class Tui():
if self.suppress:
self.draw = SuppressDraw()
else:
- self.draw = AnsiDraw(height=self.height)
+ self.draw = AnsiDraw(height=self.height, name=self.level_name)
def matrix_selector(self, matrix, x, y):
""" valinta matriisita """
@@ -78,7 +78,7 @@ class Tui():
self.draw.matrix(matrix, x, y)
self.draw.status_line(
f"{self.level_name}: " +
- f"{'K' if self.suppress else 'Peli ohitse! Kuolit!':<30}"
+ "K " if self.suppress else f"{'Kuolit!':<30}"
)
self.kbd.read_action()
@@ -87,7 +87,7 @@ class Tui():
self.draw.matrix(matrix, x, y)
self.draw.status_line(
f"{self.level_name}: " +
- f"{'V' if self.suppress else 'Peli ohitse! Voitit!':<30}"
+ "V " if self.suppress else "{'Voitit!':<30}"
)
self.kbd.read_action()