Some fixes and new nodes names added

This commit is contained in:
barsdeveloper
2023-05-22 22:15:08 +02:00
parent fa35c4860c
commit 5dfa8aff1b
12 changed files with 56 additions and 20 deletions

View File

@@ -74,7 +74,8 @@ export default class Configuration {
*/
static linkRightSVGPath = (start, c1, c2) => {
let end = 100 - start
return `M ${start} 0 C ${c1.toFixed(3)} 0, ${c2.toFixed(3)} 0, 50 50 S ${(end - c1 + start).toFixed(3)} 100, ${end.toFixed(3)} 100`
return `M ${start} 0 C ${c1.toFixed(3)} 0, ${c2.toFixed(3)} 0, 50 50 S ${(end - c1 + start).toFixed(3)} 100, `
+ `${end.toFixed(3)} 100`
}
static maxZoom = 7
static minZoom = -12
@@ -124,6 +125,7 @@ export default class Configuration {
forLoop: "/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ForLoop",
forLoopWithBreak: "/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ForLoopWithBreak",
functionEntry: "/Script/BlueprintGraph.K2Node_FunctionEntry",
functionResult: "/Script/BlueprintGraph.K2Node_FunctionResult",
getInputAxisKeyValue: "/Script/BlueprintGraph.K2Node_GetInputAxisKeyValue",
ifThenElse: "/Script/BlueprintGraph.K2Node_IfThenElse",
inputAxisKeyEvent: "/Script/BlueprintGraph.K2Node_InputAxisKeyEvent",
@@ -240,6 +242,7 @@ export default class Configuration {
begin: "ueb-tracking-mouse-begin",
end: "ueb-tracking-mouse-end",
}
static unescapedBackslash = /(?<=(?:[^\\]|^)(?:\\\\)*)\\(?!\\)/
static windowApplyEventName = "ueb-window-apply"
static windowApplyButtonText = "OK"
static windowCancelEventName = "ueb-window-cancel"

View File

@@ -349,8 +349,8 @@ export default class Utility {
/** @param {String} value */
static unescapeString(value) {
return value
.replaceAll("\\t", "\t") // Replace tab with \t
.replaceAll("\\n", "\n") // Replace newline with \n
.replaceAll(new RegExp(Configuration.unescapedBackslash.source + "t", "g"), "\t") // Replace tab with \t
.replaceAll(new RegExp(Configuration.unescapedBackslash.source + "n", "g"), "\n") // Replace newline with \n
.replaceAll(new RegExp(`\\\\(${Configuration.stringEscapedCharacters.source})`, "g"), "$1")
}

View File

@@ -585,7 +585,11 @@ export default class ObjectEntity extends IEntity {
case Configuration.paths.forEachLoopWithBreak:
return "For Each Loop with Break"
case Configuration.paths.functionEntry:
return "Construction Script"
return this.FunctionReference?.MemberName === "UserConstructionScript"
? "Construction Script"
: this.FunctionReference?.MemberName
case Configuration.paths.functionResult:
return "Return Node"
case Configuration.paths.ifThenElse:
return "Branch"
case Configuration.paths.materialExpressionConstant:
@@ -710,6 +714,7 @@ export default class ObjectEntity extends IEntity {
case "Min": return "MIN"
case "MinInt64": return "MIN"
case "Not_PreBool": return "NOT"
case "Sin": return "SIN"
case "Sqrt": return "SQRT"
case "Square": return "^2"
// Dot products not respecting MemberName pattern
@@ -828,6 +833,7 @@ export default class ObjectEntity extends IEntity {
case Configuration.paths.multiGate:
return Configuration.nodeColors.gray
case Configuration.paths.functionEntry:
case Configuration.paths.functionResult:
return Configuration.nodeColors.violet
case Configuration.paths.timeline:
return Configuration.nodeColors.yellow
@@ -850,6 +856,7 @@ export default class ObjectEntity extends IEntity {
case Configuration.paths.addDelegate:
case Configuration.paths.createDelegate:
case Configuration.paths.functionEntry:
case Configuration.paths.functionResult:
return SVGIcon.node
case Configuration.paths.customEvent: return SVGIcon.event
case Configuration.paths.doN: return SVGIcon.doN

View File

@@ -56,7 +56,7 @@ export default class IInputPinTemplate extends PinTemplate {
firstUpdated(changedProperties) {
super.firstUpdated(changedProperties)
const Self = /** @type {typeof IInputPinTemplate} */(this.constructor)
if (Self.canWrapInput) {
if (Self.canWrapInput && this.isInputRendered()) {
this.element.addEventListener("input", this.#checkWrapHandler)
this.nameWidth = this.blueprint.scaleCorrect(
this.element.querySelector(".ueb-pin-name")?.getBoundingClientRect().width ?? 0
@@ -74,7 +74,7 @@ export default class IInputPinTemplate extends PinTemplate {
} else {
this.element.addEventListener("focusout", this.#setInput)
}
if (Self.canWrapInput) {
if (Self.canWrapInput && this.isInputRendered()) {
this.element.addEventListener("input", this.#checkWrapHandler)
this.element.nodeElement.addEventListener(Configuration.nodeReflowEventName, this.#checkWrapHandler)
}

View File

@@ -77,7 +77,7 @@ export default class PinTemplate extends ITemplate {
const content = html`
<div class="ueb-pin-content">
${this.isNameRendered ? this.renderName() : nothing}
${this.element.isInput() && !this.element.entity.bDefaultValueIsIgnored ? this.renderInput() : html``}
${this.isInputRendered() ? this.renderInput() : html``}
</div>
`
return html`
@@ -105,6 +105,12 @@ export default class PinTemplate extends ITemplate {
`
}
isInputRendered() {
return this.element.isInput()
&& !this.element.entity.bDefaultValueIsIgnored
&& !this.element.entity.PinType.bIsReference
}
renderInput() {
return html``
}