Ejemplo n.º 1
0
def drawbuildicons():
	otypes = sorted(mechanics.costs.items(), key = lambda (k,v): v)
	for j, (otype, cost) in enumerate(otypes):
		if status.state.maxmutagen < cost: continue
		x = settings.layout.buildiconxs[j % len(settings.layout.buildiconxs)]
		y = settings.layout.meterbottom - getlevel(cost)
		ghost = status.state.mutagen < cost
		selected = otype == selectedorgan
		img = graphics.icon(otype, ghost, selected)
		rect = img.get_rect(center = (x, y))
		iconrects[otype] = rect
		vista.addoverlay(img, rect)
Ejemplo n.º 2
0
 def think(self, dt):
     active = self.meter.amount >= self.amount
     self.visible = self.meter.height >= self.amount
     if not self.visible: return
     self.active = active
     if self.x is None:
         self.x = settings.layout.buildiconxs[self.number % len(settings.layout.buildiconxs)]
         _, self.y = self.meter.meterpos(self.amount, bounded = False)
         self.img = None
     if not self.img:
         self.img = graphics.icon(self.name)
         self.ghost = graphics.ghostify(self.img)
         self.select = graphics.brighten(self.img)
         self.currentimg = self.img
         self.rect = self.currentimg.get_rect(center = (self.x, self.y))
     self.currentimg = (self.select if self.selected else self.img) if self.active else self.ghost
     self.linepos = x,y = self.meter.meterpos(self.amount)
     self.pointedto = False
Ejemplo n.º 3
0
 def think(self, dt):
     active = self.meter.amount >= self.amount
     self.visible = self.meter.height >= self.amount
     if not self.visible: return
     self.active = active
     if self.x is None:
         self.x = settings.layout.buildiconxs[self.number % len(
             settings.layout.buildiconxs)]
         _, self.y = self.meter.meterpos(self.amount, bounded=False)
         self.img = None
     if not self.img:
         self.img = graphics.icon(self.name)
         self.ghost = graphics.ghostify(self.img)
         self.select = graphics.brighten(self.img)
         self.currentimg = self.img
         self.rect = self.currentimg.get_rect(center=(self.x, self.y))
     self.currentimg = (self.select if self.selected else
                        self.img) if self.active else self.ghost
     self.linepos = x, y = self.meter.meterpos(self.amount)
     self.pointedto = False