From 1e48bd16b37a64613394ad934d47ae6ad9e256ce Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Thu, 26 Nov 2020 22:20:14 +0100 Subject: [PATCH] Erase pads instead of clearing them, fixes #21 --- squirrelbattle/display/logsdisplay.py | 2 +- squirrelbattle/display/mapdisplay.py | 2 +- squirrelbattle/display/menudisplay.py | 2 +- squirrelbattle/display/statsdisplay.py | 2 +- squirrelbattle/game.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/squirrelbattle/display/logsdisplay.py b/squirrelbattle/display/logsdisplay.py index d332b69..43a18dc 100644 --- a/squirrelbattle/display/logsdisplay.py +++ b/squirrelbattle/display/logsdisplay.py @@ -15,7 +15,7 @@ class LogsDisplay(Display): print(type(self.logs.messages), flush=True) messages = self.logs.messages[-self.height:] messages = messages[::-1] - self.pad.clear() + self.pad.erase() for i in range(min(self.height, len(messages))): self.addstr(self.pad, self.height - i - 1, self.x, messages[i][:self.width]) diff --git a/squirrelbattle/display/mapdisplay.py b/squirrelbattle/display/mapdisplay.py index ae4caa3..9599a54 100644 --- a/squirrelbattle/display/mapdisplay.py +++ b/squirrelbattle/display/mapdisplay.py @@ -42,7 +42,7 @@ class MapDisplay(Display): pminrow = max(0, min(self.map.height, pminrow)) pmincol = max(0, min(self.pack.tile_width * self.map.width, pmincol)) - self.pad.clear() + self.pad.erase() self.update_pad() self.refresh_pad(self.pad, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol) diff --git a/squirrelbattle/display/menudisplay.py b/squirrelbattle/display/menudisplay.py index 2338e0d..b04ac37 100644 --- a/squirrelbattle/display/menudisplay.py +++ b/squirrelbattle/display/menudisplay.py @@ -35,7 +35,7 @@ class MenuDisplay(Display): # Menu box self.menubox.refresh(self.y, self.x, self.height, self.width) - self.pad.clear() + self.pad.erase() self.update_pad() self.refresh_pad(self.pad, cornery, 0, self.y + 1, self.x + 2, self.height - 2 + self.y, diff --git a/squirrelbattle/display/statsdisplay.py b/squirrelbattle/display/statsdisplay.py index 988d99c..d33f55c 100644 --- a/squirrelbattle/display/statsdisplay.py +++ b/squirrelbattle/display/statsdisplay.py @@ -38,7 +38,7 @@ class StatsDisplay(Display): | self.color_pair(3)) def display(self) -> None: - self.pad.clear() + self.pad.erase() self.update_pad() self.refresh_pad(self.pad, 0, 0, self.y, self.x, self.y + self.height - 1, self.width + self.x - 1) diff --git a/squirrelbattle/game.py b/squirrelbattle/game.py index 0bb3024..dce1165 100644 --- a/squirrelbattle/game.py +++ b/squirrelbattle/game.py @@ -55,7 +55,7 @@ class Game: when the given key gets pressed. """ while True: # pragma no cover - screen.clear() + screen.erase() screen.refresh() self.display_actions(DisplayActions.REFRESH) key = screen.getkey()