Skip to content

Commit

Permalink
Add icon to MMC pack export (#180)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Robertz <[email protected]>
  • Loading branch information
wlhlm and Dream-Master authored Dec 2, 2024
1 parent 7233560 commit e697ee2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
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

0 comments on commit e697ee2

Please sign in to comment.