From b1962ce66cb3591a186011dff7f29dc615f07e0c Mon Sep 17 00:00:00 2001 From: nea Date: Thu, 24 Aug 2023 18:18:13 +0200 Subject: Fix rift collections --- src/main/kotlin/moe/nea/firmament/apis/Profiles.kt | 11 ++++++++++- .../kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt | 9 +++++---- src/main/resources/assets/firmament/lang/en_us.json | 1 + 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt b/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt index 083aa19..06fe31f 100644 --- a/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt +++ b/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt @@ -10,7 +10,7 @@ package moe.nea.firmament.apis import io.github.moulberry.repo.constants.Leveling import io.github.moulberry.repo.data.Rarity -import java.util.UUID +import java.util.* import kotlinx.datetime.Instant import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -90,6 +90,15 @@ enum class Skill(val accessor: KProperty1, val color: DyeColor, } } +enum class CollectionCategory(val skill: Skill?, val color: DyeColor, val icon: SkyblockId) { + FARMING(Skill.FARMING, DyeColor.YELLOW, SkyblockId("ROOKIE_HOE")), + FORAGING(Skill.FORAGING, DyeColor.BROWN, SkyblockId("TREECAPITATOR_AXE")), + MINING(Skill.MINING, DyeColor.LIGHT_GRAY, SkyblockId("DIAMOND_PICKAXE")), + FISHING(Skill.FISHING, DyeColor.BLUE, SkyblockId("FARMER_ROD")), + COMBAT(Skill.COMBAT, DyeColor.RED, SkyblockId("UNDEAD_SWORD")), + RIFT(null, DyeColor.PURPLE, SkyblockId("SKYBLOCK_MOTE")), +} + @Serializable @JvmInline value class CollectionType(val string: String) { 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 72316f7..6b22cda 100644 --- a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt +++ b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt @@ -24,6 +24,7 @@ import net.minecraft.text.Style import net.minecraft.text.Text import net.minecraft.util.DyeColor import net.minecraft.util.Formatting +import moe.nea.firmament.apis.CollectionCategory import moe.nea.firmament.apis.CollectionInfo import moe.nea.firmament.apis.CollectionType import moe.nea.firmament.apis.Member @@ -97,9 +98,9 @@ object SkillPage : ProfilePage { return WTabPanel().also { val data = HypixelStaticData.collectionData val panels = mutableListOf() - for ((skill, collections) in data.entries) { - val skillT = Skill.values().find { it.name == skill } - val color = skillT?.color ?: DyeColor.BLACK + for ((collectionKind, collections) in data.entries) { + val skillT = CollectionCategory.values().find { it.name == collectionKind } + val color = skillT?.color ?: DyeColor.WHITE val icon = skillT?.icon?.let { RepoManager.getNEUItem(it).asItemStack() } ?: ItemStack(Items.ITEM_FRAME) val panel = WBox(Axis.HORIZONTAL).also { it.horizontalAlignment = HorizontalAlignment.CENTER @@ -121,7 +122,7 @@ object SkillPage : ProfilePage { panels.add(panel) it.add(panel) { it.tooltip( - Text.translatable("firmament.pv.skills.${skill.lowercase()}") + Text.translatable("firmament.pv.skills.${collectionKind.lowercase()}") .styled { it.withColor(color.toTextColor()) }) it.icon(ItemIcon(icon)) } diff --git a/src/main/resources/assets/firmament/lang/en_us.json b/src/main/resources/assets/firmament/lang/en_us.json index 5835699..5df94a7 100644 --- a/src/main/resources/assets/firmament/lang/en_us.json +++ b/src/main/resources/assets/firmament/lang/en_us.json @@ -57,6 +57,7 @@ "firmament.pv.skills.carpentry": "Carpentry", "firmament.pv.skills.combat": "Combat", "firmament.pv.skills.social": "Social", + "firmament.pv.skills.rift": "Rift", "firmament.pv.skills.enchanting": "Enchanting", "firmament.pv.skills.total": "Total Exp: %s", "firmament.pv.lookingup": "Looking up %s", -- cgit