Fixed tooltip text not being wrapped for trait descriptions in the discoveries tab

This commit is contained in:
Sollace 2023-08-29 15:19:09 +01:00
parent 0d4b9c0db0
commit f9b6cf75f4
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -9,6 +9,7 @@ import com.minelittlepony.common.client.gui.element.Label;
import com.minelittlepony.common.client.gui.sprite.TextureSprite;
import com.minelittlepony.unicopia.USounds;
import com.minelittlepony.unicopia.ability.magic.spell.trait.*;
import com.minelittlepony.unicopia.client.FlowingText;
import com.minelittlepony.unicopia.client.gui.spellbook.SpellbookChapterList.Chapter;
import com.minelittlepony.unicopia.client.gui.spellbook.SpellbookScreen.ImageButton;
import com.minelittlepony.unicopia.container.SpellbookState;
@ -190,7 +191,7 @@ public class SpellbookTraitDexPageContent implements SpellbookChapterList.Conten
.setTextureSize(16, 16)
.setSize(16, 16)
.setTexture(trait.getSprite()));
getStyle().setTooltip(trait.getTooltip());
getStyle().setTooltip(Tooltip.of(FlowingText.wrap(trait.getTooltip(), 200).toList()));
onClick(sender -> Pony.of(MinecraftClient.getInstance().player).getDiscoveries().markRead(trait));
}