diff options
| author | Roman / Linnea Gräf <roman.graef@gmail.com> | 2022-08-26 13:24:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-26 21:24:35 +1000 |
| commit | dfd2f6b05bce74d7feb5d28e7a388dbb871ecf6a (patch) | |
| tree | 001913c4f1dd391831da26e4398f75e6731c88e1 /src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java | |
| parent | c3845685bbb3a2a7fde25476eed0f788e038dc93 (diff) | |
| download | notenoughupdates-dfd2f6b05bce74d7feb5d28e7a388dbb871ecf6a.tar.gz notenoughupdates-dfd2f6b05bce74d7feb5d28e7a388dbb871ecf6a.tar.bz2 notenoughupdates-dfd2f6b05bce74d7feb5d28e7a388dbb871ecf6a.zip | |
Of course you have pronouns in pv (#234)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java index 758ea6e8..3cbd944d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java @@ -22,7 +22,9 @@ package io.github.moulberry.notenoughupdates.profileviewer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.util.Constants; +import io.github.moulberry.notenoughupdates.util.PronounDB; import io.github.moulberry.notenoughupdates.util.Utils; import java.time.Instant; import java.time.LocalDateTime; @@ -32,6 +34,7 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.TimeZone; import java.util.TreeMap; @@ -113,9 +116,10 @@ public class ExtraPage extends GuiProfileViewerPage { ); } } + JsonObject guildInfo = profile.getGuildInformation(null); + boolean shouldRenderGuild = guildInfo != null && guildInfo.has("name"); { - JsonObject guildInfo = profile.getGuildInformation(null); - if (guildInfo != null && guildInfo.has("name")) { + if (shouldRenderGuild) { Utils.renderAlignedString( EnumChatFormatting.AQUA + "Guild", EnumChatFormatting.WHITE + guildInfo.get("name").getAsString(), @@ -125,6 +129,15 @@ public class ExtraPage extends GuiProfileViewerPage { ); } } + { + GuiProfileViewer.pronouns.peekValue().flatMap(it -> it).ifPresent(choice -> Utils.renderAlignedString( + EnumChatFormatting.GREEN + "Pronouns", + EnumChatFormatting.WHITE + String.join(" / ", choice.render()), + guiLeft + xStart, + guiTop + yStartTop + yOffset * (shouldRenderGuild ? 5 : 4), + 76 + )); + } float fairySouls = Utils.getElementAsFloat(Utils.getElement(profileInfo, "fairy_souls_collected"), 0); |
