diff --git a/squirrelbattle/display/display.py b/squirrelbattle/display/display.py index d1ead44..0cdba98 100644 --- a/squirrelbattle/display/display.py +++ b/squirrelbattle/display/display.py @@ -91,17 +91,18 @@ class HorizontalSplit(Display): self.pad.addstr(0, i, "━") self.pad.refresh(0, 0, self.y, self.x, self.y, self.x + self.width - 1) + class Box(Display): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.pad = self.newpad(self.rows, self.cols) - + def display(self) -> None: self.pad.addstr(0, 0, "┏" + "━" * (self.width - 2) + "┓") for i in range(1, self.height - 1): self.pad.addstr(i, 0, "┃") self.pad.addstr(i, self.width - 1, "┃") - self.pad.addstr(self.height - 1, 0, - "┗" + "━" * (self.width - 2) + "┛") - self.pad.refresh(0, 0, self.y, self.x, self.y + self.height - 1, self.x + self.width - 1) + self.pad.addstr(self.height - 1, 0, "┗" + "━" * (self.width - 2) + "┛") + self.pad.refresh(0, 0, self.y, self.x, self.y + self.height - 1, + self.x + self.width - 1) diff --git a/squirrelbattle/display/menudisplay.py b/squirrelbattle/display/menudisplay.py index 443722f..3c4e5a1 100644 --- a/squirrelbattle/display/menudisplay.py +++ b/squirrelbattle/display/menudisplay.py @@ -81,7 +81,8 @@ class MainMenuDisplay(Display): for i in range(len(self.title)): self.pad.addstr(4 + i, max(self.width // 2 - len(self.title[0]) // 2 - 1, 0), self.title[i]) - self.pad.refresh(0, 0, self.y, self.x, self.height + self.y - 1, self.width + self.x - 1) + self.pad.refresh(0, 0, self.y, self.x, self.height + self.y - 1, + self.width + self.x - 1) menuwidth = min(self.menudisplay.preferred_width, self.width) menuy, menux = len(self.title) + 8, self.width // 2 - menuwidth // 2 - 1 self.menudisplay.refresh(