aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java145
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/PetOverlay.java12
2 files changed, 117 insertions, 40 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java
index 9d346638..5e86f2ac 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java
@@ -460,7 +460,9 @@ public class PetInfoOverlay extends TextOverlay {
if (currentPet.petItem != null) {
JsonObject json = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(currentPet.petItem);
if (json != null) {
- String name = NotEnoughUpdates.INSTANCE.manager.jsonToStack(json).getDisplayName();
+ String name;
+ if (!NotEnoughUpdates.INSTANCE.config.petOverlay.petItemIcon) name = NotEnoughUpdates.INSTANCE.manager.jsonToStack(json).getDisplayName();
+ else name = "";
petItemStr = EnumChatFormatting.AQUA + "Held Item: " + name;
}
}
@@ -603,52 +605,28 @@ public class PetInfoOverlay extends TextOverlay {
return;
}
- if (!NotEnoughUpdates.INSTANCE.config.petOverlay.petOverlayIcon) return;
- int mythicRarity = currentPet.rarity.petId;
- JsonObject petItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(
- currentPet.skin != null ? currentPet.skin : (currentPet.petType + ";" + mythicRarity));
-
- if (petItem == null && currentPet.rarity.petId == 5) {
- petItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(
- currentPet.skin != null ? currentPet.skin : (currentPet.petType + ";" + 4));
- }
-
- if (petItem != null) {
- Vector2f position = getPosition(overlayWidth, overlayHeight, true);
- int x = (int) position.x;
- int y = (int) position.y;
-
- ItemStack stack = NotEnoughUpdates.INSTANCE.manager.jsonToStack(petItem);
- GlStateManager.enableDepth();
- GlStateManager.pushMatrix();
- Utils.pushGuiScale(NotEnoughUpdates.INSTANCE.config.locationedit.guiScale);
+ if (NotEnoughUpdates.INSTANCE.config.petOverlay.petOverlayIcon) {
+ int mythicRarity = currentPet.rarity.petId;
+ JsonObject petItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(
+ currentPet.skin != null ? currentPet.skin : (currentPet.petType + ";" + mythicRarity));
- if (firstPetLines == 1) y -= 9;
- if (firstPetLines == 2) y -= 3;
-
- GlStateManager.translate(x - 2, y - 2, 0);
- GlStateManager.scale(2, 2, 1);
- Utils.drawItemStack(stack, 0, 0);
- Utils.pushGuiScale(0);
- GlStateManager.popMatrix();
- }
+ if (petItem == null && currentPet.rarity.petId == 5) {
+ petItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(
+ currentPet.skin != null ? currentPet.skin : (currentPet.petType + ";" + 4));
+ }
- Pet currentPet2 = getCurrentPet2();
- if (currentPet2 != null) {
- JsonObject petItem2 = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(
- currentPet2.skin != null ? currentPet2.skin : (currentPet2.petType + ";" + currentPet2.rarity.petId));
- if (petItem2 != null) {
+ if (petItem != null) {
Vector2f position = getPosition(overlayWidth, overlayHeight, true);
int x = (int) position.x;
- int y = (int) position.y + (overlayStrings.size() - secondPetLines) * 10;
+ int y = (int) position.y;
- ItemStack stack = NotEnoughUpdates.INSTANCE.manager.jsonToStack(petItem2);
+ ItemStack stack = NotEnoughUpdates.INSTANCE.manager.jsonToStack(petItem);
GlStateManager.enableDepth();
GlStateManager.pushMatrix();
Utils.pushGuiScale(NotEnoughUpdates.INSTANCE.config.locationedit.guiScale);
- if (secondPetLines == 1) y -= 9;
- if (secondPetLines == 2) y -= 3;
+ if (firstPetLines == 1) y -= 9;
+ if (firstPetLines == 2) y -= 3;
GlStateManager.translate(x - 2, y - 2, 0);
GlStateManager.scale(2, 2, 1);
@@ -656,6 +634,97 @@ public class PetInfoOverlay extends TextOverlay {
Utils.pushGuiScale(0);
GlStateManager.popMatrix();
}
+
+ Pet currentPet2 = getCurrentPet2();
+ if (currentPet2 != null) {
+ JsonObject petItem2 = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(
+ currentPet2.skin != null ? currentPet2.skin : (currentPet2.petType + ";" + currentPet2.rarity.petId));
+ if (petItem2 != null) {
+ Vector2f position = getPosition(overlayWidth, overlayHeight, true);
+ int x = (int) position.x;
+ int y = (int) position.y + (overlayStrings.size() - secondPetLines) * 10;
+
+ ItemStack stack = NotEnoughUpdates.INSTANCE.manager.jsonToStack(petItem2);
+ GlStateManager.enableDepth();
+ GlStateManager.pushMatrix();
+ Utils.pushGuiScale(NotEnoughUpdates.INSTANCE.config.locationedit.guiScale);
+
+ if (secondPetLines == 1) y -= 9;
+ if (secondPetLines == 2) y -= 3;
+
+ GlStateManager.translate(x - 2, y - 2, 0);
+ GlStateManager.scale(2, 2, 1);
+ Utils.drawItemStack(stack, 0, 0);
+ Utils.pushGuiScale(0);
+ GlStateManager.popMatrix();
+ }
+ }
+ }
+
+ if (NotEnoughUpdates.INSTANCE.config.petOverlay.petItemIcon) {
+ int backgroundOffset = (NotEnoughUpdates.INSTANCE.config.petOverlay.petInfoOverlayStyle == 0) ? 0 : 5;
+ if (currentPet.petItem != null) {
+ JsonObject petHeldItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(currentPet.petItem);
+
+ if (petHeldItem != null) {
+ Vector2f position = getPosition(overlayWidth, overlayHeight, true);
+ int x = (int) position.x;
+ int y = (int) position.y;
+
+ ItemStack stack = NotEnoughUpdates.INSTANCE.manager.jsonToStack(petHeldItem);
+ GlStateManager.enableDepth();
+ GlStateManager.pushMatrix();
+ Utils.pushGuiScale(NotEnoughUpdates.INSTANCE.config.locationedit.guiScale);
+
+ int counter = 0;
+ for (String line : overlayStrings) {
+ if (line.contains("Held Item:")) {
+ break;
+ }
+ counter++;
+ }
+ if (counter >= overlayStrings.size()) {
+ return;
+ }
+
+ GlStateManager.translate(x + 77, y + (10 * counter) + 2 - backgroundOffset, 0);
+ Utils.drawItemStack(stack, 0, 0);
+ Utils.pushGuiScale(0);
+ GlStateManager.popMatrix();
+ }
+ }
+
+ Pet currentPet2 = getCurrentPet2();
+ if (currentPet2 != null && currentPet2.petItem != null) {
+ JsonObject petHeldItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(currentPet2.petItem);
+
+ if (petHeldItem != null) {
+ Vector2f position = getPosition(overlayWidth, overlayHeight, true);
+ int x = (int) position.x;
+ int y = (int) position.y + (overlayStrings.size() - secondPetLines) * 10;
+
+ ItemStack stack = NotEnoughUpdates.INSTANCE.manager.jsonToStack(petHeldItem);
+ GlStateManager.enableDepth();
+ GlStateManager.pushMatrix();
+ Utils.pushGuiScale(NotEnoughUpdates.INSTANCE.config.locationedit.guiScale);
+
+ int counter = 0;
+ for (String line : overlayStrings) {
+ if (line.contains("Held Item:")) {
+ break;
+ }
+ counter++;
+ }
+ if (counter >= overlayStrings.size()) {
+ return;
+ }
+
+ GlStateManager.translate(x + 77, y + (10 * counter) + 2 - backgroundOffset, 0);
+ Utils.drawItemStack(stack, 0, 0);
+ Utils.pushGuiScale(0);
+ GlStateManager.popMatrix();
+ }
+ }
}
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/PetOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/PetOverlay.java
index 8a0f7884..e015c05d 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/PetOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/PetOverlay.java
@@ -20,11 +20,11 @@
package io.github.moulberry.notenoughupdates.options.separatesections;
import com.google.gson.annotations.Expose;
-import io.github.moulberry.notenoughupdates.core.config.Position;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList;
import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown;
import io.github.moulberry.moulconfig.annotations.ConfigOption;
+import io.github.moulberry.notenoughupdates.core.config.Position;
import java.util.ArrayList;
import java.util.Arrays;
@@ -65,13 +65,21 @@ public class PetOverlay {
@Expose
@ConfigOption(
name = "Pet Overlay Icon",
- desc = "Show the icon of the pet you have equiped in the overlay"
+ desc = "Show the icon of the pet you have equipped in the overlay"
)
@ConfigEditorBoolean
public boolean petOverlayIcon = true;
@Expose
@ConfigOption(
+ name = "Pet Item Icon",
+ desc = "Show the icon of the pet item you have equipped in the overlay"
+ )
+ @ConfigEditorBoolean
+ public boolean petItemIcon = false;
+
+ @Expose
+ @ConfigOption(
name = "Pet Info Overlay Style",
desc = "Change the style of the Pet Info overlay"
)