diff --git a/src/main/java/de/florianmichael/viamcp/gui/GuiProtocolSelector.java b/src/main/java/de/florianmichael/viamcp/gui/GuiProtocolSelector.java index f06cead0..f929403c 100644 --- a/src/main/java/de/florianmichael/viamcp/gui/GuiProtocolSelector.java +++ b/src/main/java/de/florianmichael/viamcp/gui/GuiProtocolSelector.java @@ -60,7 +60,7 @@ public void handleMouseInput() throws IOException { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { - list.drawScreen(mouseX, mouseY, partialTicks); + list.drawScreen(mouseX, mouseY); GlStateManager.pushMatrix(); GlStateManager.scale(2.0, 2.0, 2.0); String title = EnumChatFormatting.BOLD + "ViaMCP"; diff --git a/src/main/java/dev/thoq/backend/BackendConnector.java b/src/main/java/dev/thoq/backend/BackendConnector.java index 49475097..22614cad 100644 --- a/src/main/java/dev/thoq/backend/BackendConnector.java +++ b/src/main/java/dev/thoq/backend/BackendConnector.java @@ -21,6 +21,7 @@ package dev.thoq.backend; import dev.thoq.Alya; +import net.minecraft.client.Minecraft; import java.io.IOException; import java.net.URI; @@ -47,6 +48,7 @@ private void sendUserOnline() throws IOException, InterruptedException { } public void poll() { + if(!Minecraft.getMinecraft().gameSettings.sense) return; try { sendUserOnline(); } catch(final Exception exception) { diff --git a/src/main/java/net/minecraft/client/gui/GuiControls.java b/src/main/java/net/minecraft/client/gui/GuiControls.java index 01a85720..23d85701 100644 --- a/src/main/java/net/minecraft/client/gui/GuiControls.java +++ b/src/main/java/net/minecraft/client/gui/GuiControls.java @@ -149,7 +149,7 @@ protected void keyTyped(char typedChar, int keyCode) throws IOException { /** Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks */ public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - this.keyBindingList.drawScreen(mouseX, mouseY, partialTicks); + this.keyBindingList.drawScreen(mouseX, mouseY); this.drawCenteredString(this.screenTitle, this.width / 2, 8, 16777215); boolean flag = true; diff --git a/src/main/java/net/minecraft/client/gui/GuiCreateFlatWorld.java b/src/main/java/net/minecraft/client/gui/GuiCreateFlatWorld.java index c40600b8..865b1e20 100644 --- a/src/main/java/net/minecraft/client/gui/GuiCreateFlatWorld.java +++ b/src/main/java/net/minecraft/client/gui/GuiCreateFlatWorld.java @@ -112,7 +112,7 @@ private boolean func_146382_i() public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - this.createFlatWorldListSlotGui.drawScreen(mouseX, mouseY, partialTicks); + this.createFlatWorldListSlotGui.drawScreen(mouseX, mouseY); this.drawCenteredString(this.fontRendererObj, this.flatWorldTitle, this.width / 2, 8, 16777215); int i = this.width / 2 - 92 - 16; this.drawString(this.fontRendererObj, this.field_146394_i, i, 32, 16777215); diff --git a/src/main/java/net/minecraft/client/gui/GuiCustomizeWorldScreen.java b/src/main/java/net/minecraft/client/gui/GuiCustomizeWorldScreen.java index 8674e067..d18e2e2b 100644 --- a/src/main/java/net/minecraft/client/gui/GuiCustomizeWorldScreen.java +++ b/src/main/java/net/minecraft/client/gui/GuiCustomizeWorldScreen.java @@ -1756,7 +1756,7 @@ protected void mouseReleased(int mouseX, int mouseY, int state) { /** Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks */ public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - this.field_175349_r.drawScreen(mouseX, mouseY, partialTicks); + this.field_175349_r.drawScreen(mouseX, mouseY); this.drawCenteredString(this.field_175341_a, this.width / 2, 2, 16777215); this.drawCenteredString(this.field_175333_f, this.width / 2, 12, 16777215); this.drawCenteredString(this.field_175335_g, this.width / 2, 22, 16777215); diff --git a/src/main/java/net/minecraft/client/gui/GuiFlatPresets.java b/src/main/java/net/minecraft/client/gui/GuiFlatPresets.java index 15f5a77a..e51c5f90 100644 --- a/src/main/java/net/minecraft/client/gui/GuiFlatPresets.java +++ b/src/main/java/net/minecraft/client/gui/GuiFlatPresets.java @@ -83,7 +83,7 @@ protected void actionPerformed(GuiButton button) throws IOException { public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - this.field_146435_s.drawScreen(mouseX, mouseY, partialTicks); + this.field_146435_s.drawScreen(mouseX, mouseY); this.drawCenteredString(this.fontRendererObj, this.presetsTitle, this.width / 2, 8, 16777215); this.drawString(this.fontRendererObj, this.presetsShare, 50, 30, 10526880); this.drawString(this.fontRendererObj, this.field_146436_r, 50, 70, 10526880); diff --git a/src/main/java/net/minecraft/client/gui/GuiLanguage.java b/src/main/java/net/minecraft/client/gui/GuiLanguage.java index 9e1605cb..fb460068 100644 --- a/src/main/java/net/minecraft/client/gui/GuiLanguage.java +++ b/src/main/java/net/minecraft/client/gui/GuiLanguage.java @@ -97,7 +97,7 @@ protected void actionPerformed(GuiButton button) throws IOException { /** Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks */ public void drawScreen(int mouseX, int mouseY, float partialTicks) { - this.list.drawScreen(mouseX, mouseY, partialTicks); + this.list.drawScreen(mouseX, mouseY); this.drawCenteredString( I18n.format("options.language", new Object[0]), this.width / 2, 16, 16777215); this.drawCenteredString( diff --git a/src/main/java/net/minecraft/client/gui/GuiMainMenu.java b/src/main/java/net/minecraft/client/gui/GuiMainMenu.java index 6a544eed..fcdb68dd 100644 --- a/src/main/java/net/minecraft/client/gui/GuiMainMenu.java +++ b/src/main/java/net/minecraft/client/gui/GuiMainMenu.java @@ -7,19 +7,25 @@ import dev.thoq.gui.auth.AltManagerGui; import dev.thoq.util.font.AlyaFontRenderer; import dev.thoq.util.misc.BrowserUtil; -import dev.thoq.util.render.ShaderUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.client.resources.I18n; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; +import net.optifine.CustomPanorama; +import net.optifine.CustomPanoramaProperties; import net.optifine.reflect.Reflector; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GLContext; +import org.lwjgl.util.glu.Project; import java.io.IOException; import java.util.Calendar; @@ -38,16 +44,15 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback { private static final Logger logger = LogManager.getLogger(GuiMainMenu.class); private static final Random RANDOM = new Random(); - private static ShaderUtil menuShader = null; - + private float updateCounter; + private int panoramaTimer; + private static final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[]{new ResourceLocation("client/panorama/panorama_0.png"), new ResourceLocation("client/panorama/panorama_1.png"), new ResourceLocation("client/panorama/panorama_2.png"), new ResourceLocation("client/panorama/panorama_3.png"), new ResourceLocation("client/panorama/panorama_4.png"), new ResourceLocation("client/panorama/panorama_5.png")}; private final boolean field_175375_v = true; - + private ResourceLocation backgroundTexture; private final Object threadLock = new Object(); private String openGLWarning1; - private String openGLWarning2; - private String openGLWarningLink; public static final String field_96138_a = "Please click " @@ -83,6 +88,11 @@ public boolean doesGuiPauseGame() { return false; } + @Override + public void updateScreen() { + ++this.panoramaTimer; + } + @Override protected void keyTyped(char typedChar, int keyCode) throws IOException { } @@ -94,6 +104,9 @@ public void initGui() { randomImage = new ResourceLocation("client/assets/femboys/" + n + ".png"); } + final DynamicTexture viewportTexture1 = new DynamicTexture(256, 256); + this.backgroundTexture = this.mc.getTextureManager().getDynamicTextureLocation("background", viewportTexture1); + final DynamicTexture viewportTexture = new DynamicTexture(256, 256); ResourceLocation backgroundTexture = this.mc.getTextureManager().getDynamicTextureLocation("background", viewportTexture); @@ -107,8 +120,57 @@ public void initGui() { int optionsWidth = 24 + (int) Alya.getInstance().getFontRendererSmall().getStringWidth(I18n.format("menu.options").replace("...", "")) + 4; int langWidth = 24 + (int) Alya.getInstance().getFontRendererSmall().getStringWidth(I18n.format("options.language").replace("...", "")) + 4; + int senseWidth = 24 + (int) Alya.getInstance().getFontRendererSmall().getStringWidth("Sense") + 4; + int discordWidth = 24 + (int) Alya.getInstance().getFontRendererSmall().getStringWidth("Discord") + 4; + int langX = this.width - 24 - 4 - optionsWidth - 2 - langWidth - 2; + int senseX = langX - senseWidth - 2; + int discordX = senseX - discordWidth - 2; this.buttonList.add( - new GuiButton(5, this.width - 24 - 4 - optionsWidth - 2 - langWidth - 2, 4, langWidth, 24, "") { + new GuiButton(10, senseX, 4, senseWidth, 24, "") { + @Override + public void drawButton(Minecraft mc, int mouseX, int mouseY) { + if(this.visible) { + this.hovered = + mouseX >= this.xPosition + && mouseY >= this.yPosition + && mouseX < this.xPosition + this.width + && mouseY < this.yPosition + this.height; + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + mc.getTextureManager().bindTexture(new ResourceLocation(mc.gameSettings.sense ? "client/icons/sense.png" : "client/icons/no_sense.png")); + drawModalRectWithCustomSizedTexture(this.xPosition + 4, this.yPosition + 4, 0, 0, 16, 16, 16, 16); + + String text = "Sense"; + AlyaFontRenderer font = Alya.getInstance().getFontRendererSmall(); + float textY = this.yPosition + (this.height - font.getHeight()) / 2.0F + 1.0F; + font.drawString(text, this.xPosition + 22, textY, -1); + this.mouseDragged(mc, mouseX, mouseY); + } + } + }); + this.buttonList.add( + new GuiButton(11, discordX, 4, discordWidth, 24, "") { + @Override + public void drawButton(Minecraft mc, int mouseX, int mouseY) { + if(this.visible) { + this.hovered = + mouseX >= this.xPosition + && mouseY >= this.yPosition + && mouseX < this.xPosition + this.width + && mouseY < this.yPosition + this.height; + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + mc.getTextureManager().bindTexture(new ResourceLocation("client/icons/discord.png")); + drawModalRectWithCustomSizedTexture(this.xPosition + 4, this.yPosition + 4, 0, 0, 16, 16, 16, 16); + + String text = "Discord"; + AlyaFontRenderer font = Alya.getInstance().getFontRendererSmall(); + float textY = this.yPosition + (this.height - font.getHeight()) / 2.0F + 1.0F; + font.drawString(text, this.xPosition + 22, textY, -1); + this.mouseDragged(mc, mouseX, mouseY); + } + } + }); + this.buttonList.add( + new GuiButton(5, langX, 4, langWidth, 24, "") { @Override public void drawButton(Minecraft mc, int mouseX, int mouseY) { if(this.visible) { @@ -196,6 +258,15 @@ private void addSingleplayerMultiplayerButtons(int p_73969_1_, int p_73969_2_) { this.buttonList.add(alts); } + @Override + public void confirmClicked(boolean result, int id) { + if(result) { + BrowserUtil.open(this.openGLWarningLink); + } + + this.mc.displayGuiScreen(this); + } + @Override protected void actionPerformed(GuiButton button) throws IOException { if(button.id == 0) { @@ -219,6 +290,15 @@ protected void actionPerformed(GuiButton button) throws IOException { this.mc.displayGuiScreen(new AltManagerGui()); } + if(button.id == 10) { + this.mc.gameSettings.sense = !this.mc.gameSettings.sense; + this.mc.gameSettings.saveOptions(); + } + + if(button.id == 11) { + BrowserUtil.open("https://discord.gg/J3XUnGaZjQ"); + } + if(button.id == 4) { this.mc.shutdown(); } @@ -229,20 +309,181 @@ protected void actionPerformed(GuiButton button) throws IOException { } } - @Override - public void confirmClicked(boolean result, int id) { - if(result) { - BrowserUtil.open(this.openGLWarningLink); + private void drawPanorama(int p_73970_1_, int p_73970_2_, float p_73970_3_) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GlStateManager.matrixMode(5889); + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + Project.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F); + GlStateManager.matrixMode(5888); + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.disableCull(); + GlStateManager.depthMask(false); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + int i = 8; + int j = 64; + CustomPanoramaProperties custompanoramaproperties = CustomPanorama.getCustomPanoramaProperties(); + + if(custompanoramaproperties != null) { + j = custompanoramaproperties.getBlur1(); } - this.mc.displayGuiScreen(this); + for(int k = 0; k < j; ++k) { + GlStateManager.pushMatrix(); + float f = ((float) (k % i) / (float) i - 0.5F) / 64.0F; + float f1 = ((float) (k / i) / (float) i - 0.5F) / 64.0F; + float f2 = 0.0F; + GlStateManager.translate(f, f1, f2); + GlStateManager.rotate(MathHelper.sin(((float) this.panoramaTimer + p_73970_3_) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(-((float) this.panoramaTimer + p_73970_3_) * 0.1F, 0.0F, 1.0F, 0.0F); + + for(int l = 0; l < 6; ++l) { + GlStateManager.pushMatrix(); + + if(l == 1) { + GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); + } + + if(l == 2) { + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + } + + if(l == 3) { + GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); + } + + if(l == 4) { + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + } + + if(l == 5) { + GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F); + } + + ResourceLocation[] aresourcelocation = titlePanoramaPaths; + + if(custompanoramaproperties != null) { + aresourcelocation = custompanoramaproperties.getPanoramaLocations(); + } + + this.mc.getTextureManager().bindTexture(aresourcelocation[l]); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + int i1 = 255 / (k + 1); + float f3 = 0.0F; + worldrenderer.pos(-1.0D, -1.0D, 1.0D).tex(0.0D, 0.0D).color(255, 255, 255, i1).endVertex(); + worldrenderer.pos(1.0D, -1.0D, 1.0D).tex(1.0D, 0.0D).color(255, 255, 255, i1).endVertex(); + worldrenderer.pos(1.0D, 1.0D, 1.0D).tex(1.0D, 1.0D).color(255, 255, 255, i1).endVertex(); + worldrenderer.pos(-1.0D, 1.0D, 1.0D).tex(0.0D, 1.0D).color(255, 255, 255, i1).endVertex(); + tessellator.draw(); + GlStateManager.popMatrix(); + } + + GlStateManager.popMatrix(); + GlStateManager.colorMask(true, true, true, false); + } + + worldrenderer.setTranslation(0.0D, 0.0D, 0.0D); + GlStateManager.colorMask(true, true, true, true); + GlStateManager.matrixMode(5889); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + GlStateManager.depthMask(true); + GlStateManager.enableCull(); + GlStateManager.enableDepth(); + } + + private void rotateAndBlurSkybox(float p_73968_1_) { + this.mc.getTextureManager().bindTexture(this.backgroundTexture); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.colorMask(true, true, true, false); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + GlStateManager.disableAlpha(); + int i = 3; + int j = 3; + CustomPanoramaProperties custompanoramaproperties = CustomPanorama.getCustomPanoramaProperties(); + + if(custompanoramaproperties != null) { + j = custompanoramaproperties.getBlur2(); + } + + for(int k = 0; k < j; ++k) { + float f = 1.0F / (float) (k + 1); + int l = this.width; + int i1 = this.height; + float f1 = (float) (k - i / 2) / 256.0F; + worldrenderer.pos(l, i1, this.zLevel).tex(0.0F + f1, 1.0D).color(1.0F, 1.0F, 1.0F, f).endVertex(); + worldrenderer.pos(l, 0.0D, this.zLevel).tex(1.0F + f1, 1.0D).color(1.0F, 1.0F, 1.0F, f).endVertex(); + worldrenderer.pos(0.0D, 0.0D, this.zLevel).tex(1.0F + f1, 0.0D).color(1.0F, 1.0F, 1.0F, f).endVertex(); + worldrenderer.pos(0.0D, i1, this.zLevel).tex(0.0F + f1, 0.0D).color(1.0F, 1.0F, 1.0F, f).endVertex(); + } + + tessellator.draw(); + GlStateManager.enableAlpha(); + GlStateManager.colorMask(true, true, true, true); + } + + private void renderSkybox(int p_73971_1_, int p_73971_2_, float p_73971_3_) { + this.mc.getFramebuffer().unbindFramebuffer(); + GlStateManager.viewport(0, 0, 256, 256); + this.drawPanorama(p_73971_1_, p_73971_2_, p_73971_3_); + this.rotateAndBlurSkybox(p_73971_3_); + int i = 3; + CustomPanoramaProperties custompanoramaproperties = CustomPanorama.getCustomPanoramaProperties(); + + if(custompanoramaproperties != null) { + i = custompanoramaproperties.getBlur3(); + } + + for(int j = 0; j < i; ++j) { + this.rotateAndBlurSkybox(p_73971_3_); + this.rotateAndBlurSkybox(p_73971_3_); + } + + this.mc.getFramebuffer().bindFramebuffer(true); + GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + float f2 = this.width > this.height ? 120.0F / (float) this.width : 120.0F / (float) this.height; + float f = (float) this.height * f2 / 256.0F; + float f1 = (float) this.width * f2 / 256.0F; + int k = this.width; + int l = this.height; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(0.0D, l, this.zLevel).tex(0.5F - f, 0.5F + f1).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + worldrenderer.pos(k, l, this.zLevel).tex(0.5F - f, 0.5F - f1).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + worldrenderer.pos(k, 0.0D, this.zLevel).tex(0.5F + f, 0.5F - f1).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + worldrenderer.pos(0.0D, 0.0D, this.zLevel).tex(0.5F + f, 0.5F + f1).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + tessellator.draw(); } @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { - if(menuShader == null) menuShader = new ShaderUtil("client/shaders/main_menu_bg.glsl"); - menuShader.render(); - + GlStateManager.disableAlpha(); + this.renderSkybox(mouseX, mouseY, partialTicks); + GlStateManager.enableAlpha(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + int i = 274; + int j = this.width / 2 - i / 2; + int k = 30; + int l = -2130706433; + int i1 = 16777215; + int j1 = 0; + int k1 = Integer.MIN_VALUE; int scaledSize = 140; int buttonY = this.height / 2 + 10; int maxLogoSize = buttonY - 20; diff --git a/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java b/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java index 24e37d02..fb365472 100644 --- a/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java +++ b/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java @@ -340,7 +340,7 @@ protected void keyTyped(char typedChar, int keyCode) throws IOException { public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.hoveringText = null; this.drawDefaultBackground(); - this.serverListSelector.drawScreen(mouseX, mouseY, partialTicks); + this.serverListSelector.drawScreen(mouseX, mouseY); drawCenteredString(I18n.format("multiplayer.title"), this.width / 2, 20, 16777215); super.drawScreen(mouseX, mouseY, partialTicks); diff --git a/src/main/java/net/minecraft/client/gui/GuiOptions.java b/src/main/java/net/minecraft/client/gui/GuiOptions.java index a3f7abd3..069835e7 100644 --- a/src/main/java/net/minecraft/client/gui/GuiOptions.java +++ b/src/main/java/net/minecraft/client/gui/GuiOptions.java @@ -115,18 +115,10 @@ public void initGui() { 150, 20, I18n.format("options.controls", new Object[0]))); - this.buttonList.add( - new GuiButton( - 102, - this.width / 2 - 155, - this.height / 6 + 96 - 6, - 150, - 20, - I18n.format("options.language", new Object[0]))); this.buttonList.add( new GuiButton( 103, - this.width / 2 + 5, + this.width / 2 - 155, this.height / 6 + 96 - 6, 150, 20, @@ -134,15 +126,15 @@ public void initGui() { this.buttonList.add( new GuiButton( 105, - this.width / 2 - 155, - this.height / 6 + 120 - 6, + this.width / 2 + 5, + this.height / 6 + 96 - 6, 150, 20, I18n.format("options.resourcepack", new Object[0]))); this.buttonList.add( new GuiButton( 104, - this.width / 2 + 5, + this.width / 2 - 155, this.height / 6 + 120 - 6, 150, 20, @@ -150,8 +142,8 @@ public void initGui() { this.buttonList.add( new GuiButton( 8675309, - this.width / 2 - 155, - this.height / 6 + 144 - 6, + this.width / 2 + 5, + this.height / 6 + 120 - 6, 150, 20, "Super Secret Settings...")); @@ -159,7 +151,7 @@ public void initGui() { new GuiButton( 200, this.width / 2 - 100, - this.height / 6 + 168, + this.height / 6 + 168 - 6, 200, 20, I18n.format("gui.done", new Object[0]))); diff --git a/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java b/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java index 2cbfbe53..54a3ba1d 100644 --- a/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java +++ b/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java @@ -19,7 +19,7 @@ public GuiResourcePackList( this.mc = mcIn; this.field_148204_l = p_i45055_4_; this.field_148163_i = false; - this.setHasListHeader(true, (int) (font.getFontHeight() * 1.5F)); + this.setHasListHeader((int) (font.getFontHeight() * 1.5F)); } /** Handles drawing a list's header row. */ diff --git a/src/main/java/net/minecraft/client/gui/GuiScreenCustomizePresets.java b/src/main/java/net/minecraft/client/gui/GuiScreenCustomizePresets.java index e88b533b..c96d1f76 100644 --- a/src/main/java/net/minecraft/client/gui/GuiScreenCustomizePresets.java +++ b/src/main/java/net/minecraft/client/gui/GuiScreenCustomizePresets.java @@ -105,7 +105,7 @@ protected void actionPerformed(GuiButton button) throws IOException { /** Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks */ public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - this.field_175311_g.drawScreen(mouseX, mouseY, partialTicks); + this.field_175311_g.drawScreen(mouseX, mouseY); this.drawCenteredString(this.field_175315_a, this.width / 2, 8, 16777215); this.drawString(this.field_175313_s, 50, 30, 10526880); this.drawString(this.field_175312_t, 50, 70, 10526880); diff --git a/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java b/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java index 0ef91241..24831f9b 100644 --- a/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java +++ b/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java @@ -201,8 +201,8 @@ protected void mouseReleased(int mouseX, int mouseY, int state) { /** Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks */ public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawBackground(0); - this.availableResourcePacksList.drawScreen(mouseX, mouseY, partialTicks); - this.selectedResourcePacksList.drawScreen(mouseX, mouseY, partialTicks); + this.availableResourcePacksList.drawScreen(mouseX, mouseY); + this.selectedResourcePacksList.drawScreen(mouseX, mouseY); this.drawCenteredString( I18n.format("resourcePack.title", new Object[0]), this.width / 2, 16, 16777215); this.drawCenteredString( diff --git a/src/main/java/net/minecraft/client/gui/GuiSelectWorld.java b/src/main/java/net/minecraft/client/gui/GuiSelectWorld.java index 3d886362..e6a688ea 100644 --- a/src/main/java/net/minecraft/client/gui/GuiSelectWorld.java +++ b/src/main/java/net/minecraft/client/gui/GuiSelectWorld.java @@ -216,7 +216,7 @@ public void confirmClicked(boolean result, int id) public void drawScreen(int mouseX, int mouseY, float partialTicks) { - this.availableWorlds.drawScreen(mouseX, mouseY, partialTicks); + this.availableWorlds.drawScreen(mouseX, mouseY); this.drawCenteredString(this.fontRendererObj, this.screenTitle, this.width / 2, 20, 16777215); super.drawScreen(mouseX, mouseY, partialTicks); } diff --git a/src/main/java/net/minecraft/client/gui/GuiSlot.java b/src/main/java/net/minecraft/client/gui/GuiSlot.java index 5b542d7d..07a02053 100644 --- a/src/main/java/net/minecraft/client/gui/GuiSlot.java +++ b/src/main/java/net/minecraft/client/gui/GuiSlot.java @@ -61,12 +61,12 @@ public void setShowSelectionBox(boolean showSelectionBoxIn) this.showSelectionBox = showSelectionBoxIn; } - protected void setHasListHeader(boolean hasListHeaderIn, int headerPaddingIn) + protected void setHasListHeader(int headerPaddingIn) { - this.hasListHeader = hasListHeaderIn; + this.hasListHeader = true; this.headerPadding = headerPaddingIn; - if (!hasListHeaderIn) + if (false) { this.headerPadding = 0; } @@ -164,7 +164,7 @@ else if (button.id == this.scrollDownButtonID) } } - public void drawScreen(int mouseXIn, int mouseYIn, float p_148128_3_) + public void drawScreen(int mouseXIn, int mouseYIn) { if (this.field_178041_q) { @@ -190,24 +190,24 @@ public void drawScreen(int mouseXIn, int mouseYIn, float p_148128_3_) this.drawSelectionBox(k, l, mouseXIn, mouseYIn); GlStateManager.disableDepth(); int i1 = 4; - this.overlayBackground(0, this.top, 255, 255); - this.overlayBackground(this.bottom, this.height, 255, 255); + this.overlayBackground(0, this.top); + this.overlayBackground(this.bottom, this.height); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(770, 771, 0, 1); GlStateManager.disableAlpha(); GlStateManager.shadeModel(7425); GlStateManager.disableTexture2D(); worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); - worldrenderer.pos((double)this.left, (double)(this.top + i1), 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 0).endVertex(); - worldrenderer.pos((double)this.right, (double)(this.top + i1), 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 0).endVertex(); - worldrenderer.pos((double)this.right, (double)this.top, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex(); - worldrenderer.pos((double)this.left, (double)this.top, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(this.left, this.top + i1, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 0).endVertex(); + worldrenderer.pos(this.right, this.top + i1, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 0).endVertex(); + worldrenderer.pos(this.right, this.top, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(this.left, this.top, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex(); tessellator.draw(); worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); - worldrenderer.pos((double)this.left, (double)this.bottom, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex(); - worldrenderer.pos((double)this.right, (double)this.bottom, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); - worldrenderer.pos((double)this.right, (double)(this.bottom - i1), 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 0).endVertex(); - worldrenderer.pos((double)this.left, (double)(this.bottom - i1), 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 0).endVertex(); + worldrenderer.pos(this.left, this.bottom, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(this.right, this.bottom, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(this.right, this.bottom - i1, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 0).endVertex(); + worldrenderer.pos(this.left, this.bottom - i1, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 0).endVertex(); tessellator.draw(); int j1 = this.func_148135_f(); @@ -223,22 +223,22 @@ public void drawScreen(int mouseXIn, int mouseYIn, float p_148128_3_) } worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); - worldrenderer.pos((double)i, (double)this.bottom, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex(); - worldrenderer.pos((double)j, (double)this.bottom, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); - worldrenderer.pos((double)j, (double)this.top, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex(); - worldrenderer.pos((double)i, (double)this.top, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(i, this.bottom, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(j, this.bottom, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(j, this.top, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(i, this.top, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex(); tessellator.draw(); worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); - worldrenderer.pos((double)i, (double)(l1 + k1), 0.0D).tex(0.0D, 1.0D).color(128, 128, 128, 255).endVertex(); - worldrenderer.pos((double)j, (double)(l1 + k1), 0.0D).tex(1.0D, 1.0D).color(128, 128, 128, 255).endVertex(); - worldrenderer.pos((double)j, (double)l1, 0.0D).tex(1.0D, 0.0D).color(128, 128, 128, 255).endVertex(); - worldrenderer.pos((double)i, (double)l1, 0.0D).tex(0.0D, 0.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos(i, l1 + k1, 0.0D).tex(0.0D, 1.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos(j, l1 + k1, 0.0D).tex(1.0D, 1.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos(j, l1, 0.0D).tex(1.0D, 0.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos(i, l1, 0.0D).tex(0.0D, 0.0D).color(128, 128, 128, 255).endVertex(); tessellator.draw(); worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); - worldrenderer.pos((double)i, (double)(l1 + k1 - 1), 0.0D).tex(0.0D, 1.0D).color(192, 192, 192, 255).endVertex(); - worldrenderer.pos((double)(j - 1), (double)(l1 + k1 - 1), 0.0D).tex(1.0D, 1.0D).color(192, 192, 192, 255).endVertex(); - worldrenderer.pos((double)(j - 1), (double)l1, 0.0D).tex(1.0D, 0.0D).color(192, 192, 192, 255).endVertex(); - worldrenderer.pos((double)i, (double)l1, 0.0D).tex(0.0D, 0.0D).color(192, 192, 192, 255).endVertex(); + worldrenderer.pos(i, l1 + k1 - 1, 0.0D).tex(0.0D, 1.0D).color(192, 192, 192, 255).endVertex(); + worldrenderer.pos(j - 1, l1 + k1 - 1, 0.0D).tex(1.0D, 1.0D).color(192, 192, 192, 255).endVertex(); + worldrenderer.pos(j - 1, l1, 0.0D).tex(1.0D, 0.0D).color(192, 192, 192, 255).endVertex(); + worldrenderer.pos(i, l1, 0.0D).tex(0.0D, 0.0D).color(192, 192, 192, 255).endVertex(); tessellator.draw(); } @@ -404,14 +404,14 @@ protected void drawSelectionBox(int p_148120_1_, int p_148120_2_, int mouseXIn, GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.disableTexture2D(); worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); - worldrenderer.pos((double)i1, (double)(k + l + 2), 0.0D).tex(0.0D, 1.0D).color(128, 128, 128, 255).endVertex(); - worldrenderer.pos((double)j1, (double)(k + l + 2), 0.0D).tex(1.0D, 1.0D).color(128, 128, 128, 255).endVertex(); - worldrenderer.pos((double)j1, (double)(k - 2), 0.0D).tex(1.0D, 0.0D).color(128, 128, 128, 255).endVertex(); - worldrenderer.pos((double)i1, (double)(k - 2), 0.0D).tex(0.0D, 0.0D).color(128, 128, 128, 255).endVertex(); - worldrenderer.pos((double)(i1 + 1), (double)(k + l + 1), 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex(); - worldrenderer.pos((double)(j1 - 1), (double)(k + l + 1), 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); - worldrenderer.pos((double)(j1 - 1), (double)(k - 1), 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex(); - worldrenderer.pos((double)(i1 + 1), (double)(k - 1), 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(i1, k + l + 2, 0.0D).tex(0.0D, 1.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos(j1, k + l + 2, 0.0D).tex(1.0D, 1.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos(j1, k - 2, 0.0D).tex(1.0D, 0.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos(i1, k - 2, 0.0D).tex(0.0D, 0.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos(i1 + 1, k + l + 1, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(j1 - 1, k + l + 1, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(j1 - 1, k - 1, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(i1 + 1, k - 1, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex(); tessellator.draw(); GlStateManager.enableTexture2D(); } @@ -428,19 +428,58 @@ protected int getScrollBarX() return this.width / 2 + 124; } - protected void overlayBackground(int startY, int endY, int startAlpha, int endAlpha) + protected void overlayBackground(int startY, int endY) { Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); - this.mc.getTextureManager().bindTexture(Gui.optionsBackground); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - float f = 32.0F; - worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); - worldrenderer.pos((double)this.left, (double)endY, 0.0D).tex(0.0D, (double)((float)endY / 32.0F)).color(64, 64, 64, endAlpha).endVertex(); - worldrenderer.pos((double)(this.left + this.width), (double)endY, 0.0D).tex((double)((float)this.width / 32.0F), (double)((float)endY / 32.0F)).color(64, 64, 64, endAlpha).endVertex(); - worldrenderer.pos((double)(this.left + this.width), (double)startY, 0.0D).tex((double)((float)this.width / 32.0F), (double)((float)startY / 32.0F)).color(64, 64, 64, startAlpha).endVertex(); - worldrenderer.pos((double)this.left, (double)startY, 0.0D).tex(0.0D, (double)((float)startY / 32.0F)).color(64, 64, 64, startAlpha).endVertex(); + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.shadeModel(7425); + + int startColor, endColor; + if (this.mc.theWorld != null) { + startColor = -1072689136; + endColor = -804253680; + } else { + startColor = 0xFF000000; + endColor = 0xFF0F0F0F; + } + + float f = (float)startY / (float)this.height; + float f1 = (float)endY / (float)this.height; + + float a = (float)(startColor >> 24 & 255) / 255.0F; + float r = (float)(startColor >> 16 & 255) / 255.0F; + float g = (float)(startColor >> 8 & 255) / 255.0F; + float b = (float)(startColor & 255) / 255.0F; + float a1 = (float)(endColor >> 24 & 255) / 255.0F; + float r1 = (float)(endColor >> 16 & 255) / 255.0F; + float g1 = (float)(endColor >> 8 & 255) / 255.0F; + float b1 = (float)(endColor & 255) / 255.0F; + + float ar = a + (a1 - a) * f; + float rr = r + (r1 - r) * f; + float gr = g + (g1 - g) * f; + float br = b + (b1 - b) * f; + + float ar1 = a + (a1 - a) * f1; + float rr1 = r + (r1 - r) * f1; + float gr1 = g + (g1 - g) * f1; + float br1 = b + (b1 - b) * f1; + + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos(this.right, startY, 0.0D).color(rr, gr, br, ar).endVertex(); + worldrenderer.pos(this.left, startY, 0.0D).color(rr, gr, br, ar).endVertex(); + worldrenderer.pos(this.left, endY, 0.0D).color(rr1, gr1, br1, ar1).endVertex(); + worldrenderer.pos(this.right, endY, 0.0D).color(rr1, gr1, br1, ar1).endVertex(); tessellator.draw(); + + GlStateManager.shadeModel(7424); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); } public void setSlotXBoundsFromLeft(int leftIn) @@ -456,16 +495,6 @@ public int getSlotHeight() protected void drawContainerBackground(Tessellator p_drawContainerBackground_1_) { - WorldRenderer worldrenderer = p_drawContainerBackground_1_.getWorldRenderer(); - this.mc.getTextureManager().bindTexture(Gui.optionsBackground); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - float f = 32.0F; - worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); - worldrenderer.pos((double)this.left, (double)this.bottom, 0.0D).tex((double)((float)this.left / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); - worldrenderer.pos((double)this.right, (double)this.bottom, 0.0D).tex((double)((float)this.right / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); - worldrenderer.pos((double)this.right, (double)this.top, 0.0D).tex((double)((float)this.right / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); - worldrenderer.pos((double)this.left, (double)this.top, 0.0D).tex((double)((float)this.left / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); - p_drawContainerBackground_1_.draw(); } } diff --git a/src/main/java/net/minecraft/client/gui/GuiSnooper.java b/src/main/java/net/minecraft/client/gui/GuiSnooper.java index a3fcef59..93c709e5 100644 --- a/src/main/java/net/minecraft/client/gui/GuiSnooper.java +++ b/src/main/java/net/minecraft/client/gui/GuiSnooper.java @@ -61,7 +61,7 @@ protected void actionPerformed(GuiButton button) throws IOException { /** Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks */ public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - this.field_146606_s.drawScreen(mouseX, mouseY, partialTicks); + this.field_146606_s.drawScreen(mouseX, mouseY); drawCenteredString(this.field_146610_i, this.width / 2, 8, 16777215); int i = 22; diff --git a/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java b/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java index a4a63ff6..b45481f2 100644 --- a/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java +++ b/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java @@ -173,7 +173,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.height / 2 + (int) font.getFontHeight() * 2, 16777215); } else { - this.displaySlot.drawScreen(mouseX, mouseY, partialTicks); + this.displaySlot.drawScreen(mouseX, mouseY); this.drawCenteredString(this.screenTitle, this.width / 2, 20, 16777215); super.drawScreen(mouseX, mouseY, partialTicks); } @@ -256,7 +256,7 @@ abstract class Stats extends GuiSlot { protected Stats(Minecraft mcIn) { super(mcIn, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, 20); this.setShowSelectionBox(false); - this.setHasListHeader(true, 20); + this.setHasListHeader(20); } protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) {} diff --git a/src/main/java/net/minecraft/client/settings/GameSettings.java b/src/main/java/net/minecraft/client/settings/GameSettings.java index 335b3c33..a5aaf488 100644 --- a/src/main/java/net/minecraft/client/settings/GameSettings.java +++ b/src/main/java/net/minecraft/client/settings/GameSettings.java @@ -120,6 +120,7 @@ public Type getOwnerType() { public boolean useNativeTransport = true; public boolean entityShadows = true; public boolean realmsNotifications = true; + public boolean sense = true; public KeyBinding keyBindForward = new KeyBinding("key.forward", 17, "key.categories.movement"); public KeyBinding keyBindLeft = new KeyBinding("key.left", 30, "key.categories.movement"); public KeyBinding keyBindBack = new KeyBinding("key.back", 31, "key.categories.movement"); @@ -925,6 +926,10 @@ public void loadOptions() { this.realmsNotifications = astring[1].equals("true"); } + if(astring[0].equals("sense")) { + this.sense = astring[1].equals("true"); + } + for(KeyBinding keybinding : this.keyBindings) { if(astring[0].equals("key_" + keybinding.getKeyDescription())) { keybinding.setKeyCode(Integer.parseInt(astring[1])); @@ -1040,6 +1045,7 @@ public void saveOptions() { printwriter.println("useNativeTransport:" + this.useNativeTransport); printwriter.println("entityShadows:" + this.entityShadows); printwriter.println("realmsNotifications:" + this.realmsNotifications); + printwriter.println("sense:" + this.sense); for(KeyBinding keybinding : this.keyBindings) { printwriter.println("key_" + keybinding.getKeyDescription() + ":" + keybinding.getKeyCode()); diff --git a/src/main/java/net/optifine/shaders/gui/GuiShaders.java b/src/main/java/net/optifine/shaders/gui/GuiShaders.java index c7b607b7..6a80eafc 100644 --- a/src/main/java/net/optifine/shaders/gui/GuiShaders.java +++ b/src/main/java/net/optifine/shaders/gui/GuiShaders.java @@ -335,7 +335,7 @@ public void onGuiClosed() public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - this.shaderList.drawScreen(mouseX, mouseY, partialTicks); + this.shaderList.drawScreen(mouseX, mouseY); if (this.updateTimer <= 0) { diff --git a/src/main/resources/assets/minecraft/client/assets/gui/logo.png b/src/main/resources/assets/minecraft/client/assets/gui/logo.png index e6ae0f9f..af475021 100644 Binary files a/src/main/resources/assets/minecraft/client/assets/gui/logo.png and b/src/main/resources/assets/minecraft/client/assets/gui/logo.png differ diff --git a/src/main/resources/assets/minecraft/client/icons/16x16.png b/src/main/resources/assets/minecraft/client/icons/16x16.png index 1c8c472f..c2b2c09c 100644 Binary files a/src/main/resources/assets/minecraft/client/icons/16x16.png and b/src/main/resources/assets/minecraft/client/icons/16x16.png differ diff --git a/src/main/resources/assets/minecraft/client/icons/32x32.png b/src/main/resources/assets/minecraft/client/icons/32x32.png index fef36b5c..f41a36cf 100644 Binary files a/src/main/resources/assets/minecraft/client/icons/32x32.png and b/src/main/resources/assets/minecraft/client/icons/32x32.png differ diff --git a/src/main/resources/assets/minecraft/client/icons/discord.png b/src/main/resources/assets/minecraft/client/icons/discord.png new file mode 100644 index 00000000..820ac086 Binary files /dev/null and b/src/main/resources/assets/minecraft/client/icons/discord.png differ diff --git a/src/main/resources/assets/minecraft/client/icons/no_sense.png b/src/main/resources/assets/minecraft/client/icons/no_sense.png new file mode 100644 index 00000000..58c24848 Binary files /dev/null and b/src/main/resources/assets/minecraft/client/icons/no_sense.png differ diff --git a/src/main/resources/assets/minecraft/client/icons/sense.png b/src/main/resources/assets/minecraft/client/icons/sense.png new file mode 100644 index 00000000..2f7df2c3 Binary files /dev/null and b/src/main/resources/assets/minecraft/client/icons/sense.png differ diff --git a/src/main/resources/assets/minecraft/client/panorama/panorama_0.png b/src/main/resources/assets/minecraft/client/panorama/panorama_0.png new file mode 100644 index 00000000..b8c18a74 Binary files /dev/null and b/src/main/resources/assets/minecraft/client/panorama/panorama_0.png differ diff --git a/src/main/resources/assets/minecraft/client/panorama/panorama_1.png b/src/main/resources/assets/minecraft/client/panorama/panorama_1.png new file mode 100644 index 00000000..13186bbd Binary files /dev/null and b/src/main/resources/assets/minecraft/client/panorama/panorama_1.png differ diff --git a/src/main/resources/assets/minecraft/client/panorama/panorama_2.png b/src/main/resources/assets/minecraft/client/panorama/panorama_2.png new file mode 100644 index 00000000..ddbeff6f Binary files /dev/null and b/src/main/resources/assets/minecraft/client/panorama/panorama_2.png differ diff --git a/src/main/resources/assets/minecraft/client/panorama/panorama_3.png b/src/main/resources/assets/minecraft/client/panorama/panorama_3.png new file mode 100644 index 00000000..e664afe4 Binary files /dev/null and b/src/main/resources/assets/minecraft/client/panorama/panorama_3.png differ diff --git a/src/main/resources/assets/minecraft/client/panorama/panorama_4.png b/src/main/resources/assets/minecraft/client/panorama/panorama_4.png new file mode 100644 index 00000000..4b5f9a64 Binary files /dev/null and b/src/main/resources/assets/minecraft/client/panorama/panorama_4.png differ diff --git a/src/main/resources/assets/minecraft/client/panorama/panorama_5.png b/src/main/resources/assets/minecraft/client/panorama/panorama_5.png new file mode 100644 index 00000000..7f4f4a7b Binary files /dev/null and b/src/main/resources/assets/minecraft/client/panorama/panorama_5.png differ diff --git a/src/main/resources/assets/minecraft/client/shaders/main_menu.vsh b/src/main/resources/assets/minecraft/client/shaders/main_menu.vsh deleted file mode 100644 index 1d4e2558..00000000 --- a/src/main/resources/assets/minecraft/client/shaders/main_menu.vsh +++ /dev/null @@ -1,10 +0,0 @@ -#version 120 - -attribute vec2 aPosition; -varying vec2 vUv; - -void main() { - vUv = 0.5 * aPosition + 0.5; - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_MultiTexCoord0; -} diff --git a/src/main/resources/assets/minecraft/client/shaders/main_menu_bg.glsl b/src/main/resources/assets/minecraft/client/shaders/main_menu_bg.glsl deleted file mode 100644 index 5649a862..00000000 --- a/src/main/resources/assets/minecraft/client/shaders/main_menu_bg.glsl +++ /dev/null @@ -1,90 +0,0 @@ -#version 120 -uniform float time; -uniform vec2 resolution; - -#define STAR 1.0 -#define MOUSE_INFLUENCE 0.2 -#define MOUSE_GLOW 0.05 -#define TRAIL_STRENGTH 0.8 -#define FLARE 4.0 -#define COLOR vec3(0.92, 0.61, 0.96) -#define STAR_NUM 12.0 -#define STAR_AMP 1.0 -#define STAR_SPEED 0.01 -#define STAR_VEL vec2(0.0, 1.0) -#define STAR_FREQ 8.0 -#define STAR_EXP 1.5 -#define DITHER 0.001 -#define DITHER_RES 128.0 -#define STAR_STRETCH 1.2 -#define STAR_CURVE 0.5 - -vec3 gamma_encode(vec3 lrgb) { return sqrt(lrgb); } - -vec2 turbulence(vec2 p, float freq, float num) { - mat2 rot = mat2(0.6, -0.8, 0.8, 0.6); - vec2 turb = vec2(0.0); - for (float i = 0.0; i < STAR_NUM; i++) { - if (i >= num) break; - vec2 pos = p + turb + STAR_SPEED * i * time * STAR_VEL; - float phase = freq * (pos * rot).y + STAR_SPEED * time * freq; - turb += rot[0] * sin(phase) / freq; - rot *= mat2(0.6, -0.8, 0.8, 0.6); - freq *= STAR_EXP; - } - return turb; -} - -float hash(vec2 p) { - return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); -} - -vec3 star(inout vec2 p) { - vec2 suv = p * 2.0 - 1.0; - vec2 top = suv - vec2(0.0, 1.0); - top.y *= STAR_STRETCH * resolution.y / resolution.x; - float factor = 1.0 + 0.4 * sin(9.0 * suv.x) * sin(5.0 * (suv.y + 5.0 * time * STAR_SPEED)); - vec2 turb = top + factor * STAR_AMP * turbulence(top, STAR_FREQ, STAR_NUM); - turb.y -= STAR_CURVE * suv.x * suv.x; - float fade = max(4.0 * suv.x * suv.x - suv.y + 1.2, 0.001); - float atten = fade * max(0.5 * turb.y, -turb.y); - float ft = 0.4 * time; - vec2 fp = 8.0 * (turb + 0.5 * STAR_VEL * ft); - fp *= mat2(0.4, -0.3, 0.3, 0.4); - float f = cos(fp.x) * sin(fp.y) - 0.5; - float flare = f * f + 0.5 * suv.x * suv.x - 1.5 * turb.y + 0.6 * cos(0.42 * ft + 1.6 * turb.x) * cos(0.31 * ft - turb.x); - vec3 col = 0.1 * COLOR * (STAR / (atten * atten) + FLARE / (flare * flare)); - const vec3 chrom = vec3(0.0, 0.1, 0.2); - col *= exp(p.y * - cos(turb.x * 5.0 + 0.4 * (time + turb.y * 1.0) + chrom) * - cos(turb.x * 7.0 - 0.5 * (time - turb.y * 1.5) + chrom) * - cos(turb.x * 9.0 + 0.6 * (time + turb.y * 2.0) + chrom) - ); - return col; -} - -void main() { - vec2 fragPx = gl_FragCoord.xy; - vec2 vUv = fragPx / resolution; - vec2 duv = 0.9 * fragPx / DITHER_RES * mat2(0.8, -0.6, 0.6, 0.8); - float dither = hash(duv + time * 0.1) - 0.5; - vec2 suv = vUv * 2.0 - 1.0; - - vec3 col = star(vUv); - float vig = 1.0 - abs(suv.x); - vig *= 0.5 + 0.5 * suv.y; - col *= vig * vig; - col /= 1.0 + col; - col = clamp(col, 0.0, 1.0); - col = gamma_encode(col); - float xx = suv.x + 0.03; - xx = max(1.0 - 1e1 * xx * xx / max(0.5 + 1.5 * vUv.y, 0.1), 0.0); - float light = max(0.5 + 0.5 * vUv.y, 0.0) * xx; - vec3 hue = mix(vec3(0.5, 0.2, 0.2), vec3(0.3, 0.3, 0.6), 1.0 + suv.y); - vec3 rim = 12.0 * light * light * light * light * (0.5 + 0.5 * suv.y) * hue; - rim /= (1.0 + rim); - col += (1.0 - col) * rim * rim; - col += DITHER * dither; - - gl_FragColor = vec4(col, 1.0); -}