summaryrefslogtreecommitdiff
path: root/asciifarm/client/display/healthpad.py
diff options
context:
space:
mode:
authortroido <troido@hotmail.com>2017-12-28 22:47:36 +0100
committertroido <troido@hotmail.com>2017-12-28 22:47:36 +0100
commit8c8c410f0eb7b6995c6e8db613228d91191f4e23 (patch)
tree8a0ff8bf95e20963a40332bc5fb2588fd9eb6ba6 /asciifarm/client/display/healthpad.py
parentd983e275f3f4ba156e33d00e5deaa2f730695cae (diff)
chat now works!
Diffstat (limited to 'asciifarm/client/display/healthpad.py')
-rw-r--r--asciifarm/client/display/healthpad.py9
1 files changed, 7 insertions, 2 deletions
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