Exemplo n.º 1
0
    def autosave(self):
        if SESSION.is_active():
            timer = Timer(SETTINGS.get(Setting.AUTOSAVE_INTERVAL),
                          self.autosave)
            timer.daemon = True
            timer.start()

            SESSION.save_map_to_file(autosave=True)
Exemplo n.º 2
0
 def handle_menu_selection(self, event):
     if event.option == Option.MENU_SAVE_MAP:
         SESSION.save_map_to_file()
     elif event.option == Option.MENU_QUIT_BATTLE:
         publish_game_event(EventType.E_QUIT_BATTLE, {})
     elif event.option == Option.MENU_FILL_WITH_CURRENT_TILE:
         self.fill_with_current_tile()
     elif event.option == Option.MENU_DESTROY_ALL_PIECES:
         self.clear_all_pieces()
     elif event.option == Option.MENU_MIRROR_X:
         self.mirror_map(mirror_x=True, mirror_y=False)
     elif event.option == Option.MENU_MIRROR_Y:
         self.mirror_map(mirror_x=False, mirror_y=True)