mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:41:34 +08:00
Moving node and pins information to Configuration
This commit is contained in:
@@ -122,6 +122,13 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
return VariableOperationNodeTemplate
|
||||
}
|
||||
}
|
||||
if (nodeEntity.FunctionReference.MemberParent.path === "/Script/Engine.BlueprintSetLibrary") {
|
||||
switch (nodeEntity.FunctionReference.MemberName) {
|
||||
case "Set_Contains":
|
||||
case "Set_ToArray":
|
||||
return VariableOperationNodeTemplate
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (nodeEntity.getClass()) {
|
||||
case Configuration.nodeType.comment: return CommentNodeTemplate
|
||||
@@ -215,61 +222,7 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
}
|
||||
|
||||
getNodeDisplayName() {
|
||||
switch (this.getType()) {
|
||||
case Configuration.nodeType.callFunction:
|
||||
case Configuration.nodeType.commutativeAssociativeBinaryOperator:
|
||||
if (this.entity.FunctionReference.MemberName == "AddKey") {
|
||||
let result = this.entity.FunctionReference.MemberParent.path.match(
|
||||
ObjectEntity.sequencerScriptingNameRegex
|
||||
)
|
||||
if (result) {
|
||||
return `Add Key (${Utility.formatStringName(result[1])})`
|
||||
}
|
||||
}
|
||||
let memberName = this.entity.FunctionReference.MemberName
|
||||
if (this.entity.FunctionReference.MemberParent.path == "/Script/Engine.KismetMathLibrary") {
|
||||
if (memberName.startsWith("Conv_")) {
|
||||
return "" // Conversio nodes do not have visible names
|
||||
}
|
||||
if (memberName.startsWith("Percent_")) {
|
||||
return "%"
|
||||
}
|
||||
const leadingLetter = memberName.match(/[BF]([A-Z]\w+)/)
|
||||
if (leadingLetter) {
|
||||
// Some functions start with B or F (Like FCeil, FMax, BMin)
|
||||
memberName = leadingLetter[1]
|
||||
}
|
||||
switch (memberName) {
|
||||
case "Abs": return "ABS"
|
||||
case "Exp": return "e"
|
||||
case "Max": return "MAX"
|
||||
case "MaxInt64": return "MAX"
|
||||
case "Min": return "MIN"
|
||||
case "MinInt64": return "MIN"
|
||||
}
|
||||
}
|
||||
return Utility.formatStringName(memberName)
|
||||
case Configuration.nodeType.dynamicCast:
|
||||
return `Cast To ${this.entity.TargetType.getName()}`
|
||||
case Configuration.nodeType.executionSequence:
|
||||
return "Sequence"
|
||||
case Configuration.nodeType.ifThenElse:
|
||||
return "Branch"
|
||||
case Configuration.nodeType.forEachElementInEnum:
|
||||
return `For Each ${this.entity.Enum.getName()}`
|
||||
case Configuration.nodeType.forEachLoopWithBreak:
|
||||
return "For Each Loop with Break"
|
||||
case Configuration.nodeType.variableGet:
|
||||
return ""
|
||||
case Configuration.nodeType.variableSet:
|
||||
return "SET"
|
||||
default:
|
||||
if (this.entity.getClass() === Configuration.nodeType.macro) {
|
||||
return Utility.formatStringName(this.entity.MacroGraphReference.getMacroName())
|
||||
} else {
|
||||
return Utility.formatStringName(this.entity.getNameAndCounter()[0])
|
||||
}
|
||||
}
|
||||
return Configuration.nodeDisplayName(this)
|
||||
}
|
||||
|
||||
/** @param {Number} value */
|
||||
|
||||
Reference in New Issue
Block a user