Events reduced in scope

This commit is contained in:
barsdeveloper
2023-04-02 22:46:45 +02:00
parent 938924cbfb
commit 3eec5b5e1c
5 changed files with 35 additions and 43 deletions

38
dist/ueblueprint.js vendored
View File

@@ -102,6 +102,7 @@ class Configuration {
static nodeRadius = 8 // px
static nodeReflowEventName = "ueb-node-reflow"
static nodeType = {
addDelegate: "/Script/BlueprintGraph.K2Node_AddDelegate",
callArrayFunction: "/Script/BlueprintGraph.K2Node_CallArrayFunction",
callFunction: "/Script/BlueprintGraph.K2Node_CallFunction",
comment: "/Script/UnrealEd.EdGraphNode_Comment",
@@ -2947,14 +2948,12 @@ class ObjectEntity extends IEntity {
}
isEvent() {
if (
this.getClass() === Configuration.nodeType.event
|| this.getClass() === Configuration.nodeType.customEvent
) {
return true
}
if (this.getDelegatePin()) {
return true
switch (this.getClass()) {
case Configuration.nodeType.customEvent:
case Configuration.nodeType.event:
case Configuration.nodeType.inputAxisKeyEvent:
case Configuration.nodeType.inputVectorAxisEvent:
return true
}
return false
}
@@ -3090,11 +3089,8 @@ class ObjectEntity extends IEntity {
return this.bIsPureFunc
? Configuration.nodeColors.green
: Configuration.nodeColors.blue
case Configuration.nodeType.event:
case Configuration.nodeType.customEvent:
case Configuration.nodeType.inputKey:
case Configuration.nodeType.inputAxisKeyEvent:
case Configuration.nodeType.inputDebugKey:
case Configuration.nodeType.inputKey:
return Configuration.nodeColors.red
case Configuration.nodeType.createDelegate:
case Configuration.nodeType.enumLiteral:
@@ -3110,18 +3106,20 @@ class ObjectEntity extends IEntity {
case Configuration.nodeType.dynamicCast:
return Configuration.nodeColors.turquoise
}
if (this.bIsPureFunc) {
return Configuration.nodeColors.green
}
if (this.isEvent()) {
return Configuration.nodeColors.red
}
if (this.bIsPureFunc) {
return Configuration.nodeColors.green
}
return Configuration.nodeColors.blue
}
nodeIcon() {
switch (this.getType()) {
case Configuration.nodeType.createDelegate: return SVGIcon.node
case Configuration.nodeType.addDelegate:
case Configuration.nodeType.createDelegate:
return SVGIcon.node
case Configuration.nodeType.customEvent: return SVGIcon.event
case Configuration.nodeType.doN: return SVGIcon.doN
case Configuration.nodeType.doOnce: return SVGIcon.doOnce
@@ -7383,17 +7381,15 @@ class NodeElement extends ISelectableDraggableElement {
return CommentNodeTemplate
case Configuration.nodeType.createDelegate:
return NodeTemplate
case Configuration.nodeType.event:
case Configuration.nodeType.customEvent:
case Configuration.nodeType.inputAxisKeyEvent:
case Configuration.nodeType.inputVectorAxisEvent:
return EventNodeTemplate
case Configuration.nodeType.promotableOperator:
return VariableOperationNodeTemplate
case Configuration.nodeType.knot: return KnotNodeTemplate
case Configuration.nodeType.variableGet: return VariableAccessNodeTemplate
case Configuration.nodeType.variableSet: return VariableAccessNodeTemplate
}
if (nodeEntity.isEvent()) {
return EventNodeTemplate
}
return NodeTemplate
}

File diff suppressed because one or more lines are too long

View File

@@ -78,6 +78,7 @@ export default class Configuration {
static nodeRadius = 8 // px
static nodeReflowEventName = "ueb-node-reflow"
static nodeType = {
addDelegate: "/Script/BlueprintGraph.K2Node_AddDelegate",
callArrayFunction: "/Script/BlueprintGraph.K2Node_CallArrayFunction",
callFunction: "/Script/BlueprintGraph.K2Node_CallFunction",
comment: "/Script/UnrealEd.EdGraphNode_Comment",

View File

@@ -143,17 +143,15 @@ export default class NodeElement extends ISelectableDraggableElement {
return CommentNodeTemplate
case Configuration.nodeType.createDelegate:
return NodeTemplate
case Configuration.nodeType.event:
case Configuration.nodeType.customEvent:
case Configuration.nodeType.inputAxisKeyEvent:
case Configuration.nodeType.inputVectorAxisEvent:
return EventNodeTemplate
case Configuration.nodeType.promotableOperator:
return VariableOperationNodeTemplate
case Configuration.nodeType.knot: return KnotNodeTemplate
case Configuration.nodeType.variableGet: return VariableAccessNodeTemplate
case Configuration.nodeType.variableSet: return VariableAccessNodeTemplate
}
if (nodeEntity.isEvent()) {
return EventNodeTemplate
}
return NodeTemplate
}

View File

@@ -391,14 +391,12 @@ export default class ObjectEntity extends IEntity {
}
isEvent() {
if (
this.getClass() === Configuration.nodeType.event
|| this.getClass() === Configuration.nodeType.customEvent
) {
return true
}
if (this.getDelegatePin()) {
return true
switch (this.getClass()) {
case Configuration.nodeType.customEvent:
case Configuration.nodeType.event:
case Configuration.nodeType.inputAxisKeyEvent:
case Configuration.nodeType.inputVectorAxisEvent:
return true
}
return false
}
@@ -534,11 +532,8 @@ export default class ObjectEntity extends IEntity {
return this.bIsPureFunc
? Configuration.nodeColors.green
: Configuration.nodeColors.blue
case Configuration.nodeType.event:
case Configuration.nodeType.customEvent:
case Configuration.nodeType.inputKey:
case Configuration.nodeType.inputAxisKeyEvent:
case Configuration.nodeType.inputDebugKey:
case Configuration.nodeType.inputKey:
return Configuration.nodeColors.red
case Configuration.nodeType.createDelegate:
case Configuration.nodeType.enumLiteral:
@@ -554,18 +549,20 @@ export default class ObjectEntity extends IEntity {
case Configuration.nodeType.dynamicCast:
return Configuration.nodeColors.turquoise
}
if (this.bIsPureFunc) {
return Configuration.nodeColors.green
}
if (this.isEvent()) {
return Configuration.nodeColors.red
}
if (this.bIsPureFunc) {
return Configuration.nodeColors.green
}
return Configuration.nodeColors.blue
}
nodeIcon() {
switch (this.getType()) {
case Configuration.nodeType.createDelegate: return SVGIcon.node
case Configuration.nodeType.addDelegate:
case Configuration.nodeType.createDelegate:
return SVGIcon.node
case Configuration.nodeType.customEvent: return SVGIcon.event
case Configuration.nodeType.doN: return SVGIcon.doN
case Configuration.nodeType.doOnce: return SVGIcon.doOnce