mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-23 23:34:43 +08:00
Keep possibly brand names just initials
This commit is contained in:
21
js/entity/FormatTextEntity.js
Normal file
21
js/entity/FormatTextEntity.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import IEntity from "./IEntity"
|
||||
import InvariantTextEntity from "./InvariantTextEntity"
|
||||
import LocalizedTextEntity from "./LocalizedTextEntity"
|
||||
import UnionType from "./UnionType"
|
||||
|
||||
export default class FormatTextEntity extends IEntity {
|
||||
|
||||
static lookbehind = "LOCGEN_FORMAT_NAMED"
|
||||
static attributes = {
|
||||
value: [new UnionType(LocalizedTextEntity, InvariantTextEntity, FormatTextEntity)],
|
||||
}
|
||||
|
||||
static {
|
||||
this.cleanupAttributes(this.attributes)
|
||||
}
|
||||
|
||||
constructor(values) {
|
||||
super(values)
|
||||
/** @type {String} */ this.value
|
||||
}
|
||||
} 1
|
||||
@@ -585,7 +585,7 @@ export default class ObjectEntity extends IEntity {
|
||||
if (hidValue.includes("Mouse")) {
|
||||
return SVGIcon.mouse
|
||||
} else if (hidValue.includes("Gamepad_Special")) {
|
||||
return SVGIcon.keyboard // This is called Touchpad in Unreal Engine
|
||||
return SVGIcon.keyboard // This is called Touchpad in UE
|
||||
} else if (hidValue.includes("Gamepad") || hidValue.includes("Steam")) {
|
||||
return SVGIcon.gamepad
|
||||
} else if (hidValue.includes("Touch")) {
|
||||
|
||||
@@ -371,11 +371,13 @@ export default class Grammar {
|
||||
)
|
||||
|
||||
/** @param {Grammar} r */
|
||||
InvariantText = r => r.String.trim(P.optWhitespace).wrap(
|
||||
P.string(InvariantTextEntity.lookbehind).skip(P.optWhitespace).skip(P.string("(")),
|
||||
P.string(")")
|
||||
)
|
||||
.map(value => new InvariantTextEntity({ value: value }))
|
||||
InvariantText = r =>
|
||||
Grammar.regexMap(
|
||||
new RegExp(
|
||||
String.raw`${InvariantTextEntity.lookbehind}\s*\("(${Grammar.Regex.InsideString.source})"\)`,
|
||||
matchResult => new InvariantTextEntity({ value: matchResult[1] })
|
||||
)
|
||||
)
|
||||
|
||||
/** @param {Grammar} r */
|
||||
AttributeAnyValue = r => P.alt(
|
||||
|
||||
Reference in New Issue
Block a user