Erase pads instead of clearing them, fixes #21

This commit is contained in:
Yohann D'ANELLO 2020-11-26 22:20:14 +01:00
parent 3e7dabc94e
commit 1e48bd16b3
5 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ class LogsDisplay(Display):
print(type(self.logs.messages), flush=True) print(type(self.logs.messages), flush=True)
messages = self.logs.messages[-self.height:] messages = self.logs.messages[-self.height:]
messages = messages[::-1] messages = messages[::-1]
self.pad.clear() self.pad.erase()
for i in range(min(self.height, len(messages))): for i in range(min(self.height, len(messages))):
self.addstr(self.pad, self.height - i - 1, self.x, self.addstr(self.pad, self.height - i - 1, self.x,
messages[i][:self.width]) messages[i][:self.width])

View File

@ -42,7 +42,7 @@ class MapDisplay(Display):
pminrow = max(0, min(self.map.height, pminrow)) pminrow = max(0, min(self.map.height, pminrow))
pmincol = max(0, min(self.pack.tile_width * self.map.width, pmincol)) pmincol = max(0, min(self.pack.tile_width * self.map.width, pmincol))
self.pad.clear() self.pad.erase()
self.update_pad() self.update_pad()
self.refresh_pad(self.pad, pminrow, pmincol, sminrow, smincol, smaxrow, self.refresh_pad(self.pad, pminrow, pmincol, sminrow, smincol, smaxrow,
smaxcol) smaxcol)

View File

@ -35,7 +35,7 @@ class MenuDisplay(Display):
# Menu box # Menu box
self.menubox.refresh(self.y, self.x, self.height, self.width) self.menubox.refresh(self.y, self.x, self.height, self.width)
self.pad.clear() self.pad.erase()
self.update_pad() self.update_pad()
self.refresh_pad(self.pad, cornery, 0, self.y + 1, self.x + 2, self.refresh_pad(self.pad, cornery, 0, self.y + 1, self.x + 2,
self.height - 2 + self.y, self.height - 2 + self.y,

View File

@ -38,7 +38,7 @@ class StatsDisplay(Display):
| self.color_pair(3)) | self.color_pair(3))
def display(self) -> None: def display(self) -> None:
self.pad.clear() self.pad.erase()
self.update_pad() self.update_pad()
self.refresh_pad(self.pad, 0, 0, self.y, self.x, self.refresh_pad(self.pad, 0, 0, self.y, self.x,
self.y + self.height - 1, self.width + self.x - 1) self.y + self.height - 1, self.width + self.x - 1)

View File

@ -55,7 +55,7 @@ class Game:
when the given key gets pressed. when the given key gets pressed.
""" """
while True: # pragma no cover while True: # pragma no cover
screen.clear() screen.erase()
screen.refresh() screen.refresh()
self.display_actions(DisplayActions.REFRESH) self.display_actions(DisplayActions.REFRESH)
key = screen.getkey() key = screen.getkey()