aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-17 21:08:18 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-17 21:08:18 +0200
commit86254a017fd0143291b958fbb692123fcb0fb3e3 (patch)
tree92b749465f0da42275038f422f8c873fb91c21e5
parent8a4dac9ccd128e0fb49ee9739a1ba58ef3fb7157 (diff)
parent844555116cf61e7062e31b0432533c985a19abc7 (diff)
downloadNotEnoughUpdates-86254a017fd0143291b958fbb692123fcb0fb3e3.tar.gz
NotEnoughUpdates-86254a017fd0143291b958fbb692123fcb0fb3e3.tar.bz2
NotEnoughUpdates-86254a017fd0143291b958fbb692123fcb0fb3e3.zip
Merge branch 'master' into minion_helper_2
# Conflicts: # src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java6
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java9
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java40
4 files changed, 33 insertions, 24 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java
index d4a728be..a4c5a60a 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java
@@ -726,7 +726,7 @@ public class DungeonMap {
}
GlStateManager.color(1, 1, 1, 1);
if ((!NotEnoughUpdates.INSTANCE.config.dungeons.showOwnHeadAsMarker ||
- playerMarkerMapPositions.size() <= 1 || minU != 1 / 4f) &&
+ playerMarkerMapPositions.size() < 1 || minU != 1 / 4f) &&
NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPlayerHeads >= 1 &&
playerSkinMap.containsKey(entry.getKey())) {
Minecraft.getMinecraft().getTextureManager().bindTexture(playerSkinMap.get(entry.getKey()));
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java
index 3dc59f8f..0afa2ce2 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java
@@ -45,18 +45,18 @@ import io.github.moulberry.notenoughupdates.miscfeatures.StorageManager;
import io.github.moulberry.notenoughupdates.miscgui.AccessoryBagOverlay;
import io.github.moulberry.notenoughupdates.miscgui.CalendarOverlay;
import io.github.moulberry.notenoughupdates.miscgui.GuiCustomEnchant;
-import io.github.moulberry.notenoughupdates.miscgui.hex.GuiCustomHex;
import io.github.moulberry.notenoughupdates.miscgui.GuiInvButtonEditor;
import io.github.moulberry.notenoughupdates.miscgui.GuiItemRecipe;
import io.github.moulberry.notenoughupdates.miscgui.StorageOverlay;
import io.github.moulberry.notenoughupdates.miscgui.TradeWindow;
import io.github.moulberry.notenoughupdates.miscgui.TrophyRewardOverlay;
import io.github.moulberry.notenoughupdates.miscgui.minionhelper.MinionHelperManager;
+import io.github.moulberry.notenoughupdates.miscgui.hex.GuiCustomHex;
import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer;
import io.github.moulberry.notenoughupdates.options.NEUConfig;
import io.github.moulberry.notenoughupdates.overlays.AuctionSearchOverlay;
-import io.github.moulberry.notenoughupdates.overlays.EquipmentOverlay;
import io.github.moulberry.notenoughupdates.overlays.BazaarSearchOverlay;
+import io.github.moulberry.notenoughupdates.overlays.EquipmentOverlay;
import io.github.moulberry.notenoughupdates.overlays.OverlayManager;
import io.github.moulberry.notenoughupdates.overlays.RancherBootOverlay;
import io.github.moulberry.notenoughupdates.overlays.TextOverlay;
@@ -803,6 +803,8 @@ public class RenderListener {
JsonObject bazaarInfo = neu.manager.auctionManager.getBazaarInfo(internal);
if (bazaarInfo != null && bazaarInfo.has("curr_sell")) {
bazaarPrice = bazaarInfo.get("curr_sell").getAsFloat();
+ } else if (bazaarInfo != null) {
+ bazaarPrice = 0;
}
if (bazaarPrice < 5000000 && internal.equals("RECOMBOBULATOR_3000")) bazaarPrice = 5000000;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java
index 4d18ea18..7aa0d2ec 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java
@@ -85,6 +85,15 @@ public class GuiInvButtonEditor extends GuiScreen {
private int guiLeft;
private int guiTop;
+ //region getGuiCoordinates
+ public int getGuiLeft() {
+ return this.guiLeft;
+ }
+ public int getGuiTop() {
+ return this.guiTop;
+ }
+ //endregion
+
private static final int BACKGROUND_TYPES = 5;
private static final int ICON_TYPES = 3;
private int iconTypeIndex = 0;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java
index ea440396..2d3175b5 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java
@@ -26,6 +26,7 @@ import io.github.moulberry.notenoughupdates.NEUManager;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.events.GuiInventoryBackgroundDrawnEvent;
import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay;
+import io.github.moulberry.notenoughupdates.miscgui.GuiInvButtonEditor;
import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer;
import io.github.moulberry.notenoughupdates.options.NEUConfig;
import io.github.moulberry.notenoughupdates.util.ItemUtils;
@@ -134,6 +135,8 @@ public class EquipmentOverlay {
public static final int ARMOR_OVERLAY_OVERHAND_WIDTH = 24;
public static final int ARMOR_OVERLAY_HEIGHT = 86;
public static final int ARMOR_OVERLAY_WIDTH = 31;
+ final static int PET_OVERLAY_HEIGHT = 32;
+ final static int PET_OVERLAY_WIDTH = 31;
public static final int PET_OVERLAY_OFFSET_Y = ARMOR_OVERLAY_HEIGHT - 14 /* overlaying pixels */;
//</editor-fold>
@@ -259,7 +262,7 @@ public class EquipmentOverlay {
if (screen instanceof GuiChest) {
petStack = getRepoPetStack();
}
- if (!(screen instanceof GuiInventory)
+ if ((!(screen instanceof GuiInventory) && !(screen instanceof GuiInvButtonEditor))
|| !NotEnoughUpdates.INSTANCE.config.misc.hidePotionEffect
|| !NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) {
shouldRenderPets = shouldRenderArmorHud = false;
@@ -299,7 +302,7 @@ public class EquipmentOverlay {
int overlayLeft = container.getGuiLeft() - ARMOR_OVERLAY_OVERHAND_WIDTH;
int overlayTop = container.getGuiTop() + PET_OVERLAY_OFFSET_Y;
- Utils.drawTexturedRect(overlayLeft, overlayTop, 31, 32, GL11.GL_NEAREST);
+ Utils.drawTexturedRect(overlayLeft, overlayTop, PET_OVERLAY_WIDTH, PET_OVERLAY_HEIGHT, GL11.GL_NEAREST);
GlStateManager.bindTexture(0);
Utils.drawItemStack(petInfo, overlayLeft + 8, overlayTop + 8, true);
@@ -423,33 +426,28 @@ public class EquipmentOverlay {
}
public void renderPreviewArmorHud() {
- if (!NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud) return;
+ if (!NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud || !(Minecraft.getMinecraft().currentScreen instanceof GuiInvButtonEditor)) return;
+ GuiInvButtonEditor container = (GuiInvButtonEditor) Minecraft.getMinecraft().currentScreen;
- int width = Utils.peekGuiScale().getScaledWidth();
- int height = Utils.peekGuiScale().getScaledHeight();
+ int overlayLeft = container.getGuiLeft() - ARMOR_OVERLAY_OVERHAND_WIDTH;
+ int overlayTop = container.getGuiTop();
- Minecraft.getMinecraft().getTextureManager().bindTexture(getCustomEquipmentTexture(NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay));
+ ResourceLocation equipmentTexture = getCustomEquipmentTexture(shouldRenderPets);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(equipmentTexture);
- GlStateManager.color(1, 1, 1, 1);
- GL11.glTranslatef(0, 0, 401);
- float yNumber = (float) (height - 167) / 2f;
- Utils.drawTexturedRect((float) ((width - 224.1) / 2f), yNumber, 31, 86, GL11.GL_NEAREST);
- GlStateManager.bindTexture(0);
+ Utils.drawTexturedRect(overlayLeft, overlayTop, ARMOR_OVERLAY_WIDTH, ARMOR_OVERLAY_HEIGHT, GL11.GL_NEAREST);
}
public void renderPreviewPetInvHud() {
- if (!NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay) return;
-
- int width = Utils.peekGuiScale().getScaledWidth();
- int height = Utils.peekGuiScale().getScaledHeight();
+ if (!NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay || !(Minecraft.getMinecraft().currentScreen instanceof GuiInvButtonEditor)) return;
+ GuiInvButtonEditor container = (GuiInvButtonEditor) Minecraft.getMinecraft().currentScreen;
+ int overlayLeft = container.getGuiLeft() - ARMOR_OVERLAY_OVERHAND_WIDTH;
+ int overlayTop = container.getGuiTop() + PET_OVERLAY_OFFSET_Y;
- Minecraft.getMinecraft().getTextureManager().bindTexture(getCustomPetTexture(NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud));
+ ResourceLocation petHudTexture = getCustomPetTexture(shouldRenderArmorHud);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(petHudTexture);
- GlStateManager.color(1, 1, 1, 1);
- GL11.glTranslatef(0, 0, 401);
- float yNumber = (float) (height - 23) / 2f;
- Utils.drawTexturedRect((float) ((width - 224.1) / 2f), yNumber, 31, 32, GL11.GL_NEAREST);
- GlStateManager.bindTexture(0);
+ Utils.drawTexturedRect(overlayLeft, overlayTop, PET_OVERLAY_WIDTH, PET_OVERLAY_HEIGHT, GL11.GL_NEAREST);
}
public ItemStack slot1 = null;