mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-15 17:54:52 +08:00
Shorting repetitive bits
This commit is contained in:
446
dist/ueblueprint.js
vendored
446
dist/ueblueprint.js
vendored
File diff suppressed because one or more lines are too long
12
dist/ueblueprint.min.js
vendored
12
dist/ueblueprint.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,26 +1,28 @@
|
||||
import Configuration from "../Configuration.js"
|
||||
import LinearColorEntity from "../entity/LinearColorEntity.js"
|
||||
|
||||
const p = Configuration.paths
|
||||
|
||||
/** @param {ObjectEntity} entity */
|
||||
export default function nodeColor(entity) {
|
||||
switch (entity.getType()) {
|
||||
case Configuration.paths.materialExpressionConstant2Vector:
|
||||
case Configuration.paths.materialExpressionConstant3Vector:
|
||||
case Configuration.paths.materialExpressionConstant4Vector:
|
||||
case p.materialExpressionConstant2Vector:
|
||||
case p.materialExpressionConstant3Vector:
|
||||
case p.materialExpressionConstant4Vector:
|
||||
return Configuration.nodeColors.yellow
|
||||
case Configuration.paths.materialExpressionFunctionInput:
|
||||
case Configuration.paths.materialExpressionTextureCoordinate:
|
||||
case Configuration.paths.materialExpressionWorldPosition:
|
||||
case Configuration.paths.pcgEditorGraphNodeInput:
|
||||
case Configuration.paths.pcgEditorGraphNodeOutput:
|
||||
case p.materialExpressionFunctionInput:
|
||||
case p.materialExpressionTextureCoordinate:
|
||||
case p.materialExpressionWorldPosition:
|
||||
case p.pcgEditorGraphNodeInput:
|
||||
case p.pcgEditorGraphNodeOutput:
|
||||
return Configuration.nodeColors.red
|
||||
case Configuration.paths.makeStruct:
|
||||
case p.makeStruct:
|
||||
return Configuration.nodeColors.darkBlue
|
||||
case Configuration.paths.materialExpressionMaterialFunctionCall:
|
||||
case p.materialExpressionMaterialFunctionCall:
|
||||
return Configuration.nodeColors.blue
|
||||
case Configuration.paths.materialExpressionTextureSample:
|
||||
case p.materialExpressionTextureSample:
|
||||
return Configuration.nodeColors.darkTurquoise
|
||||
case Configuration.paths.niagaraNodeInput:
|
||||
case p.niagaraNodeInput:
|
||||
switch (entity["Usage"]?.toString()) {
|
||||
case "Attribute": return Configuration.nodeColors.intenseGreen
|
||||
case "Parameter": return Configuration.nodeColors.red
|
||||
@@ -31,29 +33,29 @@ export default function nodeColor(entity) {
|
||||
}
|
||||
}
|
||||
switch (entity.getClass()) {
|
||||
case Configuration.paths.niagaraNodeFunctionCall:
|
||||
case p.niagaraNodeFunctionCall:
|
||||
return Configuration.nodeColors.darkerBlue
|
||||
case Configuration.paths.dynamicCast:
|
||||
case p.dynamicCast:
|
||||
return Configuration.nodeColors.turquoise
|
||||
case Configuration.paths.inputDebugKey:
|
||||
case Configuration.paths.inputKey:
|
||||
case p.inputDebugKey:
|
||||
case p.inputKey:
|
||||
return Configuration.nodeColors.red
|
||||
case Configuration.paths.createDelegate:
|
||||
case Configuration.paths.enumLiteral:
|
||||
case Configuration.paths.makeArray:
|
||||
case Configuration.paths.makeMap:
|
||||
case Configuration.paths.materialGraphNode:
|
||||
case Configuration.paths.select:
|
||||
case p.createDelegate:
|
||||
case p.enumLiteral:
|
||||
case p.makeArray:
|
||||
case p.makeMap:
|
||||
case p.materialGraphNode:
|
||||
case p.select:
|
||||
return Configuration.nodeColors.green
|
||||
case Configuration.paths.executionSequence:
|
||||
case Configuration.paths.ifThenElse:
|
||||
case Configuration.paths.macro:
|
||||
case Configuration.paths.multiGate:
|
||||
case p.executionSequence:
|
||||
case p.ifThenElse:
|
||||
case p.macro:
|
||||
case p.multiGate:
|
||||
return Configuration.nodeColors.gray
|
||||
case Configuration.paths.functionEntry:
|
||||
case Configuration.paths.functionResult:
|
||||
case p.functionEntry:
|
||||
case p.functionResult:
|
||||
return Configuration.nodeColors.violet
|
||||
case Configuration.paths.timeline:
|
||||
case p.timeline:
|
||||
return Configuration.nodeColors.yellow
|
||||
}
|
||||
if (entity.switchTarget()) {
|
||||
|
||||
@@ -2,50 +2,52 @@ import Configuration from "../Configuration.js"
|
||||
import SVGIcon from "../SVGIcon.js"
|
||||
import nodeTitle from "./nodeTitle.js"
|
||||
|
||||
const p = Configuration.paths
|
||||
|
||||
/** @param {ObjectEntity} entity */
|
||||
export default function nodeIcon(entity) {
|
||||
if (entity.isMaterial() || entity.isPcg() || entity.isNiagara()) {
|
||||
return null
|
||||
}
|
||||
switch (entity.getType()) {
|
||||
case Configuration.paths.addDelegate:
|
||||
case Configuration.paths.asyncAction:
|
||||
case Configuration.paths.callDelegate:
|
||||
case Configuration.paths.clearDelegate:
|
||||
case Configuration.paths.createDelegate:
|
||||
case Configuration.paths.functionEntry:
|
||||
case Configuration.paths.functionResult:
|
||||
case Configuration.paths.removeDelegate:
|
||||
case p.addDelegate:
|
||||
case p.asyncAction:
|
||||
case p.callDelegate:
|
||||
case p.clearDelegate:
|
||||
case p.createDelegate:
|
||||
case p.functionEntry:
|
||||
case p.functionResult:
|
||||
case p.removeDelegate:
|
||||
return SVGIcon.node
|
||||
case Configuration.paths.customEvent: return SVGIcon.event
|
||||
case Configuration.paths.doN: return SVGIcon.doN
|
||||
case Configuration.paths.doOnce: return SVGIcon.doOnce
|
||||
case Configuration.paths.dynamicCast: return SVGIcon.cast
|
||||
case Configuration.paths.enumLiteral: return SVGIcon.enum
|
||||
case Configuration.paths.event: return SVGIcon.event
|
||||
case Configuration.paths.executionSequence:
|
||||
case Configuration.paths.multiGate:
|
||||
case p.customEvent: return SVGIcon.event
|
||||
case p.doN: return SVGIcon.doN
|
||||
case p.doOnce: return SVGIcon.doOnce
|
||||
case p.dynamicCast: return SVGIcon.cast
|
||||
case p.enumLiteral: return SVGIcon.enum
|
||||
case p.event: return SVGIcon.event
|
||||
case p.executionSequence:
|
||||
case p.multiGate:
|
||||
return SVGIcon.sequence
|
||||
case Configuration.paths.flipflop:
|
||||
case p.flipflop:
|
||||
return SVGIcon.flipflop
|
||||
case Configuration.paths.forEachElementInEnum:
|
||||
case Configuration.paths.forLoop:
|
||||
case Configuration.paths.forLoopWithBreak:
|
||||
case Configuration.paths.whileLoop:
|
||||
case p.forEachElementInEnum:
|
||||
case p.forLoop:
|
||||
case p.forLoopWithBreak:
|
||||
case p.whileLoop:
|
||||
return SVGIcon.loop
|
||||
case Configuration.paths.forEachLoop:
|
||||
case Configuration.paths.forEachLoopWithBreak:
|
||||
case p.forEachLoop:
|
||||
case p.forEachLoopWithBreak:
|
||||
return SVGIcon.forEachLoop
|
||||
case Configuration.paths.ifThenElse: return SVGIcon.branchNode
|
||||
case Configuration.paths.isValid: return SVGIcon.questionMark
|
||||
case Configuration.paths.makeArray: return SVGIcon.makeArray
|
||||
case Configuration.paths.makeMap: return SVGIcon.makeMap
|
||||
case Configuration.paths.makeSet: return SVGIcon.makeSet
|
||||
case Configuration.paths.makeStruct: return SVGIcon.makeStruct
|
||||
case Configuration.paths.metasoundEditorGraphExternalNode: return SVGIcon.metasoundFunction
|
||||
case Configuration.paths.select: return SVGIcon.select
|
||||
case Configuration.paths.spawnActorFromClass: return SVGIcon.spawnActor
|
||||
case Configuration.paths.timeline: return SVGIcon.timer
|
||||
case p.ifThenElse: return SVGIcon.branchNode
|
||||
case p.isValid: return SVGIcon.questionMark
|
||||
case p.makeArray: return SVGIcon.makeArray
|
||||
case p.makeMap: return SVGIcon.makeMap
|
||||
case p.makeSet: return SVGIcon.makeSet
|
||||
case p.makeStruct: return SVGIcon.makeStruct
|
||||
case p.metasoundEditorGraphExternalNode: return SVGIcon.metasoundFunction
|
||||
case p.select: return SVGIcon.select
|
||||
case p.spawnActorFromClass: return SVGIcon.spawnActor
|
||||
case p.timeline: return SVGIcon.timer
|
||||
}
|
||||
if (entity.switchTarget()) {
|
||||
return SVGIcon.switch
|
||||
@@ -53,7 +55,7 @@ export default function nodeIcon(entity) {
|
||||
if (nodeTitle(entity).startsWith("Break")) {
|
||||
return SVGIcon.breakStruct
|
||||
}
|
||||
if (entity.getClass() === Configuration.paths.macro) {
|
||||
if (entity.getClass() === p.macro) {
|
||||
return SVGIcon.macro
|
||||
}
|
||||
const hidValue = entity.getHIDAttribute()?.toString()
|
||||
@@ -73,7 +75,7 @@ export default function nodeIcon(entity) {
|
||||
if (entity.getDelegatePin()) {
|
||||
return SVGIcon.event
|
||||
}
|
||||
if (entity.ObjectRef?.type === Configuration.paths.ambientSound) {
|
||||
if (entity.ObjectRef?.type === p.ambientSound) {
|
||||
return SVGIcon.sound
|
||||
}
|
||||
return SVGIcon.functionSymbol
|
||||
|
||||
@@ -2,16 +2,18 @@ import Configuration from "../Configuration.js"
|
||||
import Utility from "../Utility.js"
|
||||
import pinTitle from "./pinTitle.js"
|
||||
|
||||
const p = Configuration.paths
|
||||
|
||||
/**
|
||||
* @param {ObjectEntity} entity
|
||||
* @returns {String?}
|
||||
*/
|
||||
export default function nodeSubtitle(entity) {
|
||||
switch (entity.getType()) {
|
||||
case Configuration.paths.addDelegate:
|
||||
case Configuration.paths.clearDelegate:
|
||||
case Configuration.paths.callDelegate:
|
||||
case Configuration.paths.removeDelegate:
|
||||
case p.addDelegate:
|
||||
case p.clearDelegate:
|
||||
case p.callDelegate:
|
||||
case p.removeDelegate:
|
||||
return null
|
||||
}
|
||||
const targetPin = entity
|
||||
|
||||
@@ -71,7 +71,7 @@ const niagaraOperationNodes = [
|
||||
"Vector3::Cross",
|
||||
]
|
||||
|
||||
const paths = Configuration.paths
|
||||
const p = Configuration.paths
|
||||
|
||||
/**
|
||||
* @param {ObjectEntity} nodeEntity
|
||||
@@ -80,18 +80,18 @@ const paths = Configuration.paths
|
||||
export default function nodeTemplateClass(nodeEntity) {
|
||||
const className = nodeEntity.getClass()
|
||||
if (
|
||||
className === paths.callFunction
|
||||
|| className === paths.commutativeAssociativeBinaryOperator
|
||||
|| className === paths.callArrayFunction
|
||||
className === p.callFunction
|
||||
|| className === p.commutativeAssociativeBinaryOperator
|
||||
|| className === p.callArrayFunction
|
||||
) {
|
||||
const memberParent = nodeEntity.FunctionReference?.MemberParent?.path ?? ""
|
||||
const memberName = nodeEntity.FunctionReference?.MemberName?.toString()
|
||||
if (
|
||||
memberName && (
|
||||
memberParent === paths.kismetArrayLibrary
|
||||
|| memberParent === paths.kismetMathLibrary
|
||||
|| memberParent === paths.kismetStringLibrary
|
||||
|| memberParent === paths.typedElementHandleLibrary
|
||||
memberParent === p.kismetArrayLibrary
|
||||
|| memberParent === p.kismetMathLibrary
|
||||
|| memberParent === p.kismetStringLibrary
|
||||
|| memberParent === p.typedElementHandleLibrary
|
||||
)) {
|
||||
if (memberName.startsWith("Conv_")) {
|
||||
return VariableConversionNodeTemplate
|
||||
@@ -145,37 +145,37 @@ export default function nodeTemplateClass(nodeEntity) {
|
||||
return VariableOperationNodeTemplate
|
||||
}
|
||||
}
|
||||
if (memberParent === paths.blueprintSetLibrary) {
|
||||
if (memberParent === p.blueprintSetLibrary) {
|
||||
return VariableOperationNodeTemplate
|
||||
}
|
||||
if (memberParent === paths.blueprintMapLibrary) {
|
||||
if (memberParent === p.blueprintMapLibrary) {
|
||||
return VariableOperationNodeTemplate
|
||||
}
|
||||
}
|
||||
switch (className) {
|
||||
case paths.comment:
|
||||
case paths.materialGraphNodeComment:
|
||||
case p.comment:
|
||||
case p.materialGraphNodeComment:
|
||||
return CommentNodeTemplate
|
||||
case paths.createDelegate:
|
||||
case p.createDelegate:
|
||||
return NodeTemplate
|
||||
case paths.metasoundEditorGraphExternalNode:
|
||||
case p.metasoundEditorGraphExternalNode:
|
||||
if (nodeEntity["ClassName"]?.["Name"] == "Add") {
|
||||
return MetasoundOperationTemplate
|
||||
}
|
||||
return MetasoundNodeTemplate
|
||||
case paths.niagaraNodeOp:
|
||||
case p.niagaraNodeOp:
|
||||
if (niagaraOperationNodes.includes(nodeEntity.OpName?.toString())) {
|
||||
return VariableOperationNodeTemplate
|
||||
}
|
||||
break
|
||||
case paths.promotableOperator:
|
||||
case p.promotableOperator:
|
||||
return VariableOperationNodeTemplate
|
||||
case paths.knot:
|
||||
case p.knot:
|
||||
return KnotNodeTemplate
|
||||
case paths.literal:
|
||||
case paths.self:
|
||||
case paths.variableGet:
|
||||
case paths.variableSet:
|
||||
case p.literal:
|
||||
case p.self:
|
||||
case p.variableGet:
|
||||
case p.variableSet:
|
||||
return VariableAccessNodeTemplate
|
||||
}
|
||||
if (nodeEntity.isEvent()) {
|
||||
|
||||
@@ -5,7 +5,6 @@ import LinearColorEntity from "../entity/LinearColorEntity.js"
|
||||
import MirroredEntity from "../entity/MirroredEntity.js"
|
||||
import VectorEntity from "../entity/VectorEntity.js"
|
||||
|
||||
const paths = Configuration.paths
|
||||
const sequencerScriptingNameRegex = /\/Script\/SequencerScripting\.MovieSceneScripting(.+)Channel/
|
||||
const keyNameValue = {
|
||||
"A_AccentGrave": "à",
|
||||
@@ -95,6 +94,8 @@ const niagaraNodeNames = {
|
||||
"TWO_PI": `2 ${String.fromCharCode(0x03C0)}`,
|
||||
}).map(([k, v]) => ["Numeric::" + k, v])),
|
||||
}
|
||||
const p = Configuration.paths
|
||||
const format = Utility.formatStringName
|
||||
|
||||
/** @param {String} value */
|
||||
function numberFromText(value = "") {
|
||||
@@ -139,58 +140,58 @@ function keyName(value) {
|
||||
export default function nodeTitle(entity) {
|
||||
let value
|
||||
switch (entity.getType()) {
|
||||
case paths.addDelegate:
|
||||
case p.addDelegate:
|
||||
value ??= "Bind Event to "
|
||||
case paths.clearDelegate:
|
||||
case p.clearDelegate:
|
||||
value ??= "Unbind all Events from "
|
||||
case paths.removeDelegate:
|
||||
case p.removeDelegate:
|
||||
value ??= "Unbind Event from "
|
||||
return value + Utility.formatStringName(
|
||||
return value + format(
|
||||
entity.DelegateReference?.MemberName?.toString().replace(/Delegate$/, "") ?? "None"
|
||||
)
|
||||
case paths.asyncAction:
|
||||
case p.asyncAction:
|
||||
if (entity.ProxyFactoryFunctionName) {
|
||||
return Utility.formatStringName(entity.ProxyFactoryFunctionName?.toString())
|
||||
return format(entity.ProxyFactoryFunctionName?.toString())
|
||||
}
|
||||
case paths.actorBoundEvent:
|
||||
case paths.componentBoundEvent:
|
||||
return `${Utility.formatStringName(entity.DelegatePropertyName?.toString())} (${entity.ComponentPropertyName?.toString() ?? "Unknown"})`
|
||||
case paths.callDelegate:
|
||||
case p.actorBoundEvent:
|
||||
case p.componentBoundEvent:
|
||||
return `${format(entity.DelegatePropertyName?.toString())} (${entity.ComponentPropertyName?.toString() ?? "Unknown"})`
|
||||
case p.callDelegate:
|
||||
return `Call ${entity.DelegateReference?.MemberName?.toString() ?? "None"}`
|
||||
case paths.createDelegate:
|
||||
case p.createDelegate:
|
||||
return "Create Event"
|
||||
case paths.customEvent:
|
||||
case p.customEvent:
|
||||
if (entity.CustomFunctionName) {
|
||||
return entity.CustomFunctionName?.toString()
|
||||
}
|
||||
case paths.dynamicCast:
|
||||
case p.dynamicCast:
|
||||
if (!entity.TargetType) {
|
||||
return "Bad cast node" // Target type not found
|
||||
}
|
||||
return `Cast To ${entity.TargetType?.getName()}`
|
||||
case paths.enumLiteral:
|
||||
case p.enumLiteral:
|
||||
return `Literal enum ${entity.Enum?.getName()}`
|
||||
case paths.event:
|
||||
case p.event:
|
||||
return `Event ${(entity.EventReference?.MemberName?.toString() ?? "").replace(/^Receive/, "")}`
|
||||
case paths.executionSequence:
|
||||
case p.executionSequence:
|
||||
return "Sequence"
|
||||
case paths.forEachElementInEnum:
|
||||
case p.forEachElementInEnum:
|
||||
return `For Each ${entity.Enum?.getName()}`
|
||||
case paths.forEachLoopWithBreak:
|
||||
case p.forEachLoopWithBreak:
|
||||
return "For Each Loop with Break"
|
||||
case paths.functionEntry:
|
||||
case p.functionEntry:
|
||||
return entity.FunctionReference?.MemberName?.toString() === "UserConstructionScript"
|
||||
? "Construction Script"
|
||||
: entity.FunctionReference?.MemberName?.toString()
|
||||
case paths.functionResult:
|
||||
case p.functionResult:
|
||||
return "Return Node"
|
||||
case paths.ifThenElse:
|
||||
case p.ifThenElse:
|
||||
return "Branch"
|
||||
case paths.makeStruct:
|
||||
case p.makeStruct:
|
||||
if (entity.StructType) {
|
||||
return `Make ${entity.StructType.getName()}`
|
||||
}
|
||||
case paths.materialExpressionComponentMask: {
|
||||
case p.materialExpressionComponentMask: {
|
||||
const materialObject = entity.getMaterialSubobject()
|
||||
if (materialObject) {
|
||||
return `Mask ( ${Configuration.rgba
|
||||
@@ -199,15 +200,15 @@ export default function nodeTitle(entity) {
|
||||
.join("")})`
|
||||
}
|
||||
}
|
||||
case paths.materialExpressionConstant:
|
||||
case p.materialExpressionConstant:
|
||||
value ??= [entity.getCustomproperties().find(pinEntity => pinEntity.PinName.toString() == "Value")?.DefaultValue]
|
||||
case paths.materialExpressionConstant2Vector:
|
||||
case p.materialExpressionConstant2Vector:
|
||||
value ??= [
|
||||
entity.getCustomproperties().find(pinEntity => pinEntity.PinName?.toString() == "X")?.DefaultValue,
|
||||
entity.getCustomproperties().find(pinEntity => pinEntity.PinName?.toString() == "Y")?.DefaultValue,
|
||||
]
|
||||
case paths.materialExpressionConstant3Vector:
|
||||
case paths.materialExpressionConstant4Vector:
|
||||
case p.materialExpressionConstant3Vector:
|
||||
case p.materialExpressionConstant4Vector:
|
||||
if (!value) {
|
||||
const vector = entity.getCustomproperties()
|
||||
.find(pinEntity => pinEntity.PinName?.toString() == "Constant")
|
||||
@@ -221,32 +222,32 @@ export default function nodeTitle(entity) {
|
||||
}
|
||||
value = undefined
|
||||
break
|
||||
case paths.materialExpressionFunctionInput: {
|
||||
case p.materialExpressionFunctionInput: {
|
||||
const materialObject = entity.getMaterialSubobject()
|
||||
const inputName = materialObject?.InputName ?? "In"
|
||||
const inputType = materialObject?.InputType?.value.match(/^.+?_(\w+)$/)?.[1] ?? "Vector3"
|
||||
return `Input ${inputName} (${inputType})`
|
||||
}
|
||||
case paths.materialExpressionLogarithm:
|
||||
case p.materialExpressionLogarithm:
|
||||
return "Ln"
|
||||
case paths.materialExpressionLogarithm10:
|
||||
case p.materialExpressionLogarithm10:
|
||||
return "Log10"
|
||||
case paths.materialExpressionLogarithm2:
|
||||
case p.materialExpressionLogarithm2:
|
||||
return "Log2"
|
||||
case paths.materialExpressionMaterialFunctionCall:
|
||||
case p.materialExpressionMaterialFunctionCall:
|
||||
const materialFunction = entity.getMaterialSubobject()?.MaterialFunction
|
||||
if (materialFunction) {
|
||||
return materialFunction.getName()
|
||||
}
|
||||
break
|
||||
case paths.materialExpressionSquareRoot:
|
||||
case p.materialExpressionSquareRoot:
|
||||
return "Sqrt"
|
||||
case paths.materialExpressionSubtract:
|
||||
case p.materialExpressionSubtract:
|
||||
const materialObject = entity.getMaterialSubobject()
|
||||
if (materialObject) {
|
||||
return `Subtract(${materialObject.ConstA ?? "1"},${materialObject.ConstB ?? "1"})`
|
||||
}
|
||||
case paths.metasoundEditorGraphExternalNode: {
|
||||
case p.metasoundEditorGraphExternalNode: {
|
||||
const name = entity["ClassName"]?.["Name"]
|
||||
if (name) {
|
||||
switch (name) {
|
||||
@@ -255,7 +256,7 @@ export default function nodeTitle(entity) {
|
||||
}
|
||||
}
|
||||
}
|
||||
case paths.niagaraNodeConvert:
|
||||
case p.niagaraNodeConvert:
|
||||
/** @type {String} */
|
||||
const targetType = (entity["AutowireMakeType"]?.["ClassStructOrEnum"] ?? "")
|
||||
.toString()
|
||||
@@ -263,11 +264,11 @@ export default function nodeTitle(entity) {
|
||||
?.[1]
|
||||
?? ""
|
||||
return `Make ${targetType}`
|
||||
case paths.pcgEditorGraphNodeInput:
|
||||
case p.pcgEditorGraphNodeInput:
|
||||
return "Input"
|
||||
case paths.pcgEditorGraphNodeOutput:
|
||||
case p.pcgEditorGraphNodeOutput:
|
||||
return "Output"
|
||||
case paths.spawnActorFromClass:
|
||||
case p.spawnActorFromClass:
|
||||
let className = entity.getCustomproperties()
|
||||
.find(pinEntity => pinEntity.PinName.toString() == "ReturnValue")
|
||||
?.PinType
|
||||
@@ -276,21 +277,21 @@ export default function nodeTitle(entity) {
|
||||
if (className === "Actor") {
|
||||
className = null
|
||||
}
|
||||
return `SpawnActor ${Utility.formatStringName(className ?? "NONE")}`
|
||||
case paths.switchEnum:
|
||||
return `SpawnActor ${format(className ?? "NONE")}`
|
||||
case p.switchEnum:
|
||||
return `Switch on ${entity.Enum?.getName() ?? "Enum"}`
|
||||
case paths.switchInteger:
|
||||
case p.switchInteger:
|
||||
return `Switch on Int`
|
||||
case paths.variableGet:
|
||||
case p.variableGet:
|
||||
return ""
|
||||
case paths.variableSet:
|
||||
case p.variableSet:
|
||||
return "SET"
|
||||
}
|
||||
const className = entity.getClass()
|
||||
let switchTarget = entity.switchTarget()
|
||||
if (switchTarget) {
|
||||
if (switchTarget[0] !== "E") {
|
||||
switchTarget = Utility.formatStringName(switchTarget)
|
||||
switchTarget = format(switchTarget)
|
||||
}
|
||||
return `Switch on ${switchTarget}`
|
||||
}
|
||||
@@ -300,16 +301,16 @@ export default function nodeTitle(entity) {
|
||||
const keyNameSymbol = entity.getHIDAttribute()
|
||||
if (keyNameSymbol) {
|
||||
const name = keyNameSymbol.toString()
|
||||
let title = keyName(name) ?? Utility.formatStringName(name)
|
||||
if (className === paths.inputDebugKey) {
|
||||
let title = keyName(name) ?? format(name)
|
||||
if (className === p.inputDebugKey) {
|
||||
title = "Debug Key " + title
|
||||
} else if (className === paths.getInputAxisKeyValue) {
|
||||
} else if (className === p.getInputAxisKeyValue) {
|
||||
title = "Get " + title
|
||||
}
|
||||
return title
|
||||
}
|
||||
if (className === paths.macro) {
|
||||
return Utility.formatStringName(entity.MacroGraphReference?.getMacroName())
|
||||
if (className === p.macro) {
|
||||
return format(entity.MacroGraphReference?.getMacroName())
|
||||
}
|
||||
const materialSubobject = entity.getMaterialSubobject()
|
||||
if (materialSubobject) {
|
||||
@@ -328,19 +329,19 @@ export default function nodeTitle(entity) {
|
||||
}
|
||||
const settingsObject = entity.getSettingsObject()
|
||||
if (settingsObject) {
|
||||
if (settingsObject.ExportPath?.valueOf()?.type === paths.pcgHiGenGridSizeSettings) {
|
||||
if (settingsObject.ExportPath?.valueOf()?.type === p.pcgHiGenGridSizeSettings) {
|
||||
return `Grid Size: ${(
|
||||
settingsObject.HiGenGridSize?.toString().match(/\d+/)?.[0]?.concat("00")
|
||||
?? settingsObject.HiGenGridSize?.toString().match(/^\w+$/)?.[0]
|
||||
) ?? "256"}`
|
||||
}
|
||||
if (settingsObject.BlueprintElementInstance) {
|
||||
return Utility.formatStringName(settingsObject.BlueprintElementType.getName())
|
||||
return format(settingsObject.BlueprintElementType.getName())
|
||||
}
|
||||
if (settingsObject.Operation) {
|
||||
const match = settingsObject.Name?.toString().match(/PCGMetadata(\w+)Settings_\d+/)
|
||||
if (match) {
|
||||
return Utility.formatStringName(match[1] + ": " + settingsObject.Operation)
|
||||
return format(match[1] + ": " + settingsObject.Operation)
|
||||
}
|
||||
}
|
||||
const settingsSubgraphObject = settingsObject.getSubgraphObject()
|
||||
@@ -355,7 +356,7 @@ export default function nodeTitle(entity) {
|
||||
case "AddKey":
|
||||
let result = memberParent.match(sequencerScriptingNameRegex)
|
||||
if (result) {
|
||||
return `Add Key (${Utility.formatStringName(result[1])})`
|
||||
return `Add Key (${format(result[1])})`
|
||||
}
|
||||
case "Concat_StrStr":
|
||||
return "Append"
|
||||
@@ -366,16 +367,16 @@ export default function nodeTitle(entity) {
|
||||
+ (memberNameTraceLineMatch[1] === "Multi" ? " Multi " : " ")
|
||||
+ (memberNameTraceLineMatch[2] === ""
|
||||
? "By Channel"
|
||||
: Utility.formatStringName(memberNameTraceLineMatch[2])
|
||||
: format(memberNameTraceLineMatch[2])
|
||||
)
|
||||
}
|
||||
switch (memberParent) {
|
||||
case paths.blueprintGameplayTagLibrary:
|
||||
case paths.kismetMathLibrary:
|
||||
case paths.kismetStringLibrary:
|
||||
case paths.slateBlueprintLibrary:
|
||||
case paths.timeManagementBlueprintLibrary:
|
||||
case paths.typedElementHandleLibrary:
|
||||
case p.blueprintGameplayTagLibrary:
|
||||
case p.kismetMathLibrary:
|
||||
case p.kismetStringLibrary:
|
||||
case p.slateBlueprintLibrary:
|
||||
case p.timeManagementBlueprintLibrary:
|
||||
case p.typedElementHandleLibrary:
|
||||
const leadingLetter = memberName.match(/[BF]([A-Z]\w+)/)
|
||||
if (leadingLetter) {
|
||||
// Some functions start with B or F (Like FCeil, FMax, BMin)
|
||||
@@ -460,23 +461,23 @@ export default function nodeTitle(entity) {
|
||||
return "^"
|
||||
}
|
||||
break
|
||||
case paths.blueprintSetLibrary:
|
||||
case p.blueprintSetLibrary:
|
||||
{
|
||||
const setOperationMatch = memberName.match(/Set_(\w+)/)
|
||||
if (setOperationMatch) {
|
||||
return Utility.formatStringName(setOperationMatch[1]).toUpperCase()
|
||||
return format(setOperationMatch[1]).toUpperCase()
|
||||
}
|
||||
}
|
||||
break
|
||||
case paths.blueprintMapLibrary:
|
||||
case p.blueprintMapLibrary:
|
||||
{
|
||||
const setOperationMatch = memberName.match(/Map_(\w+)/)
|
||||
if (setOperationMatch) {
|
||||
return Utility.formatStringName(setOperationMatch[1]).toUpperCase()
|
||||
return format(setOperationMatch[1]).toUpperCase()
|
||||
}
|
||||
}
|
||||
break
|
||||
case paths.kismetArrayLibrary:
|
||||
case p.kismetArrayLibrary:
|
||||
{
|
||||
const arrayOperationMath = memberName.match(/Array_(\w+)/)
|
||||
if (arrayOperationMath) {
|
||||
@@ -485,14 +486,14 @@ export default function nodeTitle(entity) {
|
||||
}
|
||||
break
|
||||
}
|
||||
return Utility.formatStringName(memberName)
|
||||
return format(memberName)
|
||||
}
|
||||
if (entity.OpName) {
|
||||
return niagaraNodeNames[entity.OpName.toString()]
|
||||
?? Utility.formatStringName(entity.OpName.toString().replaceAll(/(?:^\w+(?<!^Matrix))?::/g, " "))
|
||||
?? format(entity.OpName.toString().replaceAll(/(?:^\w+(?<!^Matrix))?::/g, " "))
|
||||
}
|
||||
if (entity.FunctionDisplayName) {
|
||||
return Utility.formatStringName(entity.FunctionDisplayName.toString())
|
||||
return format(entity.FunctionDisplayName.toString())
|
||||
}
|
||||
if (entity.ObjectRef) {
|
||||
return entity.ObjectRef.getName()
|
||||
@@ -502,10 +503,10 @@ export default function nodeTitle(entity) {
|
||||
className.startsWith(prefix = "/Script/NiagaraEditor.NiagaraNodeParameter")
|
||||
|| className.startsWith(prefix = "/Script/NiagaraEditor.NiagaraNode")
|
||||
) {
|
||||
return entity["Input"]?.["Name"]?.toString() ?? Utility.formatStringName(className.substring(prefix.length))
|
||||
return entity["Input"]?.["Name"]?.toString() ?? format(className.substring(prefix.length))
|
||||
}
|
||||
if (entity.ParameterName) {
|
||||
return entity.ParameterName.toString()
|
||||
}
|
||||
return Utility.formatStringName(entity.getNameAndCounter()[0])
|
||||
return format(entity.getNameAndCounter()[0])
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import StringEntity from "../entity/StringEntity.js"
|
||||
/** @param {PinEntity} pinEntity */
|
||||
const indexFromUpperCaseLetterName = pinEntity =>
|
||||
pinEntity.PinName?.toString().match(/^\s*([A-Z])\s*$/)?.[1]?.charCodeAt(0) - "A".charCodeAt(0)
|
||||
const p = Configuration.paths
|
||||
|
||||
/** @param {ObjectEntity} entity */
|
||||
export default function nodeVariadic(entity) {
|
||||
@@ -21,8 +22,8 @@ export default function nodeVariadic(entity) {
|
||||
let prefix
|
||||
let name
|
||||
switch (type) {
|
||||
case Configuration.paths.commutativeAssociativeBinaryOperator:
|
||||
case Configuration.paths.promotableOperator:
|
||||
case p.commutativeAssociativeBinaryOperator:
|
||||
case p.promotableOperator:
|
||||
name = entity.FunctionReference?.MemberName?.toString()
|
||||
switch (name) {
|
||||
default:
|
||||
@@ -60,9 +61,9 @@ export default function nodeVariadic(entity) {
|
||||
break
|
||||
}
|
||||
break
|
||||
case Configuration.paths.executionSequence:
|
||||
case p.executionSequence:
|
||||
prefix ??= "Then"
|
||||
case Configuration.paths.multiGate:
|
||||
case p.multiGate:
|
||||
prefix ??= "Out"
|
||||
pinEntities ??= () => entity.getPinEntities().filter(pinEntity => pinEntity.isOutput())
|
||||
pinIndexFromEntity ??= pinEntity => Number(
|
||||
@@ -71,7 +72,7 @@ export default function nodeVariadic(entity) {
|
||||
pinNameFromIndex ??= (index, min = -1, max = -1, newPin) =>
|
||||
`${prefix} ${index >= 0 ? index : min > 0 ? `${prefix} 0` : max + 1}`
|
||||
break
|
||||
// case Configuration.paths.niagaraNodeOp:
|
||||
// case p.niagaraNodeOp:
|
||||
// pinEntities ??= () => entity.getPinEntities().filter(pinEntity => pinEntity.isInput())
|
||||
// pinIndexFromEntity ??= indexFromUpperCaseLetterName
|
||||
// pinNameFromIndex ??= (index, min = -1, max = -1, newPin) => {
|
||||
@@ -81,12 +82,12 @@ export default function nodeVariadic(entity) {
|
||||
// return result
|
||||
// }
|
||||
// break
|
||||
case Configuration.paths.switchInteger:
|
||||
case p.switchInteger:
|
||||
pinEntities ??= () => entity.getPinEntities().filter(pinEntity => pinEntity.isOutput())
|
||||
pinIndexFromEntity ??= pinEntity => Number(pinEntity.PinName?.toString().match(/^\s*(\d+)\s*$/)?.[1])
|
||||
pinNameFromIndex ??= (index, min = -1, max = -1, newPin) => (index < 0 ? max + 1 : index).toString()
|
||||
break
|
||||
case Configuration.paths.switchGameplayTag:
|
||||
case p.switchGameplayTag:
|
||||
pinNameFromIndex ??= (index, min = -1, max = -1, newPin) => {
|
||||
const result = `Case_${index >= 0 ? index : min > 0 ? "0" : max + 1}`
|
||||
entity.PinNames ??= new ArrayEntity()
|
||||
@@ -95,8 +96,8 @@ export default function nodeVariadic(entity) {
|
||||
entity.PinTags.valueOf()[entity.PinTags.length] = null
|
||||
return result
|
||||
}
|
||||
case Configuration.paths.switchName:
|
||||
case Configuration.paths.switchString:
|
||||
case p.switchName:
|
||||
case p.switchString:
|
||||
pinEntities ??= () => entity.getPinEntities().filter(pinEntity => pinEntity.isOutput())
|
||||
pinIndexFromEntity ??= pinEntity => Number(pinEntity.PinName.toString().match(/^\s*Case[_\s]+(\d+)\s*$/i)?.[1])
|
||||
pinNameFromIndex ??= (index, min = -1, max = -1, newPin) => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { css } from "lit"
|
||||
import Configuration from "../Configuration.js"
|
||||
|
||||
const p = Configuration.paths
|
||||
const colors = {
|
||||
"Any": css`132, 132, 132`,
|
||||
"Any[]": css`132, 132, 132`,
|
||||
@@ -36,21 +37,21 @@ const colors = {
|
||||
"Volume": css`230, 69, 188`,
|
||||
"Volume[]": css`230, 69, 188`,
|
||||
"wildcard": css`128, 120, 120`,
|
||||
[Configuration.paths.linearColor]: css`0, 88, 200`,
|
||||
[Configuration.paths.niagaraBool]: css`146, 0, 0`,
|
||||
[Configuration.paths.niagaraDataInterfaceCollisionQuery]: css`0, 168, 242`,
|
||||
[Configuration.paths.niagaraDataInterfaceCurlNoise]: css`0, 168, 242`,
|
||||
[Configuration.paths.niagaraDataInterfaceVolumeTexture]: css`0, 168, 242`,
|
||||
[Configuration.paths.niagaraFloat]: css`160, 250, 68`,
|
||||
[Configuration.paths.niagaraInt32]: css`30, 224, 172`,
|
||||
[Configuration.paths.niagaraPosition]: css`251, 146, 251`,
|
||||
[Configuration.paths.quat4f]: css`0, 88, 200`,
|
||||
[Configuration.paths.rotator]: css`157, 177, 251`,
|
||||
[Configuration.paths.transform]: css`227, 103, 0`,
|
||||
[Configuration.paths.vector]: css`251, 198, 34`,
|
||||
[Configuration.paths.vector2f]: css`0, 88, 200`,
|
||||
[Configuration.paths.vector3f]: css`250, 200, 36`,
|
||||
[Configuration.paths.vector4f]: css`0, 88, 200`,
|
||||
[p.linearColor]: css`0, 88, 200`,
|
||||
[p.niagaraBool]: css`146, 0, 0`,
|
||||
[p.niagaraDataInterfaceCollisionQuery]: css`0, 168, 242`,
|
||||
[p.niagaraDataInterfaceCurlNoise]: css`0, 168, 242`,
|
||||
[p.niagaraDataInterfaceVolumeTexture]: css`0, 168, 242`,
|
||||
[p.niagaraFloat]: css`160, 250, 68`,
|
||||
[p.niagaraInt32]: css`30, 224, 172`,
|
||||
[p.niagaraPosition]: css`251, 146, 251`,
|
||||
[p.quat4f]: css`0, 88, 200`,
|
||||
[p.rotator]: css`157, 177, 251`,
|
||||
[p.transform]: css`227, 103, 0`,
|
||||
[p.vector]: css`251, 198, 34`,
|
||||
[p.vector2f]: css`0, 88, 200`,
|
||||
[p.vector3f]: css`250, 200, 36`,
|
||||
[p.vector4f]: css`0, 88, 200`,
|
||||
}
|
||||
|
||||
const pinColorMaterial = css`120, 120, 120`
|
||||
|
||||
@@ -17,6 +17,7 @@ import Vector4DPinTemplate from "../template/pin/Vector4DPinTemplate.js"
|
||||
import VectorPinTemplate from "../template/pin/VectorPinTemplate.js"
|
||||
import pinTitle from "./pinTitle.js"
|
||||
|
||||
const p = Configuration.paths
|
||||
const inputPinTemplates = {
|
||||
"bool": BoolPinTemplate,
|
||||
"byte": IntPinTemplate,
|
||||
@@ -29,17 +30,17 @@ const inputPinTemplates = {
|
||||
"real": RealPinTemplate,
|
||||
"rg": Vector2DPinTemplate,
|
||||
"string": StringPinTemplate,
|
||||
[Configuration.paths.linearColor]: LinearColorPinTemplate,
|
||||
[Configuration.paths.niagaraBool]: BoolPinTemplate,
|
||||
[Configuration.paths.niagaraFloat]: RealPinTemplate,
|
||||
[Configuration.paths.niagaraInt32]: IntPinTemplate,
|
||||
[Configuration.paths.niagaraPosition]: VectorPinTemplate,
|
||||
[Configuration.paths.rotator]: RotatorPinTemplate,
|
||||
[Configuration.paths.vector]: VectorPinTemplate,
|
||||
[Configuration.paths.vector2D]: Vector2DPinTemplate,
|
||||
[Configuration.paths.vector2f]: Vector2DPinTemplate,
|
||||
[Configuration.paths.vector3f]: VectorPinTemplate,
|
||||
[Configuration.paths.vector4f]: Vector4DPinTemplate,
|
||||
[p.linearColor]: LinearColorPinTemplate,
|
||||
[p.niagaraBool]: BoolPinTemplate,
|
||||
[p.niagaraFloat]: RealPinTemplate,
|
||||
[p.niagaraInt32]: IntPinTemplate,
|
||||
[p.niagaraPosition]: VectorPinTemplate,
|
||||
[p.rotator]: RotatorPinTemplate,
|
||||
[p.vector]: VectorPinTemplate,
|
||||
[p.vector2D]: Vector2DPinTemplate,
|
||||
[p.vector2f]: Vector2DPinTemplate,
|
||||
[p.vector3f]: VectorPinTemplate,
|
||||
[p.vector4f]: Vector4DPinTemplate,
|
||||
}
|
||||
|
||||
/** @param {PinEntity<IEntity>} entity */
|
||||
|
||||
Reference in New Issue
Block a user