def test_actions_dictionary(self): test_actions = {} self.assertEqual(ActionManager.get_actions(), test_actions) self.reg_action_func(*self.reg_action_params) self.assertNotEqual(ActionManager.get_actions(), test_actions) test_actions["Test"] = TestAction self.assertEqual(ActionManager.get_actions(), test_actions) ActionManager.clear_actions() test_actions = {} self.assertEqual(ActionManager.get_actions(), test_actions)
def test_actions_dictionary(self): test_actions = {} self.assertEqual(ActionManager.get_actions(), test_actions) self.reg_action_func(*self.reg_action_params) self.assertNotEqual(ActionManager.get_actions(), test_actions) test_actions["Test"] = TestAction self.assertEqual(ActionManager.get_actions(), test_actions) ActionManager.clear_actions() test_actions = {} self.assertEqual(ActionManager.get_actions(), test_actions)
def edit_actions(self): """Show the dialog to edit actions""" dialog = Actions(self) values = dialog.show_modal(self.editor_gui.editor_window, self.engine.pump) if not dialog.return_value: return False ActionManager.clear_actions() current_items = list(values["current_items"]) self.project.set("fife-rpg", "Actions", current_items) self.register_actions(current_items) self.project_changed = True
def clear(self): """Clears all data and restores saved settings""" self._maps = {} self._current_map = None self._components = {} self._actions = {} self._systems = {} self._behaviours = {} self.changed_maps = [] self.project_changed = False self.entity_changed = False self.editor_gui.reset_layerlist() self.map_entities = None self.set_selected_object(None) tmp_settings = list(self.settings.getSettingsFromFile("fife-rpg").keys()) for setting in tmp_settings: if setting in self.editor_settings: self.settings.set("fife-rpg", setting, self.editor_settings[setting]) else: self.settings.remove("fife-rpg", setting) ComponentManager.clear_components() ComponentManager.clear_checkers() ActionManager.clear_actions() ActionManager.clear_commands() SystemManager.clear_systems() BehaviourManager.clear_behaviours() self.editor.delete_maps() self.editor.delete_objects() if self.project_source is not None: self.engine.getVFS().removeSource(self.project_source) self.project_source = None if self.project_dir is not None: sys.path.remove(self.project_dir) self.project_dir = None self.project = None for callback in self._project_cleared_callbacks: callback() self.create_world()
def tearDown(self): ActionManager.clear_actions() ActionManager.clear_commands()
def tearDown(self): ActionManager.clear_actions() ActionManager.clear_commands()