summaryrefslogtreecommitdiff
path: root/asciifarm/client/display/messagepad.py
diff options
context:
space:
mode:
authortroido <troido@hotmail.com>2017-11-06 21:12:10 +0100
committertroido <troido@hotmail.com>2017-11-06 21:12:10 +0100
commit07250230943a5fdfd7961063478523ee948710f4 (patch)
treeebec70993152b583485fad9687ccf3d89349bd40 /asciifarm/client/display/messagepad.py
parent47b57891ef4940a6fa2047345e092ba2f00cd1ba (diff)
changed ui places for inventory and ground. fixed bug where small screens would crash game
Diffstat (limited to 'asciifarm/client/display/messagepad.py')
-rw-r--r--asciifarm/client/display/messagepad.py6
1 files changed, 3 insertions, 3 deletions
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()