mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-16 13:27:34 +08:00
Fix pasted nodes links
This commit is contained in:
@@ -192,10 +192,14 @@ export default class PinElement extends IElement {
|
||||
this.entity.DefaultValue = value
|
||||
}
|
||||
|
||||
sanitizeLinks() {
|
||||
/** @param {IElement[]} nodesWhitelist */
|
||||
sanitizeLinks(nodesWhitelist = []) {
|
||||
this.entity.LinkedTo = this.getLinks().filter(pinReference => {
|
||||
let pin = this.blueprint.getPin(pinReference)
|
||||
if (pin) {
|
||||
if (nodesWhitelist.length && !nodesWhitelist.includes(pin.nodeElement)) {
|
||||
return false
|
||||
}
|
||||
let link = this.blueprint.getLink(this, pin, true)
|
||||
if (!link) {
|
||||
this.blueprint.addGraphElement(new LinkElement(this, pin))
|
||||
|
||||
Reference in New Issue
Block a user