Required mark for PCG pins

This commit is contained in:
barsdeveloper
2025-04-03 23:40:52 +03:00
parent 5ef585eb34
commit fb7fc9fc66
12 changed files with 159 additions and 30 deletions

View File

@@ -186,13 +186,9 @@ export default class PinEntity extends IEntity {
}
if (this.objectEntity?.isPcg()) {
const pcgSuboject = this.objectEntity.getPcgSubobject()
const pinObjectReference = this.isInput()
? pcgSuboject.InputPins?.valueOf()[this.pinIndex]
: pcgSuboject.OutputPins?.valueOf()[this.pinIndex]
if (pinObjectReference) {
/** @type {ObjectEntity} */
const pinObject = pcgSuboject[Configuration.subObjectAttributeNameFromReference(pinObjectReference, true)]
let allowedTypes = pinObject.Properties?.AllowedTypes?.toString() ?? ""
const pinObject = this.getPinObject(pcgSuboject)
if (pinObject) {
let allowedTypes = pinObject["Properties"]?.AllowedTypes?.toString() ?? ""
if (allowedTypes == "") {
allowedTypes = this.PinType.PinCategory ?? ""
if (allowedTypes == "") {
@@ -201,8 +197,8 @@ export default class PinEntity extends IEntity {
}
if (allowedTypes) {
if (
pinObject.Properties.bAllowMultipleData?.valueOf() !== false
&& pinObject.Properties.bAllowMultipleConnections?.valueOf() !== false
pinObject["Properties"].bAllowMultipleData?.valueOf() !== false
&& pinObject["Properties"].bAllowMultipleConnections?.valueOf() !== false
) {
allowedTypes += "[]"
}
@@ -319,6 +315,17 @@ export default class PinEntity extends IEntity {
return false
}
/** @param {ObjectEntity} pcgSuboject */
getPinObject(pcgSuboject) {
const pinObjectReference = this.isInput()
? pcgSuboject.InputPins?.valueOf()[this.pinIndex]
: pcgSuboject.OutputPins?.valueOf()[this.pinIndex]
if (pinObjectReference) {
/** @type {ObjectEntity} */
return pcgSuboject[Configuration.subObjectAttributeNameFromReference(pinObjectReference, true)]
}
}
getSubCategory() {
return this.PinType.PinSubCategoryObject?.path
}