From 4104d2261c985177c7efe51679e895640f0b1a95 Mon Sep 17 00:00:00 2001 From: Alexis Schad Date: Sun, 31 Mar 2024 20:04:17 +0200 Subject: [PATCH] add flags to item placement --- src/gbx_structs.py | 13 ++++++++++++- src/gui.py | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gbx_structs.py b/src/gbx_structs.py index bdcf830..8f366c1 100644 --- a/src/gbx_structs.py +++ b/src/gbx_structs.py @@ -3937,7 +3937,18 @@ def GbxCPlugEntRecordDataLoop(subcon): body_chunks[0x2E020000] = Struct( "version" / Int32ul, - "flags" / Int16ul, + "flags" + / ByteSwapped( # little endian 16 bit + BitStruct( + "rest" / Hex(BitsInteger(10)), + "GhostMode" / Flag, + "SwitchPivotManually" / Flag, + "AutoRotation" / Flag, + "NotOnObject" / Flag, + "YawOnly" / Flag, + "u01" / Flag, + ) + ), "cubeCenter" / GbxVec3, "cubeSize" / Float32l, "gridSnap_HStep" / Float32l, diff --git a/src/gui.py b/src/gui.py index 0afe71f..fa00044 100644 --- a/src/gui.py +++ b/src/gui.py @@ -34,7 +34,7 @@ def main(): app = QApplication.instance() or QApplication(sys.argv) win = GbxEditorUiWindow( - lambda file: on_new_file(win, file), + on_new_file, default_directory=r"C:\Users\schad\Documents\Trackmania\Items", )