@dcl/protocol 1.0.0-33413306233.commit-16d337c → 1.0.0-33421599964.commit-0e82dcd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out-js/decentraland/kernel/comms/rfc4/comms.gen.d.ts +0 -21
- package/out-js/decentraland/kernel/comms/rfc4/comms.gen.js +4 -124
- package/out-js/decentraland/kernel/comms/rfc4/comms.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/avatar_shape.gen.d.ts +0 -8
- package/out-js/decentraland/sdk/components/avatar_shape.gen.js +1 -35
- package/out-js/decentraland/sdk/components/avatar_shape.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/pointer_events.gen.d.ts +16 -11
- package/out-js/decentraland/sdk/components/pointer_events.gen.js +14 -1
- package/out-js/decentraland/sdk/components/pointer_events.gen.js.map +1 -1
- package/out-ts/decentraland/kernel/comms/rfc4/comms.gen.ts +2 -166
- package/out-ts/decentraland/sdk/components/avatar_shape.gen.ts +0 -34
- package/out-ts/decentraland/sdk/components/pointer_events.gen.ts +33 -12
- package/package.json +3 -3
- package/proto/decentraland/kernel/comms/rfc4/comms.proto +0 -11
- package/proto/decentraland/pulse/pulse_client.proto +27 -8
- package/proto/decentraland/sdk/components/avatar_shape.proto +0 -5
- package/proto/decentraland/sdk/components/light_source.proto +1 -1
- package/proto/decentraland/sdk/components/pointer_events.proto +15 -11
- package/public/sdk-components.proto +0 -1
- package/out-js/decentraland/sdk/components/avatar_nametag.gen.d.ts +0 -54
- package/out-js/decentraland/sdk/components/avatar_nametag.gen.js +0 -117
- package/out-js/decentraland/sdk/components/avatar_nametag.gen.js.map +0 -1
- package/out-ts/decentraland/sdk/components/avatar_nametag.gen.ts +0 -158
- package/proto/decentraland/sdk/components/avatar_nametag.proto +0 -31
|
@@ -33,24 +33,27 @@ export const protobufPackage = "decentraland.sdk.components";
|
|
|
33
33
|
* --------------
|
|
34
34
|
* PointerEvents can enforce interaction range using two independent distance checks:
|
|
35
35
|
*
|
|
36
|
-
* -
|
|
37
|
-
* -
|
|
36
|
+
* - Player distance (`max_distance`): distance from the avatar/player position to the target entity.
|
|
37
|
+
* - Camera distance (`max_camera_distance`): distance from the active camera to the target entity.
|
|
38
|
+
*
|
|
39
|
+
* `max_player_distance` is deprecated: it is an alias for `max_distance` (both are player distance).
|
|
40
|
+
* If both are present, the larger of the two is used as the player distance threshold.
|
|
38
41
|
*
|
|
39
42
|
* How the interaction checks are combined:
|
|
40
43
|
*
|
|
41
44
|
* 1) Only `max_distance` is present
|
|
42
|
-
* - The interaction is allowed only if the
|
|
45
|
+
* - The interaction is allowed only if the player distance is <= `max_distance`.
|
|
43
46
|
*
|
|
44
|
-
* 2) Only `
|
|
45
|
-
* - The interaction is allowed only if the
|
|
47
|
+
* 2) Only `max_camera_distance` is present
|
|
48
|
+
* - The interaction is allowed only if the camera distance is <= `max_camera_distance`.
|
|
46
49
|
*
|
|
47
|
-
* 3) Both `max_distance` and `
|
|
50
|
+
* 3) Both `max_distance` and `max_camera_distance` are present
|
|
48
51
|
* - The interaction is allowed if ANY of the checks passes (OR logic):
|
|
49
|
-
* (
|
|
52
|
+
* (player distance <= `max_distance`) OR (camera distance <= `max_camera_distance`).
|
|
50
53
|
*
|
|
51
|
-
* 4) Neither `max_distance` nor `
|
|
54
|
+
* 4) Neither `max_distance` nor `max_camera_distance` is present
|
|
52
55
|
* - The system behaves as if `max_distance` were set to its default value (10),
|
|
53
|
-
* i.e., it uses the
|
|
56
|
+
* i.e., it uses the player distance check with a threshold of 10.
|
|
54
57
|
*/
|
|
55
58
|
export interface PBPointerEvents {
|
|
56
59
|
/** the list of relevant events to detect */
|
|
@@ -66,7 +69,7 @@ export interface PBPointerEvents_Info {
|
|
|
66
69
|
hoverText?:
|
|
67
70
|
| string
|
|
68
71
|
| undefined;
|
|
69
|
-
/** range of interaction (default 10) */
|
|
72
|
+
/** range of interaction from the avatar's position (default 10) */
|
|
70
73
|
maxDistance?:
|
|
71
74
|
| number
|
|
72
75
|
| undefined;
|
|
@@ -78,12 +81,16 @@ export interface PBPointerEvents_Info {
|
|
|
78
81
|
showHighlight?:
|
|
79
82
|
| boolean
|
|
80
83
|
| undefined;
|
|
81
|
-
/**
|
|
84
|
+
/** @deprecated use `max_distance` instead (same semantics) */
|
|
82
85
|
maxPlayerDistance?:
|
|
83
86
|
| number
|
|
84
87
|
| undefined;
|
|
85
88
|
/** resolution order when multiple events overlap, higher wins (default 0) */
|
|
86
|
-
priority?:
|
|
89
|
+
priority?:
|
|
90
|
+
| number
|
|
91
|
+
| undefined;
|
|
92
|
+
/** range of interaction from the active camera's position (default none) */
|
|
93
|
+
maxCameraDistance?: number | undefined;
|
|
87
94
|
}
|
|
88
95
|
|
|
89
96
|
export interface PBPointerEvents_Entry {
|
|
@@ -170,6 +177,7 @@ function createBasePBPointerEvents_Info(): PBPointerEvents_Info {
|
|
|
170
177
|
showHighlight: undefined,
|
|
171
178
|
maxPlayerDistance: undefined,
|
|
172
179
|
priority: undefined,
|
|
180
|
+
maxCameraDistance: undefined,
|
|
173
181
|
};
|
|
174
182
|
}
|
|
175
183
|
|
|
@@ -196,6 +204,9 @@ export namespace PBPointerEvents_Info {
|
|
|
196
204
|
if (message.priority !== undefined) {
|
|
197
205
|
writer.uint32(56).uint32(message.priority);
|
|
198
206
|
}
|
|
207
|
+
if (message.maxCameraDistance !== undefined) {
|
|
208
|
+
writer.uint32(69).float(message.maxCameraDistance);
|
|
209
|
+
}
|
|
199
210
|
return writer;
|
|
200
211
|
}
|
|
201
212
|
|
|
@@ -255,6 +266,13 @@ export namespace PBPointerEvents_Info {
|
|
|
255
266
|
|
|
256
267
|
message.priority = reader.uint32();
|
|
257
268
|
continue;
|
|
269
|
+
case 8:
|
|
270
|
+
if (tag !== 69) {
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
message.maxCameraDistance = reader.float();
|
|
275
|
+
continue;
|
|
258
276
|
}
|
|
259
277
|
if ((tag & 7) === 4 || tag === 0) {
|
|
260
278
|
break;
|
|
@@ -273,6 +291,7 @@ export namespace PBPointerEvents_Info {
|
|
|
273
291
|
showHighlight: isSet(object.showHighlight) ? Boolean(object.showHighlight) : undefined,
|
|
274
292
|
maxPlayerDistance: isSet(object.maxPlayerDistance) ? Number(object.maxPlayerDistance) : undefined,
|
|
275
293
|
priority: isSet(object.priority) ? Number(object.priority) : undefined,
|
|
294
|
+
maxCameraDistance: isSet(object.maxCameraDistance) ? Number(object.maxCameraDistance) : undefined,
|
|
276
295
|
};
|
|
277
296
|
}
|
|
278
297
|
|
|
@@ -286,6 +305,7 @@ export namespace PBPointerEvents_Info {
|
|
|
286
305
|
message.showHighlight !== undefined && (obj.showHighlight = message.showHighlight);
|
|
287
306
|
message.maxPlayerDistance !== undefined && (obj.maxPlayerDistance = message.maxPlayerDistance);
|
|
288
307
|
message.priority !== undefined && (obj.priority = Math.round(message.priority));
|
|
308
|
+
message.maxCameraDistance !== undefined && (obj.maxCameraDistance = message.maxCameraDistance);
|
|
289
309
|
return obj;
|
|
290
310
|
}
|
|
291
311
|
|
|
@@ -302,6 +322,7 @@ export namespace PBPointerEvents_Info {
|
|
|
302
322
|
message.showHighlight = object.showHighlight ?? undefined;
|
|
303
323
|
message.maxPlayerDistance = object.maxPlayerDistance ?? undefined;
|
|
304
324
|
message.priority = object.priority ?? undefined;
|
|
325
|
+
message.maxCameraDistance = object.maxCameraDistance ?? undefined;
|
|
305
326
|
return message;
|
|
306
327
|
}
|
|
307
328
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/protocol",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-33421599964.commit-0e82dcd",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"gen:test": "node protoc-gen-bitwise/test/generator.test.js"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@protobuf-ts/protoc": "^2.
|
|
20
|
+
"@protobuf-ts/protoc": "^2.8.1",
|
|
21
21
|
"proto-compatibility-tool": "^1.1.2-20220925163655.commit-25bd040",
|
|
22
22
|
"typescript": "^5.0.4"
|
|
23
23
|
},
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"protoc-gen-bitwise/*.js",
|
|
37
37
|
"protoc-gen-bitwise/runtime"
|
|
38
38
|
],
|
|
39
|
-
"commit": "
|
|
39
|
+
"commit": "0e82dcd8289bec985a63727d665c08e4048cbac2"
|
|
40
40
|
}
|
|
@@ -94,14 +94,6 @@ message PlayerEmote {
|
|
|
94
94
|
uint32 incremental_id = 1;
|
|
95
95
|
string urn = 2;
|
|
96
96
|
float timestamp = 3;
|
|
97
|
-
optional bool is_stopping = 4; // true means the emote has been stopped in the sender's client
|
|
98
|
-
optional bool is_repeating = 5; // true when it is not the first time the looping animation plays
|
|
99
|
-
optional int32 interaction_id = 6; // identifies an interaction univocaly, established when the start animation is triggered
|
|
100
|
-
optional int32 social_emote_outcome = 7; // -1 means it does not use an outcome animation
|
|
101
|
-
optional bool is_reacting = 8; // to a social emote started by other user
|
|
102
|
-
optional string social_emote_initiator = 9; // wallet address of the user that initiated social emote
|
|
103
|
-
optional string target_avatar = 10; // wallet address of the user whose avatar is the target of a directed emote
|
|
104
|
-
optional uint32 mask = 11; // mask for which bones an animation applies to.
|
|
105
97
|
}
|
|
106
98
|
|
|
107
99
|
message SceneEmote {
|
|
@@ -134,9 +126,6 @@ message ProfileResponse {
|
|
|
134
126
|
message Chat {
|
|
135
127
|
string message = 1;
|
|
136
128
|
double timestamp = 2;
|
|
137
|
-
// Extension: optional forwarded_from to identify the original sender when
|
|
138
|
-
// messages are forwarded through an SFU
|
|
139
|
-
optional string forwarded_from = 3;
|
|
140
129
|
}
|
|
141
130
|
|
|
142
131
|
message Scene {
|
|
@@ -74,17 +74,35 @@ message ParcelRect {
|
|
|
74
74
|
sint32 max_z = 4;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
//
|
|
78
|
-
//
|
|
77
|
+
// One realm's slice of a scene listener's area of interest. Parcels only mean anything
|
|
78
|
+
// within a realm — every world numbers its own parcels from 0,0 — so a listener that
|
|
79
|
+
// observes several realms, as an authoritative server cohosting scenes from several worlds
|
|
80
|
+
// does, announces one of these per realm rather than one realm for the whole connection.
|
|
81
|
+
message SceneListenerAoi {
|
|
82
|
+
// Non-empty realm identifier — same rules as TeleportRequest.realm.
|
|
83
|
+
string realm = 1;
|
|
84
|
+
// This realm's parcels as inclusive rects. The sum of rect areas across every announced
|
|
85
|
+
// realm is capped server-side (SceneListener:MaxParcels) — overlaps count per rect, so
|
|
86
|
+
// announce disjoint rects.
|
|
87
|
+
repeated ParcelRect parcel_rects = 2;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Scene-listener connect: same signed-fetch auth chain as HandshakeRequest, plus a
|
|
91
|
+
// parcel-set area of interest per realm. No initial state — a listener is never a subject.
|
|
79
92
|
message SceneListenerHandshakeRequest {
|
|
80
93
|
// Signed-fetch headers JSON — identical shape to HandshakeRequest.auth_chain.
|
|
81
94
|
bytes auth_chain = 1;
|
|
82
|
-
// AoI
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
95
|
+
// Announced AoI, one entry per realm; replaceable afterwards with SceneListenerUpdate.
|
|
96
|
+
repeated SceneListenerAoi aoi = 2;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Scene-listener AoI reassignment: replaces the area of interest announced at connect, in
|
|
100
|
+
// place, on an authenticated scene-listener connection. Only valid from a peer that
|
|
101
|
+
// authenticated with SceneListenerHandshakeRequest.
|
|
102
|
+
message SceneListenerUpdate {
|
|
103
|
+
// The new AoI, replacing (not extending) the current one — realms absent from it are no
|
|
104
|
+
// longer observed. Same rules and SceneListener:MaxParcels budget as the handshake's.
|
|
105
|
+
repeated SceneListenerAoi aoi = 1;
|
|
88
106
|
}
|
|
89
107
|
|
|
90
108
|
message ClientMessage {
|
|
@@ -97,5 +115,6 @@ message ClientMessage {
|
|
|
97
115
|
EmoteStop emote_stop = 6;
|
|
98
116
|
TeleportRequest teleport = 7;
|
|
99
117
|
SceneListenerHandshakeRequest scene_listener_handshake = 8;
|
|
118
|
+
SceneListenerUpdate scene_listener_update = 9;
|
|
100
119
|
}
|
|
101
120
|
}
|
|
@@ -25,4 +25,4 @@ message PBLightSource {
|
|
|
25
25
|
optional float inner_angle = 9; // default = 21.8. Inner angle can't be higher than outer angle, otherwise will default to same value. Min value is 0. Max value is 179.
|
|
26
26
|
optional float outer_angle = 10; // default = 30. Outer angle can't be lower than inner angle, otherwise will inner angle will be set to same value. Max value is 179.
|
|
27
27
|
}
|
|
28
|
-
}
|
|
28
|
+
}
|
|
@@ -25,33 +25,37 @@ option (common.ecs_component_id) = 1062;
|
|
|
25
25
|
// --------------
|
|
26
26
|
// PointerEvents can enforce interaction range using two independent distance checks:
|
|
27
27
|
//
|
|
28
|
-
// -
|
|
29
|
-
// -
|
|
28
|
+
// - Player distance (`max_distance`): distance from the avatar/player position to the target entity.
|
|
29
|
+
// - Camera distance (`max_camera_distance`): distance from the active camera to the target entity.
|
|
30
|
+
//
|
|
31
|
+
// `max_player_distance` is deprecated: it is an alias for `max_distance` (both are player distance).
|
|
32
|
+
// If both are present, the larger of the two is used as the player distance threshold.
|
|
30
33
|
//
|
|
31
34
|
// How the interaction checks are combined:
|
|
32
35
|
//
|
|
33
36
|
// 1) Only `max_distance` is present
|
|
34
|
-
// - The interaction is allowed only if the
|
|
37
|
+
// - The interaction is allowed only if the player distance is <= `max_distance`.
|
|
35
38
|
//
|
|
36
|
-
// 2) Only `
|
|
37
|
-
// - The interaction is allowed only if the
|
|
39
|
+
// 2) Only `max_camera_distance` is present
|
|
40
|
+
// - The interaction is allowed only if the camera distance is <= `max_camera_distance`.
|
|
38
41
|
//
|
|
39
|
-
// 3) Both `max_distance` and `
|
|
42
|
+
// 3) Both `max_distance` and `max_camera_distance` are present
|
|
40
43
|
// - The interaction is allowed if ANY of the checks passes (OR logic):
|
|
41
|
-
// (
|
|
44
|
+
// (player distance <= `max_distance`) OR (camera distance <= `max_camera_distance`).
|
|
42
45
|
//
|
|
43
|
-
// 4) Neither `max_distance` nor `
|
|
46
|
+
// 4) Neither `max_distance` nor `max_camera_distance` is present
|
|
44
47
|
// - The system behaves as if `max_distance` were set to its default value (10),
|
|
45
|
-
// i.e., it uses the
|
|
48
|
+
// i.e., it uses the player distance check with a threshold of 10.
|
|
46
49
|
message PBPointerEvents {
|
|
47
50
|
message Info {
|
|
48
51
|
optional common.InputAction button = 1; // key/button in use (default IA_ANY)
|
|
49
52
|
optional string hover_text = 2; // feedback on hover (default 'Interact')
|
|
50
|
-
optional float max_distance = 3; // range of interaction (default 10)
|
|
53
|
+
optional float max_distance = 3; // range of interaction from the avatar's position (default 10)
|
|
51
54
|
optional bool show_feedback = 4; // enable or disable hover text and highlight (default true)
|
|
52
55
|
optional bool show_highlight = 5; // enable or disable hover highlight (default true)
|
|
53
|
-
optional float max_player_distance = 6; //
|
|
56
|
+
optional float max_player_distance = 6; // @deprecated use `max_distance` instead (same semantics)
|
|
54
57
|
optional uint32 priority = 7; // resolution order when multiple events overlap, higher wins (default 0)
|
|
58
|
+
optional float max_camera_distance = 8; // range of interaction from the active camera's position (default none)
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
message Entry {
|
|
@@ -9,7 +9,6 @@ import public "decentraland/sdk/components/avatar_base.proto";
|
|
|
9
9
|
import public "decentraland/sdk/components/avatar_emote_command.proto";
|
|
10
10
|
import public "decentraland/sdk/components/avatar_equipped_data.proto";
|
|
11
11
|
import public "decentraland/sdk/components/avatar_modifier_area.proto";
|
|
12
|
-
import public "decentraland/sdk/components/avatar_nametag.proto";
|
|
13
12
|
import public "decentraland/sdk/components/avatar_shape.proto";
|
|
14
13
|
import public "decentraland/sdk/components/billboard.proto";
|
|
15
14
|
import public "decentraland/sdk/components/camera_mode_area.proto";
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import _m0 from "protobufjs/minimal";
|
|
2
|
-
import { Color3 } from "../../common/colors.gen";
|
|
3
|
-
export declare const protobufPackage = "decentraland.sdk.components";
|
|
4
|
-
/**
|
|
5
|
-
* The AvatarNametag component adds a plate with scene-provided text above an avatar's nametag,
|
|
6
|
-
* for example to show a rank or a role that the scene assigns to that player.
|
|
7
|
-
*
|
|
8
|
-
* Valid only on an avatar-bearing entity:
|
|
9
|
-
* - the local player: `engine.PlayerEntity`
|
|
10
|
-
* - another player in the scene: that player's entity
|
|
11
|
-
* - an NPC: any entity with an AvatarShape
|
|
12
|
-
* Writes to any other entity are ignored.
|
|
13
|
-
*
|
|
14
|
-
* Player entity ids are not stable across disconnects: a write to a stale entity lands on
|
|
15
|
-
* whoever holds that id next. Resolve the entity from the user id on every write, and remove
|
|
16
|
-
* the component when the player leaves the scene.
|
|
17
|
-
*
|
|
18
|
-
* The plate is local to the client that renders it; it is never relayed to other players.
|
|
19
|
-
*/
|
|
20
|
-
export interface PBAvatarNametag {
|
|
21
|
-
/** The plate text: a single line, for example "Club Owner". Empty draws the plate without text. */
|
|
22
|
-
label: string;
|
|
23
|
-
/** (default: the client's native nametag text color) */
|
|
24
|
-
labelColor?: Color3 | undefined;
|
|
25
|
-
/** (default: the client's native nametag background color) */
|
|
26
|
-
backgroundColor?: Color3 | undefined;
|
|
27
|
-
/** (default: background_color, so the plate carries no visible border) */
|
|
28
|
-
borderColor?: Color3 | undefined;
|
|
29
|
-
}
|
|
30
|
-
export declare namespace PBAvatarNametag {
|
|
31
|
-
function encode(message: PBAvatarNametag, writer?: _m0.Writer): _m0.Writer;
|
|
32
|
-
function decode(input: _m0.Reader | Uint8Array, length?: number): PBAvatarNametag;
|
|
33
|
-
function fromJSON(object: any): PBAvatarNametag;
|
|
34
|
-
function toJSON(message: PBAvatarNametag): unknown;
|
|
35
|
-
function create<I extends Exact<DeepPartial<PBAvatarNametag>, I>>(base?: I): PBAvatarNametag;
|
|
36
|
-
function fromPartial<I extends Exact<DeepPartial<PBAvatarNametag>, I>>(object: I): PBAvatarNametag;
|
|
37
|
-
}
|
|
38
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
39
|
-
export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
40
|
-
$case: string;
|
|
41
|
-
} ? {
|
|
42
|
-
[K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>;
|
|
43
|
-
} & {
|
|
44
|
-
$case: T["$case"];
|
|
45
|
-
} : T extends {} ? {
|
|
46
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
47
|
-
} : Partial<T>;
|
|
48
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
49
|
-
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
50
|
-
[K in keyof P]: Exact<P[K], I[K]>;
|
|
51
|
-
} & {
|
|
52
|
-
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
53
|
-
};
|
|
54
|
-
export {};
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PBAvatarNametag = exports.protobufPackage = void 0;
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
9
|
-
const colors_gen_1 = require("../../common/colors.gen");
|
|
10
|
-
exports.protobufPackage = "decentraland.sdk.components";
|
|
11
|
-
function createBasePBAvatarNametag() {
|
|
12
|
-
return { label: "", labelColor: undefined, backgroundColor: undefined, borderColor: undefined };
|
|
13
|
-
}
|
|
14
|
-
var PBAvatarNametag;
|
|
15
|
-
(function (PBAvatarNametag) {
|
|
16
|
-
function encode(message, writer = minimal_1.default.Writer.create()) {
|
|
17
|
-
if (message.label !== "") {
|
|
18
|
-
writer.uint32(10).string(message.label);
|
|
19
|
-
}
|
|
20
|
-
if (message.labelColor !== undefined) {
|
|
21
|
-
colors_gen_1.Color3.encode(message.labelColor, writer.uint32(18).fork()).ldelim();
|
|
22
|
-
}
|
|
23
|
-
if (message.backgroundColor !== undefined) {
|
|
24
|
-
colors_gen_1.Color3.encode(message.backgroundColor, writer.uint32(26).fork()).ldelim();
|
|
25
|
-
}
|
|
26
|
-
if (message.borderColor !== undefined) {
|
|
27
|
-
colors_gen_1.Color3.encode(message.borderColor, writer.uint32(34).fork()).ldelim();
|
|
28
|
-
}
|
|
29
|
-
return writer;
|
|
30
|
-
}
|
|
31
|
-
PBAvatarNametag.encode = encode;
|
|
32
|
-
function decode(input, length) {
|
|
33
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
34
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
35
|
-
const message = createBasePBAvatarNametag();
|
|
36
|
-
while (reader.pos < end) {
|
|
37
|
-
const tag = reader.uint32();
|
|
38
|
-
switch (tag >>> 3) {
|
|
39
|
-
case 1:
|
|
40
|
-
if (tag !== 10) {
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
message.label = reader.string();
|
|
44
|
-
continue;
|
|
45
|
-
case 2:
|
|
46
|
-
if (tag !== 18) {
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
message.labelColor = colors_gen_1.Color3.decode(reader, reader.uint32());
|
|
50
|
-
continue;
|
|
51
|
-
case 3:
|
|
52
|
-
if (tag !== 26) {
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
message.backgroundColor = colors_gen_1.Color3.decode(reader, reader.uint32());
|
|
56
|
-
continue;
|
|
57
|
-
case 4:
|
|
58
|
-
if (tag !== 34) {
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
message.borderColor = colors_gen_1.Color3.decode(reader, reader.uint32());
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
reader.skipType(tag & 7);
|
|
68
|
-
}
|
|
69
|
-
return message;
|
|
70
|
-
}
|
|
71
|
-
PBAvatarNametag.decode = decode;
|
|
72
|
-
function fromJSON(object) {
|
|
73
|
-
return {
|
|
74
|
-
label: isSet(object.label) ? String(object.label) : "",
|
|
75
|
-
labelColor: isSet(object.labelColor) ? colors_gen_1.Color3.fromJSON(object.labelColor) : undefined,
|
|
76
|
-
backgroundColor: isSet(object.backgroundColor) ? colors_gen_1.Color3.fromJSON(object.backgroundColor) : undefined,
|
|
77
|
-
borderColor: isSet(object.borderColor) ? colors_gen_1.Color3.fromJSON(object.borderColor) : undefined,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
PBAvatarNametag.fromJSON = fromJSON;
|
|
81
|
-
function toJSON(message) {
|
|
82
|
-
const obj = {};
|
|
83
|
-
message.label !== undefined && (obj.label = message.label);
|
|
84
|
-
message.labelColor !== undefined &&
|
|
85
|
-
(obj.labelColor = message.labelColor ? colors_gen_1.Color3.toJSON(message.labelColor) : undefined);
|
|
86
|
-
message.backgroundColor !== undefined &&
|
|
87
|
-
(obj.backgroundColor = message.backgroundColor ? colors_gen_1.Color3.toJSON(message.backgroundColor) : undefined);
|
|
88
|
-
message.borderColor !== undefined &&
|
|
89
|
-
(obj.borderColor = message.borderColor ? colors_gen_1.Color3.toJSON(message.borderColor) : undefined);
|
|
90
|
-
return obj;
|
|
91
|
-
}
|
|
92
|
-
PBAvatarNametag.toJSON = toJSON;
|
|
93
|
-
function create(base) {
|
|
94
|
-
return PBAvatarNametag.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
95
|
-
}
|
|
96
|
-
PBAvatarNametag.create = create;
|
|
97
|
-
function fromPartial(object) {
|
|
98
|
-
var _a;
|
|
99
|
-
const message = createBasePBAvatarNametag();
|
|
100
|
-
message.label = (_a = object.label) !== null && _a !== void 0 ? _a : "";
|
|
101
|
-
message.labelColor = (object.labelColor !== undefined && object.labelColor !== null)
|
|
102
|
-
? colors_gen_1.Color3.fromPartial(object.labelColor)
|
|
103
|
-
: undefined;
|
|
104
|
-
message.backgroundColor = (object.backgroundColor !== undefined && object.backgroundColor !== null)
|
|
105
|
-
? colors_gen_1.Color3.fromPartial(object.backgroundColor)
|
|
106
|
-
: undefined;
|
|
107
|
-
message.borderColor = (object.borderColor !== undefined && object.borderColor !== null)
|
|
108
|
-
? colors_gen_1.Color3.fromPartial(object.borderColor)
|
|
109
|
-
: undefined;
|
|
110
|
-
return message;
|
|
111
|
-
}
|
|
112
|
-
PBAvatarNametag.fromPartial = fromPartial;
|
|
113
|
-
})(PBAvatarNametag || (exports.PBAvatarNametag = PBAvatarNametag = {}));
|
|
114
|
-
function isSet(value) {
|
|
115
|
-
return value !== null && value !== undefined;
|
|
116
|
-
}
|
|
117
|
-
//# sourceMappingURL=avatar_nametag.gen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"avatar_nametag.gen.js","sourceRoot":"","sources":["../../../../out-ts/decentraland/sdk/components/avatar_nametag.gen.ts"],"names":[],"mappings":";;;;;;AAAA,oBAAoB;AACpB,iEAAqC;AACrC,wDAAiD;AAEpC,QAAA,eAAe,GAAG,6BAA6B,CAAC;AAiC7D,SAAS,yBAAyB;IAChC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AAClG,CAAC;AAED,IAAiB,eAAe,CAoG/B;AApGD,WAAiB,eAAe;IAC9B,SAAgB,MAAM,CAAC,OAAwB,EAAE,SAAqB,iBAAG,CAAC,MAA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,QAoG/B;AAcD,SAAS,KAAK,CAAC,KAAU;IACvB,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC"}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { Color3 } from "../../common/colors.gen";
|
|
4
|
-
|
|
5
|
-
export const protobufPackage = "decentraland.sdk.components";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The AvatarNametag component adds a plate with scene-provided text above an avatar's nametag,
|
|
9
|
-
* for example to show a rank or a role that the scene assigns to that player.
|
|
10
|
-
*
|
|
11
|
-
* Valid only on an avatar-bearing entity:
|
|
12
|
-
* - the local player: `engine.PlayerEntity`
|
|
13
|
-
* - another player in the scene: that player's entity
|
|
14
|
-
* - an NPC: any entity with an AvatarShape
|
|
15
|
-
* Writes to any other entity are ignored.
|
|
16
|
-
*
|
|
17
|
-
* Player entity ids are not stable across disconnects: a write to a stale entity lands on
|
|
18
|
-
* whoever holds that id next. Resolve the entity from the user id on every write, and remove
|
|
19
|
-
* the component when the player leaves the scene.
|
|
20
|
-
*
|
|
21
|
-
* The plate is local to the client that renders it; it is never relayed to other players.
|
|
22
|
-
*/
|
|
23
|
-
export interface PBAvatarNametag {
|
|
24
|
-
/** The plate text: a single line, for example "Club Owner". Empty draws the plate without text. */
|
|
25
|
-
label: string;
|
|
26
|
-
/** (default: the client's native nametag text color) */
|
|
27
|
-
labelColor?:
|
|
28
|
-
| Color3
|
|
29
|
-
| undefined;
|
|
30
|
-
/** (default: the client's native nametag background color) */
|
|
31
|
-
backgroundColor?:
|
|
32
|
-
| Color3
|
|
33
|
-
| undefined;
|
|
34
|
-
/** (default: background_color, so the plate carries no visible border) */
|
|
35
|
-
borderColor?: Color3 | undefined;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function createBasePBAvatarNametag(): PBAvatarNametag {
|
|
39
|
-
return { label: "", labelColor: undefined, backgroundColor: undefined, borderColor: undefined };
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export namespace PBAvatarNametag {
|
|
43
|
-
export function encode(message: PBAvatarNametag, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
44
|
-
if (message.label !== "") {
|
|
45
|
-
writer.uint32(10).string(message.label);
|
|
46
|
-
}
|
|
47
|
-
if (message.labelColor !== undefined) {
|
|
48
|
-
Color3.encode(message.labelColor, writer.uint32(18).fork()).ldelim();
|
|
49
|
-
}
|
|
50
|
-
if (message.backgroundColor !== undefined) {
|
|
51
|
-
Color3.encode(message.backgroundColor, writer.uint32(26).fork()).ldelim();
|
|
52
|
-
}
|
|
53
|
-
if (message.borderColor !== undefined) {
|
|
54
|
-
Color3.encode(message.borderColor, writer.uint32(34).fork()).ldelim();
|
|
55
|
-
}
|
|
56
|
-
return writer;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBAvatarNametag {
|
|
60
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
61
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
62
|
-
const message = createBasePBAvatarNametag();
|
|
63
|
-
while (reader.pos < end) {
|
|
64
|
-
const tag = reader.uint32();
|
|
65
|
-
switch (tag >>> 3) {
|
|
66
|
-
case 1:
|
|
67
|
-
if (tag !== 10) {
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
message.label = reader.string();
|
|
72
|
-
continue;
|
|
73
|
-
case 2:
|
|
74
|
-
if (tag !== 18) {
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
message.labelColor = Color3.decode(reader, reader.uint32());
|
|
79
|
-
continue;
|
|
80
|
-
case 3:
|
|
81
|
-
if (tag !== 26) {
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
message.backgroundColor = Color3.decode(reader, reader.uint32());
|
|
86
|
-
continue;
|
|
87
|
-
case 4:
|
|
88
|
-
if (tag !== 34) {
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
message.borderColor = Color3.decode(reader, reader.uint32());
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
reader.skipType(tag & 7);
|
|
99
|
-
}
|
|
100
|
-
return message;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function fromJSON(object: any): PBAvatarNametag {
|
|
104
|
-
return {
|
|
105
|
-
label: isSet(object.label) ? String(object.label) : "",
|
|
106
|
-
labelColor: isSet(object.labelColor) ? Color3.fromJSON(object.labelColor) : undefined,
|
|
107
|
-
backgroundColor: isSet(object.backgroundColor) ? Color3.fromJSON(object.backgroundColor) : undefined,
|
|
108
|
-
borderColor: isSet(object.borderColor) ? Color3.fromJSON(object.borderColor) : undefined,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function toJSON(message: PBAvatarNametag): unknown {
|
|
113
|
-
const obj: any = {};
|
|
114
|
-
message.label !== undefined && (obj.label = message.label);
|
|
115
|
-
message.labelColor !== undefined &&
|
|
116
|
-
(obj.labelColor = message.labelColor ? Color3.toJSON(message.labelColor) : undefined);
|
|
117
|
-
message.backgroundColor !== undefined &&
|
|
118
|
-
(obj.backgroundColor = message.backgroundColor ? Color3.toJSON(message.backgroundColor) : undefined);
|
|
119
|
-
message.borderColor !== undefined &&
|
|
120
|
-
(obj.borderColor = message.borderColor ? Color3.toJSON(message.borderColor) : undefined);
|
|
121
|
-
return obj;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function create<I extends Exact<DeepPartial<PBAvatarNametag>, I>>(base?: I): PBAvatarNametag {
|
|
125
|
-
return PBAvatarNametag.fromPartial(base ?? {});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export function fromPartial<I extends Exact<DeepPartial<PBAvatarNametag>, I>>(object: I): PBAvatarNametag {
|
|
129
|
-
const message = createBasePBAvatarNametag();
|
|
130
|
-
message.label = object.label ?? "";
|
|
131
|
-
message.labelColor = (object.labelColor !== undefined && object.labelColor !== null)
|
|
132
|
-
? Color3.fromPartial(object.labelColor)
|
|
133
|
-
: undefined;
|
|
134
|
-
message.backgroundColor = (object.backgroundColor !== undefined && object.backgroundColor !== null)
|
|
135
|
-
? Color3.fromPartial(object.backgroundColor)
|
|
136
|
-
: undefined;
|
|
137
|
-
message.borderColor = (object.borderColor !== undefined && object.borderColor !== null)
|
|
138
|
-
? Color3.fromPartial(object.borderColor)
|
|
139
|
-
: undefined;
|
|
140
|
-
return message;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
145
|
-
|
|
146
|
-
export type DeepPartial<T> = T extends Builtin ? T
|
|
147
|
-
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
148
|
-
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
149
|
-
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
150
|
-
: Partial<T>;
|
|
151
|
-
|
|
152
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
153
|
-
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
154
|
-
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
155
|
-
|
|
156
|
-
function isSet(value: any): boolean {
|
|
157
|
-
return value !== null && value !== undefined;
|
|
158
|
-
}
|