From: Simon Cross Date: Sat, 10 Sep 2016 15:23:58 +0000 (+0200) Subject: Add battery status to infobar. X-Git-Tag: tabakrolletjie-v1.0.0~84 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=7c0eb5c9435ada37f7855170049ba6cccad2d172;p=tabakrolletjie.git Add battery status to infobar. --- diff --git a/tabakrolletjie/scenes/day.py b/tabakrolletjie/scenes/day.py index 5ba3881..8d39c2b 100644 --- a/tabakrolletjie/scenes/day.py +++ b/tabakrolletjie/scenes/day.py @@ -144,7 +144,7 @@ class DayScene(BaseScene): self._lights.render_light(surface) self._obstacles.render(surface) self._lights.render_fittings(surface) - surface.blit(self._infobar, (120, 10), None) + surface.blit(self._infobar, (50, 10), None) for tool in self._tools: tool.render(surface) for light_tool in self._light_toolbar: @@ -303,11 +303,12 @@ class DayScene(BaseScene): self._lights.tick() def _update_infobar(self, gamestate): - line1 = ("Day %d: Goal: %d Turnips. Turnips harvested: %d" % - (gamestate.days, gamestate.get_target(), self._harvested)) + line1 = ("Day %d: Goal: %d Turnips. Turnips harvested: %d" % ( + gamestate.days, gamestate.get_target(), self._harvested)) line1_img = self._infobar_font.render(line1, True, (255, 255, 255)) - line2 = ("Turnip Stocks: Seeds: %s. Planted: %d" % - (self._seeds, len(self._turnips))) + line2 = ("Turnip Stocks: Seeds: %s. Planted: %d. Battery: %d/%d" % ( + self._seeds, len(self._turnips), self._battery.current, + self._battery.max)) line2_img = self._infobar_font.render(line2, True, (255, 255, 255)) width = max(line1_img.get_width(), line2_img.get_width()) + 10 height = line1_img.get_height() + line2_img.get_height() + 10