Created
October 8, 2025 11:46
-
-
Save wjt/9de53384387f2ed6e7b11ada22a0100b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: The Threadbare Authors | |
| # SPDX-License-Identifier: MPL-2.0 | |
| @tool | |
| extends EditorScript | |
| const TILESET_PATHS := [ | |
| "scenes/quests/story_quests/shjourney/2_shjourney_intro/tilesetIntro02.tres", | |
| "scenes/quests/story_quests/shjourney/3_shjourney_intro/tilesetIntro.tres", | |
| "scenes/quests/story_quests/shjourney/4_Laberinto/tileselaberinto.tres", | |
| "scenes/quests/story_quests/shjourney/5_shjourney_sequence_puzzle/tilesetMinijuego02.tres", | |
| "scenes/quests/story_quests/shjourney/7_shjourney_combate/tilesetMinijuego03.tres", | |
| "scenes/quests/story_quests/shjourney/8_shjourney_outro/tilesetOutro.tres", | |
| ] | |
| func fix(path: String) -> void: | |
| print(path) | |
| var tileset := load(path) as TileSet | |
| var sources_to_remove: Array[int] | |
| for i: int in range(tileset.get_source_count()): | |
| var source_id := tileset.get_source_id(i) | |
| var source := tileset.get_source(source_id) | |
| if source is TileSetAtlasSource: | |
| if not source.texture or not source.texture.get_size(): | |
| sources_to_remove.append(source_id) | |
| if not sources_to_remove: | |
| return | |
| prints(path, "removing sources", sources_to_remove) | |
| for source_id: int in sources_to_remove: | |
| tileset.remove_source(source_id) | |
| ResourceSaver.save(tileset) | |
| func _run() -> void: | |
| for path: String in TILESET_PATHS: | |
| fix(path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment