summaryrefslogtreecommitdiff
path: root/asciifarm/client/display/healthpad.py
diff options
context:
space:
mode:
Diffstat (limited to 'asciifarm/client/display/healthpad.py')
-rw-r--r--asciifarm/client/display/healthpad.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/asciifarm/client/display/healthpad.py b/asciifarm/client/display/healthpad.py
index 559906d..7b756a5 100644
--- a/asciifarm/client/display/healthpad.py
+++ b/asciifarm/client/display/healthpad.py
@@ -22,15 +22,15 @@ class HealthPad:
def update(self):
win = self.widget.getWin()
- height, width = win.getmaxyx()
+ width, height = win.getSize()
width -= 1
barEnd = round(self.health/self.maxHealth * width) if self.maxHealth > 0 else 0
win.erase()
- win.addstr(0,0,"Health: {}/{}".format(self.health, self.maxHealth)[:width])
+ win.addLine((0,0),"Health: {}/{}".format(self.health, self.maxHealth)[:width])
if self.colours:
- win.addstr(1,0, self.char[0]*barEnd, self.colours.get(*self.char[1:]))
- win.addstr(1,barEnd, self.emptyChar[0]*(width-barEnd), self.colours.get(*self.emptyChar[1:]))
+ win.addLine((0, 1), self.char[0]*barEnd, self.char[1:])
+ win.addLine((barEnd, 1), self.emptyChar[0]*(width-barEnd), self.emptyChar[1:])
else:
- win.addstr(1,0, self.char[0]*barEnd)
- win.addstr(1,barEnd, self.emptyChar[0]*(width-barEnd))
+ win.addLine((0, 1), self.char[0]*barEnd)
+ win.addLine((barEnd, 1), self.emptyChar[0]*(width-barEnd))
win.noutrefresh()