Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add acceptReporters to more inputs. #191

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
map[ArgumentType.NUMBER] = 'field_number';
map[ArgumentType.STRING] = 'field_input';
map[ArgumentType.NOTE] = 'field_note';
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