From e75b19f2127a46acc242f1c3b1e8d39c4ed25f07 Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Mon, 11 Nov 2024 21:25:56 -0300 Subject: [PATCH 01/15] Initial implementation of helper function for InputModifier --- .../src/components/extended/InputModifier.ts | 35 +++++++++++++++++++ .../etc/playground-assets.api.md | 21 +++++++++++ 2 files changed, 56 insertions(+) create mode 100644 packages/@dcl/ecs/src/components/extended/InputModifier.ts diff --git a/packages/@dcl/ecs/src/components/extended/InputModifier.ts b/packages/@dcl/ecs/src/components/extended/InputModifier.ts new file mode 100644 index 000000000..105447857 --- /dev/null +++ b/packages/@dcl/ecs/src/components/extended/InputModifier.ts @@ -0,0 +1,35 @@ +import { ReadOnlyLastWriteWinElementSetComponentDefinition, IEngine } from "../../engine" +import { InputModifier } from "../generated/index.gen" +import { PBInputModifier_StandardInput, PBInputModifier } from "../generated/pb/decentraland/sdk/components/input_modifier.gen" + +export interface InputModifierHelper { + /** + * @returns a input modifier mode + */ + Standard: (standard: PBInputModifier_StandardInput) => PBInputModifier['mode'] +} + +export interface InputModifierComponentDefinitionExtended + extends ReadOnlyLastWriteWinElementSetComponentDefinition { + Mode: InputModifierHelper +} + +const InputModifierHelper: InputModifierHelper = { + Standard(standard) { + return { + $case: 'standard' as const, + standard + } + } +} + +export function defineInputModifierComponent( + engine: Pick +): InputModifierComponentDefinitionExtended { + const theComponent = InputModifier(engine) + + return { + ...theComponent, + Mode: InputModifierHelper + } +} diff --git a/packages/@dcl/playground-assets/etc/playground-assets.api.md b/packages/@dcl/playground-assets/etc/playground-assets.api.md index ab07bea40..1bed1779b 100644 --- a/packages/@dcl/playground-assets/etc/playground-assets.api.md +++ b/packages/@dcl/playground-assets/etc/playground-assets.api.md @@ -2889,6 +2889,9 @@ export interface PBTween { } | { $case: "scale"; scale: Scale; + } | { + $case: "textureMove"; + textureMove: TextureMove; } | undefined; playing?: boolean | undefined; } @@ -3891,8 +3894,10 @@ export const TextShape: LastWriteWinElementSetComponentDefinition; // @public (undocumented) export interface Texture { filterMode?: TextureFilterMode | undefined; + offset?: PBVector2 | undefined; // (undocumented) src: string; + tiling?: PBVector2 | undefined; wrapMode?: TextureWrapMode | undefined; } @@ -3930,6 +3935,22 @@ export interface TextureHelper { // @public export type TextureMode = 'nine-slices' | 'center' | 'stretch'; +// @public (undocumented) +export interface TextureMove { + // (undocumented) + end: PBVector2 | undefined; + // (undocumented) + start: PBVector2 | undefined; +} + +// @public (undocumented) +export namespace TextureMove { + // (undocumented) + export function decode(input: _m0.Reader | Uint8Array, length?: number): TextureMove; + // (undocumented) + export function encode(message: TextureMove, writer?: _m0.Writer): _m0.Writer; +} + // @public (undocumented) export interface TextureUnion { // (undocumented) From 422713a03a6e2c64d6fe8f4e67f97afd7e3c0a74 Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Mon, 11 Nov 2024 22:39:07 -0300 Subject: [PATCH 02/15] Updated protocol, regenerated API and run a lint pass --- package-lock.json | 14 +++++++------- package.json | 2 +- .../src/components/extended/InputModifier.ts | 9 ++++++--- .../etc/playground-assets.api.md | 19 ------------------- packages/@dcl/sdk-commands/package-lock.json | 14 +++++++------- packages/@dcl/sdk-commands/package.json | 2 +- 6 files changed, 22 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index 75c4d21cf..4732002bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "license": "Apache-2.0", "dependencies": { "@actions/core": "^1.10.0", - "@dcl/protocol": "1.0.0-11599848164.commit-ef74edc", + "@dcl/protocol": "1.0.0-11780504028.commit-c886080", "@dcl/quickjs-emscripten": "^0.21.0-3680274614.commit-1808aa1", "@dcl/ts-proto": "1.153.0", "@types/fs-extra": "^9.0.12", @@ -577,9 +577,9 @@ } }, "node_modules/@dcl/protocol": { - "version": "1.0.0-11599848164.commit-ef74edc", - "resolved": "https://registry.npmjs.org/@dcl/protocol/-/protocol-1.0.0-11599848164.commit-ef74edc.tgz", - "integrity": "sha512-XSUOA0LbchlBUk5/BMJFBl0+qOm4UOIxwMGp38A1n4LQAatGO/RXjzReJRveqiFma+X7eq3e6+KCDqTLwepN0w==", + "version": "1.0.0-11780504028.commit-c886080", + "resolved": "https://registry.npmjs.org/@dcl/protocol/-/protocol-1.0.0-11780504028.commit-c886080.tgz", + "integrity": "sha512-R2OnlV2yZ6S4+Kcf796v8v+HI6TwCGBXitbDBUwUczukrSbw8u9mpGXBi08SPoV025DQs5AA6XXWkfb2uDNUZg==", "dependencies": { "@dcl/ts-proto": "1.154.0" } @@ -8232,9 +8232,9 @@ } }, "@dcl/protocol": { - "version": "1.0.0-11599848164.commit-ef74edc", - "resolved": "https://registry.npmjs.org/@dcl/protocol/-/protocol-1.0.0-11599848164.commit-ef74edc.tgz", - "integrity": "sha512-XSUOA0LbchlBUk5/BMJFBl0+qOm4UOIxwMGp38A1n4LQAatGO/RXjzReJRveqiFma+X7eq3e6+KCDqTLwepN0w==", + "version": "1.0.0-11780504028.commit-c886080", + "resolved": "https://registry.npmjs.org/@dcl/protocol/-/protocol-1.0.0-11780504028.commit-c886080.tgz", + "integrity": "sha512-R2OnlV2yZ6S4+Kcf796v8v+HI6TwCGBXitbDBUwUczukrSbw8u9mpGXBi08SPoV025DQs5AA6XXWkfb2uDNUZg==", "requires": { "@dcl/ts-proto": "1.154.0" }, diff --git a/package.json b/package.json index 28538db1a..c8821a791 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "bugs": "https://github.com/decentraland/js-sdk-toolchain/issues", "dependencies": { "@actions/core": "^1.10.0", - "@dcl/protocol": "1.0.0-11599848164.commit-ef74edc", + "@dcl/protocol": "1.0.0-11780504028.commit-c886080", "@dcl/quickjs-emscripten": "^0.21.0-3680274614.commit-1808aa1", "@dcl/ts-proto": "1.153.0", "@types/fs-extra": "^9.0.12", diff --git a/packages/@dcl/ecs/src/components/extended/InputModifier.ts b/packages/@dcl/ecs/src/components/extended/InputModifier.ts index 105447857..08f4cffd2 100644 --- a/packages/@dcl/ecs/src/components/extended/InputModifier.ts +++ b/packages/@dcl/ecs/src/components/extended/InputModifier.ts @@ -1,6 +1,9 @@ -import { ReadOnlyLastWriteWinElementSetComponentDefinition, IEngine } from "../../engine" -import { InputModifier } from "../generated/index.gen" -import { PBInputModifier_StandardInput, PBInputModifier } from "../generated/pb/decentraland/sdk/components/input_modifier.gen" +import { ReadOnlyLastWriteWinElementSetComponentDefinition, IEngine } from '../../engine' +import { InputModifier } from '../generated/index.gen' +import { + PBInputModifier_StandardInput, + PBInputModifier +} from '../generated/pb/decentraland/sdk/components/input_modifier.gen' export interface InputModifierHelper { /** diff --git a/packages/@dcl/playground-assets/etc/playground-assets.api.md b/packages/@dcl/playground-assets/etc/playground-assets.api.md index 1bed1779b..f24a30ca9 100644 --- a/packages/@dcl/playground-assets/etc/playground-assets.api.md +++ b/packages/@dcl/playground-assets/etc/playground-assets.api.md @@ -2889,9 +2889,6 @@ export interface PBTween { } | { $case: "scale"; scale: Scale; - } | { - $case: "textureMove"; - textureMove: TextureMove; } | undefined; playing?: boolean | undefined; } @@ -3935,22 +3932,6 @@ export interface TextureHelper { // @public export type TextureMode = 'nine-slices' | 'center' | 'stretch'; -// @public (undocumented) -export interface TextureMove { - // (undocumented) - end: PBVector2 | undefined; - // (undocumented) - start: PBVector2 | undefined; -} - -// @public (undocumented) -export namespace TextureMove { - // (undocumented) - export function decode(input: _m0.Reader | Uint8Array, length?: number): TextureMove; - // (undocumented) - export function encode(message: TextureMove, writer?: _m0.Writer): _m0.Writer; -} - // @public (undocumented) export interface TextureUnion { // (undocumented) diff --git a/packages/@dcl/sdk-commands/package-lock.json b/packages/@dcl/sdk-commands/package-lock.json index d4487cfa7..d8a53355a 100644 --- a/packages/@dcl/sdk-commands/package-lock.json +++ b/packages/@dcl/sdk-commands/package-lock.json @@ -15,7 +15,7 @@ "@dcl/inspector": "file:../inspector", "@dcl/linker-dapp": "^0.14.2", "@dcl/mini-comms": "1.0.1-20230216163137.commit-a4c75be", - "@dcl/protocol": "1.0.0-11599848164.commit-ef74edc", + "@dcl/protocol": "1.0.0-11780504028.commit-c886080", "@dcl/quests-client": "^1.0.3", "@dcl/quests-manager": "^0.1.4", "@dcl/rpc": "^1.1.1", @@ -239,9 +239,9 @@ } }, "node_modules/@dcl/protocol": { - "version": "1.0.0-11599848164.commit-ef74edc", - "resolved": "https://registry.npmjs.org/@dcl/protocol/-/protocol-1.0.0-11599848164.commit-ef74edc.tgz", - "integrity": "sha512-XSUOA0LbchlBUk5/BMJFBl0+qOm4UOIxwMGp38A1n4LQAatGO/RXjzReJRveqiFma+X7eq3e6+KCDqTLwepN0w==", + "version": "1.0.0-11780504028.commit-c886080", + "resolved": "https://registry.npmjs.org/@dcl/protocol/-/protocol-1.0.0-11780504028.commit-c886080.tgz", + "integrity": "sha512-R2OnlV2yZ6S4+Kcf796v8v+HI6TwCGBXitbDBUwUczukrSbw8u9mpGXBi08SPoV025DQs5AA6XXWkfb2uDNUZg==", "dependencies": { "@dcl/ts-proto": "1.154.0" } @@ -3228,9 +3228,9 @@ } }, "@dcl/protocol": { - "version": "1.0.0-11599848164.commit-ef74edc", - "resolved": "https://registry.npmjs.org/@dcl/protocol/-/protocol-1.0.0-11599848164.commit-ef74edc.tgz", - "integrity": "sha512-XSUOA0LbchlBUk5/BMJFBl0+qOm4UOIxwMGp38A1n4LQAatGO/RXjzReJRveqiFma+X7eq3e6+KCDqTLwepN0w==", + "version": "1.0.0-11780504028.commit-c886080", + "resolved": "https://registry.npmjs.org/@dcl/protocol/-/protocol-1.0.0-11780504028.commit-c886080.tgz", + "integrity": "sha512-R2OnlV2yZ6S4+Kcf796v8v+HI6TwCGBXitbDBUwUczukrSbw8u9mpGXBi08SPoV025DQs5AA6XXWkfb2uDNUZg==", "requires": { "@dcl/ts-proto": "1.154.0" } diff --git a/packages/@dcl/sdk-commands/package.json b/packages/@dcl/sdk-commands/package.json index aebff11ff..87a02d627 100644 --- a/packages/@dcl/sdk-commands/package.json +++ b/packages/@dcl/sdk-commands/package.json @@ -13,7 +13,7 @@ "@dcl/inspector": "file:../inspector", "@dcl/linker-dapp": "^0.14.2", "@dcl/mini-comms": "1.0.1-20230216163137.commit-a4c75be", - "@dcl/protocol": "1.0.0-11599848164.commit-ef74edc", + "@dcl/protocol": "1.0.0-11780504028.commit-c886080", "@dcl/quests-client": "^1.0.3", "@dcl/quests-manager": "^0.1.4", "@dcl/rpc": "^1.1.1", From 1ae03c0daeb66b3523a7c4fd43881cf309a71681 Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Tue, 12 Nov 2024 00:04:28 -0300 Subject: [PATCH 03/15] Added addStandardModifier helper function --- .../src/components/extended/InputModifier.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/@dcl/ecs/src/components/extended/InputModifier.ts b/packages/@dcl/ecs/src/components/extended/InputModifier.ts index 08f4cffd2..143886cfc 100644 --- a/packages/@dcl/ecs/src/components/extended/InputModifier.ts +++ b/packages/@dcl/ecs/src/components/extended/InputModifier.ts @@ -1,4 +1,4 @@ -import { ReadOnlyLastWriteWinElementSetComponentDefinition, IEngine } from '../../engine' +import { IEngine, LastWriteWinElementSetComponentDefinition, Entity } from '../../engine' import { InputModifier } from '../generated/index.gen' import { PBInputModifier_StandardInput, @@ -13,8 +13,10 @@ export interface InputModifierHelper { } export interface InputModifierComponentDefinitionExtended - extends ReadOnlyLastWriteWinElementSetComponentDefinition { - Mode: InputModifierHelper + extends LastWriteWinElementSetComponentDefinition { + InputModifier: InputModifierHelper + + addStandardModifier: (entity: Entity, inputModifier: PBInputModifier_StandardInput) => void } const InputModifierHelper: InputModifierHelper = { @@ -33,6 +35,14 @@ export function defineInputModifierComponent( return { ...theComponent, - Mode: InputModifierHelper + Mode: InputModifierHelper, + addStandardModifier(entity: Entity, inputModifier: PBInputModifier_StandardInput) { + theComponent.createOrReplace(entity, { + inputModifier: { + $case: 'standard', + standard: inputModifier + } + }) + } } } From 61724f94734dbc467481a17ce594bd284208ebdb Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Tue, 12 Nov 2024 00:28:55 -0300 Subject: [PATCH 04/15] Fixed properties naming --- packages/@dcl/ecs/src/components/extended/InputModifier.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@dcl/ecs/src/components/extended/InputModifier.ts b/packages/@dcl/ecs/src/components/extended/InputModifier.ts index 143886cfc..a6fc6329e 100644 --- a/packages/@dcl/ecs/src/components/extended/InputModifier.ts +++ b/packages/@dcl/ecs/src/components/extended/InputModifier.ts @@ -35,10 +35,10 @@ export function defineInputModifierComponent( return { ...theComponent, - Mode: InputModifierHelper, + InputModifier: InputModifierHelper, addStandardModifier(entity: Entity, inputModifier: PBInputModifier_StandardInput) { theComponent.createOrReplace(entity, { - inputModifier: { + mode: { $case: 'standard', standard: inputModifier } From efc259b9098b0e67802a00fa31c1c8bcde9eda66 Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Tue, 12 Nov 2024 10:58:11 -0300 Subject: [PATCH 05/15] Helper function iteration. Added documentation. --- .../src/components/extended/InputModifier.ts | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/@dcl/ecs/src/components/extended/InputModifier.ts b/packages/@dcl/ecs/src/components/extended/InputModifier.ts index a6fc6329e..e648e06cf 100644 --- a/packages/@dcl/ecs/src/components/extended/InputModifier.ts +++ b/packages/@dcl/ecs/src/components/extended/InputModifier.ts @@ -1,10 +1,10 @@ import { IEngine, LastWriteWinElementSetComponentDefinition, Entity } from '../../engine' -import { InputModifier } from '../generated/index.gen' -import { - PBInputModifier_StandardInput, - PBInputModifier -} from '../generated/pb/decentraland/sdk/components/input_modifier.gen' +import { InputModifier, PBInputModifier_StandardInput, PBInputModifier } from '../generated/index.gen' +import {} from '../generated/InputModifier.gen' +/** + * @public + */ export interface InputModifierHelper { /** * @returns a input modifier mode @@ -12,17 +12,29 @@ export interface InputModifierHelper { Standard: (standard: PBInputModifier_StandardInput) => PBInputModifier['mode'] } +/** + * @public + */ export interface InputModifierComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition { + /** + * + */ InputModifier: InputModifierHelper + /** + * + * @param entity + * @param inputModifier + * @returns + */ addStandardModifier: (entity: Entity, inputModifier: PBInputModifier_StandardInput) => void } const InputModifierHelper: InputModifierHelper = { - Standard(standard) { + Standard(standard: PBInputModifier_StandardInput) { return { - $case: 'standard' as const, + $case: 'standard', standard } } From 9c9b46a5ac78e881f23f50c983afb6eae1a7662a Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Tue, 12 Nov 2024 10:58:11 -0300 Subject: [PATCH 06/15] =?UTF-8?q?=EF=BB=BFHelper=20function=20iteration.?= =?UTF-8?q?=20Added=20documentation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@dcl/ecs/src/components/extended/InputModifier.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/@dcl/ecs/src/components/extended/InputModifier.ts b/packages/@dcl/ecs/src/components/extended/InputModifier.ts index e648e06cf..995ec7614 100644 --- a/packages/@dcl/ecs/src/components/extended/InputModifier.ts +++ b/packages/@dcl/ecs/src/components/extended/InputModifier.ts @@ -18,15 +18,14 @@ export interface InputModifierHelper { export interface InputModifierComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition { /** - * + * InputModifier helper with constructor */ InputModifier: InputModifierHelper /** - * - * @param entity - * @param inputModifier - * @returns + * Create or replace the component InputModifier in the entity specified + * @param entity - the entity to link the component + * @param inputModifier - the data for this input modifier */ addStandardModifier: (entity: Entity, inputModifier: PBInputModifier_StandardInput) => void } From 15a789003ad92e759a9b27bbcf8252ee108ba3ab Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Mon, 18 Nov 2024 15:12:57 -0300 Subject: [PATCH 07/15] Added helper function to @dcl/ecs/src/components/Index.ts --- packages/@dcl/ecs/src/components/extended/InputModifier.ts | 3 +-- packages/@dcl/ecs/src/components/index.ts | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/@dcl/ecs/src/components/extended/InputModifier.ts b/packages/@dcl/ecs/src/components/extended/InputModifier.ts index 995ec7614..a4b3544b7 100644 --- a/packages/@dcl/ecs/src/components/extended/InputModifier.ts +++ b/packages/@dcl/ecs/src/components/extended/InputModifier.ts @@ -15,8 +15,7 @@ export interface InputModifierHelper { /** * @public */ -export interface InputModifierComponentDefinitionExtended - extends LastWriteWinElementSetComponentDefinition { +export interface InputModifierComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition { /** * InputModifier helper with constructor */ diff --git a/packages/@dcl/ecs/src/components/index.ts b/packages/@dcl/ecs/src/components/index.ts index c79a06abb..78c83fdd3 100644 --- a/packages/@dcl/ecs/src/components/index.ts +++ b/packages/@dcl/ecs/src/components/index.ts @@ -15,6 +15,7 @@ import { defineTransformComponent, TransformComponentExtended } from './manual/T import { AudioStreamComponentDefinitionExtended, defineAudioStreamComponent } from './extended/AudioStream' import { MediaState } from './generated/pb/decentraland/sdk/components/common/media_state.gen' import { defineVirtualCameraComponent, VirtualCameraComponentDefinitionExtended } from './extended/VirtualCamera' +import { defineInputModifierComponent, InputModifierComponentDefinitionExtended } from './extended/InputModifier' export * from './generated/index.gen' @@ -60,6 +61,9 @@ export const Tween: LwwComponentGetter = (engi export const VirtualCamera: LwwComponentGetter = (engine) => defineVirtualCameraComponent(engine) +/* @__PURE__*/ +export const InputModifier: LwwComponentGetter = (engine) => defineInputModifierComponent(engine) + /** * @alpha */ From 57801e0f7307097671de2d97ec042b6557226f69 Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Mon, 18 Nov 2024 15:34:35 -0300 Subject: [PATCH 08/15] Lint fix --- packages/@dcl/ecs/src/components/extended/InputModifier.ts | 3 ++- packages/@dcl/ecs/src/components/index.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/@dcl/ecs/src/components/extended/InputModifier.ts b/packages/@dcl/ecs/src/components/extended/InputModifier.ts index a4b3544b7..995ec7614 100644 --- a/packages/@dcl/ecs/src/components/extended/InputModifier.ts +++ b/packages/@dcl/ecs/src/components/extended/InputModifier.ts @@ -15,7 +15,8 @@ export interface InputModifierHelper { /** * @public */ -export interface InputModifierComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition { +export interface InputModifierComponentDefinitionExtended + extends LastWriteWinElementSetComponentDefinition { /** * InputModifier helper with constructor */ diff --git a/packages/@dcl/ecs/src/components/index.ts b/packages/@dcl/ecs/src/components/index.ts index 78c83fdd3..12649e375 100644 --- a/packages/@dcl/ecs/src/components/index.ts +++ b/packages/@dcl/ecs/src/components/index.ts @@ -62,7 +62,8 @@ export const VirtualCamera: LwwComponentGetter = (engine) => defineInputModifierComponent(engine) +export const InputModifier: LwwComponentGetter = (engine) => + defineInputModifierComponent(engine) /** * @alpha From 3951c06eaa711f5f5d70666272ad9fa4b46c9a93 Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Mon, 18 Nov 2024 15:53:02 -0300 Subject: [PATCH 09/15] Updated index.ts and types.ts --- packages/@dcl/ecs/src/components/types.ts | 1 + packages/@dcl/ecs/src/index.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/@dcl/ecs/src/components/types.ts b/packages/@dcl/ecs/src/components/types.ts index a4aba8886..f182b477a 100644 --- a/packages/@dcl/ecs/src/components/types.ts +++ b/packages/@dcl/ecs/src/components/types.ts @@ -11,3 +11,4 @@ export type { NameComponent, NameType } from './manual/Name' export type { ISyncComponents, ISyncComponentsType } from './manual/SyncComponents' export type { INetowrkEntity, INetowrkEntityType } from './manual/NetworkEntity' export type { INetowrkParent, INetowrkParentType } from './manual/NetworkParent' +export type { InputModifierComponentDefinitionExtended } from './extended/InputModifier' diff --git a/packages/@dcl/ecs/src/index.ts b/packages/@dcl/ecs/src/index.ts index 4fe185663..e1b10d6fa 100644 --- a/packages/@dcl/ecs/src/index.ts +++ b/packages/@dcl/ecs/src/index.ts @@ -32,7 +32,8 @@ import { TweenComponentDefinitionExtended, INetowrkEntity, INetowrkParent, - VirtualCameraComponentDefinitionExtended + VirtualCameraComponentDefinitionExtended, + InputModifierComponentDefinitionExtended } from './components/types' import { NameComponent } from './components/manual/Name' @@ -47,6 +48,8 @@ export const MeshCollider: MeshColliderComponentDefinitionExtended = /* @__PURE_ export const Name: NameComponent = components.Name(engine) export const Tween: TweenComponentDefinitionExtended = /* @__PURE__*/ components.Tween(engine) export const VirtualCamera: VirtualCameraComponentDefinitionExtended = /* @__PURE__*/ components.VirtualCamera(engine) +export const InputModifier: InputModifierComponentDefinitionExtended = /* @__PURE__*/ components.InputModifier(engine) + /** * @alpha * This is going to be used for sync components through a server. From 338098cb42601806b4e0cd856a4001708a1f291e Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Mon, 18 Nov 2024 16:05:29 -0300 Subject: [PATCH 10/15] Updated API --- .../playground-assets/etc/playground-assets.api.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/@dcl/playground-assets/etc/playground-assets.api.md b/packages/@dcl/playground-assets/etc/playground-assets.api.md index f24a30ca9..d64225cf5 100644 --- a/packages/@dcl/playground-assets/etc/playground-assets.api.md +++ b/packages/@dcl/playground-assets/etc/playground-assets.api.md @@ -1421,8 +1421,17 @@ export const enum InputAction { IA_WALK = 9 } +// Warning: (ae-missing-release-tag) "InputModifier" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const InputModifier: InputModifierComponentDefinitionExtended; + // @public (undocumented) -export const InputModifier: LastWriteWinElementSetComponentDefinition; +export interface InputModifierComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition { + addStandardModifier: (entity: Entity, inputModifier: PBInputModifier_StandardInput) => void; + // Warning: (ae-forgotten-export) The symbol "InputModifierHelper" needs to be exported by the entry point index.d.ts + InputModifier: InputModifierHelper; +} // @public export const inputSystem: IInputSystem; From dfe14164cdd36e8efe72a799f86cc0edf6af0b2a Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Mon, 18 Nov 2024 16:58:57 -0300 Subject: [PATCH 11/15] Updated types.ts and API --- packages/@dcl/ecs/src/components/types.ts | 2 +- .../@dcl/playground-assets/etc/playground-assets.api.md | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/@dcl/ecs/src/components/types.ts b/packages/@dcl/ecs/src/components/types.ts index f182b477a..42359f73e 100644 --- a/packages/@dcl/ecs/src/components/types.ts +++ b/packages/@dcl/ecs/src/components/types.ts @@ -11,4 +11,4 @@ export type { NameComponent, NameType } from './manual/Name' export type { ISyncComponents, ISyncComponentsType } from './manual/SyncComponents' export type { INetowrkEntity, INetowrkEntityType } from './manual/NetworkEntity' export type { INetowrkParent, INetowrkParentType } from './manual/NetworkParent' -export type { InputModifierComponentDefinitionExtended } from './extended/InputModifier' +export type { InputModifierHelper, InputModifierComponentDefinitionExtended } from './extended/InputModifier' diff --git a/packages/@dcl/playground-assets/etc/playground-assets.api.md b/packages/@dcl/playground-assets/etc/playground-assets.api.md index d64225cf5..d09d3aa74 100644 --- a/packages/@dcl/playground-assets/etc/playground-assets.api.md +++ b/packages/@dcl/playground-assets/etc/playground-assets.api.md @@ -1429,10 +1429,15 @@ export const InputModifier: InputModifierComponentDefinitionExtended; // @public (undocumented) export interface InputModifierComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition { addStandardModifier: (entity: Entity, inputModifier: PBInputModifier_StandardInput) => void; - // Warning: (ae-forgotten-export) The symbol "InputModifierHelper" needs to be exported by the entry point index.d.ts InputModifier: InputModifierHelper; } +// @public (undocumented) +export interface InputModifierHelper { + // (undocumented) + Standard: (standard: PBInputModifier_StandardInput) => PBInputModifier['mode']; +} + // @public export const inputSystem: IInputSystem; From 2ce9016645dbaae2dd9801978ec9192b4c40086c Mon Sep 17 00:00:00 2001 From: Gonzalo DCL Date: Tue, 19 Nov 2024 10:39:05 -0300 Subject: [PATCH 12/15] fix tests --- test/ecs/components/InputModifier.spec.ts | 8 ++++++++ test/ecs/components/Material.spec.ts | 8 ++++++-- test/ecs/components/UiBackground.spec.ts | 12 +++++++----- .../development-bundles/static-scene.test.ts.crdt | 6 +++--- .../development-bundles/testing-fw.test.ts.crdt | 6 +++--- .../development-bundles/two-way-crdt.test.ts.crdt | 6 +++--- test/snapshots/package-lock.json | 2 +- .../production-bundles/append-value-crdt.ts.crdt | 6 +++--- test/snapshots/production-bundles/billboard.ts.crdt | 6 +++--- .../production-bundles/cube-deleted.ts.crdt | 6 +++--- test/snapshots/production-bundles/cube.ts.crdt | 6 +++--- test/snapshots/production-bundles/cubes.ts.crdt | 6 +++--- .../production-bundles/pointer-events.ts.crdt | 6 +++--- .../production-bundles/schema-components.ts.crdt | 6 +++--- test/snapshots/production-bundles/ui.ts.crdt | 6 +++--- .../production-bundles/with-main-function.ts.crdt | 6 +++--- 16 files changed, 58 insertions(+), 44 deletions(-) diff --git a/test/ecs/components/InputModifier.spec.ts b/test/ecs/components/InputModifier.spec.ts index 9cf6234c1..855a1f4ed 100644 --- a/test/ecs/components/InputModifier.spec.ts +++ b/test/ecs/components/InputModifier.spec.ts @@ -20,4 +20,12 @@ describe('Generated InputModifier ProtoBuf', () => { } }) }) + it('should test Standar modifier', () => { + const newEngine = Engine() + const InputModifier = components.InputModifier(newEngine) + + testComponentSerialization(InputModifier, { + mode: InputModifier.InputModifier.Standard({ disableAll: true }) + }) + }) }) diff --git a/test/ecs/components/Material.spec.ts b/test/ecs/components/Material.spec.ts index a5f9c8e68..f10d1e517 100644 --- a/test/ecs/components/Material.spec.ts +++ b/test/ecs/components/Material.spec.ts @@ -77,7 +77,9 @@ describe('Generated Material ProtoBuf', () => { texture: { wrapMode: TextureWrapMode.TWM_MIRROR, filterMode: TextureFilterMode.TFM_POINT, - src: 'not-casla' + src: 'not-casla', + tiling: undefined, + offset: undefined } } }, @@ -87,7 +89,9 @@ describe('Generated Material ProtoBuf', () => { texture: { wrapMode: TextureWrapMode.TWM_MIRROR, filterMode: TextureFilterMode.TFM_TRILINEAR, - src: 'not-casla' + src: 'not-casla', + tiling: undefined, + offset: undefined } } }, diff --git a/test/ecs/components/UiBackground.spec.ts b/test/ecs/components/UiBackground.spec.ts index d260a7eea..066dbc744 100644 --- a/test/ecs/components/UiBackground.spec.ts +++ b/test/ecs/components/UiBackground.spec.ts @@ -21,15 +21,17 @@ describe('Generated UiBackground ProtoBuf', () => { texture: { src: 'some-src', wrapMode: TextureWrapMode.TWM_CLAMP, - filterMode: TextureFilterMode.TFM_BILINEAR + filterMode: TextureFilterMode.TFM_BILINEAR, + tiling: undefined, + offset: undefined } } }, textureSlices: { - top: 1 / 3, - left: 1 / 3, - right: 1 / 3, - bottom: 1 / 3 + top: 2, + left: 2, + right: 2, + bottom: 2 }, uvs: [] }) diff --git a/test/snapshots/development-bundles/static-scene.test.ts.crdt b/test/snapshots/development-bundles/static-scene.test.ts.crdt index e1a15a89a..6c76e3741 100644 --- a/test/snapshots/development-bundles/static-scene.test.ts.crdt +++ b/test/snapshots/development-bundles/static-scene.test.ts.crdt @@ -1,4 +1,4 @@ -SCENE_COMPILED_JS_SIZE_PROD=452.9k bytes +SCENE_COMPILED_JS_SIZE_PROD=453.4k bytes THE BUNDLE HAS SOURCEMAPS (start empty vm 0.21.0-3680274614.commit-1808aa1) OPCODES ~= 0k @@ -11,7 +11,7 @@ EVAL test/snapshots/development-bundles/static-scene.test.js REQUIRE: ~system/EngineApi REQUIRE: ~system/EngineApi OPCODES ~= 54k - MALLOC_COUNT = 13672 + MALLOC_COUNT = 13673 ALIVE_OBJS_DELTA ~= 2.70k CALL onStart() main.crdt: PUT_COMPONENT e=0x200 c=1 t=0 data={"position":{"x":5.880000114440918,"y":2.7916901111602783,"z":7.380000114440918},"rotation":{"x":0,"y":0,"z":0,"w":1},"scale":{"x":1,"y":1,"z":1},"parent":0} @@ -56,4 +56,4 @@ CALL onUpdate(0.1) OPCODES ~= 3k MALLOC_COUNT = -5 ALIVE_OBJS_DELTA ~= 0.00k - MEMORY_USAGE_COUNT ~= 1193.93k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 1194.79k bytes \ No newline at end of file diff --git a/test/snapshots/development-bundles/testing-fw.test.ts.crdt b/test/snapshots/development-bundles/testing-fw.test.ts.crdt index 9402cfc5f..95791a98d 100644 --- a/test/snapshots/development-bundles/testing-fw.test.ts.crdt +++ b/test/snapshots/development-bundles/testing-fw.test.ts.crdt @@ -1,4 +1,4 @@ -SCENE_COMPILED_JS_SIZE_PROD=453.4k bytes +SCENE_COMPILED_JS_SIZE_PROD=454k bytes THE BUNDLE HAS SOURCEMAPS (start empty vm 0.21.0-3680274614.commit-1808aa1) OPCODES ~= 0k @@ -11,7 +11,7 @@ EVAL test/snapshots/development-bundles/testing-fw.test.js REQUIRE: ~system/EngineApi REQUIRE: ~system/EngineApi OPCODES ~= 63k - MALLOC_COUNT = 14193 + MALLOC_COUNT = 14194 ALIVE_OBJS_DELTA ~= 2.85k CALL onStart() LOG: ["Adding one to position.y=0"] @@ -64,4 +64,4 @@ CALL onUpdate(0.1) OPCODES ~= 5k MALLOC_COUNT = -40 ALIVE_OBJS_DELTA ~= -0.01k - MEMORY_USAGE_COUNT ~= 1202.54k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 1203.40k bytes \ No newline at end of file diff --git a/test/snapshots/development-bundles/two-way-crdt.test.ts.crdt b/test/snapshots/development-bundles/two-way-crdt.test.ts.crdt index e9f2e6996..c8d7770eb 100644 --- a/test/snapshots/development-bundles/two-way-crdt.test.ts.crdt +++ b/test/snapshots/development-bundles/two-way-crdt.test.ts.crdt @@ -1,4 +1,4 @@ -SCENE_COMPILED_JS_SIZE_PROD=453.4k bytes +SCENE_COMPILED_JS_SIZE_PROD=454k bytes THE BUNDLE HAS SOURCEMAPS (start empty vm 0.21.0-3680274614.commit-1808aa1) OPCODES ~= 0k @@ -11,7 +11,7 @@ EVAL test/snapshots/development-bundles/two-way-crdt.test.js REQUIRE: ~system/EngineApi REQUIRE: ~system/EngineApi OPCODES ~= 63k - MALLOC_COUNT = 14193 + MALLOC_COUNT = 14194 ALIVE_OBJS_DELTA ~= 2.85k CALL onStart() LOG: ["Adding one to position.y=0"] @@ -64,4 +64,4 @@ CALL onUpdate(0.1) OPCODES ~= 5k MALLOC_COUNT = -40 ALIVE_OBJS_DELTA ~= -0.01k - MEMORY_USAGE_COUNT ~= 1202.55k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 1203.41k bytes \ No newline at end of file diff --git a/test/snapshots/package-lock.json b/test/snapshots/package-lock.json index 401ef4a4b..22767d9a8 100644 --- a/test/snapshots/package-lock.json +++ b/test/snapshots/package-lock.json @@ -168,7 +168,7 @@ "@dcl/inspector": "file:../inspector", "@dcl/linker-dapp": "^0.14.2", "@dcl/mini-comms": "1.0.1-20230216163137.commit-a4c75be", - "@dcl/protocol": "1.0.0-11599848164.commit-ef74edc", + "@dcl/protocol": "1.0.0-11780504028.commit-c886080", "@dcl/quests-client": "^1.0.3", "@dcl/quests-manager": "^0.1.4", "@dcl/rpc": "^1.1.1", diff --git a/test/snapshots/production-bundles/append-value-crdt.ts.crdt b/test/snapshots/production-bundles/append-value-crdt.ts.crdt index bf88349ba..9a082d9b5 100644 --- a/test/snapshots/production-bundles/append-value-crdt.ts.crdt +++ b/test/snapshots/production-bundles/append-value-crdt.ts.crdt @@ -1,4 +1,4 @@ -SCENE_COMPILED_JS_SIZE_PROD=197.8k bytes +SCENE_COMPILED_JS_SIZE_PROD=198.1k bytes (start empty vm 0.21.0-3680274614.commit-1808aa1) OPCODES ~= 0k MALLOC_COUNT = 1005 @@ -9,7 +9,7 @@ EVAL test/snapshots/production-bundles/append-value-crdt.js REQUIRE: ~system/EngineApi REQUIRE: ~system/EngineApi OPCODES ~= 65k - MALLOC_COUNT = 12721 + MALLOC_COUNT = 12723 ALIVE_OBJS_DELTA ~= 2.84k CALL onStart() Renderer: APPEND_VALUE e=0x200 c=1063 t=0 data={"button":0,"hit":{"position":{"x":1,"y":2,"z":3},"globalOrigin":{"x":1,"y":2,"z":3},"direction":{"x":1,"y":2,"z":3},"normalHit":{"x":1,"y":2,"z":3},"length":10,"meshName":"mesh","entityId":512},"state":1,"timestamp":1,"analog":5,"tickNumber":0} @@ -55,4 +55,4 @@ CALL onUpdate(0.1) OPCODES ~= 14k MALLOC_COUNT = 31 ALIVE_OBJS_DELTA ~= 0.01k - MEMORY_USAGE_COUNT ~= 899.15k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 899.73k bytes \ No newline at end of file diff --git a/test/snapshots/production-bundles/billboard.ts.crdt b/test/snapshots/production-bundles/billboard.ts.crdt index d70fca77a..545259257 100644 --- a/test/snapshots/production-bundles/billboard.ts.crdt +++ b/test/snapshots/production-bundles/billboard.ts.crdt @@ -1,4 +1,4 @@ -SCENE_COMPILED_JS_SIZE_PROD=230.9k bytes +SCENE_COMPILED_JS_SIZE_PROD=231.2k bytes (start empty vm 0.21.0-3680274614.commit-1808aa1) OPCODES ~= 0k MALLOC_COUNT = 1005 @@ -9,7 +9,7 @@ EVAL test/snapshots/production-bundles/billboard.js REQUIRE: ~system/EngineApi REQUIRE: ~system/EngineApi OPCODES ~= 66k - MALLOC_COUNT = 14834 + MALLOC_COUNT = 14836 ALIVE_OBJS_DELTA ~= 3.24k CALL onStart() OPCODES ~= 0k @@ -77,4 +77,4 @@ CALL onUpdate(0.1) OPCODES ~= 9k MALLOC_COUNT = 0 ALIVE_OBJS_DELTA ~= 0.00k - MEMORY_USAGE_COUNT ~= 1041.51k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 1042.09k bytes \ No newline at end of file diff --git a/test/snapshots/production-bundles/cube-deleted.ts.crdt b/test/snapshots/production-bundles/cube-deleted.ts.crdt index b4ffc63a1..21ab80d21 100644 --- a/test/snapshots/production-bundles/cube-deleted.ts.crdt +++ b/test/snapshots/production-bundles/cube-deleted.ts.crdt @@ -1,4 +1,4 @@ -SCENE_COMPILED_JS_SIZE_PROD=194.1k bytes +SCENE_COMPILED_JS_SIZE_PROD=194.3k bytes (start empty vm 0.21.0-3680274614.commit-1808aa1) OPCODES ~= 0k MALLOC_COUNT = 1005 @@ -9,7 +9,7 @@ EVAL test/snapshots/production-bundles/cube-deleted.js REQUIRE: ~system/EngineApi REQUIRE: ~system/EngineApi OPCODES ~= 55k - MALLOC_COUNT = 11876 + MALLOC_COUNT = 11878 ALIVE_OBJS_DELTA ~= 2.62k CALL onStart() OPCODES ~= 0k @@ -42,4 +42,4 @@ CALL onUpdate(0.1) OPCODES ~= 5k MALLOC_COUNT = 1 ALIVE_OBJS_DELTA ~= 0.00k - MEMORY_USAGE_COUNT ~= 861.88k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 862.46k bytes \ No newline at end of file diff --git a/test/snapshots/production-bundles/cube.ts.crdt b/test/snapshots/production-bundles/cube.ts.crdt index c9344e0fc..e4f4dadc8 100644 --- a/test/snapshots/production-bundles/cube.ts.crdt +++ b/test/snapshots/production-bundles/cube.ts.crdt @@ -1,4 +1,4 @@ -SCENE_COMPILED_JS_SIZE_PROD=193.9k bytes +SCENE_COMPILED_JS_SIZE_PROD=194.2k bytes (start empty vm 0.21.0-3680274614.commit-1808aa1) OPCODES ~= 0k MALLOC_COUNT = 1005 @@ -9,7 +9,7 @@ EVAL test/snapshots/production-bundles/cube.js REQUIRE: ~system/EngineApi REQUIRE: ~system/EngineApi OPCODES ~= 55k - MALLOC_COUNT = 11849 + MALLOC_COUNT = 11851 ALIVE_OBJS_DELTA ~= 2.61k CALL onStart() OPCODES ~= 0k @@ -32,4 +32,4 @@ CALL onUpdate(0.1) OPCODES ~= 1k MALLOC_COUNT = 0 ALIVE_OBJS_DELTA ~= 0.00k - MEMORY_USAGE_COUNT ~= 851.79k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 852.37k bytes \ No newline at end of file diff --git a/test/snapshots/production-bundles/cubes.ts.crdt b/test/snapshots/production-bundles/cubes.ts.crdt index 59c41b18b..1f61d0820 100644 --- a/test/snapshots/production-bundles/cubes.ts.crdt +++ b/test/snapshots/production-bundles/cubes.ts.crdt @@ -1,4 +1,4 @@ -SCENE_COMPILED_JS_SIZE_PROD=231.2k bytes +SCENE_COMPILED_JS_SIZE_PROD=231.5k bytes (start empty vm 0.21.0-3680274614.commit-1808aa1) OPCODES ~= 0k MALLOC_COUNT = 1005 @@ -9,7 +9,7 @@ EVAL test/snapshots/production-bundles/cubes.js REQUIRE: ~system/EngineApi REQUIRE: ~system/EngineApi OPCODES ~= 105k - MALLOC_COUNT = 18176 + MALLOC_COUNT = 18178 ALIVE_OBJS_DELTA ~= 4.53k CALL onStart() OPCODES ~= 0k @@ -1652,4 +1652,4 @@ CALL onUpdate(0.1) OPCODES ~= 691k MALLOC_COUNT = 0 ALIVE_OBJS_DELTA ~= 0.00k - MEMORY_USAGE_COUNT ~= 1177.44k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 1178.02k bytes \ No newline at end of file diff --git a/test/snapshots/production-bundles/pointer-events.ts.crdt b/test/snapshots/production-bundles/pointer-events.ts.crdt index 5c7da6d40..271ed5cce 100644 --- a/test/snapshots/production-bundles/pointer-events.ts.crdt +++ b/test/snapshots/production-bundles/pointer-events.ts.crdt @@ -1,4 +1,4 @@ -SCENE_COMPILED_JS_SIZE_PROD=194.9k bytes +SCENE_COMPILED_JS_SIZE_PROD=195.2k bytes (start empty vm 0.21.0-3680274614.commit-1808aa1) OPCODES ~= 0k MALLOC_COUNT = 1005 @@ -9,7 +9,7 @@ EVAL test/snapshots/production-bundles/pointer-events.js REQUIRE: ~system/EngineApi REQUIRE: ~system/EngineApi OPCODES ~= 56k - MALLOC_COUNT = 12135 + MALLOC_COUNT = 12137 ALIVE_OBJS_DELTA ~= 2.70k CALL onStart() OPCODES ~= 0k @@ -43,4 +43,4 @@ CALL onUpdate(0.1) OPCODES ~= 1k MALLOC_COUNT = 0 ALIVE_OBJS_DELTA ~= 0.00k - MEMORY_USAGE_COUNT ~= 869.52k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 870.10k bytes \ No newline at end of file diff --git a/test/snapshots/production-bundles/schema-components.ts.crdt b/test/snapshots/production-bundles/schema-components.ts.crdt index 621522880..ff93c6a98 100644 --- a/test/snapshots/production-bundles/schema-components.ts.crdt +++ b/test/snapshots/production-bundles/schema-components.ts.crdt @@ -1,4 +1,4 @@ -SCENE_COMPILED_JS_SIZE_PROD=194k bytes +SCENE_COMPILED_JS_SIZE_PROD=194.3k bytes (start empty vm 0.21.0-3680274614.commit-1808aa1) OPCODES ~= 0k MALLOC_COUNT = 1005 @@ -9,7 +9,7 @@ EVAL test/snapshots/production-bundles/schema-components.js REQUIRE: ~system/EngineApi REQUIRE: ~system/EngineApi OPCODES ~= 59k - MALLOC_COUNT = 11976 + MALLOC_COUNT = 11978 ALIVE_OBJS_DELTA ~= 2.65k CALL onStart() OPCODES ~= 0k @@ -31,4 +31,4 @@ CALL onUpdate(0.1) OPCODES ~= 1k MALLOC_COUNT = 0 ALIVE_OBJS_DELTA ~= 0.00k - MEMORY_USAGE_COUNT ~= 854.21k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 854.79k bytes \ No newline at end of file diff --git a/test/snapshots/production-bundles/ui.ts.crdt b/test/snapshots/production-bundles/ui.ts.crdt index eb282069d..fe8c7f005 100644 --- a/test/snapshots/production-bundles/ui.ts.crdt +++ b/test/snapshots/production-bundles/ui.ts.crdt @@ -1,4 +1,4 @@ -SCENE_COMPILED_JS_SIZE_PROD=351k bytes +SCENE_COMPILED_JS_SIZE_PROD=351.3k bytes (start empty vm 0.21.0-3680274614.commit-1808aa1) OPCODES ~= 0k MALLOC_COUNT = 1005 @@ -9,7 +9,7 @@ EVAL test/snapshots/production-bundles/ui.js REQUIRE: ~system/EngineApi REQUIRE: ~system/EngineApi OPCODES ~= 65k - MALLOC_COUNT = 19447 + MALLOC_COUNT = 19449 ALIVE_OBJS_DELTA ~= 3.87k CALL onStart() OPCODES ~= 0k @@ -65,4 +65,4 @@ CALL onUpdate(0.1) OPCODES ~= 63k MALLOC_COUNT = 0 ALIVE_OBJS_DELTA ~= 0.00k - MEMORY_USAGE_COUNT ~= 1686.56k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 1687.14k bytes \ No newline at end of file diff --git a/test/snapshots/production-bundles/with-main-function.ts.crdt b/test/snapshots/production-bundles/with-main-function.ts.crdt index 3d6eef012..e35c0d92a 100644 --- a/test/snapshots/production-bundles/with-main-function.ts.crdt +++ b/test/snapshots/production-bundles/with-main-function.ts.crdt @@ -1,4 +1,4 @@ -SCENE_COMPILED_JS_SIZE_PROD=194.6k bytes +SCENE_COMPILED_JS_SIZE_PROD=194.9k bytes (start empty vm 0.21.0-3680274614.commit-1808aa1) OPCODES ~= 0k MALLOC_COUNT = 1005 @@ -9,7 +9,7 @@ EVAL test/snapshots/production-bundles/with-main-function.js REQUIRE: ~system/EngineApi REQUIRE: ~system/EngineApi OPCODES ~= 55k - MALLOC_COUNT = 12005 + MALLOC_COUNT = 12007 ALIVE_OBJS_DELTA ~= 2.65k CALL onStart() OPCODES ~= 0k @@ -37,4 +37,4 @@ CALL onUpdate(0.1) OPCODES ~= 3k MALLOC_COUNT = 5 ALIVE_OBJS_DELTA ~= 0.00k - MEMORY_USAGE_COUNT ~= 867.33k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 867.92k bytes \ No newline at end of file From 9b4980e2bab2831ccce4662c15177d5a18fd9411 Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Tue, 19 Nov 2024 10:58:16 -0300 Subject: [PATCH 13/15] Updated InputModifier helper and tests --- .../src/components/extended/InputModifier.ts | 19 ++----------------- test/ecs/components/InputModifier.spec.ts | 9 ++++++++- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/packages/@dcl/ecs/src/components/extended/InputModifier.ts b/packages/@dcl/ecs/src/components/extended/InputModifier.ts index 995ec7614..39df6c838 100644 --- a/packages/@dcl/ecs/src/components/extended/InputModifier.ts +++ b/packages/@dcl/ecs/src/components/extended/InputModifier.ts @@ -20,14 +20,7 @@ export interface InputModifierComponentDefinitionExtended /** * InputModifier helper with constructor */ - InputModifier: InputModifierHelper - - /** - * Create or replace the component InputModifier in the entity specified - * @param entity - the entity to link the component - * @param inputModifier - the data for this input modifier - */ - addStandardModifier: (entity: Entity, inputModifier: PBInputModifier_StandardInput) => void + Mode: InputModifierHelper } const InputModifierHelper: InputModifierHelper = { @@ -46,14 +39,6 @@ export function defineInputModifierComponent( return { ...theComponent, - InputModifier: InputModifierHelper, - addStandardModifier(entity: Entity, inputModifier: PBInputModifier_StandardInput) { - theComponent.createOrReplace(entity, { - mode: { - $case: 'standard', - standard: inputModifier - } - }) - } + Mode: InputModifierHelper } } diff --git a/test/ecs/components/InputModifier.spec.ts b/test/ecs/components/InputModifier.spec.ts index 855a1f4ed..153a08e4d 100644 --- a/test/ecs/components/InputModifier.spec.ts +++ b/test/ecs/components/InputModifier.spec.ts @@ -25,7 +25,14 @@ describe('Generated InputModifier ProtoBuf', () => { const InputModifier = components.InputModifier(newEngine) testComponentSerialization(InputModifier, { - mode: InputModifier.InputModifier.Standard({ disableAll: true }) + mode: InputModifier.Mode.Standard({ + disableAll: true, + disableWalk: true, + disableJog: true, + disableRun: true, + disableJump: true, + disableEmote: true + }) }) }) }) From f059beaac750576ea14813a4280ba6f364c3e164 Mon Sep 17 00:00:00 2001 From: Gonzalo DCL Date: Tue, 19 Nov 2024 11:12:15 -0300 Subject: [PATCH 14/15] update playground assetsmd --- packages/@dcl/playground-assets/etc/playground-assets.api.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/@dcl/playground-assets/etc/playground-assets.api.md b/packages/@dcl/playground-assets/etc/playground-assets.api.md index d09d3aa74..ac86f6d71 100644 --- a/packages/@dcl/playground-assets/etc/playground-assets.api.md +++ b/packages/@dcl/playground-assets/etc/playground-assets.api.md @@ -1428,8 +1428,7 @@ export const InputModifier: InputModifierComponentDefinitionExtended; // @public (undocumented) export interface InputModifierComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition { - addStandardModifier: (entity: Entity, inputModifier: PBInputModifier_StandardInput) => void; - InputModifier: InputModifierHelper; + Mode: InputModifierHelper; } // @public (undocumented) From fae79cc6daecc394764ce46d2830263176a7776f Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Tue, 19 Nov 2024 12:17:52 -0300 Subject: [PATCH 15/15] Removed unused import --- packages/@dcl/ecs/src/components/extended/InputModifier.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@dcl/ecs/src/components/extended/InputModifier.ts b/packages/@dcl/ecs/src/components/extended/InputModifier.ts index 39df6c838..677e09dea 100644 --- a/packages/@dcl/ecs/src/components/extended/InputModifier.ts +++ b/packages/@dcl/ecs/src/components/extended/InputModifier.ts @@ -1,4 +1,4 @@ -import { IEngine, LastWriteWinElementSetComponentDefinition, Entity } from '../../engine' +import { IEngine, LastWriteWinElementSetComponentDefinition } from '../../engine' import { InputModifier, PBInputModifier_StandardInput, PBInputModifier } from '../generated/index.gen' import {} from '../generated/InputModifier.gen'