mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-14 09:10:39 +08:00
Fixes #28
This commit is contained in:
25
js/decoding/nodeSubtitle.js
Normal file
25
js/decoding/nodeSubtitle.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import Configuration from "../Configuration.js"
|
||||
import Utility from "../Utility.js"
|
||||
import pinTitle from "./pinTitle.js"
|
||||
|
||||
/**
|
||||
* @param {ObjectEntity} entity
|
||||
* @returns {String?}
|
||||
*/
|
||||
export default function nodeSubtitle(entity) {
|
||||
switch (entity.getType()) {
|
||||
case Configuration.paths.addDelegate:
|
||||
case Configuration.paths.clearDelegate:
|
||||
return null
|
||||
}
|
||||
const targetPin = entity
|
||||
.getPinEntities()
|
||||
.find(pin => pin.PinName?.toString() === "self" && pinTitle(pin) === "Target")
|
||||
if (targetPin) {
|
||||
const target = entity.FunctionReference?.MemberParent?.getName()
|
||||
?? targetPin.PinType?.PinSubCategoryObject?.getName()
|
||||
?? "Untitled"
|
||||
return target.length > 0 ? `Target is ${Utility.formatStringName(target)}` : null
|
||||
}
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user