From e50f2e51327ad5dcd99b0aed1bbf170754e7d4f0 Mon Sep 17 00:00:00 2001 From: nighca Date: Wed, 3 Jul 2024 16:12:57 +0800 Subject: [PATCH] hide onTouched --- .../editor/code-editor/code-text-editor/tools/index.ts | 2 +- .../editor/code-editor/code-text-editor/tools/spx.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/spx-gui/src/components/editor/code-editor/code-text-editor/tools/index.ts b/spx-gui/src/components/editor/code-editor/code-text-editor/tools/index.ts index feba55b6f..7b7f2b105 100644 --- a/spx-gui/src/components/editor/code-editor/code-text-editor/tools/index.ts +++ b/spx-gui/src/components/editor/code-editor/code-text-editor/tools/index.ts @@ -25,7 +25,7 @@ export const eventCategory: ToolCategory = { }, { label: { en: 'Sensing Events', zh: '感知事件' }, - tools: [spx.onClick, spx.onKey, spx.onAnyKey, spx.onTouched] + tools: [spx.onClick, spx.onKey, spx.onAnyKey] }, { label: { en: 'Motion Events', zh: '运动事件' }, diff --git a/spx-gui/src/components/editor/code-editor/code-text-editor/tools/spx.ts b/spx-gui/src/components/editor/code-editor/code-text-editor/tools/spx.ts index 22c125f6c..8c4234425 100644 --- a/spx-gui/src/components/editor/code-editor/code-text-editor/tools/spx.ts +++ b/spx-gui/src/components/editor/code-editor/code-text-editor/tools/spx.ts @@ -32,6 +32,8 @@ export const onCloned: Tool = { } } +// For now `onTouched` is not exposed to the user +// As it behaves strangely in the current implementation, see details in https://github.com/goplus/spx/issues/298 export const onTouched: Tool = { type: ToolType.method, callEffect: ToolCallEffect.listen, @@ -54,7 +56,7 @@ export const onTouched: Tool = { }, { desc: { en: 'By some given sprites', zh: '指定的某些精灵' }, - sample: 'onTouched [S1, S2] => {}', + sample: 'onTouched [S1, S2], => {}', insertText: 'onTouched [${1:}], => {\n\t${2}\n}' } ]