From a99dc0cd6113b480cffee0b58dc8339596411c3c Mon Sep 17 00:00:00 2001 From: Miepee Date: Sat, 13 Jul 2024 12:42:15 +0200 Subject: [PATCH] Rename fields --- src/mercury_engine_data_structures/cli.py | 4 --- .../formats/bmsem.py | 30 +++++++++---------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/mercury_engine_data_structures/cli.py b/src/mercury_engine_data_structures/cli.py index 044b93b9..211870bb 100644 --- a/src/mercury_engine_data_structures/cli.py +++ b/src/mercury_engine_data_structures/cli.py @@ -8,15 +8,11 @@ from pathlib import Path from typing import Optional -import construct - from mercury_engine_data_structures import formats from mercury_engine_data_structures.construct_extensions.json import convert_to_raw_python from mercury_engine_data_structures.file_tree_editor import FileTreeEditor from mercury_engine_data_structures.game_check import Game -construct.setGlobalPrintFullStrings(True) - def game_argument_type(s: str) -> Game: try: diff --git a/src/mercury_engine_data_structures/formats/bmsem.py b/src/mercury_engine_data_structures/formats/bmsem.py index fa685eab..8e102941 100644 --- a/src/mercury_engine_data_structures/formats/bmsem.py +++ b/src/mercury_engine_data_structures/formats/bmsem.py @@ -2,9 +2,11 @@ from construct import ( Array, Const, + Hex, Construct, Float32l, Int16ul, + Check, Int32ul, Struct, ) @@ -13,24 +15,20 @@ from mercury_engine_data_structures.formats import BaseResource from mercury_engine_data_structures.game_check import Game -VectorArray = Array(3, Float32l) - BMSEM = Struct( _magic=Const(b"MSEM"), - unk1=Int16ul, - unk2=Int16ul, - things= make_vector(Struct( - "layer_name" / StrId, - "objects" / make_vector(Struct( - "whatever_name" / StrId, - # "unk1" / Int32ul - "inner_things" / make_vector(Struct( - "first_part" / StrId, - "second_part" / StrId, - "unk3" / Int32ul, - "unk4" / Int32ul, - "unk6" / Int32ul, - "unk7" / Int32ul + _version=Const(0x00030001, Hex(Int32ul)), + groups=make_vector(Struct( + "group_name" / StrId, + "layers" / make_vector(Struct( + "layer_name" / StrId, + "entries" / make_vector(Struct( + "collision_camera" / StrId, + "song" / StrId, # Is empty if cc is "default". + "unk1" / Float32l, # Always either 2.0 or 1.5 + "unk2" / Float32l, # Always same number as unk1 + "unk3" / Int32ul, # Always 1 + "unk4" / Int32ul # Always 0 )) )) )),