@dcl/protocol 1.0.0-29286492043.commit-0010e70 → 1.0.0-29501656680.commit-6a4362a
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/sdk/components/touch_screen_controls.gen.d.ts +77 -0
- package/out-js/decentraland/sdk/components/touch_screen_controls.gen.js +201 -0
- package/out-js/decentraland/sdk/components/touch_screen_controls.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/ui_input_binding.gen.d.ts +52 -0
- package/out-js/decentraland/sdk/components/ui_input_binding.gen.js +81 -0
- package/out-js/decentraland/sdk/components/ui_input_binding.gen.js.map +1 -0
- package/out-ts/decentraland/sdk/components/touch_screen_controls.gen.ts +265 -0
- package/out-ts/decentraland/sdk/components/ui_input_binding.gen.ts +114 -0
- package/package.json +2 -2
- package/proto/decentraland/sdk/components/touch_screen_controls.proto +38 -0
- package/proto/decentraland/sdk/components/ui_input_binding.proto +27 -0
- package/public/sdk-components.proto +2 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import _m0 from "protobufjs/minimal";
|
|
2
|
+
import { TextureUnion } from "../../common/texture.gen";
|
|
3
|
+
import { InputAction } from "./common/input_action.gen";
|
|
4
|
+
export declare const protobufPackage = "decentraland.sdk.components";
|
|
5
|
+
/**
|
|
6
|
+
* The TouchScreenControls component lets a scene configure the native on-screen touch
|
|
7
|
+
* controls (the mobile joystick + gamepad). It must be set on the RootEntity.
|
|
8
|
+
*
|
|
9
|
+
* By default every on-screen button is shown; list a button in `touch_inputs` with
|
|
10
|
+
* `hide = true` to remove it (declutter). `main_action` picks which action the large
|
|
11
|
+
* central button triggers, and `hide_joystick` removes the native virtual joystick. It is
|
|
12
|
+
* a no-op on platforms without native on-screen controls (e.g. desktop).
|
|
13
|
+
*
|
|
14
|
+
* Accepted actions: only the on-screen gamepad actions map to a button — `IA_POINTER`,
|
|
15
|
+
* `IA_PRIMARY`, `IA_SECONDARY`, `IA_JUMP`, and `IA_ACTION_3`..`IA_ACTION_6`. Any other
|
|
16
|
+
* `InputAction` (movement actions, `IA_ANY`, `IA_MODIFIER`, or unknown/future values) is
|
|
17
|
+
* ignored: a `TouchInput` entry naming a non-button action has no effect, and a `main_action`
|
|
18
|
+
* that isn't a valid gamepad action falls back to the default central button (`IA_JUMP`).
|
|
19
|
+
*/
|
|
20
|
+
export interface PBTouchScreenControls {
|
|
21
|
+
touchInputs: PBTouchScreenControls_TouchInput[];
|
|
22
|
+
/**
|
|
23
|
+
* The large central button's action. Only the gamepad actions are valid:
|
|
24
|
+
* jump / pointer / primary (E) / secondary (F) / action_3..action_6 (1/2/3/4).
|
|
25
|
+
* When unset, the default central button (jump) is kept.
|
|
26
|
+
*/
|
|
27
|
+
mainAction?: InputAction | undefined;
|
|
28
|
+
/** hide the native virtual joystick */
|
|
29
|
+
hideJoystick: boolean;
|
|
30
|
+
/** hide the on-screen crosshair / reticle */
|
|
31
|
+
hideCrosshair: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** Per-button configuration. A button not listed here keeps its default (shown). */
|
|
34
|
+
export interface PBTouchScreenControls_TouchInput {
|
|
35
|
+
/** which on-screen button this configures */
|
|
36
|
+
inputAction: InputAction;
|
|
37
|
+
/** hide this button (default: shown) */
|
|
38
|
+
hide: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Override the button glyph with this texture. For the jump button it replaces all
|
|
41
|
+
* of its dynamic states (jump / double-jump / glide).
|
|
42
|
+
*/
|
|
43
|
+
icon?: TextureUnion | undefined;
|
|
44
|
+
}
|
|
45
|
+
export declare namespace PBTouchScreenControls {
|
|
46
|
+
function encode(message: PBTouchScreenControls, writer?: _m0.Writer): _m0.Writer;
|
|
47
|
+
function decode(input: _m0.Reader | Uint8Array, length?: number): PBTouchScreenControls;
|
|
48
|
+
function fromJSON(object: any): PBTouchScreenControls;
|
|
49
|
+
function toJSON(message: PBTouchScreenControls): unknown;
|
|
50
|
+
function create<I extends Exact<DeepPartial<PBTouchScreenControls>, I>>(base?: I): PBTouchScreenControls;
|
|
51
|
+
function fromPartial<I extends Exact<DeepPartial<PBTouchScreenControls>, I>>(object: I): PBTouchScreenControls;
|
|
52
|
+
}
|
|
53
|
+
export declare namespace PBTouchScreenControls_TouchInput {
|
|
54
|
+
function encode(message: PBTouchScreenControls_TouchInput, writer?: _m0.Writer): _m0.Writer;
|
|
55
|
+
function decode(input: _m0.Reader | Uint8Array, length?: number): PBTouchScreenControls_TouchInput;
|
|
56
|
+
function fromJSON(object: any): PBTouchScreenControls_TouchInput;
|
|
57
|
+
function toJSON(message: PBTouchScreenControls_TouchInput): unknown;
|
|
58
|
+
function create<I extends Exact<DeepPartial<PBTouchScreenControls_TouchInput>, I>>(base?: I): PBTouchScreenControls_TouchInput;
|
|
59
|
+
function fromPartial<I extends Exact<DeepPartial<PBTouchScreenControls_TouchInput>, I>>(object: I): PBTouchScreenControls_TouchInput;
|
|
60
|
+
}
|
|
61
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
62
|
+
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 {
|
|
63
|
+
$case: string;
|
|
64
|
+
} ? {
|
|
65
|
+
[K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>;
|
|
66
|
+
} & {
|
|
67
|
+
$case: T["$case"];
|
|
68
|
+
} : T extends {} ? {
|
|
69
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
70
|
+
} : Partial<T>;
|
|
71
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
72
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
73
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
74
|
+
} & {
|
|
75
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
76
|
+
};
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,201 @@
|
|
|
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.PBTouchScreenControls_TouchInput = exports.PBTouchScreenControls = exports.protobufPackage = void 0;
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
9
|
+
const texture_gen_1 = require("../../common/texture.gen");
|
|
10
|
+
const input_action_gen_1 = require("./common/input_action.gen");
|
|
11
|
+
exports.protobufPackage = "decentraland.sdk.components";
|
|
12
|
+
function createBasePBTouchScreenControls() {
|
|
13
|
+
return { touchInputs: [], mainAction: undefined, hideJoystick: false, hideCrosshair: false };
|
|
14
|
+
}
|
|
15
|
+
var PBTouchScreenControls;
|
|
16
|
+
(function (PBTouchScreenControls) {
|
|
17
|
+
function encode(message, writer = minimal_1.default.Writer.create()) {
|
|
18
|
+
for (const v of message.touchInputs) {
|
|
19
|
+
PBTouchScreenControls_TouchInput.encode(v, writer.uint32(10).fork()).ldelim();
|
|
20
|
+
}
|
|
21
|
+
if (message.mainAction !== undefined) {
|
|
22
|
+
writer.uint32(16).int32(message.mainAction);
|
|
23
|
+
}
|
|
24
|
+
if (message.hideJoystick === true) {
|
|
25
|
+
writer.uint32(24).bool(message.hideJoystick);
|
|
26
|
+
}
|
|
27
|
+
if (message.hideCrosshair === true) {
|
|
28
|
+
writer.uint32(32).bool(message.hideCrosshair);
|
|
29
|
+
}
|
|
30
|
+
return writer;
|
|
31
|
+
}
|
|
32
|
+
PBTouchScreenControls.encode = encode;
|
|
33
|
+
function decode(input, length) {
|
|
34
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
35
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
36
|
+
const message = createBasePBTouchScreenControls();
|
|
37
|
+
while (reader.pos < end) {
|
|
38
|
+
const tag = reader.uint32();
|
|
39
|
+
switch (tag >>> 3) {
|
|
40
|
+
case 1:
|
|
41
|
+
if (tag !== 10) {
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
message.touchInputs.push(PBTouchScreenControls_TouchInput.decode(reader, reader.uint32()));
|
|
45
|
+
continue;
|
|
46
|
+
case 2:
|
|
47
|
+
if (tag !== 16) {
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
message.mainAction = reader.int32();
|
|
51
|
+
continue;
|
|
52
|
+
case 3:
|
|
53
|
+
if (tag !== 24) {
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
message.hideJoystick = reader.bool();
|
|
57
|
+
continue;
|
|
58
|
+
case 4:
|
|
59
|
+
if (tag !== 32) {
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
message.hideCrosshair = reader.bool();
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
reader.skipType(tag & 7);
|
|
69
|
+
}
|
|
70
|
+
return message;
|
|
71
|
+
}
|
|
72
|
+
PBTouchScreenControls.decode = decode;
|
|
73
|
+
function fromJSON(object) {
|
|
74
|
+
return {
|
|
75
|
+
touchInputs: Array.isArray(object === null || object === void 0 ? void 0 : object.touchInputs)
|
|
76
|
+
? object.touchInputs.map((e) => PBTouchScreenControls_TouchInput.fromJSON(e))
|
|
77
|
+
: [],
|
|
78
|
+
mainAction: isSet(object.mainAction) ? (0, input_action_gen_1.inputActionFromJSON)(object.mainAction) : undefined,
|
|
79
|
+
hideJoystick: isSet(object.hideJoystick) ? Boolean(object.hideJoystick) : false,
|
|
80
|
+
hideCrosshair: isSet(object.hideCrosshair) ? Boolean(object.hideCrosshair) : false,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
PBTouchScreenControls.fromJSON = fromJSON;
|
|
84
|
+
function toJSON(message) {
|
|
85
|
+
const obj = {};
|
|
86
|
+
if (message.touchInputs) {
|
|
87
|
+
obj.touchInputs = message.touchInputs.map((e) => e ? PBTouchScreenControls_TouchInput.toJSON(e) : undefined);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
obj.touchInputs = [];
|
|
91
|
+
}
|
|
92
|
+
message.mainAction !== undefined &&
|
|
93
|
+
(obj.mainAction = message.mainAction !== undefined ? (0, input_action_gen_1.inputActionToJSON)(message.mainAction) : undefined);
|
|
94
|
+
message.hideJoystick !== undefined && (obj.hideJoystick = message.hideJoystick);
|
|
95
|
+
message.hideCrosshair !== undefined && (obj.hideCrosshair = message.hideCrosshair);
|
|
96
|
+
return obj;
|
|
97
|
+
}
|
|
98
|
+
PBTouchScreenControls.toJSON = toJSON;
|
|
99
|
+
function create(base) {
|
|
100
|
+
return PBTouchScreenControls.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
101
|
+
}
|
|
102
|
+
PBTouchScreenControls.create = create;
|
|
103
|
+
function fromPartial(object) {
|
|
104
|
+
var _a, _b, _c, _d;
|
|
105
|
+
const message = createBasePBTouchScreenControls();
|
|
106
|
+
message.touchInputs = ((_a = object.touchInputs) === null || _a === void 0 ? void 0 : _a.map((e) => PBTouchScreenControls_TouchInput.fromPartial(e))) || [];
|
|
107
|
+
message.mainAction = (_b = object.mainAction) !== null && _b !== void 0 ? _b : undefined;
|
|
108
|
+
message.hideJoystick = (_c = object.hideJoystick) !== null && _c !== void 0 ? _c : false;
|
|
109
|
+
message.hideCrosshair = (_d = object.hideCrosshair) !== null && _d !== void 0 ? _d : false;
|
|
110
|
+
return message;
|
|
111
|
+
}
|
|
112
|
+
PBTouchScreenControls.fromPartial = fromPartial;
|
|
113
|
+
})(PBTouchScreenControls || (exports.PBTouchScreenControls = PBTouchScreenControls = {}));
|
|
114
|
+
function createBasePBTouchScreenControls_TouchInput() {
|
|
115
|
+
return { inputAction: 0, hide: false, icon: undefined };
|
|
116
|
+
}
|
|
117
|
+
var PBTouchScreenControls_TouchInput;
|
|
118
|
+
(function (PBTouchScreenControls_TouchInput) {
|
|
119
|
+
function encode(message, writer = minimal_1.default.Writer.create()) {
|
|
120
|
+
if (message.inputAction !== 0) {
|
|
121
|
+
writer.uint32(8).int32(message.inputAction);
|
|
122
|
+
}
|
|
123
|
+
if (message.hide === true) {
|
|
124
|
+
writer.uint32(16).bool(message.hide);
|
|
125
|
+
}
|
|
126
|
+
if (message.icon !== undefined) {
|
|
127
|
+
texture_gen_1.TextureUnion.encode(message.icon, writer.uint32(26).fork()).ldelim();
|
|
128
|
+
}
|
|
129
|
+
return writer;
|
|
130
|
+
}
|
|
131
|
+
PBTouchScreenControls_TouchInput.encode = encode;
|
|
132
|
+
function decode(input, length) {
|
|
133
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
134
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
135
|
+
const message = createBasePBTouchScreenControls_TouchInput();
|
|
136
|
+
while (reader.pos < end) {
|
|
137
|
+
const tag = reader.uint32();
|
|
138
|
+
switch (tag >>> 3) {
|
|
139
|
+
case 1:
|
|
140
|
+
if (tag !== 8) {
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
message.inputAction = reader.int32();
|
|
144
|
+
continue;
|
|
145
|
+
case 2:
|
|
146
|
+
if (tag !== 16) {
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
message.hide = reader.bool();
|
|
150
|
+
continue;
|
|
151
|
+
case 3:
|
|
152
|
+
if (tag !== 26) {
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
message.icon = texture_gen_1.TextureUnion.decode(reader, reader.uint32());
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
reader.skipType(tag & 7);
|
|
162
|
+
}
|
|
163
|
+
return message;
|
|
164
|
+
}
|
|
165
|
+
PBTouchScreenControls_TouchInput.decode = decode;
|
|
166
|
+
function fromJSON(object) {
|
|
167
|
+
return {
|
|
168
|
+
inputAction: isSet(object.inputAction) ? (0, input_action_gen_1.inputActionFromJSON)(object.inputAction) : 0,
|
|
169
|
+
hide: isSet(object.hide) ? Boolean(object.hide) : false,
|
|
170
|
+
icon: isSet(object.icon) ? texture_gen_1.TextureUnion.fromJSON(object.icon) : undefined,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
PBTouchScreenControls_TouchInput.fromJSON = fromJSON;
|
|
174
|
+
function toJSON(message) {
|
|
175
|
+
const obj = {};
|
|
176
|
+
message.inputAction !== undefined && (obj.inputAction = (0, input_action_gen_1.inputActionToJSON)(message.inputAction));
|
|
177
|
+
message.hide !== undefined && (obj.hide = message.hide);
|
|
178
|
+
message.icon !== undefined && (obj.icon = message.icon ? texture_gen_1.TextureUnion.toJSON(message.icon) : undefined);
|
|
179
|
+
return obj;
|
|
180
|
+
}
|
|
181
|
+
PBTouchScreenControls_TouchInput.toJSON = toJSON;
|
|
182
|
+
function create(base) {
|
|
183
|
+
return PBTouchScreenControls_TouchInput.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
184
|
+
}
|
|
185
|
+
PBTouchScreenControls_TouchInput.create = create;
|
|
186
|
+
function fromPartial(object) {
|
|
187
|
+
var _a, _b;
|
|
188
|
+
const message = createBasePBTouchScreenControls_TouchInput();
|
|
189
|
+
message.inputAction = (_a = object.inputAction) !== null && _a !== void 0 ? _a : 0;
|
|
190
|
+
message.hide = (_b = object.hide) !== null && _b !== void 0 ? _b : false;
|
|
191
|
+
message.icon = (object.icon !== undefined && object.icon !== null)
|
|
192
|
+
? texture_gen_1.TextureUnion.fromPartial(object.icon)
|
|
193
|
+
: undefined;
|
|
194
|
+
return message;
|
|
195
|
+
}
|
|
196
|
+
PBTouchScreenControls_TouchInput.fromPartial = fromPartial;
|
|
197
|
+
})(PBTouchScreenControls_TouchInput || (exports.PBTouchScreenControls_TouchInput = PBTouchScreenControls_TouchInput = {}));
|
|
198
|
+
function isSet(value) {
|
|
199
|
+
return value !== null && value !== undefined;
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=touch_screen_controls.gen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touch_screen_controls.gen.js","sourceRoot":"","sources":["../../../../out-ts/decentraland/sdk/components/touch_screen_controls.gen.ts"],"names":[],"mappings":";;;;;;AAAA,oBAAoB;AACpB,iEAAqC;AACrC,0DAAwD;AACxD,gEAAgG;AAEnF,QAAA,eAAe,GAAG,6BAA6B,CAAC;AA8C7D,SAAS,+BAA+B;IACtC,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;AAC/F,CAAC;AAED,IAAiB,qBAAqB,CAoGrC;AApGD,WAAiB,qBAAqB;IACpC,SAAgB,MAAM,CAAC,OAA8B,EAAE,SAAqB,iBAAG,CAAC,MAAM,CAAC,MAAM,EAAE;QAC7F,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;YACpC,gCAAgC,CAAC,MAAM,CAAC,CAAE,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QACjF,CAAC;QACD,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACrC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC9C,CAAC;QACD,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;YAClC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC/C,CAAC;QACD,IAAI,OAAO,CAAC,aAAa,KAAK,IAAI,EAAE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A;IAED,SAAgB,WAAW,CACzB,MAAS;;QAET,MAAM,OAAO,GAAG,0CAA0C,EAAE,CAAC;QAC7D,OAAO,CAAC,WAAW,GAAG,MAAA,MAAM,CAAC,WAAW,mCAAI,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,GAAG,MAAA,MAAM,CAAC,IAAI,mCAAI,KAAK,CAAC;QACpC,OAAO,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;YAChE,CAAC,CAAC,0BAAY,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC;YACvC,CAAC,CAAC,SAAS,CAAC;QACd,OAAO,OAAO,CAAC;IACjB,CAAC;IAVe,4CAAW,cAU1B,CAAA;AACH,CAAC,EAvFgB,gCAAgC,gDAAhC,gCAAgC,QAuFhD;AAcD,SAAS,KAAK,CAAC,KAAU;IACvB,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import _m0 from "protobufjs/minimal";
|
|
2
|
+
import { InputAction } from "./common/input_action.gen";
|
|
3
|
+
export declare const protobufPackage = "decentraland.sdk.components";
|
|
4
|
+
/**
|
|
5
|
+
* The UiInputBinding component binds a UI entity to one or more InputActions. While the
|
|
6
|
+
* element is pressed (touch or pointer) the listed actions are held down, driving both
|
|
7
|
+
* the local player input and scene InputAction listeners, just like the native on-screen
|
|
8
|
+
* buttons. It is typically combined with PBTouchScreenControls to replace the native
|
|
9
|
+
* controls with a custom touch UI.
|
|
10
|
+
*
|
|
11
|
+
* Release semantics: the held actions are released as soon as the press that started them
|
|
12
|
+
* ends. A renderer MUST release all actions held by this binding when any of the following
|
|
13
|
+
* happens: the press/touch is lifted or cancelled, the pointer/touch leaves the element
|
|
14
|
+
* (loses press ownership), the actions list changes (the previous set is released before
|
|
15
|
+
* the new set is applied), the component is removed or its actions list becomes empty, the
|
|
16
|
+
* UI element is hidden, disabled or removed from the tree, or the scene unloads. In short,
|
|
17
|
+
* no action may remain held once the element is no longer both present and actively pressed.
|
|
18
|
+
*
|
|
19
|
+
* Multi-touch: the binding is a single held state, not reference-counted per pointer. The
|
|
20
|
+
* actions are held while the element is pressed and released when that press ends; a second
|
|
21
|
+
* simultaneous press on the same element does not stack, and does not extend the hold past
|
|
22
|
+
* the first release.
|
|
23
|
+
*/
|
|
24
|
+
export interface PBUiInputBinding {
|
|
25
|
+
/** the input actions fired while this element is pressed */
|
|
26
|
+
actions: InputAction[];
|
|
27
|
+
}
|
|
28
|
+
export declare namespace PBUiInputBinding {
|
|
29
|
+
function encode(message: PBUiInputBinding, writer?: _m0.Writer): _m0.Writer;
|
|
30
|
+
function decode(input: _m0.Reader | Uint8Array, length?: number): PBUiInputBinding;
|
|
31
|
+
function fromJSON(object: any): PBUiInputBinding;
|
|
32
|
+
function toJSON(message: PBUiInputBinding): unknown;
|
|
33
|
+
function create<I extends Exact<DeepPartial<PBUiInputBinding>, I>>(base?: I): PBUiInputBinding;
|
|
34
|
+
function fromPartial<I extends Exact<DeepPartial<PBUiInputBinding>, I>>(object: I): PBUiInputBinding;
|
|
35
|
+
}
|
|
36
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
37
|
+
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 {
|
|
38
|
+
$case: string;
|
|
39
|
+
} ? {
|
|
40
|
+
[K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>;
|
|
41
|
+
} & {
|
|
42
|
+
$case: T["$case"];
|
|
43
|
+
} : T extends {} ? {
|
|
44
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
45
|
+
} : Partial<T>;
|
|
46
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
47
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
48
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
49
|
+
} & {
|
|
50
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
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.PBUiInputBinding = exports.protobufPackage = void 0;
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
9
|
+
const input_action_gen_1 = require("./common/input_action.gen");
|
|
10
|
+
exports.protobufPackage = "decentraland.sdk.components";
|
|
11
|
+
function createBasePBUiInputBinding() {
|
|
12
|
+
return { actions: [] };
|
|
13
|
+
}
|
|
14
|
+
var PBUiInputBinding;
|
|
15
|
+
(function (PBUiInputBinding) {
|
|
16
|
+
function encode(message, writer = minimal_1.default.Writer.create()) {
|
|
17
|
+
writer.uint32(10).fork();
|
|
18
|
+
for (const v of message.actions) {
|
|
19
|
+
writer.int32(v);
|
|
20
|
+
}
|
|
21
|
+
writer.ldelim();
|
|
22
|
+
return writer;
|
|
23
|
+
}
|
|
24
|
+
PBUiInputBinding.encode = encode;
|
|
25
|
+
function decode(input, length) {
|
|
26
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
27
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
28
|
+
const message = createBasePBUiInputBinding();
|
|
29
|
+
while (reader.pos < end) {
|
|
30
|
+
const tag = reader.uint32();
|
|
31
|
+
switch (tag >>> 3) {
|
|
32
|
+
case 1:
|
|
33
|
+
if (tag === 8) {
|
|
34
|
+
message.actions.push(reader.int32());
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (tag === 10) {
|
|
38
|
+
const end2 = reader.uint32() + reader.pos;
|
|
39
|
+
while (reader.pos < end2) {
|
|
40
|
+
message.actions.push(reader.int32());
|
|
41
|
+
}
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
reader.skipType(tag & 7);
|
|
50
|
+
}
|
|
51
|
+
return message;
|
|
52
|
+
}
|
|
53
|
+
PBUiInputBinding.decode = decode;
|
|
54
|
+
function fromJSON(object) {
|
|
55
|
+
return { actions: Array.isArray(object === null || object === void 0 ? void 0 : object.actions) ? object.actions.map((e) => (0, input_action_gen_1.inputActionFromJSON)(e)) : [] };
|
|
56
|
+
}
|
|
57
|
+
PBUiInputBinding.fromJSON = fromJSON;
|
|
58
|
+
function toJSON(message) {
|
|
59
|
+
const obj = {};
|
|
60
|
+
if (message.actions) {
|
|
61
|
+
obj.actions = message.actions.map((e) => (0, input_action_gen_1.inputActionToJSON)(e));
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
obj.actions = [];
|
|
65
|
+
}
|
|
66
|
+
return obj;
|
|
67
|
+
}
|
|
68
|
+
PBUiInputBinding.toJSON = toJSON;
|
|
69
|
+
function create(base) {
|
|
70
|
+
return PBUiInputBinding.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
71
|
+
}
|
|
72
|
+
PBUiInputBinding.create = create;
|
|
73
|
+
function fromPartial(object) {
|
|
74
|
+
var _a;
|
|
75
|
+
const message = createBasePBUiInputBinding();
|
|
76
|
+
message.actions = ((_a = object.actions) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
|
|
77
|
+
return message;
|
|
78
|
+
}
|
|
79
|
+
PBUiInputBinding.fromPartial = fromPartial;
|
|
80
|
+
})(PBUiInputBinding || (exports.PBUiInputBinding = PBUiInputBinding = {}));
|
|
81
|
+
//# sourceMappingURL=ui_input_binding.gen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui_input_binding.gen.js","sourceRoot":"","sources":["../../../../out-ts/decentraland/sdk/components/ui_input_binding.gen.ts"],"names":[],"mappings":";;;;;;AAAA,oBAAoB;AACpB,iEAAqC;AACrC,gEAAgG;AAEnF,QAAA,eAAe,GAAG,6BAA6B,CAAC;AA2B7D,SAAS,0BAA0B;IACjC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AACzB,CAAC;AAED,IAAiB,gBAAgB,CAkEhC;AAlED,WAAiB,gBAAgB;IAC/B,SAAgB,MAAM,CAAC,OAAyB,EAAE,SAAqB,iBAAG,CAAC,MAAM,CAAC,MAAM,EAAE;QACxF,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACzB,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAChC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,CAAC,MAAM,EAAE,CAAC;QAChB,OAAO,MAAM,CAAC;IAChB,CAAC;IAPe,uBAAM,SAOrB,CAAA;IAED,SAAgB,MAAM,CAAC,KAA8B,EAAE,MAAe;QACpE,MAAM,MAAM,GAAG,KAAK,YAAY,iBAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9E,IAAI,GAAG,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC;QAClE,MAAM,OAAO,GAAG,0BAA0B,EAAE,CAAC;QAC7C,OAAO,MAAM,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;YACxB,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;Y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AG,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,oCAAiB,EAAC,CAAC,CAAC,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC;QACnB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IARe,uBAAM,SAQrB,CAAA;IAED,SAAgB,MAAM,CAAoD,IAAQ;QAChF,OAAO,gBAAgB,CAAC,WAAW,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC,CAAC;IAClD,CAAC;IAFe,uBAAM,SAErB,CAAA;IAED,SAAgB,WAAW,CAAoD,MAAS;;QACtF,MAAM,OAAO,GAAG,0BAA0B,EAAE,CAAC;QAC7C,OAAO,CAAC,OAAO,GAAG,CAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAI,EAAE,CAAC;QACtD,OAAO,OAAO,CAAC;IACjB,CAAC;IAJe,4BAAW,cAI1B,CAAA;AACH,CAAC,EAlEgB,gBAAgB,gCAAhB,gBAAgB,QAkEhC"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { TextureUnion } from "../../common/texture.gen";
|
|
4
|
+
import { InputAction, inputActionFromJSON, inputActionToJSON } from "./common/input_action.gen";
|
|
5
|
+
|
|
6
|
+
export const protobufPackage = "decentraland.sdk.components";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The TouchScreenControls component lets a scene configure the native on-screen touch
|
|
10
|
+
* controls (the mobile joystick + gamepad). It must be set on the RootEntity.
|
|
11
|
+
*
|
|
12
|
+
* By default every on-screen button is shown; list a button in `touch_inputs` with
|
|
13
|
+
* `hide = true` to remove it (declutter). `main_action` picks which action the large
|
|
14
|
+
* central button triggers, and `hide_joystick` removes the native virtual joystick. It is
|
|
15
|
+
* a no-op on platforms without native on-screen controls (e.g. desktop).
|
|
16
|
+
*
|
|
17
|
+
* Accepted actions: only the on-screen gamepad actions map to a button — `IA_POINTER`,
|
|
18
|
+
* `IA_PRIMARY`, `IA_SECONDARY`, `IA_JUMP`, and `IA_ACTION_3`..`IA_ACTION_6`. Any other
|
|
19
|
+
* `InputAction` (movement actions, `IA_ANY`, `IA_MODIFIER`, or unknown/future values) is
|
|
20
|
+
* ignored: a `TouchInput` entry naming a non-button action has no effect, and a `main_action`
|
|
21
|
+
* that isn't a valid gamepad action falls back to the default central button (`IA_JUMP`).
|
|
22
|
+
*/
|
|
23
|
+
export interface PBTouchScreenControls {
|
|
24
|
+
touchInputs: PBTouchScreenControls_TouchInput[];
|
|
25
|
+
/**
|
|
26
|
+
* The large central button's action. Only the gamepad actions are valid:
|
|
27
|
+
* jump / pointer / primary (E) / secondary (F) / action_3..action_6 (1/2/3/4).
|
|
28
|
+
* When unset, the default central button (jump) is kept.
|
|
29
|
+
*/
|
|
30
|
+
mainAction?:
|
|
31
|
+
| InputAction
|
|
32
|
+
| undefined;
|
|
33
|
+
/** hide the native virtual joystick */
|
|
34
|
+
hideJoystick: boolean;
|
|
35
|
+
/** hide the on-screen crosshair / reticle */
|
|
36
|
+
hideCrosshair: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Per-button configuration. A button not listed here keeps its default (shown). */
|
|
40
|
+
export interface PBTouchScreenControls_TouchInput {
|
|
41
|
+
/** which on-screen button this configures */
|
|
42
|
+
inputAction: InputAction;
|
|
43
|
+
/** hide this button (default: shown) */
|
|
44
|
+
hide: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Override the button glyph with this texture. For the jump button it replaces all
|
|
47
|
+
* of its dynamic states (jump / double-jump / glide).
|
|
48
|
+
*/
|
|
49
|
+
icon?: TextureUnion | undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function createBasePBTouchScreenControls(): PBTouchScreenControls {
|
|
53
|
+
return { touchInputs: [], mainAction: undefined, hideJoystick: false, hideCrosshair: false };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export namespace PBTouchScreenControls {
|
|
57
|
+
export function encode(message: PBTouchScreenControls, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
58
|
+
for (const v of message.touchInputs) {
|
|
59
|
+
PBTouchScreenControls_TouchInput.encode(v!, writer.uint32(10).fork()).ldelim();
|
|
60
|
+
}
|
|
61
|
+
if (message.mainAction !== undefined) {
|
|
62
|
+
writer.uint32(16).int32(message.mainAction);
|
|
63
|
+
}
|
|
64
|
+
if (message.hideJoystick === true) {
|
|
65
|
+
writer.uint32(24).bool(message.hideJoystick);
|
|
66
|
+
}
|
|
67
|
+
if (message.hideCrosshair === true) {
|
|
68
|
+
writer.uint32(32).bool(message.hideCrosshair);
|
|
69
|
+
}
|
|
70
|
+
return writer;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBTouchScreenControls {
|
|
74
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
75
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
76
|
+
const message = createBasePBTouchScreenControls();
|
|
77
|
+
while (reader.pos < end) {
|
|
78
|
+
const tag = reader.uint32();
|
|
79
|
+
switch (tag >>> 3) {
|
|
80
|
+
case 1:
|
|
81
|
+
if (tag !== 10) {
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
message.touchInputs.push(PBTouchScreenControls_TouchInput.decode(reader, reader.uint32()));
|
|
86
|
+
continue;
|
|
87
|
+
case 2:
|
|
88
|
+
if (tag !== 16) {
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
message.mainAction = reader.int32() as any;
|
|
93
|
+
continue;
|
|
94
|
+
case 3:
|
|
95
|
+
if (tag !== 24) {
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
message.hideJoystick = reader.bool();
|
|
100
|
+
continue;
|
|
101
|
+
case 4:
|
|
102
|
+
if (tag !== 32) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
message.hideCrosshair = reader.bool();
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
reader.skipType(tag & 7);
|
|
113
|
+
}
|
|
114
|
+
return message;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function fromJSON(object: any): PBTouchScreenControls {
|
|
118
|
+
return {
|
|
119
|
+
touchInputs: Array.isArray(object?.touchInputs)
|
|
120
|
+
? object.touchInputs.map((e: any) => PBTouchScreenControls_TouchInput.fromJSON(e))
|
|
121
|
+
: [],
|
|
122
|
+
mainAction: isSet(object.mainAction) ? inputActionFromJSON(object.mainAction) : undefined,
|
|
123
|
+
hideJoystick: isSet(object.hideJoystick) ? Boolean(object.hideJoystick) : false,
|
|
124
|
+
hideCrosshair: isSet(object.hideCrosshair) ? Boolean(object.hideCrosshair) : false,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function toJSON(message: PBTouchScreenControls): unknown {
|
|
129
|
+
const obj: any = {};
|
|
130
|
+
if (message.touchInputs) {
|
|
131
|
+
obj.touchInputs = message.touchInputs.map((e) => e ? PBTouchScreenControls_TouchInput.toJSON(e) : undefined);
|
|
132
|
+
} else {
|
|
133
|
+
obj.touchInputs = [];
|
|
134
|
+
}
|
|
135
|
+
message.mainAction !== undefined &&
|
|
136
|
+
(obj.mainAction = message.mainAction !== undefined ? inputActionToJSON(message.mainAction) : undefined);
|
|
137
|
+
message.hideJoystick !== undefined && (obj.hideJoystick = message.hideJoystick);
|
|
138
|
+
message.hideCrosshair !== undefined && (obj.hideCrosshair = message.hideCrosshair);
|
|
139
|
+
return obj;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function create<I extends Exact<DeepPartial<PBTouchScreenControls>, I>>(base?: I): PBTouchScreenControls {
|
|
143
|
+
return PBTouchScreenControls.fromPartial(base ?? {});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function fromPartial<I extends Exact<DeepPartial<PBTouchScreenControls>, I>>(
|
|
147
|
+
object: I,
|
|
148
|
+
): PBTouchScreenControls {
|
|
149
|
+
const message = createBasePBTouchScreenControls();
|
|
150
|
+
message.touchInputs = object.touchInputs?.map((e) => PBTouchScreenControls_TouchInput.fromPartial(e)) || [];
|
|
151
|
+
message.mainAction = object.mainAction ?? undefined;
|
|
152
|
+
message.hideJoystick = object.hideJoystick ?? false;
|
|
153
|
+
message.hideCrosshair = object.hideCrosshair ?? false;
|
|
154
|
+
return message;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function createBasePBTouchScreenControls_TouchInput(): PBTouchScreenControls_TouchInput {
|
|
159
|
+
return { inputAction: 0, hide: false, icon: undefined };
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export namespace PBTouchScreenControls_TouchInput {
|
|
163
|
+
export function encode(
|
|
164
|
+
message: PBTouchScreenControls_TouchInput,
|
|
165
|
+
writer: _m0.Writer = _m0.Writer.create(),
|
|
166
|
+
): _m0.Writer {
|
|
167
|
+
if (message.inputAction !== 0) {
|
|
168
|
+
writer.uint32(8).int32(message.inputAction);
|
|
169
|
+
}
|
|
170
|
+
if (message.hide === true) {
|
|
171
|
+
writer.uint32(16).bool(message.hide);
|
|
172
|
+
}
|
|
173
|
+
if (message.icon !== undefined) {
|
|
174
|
+
TextureUnion.encode(message.icon, writer.uint32(26).fork()).ldelim();
|
|
175
|
+
}
|
|
176
|
+
return writer;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBTouchScreenControls_TouchInput {
|
|
180
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
181
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
182
|
+
const message = createBasePBTouchScreenControls_TouchInput();
|
|
183
|
+
while (reader.pos < end) {
|
|
184
|
+
const tag = reader.uint32();
|
|
185
|
+
switch (tag >>> 3) {
|
|
186
|
+
case 1:
|
|
187
|
+
if (tag !== 8) {
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
message.inputAction = reader.int32() as any;
|
|
192
|
+
continue;
|
|
193
|
+
case 2:
|
|
194
|
+
if (tag !== 16) {
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
message.hide = reader.bool();
|
|
199
|
+
continue;
|
|
200
|
+
case 3:
|
|
201
|
+
if (tag !== 26) {
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
message.icon = TextureUnion.decode(reader, reader.uint32());
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
reader.skipType(tag & 7);
|
|
212
|
+
}
|
|
213
|
+
return message;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function fromJSON(object: any): PBTouchScreenControls_TouchInput {
|
|
217
|
+
return {
|
|
218
|
+
inputAction: isSet(object.inputAction) ? inputActionFromJSON(object.inputAction) : 0,
|
|
219
|
+
hide: isSet(object.hide) ? Boolean(object.hide) : false,
|
|
220
|
+
icon: isSet(object.icon) ? TextureUnion.fromJSON(object.icon) : undefined,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export function toJSON(message: PBTouchScreenControls_TouchInput): unknown {
|
|
225
|
+
const obj: any = {};
|
|
226
|
+
message.inputAction !== undefined && (obj.inputAction = inputActionToJSON(message.inputAction));
|
|
227
|
+
message.hide !== undefined && (obj.hide = message.hide);
|
|
228
|
+
message.icon !== undefined && (obj.icon = message.icon ? TextureUnion.toJSON(message.icon) : undefined);
|
|
229
|
+
return obj;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export function create<I extends Exact<DeepPartial<PBTouchScreenControls_TouchInput>, I>>(
|
|
233
|
+
base?: I,
|
|
234
|
+
): PBTouchScreenControls_TouchInput {
|
|
235
|
+
return PBTouchScreenControls_TouchInput.fromPartial(base ?? {});
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export function fromPartial<I extends Exact<DeepPartial<PBTouchScreenControls_TouchInput>, I>>(
|
|
239
|
+
object: I,
|
|
240
|
+
): PBTouchScreenControls_TouchInput {
|
|
241
|
+
const message = createBasePBTouchScreenControls_TouchInput();
|
|
242
|
+
message.inputAction = object.inputAction ?? 0;
|
|
243
|
+
message.hide = object.hide ?? false;
|
|
244
|
+
message.icon = (object.icon !== undefined && object.icon !== null)
|
|
245
|
+
? TextureUnion.fromPartial(object.icon)
|
|
246
|
+
: undefined;
|
|
247
|
+
return message;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
252
|
+
|
|
253
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
254
|
+
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
255
|
+
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
256
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
257
|
+
: Partial<T>;
|
|
258
|
+
|
|
259
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
260
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
261
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
262
|
+
|
|
263
|
+
function isSet(value: any): boolean {
|
|
264
|
+
return value !== null && value !== undefined;
|
|
265
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { InputAction, inputActionFromJSON, inputActionToJSON } from "./common/input_action.gen";
|
|
4
|
+
|
|
5
|
+
export const protobufPackage = "decentraland.sdk.components";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The UiInputBinding component binds a UI entity to one or more InputActions. While the
|
|
9
|
+
* element is pressed (touch or pointer) the listed actions are held down, driving both
|
|
10
|
+
* the local player input and scene InputAction listeners, just like the native on-screen
|
|
11
|
+
* buttons. It is typically combined with PBTouchScreenControls to replace the native
|
|
12
|
+
* controls with a custom touch UI.
|
|
13
|
+
*
|
|
14
|
+
* Release semantics: the held actions are released as soon as the press that started them
|
|
15
|
+
* ends. A renderer MUST release all actions held by this binding when any of the following
|
|
16
|
+
* happens: the press/touch is lifted or cancelled, the pointer/touch leaves the element
|
|
17
|
+
* (loses press ownership), the actions list changes (the previous set is released before
|
|
18
|
+
* the new set is applied), the component is removed or its actions list becomes empty, the
|
|
19
|
+
* UI element is hidden, disabled or removed from the tree, or the scene unloads. In short,
|
|
20
|
+
* no action may remain held once the element is no longer both present and actively pressed.
|
|
21
|
+
*
|
|
22
|
+
* Multi-touch: the binding is a single held state, not reference-counted per pointer. The
|
|
23
|
+
* actions are held while the element is pressed and released when that press ends; a second
|
|
24
|
+
* simultaneous press on the same element does not stack, and does not extend the hold past
|
|
25
|
+
* the first release.
|
|
26
|
+
*/
|
|
27
|
+
export interface PBUiInputBinding {
|
|
28
|
+
/** the input actions fired while this element is pressed */
|
|
29
|
+
actions: InputAction[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function createBasePBUiInputBinding(): PBUiInputBinding {
|
|
33
|
+
return { actions: [] };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export namespace PBUiInputBinding {
|
|
37
|
+
export function encode(message: PBUiInputBinding, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
38
|
+
writer.uint32(10).fork();
|
|
39
|
+
for (const v of message.actions) {
|
|
40
|
+
writer.int32(v);
|
|
41
|
+
}
|
|
42
|
+
writer.ldelim();
|
|
43
|
+
return writer;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBUiInputBinding {
|
|
47
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
48
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
49
|
+
const message = createBasePBUiInputBinding();
|
|
50
|
+
while (reader.pos < end) {
|
|
51
|
+
const tag = reader.uint32();
|
|
52
|
+
switch (tag >>> 3) {
|
|
53
|
+
case 1:
|
|
54
|
+
if (tag === 8) {
|
|
55
|
+
message.actions.push(reader.int32() as any);
|
|
56
|
+
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (tag === 10) {
|
|
61
|
+
const end2 = reader.uint32() + reader.pos;
|
|
62
|
+
while (reader.pos < end2) {
|
|
63
|
+
message.actions.push(reader.int32() as any);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
reader.skipType(tag & 7);
|
|
75
|
+
}
|
|
76
|
+
return message;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function fromJSON(object: any): PBUiInputBinding {
|
|
80
|
+
return { actions: Array.isArray(object?.actions) ? object.actions.map((e: any) => inputActionFromJSON(e)) : [] };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function toJSON(message: PBUiInputBinding): unknown {
|
|
84
|
+
const obj: any = {};
|
|
85
|
+
if (message.actions) {
|
|
86
|
+
obj.actions = message.actions.map((e) => inputActionToJSON(e));
|
|
87
|
+
} else {
|
|
88
|
+
obj.actions = [];
|
|
89
|
+
}
|
|
90
|
+
return obj;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function create<I extends Exact<DeepPartial<PBUiInputBinding>, I>>(base?: I): PBUiInputBinding {
|
|
94
|
+
return PBUiInputBinding.fromPartial(base ?? {});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function fromPartial<I extends Exact<DeepPartial<PBUiInputBinding>, I>>(object: I): PBUiInputBinding {
|
|
98
|
+
const message = createBasePBUiInputBinding();
|
|
99
|
+
message.actions = object.actions?.map((e) => e) || [];
|
|
100
|
+
return message;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
105
|
+
|
|
106
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
107
|
+
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
108
|
+
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
109
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
110
|
+
: Partial<T>;
|
|
111
|
+
|
|
112
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
113
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
114
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
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-29501656680.commit-6a4362a",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"out-js",
|
|
34
34
|
"public"
|
|
35
35
|
],
|
|
36
|
-
"commit": "
|
|
36
|
+
"commit": "6a4362aad3f01b1942719bd42bb9d4509d57a290"
|
|
37
37
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
package decentraland.sdk.components;
|
|
3
|
+
import "decentraland/sdk/components/common/id.proto";
|
|
4
|
+
import "decentraland/sdk/components/common/input_action.proto";
|
|
5
|
+
import "decentraland/common/texture.proto";
|
|
6
|
+
option (common.ecs_component_id) = 1218;
|
|
7
|
+
|
|
8
|
+
// The TouchScreenControls component lets a scene configure the native on-screen touch
|
|
9
|
+
// controls (the mobile joystick + gamepad). It must be set on the RootEntity.
|
|
10
|
+
//
|
|
11
|
+
// By default every on-screen button is shown; list a button in `touch_inputs` with
|
|
12
|
+
// `hide = true` to remove it (declutter). `main_action` picks which action the large
|
|
13
|
+
// central button triggers, and `hide_joystick` removes the native virtual joystick. It is
|
|
14
|
+
// a no-op on platforms without native on-screen controls (e.g. desktop).
|
|
15
|
+
//
|
|
16
|
+
// Accepted actions: only the on-screen gamepad actions map to a button — `IA_POINTER`,
|
|
17
|
+
// `IA_PRIMARY`, `IA_SECONDARY`, `IA_JUMP`, and `IA_ACTION_3`..`IA_ACTION_6`. Any other
|
|
18
|
+
// `InputAction` (movement actions, `IA_ANY`, `IA_MODIFIER`, or unknown/future values) is
|
|
19
|
+
// ignored: a `TouchInput` entry naming a non-button action has no effect, and a `main_action`
|
|
20
|
+
// that isn't a valid gamepad action falls back to the default central button (`IA_JUMP`).
|
|
21
|
+
message PBTouchScreenControls {
|
|
22
|
+
// Per-button configuration. A button not listed here keeps its default (shown).
|
|
23
|
+
message TouchInput {
|
|
24
|
+
common.InputAction input_action = 1; // which on-screen button this configures
|
|
25
|
+
bool hide = 2; // hide this button (default: shown)
|
|
26
|
+
// Override the button glyph with this texture. For the jump button it replaces all
|
|
27
|
+
// of its dynamic states (jump / double-jump / glide).
|
|
28
|
+
optional decentraland.common.TextureUnion icon = 3;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
repeated TouchInput touch_inputs = 1;
|
|
32
|
+
// The large central button's action. Only the gamepad actions are valid:
|
|
33
|
+
// jump / pointer / primary (E) / secondary (F) / action_3..action_6 (1/2/3/4).
|
|
34
|
+
// When unset, the default central button (jump) is kept.
|
|
35
|
+
optional common.InputAction main_action = 2;
|
|
36
|
+
bool hide_joystick = 3; // hide the native virtual joystick
|
|
37
|
+
bool hide_crosshair = 4; // hide the on-screen crosshair / reticle
|
|
38
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
package decentraland.sdk.components;
|
|
3
|
+
import "decentraland/sdk/components/common/id.proto";
|
|
4
|
+
import "decentraland/sdk/components/common/input_action.proto";
|
|
5
|
+
option (common.ecs_component_id) = 1219;
|
|
6
|
+
|
|
7
|
+
// The UiInputBinding component binds a UI entity to one or more InputActions. While the
|
|
8
|
+
// element is pressed (touch or pointer) the listed actions are held down, driving both
|
|
9
|
+
// the local player input and scene InputAction listeners, just like the native on-screen
|
|
10
|
+
// buttons. It is typically combined with PBTouchScreenControls to replace the native
|
|
11
|
+
// controls with a custom touch UI.
|
|
12
|
+
//
|
|
13
|
+
// Release semantics: the held actions are released as soon as the press that started them
|
|
14
|
+
// ends. A renderer MUST release all actions held by this binding when any of the following
|
|
15
|
+
// happens: the press/touch is lifted or cancelled, the pointer/touch leaves the element
|
|
16
|
+
// (loses press ownership), the actions list changes (the previous set is released before
|
|
17
|
+
// the new set is applied), the component is removed or its actions list becomes empty, the
|
|
18
|
+
// UI element is hidden, disabled or removed from the tree, or the scene unloads. In short,
|
|
19
|
+
// no action may remain held once the element is no longer both present and actively pressed.
|
|
20
|
+
//
|
|
21
|
+
// Multi-touch: the binding is a single held state, not reference-counted per pointer. The
|
|
22
|
+
// actions are held while the element is pressed and released when that press ends; a second
|
|
23
|
+
// simultaneous press on the same element does not stack, and does not extend the hold past
|
|
24
|
+
// the first release.
|
|
25
|
+
message PBUiInputBinding {
|
|
26
|
+
repeated common.InputAction actions = 1; // the input actions fired while this element is pressed
|
|
27
|
+
}
|
|
@@ -29,6 +29,7 @@ import public "decentraland/sdk/components/raycast_result.proto";
|
|
|
29
29
|
import public "decentraland/sdk/components/raycast.proto";
|
|
30
30
|
import public "decentraland/sdk/components/realm_info.proto";
|
|
31
31
|
import public "decentraland/sdk/components/text_shape.proto";
|
|
32
|
+
import public "decentraland/sdk/components/touch_screen_controls.proto";
|
|
32
33
|
import public "decentraland/sdk/components/tween.proto";
|
|
33
34
|
import public "decentraland/sdk/components/tween_state.proto";
|
|
34
35
|
import public "decentraland/sdk/components/tween_sequence.proto";
|
|
@@ -37,6 +38,7 @@ import public "decentraland/sdk/components/ui_dropdown_result.proto";
|
|
|
37
38
|
import public "decentraland/sdk/components/ui_dropdown.proto";
|
|
38
39
|
import public "decentraland/sdk/components/ui_input_result.proto";
|
|
39
40
|
import public "decentraland/sdk/components/ui_input.proto";
|
|
41
|
+
import public "decentraland/sdk/components/ui_input_binding.proto";
|
|
40
42
|
import public "decentraland/sdk/components/ui_text.proto";
|
|
41
43
|
import public "decentraland/sdk/components/ui_transform.proto";
|
|
42
44
|
import public "decentraland/sdk/components/video_player.proto";
|