diff options
author | Jacob <55346310+Kathund@users.noreply.github.com> | 2025-05-08 05:20:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-07 23:20:29 +0200 |
commit | 40256ca60135f8796066ac445211b9d084f2a0af (patch) | |
tree | f08a766a6244ead23d443c1fac8fc380d85de853 /src/main/kotlin/util/textutil.kt | |
parent | 63669bc28be11adbf55c8d49bb747bb22124be86 (diff) | |
download | Firmament-40256ca60135f8796066ac445211b9d084f2a0af.tar.gz Firmament-40256ca60135f8796066ac445211b9d084f2a0af.tar.bz2 Firmament-40256ca60135f8796066ac445211b9d084f2a0af.zip |
feat: Add Pet overlay
* feat: pet overlay
* fix: missing shadow
* fix: getting pet when not in pets menu
* sort translations
* Merge branch 'master' into feat/pet-overlay
* Merge branch 'master' into feat/pet-overlay
* Add requested changes for Pet Overlay
Diffstat (limited to 'src/main/kotlin/util/textutil.kt')
-rw-r--r-- | src/main/kotlin/util/textutil.kt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/kotlin/util/textutil.kt b/src/main/kotlin/util/textutil.kt index 4ef7f76..2458891 100644 --- a/src/main/kotlin/util/textutil.kt +++ b/src/main/kotlin/util/textutil.kt @@ -164,4 +164,14 @@ fun Text.transformEachRecursively(function: (Text) -> Text): Text { fun tr(key: String, default: String): MutableText = error("Compiler plugin did not run.") fun trResolved(key: String, vararg args: Any): MutableText = Text.stringifiedTranslatable(key, *args) +fun titleCase(str: String): String { + return str + .lowercase() + .replace("_", " ") + .split(" ") + .joinToString(" ") { word -> + word.replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() } + } +} + |