More Cleanup

This commit is contained in:
Kam committed 2025-05-20 13:53:32 -04:00
1 parent 43bc1eb81f
commit ae7e7018c5
12 files changed
+39 -42

No files matched your search

@@ -78,10 +78,10 @@ public class SubGuiMagicCycle extends SubGuiInterface implements ITextfieldListe
String index = "gui.unused";
String priority = "gui.unused";
if(cycle.layout == EnumDiagramLayout.MANUAL) {
if (cycle.layout == EnumDiagramLayout.MANUAL) {
index = "X";
priority = "Y";
} else if(cycle.layout.isManual()) {
} else if (cycle.layout.isManual()) {
index = "magic.index";
priority = "magic.priority";
}
@@ -41,9 +41,9 @@ public class SubGuiNpcDialogVisual extends SubGuiInterface implements ISubGuiLis
GuiMenuTopButton general = new GuiMenuTopButton(1, guiLeft + 4, guiTop - 17, "General");
GuiMenuTopButton spacing = new GuiMenuTopButton(2, general.xPosition + general.getWidth(), guiTop - 17, "Spacing");
GuiMenuTopButton images = new GuiMenuTopButton(3, spacing.xPosition + spacing.getWidth(), guiTop - 17, "Images");
GuiMenuTopButton colours = new GuiMenuTopButton(5, images.xPosition + images.getWidth(), guiTop - 17, "Colors");
GuiMenuTopButton colours = new GuiMenuTopButton(5, images.xPosition + images.getWidth(), guiTop - 17, "Colors");
topButtons = new GuiMenuTopButton[]{general,images,spacing,close,colours};
topButtons = new GuiMenuTopButton[]{general, images, spacing, close, colours};
for (GuiMenuTopButton button : topButtons) {
button.active = button.id == activeMenu;
addButton(button);
@@ -243,8 +243,7 @@ public class SubGuiNpcDialogVisual extends SubGuiInterface implements ISubGuiLis
getButton(24).setVisible(dialogImage.imageType == 0);
getLabel(21).enabled = dialogImage.imageType == 0;
}
}
else if (activeMenu == 5) {
} else if (activeMenu == 5) {
addButton(new GuiNpcButtonYesNo(10, guiLeft + 180, y += 22, 60, 20, dialog.colorData.getEnableColorSettings()));
addLabel(new GuiNpcLabel(10, "dialog.enableColorSettings", guiLeft + 4, y + 5));
if (dialog.colorData.getEnableColorSettings()) {
@@ -432,7 +431,7 @@ public class SubGuiNpcDialogVisual extends SubGuiInterface implements ISubGuiLis
if (activeMenu == 5) {
DialogColorData colData = dialog.colorData;
if (button.id == 10) {
colData.setEnableColorSettings(button.getValue()==1);
colData.setEnableColorSettings(button.getValue() == 1);
}
if (button.id == 11) {
setSubGui(new SubGuiColorSelector(colData.getLineColor1()));
@@ -497,13 +496,13 @@ public class SubGuiNpcDialogVisual extends SubGuiInterface implements ISubGuiLis
colData.setLineColor1(((SubGuiColorSelector) subgui).color);
} else if (lastColorClicked == 3) {
colData.setLineColor2(((SubGuiColorSelector) subgui).color);
}else if (lastColorClicked == 4) {
} else if (lastColorClicked == 4) {
colData.setLineColor3(((SubGuiColorSelector) subgui).color);
}else if (lastColorClicked == 5) {
} else if (lastColorClicked == 5) {
colData.setSlotColor(((SubGuiColorSelector) subgui).color);
}else if (lastColorClicked == 6) {
} else if (lastColorClicked == 6) {
colData.setButtonAcceptColor(((SubGuiColorSelector) subgui).color);
}else if (lastColorClicked == 7) {
} else if (lastColorClicked == 7) {
colData.setButtonRejectColor(((SubGuiColorSelector) subgui).color);
}
initGui();
@@ -105,7 +105,7 @@ public class SubGuiScriptParticle extends SubGuiInterface implements ITextfieldL
}
@Override
public void close(){
public void close() {
GuiNpcTextField.unfocus();
super.close();
}
@@ -16,12 +16,13 @@ public class BlurEventHandler {
if (Minecraft.getMinecraft().theWorld != null) {
EntityRenderer er = Minecraft.getMinecraft().entityRenderer;
if (er.getShaderGroup() == null && (event.gui instanceof GuiModernDialogInteract) || (event.gui instanceof GuiModernQuestDialog)) {
loadEffect(er,new ResourceLocation("customnpcs", "shaders/post/blur.json"));
} else if (er.getShaderGroup()!=null && !(event.gui instanceof GuiModernDialogInteract)) {
loadEffect(er, new ResourceLocation("customnpcs", "shaders/post/blur.json"));
} else if (er.getShaderGroup() != null && !(event.gui instanceof GuiModernDialogInteract)) {
er.deactivateShader();
}
}
}
public static void loadEffect(EntityRenderer er, ResourceLocation p_175069_1_) {
if (er.theShaderGroup != null) {
er.theShaderGroup.deleteShaderGroup();
@@ -102,7 +102,7 @@ public class GuiNpcSquareButton extends GuiNpcButton {
}
// Or if click is in the icon area, we also treat it as a click.
return mouseX >= xPosition && mouseX < xPosition + size &&
mouseY >= yPosition && mouseY < yPosition + iconAreaHeight;
mouseY >= yPosition && mouseY < yPosition + iconAreaHeight;
}
@Override
@@ -93,8 +93,8 @@ public class GuiTexturedButton extends GuiNpcButton {
mc.getTextureManager().bindTexture(this.location);
this.drawTexturedModalRect(0, 0, this.textureX, this.textureY, this.width, this.height);
GL11.glTranslated(0.0D, 0.0D, 0.1D);
this.drawCenteredString(mc.fontRenderer, this.label, (int) (this.xPosition + ((float)this.width)*scale / 2f),
(int) (this.yPosition+(((float)this.height)*scale- ClientProxy.Font.height()+4) / 2f), this.color);
this.drawCenteredString(mc.fontRenderer, this.label, (int) (this.xPosition + ((float) this.width) * scale / 2f),
(int) (this.yPosition + (((float) this.height) * scale - ClientProxy.Font.height() + 4) / 2f), this.color);
} else {
FontRenderer fontrenderer = mc.fontRenderer;
mc.getTextureManager().bindTexture(buttonTextures);
@@ -159,12 +159,11 @@ public class GuiTexturedButton extends GuiNpcButton {
}
@Override
public boolean mousePressed(Minecraft minecraft, int i, int j)
{
public boolean mousePressed(Minecraft minecraft, int i, int j) {
boolean bo = this.enabled && this.visible && i >= this.xPosition && j >= this.yPosition
&& i < this.xPosition + this.width*scale && j < this.yPosition + this.height*scale;
if(bo && display != null && display.length != 0){
setDisplay((getValue()+1) % display.length);
&& i < this.xPosition + this.width * scale && j < this.yPosition + this.height * scale;
if (bo && display != null && display.length != 0) {
setDisplay((getValue() + 1) % display.length);
}
return bo;
}