mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-06 15:47:30 +08:00
Make struct node
This commit is contained in:
@@ -8,7 +8,8 @@ import { css } from "lit"
|
||||
export default class Configuration {
|
||||
static nodeColors = {
|
||||
blue: css`84, 122, 156`,
|
||||
darkBlue: css`19, 100, 137`,
|
||||
darkBlue: css`32, 80, 128`,
|
||||
darkTurquoise: css`19, 100, 137`,
|
||||
gray: css`150,150,150`,
|
||||
green: css`95, 129, 90`,
|
||||
lime: css`150, 160, 30`,
|
||||
@@ -142,6 +143,7 @@ export default class Configuration {
|
||||
makeArray: "/Script/BlueprintGraph.K2Node_MakeArray",
|
||||
makeMap: "/Script/BlueprintGraph.K2Node_MakeMap",
|
||||
makeSet: "/Script/BlueprintGraph.K2Node_MakeSet",
|
||||
makeStruct: "/Script/BlueprintGraph.K2Node_MakeStruct",
|
||||
materialExpressionConstant: "/Script/Engine.MaterialExpressionConstant",
|
||||
materialExpressionConstant2Vector: "/Script/Engine.MaterialExpressionConstant2Vector",
|
||||
materialExpressionConstant3Vector: "/Script/Engine.MaterialExpressionConstant3Vector",
|
||||
|
||||
@@ -151,6 +151,9 @@ export default class ObjectEntity extends IEntity {
|
||||
G: {
|
||||
type: Number,
|
||||
},
|
||||
StructType: {
|
||||
type: ObjectReferenceEntity,
|
||||
},
|
||||
MaterialExpression: {
|
||||
type: ObjectReferenceEntity,
|
||||
},
|
||||
@@ -340,6 +343,7 @@ export default class ObjectEntity extends IEntity {
|
||||
/** @type {ObjectReferenceEntity?} */ this.ProxyClass
|
||||
/** @type {Number?} */ this.R
|
||||
/** @type {Number?} */ this.G
|
||||
/** @type {ObjectReferenceEntity?} */ this.StructType
|
||||
/** @type {ObjectReferenceEntity?} */ this.MaterialExpression
|
||||
/** @type {ObjectReferenceEntity?} */ this.MaterialExpressionComment
|
||||
/** @type {SymbolEntity?} */ this.MoveMode
|
||||
@@ -596,6 +600,10 @@ export default class ObjectEntity extends IEntity {
|
||||
return "Return Node"
|
||||
case Configuration.paths.ifThenElse:
|
||||
return "Branch"
|
||||
case Configuration.paths.makeStruct:
|
||||
if (this.StructType) {
|
||||
return `Make ${this.StructType.getName()}`
|
||||
}
|
||||
case Configuration.paths.materialExpressionConstant:
|
||||
input ??= [this.getCustomproperties().find(pinEntity => pinEntity.PinName == "Value")?.DefaultValue]
|
||||
case Configuration.paths.materialExpressionConstant2Vector:
|
||||
@@ -816,10 +824,12 @@ export default class ObjectEntity extends IEntity {
|
||||
case Configuration.paths.materialExpressionConstant3Vector:
|
||||
case Configuration.paths.materialExpressionConstant4Vector:
|
||||
return Configuration.nodeColors.yellow
|
||||
case Configuration.paths.makeStruct:
|
||||
return Configuration.nodeColors.darkBlue
|
||||
case Configuration.paths.materialExpressionMaterialFunctionCall:
|
||||
return Configuration.nodeColors.blue
|
||||
case Configuration.paths.materialExpressionTextureSample:
|
||||
return Configuration.nodeColors.darkBlue
|
||||
return Configuration.nodeColors.darkTurquoise
|
||||
case Configuration.paths.materialExpressionTextureCoordinate:
|
||||
return Configuration.nodeColors.red
|
||||
}
|
||||
@@ -895,6 +905,7 @@ export default class ObjectEntity extends IEntity {
|
||||
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.select: return SVGIcon.select
|
||||
case Configuration.paths.spawnActorFromClass: return SVGIcon.spawnActor
|
||||
case Configuration.paths.timeline: return SVGIcon.timer
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { html, nothing } from "lit"
|
||||
import Configuration from "../../Configuration.js"
|
||||
import ITemplate from "../ITemplate.js"
|
||||
import MouseCreateLink from "../../input/mouse/MouseCreateLink.js"
|
||||
import SVGIcon from "../../SVGIcon.js"
|
||||
@@ -100,8 +101,17 @@ export default class PinTemplate extends ITemplate {
|
||||
}
|
||||
|
||||
renderName() {
|
||||
let name = this.element.getPinDisplayName()
|
||||
const nodeElement = this.element.nodeElement
|
||||
const pinName = this.element.getPinName()
|
||||
if (
|
||||
nodeElement.getType() == Configuration.paths.makeStruct
|
||||
&& pinName == nodeElement.entity.StructType.getName()
|
||||
) {
|
||||
name = pinName
|
||||
}
|
||||
return html`
|
||||
<span class="ueb-pin-name ueb-ellipsis-nowrap-text">${this.element.getPinDisplayName()}</span>
|
||||
<span class="ueb-pin-name ueb-ellipsis-nowrap-text">${name}</span>
|
||||
`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user