aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/gui
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-02-09 12:00:50 +0100
committerLinnea Gräf <nea@nea.moe>2024-02-09 12:00:50 +0100
commitefbef712130048e1bf39e66b15271bf663586eee (patch)
tree5260c953cdb3825128d43323a7de6557561cb7af /src/main/kotlin/moe/nea/firmament/gui
parent0cb6e308acc313a22f9fd796cc47301272485120 (diff)
downloadFirmament-efbef712130048e1bf39e66b15271bf663586eee.tar.gz
Firmament-efbef712130048e1bf39e66b15271bf663586eee.tar.bz2
Firmament-efbef712130048e1bf39e66b15271bf663586eee.zip
Fix crash when rendering SkyBlock id in a string
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/gui')
-rw-r--r--src/main/kotlin/moe/nea/firmament/gui/config/HudMetaHandler.kt2
-rw-r--r--src/main/kotlin/moe/nea/firmament/gui/profileviewer/ProfileViewer.kt10
-rw-r--r--src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/gui/config/HudMetaHandler.kt b/src/main/kotlin/moe/nea/firmament/gui/config/HudMetaHandler.kt
index 3993bfa..7df98e3 100644
--- a/src/main/kotlin/moe/nea/firmament/gui/config/HudMetaHandler.kt
+++ b/src/main/kotlin/moe/nea/firmament/gui/config/HudMetaHandler.kt
@@ -27,7 +27,7 @@ class HudMetaHandler(val config: ManagedConfig, val label: MutableText, val widt
}
override fun emitGuiElements(opt: ManagedOption<HudMeta>, guiAppender: GuiAppender) {
- guiAppender.appendLabeledRow(opt.labelText, WButton(Text.translatable("firmament.hud.edit", label))
+ guiAppender.appendLabeledRow(opt.labelText, WButton(Text.stringifiedTranslatable("firmament.hud.edit", label))
.also {
it.setOnClick {
MC.screen = JarvisIntegration.jarvis.getHudEditor(
diff --git a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/ProfileViewer.kt b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/ProfileViewer.kt
index e811663..ada7603 100644
--- a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/ProfileViewer.kt
+++ b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/ProfileViewer.kt
@@ -44,31 +44,31 @@ class ProfileViewer(
companion object {
suspend fun onCommand(source: FabricClientCommandSource, name: String) {
- source.sendFeedback(Text.translatable("firmament.pv.lookingup", name))
+ source.sendFeedback(Text.stringifiedTranslatable("firmament.pv.lookingup", name))
try {
val uuid = Routes.getUUIDForPlayerName(name)
if (uuid == null) {
- source.sendError(Text.translatable("firmament.pv.noplayer", name))
+ source.sendError(Text.stringifiedTranslatable("firmament.pv.noplayer", name))
return
}
val name = Routes.getPlayerNameForUUID(uuid) ?: name
val names = mapOf(uuid to (name))
val data = Routes.getAccountData(uuid)
if (data == null) {
- source.sendError(Text.translatable("firmament.pv.noprofile", name))
+ source.sendError(Text.stringifiedTranslatable("firmament.pv.noprofile", name))
return
}
val accountData = mapOf(data.uuid to data)
val profiles = Routes.getProfiles(uuid)
val profile = profiles?.profiles?.find { it.selected }
if (profile == null) {
- source.sendFeedback(Text.translatable("firmament.pv.noprofile", name))
+ source.sendFeedback(Text.stringifiedTranslatable("firmament.pv.noprofile", name))
return
}
ScreenUtil.setScreenLater(CottonClientScreen(ProfileViewer(uuid, names, accountData, profile)))
} catch (e: Exception) {
Firmament.logger.error("Error loading profile data for $name", e)
- source.sendError(Text.translatable("firmament.pv.badprofile", name, e.message))
+ source.sendError(Text.stringifiedTranslatable("firmament.pv.badprofile", name, e.message))
}
}
}
diff --git a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt
index 197f560..76c88c2 100644
--- a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt
+++ b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt
@@ -49,7 +49,7 @@ object SkillPage : ProfilePage {
) {
override fun addTooltip(tooltip: TooltipBuilder) {
tooltip.add(Text.literal("$level/$maxLevel"))
- tooltip.add(Text.translatable("firmament.pv.skills.total", FirmFormatters.formatCurrency(exp, 1)))
+ tooltip.add(Text.stringifiedTranslatable("firmament.pv.skills.total", FirmFormatters.formatCurrency(exp, 1)))
}
}
}