diff options
author | nea <nea@nea.moe> | 2023-06-11 02:43:14 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-06-11 02:43:14 +0200 |
commit | a36c8f1c0eae969dcee8cf690f12d9121350212d (patch) | |
tree | ea93f19bf5f77f8b5e42a7b56162d9b6492b7fed /src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt | |
parent | 040f7c7275568d783bfa5e4ed20412f72d126549 (diff) | |
download | Firmament-a36c8f1c0eae969dcee8cf690f12d9121350212d.tar.gz Firmament-a36c8f1c0eae969dcee8cf690f12d9121350212d.tar.bz2 Firmament-a36c8f1c0eae969dcee8cf690f12d9121350212d.zip |
Add collection info to skill page
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt index 62889bd..20e11e7 100644 --- a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt +++ b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt @@ -14,8 +14,10 @@ import net.minecraft.client.item.TooltipContext import net.minecraft.item.Items import net.minecraft.text.Text import moe.nea.firmament.gui.WTightScrollPanel +import moe.nea.firmament.gui.WTitledItem import moe.nea.firmament.rei.PetData import moe.nea.firmament.rei.SBItemStack +import moe.nea.firmament.repo.RepoManager object PetsPage : ProfilePage { override fun getElements(profileViewer: ProfileViewer): WWidget { @@ -26,16 +28,7 @@ object PetsPage : ProfilePage { it.setGaps(8, 8) for ((i, pet) in profileViewer.member.pets.withIndex()) { val stack = SBItemStack(pet.itemId, PetData(pet.tier, pet.type.name, pet.exp)).asItemStack() - it.add(object : WItem(stack) { - override fun paint(context: DrawContext?, x: Int, y: Int, mouseX: Int, mouseY: Int) { - BackgroundPainter.SLOT.paintBackground(context, x, y, this) - super.paint(context, x, y, mouseX, mouseY) - } - - override fun addTooltip(tooltip: TooltipBuilder) { - tooltip.add(*stack.getTooltip(null, TooltipContext.BASIC).toTypedArray()) - } - }, i % 5, i / 5, 1, 1) + it.add(WTitledItem(stack), i % 5, i / 5, 1, 1) } it.layout() })), 0, 1, 8, 8) |