Fixed dialogs with more options than the previous dialog being cut off.

This commit is contained in:
c0508383 committed 2022-08-30 00:28:47 -05:00
1 parent 1facfd133d
commit 7300cde833
1 file changed
+6 -3
@@ -87,10 +87,13 @@ public class GuiDialogInteract extends GuiNPCInterface implements IGuiClose
calculateRowHeight();
this.scaledResolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
this.drawDefaultBackground = dialog.darkenScreen;
optionStart = scaledResolution.getScaledHeight() - (options.size()) * (ClientProxy.Font.height() + dialog.optionSpaceY) - 20;
setOptionOffset();
}
public void setOptionOffset() {
optionStart = scaledResolution.getScaledHeight() - (options.size()) * (ClientProxy.Font.height() + dialog.optionSpaceY) - 20;
}
public void grabMouse(boolean grab){
if(grab && !isGrabbed){
Minecraft.getMinecraft().mouseHelper.grabMouseCursor();
@@ -154,6 +157,7 @@ public class GuiDialogInteract extends GuiNPCInterface implements IGuiClose
OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
super.drawScreen(i, j, f);
setOptionOffset();
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
@@ -602,7 +606,6 @@ public class GuiDialogInteract extends GuiNPCInterface implements IGuiClose
textPauseTime = 0;
NoppesUtil.clickSound();
}
private void closed(){
grabMouse(false);