mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-12 02:57:32 +08:00
Fixing still
This commit is contained in:
195
dist/ueblueprint.js
vendored
195
dist/ueblueprint.js
vendored
@@ -3205,7 +3205,7 @@ function nodeColor(entity) {
|
|||||||
}
|
}
|
||||||
switch (entity.getClass()) {
|
switch (entity.getClass()) {
|
||||||
case Configuration.paths.callFunction:
|
case Configuration.paths.callFunction:
|
||||||
return entity.bIsPureFunc
|
return entity.bIsPureFunc?.valueOf()
|
||||||
? Configuration.nodeColors.green
|
? Configuration.nodeColors.green
|
||||||
: Configuration.nodeColors.blue
|
: Configuration.nodeColors.blue
|
||||||
case Configuration.paths.niagaraNodeFunctionCall:
|
case Configuration.paths.niagaraNodeFunctionCall:
|
||||||
@@ -3255,7 +3255,7 @@ function nodeColor(entity) {
|
|||||||
return Configuration.nodeColors.intenseGreen
|
return Configuration.nodeColors.intenseGreen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (entity.bIsPureFunc) {
|
if (entity.bIsPureFunc?.valueOf()) {
|
||||||
return Configuration.nodeColors.green
|
return Configuration.nodeColors.green
|
||||||
}
|
}
|
||||||
return Configuration.nodeColors.blue
|
return Configuration.nodeColors.blue
|
||||||
@@ -3704,11 +3704,7 @@ class BooleanEntity extends IEntity {
|
|||||||
return this.value
|
return this.value
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(
|
toString() {
|
||||||
insideString = false,
|
|
||||||
indentation = "",
|
|
||||||
printKey = this.Self().printKey,
|
|
||||||
) {
|
|
||||||
return this.value
|
return this.value
|
||||||
? this.#uppercase
|
? this.#uppercase
|
||||||
? "True"
|
? "True"
|
||||||
@@ -3754,9 +3750,12 @@ class MirroredEntity extends IEntity {
|
|||||||
toString(
|
toString(
|
||||||
insideString = false,
|
insideString = false,
|
||||||
indentation = "",
|
indentation = "",
|
||||||
printKey = this.Self().printKey,
|
Self = this.Self(),
|
||||||
|
printKey = Self.printKey,
|
||||||
|
wrap = Self.wrap,
|
||||||
) {
|
) {
|
||||||
return this.getter().toString(insideString, indentation, printKey)
|
this.toString = this.getter.toString.bind(this.getter());
|
||||||
|
return this.toString(insideString, indentation, Self, printKey, wrap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3806,13 +3805,7 @@ class NumberEntity extends IEntity {
|
|||||||
return this.value
|
return this.value
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(
|
toString() {
|
||||||
insideString = false,
|
|
||||||
indentation = "",
|
|
||||||
Self = this.Self(),
|
|
||||||
printKey = Self.printKey,
|
|
||||||
wrap = Self.wrap,
|
|
||||||
) {
|
|
||||||
if (this.value === Number.POSITIVE_INFINITY) {
|
if (this.value === Number.POSITIVE_INFINITY) {
|
||||||
return "+inf"
|
return "+inf"
|
||||||
}
|
}
|
||||||
@@ -4391,12 +4384,12 @@ class ArrayEntity extends IEntity {
|
|||||||
printKey = Self.printKey,
|
printKey = Self.printKey,
|
||||||
wrap = Self.wrap,
|
wrap = Self.wrap,
|
||||||
) {
|
) {
|
||||||
if (this.Self().inlined) {
|
if (Self.inlined) {
|
||||||
return super.toString.bind(this.values, insideString, indentation, Self, printKey, wrap)()
|
return super.toString.bind(this.values, insideString, indentation, Self, printKey, wrap)()
|
||||||
}
|
}
|
||||||
let result = this.values.map(v => v?.toString(insideString)).join(this.Self().attributeSeparator);
|
let result = this.values.map(v => v?.toString(insideString)).join(Self.attributeSeparator);
|
||||||
if (this.trailing) {
|
if (this.trailing) {
|
||||||
result += this.Self().attributeSeparator;
|
result += Self.attributeSeparator;
|
||||||
}
|
}
|
||||||
return `(${result})`
|
return `(${result})`
|
||||||
}
|
}
|
||||||
@@ -4542,12 +4535,12 @@ function pinColor(entity) {
|
|||||||
function pinTitle(entity) {
|
function pinTitle(entity) {
|
||||||
let result = entity.PinFriendlyName
|
let result = entity.PinFriendlyName
|
||||||
? entity.PinFriendlyName.toString()
|
? entity.PinFriendlyName.toString()
|
||||||
: Utility.formatStringName(entity.PinName ?? "");
|
: Utility.formatStringName(entity.PinName?.valueOf() ?? "");
|
||||||
let match;
|
let match;
|
||||||
if (
|
if (
|
||||||
entity.PinToolTip
|
entity.PinToolTip
|
||||||
// Match up until the first \n excluded or last character
|
// Match up until the first \n excluded or last character
|
||||||
&& (match = entity.PinToolTip.match(/\s*(.+?(?=\n)|.+\S)\s*/))
|
&& (match = entity.PinToolTip?.valueOf().match(/\s*(.+?(?=\n)|.+\S)\s*/))
|
||||||
) {
|
) {
|
||||||
if (match[1].toLowerCase() === result.toLowerCase()) {
|
if (match[1].toLowerCase() === result.toLowerCase()) {
|
||||||
return match[1] // In case they match, then keep the case of the PinToolTip
|
return match[1] // In case they match, then keep the case of the PinToolTip
|
||||||
@@ -4682,7 +4675,13 @@ class StringEntity extends IEntity {
|
|||||||
return this.value
|
return this.value
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(insideString = false) {
|
toString(
|
||||||
|
insideString = false,
|
||||||
|
indentation = "",
|
||||||
|
Self = this.Self(),
|
||||||
|
printKey = Self.printKey,
|
||||||
|
wrap = Self.wrap,
|
||||||
|
) {
|
||||||
let result = `"${Utility.escapeString(this.value)}"`;
|
let result = `"${Utility.escapeString(this.value)}"`;
|
||||||
if (insideString) {
|
if (insideString) {
|
||||||
result = Utility.escapeString(result, false);
|
result = Utility.escapeString(result, false);
|
||||||
@@ -4791,10 +4790,10 @@ class FormatTextEntity extends IEntity {
|
|||||||
printKey = Self.printKey,
|
printKey = Self.printKey,
|
||||||
wrap = Self.wrap,
|
wrap = Self.wrap,
|
||||||
) {
|
) {
|
||||||
const separator = this.Self().attributeSeparator;
|
const separator = Self.attributeSeparator;
|
||||||
return this.lookbehind + "("
|
return this.lookbehind + "("
|
||||||
+ this.values.map(v => v.toString(insideString)).join(separator)
|
+ this.values.map(v => v.toString(insideString)).join(separator)
|
||||||
+ (this.Self().trailing ? separator : "")
|
+ (Self.trailing ? separator : "")
|
||||||
+ ")"
|
+ ")"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4826,7 +4825,13 @@ class Integer64Entity extends IEntity {
|
|||||||
return this.value
|
return this.value
|
||||||
}
|
}
|
||||||
|
|
||||||
toString() {
|
toString(
|
||||||
|
insideString = false,
|
||||||
|
indentation = "",
|
||||||
|
Self = this.Self(),
|
||||||
|
printKey = Self.printKey,
|
||||||
|
wrap = Self.wrap,
|
||||||
|
) {
|
||||||
return this.value.toString()
|
return this.value.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4954,13 +4959,7 @@ class PinReferenceEntity extends IEntity {
|
|||||||
this.pinGuid = pinGuid;
|
this.pinGuid = pinGuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(
|
toString() {
|
||||||
insideString = false,
|
|
||||||
indentation = "",
|
|
||||||
Self = this.Self(),
|
|
||||||
printKey = Self.printKey,
|
|
||||||
wrap = Self.wrap,
|
|
||||||
) {
|
|
||||||
return this.objectName.toString() + " " + this.pinGuid.toString()
|
return this.objectName.toString() + " " + this.pinGuid.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5126,12 +5125,13 @@ class SimpleSerializationRotatorEntity extends RotatorEntity {
|
|||||||
toString(
|
toString(
|
||||||
insideString = false,
|
insideString = false,
|
||||||
indentation = "",
|
indentation = "",
|
||||||
printKey = this.Self().printKey,
|
Self = this.Self(),
|
||||||
|
printKey = Self.printKey,
|
||||||
|
wrap = Self.wrap,
|
||||||
) {
|
) {
|
||||||
const Self = this.Self();
|
return this.P.toString() + Self.attributeSeparator
|
||||||
return this.P.toString(insideString) + Self.attributeSeparator
|
+ this.Y.toString() + Self.attributeSeparator
|
||||||
+ this.Y.toString(insideString) + Self.attributeSeparator
|
+ this.R.toString() + (this.trailing ? Self.attributeSeparator : "")
|
||||||
+ this.R.toString(insideString) + (this.trailing ? Self.attributeSeparator : "")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5158,11 +5158,12 @@ class SimpleSerializationVector2DEntity extends Vector2DEntity {
|
|||||||
toString(
|
toString(
|
||||||
insideString = false,
|
insideString = false,
|
||||||
indentation = "",
|
indentation = "",
|
||||||
printKey = this.Self().printKey,
|
Self = this.Self(),
|
||||||
|
printKey = Self.printKey,
|
||||||
|
wrap = Self.wrap,
|
||||||
) {
|
) {
|
||||||
const Self = this.Self();
|
return this.X.toString() + Self.attributeSeparator
|
||||||
return this.X.toString(insideString) + Self.attributeSeparator
|
+ this.Y.toString() + (this.trailing ? Self.attributeSeparator : "")
|
||||||
+ this.Y.toString(insideString) + (this.trailing ? Self.attributeSeparator : "")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5247,12 +5248,13 @@ class SimpleSerializationVectorEntity extends VectorEntity {
|
|||||||
toString(
|
toString(
|
||||||
insideString = false,
|
insideString = false,
|
||||||
indentation = "",
|
indentation = "",
|
||||||
printKey = this.Self().printKey,
|
Self = this.Self(),
|
||||||
|
printKey = Self.printKey,
|
||||||
|
wrap = Self.wrap,
|
||||||
) {
|
) {
|
||||||
const Self = this.Self();
|
return this.X.toString() + Self.attributeSeparator
|
||||||
return this.X.toString(insideString) + Self.attributeSeparator
|
+ this.Y.toString() + Self.attributeSeparator
|
||||||
+ this.Y.toString(insideString) + Self.attributeSeparator
|
+ this.Z.toString() + (this.trailing ? Self.attributeSeparator : "")
|
||||||
+ this.Z.toString(insideString) + (this.trailing ? Self.attributeSeparator : "")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5385,7 +5387,7 @@ class PinEntity extends IEntity {
|
|||||||
if (pinObjectReference) {
|
if (pinObjectReference) {
|
||||||
/** @type {ObjectEntity} */
|
/** @type {ObjectEntity} */
|
||||||
const pinObject = pcgSuboject[Configuration.subObjectAttributeNameFromReference(pinObjectReference, true)];
|
const pinObject = pcgSuboject[Configuration.subObjectAttributeNameFromReference(pinObjectReference, true)];
|
||||||
let allowedTypes = pinObject.Properties?.AllowedTypes?.toString() ?? "";
|
let allowedTypes = pinObject.Properties?.AllowedTypes?.valueOf() ?? "";
|
||||||
if (allowedTypes == "") {
|
if (allowedTypes == "") {
|
||||||
allowedTypes = this.PinType.PinCategory ?? "";
|
allowedTypes = this.PinType.PinCategory ?? "";
|
||||||
if (allowedTypes == "") {
|
if (allowedTypes == "") {
|
||||||
@@ -5394,8 +5396,8 @@ class PinEntity extends IEntity {
|
|||||||
}
|
}
|
||||||
if (allowedTypes) {
|
if (allowedTypes) {
|
||||||
if (
|
if (
|
||||||
pinObject.Properties.bAllowMultipleData !== false
|
pinObject.Properties.bAllowMultipleData?.valueOf() !== false
|
||||||
&& pinObject.Properties.bAllowMultipleConnections !== false
|
&& pinObject.Properties.bAllowMultipleConnections?.valueOf() !== false
|
||||||
) {
|
) {
|
||||||
allowedTypes += "[]";
|
allowedTypes += "[]";
|
||||||
}
|
}
|
||||||
@@ -5458,15 +5460,15 @@ class PinEntity extends IEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isHidden() {
|
isHidden() {
|
||||||
return this.bHidden
|
return this.bHidden?.valueOf()
|
||||||
}
|
}
|
||||||
|
|
||||||
isInput() {
|
isInput() {
|
||||||
return !this.bHidden && this.Direction.toString() != "EGPD_Output"
|
return !this.isHidden() && this.Direction.valueOf() != "EGPD_Output"
|
||||||
}
|
}
|
||||||
|
|
||||||
isOutput() {
|
isOutput() {
|
||||||
return !this.bHidden && this.Direction.toString() == "EGPD_Output"
|
return !this.isHidden() && this.Direction.valueOf() == "EGPD_Output"
|
||||||
}
|
}
|
||||||
|
|
||||||
isLinked() {
|
isLinked() {
|
||||||
@@ -5598,9 +5600,9 @@ function nodeVariadic(entity) {
|
|||||||
pinNameFromIndex ??= (index, min = -1, max = -1, newPin) => {
|
pinNameFromIndex ??= (index, min = -1, max = -1, newPin) => {
|
||||||
const result = `Case_${index >= 0 ? index : min > 0 ? "0" : max + 1}`;
|
const result = `Case_${index >= 0 ? index : min > 0 ? "0" : max + 1}`;
|
||||||
entity.PinNames ??= new ArrayEntity();
|
entity.PinNames ??= new ArrayEntity();
|
||||||
entity.PinNames.values.push(new StringEntity(result));
|
entity.PinNames.valueOf().push(new StringEntity(result));
|
||||||
delete entity.PinTags.values[entity.PinTags.length - 1];
|
delete entity.PinTags.valueOf()[entity.PinTags.length - 1];
|
||||||
entity.PinTags.values[entity.PinTags.length] = null;
|
entity.PinTags.valueOf()[entity.PinTags.length] = null;
|
||||||
return result
|
return result
|
||||||
};
|
};
|
||||||
case Configuration.paths.switchName:
|
case Configuration.paths.switchName:
|
||||||
@@ -5610,7 +5612,7 @@ function nodeVariadic(entity) {
|
|||||||
pinNameFromIndex ??= (index, min = -1, max = -1, newPin) => {
|
pinNameFromIndex ??= (index, min = -1, max = -1, newPin) => {
|
||||||
const result = `Case_${index >= 0 ? index : min > 0 ? "0" : max + 1}`;
|
const result = `Case_${index >= 0 ? index : min > 0 ? "0" : max + 1}`;
|
||||||
entity.PinNames ??= new ArrayEntity();
|
entity.PinNames ??= new ArrayEntity();
|
||||||
entity.PinNames.values.push(new StringEntity(result));
|
entity.PinNames.valueOf().push(new StringEntity(result));
|
||||||
return result
|
return result
|
||||||
};
|
};
|
||||||
break
|
break
|
||||||
@@ -5697,11 +5699,7 @@ class NullEntity extends IEntity {
|
|||||||
.map(v => new this())
|
.map(v => new this())
|
||||||
)
|
)
|
||||||
|
|
||||||
toString(
|
toString() {
|
||||||
insideString = false,
|
|
||||||
indentation = "",
|
|
||||||
printKey = this.Self().printKey,
|
|
||||||
) {
|
|
||||||
return "()"
|
return "()"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6578,9 +6576,12 @@ class KeyboardShortcut extends IInput {
|
|||||||
|
|
||||||
this.#activationKeys = this.options.activationKeys ?? [];
|
this.#activationKeys = this.options.activationKeys ?? [];
|
||||||
|
|
||||||
const wantsShift = keyEntry => keyEntry.bShift || keyEntry.Key == "LeftShift" || keyEntry.Key == "RightShift";
|
/** @param {KeyBindingEntity} keyEntry */
|
||||||
const wantsCtrl = keyEntry => keyEntry.bCtrl || keyEntry.Key == "LeftControl" || keyEntry.Key == "RightControl";
|
const wantsShift = keyEntry => keyEntry.bShift?.valueOf() || keyEntry.Key.valueOf() == "LeftShift" || keyEntry.Key.valueOf() == "RightShift";
|
||||||
const wantsAlt = keyEntry => keyEntry.bAlt || keyEntry.Key == "LeftAlt" || keyEntry.Key == "RightAlt";
|
/** @param {KeyBindingEntity} keyEntry */
|
||||||
|
const wantsCtrl = keyEntry => keyEntry.bCtrl?.valueOf() || keyEntry.Key.valueOf() == "LeftControl" || keyEntry.Key.valueOf() == "RightControl";
|
||||||
|
/** @param {KeyBindingEntity} keyEntry */
|
||||||
|
const wantsAlt = keyEntry => keyEntry.bAlt?.valueOf() || keyEntry.Key.valueOf() == "LeftAlt" || keyEntry.Key.valueOf() == "RightAlt";
|
||||||
|
|
||||||
let self = this;
|
let self = this;
|
||||||
/** @param {KeyboardEvent} e */
|
/** @param {KeyboardEvent} e */
|
||||||
@@ -6608,10 +6609,10 @@ class KeyboardShortcut extends IInput {
|
|||||||
this.keyUpHandler = e => {
|
this.keyUpHandler = e => {
|
||||||
if (
|
if (
|
||||||
self.#activationKeys.some(keyEntry =>
|
self.#activationKeys.some(keyEntry =>
|
||||||
keyEntry.bShift && e.key == "Shift"
|
keyEntry.bShift?.valueOf() && e.key == "Shift"
|
||||||
|| keyEntry.bCtrl && e.key == "Control"
|
|| keyEntry.bCtrl?.valueOf() && e.key == "Control"
|
||||||
|| keyEntry.bAlt && e.key == "Alt"
|
|| keyEntry.bAlt?.valueOf() && e.key == "Alt"
|
||||||
|| keyEntry.bCmd && e.key == "Meta"
|
|| keyEntry.bCmd?.valueOf() && e.key == "Meta"
|
||||||
|| Configuration.Keys[keyEntry.Key.value] == e.code
|
|| Configuration.Keys[keyEntry.Key.value] == e.code
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
@@ -8814,7 +8815,7 @@ class PinTemplate extends ITemplate {
|
|||||||
case "Set": return SVGIcon.setPin
|
case "Set": return SVGIcon.setPin
|
||||||
case "Map": return SVGIcon.mapPin
|
case "Map": return SVGIcon.mapPin
|
||||||
}
|
}
|
||||||
if (this.element.entity.PinType?.PinCategory?.toLocaleLowerCase() === "delegate") {
|
if (this.element.entity.PinType?.PinCategory?.valueOf().toLocaleLowerCase() === "delegate") {
|
||||||
return SVGIcon.delegate
|
return SVGIcon.delegate
|
||||||
}
|
}
|
||||||
if (this.element.nodeElement?.template instanceof VariableOperationNodeTemplate) {
|
if (this.element.nodeElement?.template instanceof VariableOperationNodeTemplate) {
|
||||||
@@ -8840,8 +8841,8 @@ class PinTemplate extends ITemplate {
|
|||||||
|
|
||||||
isInputRendered() {
|
isInputRendered() {
|
||||||
return this.element.isInput()
|
return this.element.isInput()
|
||||||
&& !this.element.entity.bDefaultValueIsIgnored
|
&& !this.element.entity.bDefaultValueIsIgnored?.valueOf()
|
||||||
&& !this.element.entity.PinType.bIsReference
|
&& !this.element.entity.PinType.bIsReference?.valueOf()
|
||||||
}
|
}
|
||||||
|
|
||||||
renderInput() {
|
renderInput() {
|
||||||
@@ -9357,7 +9358,7 @@ class NodeElement extends ISelectableDraggableElement {
|
|||||||
this.advancedPinDisplay = entity.AdvancedPinDisplay?.toString();
|
this.advancedPinDisplay = entity.AdvancedPinDisplay?.toString();
|
||||||
this.enabledState = entity.EnabledState;
|
this.enabledState = entity.EnabledState;
|
||||||
this.nodeDisplayName = nodeTitle(entity);
|
this.nodeDisplayName = nodeTitle(entity);
|
||||||
this.pureFunction = entity.bIsPureFunc;
|
this.pureFunction = entity.bIsPureFunc?.valueOf();
|
||||||
this.dragLinkObjects = [];
|
this.dragLinkObjects = [];
|
||||||
super.initialize(entity, template);
|
super.initialize(entity, template);
|
||||||
this.#pins = this.template.createPinElements();
|
this.#pins = this.template.createPinElements();
|
||||||
@@ -9526,18 +9527,18 @@ class BlueprintEntity extends ObjectEntity {
|
|||||||
|
|
||||||
/** @param {ObjectEntity} entity */
|
/** @param {ObjectEntity} entity */
|
||||||
mergeWith(entity) {
|
mergeWith(entity) {
|
||||||
if (!entity.ScriptVariables || entity.ScriptVariables.values.length === 0) {
|
if (!entity.ScriptVariables || entity.ScriptVariables.length === 0) {
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
if (!this.ScriptVariables || this.ScriptVariables.values.length === 0) {
|
if (!this.ScriptVariables || this.ScriptVariables.length === 0) {
|
||||||
this.ScriptVariables = entity.ScriptVariables;
|
this.ScriptVariables = entity.ScriptVariables;
|
||||||
}
|
}
|
||||||
let scriptVariables = Utility.mergeArrays(
|
let scriptVariables = Utility.mergeArrays(
|
||||||
this.ScriptVariables.values,
|
this.ScriptVariables.valueOf(),
|
||||||
entity.ScriptVariables.values,
|
entity.ScriptVariables.valueOf(),
|
||||||
(l, r) => l.OriginalChangeId.value == r.OriginalChangeId.value
|
(l, r) => l.OriginalChangeId.value == r.OriginalChangeId.value
|
||||||
);
|
);
|
||||||
if (scriptVariables.length === this.ScriptVariables.values.length) {
|
if (scriptVariables.length === this.ScriptVariables.length) {
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
const entries = scriptVariables.concat(scriptVariables).map((v, i) => {
|
const entries = scriptVariables.concat(scriptVariables).map((v, i) => {
|
||||||
@@ -12200,7 +12201,7 @@ function pinTemplate(entity) {
|
|||||||
if (entity.PinType.ContainerType?.toString() === "Array") {
|
if (entity.PinType.ContainerType?.toString() === "Array") {
|
||||||
return PinTemplate
|
return PinTemplate
|
||||||
}
|
}
|
||||||
if (entity.PinType.bIsReference && !entity.PinType.bIsConst) {
|
if (entity.PinType.bIsReference?.valueOf() && !entity.PinType.bIsConst?.valueOf()) {
|
||||||
return inputPinTemplates["MUTABLE_REFERENCE"]
|
return inputPinTemplates["MUTABLE_REFERENCE"]
|
||||||
}
|
}
|
||||||
if (entity.getType() === "exec") {
|
if (entity.getType() === "exec") {
|
||||||
@@ -12290,9 +12291,9 @@ class PinElement extends IElement {
|
|||||||
nodeElement = undefined
|
nodeElement = undefined
|
||||||
) {
|
) {
|
||||||
this.nodeElement = nodeElement;
|
this.nodeElement = nodeElement;
|
||||||
this.advancedView = entity.bAdvancedView;
|
this.advancedView = entity.bAdvancedView?.valueOf();
|
||||||
this.isLinked = false;
|
this.isLinked = false;
|
||||||
this.connectable = !entity.bNotConnectable;
|
this.connectable = !entity.bNotConnectable?.valueOf();
|
||||||
super.initialize(entity, template);
|
super.initialize(entity, template);
|
||||||
this.pinType = this.entity.getType();
|
this.pinType = this.entity.getType();
|
||||||
this.defaultValue = this.entity.getDefaultValue();
|
this.defaultValue = this.entity.getDefaultValue();
|
||||||
@@ -12307,7 +12308,7 @@ class PinElement extends IElement {
|
|||||||
|
|
||||||
createPinReference() {
|
createPinReference() {
|
||||||
return new PinReferenceEntity({
|
return new PinReferenceEntity({
|
||||||
objectName: this.nodeElement.getNodeName(),
|
objectName: new StringEntity(this.nodeElement.getNodeName()),
|
||||||
pinGuid: this.getPinId(),
|
pinGuid: this.getPinId(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -12319,7 +12320,7 @@ class PinElement extends IElement {
|
|||||||
|
|
||||||
/** @returns {String} */
|
/** @returns {String} */
|
||||||
getPinName() {
|
getPinName() {
|
||||||
return this.entity.PinName
|
return this.entity.PinName?.valueOf() ?? ""
|
||||||
}
|
}
|
||||||
|
|
||||||
getPinDisplayName() {
|
getPinDisplayName() {
|
||||||
@@ -12366,21 +12367,23 @@ class PinElement extends IElement {
|
|||||||
|
|
||||||
/** @param {IElement[]} nodesWhitelist */
|
/** @param {IElement[]} nodesWhitelist */
|
||||||
sanitizeLinks(nodesWhitelist = []) {
|
sanitizeLinks(nodesWhitelist = []) {
|
||||||
this.entity.LinkedTo = this.entity.LinkedTo?.filter(pinReference => {
|
this.entity.LinkedTo = new ArrayEntity(
|
||||||
let pin = this.blueprint.getPin(pinReference);
|
this.entity.LinkedTo?.valueOf().filter(pinReference => {
|
||||||
if (pin) {
|
let pin = this.blueprint.getPin(pinReference);
|
||||||
if (nodesWhitelist.length && !nodesWhitelist.includes(pin.nodeElement)) {
|
if (pin) {
|
||||||
return false
|
if (nodesWhitelist.length && !nodesWhitelist.includes(pin.nodeElement)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
let link = this.blueprint.getLink(this, pin);
|
||||||
|
if (!link) {
|
||||||
|
link = /** @type {LinkElementConstructor} */(ElementFactory.getConstructor("ueb-link"))
|
||||||
|
.newObject(this, pin);
|
||||||
|
this.blueprint.addGraphElement(link);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let link = this.blueprint.getLink(this, pin);
|
return pin
|
||||||
if (!link) {
|
})
|
||||||
link = /** @type {LinkElementConstructor} */(ElementFactory.getConstructor("ueb-link"))
|
);
|
||||||
.newObject(this, pin);
|
|
||||||
this.blueprint.addGraphElement(link);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return pin
|
|
||||||
});
|
|
||||||
this.isLinked = this.entity.isLinked();
|
this.isLinked = this.entity.isLinked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
dist/ueblueprint.min.js
vendored
4
dist/ueblueprint.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -24,7 +24,7 @@ export default function nodeColor(entity) {
|
|||||||
}
|
}
|
||||||
switch (entity.getClass()) {
|
switch (entity.getClass()) {
|
||||||
case Configuration.paths.callFunction:
|
case Configuration.paths.callFunction:
|
||||||
return entity.bIsPureFunc
|
return entity.bIsPureFunc?.valueOf()
|
||||||
? Configuration.nodeColors.green
|
? Configuration.nodeColors.green
|
||||||
: Configuration.nodeColors.blue
|
: Configuration.nodeColors.blue
|
||||||
case Configuration.paths.niagaraNodeFunctionCall:
|
case Configuration.paths.niagaraNodeFunctionCall:
|
||||||
@@ -74,7 +74,7 @@ export default function nodeColor(entity) {
|
|||||||
return Configuration.nodeColors.intenseGreen
|
return Configuration.nodeColors.intenseGreen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (entity.bIsPureFunc) {
|
if (entity.bIsPureFunc?.valueOf()) {
|
||||||
return Configuration.nodeColors.green
|
return Configuration.nodeColors.green
|
||||||
}
|
}
|
||||||
return Configuration.nodeColors.blue
|
return Configuration.nodeColors.blue
|
||||||
|
|||||||
@@ -84,9 +84,9 @@ export default function nodeVariadic(entity) {
|
|||||||
pinNameFromIndex ??= (index, min = -1, max = -1, newPin) => {
|
pinNameFromIndex ??= (index, min = -1, max = -1, newPin) => {
|
||||||
const result = `Case_${index >= 0 ? index : min > 0 ? "0" : max + 1}`
|
const result = `Case_${index >= 0 ? index : min > 0 ? "0" : max + 1}`
|
||||||
entity.PinNames ??= new ArrayEntity()
|
entity.PinNames ??= new ArrayEntity()
|
||||||
entity.PinNames.values.push(new StringEntity(result))
|
entity.PinNames.valueOf().push(new StringEntity(result))
|
||||||
delete entity.PinTags.values[entity.PinTags.length - 1]
|
delete entity.PinTags.valueOf()[entity.PinTags.length - 1]
|
||||||
entity.PinTags.values[entity.PinTags.length] = null
|
entity.PinTags.valueOf()[entity.PinTags.length] = null
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
case Configuration.paths.switchName:
|
case Configuration.paths.switchName:
|
||||||
@@ -96,7 +96,7 @@ export default function nodeVariadic(entity) {
|
|||||||
pinNameFromIndex ??= (index, min = -1, max = -1, newPin) => {
|
pinNameFromIndex ??= (index, min = -1, max = -1, newPin) => {
|
||||||
const result = `Case_${index >= 0 ? index : min > 0 ? "0" : max + 1}`
|
const result = `Case_${index >= 0 ? index : min > 0 ? "0" : max + 1}`
|
||||||
entity.PinNames ??= new ArrayEntity()
|
entity.PinNames ??= new ArrayEntity()
|
||||||
entity.PinNames.values.push(new StringEntity(result))
|
entity.PinNames.valueOf().push(new StringEntity(result))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ const inputPinTemplates = {
|
|||||||
|
|
||||||
/** @param {PinEntity} entity */
|
/** @param {PinEntity} entity */
|
||||||
export default function pinTemplate(entity) {
|
export default function pinTemplate(entity) {
|
||||||
if (entity.PinType.ContainerType?.toString() === "Array") {
|
if (entity.PinType.ContainerType?.valueOf() === "Array") {
|
||||||
return PinTemplate
|
return PinTemplate
|
||||||
}
|
}
|
||||||
if (entity.PinType.bIsReference && !entity.PinType.bIsConst) {
|
if (entity.PinType.bIsReference?.valueOf() && !entity.PinType.bIsConst?.valueOf()) {
|
||||||
return inputPinTemplates["MUTABLE_REFERENCE"]
|
return inputPinTemplates["MUTABLE_REFERENCE"]
|
||||||
}
|
}
|
||||||
if (entity.getType() === "exec") {
|
if (entity.getType() === "exec") {
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ import Utility from "../Utility.js"
|
|||||||
export default function pinTitle(entity) {
|
export default function pinTitle(entity) {
|
||||||
let result = entity.PinFriendlyName
|
let result = entity.PinFriendlyName
|
||||||
? entity.PinFriendlyName.toString()
|
? entity.PinFriendlyName.toString()
|
||||||
: Utility.formatStringName(entity.PinName ?? "")
|
: Utility.formatStringName(entity.PinName?.valueOf() ?? "")
|
||||||
let match
|
let match
|
||||||
if (
|
if (
|
||||||
entity.PinToolTip
|
entity.PinToolTip
|
||||||
// Match up until the first \n excluded or last character
|
// Match up until the first \n excluded or last character
|
||||||
&& (match = entity.PinToolTip.match(/\s*(.+?(?=\n)|.+\S)\s*/))
|
&& (match = entity.PinToolTip?.valueOf().match(/\s*(.+?(?=\n)|.+\S)\s*/))
|
||||||
) {
|
) {
|
||||||
if (match[1].toLowerCase() === result.toLowerCase()) {
|
if (match[1].toLowerCase() === result.toLowerCase()) {
|
||||||
return match[1] // In case they match, then keep the case of the PinToolTip
|
return match[1] // In case they match, then keep the case of the PinToolTip
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export default class NodeElement extends ISelectableDraggableElement {
|
|||||||
this.advancedPinDisplay = entity.AdvancedPinDisplay?.toString()
|
this.advancedPinDisplay = entity.AdvancedPinDisplay?.toString()
|
||||||
this.enabledState = entity.EnabledState
|
this.enabledState = entity.EnabledState
|
||||||
this.nodeDisplayName = nodeTitle(entity)
|
this.nodeDisplayName = nodeTitle(entity)
|
||||||
this.pureFunction = entity.bIsPureFunc
|
this.pureFunction = entity.bIsPureFunc?.valueOf()
|
||||||
this.dragLinkObjects = []
|
this.dragLinkObjects = []
|
||||||
super.initialize(entity, template)
|
super.initialize(entity, template)
|
||||||
this.#pins = this.template.createPinElements()
|
this.#pins = this.template.createPinElements()
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import Utility from "../Utility.js"
|
import Utility from "../Utility.js"
|
||||||
import pinTemplate from "../decoding/pinTemplate.js"
|
import pinTemplate from "../decoding/pinTemplate.js"
|
||||||
|
import ArrayEntity from "../entity/ArrayEntity.js"
|
||||||
import GuidEntity from "../entity/GuidEntity.js"
|
import GuidEntity from "../entity/GuidEntity.js"
|
||||||
import LinearColorEntity from "../entity/LinearColorEntity.js"
|
import LinearColorEntity from "../entity/LinearColorEntity.js"
|
||||||
import PinEntity from "../entity/PinEntity.js"
|
import PinEntity from "../entity/PinEntity.js"
|
||||||
import PinReferenceEntity from "../entity/PinReferenceEntity.js"
|
import PinReferenceEntity from "../entity/PinReferenceEntity.js"
|
||||||
|
import StringEntity from "../entity/StringEntity.js"
|
||||||
import PinTemplate from "../template/pin/PinTemplate.js"
|
import PinTemplate from "../template/pin/PinTemplate.js"
|
||||||
import ElementFactory from "./ElementFactory.js"
|
import ElementFactory from "./ElementFactory.js"
|
||||||
import IElement from "./IElement.js"
|
import IElement from "./IElement.js"
|
||||||
@@ -89,9 +91,9 @@ export default class PinElement extends IElement {
|
|||||||
nodeElement = undefined
|
nodeElement = undefined
|
||||||
) {
|
) {
|
||||||
this.nodeElement = nodeElement
|
this.nodeElement = nodeElement
|
||||||
this.advancedView = entity.bAdvancedView
|
this.advancedView = entity.bAdvancedView?.valueOf()
|
||||||
this.isLinked = false
|
this.isLinked = false
|
||||||
this.connectable = !entity.bNotConnectable
|
this.connectable = !entity.bNotConnectable?.valueOf()
|
||||||
super.initialize(entity, template)
|
super.initialize(entity, template)
|
||||||
this.pinType = this.entity.getType()
|
this.pinType = this.entity.getType()
|
||||||
this.defaultValue = this.entity.getDefaultValue()
|
this.defaultValue = this.entity.getDefaultValue()
|
||||||
@@ -106,7 +108,7 @@ export default class PinElement extends IElement {
|
|||||||
|
|
||||||
createPinReference() {
|
createPinReference() {
|
||||||
return new PinReferenceEntity({
|
return new PinReferenceEntity({
|
||||||
objectName: this.nodeElement.getNodeName(),
|
objectName: new StringEntity(this.nodeElement.getNodeName()),
|
||||||
pinGuid: this.getPinId(),
|
pinGuid: this.getPinId(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -118,7 +120,7 @@ export default class PinElement extends IElement {
|
|||||||
|
|
||||||
/** @returns {String} */
|
/** @returns {String} */
|
||||||
getPinName() {
|
getPinName() {
|
||||||
return this.entity.PinName
|
return this.entity.PinName?.valueOf() ?? ""
|
||||||
}
|
}
|
||||||
|
|
||||||
getPinDisplayName() {
|
getPinDisplayName() {
|
||||||
@@ -147,7 +149,7 @@ export default class PinElement extends IElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getLinks() {
|
getLinks() {
|
||||||
return this.entity.LinkedTo ?? []
|
return this.entity.LinkedTo?.valueOf() ?? []
|
||||||
}
|
}
|
||||||
|
|
||||||
getDefaultValue(maybeCreate = false) {
|
getDefaultValue(maybeCreate = false) {
|
||||||
@@ -165,21 +167,23 @@ export default class PinElement extends IElement {
|
|||||||
|
|
||||||
/** @param {IElement[]} nodesWhitelist */
|
/** @param {IElement[]} nodesWhitelist */
|
||||||
sanitizeLinks(nodesWhitelist = []) {
|
sanitizeLinks(nodesWhitelist = []) {
|
||||||
this.entity.LinkedTo = this.entity.LinkedTo?.filter(pinReference => {
|
this.entity.LinkedTo = new ArrayEntity(
|
||||||
let pin = this.blueprint.getPin(pinReference)
|
this.entity.LinkedTo?.valueOf().filter(pinReference => {
|
||||||
if (pin) {
|
let pin = this.blueprint.getPin(pinReference)
|
||||||
if (nodesWhitelist.length && !nodesWhitelist.includes(pin.nodeElement)) {
|
if (pin) {
|
||||||
return false
|
if (nodesWhitelist.length && !nodesWhitelist.includes(pin.nodeElement)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
let link = this.blueprint.getLink(this, pin)
|
||||||
|
if (!link) {
|
||||||
|
link = /** @type {LinkElementConstructor} */(ElementFactory.getConstructor("ueb-link"))
|
||||||
|
.newObject(this, pin)
|
||||||
|
this.blueprint.addGraphElement(link)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let link = this.blueprint.getLink(this, pin)
|
return pin
|
||||||
if (!link) {
|
})
|
||||||
link = /** @type {LinkElementConstructor} */(ElementFactory.getConstructor("ueb-link"))
|
)
|
||||||
.newObject(this, pin)
|
|
||||||
this.blueprint.addGraphElement(link)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return pin
|
|
||||||
})
|
|
||||||
this.isLinked = this.entity.isLinked()
|
this.isLinked = this.entity.isLinked()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,12 +74,12 @@ export default class ArrayEntity extends IEntity {
|
|||||||
printKey = Self.printKey,
|
printKey = Self.printKey,
|
||||||
wrap = Self.wrap,
|
wrap = Self.wrap,
|
||||||
) {
|
) {
|
||||||
if (this.Self().inlined) {
|
if (Self.inlined) {
|
||||||
return super.toString.bind(this.values, insideString, indentation, Self, printKey, wrap)()
|
return super.toString.bind(this.values, insideString, indentation, Self, printKey, wrap)()
|
||||||
}
|
}
|
||||||
let result = this.values.map(v => v?.toString(insideString)).join(this.Self().attributeSeparator)
|
let result = this.values.map(v => v?.toString(insideString)).join(Self.attributeSeparator)
|
||||||
if (this.trailing) {
|
if (this.trailing) {
|
||||||
result += this.Self().attributeSeparator
|
result += Self.attributeSeparator
|
||||||
}
|
}
|
||||||
return `(${result})`
|
return `(${result})`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,18 +56,18 @@ export default class BlueprintEntity extends ObjectEntity {
|
|||||||
|
|
||||||
/** @param {ObjectEntity} entity */
|
/** @param {ObjectEntity} entity */
|
||||||
mergeWith(entity) {
|
mergeWith(entity) {
|
||||||
if (!entity.ScriptVariables || entity.ScriptVariables.values.length === 0) {
|
if (!entity.ScriptVariables || entity.ScriptVariables.length === 0) {
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
if (!this.ScriptVariables || this.ScriptVariables.values.length === 0) {
|
if (!this.ScriptVariables || this.ScriptVariables.length === 0) {
|
||||||
this.ScriptVariables = entity.ScriptVariables
|
this.ScriptVariables = entity.ScriptVariables
|
||||||
}
|
}
|
||||||
let scriptVariables = Utility.mergeArrays(
|
let scriptVariables = Utility.mergeArrays(
|
||||||
this.ScriptVariables.values,
|
this.ScriptVariables.valueOf(),
|
||||||
entity.ScriptVariables.values,
|
entity.ScriptVariables.valueOf(),
|
||||||
(l, r) => l.OriginalChangeId.value == r.OriginalChangeId.value
|
(l, r) => l.OriginalChangeId.value == r.OriginalChangeId.value
|
||||||
)
|
)
|
||||||
if (scriptVariables.length === this.ScriptVariables.values.length) {
|
if (scriptVariables.length === this.ScriptVariables.length) {
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
const entries = scriptVariables.concat(scriptVariables).map((v, i) => {
|
const entries = scriptVariables.concat(scriptVariables).map((v, i) => {
|
||||||
|
|||||||
@@ -30,11 +30,7 @@ export default class BooleanEntity extends IEntity {
|
|||||||
return this.value
|
return this.value
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(
|
toString() {
|
||||||
insideString = false,
|
|
||||||
indentation = "",
|
|
||||||
printKey = this.Self().printKey,
|
|
||||||
) {
|
|
||||||
return this.value
|
return this.value
|
||||||
? this.#uppercase
|
? this.#uppercase
|
||||||
? "True"
|
? "True"
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ export default class FormatTextEntity extends IEntity {
|
|||||||
printKey = Self.printKey,
|
printKey = Self.printKey,
|
||||||
wrap = Self.wrap,
|
wrap = Self.wrap,
|
||||||
) {
|
) {
|
||||||
const separator = this.Self().attributeSeparator
|
const separator = Self.attributeSeparator
|
||||||
return this.lookbehind + "("
|
return this.lookbehind + "("
|
||||||
+ this.values.map(v => v.toString(insideString)).join(separator)
|
+ this.values.map(v => v.toString(insideString)).join(separator)
|
||||||
+ (this.Self().trailing ? separator : "")
|
+ (Self.trailing ? separator : "")
|
||||||
+ ")"
|
+ ")"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,13 @@ export default class Integer64Entity extends IEntity {
|
|||||||
return this.value
|
return this.value
|
||||||
}
|
}
|
||||||
|
|
||||||
toString() {
|
toString(
|
||||||
|
insideString = false,
|
||||||
|
indentation = "",
|
||||||
|
Self = this.Self(),
|
||||||
|
printKey = Self.printKey,
|
||||||
|
wrap = Self.wrap,
|
||||||
|
) {
|
||||||
return this.value.toString()
|
return this.value.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,8 +35,11 @@ export default class MirroredEntity extends IEntity {
|
|||||||
toString(
|
toString(
|
||||||
insideString = false,
|
insideString = false,
|
||||||
indentation = "",
|
indentation = "",
|
||||||
printKey = this.Self().printKey,
|
Self = this.Self(),
|
||||||
|
printKey = Self.printKey,
|
||||||
|
wrap = Self.wrap,
|
||||||
) {
|
) {
|
||||||
return this.getter().toString(insideString, indentation, printKey)
|
this.toString = this.getter.toString.bind(this.getter())
|
||||||
|
return this.toString(insideString, indentation, Self, printKey, wrap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ export default class NullEntity extends IEntity {
|
|||||||
.map(v => new this())
|
.map(v => new this())
|
||||||
)
|
)
|
||||||
|
|
||||||
toString(
|
toString() {
|
||||||
insideString = false,
|
|
||||||
indentation = "",
|
|
||||||
printKey = this.Self().printKey,
|
|
||||||
) {
|
|
||||||
return "()"
|
return "()"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,13 +48,7 @@ export default class NumberEntity extends IEntity {
|
|||||||
return this.value
|
return this.value
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(
|
toString() {
|
||||||
insideString = false,
|
|
||||||
indentation = "",
|
|
||||||
Self = this.Self(),
|
|
||||||
printKey = Self.printKey,
|
|
||||||
wrap = Self.wrap,
|
|
||||||
) {
|
|
||||||
if (this.value === Number.POSITIVE_INFINITY) {
|
if (this.value === Number.POSITIVE_INFINITY) {
|
||||||
return "+inf"
|
return "+inf"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ export default class PinEntity extends IEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getType() {
|
getType() {
|
||||||
const category = this.PinType.PinCategory.toString().toLocaleLowerCase()
|
const category = this.PinType.PinCategory.valueOf().toLocaleLowerCase()
|
||||||
if (category === "struct" || category === "class" || category === "object" || category === "type") {
|
if (category === "struct" || category === "class" || category === "object" || category === "type") {
|
||||||
return this.PinType.PinSubCategoryObject.path
|
return this.PinType.PinSubCategoryObject.path
|
||||||
}
|
}
|
||||||
@@ -162,7 +162,7 @@ export default class PinEntity extends IEntity {
|
|||||||
if (pinObjectReference) {
|
if (pinObjectReference) {
|
||||||
/** @type {ObjectEntity} */
|
/** @type {ObjectEntity} */
|
||||||
const pinObject = pcgSuboject[Configuration.subObjectAttributeNameFromReference(pinObjectReference, true)]
|
const pinObject = pcgSuboject[Configuration.subObjectAttributeNameFromReference(pinObjectReference, true)]
|
||||||
let allowedTypes = pinObject.Properties?.AllowedTypes?.toString() ?? ""
|
let allowedTypes = pinObject.Properties?.AllowedTypes?.valueOf() ?? ""
|
||||||
if (allowedTypes == "") {
|
if (allowedTypes == "") {
|
||||||
allowedTypes = this.PinType.PinCategory ?? ""
|
allowedTypes = this.PinType.PinCategory ?? ""
|
||||||
if (allowedTypes == "") {
|
if (allowedTypes == "") {
|
||||||
@@ -171,8 +171,8 @@ export default class PinEntity extends IEntity {
|
|||||||
}
|
}
|
||||||
if (allowedTypes) {
|
if (allowedTypes) {
|
||||||
if (
|
if (
|
||||||
pinObject.Properties.bAllowMultipleData !== false
|
pinObject.Properties.bAllowMultipleData?.valueOf() !== false
|
||||||
&& pinObject.Properties.bAllowMultipleConnections !== false
|
&& pinObject.Properties.bAllowMultipleConnections?.valueOf() !== false
|
||||||
) {
|
) {
|
||||||
allowedTypes += "[]"
|
allowedTypes += "[]"
|
||||||
}
|
}
|
||||||
@@ -235,15 +235,15 @@ export default class PinEntity extends IEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isHidden() {
|
isHidden() {
|
||||||
return this.bHidden
|
return this.bHidden?.valueOf()
|
||||||
}
|
}
|
||||||
|
|
||||||
isInput() {
|
isInput() {
|
||||||
return !this.bHidden && this.Direction.toString() != "EGPD_Output"
|
return !this.isHidden() && this.Direction.valueOf() != "EGPD_Output"
|
||||||
}
|
}
|
||||||
|
|
||||||
isOutput() {
|
isOutput() {
|
||||||
return !this.bHidden && this.Direction.toString() == "EGPD_Output"
|
return !this.isHidden() && this.Direction.valueOf() == "EGPD_Output"
|
||||||
}
|
}
|
||||||
|
|
||||||
isLinked() {
|
isLinked() {
|
||||||
|
|||||||
@@ -25,13 +25,7 @@ export default class PinReferenceEntity extends IEntity {
|
|||||||
this.pinGuid = pinGuid
|
this.pinGuid = pinGuid
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(
|
toString() {
|
||||||
insideString = false,
|
|
||||||
indentation = "",
|
|
||||||
Self = this.Self(),
|
|
||||||
printKey = Self.printKey,
|
|
||||||
wrap = Self.wrap,
|
|
||||||
) {
|
|
||||||
return this.objectName.toString() + " " + this.pinGuid.toString()
|
return this.objectName.toString() + " " + this.pinGuid.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,11 +30,12 @@ export default class SimpleSerializationRotatorEntity extends RotatorEntity {
|
|||||||
toString(
|
toString(
|
||||||
insideString = false,
|
insideString = false,
|
||||||
indentation = "",
|
indentation = "",
|
||||||
printKey = this.Self().printKey,
|
Self = this.Self(),
|
||||||
|
printKey = Self.printKey,
|
||||||
|
wrap = Self.wrap,
|
||||||
) {
|
) {
|
||||||
const Self = this.Self()
|
return this.P.toString() + Self.attributeSeparator
|
||||||
return this.P.toString(insideString) + Self.attributeSeparator
|
+ this.Y.toString() + Self.attributeSeparator
|
||||||
+ this.Y.toString(insideString) + Self.attributeSeparator
|
+ this.R.toString() + (this.trailing ? Self.attributeSeparator : "")
|
||||||
+ this.R.toString(insideString) + (this.trailing ? Self.attributeSeparator : "")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,10 +26,11 @@ export default class SimpleSerializationVector2DEntity extends Vector2DEntity {
|
|||||||
toString(
|
toString(
|
||||||
insideString = false,
|
insideString = false,
|
||||||
indentation = "",
|
indentation = "",
|
||||||
printKey = this.Self().printKey,
|
Self = this.Self(),
|
||||||
|
printKey = Self.printKey,
|
||||||
|
wrap = Self.wrap,
|
||||||
) {
|
) {
|
||||||
const Self = this.Self()
|
return this.X.toString() + Self.attributeSeparator
|
||||||
return this.X.toString(insideString) + Self.attributeSeparator
|
+ this.Y.toString() + (this.trailing ? Self.attributeSeparator : "")
|
||||||
+ this.Y.toString(insideString) + (this.trailing ? Self.attributeSeparator : "")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,11 +31,12 @@ export default class SimpleSerializationVectorEntity extends VectorEntity {
|
|||||||
toString(
|
toString(
|
||||||
insideString = false,
|
insideString = false,
|
||||||
indentation = "",
|
indentation = "",
|
||||||
printKey = this.Self().printKey,
|
Self = this.Self(),
|
||||||
|
printKey = Self.printKey,
|
||||||
|
wrap = Self.wrap,
|
||||||
) {
|
) {
|
||||||
const Self = this.Self()
|
return this.X.toString() + Self.attributeSeparator
|
||||||
return this.X.toString(insideString) + Self.attributeSeparator
|
+ this.Y.toString() + Self.attributeSeparator
|
||||||
+ this.Y.toString(insideString) + Self.attributeSeparator
|
+ this.Z.toString() + (this.trailing ? Self.attributeSeparator : "")
|
||||||
+ this.Z.toString(insideString) + (this.trailing ? Self.attributeSeparator : "")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,13 @@ export default class StringEntity extends IEntity {
|
|||||||
return this.value
|
return this.value
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(insideString = false) {
|
toString(
|
||||||
|
insideString = false,
|
||||||
|
indentation = "",
|
||||||
|
Self = this.Self(),
|
||||||
|
printKey = Self.printKey,
|
||||||
|
wrap = Self.wrap,
|
||||||
|
) {
|
||||||
let result = `"${Utility.escapeString(this.value)}"`
|
let result = `"${Utility.escapeString(this.value)}"`
|
||||||
if (insideString) {
|
if (insideString) {
|
||||||
result = Utility.escapeString(result, false)
|
result = Utility.escapeString(result, false)
|
||||||
|
|||||||
@@ -64,9 +64,12 @@ export default class KeyboardShortcut extends IInput {
|
|||||||
|
|
||||||
this.#activationKeys = this.options.activationKeys ?? []
|
this.#activationKeys = this.options.activationKeys ?? []
|
||||||
|
|
||||||
const wantsShift = keyEntry => keyEntry.bShift || keyEntry.Key == "LeftShift" || keyEntry.Key == "RightShift"
|
/** @param {KeyBindingEntity} keyEntry */
|
||||||
const wantsCtrl = keyEntry => keyEntry.bCtrl || keyEntry.Key == "LeftControl" || keyEntry.Key == "RightControl"
|
const wantsShift = keyEntry => keyEntry.bShift?.valueOf() || keyEntry.Key.valueOf() == "LeftShift" || keyEntry.Key.valueOf() == "RightShift"
|
||||||
const wantsAlt = keyEntry => keyEntry.bAlt || keyEntry.Key == "LeftAlt" || keyEntry.Key == "RightAlt"
|
/** @param {KeyBindingEntity} keyEntry */
|
||||||
|
const wantsCtrl = keyEntry => keyEntry.bCtrl?.valueOf() || keyEntry.Key.valueOf() == "LeftControl" || keyEntry.Key.valueOf() == "RightControl"
|
||||||
|
/** @param {KeyBindingEntity} keyEntry */
|
||||||
|
const wantsAlt = keyEntry => keyEntry.bAlt?.valueOf() || keyEntry.Key.valueOf() == "LeftAlt" || keyEntry.Key.valueOf() == "RightAlt"
|
||||||
|
|
||||||
let self = this
|
let self = this
|
||||||
/** @param {KeyboardEvent} e */
|
/** @param {KeyboardEvent} e */
|
||||||
@@ -94,10 +97,10 @@ export default class KeyboardShortcut extends IInput {
|
|||||||
this.keyUpHandler = e => {
|
this.keyUpHandler = e => {
|
||||||
if (
|
if (
|
||||||
self.#activationKeys.some(keyEntry =>
|
self.#activationKeys.some(keyEntry =>
|
||||||
keyEntry.bShift && e.key == "Shift"
|
keyEntry.bShift?.valueOf() && e.key == "Shift"
|
||||||
|| keyEntry.bCtrl && e.key == "Control"
|
|| keyEntry.bCtrl?.valueOf() && e.key == "Control"
|
||||||
|| keyEntry.bAlt && e.key == "Alt"
|
|| keyEntry.bAlt?.valueOf() && e.key == "Alt"
|
||||||
|| keyEntry.bCmd && e.key == "Meta"
|
|| keyEntry.bCmd?.valueOf() && e.key == "Meta"
|
||||||
|| Configuration.Keys[keyEntry.Key.value] == e.code
|
|| Configuration.Keys[keyEntry.Key.value] == e.code
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default class MouseCreateLink extends IMouseClickDrag {
|
|||||||
this.link.setMessageReplaceOutputLink()
|
this.link.setMessageReplaceOutputLink()
|
||||||
this.linkValid = true
|
this.linkValid = true
|
||||||
} else if (
|
} else if (
|
||||||
(a.entity.PinType.PinCategory != "object" || b.entity.PinType.PinCategory != "object")
|
(a.entity.PinType.PinCategory.valueOf() != "object" || b.entity.PinType.PinCategory.valueOf() != "object")
|
||||||
&& a.pinType != b.pinType
|
&& a.pinType != b.pinType
|
||||||
) {
|
) {
|
||||||
this.link.setMessageTypesIncompatible(a, b)
|
this.link.setMessageTypesIncompatible(a, b)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default class CommentNodeTemplate extends IResizeableTemplate {
|
|||||||
<div class="ueb-node-border">
|
<div class="ueb-node-border">
|
||||||
<div class="ueb-node-wrapper">
|
<div class="ueb-node-wrapper">
|
||||||
<div class="ueb-node-top"
|
<div class="ueb-node-top"
|
||||||
.innerText="${Utility.encodeHTMLWhitespace(this.element.entity.NodeComment)}">
|
.innerText="${Utility.encodeHTMLWhitespace(this.element.entity.NodeComment?.valueOf())}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default class EventNodeTemplate extends NodeTemplate {
|
|||||||
|
|
||||||
createDelegatePinElement() {
|
createDelegatePinElement() {
|
||||||
const pin = /** @type {PinElementConstructor} */(ElementFactory.getConstructor("ueb-pin")).newObject(
|
const pin = /** @type {PinElementConstructor} */(ElementFactory.getConstructor("ueb-pin")).newObject(
|
||||||
this.element.getPinEntities().find(v => !v.isHidden() && v.PinType.PinCategory === "delegate"),
|
this.element.getPinEntities().find(v => !v.isHidden() && v.PinType.PinCategory?.valueOf() === "delegate"),
|
||||||
new MinimalPinTemplate(),
|
new MinimalPinTemplate(),
|
||||||
this.element
|
this.element
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { html } from "lit"
|
import { html } from "lit"
|
||||||
import Configuration from "../../Configuration.js"
|
import Configuration from "../../Configuration.js"
|
||||||
|
import StringEntity from "../../entity/StringEntity.js"
|
||||||
import Utility from "../../Utility.js"
|
import Utility from "../../Utility.js"
|
||||||
import IInputPinTemplate from "./IInputPinTemplate.js"
|
import IInputPinTemplate from "./IInputPinTemplate.js"
|
||||||
|
|
||||||
@@ -15,11 +16,11 @@ export default class EnumPinTemplate extends IInputPinTemplate {
|
|||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
super.setup()
|
super.setup()
|
||||||
const enumEntries = this.element.nodeElement.entity.EnumEntries
|
const enumEntries = this.element.nodeElement.entity.EnumEntries.valueOf()
|
||||||
this.#dropdownEntries =
|
this.#dropdownEntries =
|
||||||
enumEntries?.map(k => {
|
enumEntries?.map(k => {
|
||||||
if (k === "") {
|
if (k.valueOf() === "") {
|
||||||
k = "None"
|
k = new StringEntity("None")
|
||||||
}
|
}
|
||||||
return [
|
return [
|
||||||
k,
|
k,
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ export default class PinTemplate extends ITemplate {
|
|||||||
case "Set": return SVGIcon.setPin
|
case "Set": return SVGIcon.setPin
|
||||||
case "Map": return SVGIcon.mapPin
|
case "Map": return SVGIcon.mapPin
|
||||||
}
|
}
|
||||||
if (this.element.entity.PinType?.PinCategory?.toLocaleLowerCase() === "delegate") {
|
if (this.element.entity.PinType?.PinCategory?.valueOf().toLocaleLowerCase() === "delegate") {
|
||||||
return SVGIcon.delegate
|
return SVGIcon.delegate
|
||||||
}
|
}
|
||||||
if (this.element.nodeElement?.template instanceof VariableOperationNodeTemplate) {
|
if (this.element.nodeElement?.template instanceof VariableOperationNodeTemplate) {
|
||||||
@@ -141,8 +141,8 @@ export default class PinTemplate extends ITemplate {
|
|||||||
|
|
||||||
isInputRendered() {
|
isInputRendered() {
|
||||||
return this.element.isInput()
|
return this.element.isInput()
|
||||||
&& !this.element.entity.bDefaultValueIsIgnored
|
&& !this.element.entity.bDefaultValueIsIgnored?.valueOf()
|
||||||
&& !this.element.entity.PinType.bIsReference
|
&& !this.element.entity.PinType.bIsReference?.valueOf()
|
||||||
}
|
}
|
||||||
|
|
||||||
renderInput() {
|
renderInput() {
|
||||||
|
|||||||
Reference in New Issue
Block a user