From 7573aa1d2cbdda2c78f7b3f32d9e7b06a7c62c42 Mon Sep 17 00:00:00 2001 From: LilyMakesThings <127533508+LilyMakesThings@users.noreply.github.com> Date: Wed, 31 Jan 2024 23:56:04 +0000 Subject: [PATCH 1/6] add acceptText for menus --- src/engine/runtime.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 6fc794268f7..250070fd9dc 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -1225,8 +1225,8 @@ class Runtime extends EventEmitter { outputShape: menuInfo.acceptReporters ? ScratchBlocksConstants.OUTPUT_SHAPE_ROUND : ScratchBlocksConstants.OUTPUT_SHAPE_SQUARE, args0: [ - { - type: 'field_dropdown', + { // to do: we could reimplement field_numberdropdown here really easily + type: menuInfo.acceptText ? 'field_textdropdown' : 'field_dropdown', name: menuName, options: menuItems } @@ -1633,6 +1633,7 @@ class Runtime extends EventEmitter { let valueName; let shadowType; let fieldName; + let allowText; if (argInfo.menu) { const menuInfo = context.categoryInfo.menuInfo[argInfo.menu]; if (menuInfo.acceptReporters) { From 567750bdceae93a68b704c3e133467cd3ba92924 Mon Sep 17 00:00:00 2001 From: LilyMakesThings <127533508+LilyMakesThings@users.noreply.github.com> Date: Thu, 1 Feb 2024 00:01:44 +0000 Subject: [PATCH 2/6] lint (oops) --- src/engine/runtime.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 250070fd9dc..a34f278923a 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -1226,7 +1226,8 @@ class Runtime extends EventEmitter { ScratchBlocksConstants.OUTPUT_SHAPE_ROUND : ScratchBlocksConstants.OUTPUT_SHAPE_SQUARE, args0: [ { // to do: we could reimplement field_numberdropdown here really easily - type: menuInfo.acceptText ? 'field_textdropdown' : 'field_dropdown', + type: menuInfo.acceptText ? + 'field_textdropdown' : 'field_dropdown', name: menuName, options: menuItems } @@ -1633,7 +1634,6 @@ class Runtime extends EventEmitter { let valueName; let shadowType; let fieldName; - let allowText; if (argInfo.menu) { const menuInfo = context.categoryInfo.menuInfo[argInfo.menu]; if (menuInfo.acceptReporters) { From 6884b588905d398eb827256ea3187a481e46a722 Mon Sep 17 00:00:00 2001 From: LilyMakesThings <127533508+LilyMakesThings@users.noreply.github.com> Date: Thu, 1 Feb 2024 00:02:07 +0000 Subject: [PATCH 3/6] more lint --- src/engine/runtime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index a34f278923a..468eabec8b2 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -1225,7 +1225,7 @@ class Runtime extends EventEmitter { outputShape: menuInfo.acceptReporters ? ScratchBlocksConstants.OUTPUT_SHAPE_ROUND : ScratchBlocksConstants.OUTPUT_SHAPE_SQUARE, args0: [ - { // to do: we could reimplement field_numberdropdown here really easily + {// to do: we could reimplement field_numberdropdown here really easily type: menuInfo.acceptText ? 'field_textdropdown' : 'field_dropdown', name: menuName, From 77efd4bab75d18b7026670aaf2cba8b81d63c8b2 Mon Sep 17 00:00:00 2001 From: LilyMakesThings <127533508+LilyMakesThings@users.noreply.github.com> Date: Thu, 1 Feb 2024 00:03:57 +0000 Subject: [PATCH 4/6] final lint --- src/engine/runtime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 468eabec8b2..b4f8599471b 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -1226,7 +1226,7 @@ class Runtime extends EventEmitter { ScratchBlocksConstants.OUTPUT_SHAPE_ROUND : ScratchBlocksConstants.OUTPUT_SHAPE_SQUARE, args0: [ {// to do: we could reimplement field_numberdropdown here really easily - type: menuInfo.acceptText ? + type: menuInfo.acceptText ? 'field_textdropdown' : 'field_dropdown', name: menuName, options: menuItems From 06a2a2260636bd51bbf4432ad49da557a9f9b834 Mon Sep 17 00:00:00 2001 From: LilyMakesThings <127533508+LilyMakesThings@users.noreply.github.com> Date: Thu, 1 Feb 2024 01:20:40 +0000 Subject: [PATCH 5/6] Fix colours --- src/engine/runtime.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index b4f8599471b..274f5753813 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -1219,9 +1219,9 @@ class Runtime extends EventEmitter { type: menuId, inputsInline: true, output: 'String', - colour: categoryInfo.color1, - colourSecondary: categoryInfo.color2, - colourTertiary: categoryInfo.color3, + colour: menuInfo.acceptText ? "#FFFFFF" : categoryInfo.color1, + colourSecondary: menuInfo.acceptText ? "#FFFFFF" : categoryInfo.color2, + colourTertiary: menuInfo.acceptText ? "#FFFFFF" : categoryInfo.color3, outputShape: menuInfo.acceptReporters ? ScratchBlocksConstants.OUTPUT_SHAPE_ROUND : ScratchBlocksConstants.OUTPUT_SHAPE_SQUARE, args0: [ From 60f6da2c37e6cdfcc202193d54bbc29dd738bafe Mon Sep 17 00:00:00 2001 From: LilyMakesThings <127533508+LilyMakesThings@users.noreply.github.com> Date: Thu, 1 Feb 2024 01:27:16 +0000 Subject: [PATCH 6/6] satisfying the lint gods --- src/engine/runtime.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 274f5753813..d9afa9b127d 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -1219,9 +1219,9 @@ class Runtime extends EventEmitter { type: menuId, inputsInline: true, output: 'String', - colour: menuInfo.acceptText ? "#FFFFFF" : categoryInfo.color1, - colourSecondary: menuInfo.acceptText ? "#FFFFFF" : categoryInfo.color2, - colourTertiary: menuInfo.acceptText ? "#FFFFFF" : categoryInfo.color3, + colour: menuInfo.acceptText ? '#FFFFFF' : categoryInfo.color1, + colourSecondary: menuInfo.acceptText ? '#FFFFFF' : categoryInfo.color2, + colourTertiary: menuInfo.acceptText ? '#FFFFFF' : categoryInfo.color3, outputShape: menuInfo.acceptReporters ? ScratchBlocksConstants.OUTPUT_SHAPE_ROUND : ScratchBlocksConstants.OUTPUT_SHAPE_SQUARE, args0: [