def _actions_solution(self): # start with a line break sol = "\n " + "\n .\n ".join(self._gen_action_string()) self.edit_level.set_metadata_raw("solution", sol) msg = dedent("""\ Solution updated/created in the editor. If you want to play the solution, please reload the map. Remember to save the level in the editor! (reload level by "Edit-mode" -> "Play Level") """) mdiag = MessageDialog(msg, "Solution set") mdiag.open()
def show_hint(self): if self.level: h = self.level.get_metadata_raw("description") if h is not None: d = MessageDialog(h, title="Hint") d.open(); else: d = MessageDialog("No hint available", title="Sorry") d.open();