From 7e6b4727d8715783e96b3112e3da2531d8bf1432 Mon Sep 17 00:00:00 2001 From: MaXFeeD Date: Thu, 25 Sep 2025 20:10:10 +0300 Subject: [PATCH] Project availability mistypos, fix defaults --- .gitignore | 8 ++++++++ src/icmtoolchain/__init__.py | 3 +-- src/icmtoolchain/language.py | 2 +- src/icmtoolchain/mod_structure.py | 2 +- src/icmtoolchain/resources.py | 2 +- src/icmtoolchain/task.py | 1 + 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 3a8816c..7fe7481 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,11 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + +# Horizon Toolchain +output/ +.toolchain.tsconfig.json +/examples/**/*.zip +/examples/**/*.icmod +/examples/**/*.icpack +/examples/**/*.hzpack diff --git a/src/icmtoolchain/__init__.py b/src/icmtoolchain/__init__.py index caf0332..1e6f053 100644 --- a/src/icmtoolchain/__init__.py +++ b/src/icmtoolchain/__init__.py @@ -191,8 +191,7 @@ class Globals: return self.parameter_signature def is_project_available(self, which_project: Optional[str] = None): - from .make_config import MakeConfig - if not isinstance(self.PREFERRED_CONFIG, MakeConfig): + if not isinstance(self.PREFERRED_CONFIG, MakeDataConfig): return False return which_project is None or which_project == self.MAKE_CONFIG.current_project diff --git a/src/icmtoolchain/language.py b/src/icmtoolchain/language.py index cf01561..b7b604e 100644 --- a/src/icmtoolchain/language.py +++ b/src/icmtoolchain/language.py @@ -108,7 +108,7 @@ class MakeModpackData(FlushableMakeProjectData): version_name: Union[MutableMapping[str, str], str] = "1.0" version_code: int = 1 description: Union[MutableMapping[str, str], str] = "" - icon: Optional[str] = "pack_icon.png" + icon: Optional[str] = None def flush_to_output(self, directory: str) -> int: manifest_file = join(directory, "modpack.json") diff --git a/src/icmtoolchain/mod_structure.py b/src/icmtoolchain/mod_structure.py index 09f8f65..202cbd4 100644 --- a/src/icmtoolchain/mod_structure.py +++ b/src/icmtoolchain/mod_structure.py @@ -197,7 +197,7 @@ class LinkedResourceStorage: def append_resource(self, relative_path: str, output_path: str, **properties: Any) -> None: for linked_resource in self.contents: if relative_path == linked_resource["relative_path"] and output_path == linked_resource["output_path"]: - attention(f"Duplicate resource directory {relative_path}, skipping it...") + attention(f"Duplicate resource directory {relative_path!r}, skipping it...") return self.contents.append({ "relative_path": relative_path, diff --git a/src/icmtoolchain/resources.py b/src/icmtoolchain/resources.py index f50f2b2..ad5117b 100644 --- a/src/icmtoolchain/resources.py +++ b/src/icmtoolchain/resources.py @@ -135,7 +135,7 @@ def build_package() -> int: elif isdir(input_resource): copy_directory(input_resource, output_package_resource) else: - attention(f"We cannot copy {linked_resource['relative_path']} resource because we could not determine its type.") + attention(f"We cannot copy resource {linked_resource['relative_path']!r} because we could not determine its type.") for path in GLOBALS.MAKE_CONFIG.obtain_list("excludeFromRelease"): for excluded_path in expand_paths(join(output_package_directory, path)): remove_tree(excluded_path) diff --git a/src/icmtoolchain/task.py b/src/icmtoolchain/task.py index 0dd1091..94ece47 100644 --- a/src/icmtoolchain/task.py +++ b/src/icmtoolchain/task.py @@ -200,6 +200,7 @@ def task_update_includes() -> int: def task_resources() -> int: from .resources import (build_additional_resources, build_pack_graphics, build_resources) + overall_result = 0 if GLOBALS.MAKE_CONFIG.supports_resources: overall_result = build_resources() if overall_result == 0 and GLOBALS.MAKE_CONFIG.supports_pack_graphics: