From 9b4980e2bab2831ccce4662c15177d5a18fd9411 Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Melucci Date: Tue, 19 Nov 2024 10:58:16 -0300 Subject: [PATCH] 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 + }) }) }) })