Animation GUI Fixes

- Stop Head from following Mouse in Editor
This commit is contained in:
Kam committed 2024-03-20 01:28:08 -04:00
1 parent adad618de5
commit cf30c509d1
2 files changed
+5 -3

No files matched your search

@@ -43,6 +43,7 @@ public class GuiNPCEditAnimation extends GuiModelInterface implements ITextfield
public GuiNPCEditAnimation(GuiScreen parent, Animation animation, EntityNPCInterface npc) {
super((EntityCustomNpc) npc);
this.parent = parent;
this.followMouse = false;
xOffset = 0;
yOffset = -21;
@@ -252,7 +253,7 @@ public class GuiNPCEditAnimation extends GuiModelInterface implements ITextfield
this.addLabel(new GuiNpcLabel(67, editingPart.part.name(), guiLeft + bodyPartX + 65, guiTop + bodyPartY + 20, 0xFFFFFF));
this.addButton(new GuiNpcButton(67, guiLeft + bodyPartX + 45, guiTop + bodyPartY + 35, 60, 20, "gui.remove"));
this.addButton(new GuiNpcButton(68, guiLeft + bodyPartX + 45, guiTop + bodyPartY + 57, 60, 20, new String[] {"Sliders","Manual"}, partEditMode));
this.addButton(new GuiNpcButton(68, guiLeft + bodyPartX + 45, guiTop + bodyPartY + 57, 60, 20, new String[] {"model.sliders","model.manual"}, partEditMode));
if (partEditMode == 0) {
this.addButton(new GuiNpcButton(69, guiLeft + bodyPartX, guiTop + bodyPartY + 80, 60, 20, "model.rotate"));
@@ -24,6 +24,7 @@ public class GuiModelInterface extends GuiNPCInterface{
public int xOffset = 0;
public int yOffset = 0;
public boolean followMouse = true;
public EntityCustomNpc npc;
@@ -102,8 +103,8 @@ public class GuiModelInterface extends GuiNPCInterface{
GL11.glRotatef(-(float)Math.atan(f6 / 80F) * 20F, 1.0F, 0.0F, 0.0F);
entity.prevRenderYawOffset = entity.renderYawOffset = rotation;
entity.prevRotationYaw = entity.rotationYaw = (float)Math.atan(f5 / 80F) * 40F + rotation;
entity.rotationPitch = -(float)Math.atan(f6 / 80F) * 20F;
entity.prevRotationYawHead = entity.rotationYawHead = entity.rotationYaw;
entity.rotationPitch = followMouse ? -(float)Math.atan(f6 / 80F) * 20F : 0;
entity.prevRotationYawHead = entity.rotationYawHead = followMouse ? entity.rotationYaw : rotation;
GL11.glTranslatef(0.0F, entity.yOffset, 0.0F);
RenderManager.instance.playerViewY = 180F;