mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-03 23:55:04 +08:00
* Fix node reference when changing elements * Fix ScriptVariables parsing * Fix invariant text and niagara types * Niagara convert nodes * Move node tests to own files * More Niagara tests * Niagara float and smaller fixes * More Decoding * More decoding * WIP * Float is real * WIP * More types and colors * Test case and small polish * WIP * WIP * Fix niagara script variables merging * Fix Niagara variables * Fixing mirrored ExportPath * Fix Export paths name adjustments * Simplify arc calculation * Simplify a bit arc calculation * source / destionation => origin / target * Minor refactoring * Fix switched link position * Rename some properties for uniformity * Fix input escape * Simplify test * About window * Dialog backdrop style * About dialog touches * Remove dependency and minot improvement * Light mode * Fix link location and css small improvement * Link direction and minor fixes * Some minor fixes and refactoring * Refactoring WIP * Shorting repetitive bits * More tests * Simplify linking tests
91 lines
3.4 KiB
JavaScript
Executable File
91 lines
3.4 KiB
JavaScript
Executable File
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 p.materialExpressionConstant2Vector:
|
|
case p.materialExpressionConstant3Vector:
|
|
case p.materialExpressionConstant4Vector:
|
|
return Configuration.nodeColors.yellow
|
|
case p.materialExpressionFunctionInput:
|
|
case p.materialExpressionTextureCoordinate:
|
|
case p.materialExpressionWorldPosition:
|
|
case p.pcgEditorGraphNodeInput:
|
|
case p.pcgEditorGraphNodeOutput:
|
|
return Configuration.nodeColors.red
|
|
case p.makeStruct:
|
|
return Configuration.nodeColors.darkBlue
|
|
case p.materialExpressionMaterialFunctionCall:
|
|
return Configuration.nodeColors.blue
|
|
case p.materialExpressionTextureSample:
|
|
return Configuration.nodeColors.darkTurquoise
|
|
case p.niagaraNodeInput:
|
|
switch (entity["Usage"]?.toString()) {
|
|
case "Attribute": return Configuration.nodeColors.intenseGreen
|
|
case "Parameter": return Configuration.nodeColors.red
|
|
case "RapidIterationParameter": return Configuration.nodeColors.black
|
|
case "SystemConstant": return Configuration.nodeColors.gray
|
|
case "TranslatorConstant": return Configuration.nodeColors.gray
|
|
default: return Configuration.nodeColors.red
|
|
}
|
|
}
|
|
switch (entity.getClass()) {
|
|
case p.niagaraNodeFunctionCall:
|
|
return Configuration.nodeColors.darkerBlue
|
|
case p.dynamicCast:
|
|
return Configuration.nodeColors.turquoise
|
|
case p.inputDebugKey:
|
|
case p.inputKey:
|
|
return Configuration.nodeColors.red
|
|
case p.createDelegate:
|
|
case p.enumLiteral:
|
|
case p.makeArray:
|
|
case p.makeMap:
|
|
case p.materialGraphNode:
|
|
case p.select:
|
|
return Configuration.nodeColors.green
|
|
case p.executionSequence:
|
|
case p.ifThenElse:
|
|
case p.macro:
|
|
case p.multiGate:
|
|
return Configuration.nodeColors.gray
|
|
case p.functionEntry:
|
|
case p.functionResult:
|
|
return Configuration.nodeColors.violet
|
|
case p.timeline:
|
|
return Configuration.nodeColors.yellow
|
|
}
|
|
if (entity.switchTarget()) {
|
|
return Configuration.nodeColors.lime
|
|
}
|
|
if (entity.isEvent()) {
|
|
return Configuration.nodeColors.red
|
|
}
|
|
if (entity.isComment()) {
|
|
return (entity.CommentColor ? entity.CommentColor : LinearColorEntity.getWhite())
|
|
.toDimmedColor()
|
|
.toCSSRGBValues()
|
|
}
|
|
const pcgSubobject = entity.getPcgSubobject()
|
|
if (pcgSubobject) {
|
|
if (pcgSubobject.NodeTitleColor) {
|
|
return pcgSubobject.NodeTitleColor.toDimmedColor(0.1).toCSSRGBValues()
|
|
}
|
|
switch (entity.PCGNode?.getName(true)) {
|
|
case "Branch":
|
|
case "Select":
|
|
return Configuration.nodeColors.intenseGreen
|
|
}
|
|
}
|
|
if (entity.bIsPureFunc?.valueOf() || entity.bDefaultsToPureFunc?.valueOf()) {
|
|
return Configuration.nodeColors.green
|
|
}
|
|
if (entity["Input"]?.["Name"]) {
|
|
return Configuration.nodeColors.gray
|
|
}
|
|
return Configuration.nodeColors.blue
|
|
}
|