From 99d7920cb3daf3fc5cb6f824eb4a639542d47974 Mon Sep 17 00:00:00 2001 From: troido Date: Wed, 3 Jan 2018 17:07:15 +0100 Subject: added intermediary window wrapper for safety. also server now appends logs --- asciifarm/client/display/healthpad.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'asciifarm/client/display/healthpad.py') 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() -- cgit