mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-18 20:34:54 +08:00
Shorting repetitive bits
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user