def enable(self): if self._enabled is True: return self.editor = scripts.editor.getEditor() self.engine = self.editor.getEngine() self._show_action = Action(u"History manager", checkable=True) self._undo_action = Action(u"Undo", "gui/icons/undo.png") self._redo_action = Action(u"Redo", "gui/icons/redo.png") self._next_action = Action(u"Next branch", "gui/icons/next_branch.png") self._prev_action = Action(u"Previous branch", "gui/icons/previous_branch.png") self._show_action.helptext = u"Toggle HistoryManager" self._undo_action.helptext = u"Undo action (CTRL+Z)" self._redo_action.helptext = u"Redo action (CTRL+SHIFT+Z)" self._next_action.helptext = u"Next branch (CTRL+ALT+Z" self._prev_action.helptext = u"Previous branch (CTRL+ALT+SHIFT+Z)" scripts.gui.action.activated.connect(self.toggle, sender=self._show_action) scripts.gui.action.activated.connect(self._undo, sender=self._undo_action) scripts.gui.action.activated.connect(self._redo, sender=self._redo_action) scripts.gui.action.activated.connect(self._next, sender=self._next_action) scripts.gui.action.activated.connect(self._prev, sender=self._prev_action) self._undo_group = ActionGroup(name=u"UndoGroup") self._undo_group.addAction(self._undo_action) self._undo_group.addAction(self._redo_action) self._undo_group.addAction(self._next_action) self._undo_group.addAction(self._prev_action) self.editor._tools_menu.addAction(self._show_action) self.editor._edit_menu.insertAction(self._undo_group, 0) self.editor._edit_menu.insertSeparator(position=1) events.postMapShown.connect(self.update) undomanager.changed.connect(self.update) self.buildGui()
def enable(self): """ plugin method """ if self._enabled is True: return self._editor = scripts.editor.getEditor() #self._camera = self._editor.getActiveMapView().getCamera() self._action_show = Action(u"Camera Editor", checkable=True) scripts.gui.action.activated.connect(self.toggle, sender=self._action_show) self._editor._tools_menu.addAction(self._action_show) self._createGui() self._enabled = True
def enable(self): """ Enable plugin """ if self._enabled is True: return # Fifedit plugin data self._editor = scripts.editor.getEditor() self._action_show = Action(u"LayerTool", checkable=True) scripts.gui.action.activated.connect(self.toggle, sender=self._action_show) self._editor._tools_menu.addAction(self._action_show) self._createGui() self.toggle() events.postMapShown.connect(self.update) events.preMapClosed.connect(self._mapClosed)
def enable(self): if self._enabled is True: return self.editor = scripts.editor.getEditor() self.engine = self.editor.getEngine() self._showAction = Action(u"Object selector", checkable=True) scripts.gui.action.activated.connect(self.toggle, sender=self._showAction) self.editor._tools_menu.addAction(self._showAction) events.postMapShown.connect(self.update_namespace) events.onObjectSelected.connect(self.setPreview) events.onObjectsImported.connect(self.update_namespace) self.buildGui()
def enable(self): """ enables the plugin and connects to the editor """ if self._enabled: return self._enabled = True # Fifedit plugin data self._action_show = Action(self.getName(), checkable=True) scripts.gui.action.activated.connect(self.toggle, sender=self._action_show) self._editor._tools_menu.addAction(self._action_show) self.load_map_history() self.create() onOpenMapFile.connect(self.update) if self.settings['docked']: self._editor.dockWidgetTo(self.container, self.settings['dockarea'])
def enable(self): """ Enable plugin """ if self._enabled: return # Fifedit plugin data self._action_show = Action(u"LayerTool", checkable=True) scripts.gui.action.activated.connect(self.toggle, sender=self._action_show) self._editor._tools_menu.addAction(self._action_show) self.create() self.toggle() events.postMapShown.connect(self.update) events.preMapClosed.connect(self._mapClosed) if self.settings['docked']: self._editor.dockWidgetTo(self.container, self.settings['dockarea'])
def enable(self): """ plugin method """ if self._enabled: return self._enabled = True self._action_show = Action(unicode(self.getName(),"utf-8"), checkable=True) scripts.gui.action.activated.connect(self.toggle_gui, sender=self._action_show) self._editor._tools_menu.addAction(self._action_show) onObjectSelected.connect(self.update) onInstancesSelected.connect(self.update) preMapClosed.connect(self.hide) postMapShown.connect(self.update) self.create_gui() self.update_gui() if self.settings['docked']: self._editor.dockWidgetTo(self.container, self.settings['dockarea'])
def enable(self): """ enables the plugin and connects to the editor """ if self._enabled: return self._enabled = True # Fifedit plugin data self._action_show = Action(self.getName(), checkable=True) scripts.gui.action.activated.connect(self.toggle, sender=self._action_show) self._editor._tools_menu.addAction(self._action_show) postMapShown.connect(self.update) onObjectSelected.connect(self.set_object) onObjectsImported.connect(self.update_namespaces) self.create() self.toggle() if self.settings['docked']: self._editor.dockWidgetTo(self.container, self.settings['dockarea'])
def enable(self): """ plugin method """ if self._enabled is True: return self._editor = scripts.editor.getEditor() self.engine = self._editor.getEngine() self.imagemanager = self.engine.getImageManager() self._showAction = Action(unicode(self.getName(), "utf-8"), checkable=True) scripts.gui.action.activated.connect(self.toggle_gui, sender=self._showAction) self._editor._tools_menu.addAction(self._showAction) events.onInstancesSelected.connect(self.input) self._reset() self.create_gui()
def enable(self): """ plugin method overwrite """ if self._enabled: return self._editor = scripts.editor.getEditor() self._engine = self._editor.getEngine() self._action_show = Action(unicode(self.getName(), "utf-8"), checkable=True) scripts.gui.action.activated.connect(self.toggle_gui, sender=self._action_show) self._editor._tools_menu.addAction(self._action_show) events.onCellSelected.connect(self.input) events.preMapClosed.connect(self.hide) events.postMapShown.connect(self.map_shown) events.mousePressed.connect(self.mouse_pressed) self._reset() self.create() self.container.x = 0 self.container.y = 0 self.show()