mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-14 09:10:39 +08:00
Large refactoring and new nodes
* 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
This commit is contained in:
76
js/decoding/nodeColor.js
Normal file → Executable file
76
js/decoding/nodeColor.js
Normal file → Executable file
@@ -1,54 +1,61 @@
|
||||
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 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 Configuration.paths.callFunction:
|
||||
return entity.bIsPureFunc?.valueOf()
|
||||
? Configuration.nodeColors.green
|
||||
: Configuration.nodeColors.blue
|
||||
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()) {
|
||||
@@ -73,8 +80,11 @@ export default function nodeColor(entity) {
|
||||
return Configuration.nodeColors.intenseGreen
|
||||
}
|
||||
}
|
||||
if (entity.bIsPureFunc?.valueOf()) {
|
||||
if (entity.bIsPureFunc?.valueOf() || entity.bDefaultsToPureFunc?.valueOf()) {
|
||||
return Configuration.nodeColors.green
|
||||
}
|
||||
if (entity["Input"]?.["Name"]) {
|
||||
return Configuration.nodeColors.gray
|
||||
}
|
||||
return Configuration.nodeColors.blue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user