From 3fcc264ff36bc5f942d0d24af231c06e6025ae85 Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 13 Nov 2017 14:29:54 +0100 Subject: cleanup of display stuff --- asciifarm/client/display/healthpad.py | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'asciifarm/client/display/healthpad.py') diff --git a/asciifarm/client/display/healthpad.py b/asciifarm/client/display/healthpad.py index 1b5c7e2..f5a9cc4 100644 --- a/asciifarm/client/display/healthpad.py +++ b/asciifarm/client/display/healthpad.py @@ -3,13 +3,10 @@ import curses class HealthPad: - def __init__(self, width=1, char=('@',7,0), emptyChar=('-',7,0), colours=False): + def __init__(self, char=('@',7,0), emptyChar=('-',7,0), colours=False): self.char = char self.emptyChar = emptyChar - #self.pad = curses.newpad(2, width+1) - #self.width = width self.changed = False - #self.lastView = None self.colours = colours self.health = 0 self.maxHealth = 0 @@ -17,27 +14,12 @@ class HealthPad: def setHealth(self, health, maxHealth): self.health = health self.maxHealth = maxHealth - - - #self.pad.erase() - #barEnd = round(health/maxHealth * self.width) - #self.pad.addstr(0,0,"Health: {}/{}".format(health, maxHealth)[:self.width]) - #if self.colours: - #self.pad.addstr(1,0, self.char[0]*barEnd, self.colours.get(*self.char[1:])) - #self.pad.addstr(1,barEnd, self.emptyChar[0]*(self.width-barEnd), self.colours.get(*self.emptyChar[1:])) - #else: - #self.pad.addstr(1,0, self.char[0]*barEnd) - #self.pad.addstr(1,barEnd, self.emptyChar[0]*(self.width-barEnd)) self.changed = True - #def getHeight(self): - #return 2 - - def update(self, win, force=False): + def update(self, win, force): if not self.changed and not force or not win: return - #self.lastView = (x, y, xmax, ymax) self.changed = False height, width = win.getmaxyx() width -= 1 @@ -51,9 +33,3 @@ class HealthPad: win.addstr(1,0, self.char[0]*barEnd) win.addstr(1,barEnd, self.emptyChar[0]*(width-barEnd)) win.noutrefresh() - #0, - #0, - #y, - #x, - #ymax-1, - #xmax-1) -- cgit