From 4c8a38dfc0121343396d2a0d734cf1445d05b60c Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 12 Aug 2025 16:55:17 -0400 Subject: Converted to proto2 This will let us use an older version of protobuf in Python, and allows us to use the Godot protobuf implementation at all. Scalar fields with custom defaults in data.proto were changed to not have a default, because Godot doesn't handle it properly. The equivalent fields in human.proto still have the defaults, and datapacker copies the default value in if necessary. The Panel message in data.proto was also renamed to PanelData because otherwise it conflicts with the native Godot class named Panel. The double field in Letter was renamed to level2, because Godot couldn't handle it well. Finally, common.proto was removed and its contents were moved into data.proto, which allows us to generate code for Python without needing to edit it. NOTE: I had to slightly modify the Godot protobuf code generator. I'll need to upload that somewhere. --- proto/human.proto | 112 +++++++++++++++++++++++++++--------------------------- 1 file changed, 56 insertions(+), 56 deletions(-) (limited to 'proto/human.proto') diff --git a/proto/human.proto b/proto/human.proto index 858c88f..b420cb4 100644 --- a/proto/human.proto +++ b/proto/human.proto @@ -1,43 +1,43 @@ -edition = "2023"; +syntax = "proto2"; -import "common.proto"; +import "data.proto"; package com.fourisland.lingo2_archipelago; message RoomIdentifier { - string map = 1; - string name = 2; + optional string map = 1; + optional string name = 2; } message DoorIdentifier { - string map = 1; - string name = 2; + optional string map = 1; + optional string name = 2; } message PortIdentifier { - string map = 1; - string room = 2; - string name = 3; + optional string map = 1; + optional string room = 2; + optional string name = 3; } message PaintingIdentifier { - string map = 1; - string room = 2; - string name = 3; + optional string map = 1; + optional string room = 2; + optional string name = 3; } message PanelIdentifier { - string map = 1; - string room = 2; - string name = 3; - string answer = 4; + optional string map = 1; + optional string room = 2; + optional string name = 3; + optional string answer = 4; } message KeyholderIdentifier { - string map = 1; - string room = 2; - string name = 3; - string key = 4; + optional string map = 1; + optional string room = 2; + optional string name = 3; + optional string key = 4; } message HumanConnection { @@ -60,8 +60,8 @@ message HumanConnection { string to_room = 6; } - bool oneway = 3; - DoorIdentifier door = 4; + optional bool oneway = 3; + optional DoorIdentifier door = 4; } message HumanConnections { @@ -69,7 +69,7 @@ message HumanConnections { } message HumanDoor { - string name = 1; + optional string name = 1; repeated string receivers = 2; repeated PaintingIdentifier move_paintings = 8; @@ -79,15 +79,15 @@ message HumanDoor { // If set, the number of panels from the above set that need to be solved. // Warning: this is a messy kind of OR logic! Consider if there's another way. - uint64 complete_at = 9; + optional uint64 complete_at = 9; - string control_center_color = 6; + optional string control_center_color = 6; repeated string switches = 7; repeated KeyholderIdentifier keyholders = 10; repeated RoomIdentifier rooms = 11; - DoorType type = 4; - string location_room = 5; + optional DoorType type = 4; + optional string location_room = 5; } message HumanDoors { @@ -95,64 +95,64 @@ message HumanDoors { } message HumanPanel { - string name = 1; - string path = 5; + optional string name = 1; + optional string path = 5; - string clue = 2; - string answer = 3; + optional string clue = 2; + optional string answer = 3; repeated string symbols = 4; repeated Proxy proxies = 6; - DoorIdentifier required_door = 7; - RoomIdentifier required_room = 8; + optional DoorIdentifier required_door = 7; + optional RoomIdentifier required_room = 8; } message HumanPainting { - string name = 1; - string path = 2; + optional string name = 1; + optional string path = 2; - string display_name = 4; + optional string display_name = 4; - string orientation = 3; - bool move = 6; - bool enter_only = 7; - AxisDirection gravity = 8 [default = Y_MINUS]; - bool exit_only = 9; + optional string orientation = 3; + optional bool move = 6; + optional bool enter_only = 7; + optional AxisDirection gravity = 8 [default = Y_MINUS]; + optional bool exit_only = 9; - DoorIdentifier required_door = 5; + optional DoorIdentifier required_door = 5; } message HumanPort { - string name = 1; - string path = 2; + optional string name = 1; + optional string path = 2; - string orientation = 3; - AxisDirection gravity = 5 [default = Y_MINUS]; + optional string orientation = 3; + optional AxisDirection gravity = 5 [default = Y_MINUS]; - DoorIdentifier required_door = 4; + optional DoorIdentifier required_door = 4; } message HumanKeyholder { - string name = 1; - string path = 2; + optional string name = 1; + optional string path = 2; } message HumanLetter { - string key = 1; - bool double = 2; + optional string key = 1; + optional bool level2 = 2; - string path = 3; + optional string path = 3; } message HumanMastery { - string name = 1; - string path = 2; + optional string name = 1; + optional string path = 2; } message HumanRoom { - string name = 1; - string display_name = 2; + optional string name = 1; + optional string display_name = 2; repeated HumanPanel panels = 3; repeated HumanPainting paintings = 4; -- cgit 1.4.1