aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-06-11 02:43:14 +0200
committernea <nea@nea.moe>2023-06-11 02:43:14 +0200
commita36c8f1c0eae969dcee8cf690f12d9121350212d (patch)
treeea93f19bf5f77f8b5e42a7b56162d9b6492b7fed /src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt
parent040f7c7275568d783bfa5e4ed20412f72d126549 (diff)
downloadfirmament-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.kt13
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)