Skip to content

Commit

Permalink
Update runtime.js
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyMakesThings authored Feb 3, 2024
1 parent 9622516 commit 744c2ac
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/engine/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ const ArgumentTypeMap = (() => {
return map;
})();

const FieldTypeMap = (() => {
const map = {};
map[ArgumentType.ANGLE] = "field_angle";

Check failure on line 131 in src/engine/runtime.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
map[ArgumentType.NUMBER] = "field_number";

Check failure on line 132 in src/engine/runtime.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
map[ArgumentType.STRING] = "field_input";

Check failure on line 133 in src/engine/runtime.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
map[ArgumentType.NOTE] = "field_note";

Check failure on line 134 in src/engine/runtime.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
return map;
})();

/**
* A pair of functions used to manage the cloud variable limit,
* to be used when adding (or attempting to add) or removing a cloud variable.
Expand Down Expand Up @@ -1635,7 +1644,7 @@ class Runtime extends EventEmitter {
let fieldName;
if (argInfo.menu) {
const menuInfo = context.categoryInfo.menuInfo[argInfo.menu];
if (menuInfo.acceptReporters) {
if (menuInfo.acceptReporters || argInfo.acceptReporters) {
valueName = placeholder;
shadowType = this._makeExtensionMenuId(argInfo.menu, context.categoryInfo.id);
fieldName = argInfo.menu;
Expand All @@ -1646,6 +1655,11 @@ class Runtime extends EventEmitter {
shadowType = null;
fieldName = placeholder;
}
} else if (argInfo.acceptReporters === false && FieldTypeMap[argInfo.type]) {
argJSON.type = FieldTypeMap[argInfo.type];
valueName = null;
shadowType = null;
fieldName = placeholder;
} else {
valueName = placeholder;
shadowType = (argTypeInfo.shadow && argTypeInfo.shadow.type) || null;
Expand Down

0 comments on commit 744c2ac

Please sign in to comment.