Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add icon to MMC pack export #180

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added client_assets/multi_poly/gtnh_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/gtnh/assembler/multi_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from gtnh.assembler.downloader import get_asset_version_cache_location
from gtnh.assembler.generic_assembler import GenericAssembler
from gtnh.defs import JAVA_9_ARCHIVE_SUFFIX, MMC_PACK_INSTANCE, MMC_PACK_JSON, RELEASE_MMC_DIR, Side
from gtnh.defs import JAVA_9_ARCHIVE_SUFFIX, MMC_ASSETS_DIR, MMC_PACK_INSTANCE, MMC_PACK_JSON, RELEASE_MMC_DIR, Side
from gtnh.models.gtnh_config import GTNHConfig
from gtnh.models.gtnh_release import GTNHRelease
from gtnh.models.gtnh_version import GTNHVersion
Expand Down Expand Up @@ -143,3 +143,6 @@ def add_mmc_meta_data(self, side: Side) -> None:
archive.writestr(
str(self.mmc_archive_root) + "/instance.cfg", MMC_PACK_INSTANCE.format(f"GTNH {self.release.version}")
)
with archive.open(str(self.mmc_archive_root) + "/gtnh_icon.png", "w") as target:
with open(MMC_ASSETS_DIR / "gtnh_icon.png", "rb") as icon:
shutil.copyfileobj(icon, target)
5 changes: 4 additions & 1 deletion src/gtnh/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
RELEASE_README_DIR = RELEASE_DIR / "readmes"

SERVER_ASSETS_DIR = ROOT_DIR / "server_assets"
CLIENT_ASSETS_DIR = ROOT_DIR / "client_assets"

MMC_ASSETS_DIR = CLIENT_ASSETS_DIR / "multi_poly"

TRANSLATION_DIR = ROOT_DIR / "translations"

Expand Down Expand Up @@ -90,7 +93,7 @@ class Archive(str, Enum):
OverrideMemory=false
OverrideNativeWorkarounds=false
OverrideWindow=false
iconKey=default
iconKey=gtnh_icon
name={}
notes=
"""
Expand Down
Loading