From 07250230943a5fdfd7961063478523ee948710f4 Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 6 Nov 2017 21:12:10 +0100 Subject: changed ui places for inventory and ground. fixed bug where small screens would crash game --- asciifarm/client/display/messagepad.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'asciifarm/client/display/messagepad.py') diff --git a/asciifarm/client/display/messagepad.py b/asciifarm/client/display/messagepad.py index 50d34f5..ab3afab 100644 --- a/asciifarm/client/display/messagepad.py +++ b/asciifarm/client/display/messagepad.py @@ -2,7 +2,7 @@ import curses import textwrap -class MessagePad: +class MessagePad(): def __init__(self, maxLines=10): self.maxLines = maxLines @@ -16,10 +16,10 @@ class MessagePad: self.changed = True def getHeight(self): - return min(len(self.messages), self.maxLines) + return self.maxLines def update(self, screen, x, y, xmax, ymax): - if not self.changed and (x, y, xmax, ymax) == self.lastView : + if not self.changed and (x, y, xmax, ymax) == self.lastView or xmax <= x or ymax <= y: return width = xmax - x height = ymax - y # should equal self.getHeight() -- cgit