aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2024-05-16 22:53:28 +1000
committerGitHub <noreply@github.com>2024-05-16 14:53:28 +0200
commit3c46c1065dd22d7fddcb270f7c01df0ce5c710de (patch)
treec34144293367b8aab0da7f3fceb7dd8dccfa76b4
parent38778ba299c1126f81902d4ba872d922a6d08cc3 (diff)
downloadNotEnoughUpdates-3c46c1065dd22d7fddcb270f7c01df0ce5c710de.tar.gz
NotEnoughUpdates-3c46c1065dd22d7fddcb270f7c01df0ce5c710de.tar.bz2
NotEnoughUpdates-3c46c1065dd22d7fddcb270f7c01df0ce5c710de.zip
Add bingo tier colour to icon next to name (#1155)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java46
1 files changed, 42 insertions, 4 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java
index ab423167..ea71a2b5 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java
@@ -568,8 +568,44 @@ public class BasicPage extends GuiProfileViewerPage {
}
GlStateManager.color(1, 1, 1, 1);
- JsonObject petsInfo = profile.getProfile(profileName).getPetsInfo();
+ SkyblockProfiles.SkyblockProfile currentProfile = profile.getProfile(profileName);
+ JsonObject petsInfo = currentProfile.getPetsInfo();
if (petsInfo != null) {
+ if (currentProfile.getGamemode() != null && currentProfile.getGamemode().equals("bingo")) {
+ JsonArray pets = petsInfo.get("pets").getAsJsonArray();
+ if (pets != null) {
+ for (JsonElement pet : pets) {
+ JsonObject petJsonObject = pet.getAsJsonObject();
+ if (petJsonObject.get("type") == null) break;
+ if (petJsonObject.get("type").getAsString().equals("BINGO")) {
+ if (petJsonObject.get("tier") == null) break;
+ String tier = petJsonObject.get("tier").getAsString();
+ switch (tier) {
+ case "COMMON":
+ bingoRarity = "§7";
+ break;
+ case "UNCOMMON":
+ bingoRarity = "§a";
+ break;
+ case "RARE":
+ bingoRarity = "§9";
+ break;
+ case "EPIC":
+ bingoRarity = "§5";
+ break;
+ case "LEGENDARY":
+ bingoRarity = "§6";
+ break;
+ case "MYTHIC":
+ bingoRarity = "§d";
+ break;
+ }
+ break;
+ }
+ bingoRarity = "§7";
+ }
+ }
+ }
JsonElement activePetElement = petsInfo.get("active_pet");
if (activePetElement != null && activePetElement.isJsonObject()) {
JsonObject activePet = activePetElement.getAsJsonObject();
@@ -619,8 +655,8 @@ public class BasicPage extends GuiProfileViewerPage {
int sbLevelX = guiLeft + 162;
int sbLevelY = guiTop + 74;
- double skyblockLevel = profile.getProfile(profileName).getSkyblockLevel();
- EnumChatFormatting skyblockLevelColour = profile.getProfile(profileName).getSkyblockLevelColour();
+ double skyblockLevel = currentProfile.getSkyblockLevel();
+ EnumChatFormatting skyblockLevelColour = currentProfile.getSkyblockLevelColour();
GlStateManager.pushMatrix();
GlStateManager.translate(sbLevelX, sbLevelY, 0);
@@ -777,12 +813,14 @@ public class BasicPage extends GuiProfileViewerPage {
selectedProfile.updateBeastMasterMultiplier();
}
+ private String bingoRarity = "§7";
+
private String getIcon(String gameModeType) {
switch (gameModeType) {
case "island":
return "§a☀";
case "bingo":
- return "§7Ⓑ";
+ return bingoRarity + "Ⓑ";
case "ironman":
return "§7♲";
default: