mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-23 23:34:43 +08:00
Required mark for PCG pins
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -79,8 +79,12 @@ export default class PinTemplate extends ITemplate {
|
||||
${this.isInputRendered() ? this.renderInput() : html``}
|
||||
</div>
|
||||
`
|
||||
let pcgSubobject = this.element.nodeElement.entity.getPcgSubobject()
|
||||
return html`
|
||||
<div class="ueb-pin-wrapper">
|
||||
${pcgSubobject && this.element.entity.getPinObject(pcgSubobject)?.["Properties"]?.["PinStatus"] == "Required"
|
||||
? html`<div class="ueb-pin-required-mark"></div>`
|
||||
: nothing}
|
||||
${this.element.isInput() ? html`${icon}${content}` : html`${content}${icon}`}
|
||||
</div>
|
||||
`
|
||||
@@ -115,13 +119,13 @@ export default class PinTemplate extends ITemplate {
|
||||
case "Set": return SVGIcon.setPin
|
||||
case "Map": return SVGIcon.mapPin
|
||||
}
|
||||
if (this.element.entity.PinType.PinCategory?.toString().toLocaleLowerCase() === "delegate") {
|
||||
if (this.element.entity.PinType.PinCategory?.toString().toLocaleLowerCase() == "delegate") {
|
||||
return SVGIcon.delegate
|
||||
}
|
||||
if (this.element.nodeElement?.template instanceof VariableOperationNodeTemplate) {
|
||||
return SVGIcon.operationPin
|
||||
}
|
||||
if (this.element.entity.PinType.PinCategory?.toString().toLocaleLowerCase() === "statictype") {
|
||||
if (this.element.entity.PinType.PinCategory?.toString().toLocaleLowerCase() == "statictype") {
|
||||
return SVGIcon.staticPin
|
||||
}
|
||||
return SVGIcon.genericPin
|
||||
|
||||
Reference in New Issue
Block a user