mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
17 lines
602 B
JavaScript
Executable File
17 lines
602 B
JavaScript
Executable File
import Utility from "../Utility.js"
|
|
|
|
/** @param {PinEntity<IEntity>} entity */
|
|
export default function pinTitle(entity) {
|
|
let result = entity.PinFriendlyName
|
|
? entity.PinFriendlyName.toString()
|
|
: Utility.formatStringName(entity.PinName?.toString() ?? "")
|
|
let match
|
|
if (match = entity.PinToolTip?.toString().match(/\s*(.+?(?=\n)|.+\S)\s*/)) {
|
|
if (match[1].toLowerCase() === result.toLowerCase()) {
|
|
return match[1] // In case they match, then keep the case of the PinToolTip
|
|
}
|
|
}
|
|
result = result.replace(/^Module\./, "")
|
|
return result
|
|
}
|