Required mark for PCG pins

This commit is contained in:
barsdeveloper
2025-04-03 23:40:52 +03:00
parent 5ef585eb34
commit fb7fc9fc66
12 changed files with 159 additions and 30 deletions

View File

@@ -781,6 +781,19 @@ ueb-blueprint[data-scrolling=false][data-selecting=false] .ueb-pin-wrapper:hover
background: none !important;
}
.ueb-pin-required-mark {
width: 0;
}
.ueb-pin-required-mark::before {
content: "";
display: block;
width: 6px;
height: 4px;
background: var(--ueb-pin-color);
margin-left: -13px;
border-radius: 0 2px 2px 0;
}
.ueb-pin-content {
display: flex;
align-items: center;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

33
dist/ueblueprint.js vendored
View File

@@ -5884,13 +5884,9 @@ class PinEntity extends IEntity {
}
if (this.objectEntity?.isPcg()) {
const pcgSuboject = this.objectEntity.getPcgSubobject();
const pinObjectReference = this.isInput()
? pcgSuboject.InputPins?.valueOf()[this.pinIndex]
: pcgSuboject.OutputPins?.valueOf()[this.pinIndex];
if (pinObjectReference) {
/** @type {ObjectEntity} */
const pinObject = pcgSuboject[Configuration.subObjectAttributeNameFromReference(pinObjectReference, true)];
let allowedTypes = pinObject.Properties?.AllowedTypes?.toString() ?? "";
const pinObject = this.getPinObject(pcgSuboject);
if (pinObject) {
let allowedTypes = pinObject["Properties"]?.AllowedTypes?.toString() ?? "";
if (allowedTypes == "") {
allowedTypes = this.PinType.PinCategory ?? "";
if (allowedTypes == "") {
@@ -5899,8 +5895,8 @@ class PinEntity extends IEntity {
}
if (allowedTypes) {
if (
pinObject.Properties.bAllowMultipleData?.valueOf() !== false
&& pinObject.Properties.bAllowMultipleConnections?.valueOf() !== false
pinObject["Properties"].bAllowMultipleData?.valueOf() !== false
&& pinObject["Properties"].bAllowMultipleConnections?.valueOf() !== false
) {
allowedTypes += "[]";
}
@@ -6017,6 +6013,17 @@ class PinEntity extends IEntity {
return false
}
/** @param {ObjectEntity} pcgSuboject */
getPinObject(pcgSuboject) {
const pinObjectReference = this.isInput()
? pcgSuboject.InputPins?.valueOf()[this.pinIndex]
: pcgSuboject.OutputPins?.valueOf()[this.pinIndex];
if (pinObjectReference) {
/** @type {ObjectEntity} */
return pcgSuboject[Configuration.subObjectAttributeNameFromReference(pinObjectReference, true)]
}
}
getSubCategory() {
return this.PinType.PinSubCategoryObject?.path
}
@@ -9611,8 +9618,12 @@ class PinTemplate extends ITemplate {
${this.isInputRendered() ? this.renderInput() : x``}
</div>
`;
let pcgSubobject = this.element.nodeElement.entity.getPcgSubobject();
return x`
<div class="ueb-pin-wrapper">
${pcgSubobject && this.element.entity.getPinObject(pcgSubobject)?.["Properties"]?.["PinStatus"] == "Required"
? x`<div class="ueb-pin-required-mark"></div>`
: E}
${this.element.isInput() ? x`${icon}${content}` : x`${content}${icon}`}
</div>
`
@@ -9647,13 +9658,13 @@ class PinTemplate extends ITemplate {
case "Set": return SVGIcon.setPin
case "Map": return SVGIcon.mapPin
}
if (this.element.entity.PinType.PinCategory?.toString().toLocaleLowerCase() === "delegate") {
if (this.element.entity.PinType.PinCategory?.toString().toLocaleLowerCase() == "delegate") {
return SVGIcon.delegate
}
if (this.element.nodeElement?.template instanceof VariableOperationNodeTemplate) {
return SVGIcon.operationPin
}
if (this.element.entity.PinType.PinCategory?.toString().toLocaleLowerCase() === "statictype") {
if (this.element.entity.PinType.PinCategory?.toString().toLocaleLowerCase() == "statictype") {
return SVGIcon.staticPin
}
return SVGIcon.genericPin

File diff suppressed because one or more lines are too long