+ self._roaches = self.actors.add_layer("roaches", level=10)
+ self._pads = self.actors.add_layer("pads", level=5)
+ self._buttons = self.actors.add_layer("buttons", level=6)
+ self._init_bg()
+ self._init_pads()
+ self._init_buttons()
+
+ def _init_bg(self):
+ self.actors.default.add(Actor("vehicles/walking/background"))
+
+ def _init_pads(self):
+ self._roach_pad = self._pads.add(
+ Actor("roach_management/roach_pad", anchor=("left", "bottom")))
+ self._roach_pad.pos = (TOOLBAR_LEFT_X, TOOLBAR_MID_Y)
+ self._inventory_pad = self._pads.add(
+ Actor("roach_management/inventory_pad", anchor=("left", "top")))
+ self._inventory_pad.pos = (TOOLBAR_LEFT_X, TOOLBAR_MID_Y)
+
+ def _add_button(self, name, anchor, inset, pos, action):
+ button = self._buttons.add(
+ ImageButton(name, anchor=anchor, action=action))
+ button.pos = inset_button(pos, inset)
+ return button
+
+ def _init_buttons(self):
+ self._add_button(
+ "roach_management/left_button", ("left", "bottom"), (1, -1),
+ self._roach_pad.bottomleft, self._roach_left)
+
+ self._add_button(
+ "roach_management/right_button", ("right", "bottom"), (-1, -1),
+ self._roach_pad.bottomright, self._roach_right)
+
+ self._add_button(
+ "roach_management/left_button", ("left", "bottom"), (1, -1),
+ self._inventory_pad.bottomleft, self._inventory_left)
+
+ self._add_button(
+ "roach_management/right_button", ("right", "bottom"), (-1, -1),
+ self._inventory_pad.bottomright, self._inventory_right)
+
+ self._add_button(
+ "roach_management/eject_button", ("right", "top"), (-1, 1),
+ (TOOLBAR_LEFT_X, TOOLBAR_TOP_Y), self._eject_roach)
+
+ def _roach_left(self):
+ print("Cycle outside roaches left.")
+
+ def _roach_right(self):
+ print("Cycle outside roaches right.")
+
+ def _inventory_left(self):
+ print("Cycle inventory left.")
+
+ def _inventory_right(self):
+ print("Cycle inventory right.")
+
+ def _eject_roach(self):
+ print("Eject roach.")