mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-21 22:34:44 +08:00
New node type
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { html, nothing } from "lit"
|
||||
import Configuration from "../../Configuration.js"
|
||||
import ElementFactory from "../../element/ElementFactory.js"
|
||||
import MinimalPinTemplate from "../pin/MinimalPinTemplate.js"
|
||||
import NodeTemplate from "./NodeTemplate.js"
|
||||
@@ -21,6 +22,8 @@ export default class EventNodeTemplate extends NodeTemplate {
|
||||
renderTop() {
|
||||
const icon = this.renderNodeIcon()
|
||||
const name = this.renderNodeName()
|
||||
const customEvent = this.element.getType() === Configuration.nodeType.customEvent
|
||||
&& (this.element.entity.CustomFunctionName || this.element.entity.FunctionReference.MemberParent)
|
||||
return html`
|
||||
<div class="ueb-node-name">
|
||||
${icon ? html`
|
||||
@@ -29,7 +32,7 @@ export default class EventNodeTemplate extends NodeTemplate {
|
||||
${name ? html`
|
||||
<div class="ueb-node-name-text ueb-ellipsis-nowrap-text">
|
||||
${name}
|
||||
${this.hasSubtitle && this.element.entity.FunctionReference.MemberParent ? html`
|
||||
${customEvent ? html`
|
||||
<div class="ueb-node-subtitle-text ueb-ellipsis-nowrap-text">
|
||||
Custom Event
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
|
||||
|
||||
/** @typedef {typeof NodeTemplate} NodeTemplateConstructor */
|
||||
|
||||
hasSubtitle = false
|
||||
#hasSubtitle = false
|
||||
|
||||
static nodeStyleClasses = ["ueb-node-style-default"]
|
||||
|
||||
@@ -79,7 +79,7 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
|
||||
${name ? html`
|
||||
<div class="ueb-node-name-text ueb-ellipsis-nowrap-text">
|
||||
${name}
|
||||
${this.hasSubtitle && this.getTargetType().length > 0 ? html`
|
||||
${this.#hasSubtitle && this.getTargetType().length > 0 ? html`
|
||||
<div class="ueb-node-subtitle-text ueb-ellipsis-nowrap-text">
|
||||
Target is ${Utility.formatStringName(this.getTargetType())}
|
||||
</div>
|
||||
@@ -124,7 +124,7 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
|
||||
return this.element.getPinEntities()
|
||||
.filter(v => !v.isHidden())
|
||||
.map(pinEntity => {
|
||||
this.hasSubtitle = this.hasSubtitle
|
||||
this.#hasSubtitle = this.#hasSubtitle
|
||||
|| pinEntity.PinName === "self" && pinEntity.getDisplayName() === "Target"
|
||||
let pinElement = /** @type {PinElementConstructor} */(ElementFactory.getConstructor("ueb-pin"))
|
||||
.newObject(pinEntity, undefined, this.element)
|
||||
|
||||
Reference in New Issue
Block a user