diff --git a/requirements-mac-windows.txt b/requirements-mac-windows.txt index 4f85876ad..106ac6e54 100644 --- a/requirements-mac-windows.txt +++ b/requirements-mac-windows.txt @@ -14,7 +14,7 @@ pypresence==4.3.0 pygal==3.0.1 CairoSVG==2.7.1 gbulb==0.6.4 -psutil==5.9.5 +psutil==5.9.8 sentry-sdk==1.35.0 cairocffi>=1.6.1 packaging diff --git a/requirements.txt b/requirements.txt index acd48c1ba..48c94f06e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ pypresence==4.3.0 pygal==3.0.1 CairoSVG==2.7.1 gbulb==0.6.4 -psutil==5.9.5 +psutil==5.9.8 sentry-sdk==1.35.0 packaging wheel diff --git a/skytemple/_i18n.py b/skytemple/_i18n.py index f0fa416c6..7be4c7f0a 100644 --- a/skytemple/_i18n.py +++ b/skytemple/_i18n.py @@ -1,4 +1,5 @@ """Module that contains GTK stock strings, just for source detection for i18n strings.""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/core/error_handler.py b/skytemple/core/error_handler.py index 16b762ceb..63b1c8c14 100644 --- a/skytemple/core/error_handler.py +++ b/skytemple/core/error_handler.py @@ -1,4 +1,5 @@ """Module for handling errors.""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/core/events/impl/discord.py b/skytemple/core/events/impl/discord.py index 2487fe112..d59305703 100644 --- a/skytemple/core/events/impl/discord.py +++ b/skytemple/core/events/impl/discord.py @@ -2,6 +2,7 @@ Discord presence module. If the extra dependencies are not installed, importing this module will raise an ImportError. """ + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. @@ -351,9 +352,11 @@ def _update_current_presence(self): elif self.current_presence == "debugger": self._update_presence( state=self.debugger_script_name, - details="In the debugger" - if self.debugger_script_name is None - else "Editing script", + details=( + "In the debugger" + if self.debugger_script_name is None + else "Editing script" + ), start=self.start, large_text=self.rom_name, small_image="bug", diff --git a/skytemple/core/img_utils.py b/skytemple/core/img_utils.py index a7a1e0893..45fa1c030 100644 --- a/skytemple/core/img_utils.py +++ b/skytemple/core/img_utils.py @@ -1,4 +1,5 @@ """Utilities for dealing with images""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/core/list_icon_renderer.py b/skytemple/core/list_icon_renderer.py index 929606cc2..f8fe2ab7d 100644 --- a/skytemple/core/list_icon_renderer.py +++ b/skytemple/core/list_icon_renderer.py @@ -120,9 +120,9 @@ def _reload_icon(self, parameters, idx, store, load_fn, target_name, was_loading def _reload_icons_in_tree(self): try: for model, idx, params in self._registered_for_reload: - model[get_list_store_iter_by_idx(model, idx)][ - self.column_id - ] = self._get_icon(*params) + model[get_list_store_iter_by_idx(model, idx)][self.column_id] = ( + self._get_icon(*params) + ) self._loading = False self._refresh_timer = None except (AttributeError, TypeError): diff --git a/skytemple/core/logger.py b/skytemple/core/logger.py index e5ccd5f1c..3a9517226 100644 --- a/skytemple/core/logger.py +++ b/skytemple/core/logger.py @@ -1,4 +1,5 @@ """Logging configuration.""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/core/mapbg_util/__init__.py b/skytemple/core/mapbg_util/__init__.py index 5f742fa89..21be8bdaf 100644 --- a/skytemple/core/mapbg_util/__init__.py +++ b/skytemple/core/mapbg_util/__init__.py @@ -1,4 +1,5 @@ """Utilities for drawing editors for/on maps.""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/core/module_controller.py b/skytemple/core/module_controller.py index d1ec25064..4e4e5042b 100644 --- a/skytemple/core/module_controller.py +++ b/skytemple/core/module_controller.py @@ -2,6 +2,7 @@ :deprecated: The controller-based approach of presenting and controlling views has been replaced. See docs for `AbstractController`. """ + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/core/modules.py b/skytemple/core/modules.py index 74226b6b2..4d216e73b 100644 --- a/skytemple/core/modules.py +++ b/skytemple/core/modules.py @@ -1,4 +1,5 @@ """Module that manages and loads modules""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/core/profiling.py b/skytemple/core/profiling.py index f65c9ad8a..27b138d57 100644 --- a/skytemple/core/profiling.py +++ b/skytemple/core/profiling.py @@ -1,6 +1,7 @@ """ Module that contains profiling contexts. They are based on Sentry's transactions and spans. """ + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. @@ -29,8 +30,7 @@ class TaggableContext(AbstractContextManager, Protocol): - def set_tag(self, key: str, value: Any): - ... + def set_tag(self, key: str, value: Any): ... def record_transaction( @@ -52,20 +52,17 @@ def reset_impls_cache(): class _ProfilingImplementation(ABC): @classmethod @abstractmethod - def new(cls) -> _ProfilingImplementation | None: - ... + def new(cls) -> _ProfilingImplementation | None: ... @abstractmethod def make_transaction( self, name: str, tags: dict[str, Any] | None - ) -> TaggableContext | None: - ... + ) -> TaggableContext | None: ... @abstractmethod def make_span( self, op: str, description: str, tags: dict[str, Any] | None - ) -> TaggableContext | None: - ... + ) -> TaggableContext | None: ... class _LogImpl(_ProfilingImplementation): diff --git a/skytemple/core/rom_project.py b/skytemple/core/rom_project.py index 64cc33436..298d14dde 100644 --- a/skytemple/core/rom_project.py +++ b/skytemple/core/rom_project.py @@ -1,4 +1,5 @@ """Manages the state and files of the currently open ROM""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. @@ -304,72 +305,57 @@ def get_modules(self, include_rom_module=True) -> Iterator[AbstractModule]: from skytemple.module.spritecollab.module import SpritecollabModule @overload - def get_module(self, name: Literal["rom"]) -> "RomModule": - ... + def get_module(self, name: Literal["rom"]) -> "RomModule": ... @overload - def get_module(self, name: Literal["bgp"]) -> "BgpModule": - ... + def get_module(self, name: Literal["bgp"]) -> "BgpModule": ... @overload - def get_module(self, name: Literal["tiled_img"]) -> "TiledImgModule": - ... + def get_module(self, name: Literal["tiled_img"]) -> "TiledImgModule": ... @overload - def get_module(self, name: Literal["map_bg"]) -> "MapBgModule": - ... + def get_module(self, name: Literal["map_bg"]) -> "MapBgModule": ... @overload - def get_module(self, name: Literal["script"]) -> "ScriptModule": - ... + def get_module(self, name: Literal["script"]) -> "ScriptModule": ... @overload - def get_module(self, name: Literal["gfxcrunch"]) -> "GfxcrunchModule": - ... + def get_module(self, name: Literal["gfxcrunch"]) -> "GfxcrunchModule": ... @overload - def get_module(self, name: Literal["sprite"]) -> "SpriteModule": - ... + def get_module(self, name: Literal["sprite"]) -> "SpriteModule": ... @overload - def get_module(self, name: Literal["monster"]) -> "MonsterModule": - ... + def get_module(self, name: Literal["monster"]) -> "MonsterModule": ... @overload - def get_module(self, name: Literal["portrait"]) -> "PortraitModule": - ... + def get_module(self, name: Literal["portrait"]) -> "PortraitModule": ... @overload - def get_module(self, name: Literal["patch"]) -> "PatchModule": - ... + def get_module(self, name: Literal["patch"]) -> "PatchModule": ... @overload - def get_module(self, name: Literal["lists"]) -> "ListsModule": - ... + def get_module(self, name: Literal["lists"]) -> "ListsModule": ... @overload - def get_module(self, name: Literal["moves_items"]) -> "MovesItemsModule": - ... + def get_module(self, name: Literal["moves_items"]) -> "MovesItemsModule": ... @overload - def get_module(self, name: Literal["misc_graphics"]) -> "MiscGraphicsModule": - ... + def get_module(self, name: Literal["misc_graphics"]) -> "MiscGraphicsModule": ... @overload - def get_module(self, name: Literal["dungeon"]) -> "DungeonModule": - ... + def get_module(self, name: Literal["dungeon"]) -> "DungeonModule": ... @overload - def get_module(self, name: Literal["dungeon_graphics"]) -> "DungeonGraphicsModule": - ... + def get_module( + self, name: Literal["dungeon_graphics"] + ) -> "DungeonGraphicsModule": ... @overload - def get_module(self, name: Literal["strings"]) -> "StringsModule": - ... + def get_module(self, name: Literal["strings"]) -> "StringsModule": ... @overload - def get_module(self, name: Literal["spritecollab"]) -> "SpritecollabModule": - ... + def get_module(self, name: Literal["spritecollab"]) -> "SpritecollabModule": ... def get_module(self, name: str) -> AbstractModule: return self._loaded_modules[name] @@ -401,8 +387,7 @@ def open_file_in_rom( file_handler_class: type[DataHandler[T]], threadsafe: Literal[False] = False, **kwargs, - ) -> T: - ... + ) -> T: ... @overload def open_file_in_rom( @@ -411,8 +396,7 @@ def open_file_in_rom( file_handler_class: type[DataHandler[T]], threadsafe: Literal[True], **kwargs, - ) -> ModelContext[T]: - ... + ) -> ModelContext[T]: ... def open_file_in_rom( self, diff --git a/skytemple/core/sentry.py b/skytemple/core/sentry.py index cee817a7e..b16e66a13 100644 --- a/skytemple/core/sentry.py +++ b/skytemple/core/sentry.py @@ -1,4 +1,5 @@ """Module that manages capturing debugging information and sending it to sentry.io.""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. @@ -280,9 +281,9 @@ def debugger_emulator_state(manager: DebuggerManager): { "id": x.id, "hanger": x.hanger, - "direction": x.direction.ssa_id - if x.direction is not None - else None, + "direction": ( + x.direction.ssa_id if x.direction is not None else None + ), "kind": x.kind.name, "sector": x.sector, } @@ -296,9 +297,9 @@ def debugger_emulator_state(manager: DebuggerManager): { "id": x.id, "hanger": x.hanger, - "direction": x.direction.ssa_id - if x.direction is not None - else None, + "direction": ( + x.direction.ssa_id if x.direction is not None else None + ), "kind": x.kind.unique_name, "sector": x.sector, } @@ -312,9 +313,9 @@ def debugger_emulator_state(manager: DebuggerManager): { "id": x.id, "hanger": x.hanger, - "direction": x.direction.ssa_id - if x.direction is not None - else None, + "direction": ( + x.direction.ssa_id if x.direction is not None else None + ), "kind": x.kind, "sector": x.sector, } @@ -335,9 +336,11 @@ def debugger_emulator_state(manager: DebuggerManager): return { "running": ges.running, "ground_state": ground_state, - "game_vars": {k.name: v for k, v in vars._variable_cache.items()} - if hasattr(vars, "_variable_cache") and vars._variable_cache is not None - else None, + "game_vars": ( + {k.name: v for k, v in vars._variable_cache.items()} + if hasattr(vars, "_variable_cache") and vars._variable_cache is not None + else None + ), } diff --git a/skytemple/core/sentry_ext.py b/skytemple/core/sentry_ext.py index 7adf26525..3b28492eb 100644 --- a/skytemple/core/sentry_ext.py +++ b/skytemple/core/sentry_ext.py @@ -2,6 +2,7 @@ Sentry extensions for user feedback. Can be removed and replaced by if https://github.com/getsentry/sentry-python/pull/2442 is merged and released. """ + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/core/sprite_provider.py b/skytemple/core/sprite_provider.py index 1ccd83cb1..d2c220b42 100644 --- a/skytemple/core/sprite_provider.py +++ b/skytemple/core/sprite_provider.py @@ -1,4 +1,5 @@ """Sprite renderer module. Allows rendering Sprites, and loads them asynchronously.""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/core/ssb_debugger/manager.py b/skytemple/core/ssb_debugger/manager.py index b7ef9d3cb..924d05de6 100644 --- a/skytemple/core/ssb_debugger/manager.py +++ b/skytemple/core/ssb_debugger/manager.py @@ -1,4 +1,5 @@ """Manages the integration of SkyTemple Script Debugger (skytemple-ssb-debugger).""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/core/ssb_debugger/ssb_loaded_file_handler.py b/skytemple/core/ssb_debugger/ssb_loaded_file_handler.py index be2ccc45a..452f574ae 100644 --- a/skytemple/core/ssb_debugger/ssb_loaded_file_handler.py +++ b/skytemple/core/ssb_debugger/ssb_loaded_file_handler.py @@ -1,4 +1,5 @@ """skytemple-files data handler that wraps skytemple-files Ssb models in skytemple-ssb-debugger's LoadedSsbFile""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/core/ui_utils.py b/skytemple/core/ui_utils.py index de5180e8a..75ae9cdd0 100644 --- a/skytemple/core/ui_utils.py +++ b/skytemple/core/ui_utils.py @@ -1,4 +1,5 @@ """UI utilities.""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. @@ -191,13 +192,11 @@ def wrapper(*args, **kwargs): @overload def catch_overflow( typ: type[u8] | type[u16] | type[u32] | type[i8] | type[i16] | type[i32], -): - ... +): ... @overload -def catch_overflow(range_start: int, range_end: int): - ... +def catch_overflow(range_start: int, range_end: int): ... def catch_overflow(typ_or_range_start, range_end=None): diff --git a/skytemple/core/view_loader.py b/skytemple/core/view_loader.py index bc2568d84..5262652d5 100644 --- a/skytemple/core/view_loader.py +++ b/skytemple/core/view_loader.py @@ -1,4 +1,5 @@ """Module to load a module view and controller""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/data/locale/it_IT/LC_MESSAGES/skytemple.po b/skytemple/data/locale/it_IT/LC_MESSAGES/skytemple.po index bcc606926..c52c4acb4 100644 --- a/skytemple/data/locale/it_IT/LC_MESSAGES/skytemple.po +++ b/skytemple/data/locale/it_IT/LC_MESSAGES/skytemple.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: skytemple\n" "Report-Msgid-Bugs-To: https://translate.skytemple.org\n" "POT-Creation-Date: 2024-01-26 09:32+0000\n" -"PO-Revision-Date: 2024-01-26 09:40\n" +"PO-Revision-Date: 2024-01-29 14:50\n" "Last-Translator: \n" "Language-Team: Italian\n" "Language: it_IT\n" @@ -387,7 +387,7 @@ msgstr "" #: skytemple/skytemple/module/monster/controller/monster.glade:3510 #: skytemple/skytemple/module/moves_items/controller/move.glade:1389 msgid "Other" -msgstr "" +msgstr "Altro" #: /dev/fd/63:90 /dev/fd/63:213 #: skytemple/skytemple/module/dungeon/controller/floor.glade:5140 @@ -495,7 +495,7 @@ msgstr "" #: /dev/fd/63:115 /dev/fd/63:238 msgid "Update the level and stats of evolved enemies" -msgstr "" +msgstr "Aggiorna il livello e le statistiche dei nemici evoluti" #: /dev/fd/63:116 /dev/fd/63:239 msgid "Fully heal enemies after evolving" @@ -503,7 +503,7 @@ msgstr "" #: /dev/fd/63:117 /dev/fd/63:240 msgid "Update the moves of evolved enemies" -msgstr "" +msgstr "Aggiorna le mosse dei nemici evoluti" #: /dev/fd/63:118 /dev/fd/63:241 msgid "Increase Atk/SpAtk/Def/SpDef of evolved enemies by" @@ -511,7 +511,7 @@ msgstr "" #: /dev/fd/63:119 /dev/fd/63:242 msgid "Let enemies evolve even if the defeated pokémon is revived" -msgstr "" +msgstr "Permetti che i nemici si evolvano anche se il Pokémon sconfitto viene rianimato" #: /dev/fd/63:121 #: skytemple-ssb-debugger/skytemple_ssb_debugger/debugger.glade:539 @@ -924,7 +924,7 @@ msgstr "" #: skytemple/skytemple/module/dungeon/controller/dungeon.glade:15 #: skytemple/skytemple/module/dungeon/controller/invalid.glade:15 msgid "Down" -msgstr "" +msgstr "Giù" #: skytemple-files/skytemple_files/common/ppmdu_config/script_data.py:320 msgid "Down Right" @@ -934,7 +934,7 @@ msgstr "" #: skytemple-files/skytemple_files/common/ppmdu_config/script_data.py:322 #: skytemple-ssb-debugger/skytemple_ssb_debugger/controller/desmume_control_ui/__init__.py:26 msgid "Right" -msgstr "" +msgstr "Destra" #: skytemple-files/skytemple_files/common/ppmdu_config/script_data.py:324 msgid "Up Right" @@ -946,7 +946,7 @@ msgstr "" #: skytemple/skytemple/module/dungeon/controller/dungeon.glade:19 #: skytemple/skytemple/module/dungeon/controller/invalid.glade:19 msgid "Up" -msgstr "" +msgstr "Su" #: skytemple-files/skytemple_files/common/ppmdu_config/script_data.py:328 msgid "Up Left" @@ -956,7 +956,7 @@ msgstr "" #: skytemple-files/skytemple_files/common/ppmdu_config/script_data.py:330 #: skytemple-ssb-debugger/skytemple_ssb_debugger/controller/desmume_control_ui/__init__.py:27 msgid "Left" -msgstr "" +msgstr "Sinistra" #: skytemple-files/skytemple_files/common/ppmdu_config/script_data.py:332 msgid "Down Left" @@ -1001,7 +1001,7 @@ msgstr "" #: skytemple-files/skytemple_files/common/util.py:540 msgid "This ROM is not supported by SkyTemple." -msgstr "" +msgstr "Questa ROM non è supportata da SkyTemple." #: skytemple-files/skytemple_files/common/util.py:610 #: skytemple-files/skytemple_files/common/util.py:629 @@ -1173,7 +1173,7 @@ msgstr "Pokémon" #: skytemple/skytemple/module/script/controller/ssa.glade:2118 #: skytemple/skytemple/module/script/controller/ssa.py:1792 msgid "Type" -msgstr "" +msgstr "Tipo" #: skytemple-files/skytemple_files/data/item_s_p/model.py:71 msgid "The Pokemon may hatch holding the item." @@ -1472,15 +1472,15 @@ msgstr "" #: skytemple-files/skytemple_files/data/waza_p/protocol.py:35 msgid "Physical Move" -msgstr "" +msgstr "Mossa fisica" #: skytemple-files/skytemple_files/data/waza_p/protocol.py:36 msgid "Special Move" -msgstr "" +msgstr "Mossa speciale" #: skytemple-files/skytemple_files/data/waza_p/protocol.py:37 msgid "Status Move" -msgstr "" +msgstr "Mossa di stato" #: skytemple-files/skytemple_files/data/waza_p/protocol.py:60 msgid "Enemies" diff --git a/skytemple/module/dungeon/controller/fixed.py b/skytemple/module/dungeon/controller/fixed.py index b6e0fa893..e6c86eb34 100644 --- a/skytemple/module/dungeon/controller/fixed.py +++ b/skytemple/module/dungeon/controller/fixed.py @@ -106,9 +106,9 @@ def __init__(self, module: "DungeonModule", item_id: int): self.long_enemy_settings_name = [f"{i}: ???" for i in range(0, 256)] for spawn_type in MonsterSpawnType: self.enemy_settings_name[spawn_type.value] = f"{spawn_type.description}" - self.long_enemy_settings_name[ - spawn_type.value - ] = f"{spawn_type.value}: {spawn_type.description}" + self.long_enemy_settings_name[spawn_type.value] = ( + f"{spawn_type.value}: {spawn_type.description}" + ) self.monster_names = {} self.long_monster_names = {} @@ -119,9 +119,9 @@ def __init__(self, module: "DungeonModule", item_id: int): StringType.POKEMON_NAMES, i % num_entities ) self.monster_names[i] = f"{name}" - self.long_monster_names[ - i - ] = f"{name} ({Gender(entry.gender).name.capitalize()}) (${i:04})" + self.long_monster_names[i] = ( + f"{name} ({Gender(entry.gender).name.capitalize()}) (${i:04})" + ) for i in range(length, length + SPECIAL_MONSTERS): self.monster_names[i] = _("(Special?)") self.long_monster_names[i] = _("(Special?)") + f" (${i:04})" @@ -193,9 +193,11 @@ def on_fixed_draw_event_button_press_event(self, box, button: Gdk.EventButton): ) self._select_combobox( "utility_tile_direction", - lambda row: row[0] == action_to_copy.direction.ssa_id - if action_to_copy.direction is not None - else 0, + lambda row: ( + row[0] == action_to_copy.direction.ssa_id + if action_to_copy.direction is not None + else 0 + ), ) else: builder_get_assert( @@ -207,9 +209,11 @@ def on_fixed_draw_event_button_press_event(self, box, button: Gdk.EventButton): ) self._select_combobox( "utility_entity_direction", - lambda row: row[0] == action_to_copy.direction.ssa_id - if action_to_copy.direction is not None - else 0, + lambda row: ( + row[0] == action_to_copy.direction.ssa_id + if action_to_copy.direction is not None + else 0 + ), ) # SELECT @@ -243,9 +247,9 @@ def on_fixed_draw_event_button_release_event(self, box, button: Gdk.EventButton) old_x, old_y = self.drawer.get_selected() # abort if dragging onto same tile if old_x != tile_x or old_y != tile_y: - self.floor.actions[ - tile_y * self.floor.width + tile_x - ] = self.floor.actions[old_y * self.floor.width + old_x] + self.floor.actions[tile_y * self.floor.width + tile_x] = ( + self.floor.actions[old_y * self.floor.width + old_x] + ) # Insert floor at old position self.floor.actions[old_y * self.floor.width + old_x] = TileRule( TileRuleType.FLOOR_ROOM, None @@ -724,9 +728,9 @@ def _place(self): self.drawer.interaction_mode == InteractionMode.PLACE_TILE or self.drawer.interaction_mode == InteractionMode.PLACE_ENTITY ): - self.floor.actions[ - y * self.floor.width + x - ] = self.drawer.get_selected() + self.floor.actions[y * self.floor.width + x] = ( + self.drawer.get_selected() + ) self.module.mark_fixed_floor_as_modified(self.floor_id) @staticmethod diff --git a/skytemple/module/dungeon/controller/fixed_rooms.py b/skytemple/module/dungeon/controller/fixed_rooms.py index 81bb957dc..18c0baf41 100644 --- a/skytemple/module/dungeon/controller/fixed_rooms.py +++ b/skytemple/module/dungeon/controller/fixed_rooms.py @@ -56,9 +56,9 @@ def __init__(self, module: "DungeonModule", item_id: int): self.enemy_settings_name = [f"{i}: ???" for i in range(0, 256)] for spawn_type in MonsterSpawnType: - self.enemy_settings_name[ - spawn_type.value - ] = f"{spawn_type.value}: {spawn_type.description}" + self.enemy_settings_name[spawn_type.value] = ( + f"{spawn_type.value}: {spawn_type.description}" + ) self.monster_names = {} length = len(self.module.get_monster_md().entries) @@ -66,9 +66,9 @@ def __init__(self, module: "DungeonModule", item_id: int): name = self.module.project.get_string_provider().get_value( StringType.POKEMON_NAMES, i % FileType.MD.properties().num_entities ) - self.monster_names[ - i - ] = f"{name} ({Gender(entry.gender).print_name}) (${i:04})" + self.monster_names[i] = ( + f"{name} ({Gender(entry.gender).print_name}) (${i:04})" + ) for i in range(length, length + SPECIAL_MONSTERS): self.monster_names[i] = _("(Special?)") + f" (${i:04})" diff --git a/skytemple/module/dungeon/controller/floor.py b/skytemple/module/dungeon/controller/floor.py index a113fceb9..7a2ff2b9d 100644 --- a/skytemple/module/dungeon/controller/floor.py +++ b/skytemple/module/dungeon/controller/floor.py @@ -2301,9 +2301,9 @@ def _recalculate_spawn_chances( if sum_of_all_weights == 0: row[chance_idx] = "0.00%" else: - row[ - chance_idx - ] = f"{int(row[weight_idx]) / sum_of_all_weights * 100:.2f}%" + row[chance_idx] = ( + f"{int(row[weight_idx]) / sum_of_all_weights * 100:.2f}%" + ) # TODO: Generalize this with the base classs for lists def _get_icon(self, entid, idx): @@ -2419,9 +2419,9 @@ def _save_monster_spawn_rates(self): # divisible. Find the last non-zero we set and set it to 10000. self.entry.monsters[last_weight_main_set_idx].main_spawn_weight = u16(10000) if last_weight_mh != 0 and last_weight_mh != 10000: - self.entry.monsters[ - last_weight_mh_set_idx - ].monster_house_spawn_weight = u16(10000) + self.entry.monsters[last_weight_mh_set_idx].monster_house_spawn_weight = ( + u16(10000) + ) self.mark_as_modified() def _save_trap_spawn_rates(self): diff --git a/skytemple/module/dungeon/controller/main.py b/skytemple/module/dungeon/controller/main.py index ebb322aa8..2ea740391 100644 --- a/skytemple/module/dungeon/controller/main.py +++ b/skytemple/module/dungeon/controller/main.py @@ -540,15 +540,15 @@ def _is_regigias_special_case(self, dungeons, e): def _fix_error(self, dungeons: list[DungeonDefinition], e: DungeonValidatorError): mappa = self.module.get_mappa() if isinstance(e, DungeonTotalFloorCountInvalidError): - dungeons[ - e.dungeon_id - ].number_floors_in_group = e.expected_floor_count_in_group + dungeons[e.dungeon_id].number_floors_in_group = ( + e.expected_floor_count_in_group + ) elif isinstance(e, InvalidFloorListReferencedError) or isinstance( e, FloorReusedError ): - dungeons[ - e.dungeon_id - ].mappa_index = self.module.mappa_generate_and_insert_new_floor_list() + dungeons[e.dungeon_id].mappa_index = ( + self.module.mappa_generate_and_insert_new_floor_list() + ) dungeons[e.dungeon_id].start_after = u8(0) dungeons[e.dungeon_id].number_floors = u8(1) dungeons[e.dungeon_id].number_floors_in_group = u8(1) diff --git a/skytemple/module/dungeon/module.py b/skytemple/module/dungeon/module.py index 942911128..6aeae5afd 100644 --- a/skytemple/module/dungeon/module.py +++ b/skytemple/module/dungeon/module.py @@ -470,17 +470,19 @@ def _regenerate_dungeon_floors(self, idx, previous_floor_id): self._dungeon_floor_iters[idx] = {} dungeon.delete_all_children() for floor_i in range(0, self.get_number_floors(idx)): - self._dungeon_floor_iters[idx][ - previous_floor_id + floor_i - ] = self._item_tree.add_entry( - dungeon, - ItemTreeEntry( - icon=ICON_FLOOR, - name=self.generate_floor_label(floor_i + previous_floor_id), - module=self, - view_class=FloorController, - item_data=FloorViewInfo(previous_floor_id + floor_i, dungeon_info), - ), + self._dungeon_floor_iters[idx][previous_floor_id + floor_i] = ( + self._item_tree.add_entry( + dungeon, + ItemTreeEntry( + icon=ICON_FLOOR, + name=self.generate_floor_label(floor_i + previous_floor_id), + module=self, + view_class=FloorController, + item_data=FloorViewInfo( + previous_floor_id + floor_i, dungeon_info + ), + ), + ) ) def load_dungeons(self) -> Iterable[Union[DungeonGroup, int]]: @@ -720,9 +722,9 @@ def change_floor_count(self, dungeon_id, number_floors_new): # TODO: Unchanged new_total_floor_count = sum( [dungeon_definitions[x].number_floors for x in is_group.dungeon_ids] ) - dungeon_definitions[ - dungeon_id - ].number_floors_in_group = new_total_floor_count + dungeon_definitions[dungeon_id].number_floors_in_group = ( + new_total_floor_count + ) for dungeon_in_group in ( x for x in is_group.dungeon_ids if x != dungeon_id @@ -733,9 +735,9 @@ def change_floor_count(self, dungeon_id, number_floors_new): # TODO: Unchanged > dungeon_definitions[dungeon_id].start_after ): dungeon_definitions[dungeon_in_group].start_after += floors_added - dungeon_definitions[ - dungeon_in_group - ].number_floors_in_group = u8_checked(new_total_floor_count) + dungeon_definitions[dungeon_in_group].number_floors_in_group = ( + u8_checked(new_total_floor_count) + ) else: dungeon_definitions[dungeon_id].number_floors_in_group = number_floors_new diff --git a/skytemple/module/dungeon_graphics/controller/bg_menu.py b/skytemple/module/dungeon_graphics/controller/bg_menu.py index 1d3cc7c2f..df7bfec9f 100644 --- a/skytemple/module/dungeon_graphics/controller/bg_menu.py +++ b/skytemple/module/dungeon_graphics/controller/bg_menu.py @@ -1,4 +1,5 @@ """Sub-controller for the dungeon bg menu.""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/module/dungeon_graphics/controller/main.py b/skytemple/module/dungeon_graphics/controller/main.py index 6d5d6655e..dd2c6f2a2 100644 --- a/skytemple/module/dungeon_graphics/controller/main.py +++ b/skytemple/module/dungeon_graphics/controller/main.py @@ -193,9 +193,11 @@ def _init_values(self): store.append( [ str(i), - f"{_('Tileset')} {i}" - if i < NUMBER_OF_TILESETS - else f"{_('Background')} {i}", + ( + f"{_('Tileset')} {i}" + if i < NUMBER_OF_TILESETS + else f"{_('Background')} {i}" + ), v.map_color.value, v.stirring_effect.value, v.secret_power_effect.value, diff --git a/skytemple/module/dungeon_graphics/dungeon_bg_drawer.py b/skytemple/module/dungeon_graphics/dungeon_bg_drawer.py index 8beaa1e23..6b6666d7b 100644 --- a/skytemple/module/dungeon_graphics/dungeon_bg_drawer.py +++ b/skytemple/module/dungeon_graphics/dungeon_bg_drawer.py @@ -1,4 +1,5 @@ """Module that draws the main background DrawingArea and the chunks icon views for dungeon backgrounds""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/module/dungeon_graphics/dungeon_chunk_drawer.py b/skytemple/module/dungeon_graphics/dungeon_chunk_drawer.py index 081e56d5b..67ae9f98a 100644 --- a/skytemple/module/dungeon_graphics/dungeon_chunk_drawer.py +++ b/skytemple/module/dungeon_graphics/dungeon_chunk_drawer.py @@ -1,4 +1,5 @@ """Module that draws the chunks icon views""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/module/gfxcrunch/controller/gfxcrunch.py b/skytemple/module/gfxcrunch/controller/gfxcrunch.py index ec711abdf..059e10820 100644 --- a/skytemple/module/gfxcrunch/controller/gfxcrunch.py +++ b/skytemple/module/gfxcrunch/controller/gfxcrunch.py @@ -103,7 +103,7 @@ async def _run_gfxcrunch(self, arg_list: list[str]): stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell, - universal_newlines=True + universal_newlines=True, # creationflags= ) diff --git a/skytemple/module/lists/controller/base.py b/skytemple/module/lists/controller/base.py index a2e6f2f3e..e17e30c64 100644 --- a/skytemple/module/lists/controller/base.py +++ b/skytemple/module/lists/controller/base.py @@ -74,9 +74,9 @@ def _init_monster_store(self): name = self.module.project.get_string_provider().get_value( StringType.POKEMON_NAMES, entry.md_index_base ) - self._ent_names[ - idx - ] = f"{name} ({Gender(entry.gender).print_name}) (${idx:04})" + self._ent_names[idx] = ( + f"{name} ({Gender(entry.gender).print_name}) (${idx:04})" + ) monster_store.append([self._ent_names[idx]]) def on_draw_example_placeholder_draw( diff --git a/skytemple/module/lists/controller/tactics.py b/skytemple/module/lists/controller/tactics.py index 2579c19bb..1ddd00807 100644 --- a/skytemple/module/lists/controller/tactics.py +++ b/skytemple/module/lists/controller/tactics.py @@ -79,10 +79,12 @@ def refresh_list(self): [ str(idx), str(entry), - self.module.project.get_string_provider().get_value( - StringType.TACTICS_NAMES, idx - ) - if idx != 11 - else _(""), + ( + self.module.project.get_string_provider().get_value( + StringType.TACTICS_NAMES, idx + ) + if idx != 11 + else _("") + ), ] ) diff --git a/skytemple/module/map_bg/controller/bg_menu.py b/skytemple/module/map_bg/controller/bg_menu.py index 29e3a6fa3..325a31695 100644 --- a/skytemple/module/map_bg/controller/bg_menu.py +++ b/skytemple/module/map_bg/controller/bg_menu.py @@ -1,4 +1,5 @@ """Sub-controller for the map bg menu.""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. @@ -432,9 +433,9 @@ def on_men_chunks_layer1_edit_activate(self): new_chunk_size > self.parent.bpc.layers[bpc_layer_to_use].chunk_tilemap_len ): - self.parent.bpc.layers[ - bpc_layer_to_use - ].chunk_tilemap_len = new_chunk_size + self.parent.bpc.layers[bpc_layer_to_use].chunk_tilemap_len = ( + new_chunk_size + ) self.parent.bpc.layers[bpc_layer_to_use].tilemap = edited_mappings.copy() self.parent.reload_all() self.parent.mark_as_modified() @@ -472,9 +473,9 @@ def on_men_chunks_layer2_edit_activate(self): new_chunk_size > self.parent.bpc.layers[bpc_layer_to_use].chunk_tilemap_len ): - self.parent.bpc.layers[ - bpc_layer_to_use - ].chunk_tilemap_len = new_chunk_size + self.parent.bpc.layers[bpc_layer_to_use].chunk_tilemap_len = ( + new_chunk_size + ) self.parent.bpc.layers[bpc_layer_to_use].tilemap = edited_mappings self.parent.reload_all() self.parent.mark_as_modified() diff --git a/skytemple/module/map_bg/controller/bg_menu_dialogs/map_width_height.py b/skytemple/module/map_bg/controller/bg_menu_dialogs/map_width_height.py index 4d807c342..55aba4727 100644 --- a/skytemple/module/map_bg/controller/bg_menu_dialogs/map_width_height.py +++ b/skytemple/module/map_bg/controller/bg_menu_dialogs/map_width_height.py @@ -1,4 +1,5 @@ """Signal handlers for the map width / height dialog boxes""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/module/map_bg/drawer.py b/skytemple/module/map_bg/drawer.py index 44fc27361..5644f3804 100644 --- a/skytemple/module/map_bg/drawer.py +++ b/skytemple/module/map_bg/drawer.py @@ -1,4 +1,5 @@ """Module that draws the main background DrawingArea and the chunks icon views""" + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. diff --git a/skytemple/module/map_bg/module.py b/skytemple/module/map_bg/module.py index 0b30fe0cf..cb7d540b1 100644 --- a/skytemple/module/map_bg/module.py +++ b/skytemple/module/map_bg/module.py @@ -390,13 +390,13 @@ def get_mapping_dungeon_assets( "BALANCE/fixed.bin", FileType.FIXED_BIN, static_data=static_data ) - dungeon_bin_context: ModelContext[ - DungeonBinPack - ] = self.project.open_file_in_rom( - "DUNGEON/dungeon.bin", - FileType.DUNGEON_BIN, - static_data=static_data, - threadsafe=True, + dungeon_bin_context: ModelContext[DungeonBinPack] = ( + self.project.open_file_in_rom( + "DUNGEON/dungeon.bin", + FileType.DUNGEON_BIN, + static_data=static_data, + threadsafe=True, + ) ) dungeon_list = HardcodedDungeons.get_dungeon_list( diff --git a/skytemple/module/misc_graphics/controller/font.py b/skytemple/module/misc_graphics/controller/font.py index ea29f6a4b..2eaf92a17 100644 --- a/skytemple/module/misc_graphics/controller/font.py +++ b/skytemple/module/misc_graphics/controller/font.py @@ -269,9 +269,9 @@ def on_btn_remove_clicked(self, widget): # Deletes all selected font entries # Allows multiple deletions entry_tree = builder_get_assert(self.builder, Gtk.TreeView, "entry_tree") - active_rows: list[ - Gtk.TreePath - ] = entry_tree.get_selection().get_selected_rows()[1] + active_rows: list[Gtk.TreePath] = ( + entry_tree.get_selection().get_selected_rows()[1] + ) store = assert_not_none(cast(Optional[Gtk.ListStore], entry_tree.get_model())) assert self.font is not None for x in sorted(active_rows, key=lambda x: -x.get_indices()[0]): @@ -320,9 +320,9 @@ def draw(self, wdg, ctx: cairo.Context, *args): ctx.get_source().set_filter(cairo.Filter.NEAREST) ctx.paint() entry_tree = builder_get_assert(self.builder, Gtk.TreeView, "entry_tree") - active_rows: list[ - Gtk.TreePath - ] = entry_tree.get_selection().get_selected_rows()[1] + active_rows: list[Gtk.TreePath] = ( + entry_tree.get_selection().get_selected_rows()[1] + ) for x in active_rows: prop = self.entries[x.get_indices()[0]].get_properties() if self.font.get_entry_image_size() > 12: diff --git a/skytemple/module/misc_graphics/module.py b/skytemple/module/misc_graphics/module.py index c992e47b6..019c2ad8b 100644 --- a/skytemple/module/misc_graphics/module.py +++ b/skytemple/module/misc_graphics/module.py @@ -273,17 +273,17 @@ def load_tree_items(self, item_tree: ItemTree): if pal_name == None: none_assoc = True spec = FontOpenSpec(name, pal_name, FontType.BANNER_FONT) - self._tree_level_iter[ - spec.get_row_name() - ] = item_tree.add_entry( - root, - ItemTreeEntry( - icon="skytemple-e-graphics-symbolic", - name=spec.get_row_name(), - module=self, - view_class=FontController, - item_data=spec, - ), + self._tree_level_iter[spec.get_row_name()] = ( + item_tree.add_entry( + root, + ItemTreeEntry( + icon="skytemple-e-graphics-symbolic", + name=spec.get_row_name(), + module=self, + view_class=FontController, + item_data=spec, + ), + ) ) for i, name in enumerate(self.list_of_graphic_fonts): diff --git a/skytemple/module/monster/module.py b/skytemple/module/monster/module.py index 9513f2f59..aac2e4d0a 100644 --- a/skytemple/module/monster/module.py +++ b/skytemple/module/monster/module.py @@ -281,9 +281,7 @@ def set_shadow_size(shadow_size_id): v.show_all() return v - def get_portraits_for_export( - self, item_id - ) -> tuple[ + def get_portraits_for_export(self, item_id) -> tuple[ Optional[list[Optional[KaoImageProtocol]]], Optional[list[Optional[KaoImageProtocol]]], ]: @@ -440,13 +438,17 @@ def get_export_data(self, entry): portraits, portraits2, self.get_personality(md_gender1.md_index), - self.get_personality(md_gender2.md_index) - if md_gender2 is not None - else None, + ( + self.get_personality(md_gender2.md_index) + if md_gender2 is not None + else None + ), self.get_idle_anim_type(md_gender1.md_index), - self.get_idle_anim_type(md_gender2.md_index) - if md_gender2 is not None - else None, + ( + self.get_idle_anim_type(md_gender2.md_index) + if md_gender2 is not None + else None + ), ) def update_monster_sort_lists(self, lang): diff --git a/skytemple/module/moves_items/controller/item_lists.py b/skytemple/module/moves_items/controller/item_lists.py index f9f95636b..0c10d9107 100644 --- a/skytemple/module/moves_items/controller/item_lists.py +++ b/skytemple/module/moves_items/controller/item_lists.py @@ -709,9 +709,9 @@ def _recalculate_spawn_chances(self, store_name, weight_idx, chance_idx): if sum_of_all_weights == 0: row[chance_idx] = "0.00%" else: - row[ - chance_idx - ] = f"{int(row[weight_idx]) / sum_of_all_weights * 100:.2f}%" + row[chance_idx] = ( + f"{int(row[weight_idx]) / sum_of_all_weights * 100:.2f}%" + ) def _fill_available_categories_into_store(self, cb_store): available_categories = [ diff --git a/skytemple/module/patch/controller/asm.py b/skytemple/module/patch/controller/asm.py index a93a774ba..a3eff8f08 100644 --- a/skytemple/module/patch/controller/asm.py +++ b/skytemple/module/patch/controller/asm.py @@ -87,9 +87,9 @@ def __init__(self, module: "PatchModule", *args): self._accepted_danger = False self._category_tabs: dict[PatchCategory, Gtk.Box] = {} # category -> page - self._category_tabs_reverse: dict[ - Gtk.Widget, PatchCategory - ] = {} # page -> category + self._category_tabs_reverse: dict[Gtk.Widget, PatchCategory] = ( + {} + ) # page -> category self._current_tab: Optional[PatchCategory] = None def get_view(self) -> Gtk.Widget: @@ -449,8 +449,7 @@ def _error_or_issue( is_load: bool, is_error: Literal[True], errors_or_issues: list[ErrorsTuple], - ): - ... + ): ... @overload def _error_or_issue( @@ -458,8 +457,7 @@ def _error_or_issue( is_load: bool, is_error: Literal[False], errors_or_issues: dict[str, list[warnings.WarningMessage]], - ): - ... + ): ... def _error_or_issue(self, is_load: bool, is_error: bool, errors_or_issues): """Show the compatibility issues / patch error dialog with the appropriate content based on the situation.""" diff --git a/skytemple/module/patch/controller/pmdsky_debug.py b/skytemple/module/patch/controller/pmdsky_debug.py index 7d237e3ae..30ce114f7 100644 --- a/skytemple/module/patch/controller/pmdsky_debug.py +++ b/skytemple/module/patch/controller/pmdsky_debug.py @@ -175,10 +175,12 @@ def refresh(self): model.append( [ symbol_name, - f"0x{symbol.absolute_address:0x}" - if symbol.absolute_addresses is not None - and len(symbol.absolute_addresses) > 0 - else "???", + ( + f"0x{symbol.absolute_address:0x}" + if symbol.absolute_addresses is not None + and len(symbol.absolute_addresses) > 0 + else "???" + ), str(symbol.length if symbol.length is not None else 1), symbol.description.strip(), ] diff --git a/skytemple/module/script/controller/ssa.py b/skytemple/module/script/controller/ssa.py index 7bd38bb02..03c6507a4 100644 --- a/skytemple/module/script/controller/ssa.py +++ b/skytemple/module/script/controller/ssa.py @@ -266,9 +266,9 @@ def on_ssa_draw_event_button_release_event(self, box, button: Gdk.EventButton): assert self.ssa # PLACE place_layer = 0 - new_entity: Optional[ - Union[SsaActor, SsaObject, SsaPerformer, SsaEvent] - ] = None + new_entity: Optional[Union[SsaActor, SsaObject, SsaPerformer, SsaEvent]] = ( + None + ) if self.drawer.get_sector_highlighted() is not None: place_layer = self.drawer.get_sector_highlighted() @@ -2140,12 +2140,10 @@ def _get_event_script_name( return name @typing.overload - def _script_id(self, name: str, as_int: typing.Literal[False] = False) -> str: - ... + def _script_id(self, name: str, as_int: typing.Literal[False] = False) -> str: ... @typing.overload - def _script_id(self, name: str, as_int: typing.Literal[True]) -> int: - ... + def _script_id(self, name: str, as_int: typing.Literal[True]) -> int: ... def _script_id(self, name: str, as_int: bool = False) -> Union[str, int]: # First try to parse as an int, if this fails, the event has no script assigned. diff --git a/skytemple/module/script/module.py b/skytemple/module/script/module.py index cb039739b..8c7000109 100644 --- a/skytemple/module/script/module.py +++ b/skytemple/module/script/module.py @@ -581,9 +581,7 @@ def create_new_level(self, new_name): ) self._sub_roots[new_name] = sr - def get_subnodes( - self, name: str - ) -> tuple[ + def get_subnodes(self, name: str) -> tuple[ Optional[ItemTreeEntryRef], Optional[ItemTreeEntryRef], Optional[ItemTreeEntryRef], @@ -737,13 +735,13 @@ def get_mapping_dungeon_assets( "BALANCE/fixed.bin", FileType.FIXED_BIN, static_data=static_data ) - dungeon_bin_context: ModelContext[ - DungeonBinPack - ] = self.project.open_file_in_rom( - "DUNGEON/dungeon.bin", - FileType.DUNGEON_BIN, - static_data=static_data, - threadsafe=True, + dungeon_bin_context: ModelContext[DungeonBinPack] = ( + self.project.open_file_in_rom( + "DUNGEON/dungeon.bin", + FileType.DUNGEON_BIN, + static_data=static_data, + threadsafe=True, + ) ) dungeon_list = HardcodedDungeons.get_dungeon_list( diff --git a/skytemple/module/sprite/controller/monster_sprite.py b/skytemple/module/sprite/controller/monster_sprite.py index e456eecbe..55212cccb 100644 --- a/skytemple/module/sprite/controller/monster_sprite.py +++ b/skytemple/module/sprite/controller/monster_sprite.py @@ -181,9 +181,11 @@ def on_export_clicked(self, w: Gtk.MenuToolButton): dialog = Gtk.FileChooserNative.new( _("Export spritesheet..."), MainController.window(), - Gtk.FileChooserAction.SELECT_FOLDER - if not is_zip - else Gtk.FileChooserAction.SAVE, + ( + Gtk.FileChooserAction.SELECT_FOLDER + if not is_zip + else Gtk.FileChooserAction.SAVE + ), _("_Save"), None, ) @@ -248,11 +250,13 @@ def on_import_clicked(self, w: Gtk.MenuToolButton): Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.INFO, Gtk.ButtonsType.OK, - _("To import select the archive that contains the spritesheets.") - if self._zip_is_active() - else _( - "To import select the directory of the spritesheets. If it " - "is still zipped, unzip it first." + ( + _("To import select the archive that contains the spritesheets.") + if self._zip_is_active() + else _( + "To import select the directory of the spritesheets. If it " + "is still zipped, unzip it first." + ) ), title="SkyTemple", ) @@ -266,16 +270,18 @@ def on_import_new_clicked(self, w: Gtk.MenuToolButton): Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.INFO, Gtk.ButtonsType.OK_CANCEL, - _( - "This will insert a completely new sprite into the game's sprite file and " - "assign the new ID to the Pokémon.\n" - "If you want to instead replace the currently assigned sprite, choose 'Import'.\n" - ) - + _("To import select the archive that contains the spritesheets.") - if self._zip_is_active() - else _( - "To import select the directory of the spritesheets. If it " - "is still zipped, unzip it first." + ( + _( + "This will insert a completely new sprite into the game's sprite file and " + "assign the new ID to the Pokémon.\n" + "If you want to instead replace the currently assigned sprite, choose 'Import'.\n" + ) + + _("To import select the archive that contains the spritesheets.") + if self._zip_is_active() + else _( + "To import select the directory of the spritesheets. If it " + "is still zipped, unzip it first." + ) ), title="SkyTemple", ) @@ -294,9 +300,11 @@ def do_import(self, sprite_id: int, cb=lambda: None): dialog = Gtk.FileChooserNative.new( _("Import spritesheet..."), MainController.window(), - Gtk.FileChooserAction.SELECT_FOLDER - if not is_zip - else Gtk.FileChooserAction.OPEN, + ( + Gtk.FileChooserAction.SELECT_FOLDER + if not is_zip + else Gtk.FileChooserAction.OPEN + ), None, None, ) diff --git a/skytemple/module/sprite/module.py b/skytemple/module/sprite/module.py index d6e326eeb..5f37ff92b 100644 --- a/skytemple/module/sprite/module.py +++ b/skytemple/module/sprite/module.py @@ -307,12 +307,10 @@ def get_attack_bin_ctx(self) -> ModelContext[BinPack]: @overload def get_monster_monster_sprite_chara( self, id, raw: Literal[False] = False - ) -> WanFile: - ... + ) -> WanFile: ... @overload - def get_monster_monster_sprite_chara(self, id, raw: Literal[True]) -> bytes: - ... + def get_monster_monster_sprite_chara(self, id, raw: Literal[True]) -> bytes: ... def get_monster_monster_sprite_chara( self, id, raw: bool = False @@ -326,12 +324,10 @@ def get_monster_monster_sprite_chara( @overload def get_monster_ground_sprite_chara( self, id, raw: Literal[False] = False - ) -> WanFile: - ... + ) -> WanFile: ... @overload - def get_monster_ground_sprite_chara(self, id, raw: Literal[True]) -> bytes: - ... + def get_monster_ground_sprite_chara(self, id, raw: Literal[True]) -> bytes: ... def get_monster_ground_sprite_chara( self, id, raw: bool = False @@ -344,12 +340,10 @@ def get_monster_ground_sprite_chara( @overload def get_monster_attack_sprite_chara( self, id, raw: Literal[False] = False - ) -> WanFile: - ... + ) -> WanFile: ... @overload - def get_monster_attack_sprite_chara(self, id, raw: Literal[True]) -> bytes: - ... + def get_monster_attack_sprite_chara(self, id, raw: Literal[True]) -> bytes: ... def get_monster_attack_sprite_chara( self, id, raw: bool = False @@ -361,7 +355,11 @@ def get_monster_attack_sprite_chara( return FileType.WAN.CHARA.deserialize(decompressed) def get_monster_sprite_count(self): - with self.get_monster_bin_ctx() as monster_bin, self.get_attack_bin_ctx() as attack_bin, self.get_ground_bin_ctx() as ground_bin: + with ( + self.get_monster_bin_ctx() as monster_bin, + self.get_attack_bin_ctx() as attack_bin, + self.get_ground_bin_ctx() as ground_bin, + ): if len(monster_bin) != len(attack_bin) or len(attack_bin) != len( ground_bin ): diff --git a/skytemple/module/tiled_img/drawer_tiled.py b/skytemple/module/tiled_img/drawer_tiled.py index 94d9b439c..16f7bc854 100644 --- a/skytemple/module/tiled_img/drawer_tiled.py +++ b/skytemple/module/tiled_img/drawer_tiled.py @@ -2,6 +2,7 @@ Module that draws the icon views and drawing areas in the chunk editor. Tile based instead of chunk based. """ + # Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple.