diff --git a/src/main/java/noppes/npcs/client/gui/model/GuiModelScale.java b/src/main/java/noppes/npcs/client/gui/model/GuiModelScale.java index 234753004..661b0b6ab 100644 --- a/src/main/java/noppes/npcs/client/gui/model/GuiModelScale.java +++ b/src/main/java/noppes/npcs/client/gui/model/GuiModelScale.java @@ -162,11 +162,11 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{ @Override public void mousePressed(GuiNpcSlider slider) { - // TODO Auto-generated method stub - + allowRotate = false; } @Override public void mouseReleased(GuiNpcSlider slider) { + allowRotate = true; } } diff --git a/src/main/java/noppes/npcs/client/gui/util/GuiModelInterface.java b/src/main/java/noppes/npcs/client/gui/util/GuiModelInterface.java index fd4f1c6eb..a3163a45c 100644 --- a/src/main/java/noppes/npcs/client/gui/util/GuiModelInterface.java +++ b/src/main/java/noppes/npcs/client/gui/util/GuiModelInterface.java @@ -27,6 +27,7 @@ public class GuiModelInterface extends GuiNPCInterface { public int yOffset = 0, yOffsetButton = 0; public boolean followMouse = true, drawNPConSub = true; + public boolean allowRotate = true; public boolean drawRenderButtons = true, drawXButton = true; public EntityCustomNpc npc; @@ -36,6 +37,7 @@ public class GuiModelInterface extends GuiNPCInterface { playerdata = npc.modelData; xSize = 380; drawDefaultBackground = false; + closeOnEsc = true; } @Override @@ -71,13 +73,24 @@ public class GuiModelInterface extends GuiNPCInterface { private long start = -1; public boolean isMouseOverRenderer(int x, int y) { - return x >= guiLeft + xOffset + 40 && x <= guiLeft + xOffset + 330 && y >= guiTop + yOffset - 50 && y <= guiTop + yOffset + 250; - } + if(!allowRotate){ + return false; + } + // Center of the entity rendering + int centerX = guiLeft + 190 + xOffset; // Matches l in drawScreen() + int centerY = guiTop + 180 + yOffset; // Matches i1 in drawScreen() + // Define separate buffers for X and Y axes + int xBuffer = 100; // Horizontal buffer + int yBuffer = 150; // Vertical buffer + + // Check if the mouse is within the buffer area + return mouseX >= centerX - xBuffer && mouseX <= centerX + xBuffer && + mouseY >= centerY - yBuffer && mouseY <= centerY + yBuffer; + } public void preRender(EntityLivingBase entity) { EntityUtil.Copy(npc, entity); - } public void postRender(EntityLivingBase entity) {