mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-21 06:05:45 +08:00
Linear color fix
This commit is contained in:
@@ -45,13 +45,13 @@ export default class Configuration {
|
||||
static nodeRadius = 8 // in pixel
|
||||
static nodeReflowEventName = "ueb-node-reflow"
|
||||
static pinColor = {
|
||||
bool: css`117, 0, 0`, // #750000
|
||||
default: css`167, 167, 167`, // #a7a7a7
|
||||
exec: css`167, 167, 167`, // #a7a7a7
|
||||
name: css`203, 129, 252`, // #cb81fc
|
||||
real: css`50, 187, 0`, // #32bb00
|
||||
string: css`213, 0, 176`, // #d500b0
|
||||
struct: css`3, 76, 168` // #034ca8
|
||||
"bool": css`117, 0, 0`, // #750000
|
||||
"default": css`167, 167, 167`, // #a7a7a7
|
||||
"exec": css`167, 167, 167`, // #a7a7a7
|
||||
"name": css`203, 129, 252`, // #cb81fc
|
||||
"real": css`50, 187, 0`, // #32bb00
|
||||
"string": css`213, 0, 176`, // #d500b0
|
||||
"/Script/CoreUObject.LinearColor": css`3, 76, 168` // #034ca8
|
||||
}
|
||||
static selectAllKeyboardKey = "(bCtrl=True,Key=A)"
|
||||
static trackingMouseEventName = {
|
||||
|
||||
@@ -30,9 +30,7 @@ export default class PinElement extends IElement {
|
||||
"name": NamePinTemplate,
|
||||
"real": RealPinTemplate,
|
||||
"string": StringPinTemplate,
|
||||
"struct": {
|
||||
"/Script/CoreUObject.LinearColor": LinearColorPinTemplate,
|
||||
}
|
||||
"/Script/CoreUObject.LinearColor": LinearColorPinTemplate,
|
||||
}
|
||||
|
||||
static properties = {
|
||||
@@ -51,6 +49,7 @@ export default class PinElement extends IElement {
|
||||
return Utility.printLinearColor(value)
|
||||
},
|
||||
},
|
||||
attribute: "data-color",
|
||||
reflect: true,
|
||||
},
|
||||
defaultValue: {
|
||||
@@ -81,9 +80,6 @@ export default class PinElement extends IElement {
|
||||
*/
|
||||
static getTypeTemplate(pinEntity) {
|
||||
let result = PinElement.#typeTemplateMap[pinEntity.getType()]
|
||||
if (result.constructor === Object) {
|
||||
result = result[pinEntity.getSubCategory()]
|
||||
}
|
||||
return result ?? PinTemplate
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import Utility from "../Utility"
|
||||
import IEntity from "./IEntity"
|
||||
|
||||
export default class LinearColorEntity extends IEntity {
|
||||
@@ -8,4 +9,8 @@ export default class LinearColorEntity extends IEntity {
|
||||
B: Number,
|
||||
A: Number,
|
||||
}
|
||||
|
||||
toString() {
|
||||
return Utility.printLinearColor(this)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,16 +104,13 @@ export default class PinEntity extends IEntity {
|
||||
}
|
||||
|
||||
getType() {
|
||||
if (this.PinType.PinCategory == "struct") {
|
||||
return this.PinType.PinSubCategoryObject.path
|
||||
}
|
||||
return this.PinType.PinCategory
|
||||
}
|
||||
|
||||
getSubCategory() {
|
||||
return this.PinType.PinSubCategoryObject.path
|
||||
}
|
||||
|
||||
getColorValue() {
|
||||
if (this.PinType.PinSubCategoryObject.path == "/Script/CoreUObject.LinearColor") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,13 +32,13 @@ export default class BlueprintTemplate extends ITemplate {
|
||||
"--ueb-grid-size": `${Configuration.gridSize}px`,
|
||||
"--ueb-link-min-width": `${Configuration.linkMinWidth}`,
|
||||
"--ueb-node-radius": `${Configuration.nodeRadius}px`,
|
||||
"--ueb-pin-bool-color": `${Configuration.pinColor.bool}`,
|
||||
"--ueb-pin-default-color": `${Configuration.pinColor.default}`,
|
||||
"--ueb-pin-exec-color": `${Configuration.pinColor.exec}`,
|
||||
"--ueb-pin-name-color": `${Configuration.pinColor.name}`,
|
||||
"--ueb-pin-real-color": `${Configuration.pinColor.real}`,
|
||||
"--ueb-pin-string-color": `${Configuration.pinColor.string}`,
|
||||
"--ueb-pin-struct-color": `${Configuration.pinColor.struct}`,
|
||||
"--ueb-pin-bool-color": `${Configuration.pinColor["bool"]}`,
|
||||
"--ueb-pin-default-color": `${Configuration.pinColor["default"]}`,
|
||||
"--ueb-pin-exec-color": `${Configuration.pinColor["exec"]}`,
|
||||
"--ueb-pin-name-color": `${Configuration.pinColor["name"]}`,
|
||||
"--ueb-pin-real-color": `${Configuration.pinColor["real"]}`,
|
||||
"--ueb-pin-string-color": `${Configuration.pinColor["string"]}`,
|
||||
"--ueb-pin-linear-color": `${Configuration.pinColor["/Script/CoreUObject.LinearColor"]}`,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,7 +40,12 @@ export default class LinearColorPinTemplate extends IInputPinTemplate {
|
||||
renderInput(pin) {
|
||||
if (pin.isInput()) {
|
||||
return html`
|
||||
<span class="ueb-pin-input" data-linear-color="${pin.defaultValue.toString()}"></span>
|
||||
<span
|
||||
class="ueb-pin-input"
|
||||
data-linear-color="${pin.defaultValue.toString()}"
|
||||
style="--ueb-linear-color:rgba(${pin.defaultValue.toString()})"
|
||||
>
|
||||
</span>
|
||||
`
|
||||
}
|
||||
return super.renderInput(pin)
|
||||
|
||||
Reference in New Issue
Block a user