tilemap-editor 5.1.0__tar.gz → 5.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/CHANGELOG.md +13 -1
- {tilemap_editor-5.1.0/src/tilemap_editor.egg-info → tilemap_editor-5.2.0}/PKG-INFO +1 -1
- tilemap_editor-5.2.0/assets/icons/fill.svg +3 -0
- tilemap_editor-5.2.0/assets/icons/pick.svg +3 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/pyproject.toml +2 -1
- tilemap_editor-5.2.0/src/aliases.py +299 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/constants.py +0 -6
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/editor.py +167 -52
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/layers.py +98 -42
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/node_manager.py +30 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/character_collision/editor.py +0 -13
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_animation/editor.py +2 -17
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_animation/frame_picker.py +0 -2
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_animation/timeline.py +0 -41
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_editor/clipboard.py +7 -3
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_editor/commands.py +18 -3
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_editor/dialogs.py +5 -2
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_editor/document.py +108 -29
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_editor/editor.py +63 -29
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_editor/overlays.py +0 -1
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_editor/region_export.py +2 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_editor/selection.py +2 -3
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_editor/tools.py +60 -59
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_editor/viewport.py +33 -5
- tilemap_editor-5.2.0/src/plugins/tile_alias/__init__.py +11 -0
- tilemap_editor-5.2.0/src/plugins/tile_alias/editor.py +860 -0
- tilemap_editor-5.2.0/src/plugins/tile_alias/standalone.py +149 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/tileset_collision/collision_painter.py +58 -25
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/tileset_collision/editor.py +32 -40
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/tileset_collision/models.py +8 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/standalone_error_console.py +0 -13
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/standalone_filemanager.py +3 -20
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/standalone_image_viewer.py +0 -21
- tilemap_editor-5.2.0/src/standalone_marker_palette.py +210 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap.py +71 -12
- tilemap_editor-5.2.0/src/tilemap_editor/assets/icons/dice.svg +3 -0
- tilemap_editor-5.2.0/src/tilemap_editor/assets/icons/fill.svg +3 -0
- tilemap_editor-5.2.0/src/tilemap_editor/assets/icons/line.svg +2 -0
- tilemap_editor-5.2.0/src/tilemap_editor/assets/icons/pick.svg +3 -0
- tilemap_editor-5.2.0/src/tilemap_editor/assets/icons/rect.svg +2 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/cli.py +22 -14
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/settings.py +8 -1
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0/src/tilemap_editor.egg-info}/PKG-INFO +1 -1
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor.egg-info/SOURCES.txt +43 -1
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor.egg-info/top_level.txt +1 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/context_dispatch.py +0 -2
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/error_handler.py +0 -15
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/font_manager.py +11 -21
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/icon_manager.py +0 -9
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/icons_cache.py +0 -19
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/serialization.py +0 -1
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/tileset_hierarchy.py +1 -3
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/tileset_ops.py +0 -19
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/automap_models.py +0 -160
- tilemap_editor-5.2.0/src/widgets/autotile_template.py +540 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/autotiler.py +386 -111
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/filemanager.py +339 -189
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/layer_selector.py +136 -120
- tilemap_editor-5.2.0/src/widgets/minimap.py +226 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/regex_automap_designer.py +0 -106
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/tile_grid.py +844 -68
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/tile_selector.py +19 -45
- tilemap_editor-5.2.0/src/widgets/ui/alias_palette.py +426 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/checkbox.py +0 -6
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/collision_layer_mask.py +0 -3
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/collision_layer_sidebar.py +0 -2
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/context_menu.py +0 -1
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/layer_type_dialog.py +0 -6
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/menubar.py +55 -3
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/mode_indicator.py +0 -17
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/node_editor.py +152 -83
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/node_selector.py +101 -7
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/region_selector.py +0 -28
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/resize_map_dialog.py +0 -4
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/scrollbar.py +0 -1
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/status_bar.py +0 -15
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/theme.py +107 -71
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/tileset_type_dialog.py +0 -7
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/tool_manager.py +4 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/toolbar.py +32 -9
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/tree_widget.py +0 -2
- tilemap_editor-5.2.0/tests/test_alias_composer.py +406 -0
- tilemap_editor-5.2.0/tests/test_alias_format.py +102 -0
- tilemap_editor-5.2.0/tests/test_alias_palette.py +475 -0
- tilemap_editor-5.2.0/tests/test_autotile_group_delete.py +87 -0
- tilemap_editor-5.2.0/tests/test_autotile_ownership.py +214 -0
- tilemap_editor-5.2.0/tests/test_autotile_rules.py +138 -0
- tilemap_editor-5.2.0/tests/test_autotile_subcases.py +517 -0
- tilemap_editor-5.2.0/tests/test_autotile_templates.py +257 -0
- tilemap_editor-5.2.0/tests/test_dice_brush.py +250 -0
- tilemap_editor-5.2.0/tests/test_edit_menu.py +201 -0
- tilemap_editor-5.2.0/tests/test_filemanager_ui.py +303 -0
- tilemap_editor-5.2.0/tests/test_fill_tool.py +166 -0
- tilemap_editor-5.2.0/tests/test_history_nodes.py +166 -0
- tilemap_editor-5.2.0/tests/test_key_conflicts.py +190 -0
- tilemap_editor-5.2.0/tests/test_layer_selector_keys.py +145 -0
- tilemap_editor-5.2.0/tests/test_layer_selector_ops.py +370 -0
- tilemap_editor-5.2.0/tests/test_line_tool.py +192 -0
- tilemap_editor-5.2.0/tests/test_marker_palette.py +194 -0
- tilemap_editor-5.2.0/tests/test_minimap.py +263 -0
- tilemap_editor-5.2.0/tests/test_node_hotkeys.py +105 -0
- tilemap_editor-5.2.0/tests/test_node_panels.py +397 -0
- tilemap_editor-5.2.0/tests/test_pick_tool.py +120 -0
- tilemap_editor-5.2.0/tests/test_rect_fill.py +218 -0
- tilemap_editor-5.2.0/tests/test_replace_variant.py +141 -0
- tilemap_editor-5.2.0/tests/test_settings_migration.py +27 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_sprite_editor_commands.py +147 -1
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_sprite_editor_drop.py +39 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_sprite_editor_interaction.py +155 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_sprite_editor_models.py +8 -5
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_theme.py +30 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_tile_selector_pick.py +11 -0
- tilemap_editor-5.2.0/tests/test_tileset_collision_flip.py +262 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_tileset_hierarchy.py +3 -0
- tilemap_editor-5.2.0/tests/test_tool_shortcuts.py +102 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_toolbar_tools.py +180 -0
- tilemap_editor-5.2.0/tests/test_view_menu.py +163 -0
- tilemap_editor-5.1.0/src/widgets/autotile_template.py +0 -248
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/LICENSE +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/MANIFEST.in +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/README.md +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/fonts/jetbrain-fonts/JetBrainsMono-Bold.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/fonts/jetbrain-fonts/JetBrainsMono-BoldItalic.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/fonts/jetbrain-fonts/JetBrainsMono-Italic.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/fonts/jetbrain-fonts/JetBrainsMono-Regular.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/fonts/noto/NotoSans-Bold.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/fonts/noto/NotoSans-BoldItalic.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/fonts/noto/NotoSans-Italic.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/fonts/noto/NotoSans-Regular.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/arrow-down.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/check.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/checked.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/close.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/duplicate.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/error.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/file.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/filedead.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/fit.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/folder.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/grid.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/image.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/info.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/load.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/loop.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/onion.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/pan.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/pause.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/pencil.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/play.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/plus.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/radio.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/reset.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/save.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/skip-back.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/skip-forward.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/stop.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/tilemap.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/tileset.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/unchecked.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/warning.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/zoomin.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/assets/icons/zoomout.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/setup.cfg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/event_map.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/main.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/nodes.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/__init__.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/character_collision/__init__.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/character_collision/models.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/character_collision/protocols.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/character_collision/shape_editor.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/character_collision/standalone.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/object_tileset_collision/__init__.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/object_tileset_collision/editor.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/object_tileset_collision/models.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/object_tileset_collision/protocols.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/object_tileset_collision/standalone.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_animation/__init__.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_animation/__main__.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_animation/clipboard_util.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_animation/models.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_animation/preview.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_animation/protocols.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_animation/runtime_load.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_animation/standalone.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_animation/validation.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_editor/__init__.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_editor/camera.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/sprite_editor/standalone.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/tileset_collision/__init__.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/tileset_collision/protocols.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/plugins/tileset_collision/standalone.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/run.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/standalone_automap.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/__init__.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/__main__.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/__init__.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/fonts/jetbrain-fonts/JetBrainsMono-Bold.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/fonts/jetbrain-fonts/JetBrainsMono-BoldItalic.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/fonts/jetbrain-fonts/JetBrainsMono-Italic.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/fonts/jetbrain-fonts/JetBrainsMono-Regular.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/fonts/noto/NotoSans-Bold.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/fonts/noto/NotoSans-BoldItalic.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/fonts/noto/NotoSans-Italic.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/fonts/noto/NotoSans-Regular.ttf +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/ToolMove.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/arrow-down.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/check.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/checked.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/close.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/duplicate.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/error.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/file.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/filedead.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/fit.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/fold_down_arrow.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/folder.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/gear.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/grid.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/image.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/info.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/load.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/loop.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/miniobj.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/onion.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/pan.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/pause.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/pencil.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/play.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/plus.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/radio.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/redo.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/reset.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/save.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/skip-back.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/skip-forward.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/stop.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/text.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/tilemap.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/tileset.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/unchecked.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/undo.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/unfold_right_arrow.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/warning.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/zoomin.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/assets/icons/zoomout.svg +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor/main.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor.egg-info/dependency_links.txt +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor.egg-info/entry_points.txt +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/tilemap_editor.egg-info/requires.txt +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/ttypes/__init__.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/ttypes/tilemap.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/__init__.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/editor_preference.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/history.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/log_capture.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/natural_sort.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/project_paths.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/property_suggestions.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/standalone.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/utils/validation.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/__init__.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/input.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/map_properties.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/mapsetup.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/particle_presets.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/particle_system.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/button.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/confirm_dialog.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/dialog_base.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/drag_tracker.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/draw_utils.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/fileinput.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/label.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/notification.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/particle_config_dialog.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/property_editor.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/sidebar_container.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/splitter.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/toast.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/ui/tooltip.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/src/widgets/widget_base.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_animation_library_grid_offset.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_collision_layer_mask.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_collision_layer_sidebar.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_context_dispatch.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_drag_tracker.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_editor_pan_mode.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_gid_collision.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_image_layers.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_layers_autotile.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_map_resize_model.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_natural_sort.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_object_animation.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_object_properties_context.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_project_paths.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_render_scale.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_sandbox_mode.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_serialization_regression.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_sprite_animation_editor_grid.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_sprite_animation_gestures.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_sprite_editor_stack.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_tile_grid_selection.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_tilemap_save.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_tileset_integrity.py +0 -0
- {tilemap_editor-5.1.0 → tilemap_editor-5.2.0}/tests/test_timeline_invalidate_cache.py +0 -0
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
<!-- towncrier release notes start -->
|
|
4
|
-
# tilemap_editor 5.2.0 (2026-09-
|
|
4
|
+
# tilemap_editor 5.2.0 (2026-09-11)
|
|
5
5
|
|
|
6
6
|
## Features
|
|
7
7
|
|
|
8
8
|
- **Background layer support** — load and display image layers from your map. The first image layer loads automatically as the background, and can place additional layers manually.
|
|
9
9
|
- **Object animation** — animate objects on object layers with per-object or shared tileset animation strips. Configure frame count, duration, loop mode, and custom frame order. Objects without animation fall back to their tileset's shared strip automatically.
|
|
10
|
+
- **Ordered tile-animation sequences** — play frame sequences across separate spritesheets: pick frames in order from any loaded tileset instead of relying on row stride. Invalid sequences are rejected before saving, so saved maps stay intact. (54-tile-sequences)
|
|
11
|
+
- **Alias composer** — author tile-pattern brushes with a standalone composer and palette. Patterns save as `*.alias.json` sidecars per tileset and reload live in the editor.
|
|
12
|
+
- **Autotile upgrades** — 4x4/5x5 strips with ownership tracking, hierarchical classification via distance-2 subcases, and template management with hardened asserts.
|
|
13
|
+
- **New paint tools** — dice (random) brush, rect fill, line tool, replace-variant, and a marker palette with preview gating.
|
|
14
|
+
- **Minimap** — tile-view minimap for navigation.
|
|
15
|
+
- **Collision editor** — body-drag, per-tile flip flags, and baked mirror actions.
|
|
16
|
+
- **Sprite editor** — recency-ordered paste, auto-trim on content delete, internal tiles preferred over OS paths on paste, plus model/tools/persistence/viewport review fixes.
|
|
17
|
+
- **Layer control** — layer toggle and slope flag on marker generation.
|
|
10
18
|
|
|
11
19
|
## Bug Fixes
|
|
12
20
|
|
|
13
21
|
- Fixed image-layer metadata round-trip: persists `metadata` alongside `properties` in save/load, guards image handle/rect calls against partial `image_rect`, coerces `custom_frames` to int, centralizes frame-aware object selection, avoids `anim_*` collisions via explicit mapping, and handles `OSError` in image validation. (#999)
|
|
22
|
+
- Fixed autotile duplication and event behavior: orphaned subcase leaves are dropped when variant ids change, and corrupted persisted autotile data no longer crashes map load.
|
|
23
|
+
- Fixed collision body-drag state corruption on mid-interaction polygon delete and mirror overwriting unselected tiles; marker slope polygons now render correctly at cell boundaries; minimap keeps minimum 1px dimensions.
|
|
24
|
+
- Fixed view checkboxes, node keys, pick/fill tools, edit menu, shortcuts, rule ops, themes, filemanager refresh, and ESC scope.
|
|
25
|
+
- Fixed modal palette help and exact tileset resolution, plus sprite editor trim/composer/palette issues.
|
|
14
26
|
|
|
15
27
|
|
|
16
28
|
# tilemap_editor 5.0.1 (2026-08-30)
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<!-- Source: godotengine/godot 4.7 editor/icons/Bucket.svg (see that repo's license).
|
|
2
|
+
Used as the Flood Fill toolbar icon. -->
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#e0e0e0" d="M8.693 2.51a.754.754 0 0 0-1.067 0l-.8.8 1.538 1.54a1.132 1.132 0 1 1-1.066 1.066l-1.54-1.54-.8.8-1.6-1.6A.754.754 0 0 1 4.425 2.51l3.273 3.273a.754.754 0 1 0 .533-.533L4.958 1.977A1.509 1.509 0 0 0 2.824 4.11l1.6 1.6-3.2 3.201a.754.754 0 0 0 0 1.067l4.268 4.268a.754.754 0 0 0 1.067 0l6.935-6.935zm4.801 5.869c-1.51 2.263-1.51 2.263-1.51 3.018 0 .754.756 1.509 1.51 1.509s1.51-.755 1.51-1.51c0-.754 0-.754-1.51-3.017z"/></svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<!-- Source: godotengine/godot 4.7 editor/icons/ColorPick.svg (see that repo's license).
|
|
2
|
+
Used as the Pick (eyedropper) toolbar icon. -->
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#e0e0e0" d="m8 1c-1.108 0-2 .892-2 2v2h-1v2h1v5a2 2 0 0 0 1 1.7285v1.2715h2v-1.2695a2 2 0 0 0 1-1.7305v-5h1v-2h-1v-2c0-1.108-.892-2-2-2zm-1 6h2v5a1 1 0 0 1 -1 1 1 1 0 0 1 -1-1z"/></svg>
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tilemap-editor"
|
|
7
|
-
version = "5.
|
|
7
|
+
version = "5.2.0"
|
|
8
8
|
description = "Pygame tilemap editor with collision, animation, sprite & particle tools"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -74,6 +74,7 @@ py-modules = [
|
|
|
74
74
|
"standalone_image_viewer",
|
|
75
75
|
"standalone_automap",
|
|
76
76
|
"standalone_error_console",
|
|
77
|
+
"standalone_marker_palette",
|
|
77
78
|
]
|
|
78
79
|
|
|
79
80
|
[tool.setuptools.packages.find]
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
"""Alias (pattern brush) library — sidecar model, no UI.
|
|
2
|
+
|
|
3
|
+
One ``*.alias.json`` file per tileset under ``data/aliases/``::
|
|
4
|
+
|
|
5
|
+
{"version": 1, "tileset": "tiles/stone.png", "aliases": [
|
|
6
|
+
{"name": "WallEnd", "w": 3, "h": 2,
|
|
7
|
+
"cells": [[dx, dy, variant], ...]}]}
|
|
8
|
+
|
|
9
|
+
Aliases are tile-only: a (tileset identity, local pattern) pair. No
|
|
10
|
+
objects, no layer references. Malformed entries are skipped on load so
|
|
11
|
+
one bad leaf cannot break the palette; valid data round-trips exactly.
|
|
12
|
+
Saves are atomic.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import os
|
|
19
|
+
import tempfile
|
|
20
|
+
from dataclasses import dataclass, field
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
from typing import Any
|
|
23
|
+
|
|
24
|
+
ALIAS_VERSION = 1
|
|
25
|
+
ALIAS_SUFFIX = ".alias.json"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@dataclass
|
|
29
|
+
class AliasPattern:
|
|
30
|
+
"""A named multi-cell tile pattern within one tileset."""
|
|
31
|
+
|
|
32
|
+
name: str
|
|
33
|
+
w: int
|
|
34
|
+
h: int
|
|
35
|
+
cells: list[tuple[int, int, int]] = field(default_factory=list)
|
|
36
|
+
|
|
37
|
+
def to_dict(self) -> dict[str, Any]:
|
|
38
|
+
return {
|
|
39
|
+
"name": self.name,
|
|
40
|
+
"w": self.w,
|
|
41
|
+
"h": self.h,
|
|
42
|
+
"cells": [[dx, dy, v] for dx, dy, v in self.cells],
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@staticmethod
|
|
46
|
+
def from_dict(data: Any) -> AliasPattern | None:
|
|
47
|
+
"""Parse one alias; return None when malformed."""
|
|
48
|
+
if not isinstance(data, dict):
|
|
49
|
+
return None
|
|
50
|
+
name = data.get("name")
|
|
51
|
+
w, h = data.get("w"), data.get("h")
|
|
52
|
+
if (not isinstance(name, str) or not name
|
|
53
|
+
or not isinstance(w, int) or not isinstance(h, int)
|
|
54
|
+
or w <= 0 or h <= 0):
|
|
55
|
+
return None
|
|
56
|
+
raw_cells = data.get("cells")
|
|
57
|
+
if not isinstance(raw_cells, list):
|
|
58
|
+
return None
|
|
59
|
+
cells: list[tuple[int, int, int]] = []
|
|
60
|
+
seen: set[tuple[int, int]] = set()
|
|
61
|
+
for entry in raw_cells:
|
|
62
|
+
if (not isinstance(entry, (list, tuple)) or len(entry) != 3):
|
|
63
|
+
continue
|
|
64
|
+
dx, dy, variant = entry
|
|
65
|
+
if (not isinstance(dx, int) or not isinstance(dy, int)
|
|
66
|
+
or not isinstance(variant, int)):
|
|
67
|
+
continue
|
|
68
|
+
if not (0 <= dx < w and 0 <= dy < h and variant >= 0):
|
|
69
|
+
continue
|
|
70
|
+
if (dx, dy) in seen:
|
|
71
|
+
continue
|
|
72
|
+
seen.add((dx, dy))
|
|
73
|
+
cells.append((dx, dy, variant))
|
|
74
|
+
if not cells:
|
|
75
|
+
return None
|
|
76
|
+
return AliasPattern(name=name, w=w, h=h, cells=cells)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@dataclass
|
|
80
|
+
class AliasFile:
|
|
81
|
+
"""All aliases authored against a single tileset."""
|
|
82
|
+
|
|
83
|
+
tileset: str = ""
|
|
84
|
+
aliases: list[AliasPattern] = field(default_factory=list)
|
|
85
|
+
|
|
86
|
+
def by_name(self, name: str) -> AliasPattern | None:
|
|
87
|
+
for alias in self.aliases:
|
|
88
|
+
if alias.name == name:
|
|
89
|
+
return alias
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
def to_dict(self) -> dict[str, Any]:
|
|
93
|
+
return {
|
|
94
|
+
"version": ALIAS_VERSION,
|
|
95
|
+
"tileset": self.tileset,
|
|
96
|
+
"aliases": [a.to_dict() for a in self.aliases],
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@staticmethod
|
|
100
|
+
def from_dict(data: Any) -> AliasFile:
|
|
101
|
+
if not isinstance(data, dict):
|
|
102
|
+
return AliasFile()
|
|
103
|
+
tileset = data.get("tileset", "")
|
|
104
|
+
raw = data.get("aliases", [])
|
|
105
|
+
aliases: list[AliasPattern] = []
|
|
106
|
+
seen: set[str] = set()
|
|
107
|
+
if isinstance(raw, list):
|
|
108
|
+
for entry in raw:
|
|
109
|
+
alias = AliasPattern.from_dict(entry)
|
|
110
|
+
if alias is None or alias.name in seen:
|
|
111
|
+
continue
|
|
112
|
+
seen.add(alias.name)
|
|
113
|
+
aliases.append(alias)
|
|
114
|
+
return AliasFile(
|
|
115
|
+
tileset=tileset if isinstance(tileset, str) else "",
|
|
116
|
+
aliases=aliases,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
@staticmethod
|
|
120
|
+
def load(path: str | Path) -> AliasFile:
|
|
121
|
+
try:
|
|
122
|
+
with open(path) as f:
|
|
123
|
+
return AliasFile.from_dict(json.load(f))
|
|
124
|
+
except (OSError, ValueError):
|
|
125
|
+
return AliasFile()
|
|
126
|
+
|
|
127
|
+
def save(self, path: str | Path) -> None:
|
|
128
|
+
"""Atomic write so a crash never half-writes."""
|
|
129
|
+
path = Path(path)
|
|
130
|
+
if path.parent and not path.parent.exists():
|
|
131
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
132
|
+
fd, tmp = tempfile.mkstemp(
|
|
133
|
+
dir=str(path.parent), prefix=path.name + ".", suffix=".tmp")
|
|
134
|
+
try:
|
|
135
|
+
with os.fdopen(fd, "w") as f:
|
|
136
|
+
json.dump(self.to_dict(), f, indent=2)
|
|
137
|
+
os.replace(tmp, path)
|
|
138
|
+
except BaseException:
|
|
139
|
+
try:
|
|
140
|
+
os.unlink(tmp)
|
|
141
|
+
except OSError:
|
|
142
|
+
pass
|
|
143
|
+
raise
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def alias_path_for(aliases_dir: str | Path, stem: str) -> Path:
|
|
147
|
+
return Path(aliases_dir) / f"{stem}{ALIAS_SUFFIX}"
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def alias_key_for(tileset_ref: str) -> str:
|
|
151
|
+
"""Collision-free sidecar key for a tileset ref.
|
|
152
|
+
|
|
153
|
+
Bare filenames map to their stem (identical to the legacy layout,
|
|
154
|
+
so existing single-level sidecars keep working). Project-relative
|
|
155
|
+
refs with directories are namespaced by joining the suffix-less
|
|
156
|
+
parts with ``__``, so ``a/stone.png`` and ``b/stone.png`` get
|
|
157
|
+
separate files. Refs escaping the project root (``..``) fall back
|
|
158
|
+
to the legacy stem: they cannot be namespaced meaningfully.
|
|
159
|
+
"""
|
|
160
|
+
ref = (tileset_ref or "").replace("\\", "/").strip()
|
|
161
|
+
if not ref:
|
|
162
|
+
return ""
|
|
163
|
+
base = ref.rsplit("/", 1)[-1]
|
|
164
|
+
stem = base.rsplit(".", 1)[0] if "." in base else base
|
|
165
|
+
if "/" not in ref:
|
|
166
|
+
return stem
|
|
167
|
+
no_suffix = ref[: -len("." + ref.rsplit(".", 1)[1])] if "." in ref.rsplit("/", 1)[-1] else ref
|
|
168
|
+
parts = [p for p in no_suffix.split("/") if p not in ("", ".")]
|
|
169
|
+
if not parts or ".." in parts:
|
|
170
|
+
return stem
|
|
171
|
+
return "__".join(parts)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def resolve_alias_path(aliases_dir: str | Path, tileset_ref: str) -> Path:
|
|
175
|
+
"""Save path for a tileset ref (namespaced; bare names = legacy stem)."""
|
|
176
|
+
return alias_path_for(aliases_dir, alias_key_for(tileset_ref))
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def load_alias_path(aliases_dir: str | Path, tileset_ref: str) -> Path | None:
|
|
180
|
+
"""Existing sidecar for a ref: namespaced first, then legacy stem."""
|
|
181
|
+
key = alias_key_for(tileset_ref)
|
|
182
|
+
namespaced = alias_path_for(aliases_dir, key)
|
|
183
|
+
if namespaced.exists():
|
|
184
|
+
return namespaced
|
|
185
|
+
legacy_stem = Path(tileset_ref.replace("\\", "/")).stem
|
|
186
|
+
if legacy_stem and legacy_stem != key:
|
|
187
|
+
legacy = alias_path_for(aliases_dir, legacy_stem)
|
|
188
|
+
if legacy.exists():
|
|
189
|
+
return legacy
|
|
190
|
+
return namespaced if namespaced.exists() else None
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def resolve_tileset(matches: list, ref: str, base: str | Path | None = None) -> int | None:
|
|
194
|
+
"""Index into tileset-likes (each with a ``path`` attr) for an alias ref.
|
|
195
|
+
|
|
196
|
+
Full normalized-path equality wins; basename/stem fallbacks only
|
|
197
|
+
resolve when they identify exactly one loaded tileset, so
|
|
198
|
+
``a/stone.png`` vs ``b/stone.png`` never silently picks wrong.
|
|
199
|
+
When ``base`` is given, each candidate path and the ref are first
|
|
200
|
+
compared as project-relative refs against that root, so an
|
|
201
|
+
absolute ``TilesetData.path`` still exact-matches a stored
|
|
202
|
+
project-relative ref.
|
|
203
|
+
"""
|
|
204
|
+
import os
|
|
205
|
+
|
|
206
|
+
ref = ref or ""
|
|
207
|
+
norm_ref = os.path.normpath(ref)
|
|
208
|
+
base_ref = os.path.basename(norm_ref)
|
|
209
|
+
stem_ref = os.path.splitext(base_ref)[0]
|
|
210
|
+
if base is not None:
|
|
211
|
+
try:
|
|
212
|
+
from utils.project_paths import to_project_path
|
|
213
|
+
|
|
214
|
+
norm_ref_proj = os.path.normpath(to_project_path(ref, Path(base)))
|
|
215
|
+
except Exception:
|
|
216
|
+
norm_ref_proj = norm_ref
|
|
217
|
+
else:
|
|
218
|
+
norm_ref_proj = None
|
|
219
|
+
base_hits: list[int] = []
|
|
220
|
+
stem_hits: list[int] = []
|
|
221
|
+
for idx, ts in enumerate(matches):
|
|
222
|
+
p = os.path.normpath(str(getattr(ts, "path", "") or ""))
|
|
223
|
+
if not p or p == ".":
|
|
224
|
+
continue
|
|
225
|
+
if p == norm_ref:
|
|
226
|
+
return idx
|
|
227
|
+
if norm_ref_proj is not None:
|
|
228
|
+
try:
|
|
229
|
+
from utils.project_paths import to_project_path
|
|
230
|
+
|
|
231
|
+
cand_proj = os.path.normpath(
|
|
232
|
+
to_project_path(getattr(ts, "path", "") or "", Path(base)))
|
|
233
|
+
except Exception:
|
|
234
|
+
cand_proj = None
|
|
235
|
+
if cand_proj is not None and cand_proj == norm_ref_proj:
|
|
236
|
+
return idx
|
|
237
|
+
base_name = os.path.basename(p)
|
|
238
|
+
if base_ref and base_name == base_ref:
|
|
239
|
+
base_hits.append(idx)
|
|
240
|
+
elif stem_ref and os.path.splitext(base_name)[0] == stem_ref:
|
|
241
|
+
stem_hits.append(idx)
|
|
242
|
+
if len(base_hits) == 1:
|
|
243
|
+
return base_hits[0]
|
|
244
|
+
if len(stem_hits) == 1:
|
|
245
|
+
return stem_hits[0]
|
|
246
|
+
return None
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
class AliasScope:
|
|
250
|
+
"""Aggregates one scope (several alias files) with mtime tracking.
|
|
251
|
+
|
|
252
|
+
The editor palette polls :meth:`changed` to reload files the
|
|
253
|
+
standalone composer saved — no IPC needed.
|
|
254
|
+
"""
|
|
255
|
+
|
|
256
|
+
def __init__(self, aliases_dir: str | Path, stems: list[str]):
|
|
257
|
+
self.aliases_dir = Path(aliases_dir)
|
|
258
|
+
self.stems = list(stems)
|
|
259
|
+
self.files: dict[str, AliasFile] = {}
|
|
260
|
+
self._mtimes: dict[str, float] = {}
|
|
261
|
+
self.refresh(force=True)
|
|
262
|
+
|
|
263
|
+
def refresh(self, force: bool = False) -> bool:
|
|
264
|
+
"""(Re)load files whose mtime moved. Returns True if anything changed."""
|
|
265
|
+
changed = False
|
|
266
|
+
for stem in self.stems:
|
|
267
|
+
path = alias_path_for(self.aliases_dir, stem)
|
|
268
|
+
try:
|
|
269
|
+
mtime = path.stat().st_mtime
|
|
270
|
+
except OSError:
|
|
271
|
+
mtime = -1.0
|
|
272
|
+
if force or mtime != self._mtimes.get(stem):
|
|
273
|
+
self._mtimes[stem] = mtime
|
|
274
|
+
self.files[stem] = AliasFile.load(path)
|
|
275
|
+
changed = True
|
|
276
|
+
return changed
|
|
277
|
+
|
|
278
|
+
def changed(self) -> bool:
|
|
279
|
+
"""True if any scoped file appeared, vanished, or was rewritten."""
|
|
280
|
+
for stem in self.stems:
|
|
281
|
+
path = alias_path_for(self.aliases_dir, stem)
|
|
282
|
+
try:
|
|
283
|
+
mtime = path.stat().st_mtime
|
|
284
|
+
except OSError:
|
|
285
|
+
mtime = -1.0
|
|
286
|
+
if mtime != self._mtimes.get(stem):
|
|
287
|
+
return True
|
|
288
|
+
return False
|
|
289
|
+
|
|
290
|
+
def all_aliases(self) -> list[tuple[str, str, AliasPattern]]:
|
|
291
|
+
"""(stem, tileset, pattern) triples across the scope, in scope order."""
|
|
292
|
+
out = []
|
|
293
|
+
for stem in self.stems:
|
|
294
|
+
af = self.files.get(stem)
|
|
295
|
+
if af is None:
|
|
296
|
+
continue
|
|
297
|
+
for alias in af.aliases:
|
|
298
|
+
out.append((stem, af.tileset, alias))
|
|
299
|
+
return out
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import sys
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
|
|
4
|
-
# Handle PyInstaller bundled execution
|
|
5
|
-
# When frozen (built with PyInstaller), sys._MEIPASS contains the temp directory
|
|
6
|
-
# where bundled files are extracted. Otherwise, use the normal project structure.
|
|
7
4
|
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
|
|
8
|
-
# Running as compiled executable
|
|
9
5
|
BASE_PATH = Path(sys._MEIPASS)
|
|
10
6
|
else:
|
|
11
|
-
# Running as script
|
|
12
7
|
BASE_PATH = Path(__file__).parent.parent
|
|
13
8
|
THEME_PATH = BASE_PATH / "src" / "themes"
|
|
14
9
|
|
|
@@ -18,6 +13,5 @@ INTELLISENSE_DEPTH = 3
|
|
|
18
13
|
IGNORE_DIRS = {".git", "__pycache__", "node_modules", "venv", ".venv", "build", "dist"}
|
|
19
14
|
MAX_LOG_FILES = 20
|
|
20
15
|
|
|
21
|
-
# Image preview spritesheet settings
|
|
22
16
|
SPRITESHEET_THRESHOLD_WIDTH = 800
|
|
23
17
|
SPRITESHEET_THRESHOLD_HEIGHT = 600
|