summaryrefslogtreecommitdiff
path: root/asciifarm/client/display/healthpad.py
diff options
context:
space:
mode:
authortroido <troido@hotmail.com>2017-11-13 14:29:54 +0100
committertroido <troido@hotmail.com>2017-11-13 14:29:54 +0100
commit3fcc264ff36bc5f942d0d24af231c06e6025ae85 (patch)
treef21787e387f215658b10acf25ca9472f9cfd9538 /asciifarm/client/display/healthpad.py
parenta29876590bf97c9cf0b1e8a8760481a435a3a46c (diff)
cleanup of display stuff
Diffstat (limited to 'asciifarm/client/display/healthpad.py')
-rw-r--r--asciifarm/client/display/healthpad.py28
1 files changed, 2 insertions, 26 deletions
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)