forked from enigma-dev/enigma-dev
/
Room.proto
135 lines (114 loc) · 5.17 KB
/
Room.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
syntax = "proto2";
package buffers.resources;
import "options.proto";
message Room {
optional int32 id = 29 [(gmx) = "GMX_DEPRECATED"];
optional string caption = 1;
optional uint32 width = 2 [(yyp) = "roomSettings/Width", (tmx) = "width"]; // tmx width unit is no. of tiles
optional uint32 height = 3 [(yyp) = "roomSettings/Height", (tmx) = "height"]; // tmx height unit is no. of tiles
optional uint32 hsnap = 4 [(tmx) = "tilewidth"]; // tmx tilewidth unit is probably in pixels
optional uint32 vsnap = 5 [(tmx) = "tileheight"]; // tmx tileheight unit is probably in pixels
optional bool isometric = 6 [(tmx) = "orientation"]; // TODO: Handle type conversion exclusively. Add support to staggered and hexagonal orientations of tmx
optional uint32 speed = 27;
optional bool persistent = 7 [(yyp) = "roomSettings/persistent"];
optional int32 color = 8 [(gmx) = "colour", (tmx) = "backgroundcolor"]; // TODO: Handle type conversion exclusively
optional bool show_color = 9 [(gmx) = "showcolour"];
optional string creation_code = 10;
optional bool enable_views = 11 [(gmx) = "enableViews", (yyp) = "viewSettings/enableViews"];
optional bool clear_view_background = 12 [(gmx) = "clearViewBackground", (yyp) = "viewSettings/clearViewBackground"];
optional bool clear_display_buffer = 13 [(gmx) = "clearDisplayBuffer", (yyp) = "viewSettings/clearDisplayBuffer"];
message Background {
optional bool visible = 1;
optional bool foreground = 2;
optional string background_name = 3 [(resource_ref)="background", (gmx) = "name"];
optional int32 x = 4;
optional int32 y = 5;
optional bool htiled = 6;
optional bool vtiled = 7;
optional double hspeed = 8;
optional double vspeed = 9;
optional bool stretch = 10;
optional int32 color = 11 [default = 0xFFFFFF];
optional double alpha = 12 [default = 1.0];
}
repeated Background backgrounds = 15 [(gmx) = "backgrounds/background"];
message View {
optional bool visible = 1;
optional int32 xview = 2;
optional int32 yview = 3;
optional uint32 wview = 4;
optional uint32 hview = 5;
optional int32 xport = 6;
optional int32 yport = 7;
optional uint32 wport = 8;
optional uint32 hport = 9;
optional int32 hborder = 10;
optional int32 vborder = 11;
optional double hspeed = 12;
optional double vspeed = 13;
optional string object_following = 14 [(resource_ref)="object", (gmx) = "objName"];
}
repeated View views = 16 [(gmx) = "views/view", (yyp) = "views"];
message Instance {
optional string name = 1;
optional int32 id = 2 [(id_start) = 100001];
optional string object_type = 3 [(resource_ref)="object", (gmx) = "objName"];
optional double x = 4;
optional double y = 5;
optional double z = 6;
optional string creation_code = 7;
optional string initialization_code = 14;
optional double xscale = 8 [default = 1, (gmx) = "scaleX"];
optional double yscale = 9 [default = 1, (gmx) = "scaleY"];
optional double zscale = 10 [default = 1, (gmx) = "scaleY"];
optional double rotation = 11;
optional double zrotation = 12;
optional int32 color = 13 [default = 0xFFFFFF, (gmx) = "colour"];
message EditorSettings {
optional bool locked = 1;
}
optional EditorSettings editor_settings = 31;
}
repeated Instance instances = 17 [(gmx) = "instances/instance"];
message Tile {
optional string name = 1;
optional int32 id = 2 [(id_start) = 10000001];
optional string background_name = 3 [(resource_ref)="background", (gmx) = "bgName"];
optional double x = 4 [(tmx) = "x"];
optional double y = 5 [(tmx) = "y"];
optional int32 xoffset = 6 [(gmx) = "xo"];
optional int32 yoffset = 7 [(gmx) = "yo"];
optional uint32 width = 8 [(gmx) = "w", (tmx) = "width"];
optional uint32 height = 9 [(gmx) = "h", (tmx) = "height"];
optional int32 depth = 10;
optional double xscale = 11 [default = 1.0, (gmx) = "scaleX"];
optional double yscale = 12 [default = 1.0, (gmx) = "scaleY"];
optional int32 color = 13 [default = 0xFFFFFF, (gmx) = "colour"];
optional double alpha = 14 [default = 1.0];
message EditorSettings {
optional bool locked = 1;
}
optional EditorSettings editor_settings = 31;
}
repeated Tile tiles = 18 [(gmx) = "tiles/tile"];
message Layer {
optional string name = 1;
optional int32 id = 2;
optional int32 depth = 3;
optional bool visible = 4;
repeated Instance instances = 5;
repeated Tile tiles = 6;
}
repeated Layer layers = 20;
message RoomPhysicsSettings {
optional bool use_physics = 1 [(gmx) = "PhysicsWorld"];
optional int32 phy_world_top = 2 [(gmx) = "PhysicsWorldTop"];
optional int32 phy_world_left = 3 [(gmx) = "PhysicsWorldLeft"];
optional int32 phy_world_right = 4 [(gmx) = "PhysicsWorldRight"];
optional int32 phy_world_bottom = 5 [(gmx) = "PhysicsWorldBottom"];
optional double phy_world_xgravity = 6 [(gmx) = "PhysicsWorldGravityX"];
optional double phy_world_ygravity = 7 [(gmx) = "PhysicsWorldGravityY"];
optional double phy_world_pixel_meters = 8 [(gmx) = "PhysicsWorldPixToMeters"];
}
optional RoomPhysicsSettings physics_settings = 19 [(gmx) = "EGM_NESTED"];
}