def open_scene_editor(self, type_of_scene, path): try: map_name, filename = path.split('/')[-2:] if type_of_scene == 'ssa': RomProject.get_current().request_open(OpenRequest( REQUEST_TYPE_SCENE_SSA, (map_name, filename.replace(SSB_EXT, SSA_EXT)) ), True) elif type_of_scene == 'sss': RomProject.get_current().request_open(OpenRequest( REQUEST_TYPE_SCENE_SSS, (map_name, filename.replace(SSB_EXT, SSS_EXT)) ), True) elif type_of_scene == 'sse': RomProject.get_current().request_open(OpenRequest( REQUEST_TYPE_SCENE_SSE, map_name ), True) else: raise ValueError() self._manager.main_window.present() except ValueError: md = Gtk.MessageDialog(self._manager.get_window(), Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.INFO, Gtk.ButtonsType.OK, f"A scene for this script was not found.", title="No Scenes Found") md.run() md.destroy()
def open_scene_editor_for_map(self, map_name): try: RomProject.get_current().request_open(OpenRequest( REQUEST_TYPE_SCENE, map_name ), True) self._manager.main_window.present() except ValueError: md = Gtk.MessageDialog(self._manager.get_window(), Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.INFO, Gtk.ButtonsType.OK, f"A scene for this script was not found.", title="No Scenes Found") md.run() md.destroy()
def on_tb_goto_scene_clicked(self, w): try: associated = self.module.get_associated_script_map(self.item_id) if associated is None: raise ValueError() self.module.project.request_open(OpenRequest( REQUEST_TYPE_SCENE, associated.name ), True) except ValueError: md = Gtk.MessageDialog(MainController.window(), Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.INFO, Gtk.ButtonsType.OK, f"A script map with the same name as " f"this background does not exist.", title="No Scenes Found") md.run() md.destroy()
def open_scene_editor_for_map(self, map_name): try: current = RomProject.get_current() assert current is not None current.request_open(OpenRequest(REQUEST_TYPE_SCENE, map_name), True) if self._manager.main_window is not None: self._manager.main_window.present() except ValueError: md = SkyTempleMessageDialog( self._manager.get_window(), Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.INFO, Gtk.ButtonsType.OK, _("A scene for this script was not found."), title=_("No Scenes Found")) md.run() md.destroy()
def on_tool_scene_goto_tileset_clicked(self, *args): self.module.project.request_open(OpenRequest( REQUEST_TYPE_DUNGEON_TILESET, self.tileset_id ))
def on_btn_goto_entity_editor_clicked(self, *args): idx = self.builder.get_object('utility_entity_type').get_active() self.module.project.request_open(OpenRequest( REQUEST_TYPE_DUNGEON_FIXED_FLOOR_ENTITY, idx ))
def on_edit_map_bg_clicked(self, *args): self.module.project.request_open(OpenRequest( REQUEST_TYPE_MAP_BG, self._level_id ))
def on_btn_goto_clicked(self, *args): self.module.project.request_open(OpenRequest( REQUEST_TYPE_DUNGEONS, None ))