From 8c8c410f0eb7b6995c6e8db613228d91191f4e23 Mon Sep 17 00:00:00 2001 From: troido Date: Thu, 28 Dec 2017 22:47:36 +0100 Subject: chat now works! --- asciifarm/client/display/healthpad.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'asciifarm/client/display/healthpad.py') diff --git a/asciifarm/client/display/healthpad.py b/asciifarm/client/display/healthpad.py index f5a9cc4..968ed1c 100644 --- a/asciifarm/client/display/healthpad.py +++ b/asciifarm/client/display/healthpad.py @@ -10,6 +10,10 @@ class HealthPad: self.colours = colours self.health = 0 self.maxHealth = 0 + self.win = None + + def setWin(self, win): + self.win = win def setHealth(self, health, maxHealth): self.health = health @@ -17,9 +21,10 @@ class HealthPad: self.changed = True - def update(self, win, force): - if not self.changed and not force or not win: + def update(self, force): + if not self.changed and not force or not self.win: return + win = self.win self.changed = False height, width = win.getmaxyx() width -= 1 -- cgit