mirror of https://github.com/dirtbags/moth.git
Fixed type error, made results rows keyed by color.
This commit is contained in:
parent
8e8bad1e3c
commit
30e18ea544
|
@ -205,12 +205,17 @@ class Pflanzarr:
|
|||
'<table><tr><th>Team<th>Kills<th>Cause of Death']
|
||||
for tank in tanks:
|
||||
if tank is winner:
|
||||
rowStyle = 'style="color:red;"'
|
||||
rowStyle = 'style="font-weight:bold; '\
|
||||
'background-color:%s"' % tank._color
|
||||
else:
|
||||
rowStyle = ''
|
||||
rowStyle = 'style="background-color:%s"' % tank._color
|
||||
if name:
|
||||
name = xml.sax.saxutils.escape(tank.name)
|
||||
else:
|
||||
name = '#default'
|
||||
html.append('<tr %s><td>%s<td>%d<td>%s' %
|
||||
(rowStyle,
|
||||
xml.sax.saxutils.escape(tank.name),
|
||||
name,
|
||||
len(kills[tank]),
|
||||
xml.sax.saxutils.escape(tank.deathReason)))
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ class Tank(object):
|
|||
else:
|
||||
self._tAngle = tAngle
|
||||
|
||||
self._color = color
|
||||
self.color = color
|
||||
|
||||
# You can't fire until fireReady is 0.
|
||||
self._fireReady = self.FIRE_RATE
|
||||
|
@ -466,7 +466,7 @@ class Tank(object):
|
|||
|
||||
# The base body rectangle.
|
||||
for poly in gm.displacePoly(hood, self.pos, self._limits):
|
||||
d.polygon( poly, fill=self._color )
|
||||
d.polygon( poly, fill=self.color )
|
||||
|
||||
# The treads
|
||||
for poly in gm.displacePoly(tread1, self.pos, self._limits) + \
|
||||
|
@ -475,7 +475,7 @@ class Tank(object):
|
|||
|
||||
# The turret circle
|
||||
for poly in gm.displacePoly(self.body, self.pos, self._limits):
|
||||
d.ellipse( poly, fill=self._color, outline='black')
|
||||
d.ellipse( poly, fill=self.color, outline='black')
|
||||
|
||||
self._drawLaser(d)
|
||||
|
||||
|
@ -491,7 +491,7 @@ class Tank(object):
|
|||
if self._fired:
|
||||
laser = gm.rotatePoly( self.laser, self._angle + self._tAngle )
|
||||
for poly in gm.displacePoly(laser, self.pos, self._limits):
|
||||
drawing.polygon(poly, fill=self._color)
|
||||
drawing.polygon(poly, fill=self.color)
|
||||
|
||||
self._fired = False
|
||||
|
||||
|
@ -522,7 +522,7 @@ class Tank(object):
|
|||
if self._sensorState[i]:
|
||||
color = '#000000'
|
||||
else:
|
||||
color = self._color
|
||||
color = self.color
|
||||
|
||||
r, angle, width, tAttached = self._sensors[i]
|
||||
r = int(r)
|
||||
|
|
Loading…
Reference in New Issue