Several fixes

This commit is contained in:
barsdeveloper
2024-07-18 17:35:29 +02:00
parent 8a2cd6c26e
commit 5d847ab8f6
12 changed files with 50 additions and 54 deletions

View File

@@ -129,7 +129,7 @@ export default class PinEntity extends IEntity {
/** @type {InstanceType<typeof PinEntity.attributes.Direction>} */ this.Direction
/** @type {InstanceType<typeof PinEntity.attributes.PinType>} */ this.PinType
/** @type {InstanceType<typeof PinEntity.attributes.LinkedTo>} */ this.LinkedTo
/** @type {InstanceType<typeof PinEntity.attributes.DefaultValue>} */ this.DefaultValue
/** @type {T} */ this.DefaultValue
/** @type {InstanceType<typeof PinEntity.attributes.AutogeneratedDefaultValue>} */ this.AutogeneratedDefaultValue
/** @type {InstanceType<typeof PinEntity.attributes.DefaultObject>} */ this.DefaultObject
/** @type {InstanceType<typeof PinEntity.attributes.PersistentGuid>} */ this.PersistentGuid
@@ -147,9 +147,9 @@ export default class PinEntity extends IEntity {
}
getType() {
const category = this.PinType.PinCategory.valueOf().toLocaleLowerCase()
const category = this.PinType.PinCategory?.valueOf().toLocaleLowerCase()
if (category === "struct" || category === "class" || category === "object" || category === "type") {
return this.PinType.PinSubCategoryObject.path
return this.PinType.PinSubCategoryObject?.path
}
if (this.isEnum()) {
return "enum"
@@ -181,7 +181,8 @@ export default class PinEntity extends IEntity {
}
}
if (category === "optional") {
switch (this.PinType.PinSubCategory.toString()) {
const subCategory = this.PinType.PinSubCategory?.valueOf()
switch (subCategory) {
case "red":
return "real"
case "rg":
@@ -191,7 +192,7 @@ export default class PinEntity extends IEntity {
case "rgba":
return Configuration.paths.linearColor
default:
return this.PinType.PinSubCategory
return subCategory
}
}
return category