mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-22 22:27:30 +08:00
Additional colors and types added
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import IEntity from "./IEntity"
|
||||
import Utility from "../Utility"
|
||||
|
||||
export default class LocalizedTextEntity extends IEntity {
|
||||
|
||||
@@ -17,10 +18,6 @@ export default class LocalizedTextEntity extends IEntity {
|
||||
}
|
||||
|
||||
toString() {
|
||||
if (this.value.length === 0) {
|
||||
return this.value
|
||||
}
|
||||
let result = this.value
|
||||
return result.charAt(0).toLocaleUpperCase() + result.slice(1).toLocaleLowerCase()
|
||||
return Utility.capitalFirstLetter(this.value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ export default class ObjectEntity extends IEntity {
|
||||
EventReference: new TypeInitialization(FunctionReferenceEntity, false, null,),
|
||||
TargetType: new TypeInitialization(ObjectReferenceEntity, false, null),
|
||||
MacroGraphReference: new TypeInitialization(MacroGraphReferenceEntity, false, null),
|
||||
Enum: new TypeInitialization(ObjectReferenceEntity, false),
|
||||
NodePosX: IntegerEntity,
|
||||
NodePosY: IntegerEntity,
|
||||
AdvancedPinDisplay: new TypeInitialization(IdentifierEntity, false, null),
|
||||
@@ -44,6 +45,7 @@ export default class ObjectEntity extends IEntity {
|
||||
/** @type {FunctionReferenceEntity?} */ this.EventReference
|
||||
/** @type {ObjectReferenceEntity?} */ this.TargetType
|
||||
/** @type {MacroGraphReferenceEntity?} */ this.MacroGraphReference
|
||||
/** @type {ObjectReferenceEntity?} */ this.Enum
|
||||
/** @type {IntegerEntity} */ this.NodePosX
|
||||
/** @type {IntegerEntity} */ this.NodePosY
|
||||
/** @type {IdentifierEntity?} */ this.AdvancedPinDisplay
|
||||
@@ -94,26 +96,22 @@ export default class ObjectEntity extends IEntity {
|
||||
let name = ""
|
||||
switch (this.getType()) {
|
||||
case Configuration.nodeType.callFunction:
|
||||
name = this.FunctionReference.MemberName
|
||||
break
|
||||
return Utility.formatStringName(this.FunctionReference.MemberName)
|
||||
case Configuration.nodeType.dynamicCast:
|
||||
return `Cast To ${this.TargetType.getName()}`
|
||||
case Configuration.nodeType.ifThenElse:
|
||||
name = "Branch"
|
||||
break
|
||||
case Configuration.nodeType.forEachLoop:
|
||||
name = "For Each Loop with Break"
|
||||
break
|
||||
case Configuration.nodeType.reverseForEachLoop:
|
||||
name = "Reverse for Each Loop"
|
||||
break
|
||||
return "Branch"
|
||||
case Configuration.nodeType.forEachElementInEnum:
|
||||
return `For Each ${this.Enum.getName()}`
|
||||
case Configuration.nodeType.forEachLoopWithBreak:
|
||||
return "For Each Loop with Break"
|
||||
default:
|
||||
if (this.getClass() === Configuration.nodeType.macro) {
|
||||
name = this.MacroGraphReference.getMacroName()
|
||||
return Utility.formatStringName(this.MacroGraphReference.getMacroName())
|
||||
} else {
|
||||
name = this.getNameAndCounter()[0]
|
||||
return Utility.formatStringName(this.getNameAndCounter()[0])
|
||||
}
|
||||
break
|
||||
}
|
||||
return Utility.formatStringName(name)
|
||||
}
|
||||
|
||||
getCounter() {
|
||||
|
||||
@@ -17,4 +17,8 @@ export default class ObjectReferenceEntity extends IEntity {
|
||||
/** @type {String} */ this.type
|
||||
/** @type {String} */ this.path
|
||||
}
|
||||
|
||||
getName() {
|
||||
return this.path.match(/[^\.\/]+$/)[0]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user