aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-06-02 02:32:02 +0200
committernea <nea@nea.moe>2023-06-02 02:32:02 +0200
commit3d76538cef0cb150415ef5db734c80fb0dec7e85 (patch)
tree1fdeaf1f42e4a34d6637c3c74e9993ffcf8e4064 /src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt
parentb61476608ec00642c5dc27cbfe02b4acf26c18d2 (diff)
downloadFirmament-3d76538cef0cb150415ef5db734c80fb0dec7e85.tar.gz
Firmament-3d76538cef0cb150415ef5db734c80fb0dec7e85.tar.bz2
Firmament-3d76538cef0cb150415ef5db734c80fb0dec7e85.zip
Display rank alongside name
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt')
-rw-r--r--src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt12
1 files changed, 11 insertions, 1 deletions
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 8f0693f..d189b5b 100644
--- a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt
+++ b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt
@@ -10,6 +10,7 @@ import io.github.cottonmc.cotton.gui.widget.icon.ItemIcon
import net.minecraft.item.ItemStack
import net.minecraft.item.Items
import net.minecraft.text.Text
+import net.minecraft.util.Formatting
import moe.nea.firmament.apis.Skill
import moe.nea.firmament.gui.WBar
import moe.nea.firmament.repo.RepoManager
@@ -19,7 +20,16 @@ object SkillPage : ProfilePage {
override fun getElements(profileViewer: ProfileViewer): WWidget {
return WGridPanel().also {
it.insets = Insets.ROOT_PANEL
- it.add(WText(Text.literal(profileViewer.primaryName /* with rank? */)), 0, 0, 6, 1)
+ it.add(
+ WText(
+ Text.literal(
+ profileViewer.account.rankData?.let {
+ ("§${it.color}[${it.tag}${profileViewer.account.rankPlusDyeColor.modern}" +
+ "${it.plus ?: ""}§${it.color}] ${profileViewer.primaryName}")
+ } ?: "§${Formatting.GRAY}${profileViewer.primaryName}"
+ )
+ ), 0, 0, 6, 1
+ )
for ((i, skill) in Skill.values().withIndex()) {
val leveling = RepoManager.neuRepo.constants.leveling
val exp = skill.accessor.get(profileViewer.member)