You are on page 1of 4

package net.minecraft.client.

gui;

import java.awt.Color;
import java.io.IOException;
import java.net.URI;
import java.text.SimpleDateFormat;
import java.util.Date;

import net.minecraft.client.resources.I18n;
import net.minecraft.util.ResourceLocation;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.input.Mouse;

import kombat.java.client.Beta;
import kombat.java.client.Kombat;
import kombat.java.client.TTFFontRenderer;
import kombat.java.client.gui.account.gui.impl.GuiAltLogin;
import kombat.java.client.module.Module.Category;
import kombat.java.client.utils.RenderUtil;
import kombat.java.client.utils.font.Fonts;
import kombat.java.client.utils.font.MCFontRenderer;

import static org.lwjgl.opengl.GL11.*;


import static org.lwjgl.opengl.GL20.*;

public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback {

public static MCFontRenderer dufnctrmgyot6m18 = new


MCFontRenderer(Fonts.fontFromTTF(new
ResourceLocation("textures/client/bttf.ttf"),18,0), true, true);
private long initTime = System.currentTimeMillis();
private String openGLWarning1;

private int field_92024_r;

private int field_92023_s;

private int field_92022_t;

private int field_92021_u;

private int field_92020_v;

private int field_92019_w;

private String openGLWarning2;


private final GLShader czBackgroundShader = new GLShader(Shaders.VERTEX_SHADER,
Shaders.BACKGROUND_CZ_FRAG_SHADER) {
@Override
public void setupUniforms() {
setupUniform("time");
setupUniform("resolution");
}

@Override
public void updateUniforms() {
glUniform1f(this.getUniformLocation("time"),
(System.currentTimeMillis() - initTime) / 1000.0F);
glUniform2f(this.getUniformLocation("resolution"), mc.displayWidth,
mc.displayHeight);
}
};

private final GLShader backgroundShader = new GLShader(Shaders.VERTEX_SHADER,


Shaders.BACKGROUND_FRAG_SHADER) {
@Override
public void setupUniforms() {
setupUniform("time");
setupUniform("resolution");
setupUniform("mouse");
}

@Override
public void updateUniforms() {
glUniform1f(this.getUniformLocation("time"),
(System.currentTimeMillis() - initTime) / 1000.0F);
glUniform2f(this.getUniformLocation("resolution"), mc.displayWidth,
mc.displayHeight);
glUniform2f(this.getUniformLocation("mouse"), Mouse.getX() / 1000.0F,
Mouse.getY() / 1000.0F);
}
};
public boolean doesGuiPauseGame()
{
return false;
}

protected void keyTyped(char typedChar, int keyCode) throws IOException {


}

public void initGui()


{
Kombat.getInstance().getDiscordRP().update("Idle", "Main Menu");
final int j = this.height / 4 + 48;

this.addSingleplayerMultiplayerButtons(j, 24);

this.buttonList.add(new GuiButton(0, this.width / 2 - 100, j + 72 + 12, 98,


20, I18n.format("menu.options")));
this.buttonList.add(new GuiButton(4, this.width / 2 + 2, j + 72 + 12, 98,
20, I18n.format("menu.quit")));

this.initTime = System.currentTimeMillis();
}

private void addSingleplayerMultiplayerButtons(int p_73969_1_, int p_73969_2_)


{
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, p_73969_1_,
I18n.format("menu.singleplayer")));
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, p_73969_1_ +
p_73969_2_, I18n.format("menu.multiplayer")));
this.buttonList.add(new GuiButton(3, this.width / 2 - 100, p_73969_1_ +
p_73969_2_ * 2, "Alt Manager"));

}
protected void actionPerformed(GuiButton button) throws IOException {
switch (button.id) {
case 0:
this.mc.displayGuiScreen(new GuiOptions(this,
this.mc.gameSettings));
break;
case 1:
this.mc.displayGuiScreen(new GuiSelectWorld(this));
break;
case 2:
this.mc.displayGuiScreen(new GuiMultiplayer(this));
break;
case 3:
this.mc.displayGuiScreen(new GuiAltLogin(this));
break;
case 4:
this.mc.shutdown();
break;
}
}

public void drawScreen(int mouseX, int mouseY, float partialTicks)


{
glDisable(GL_CULL_FACE);

final boolean czechMode = this.mc.gameSettings.language.equals("cs_CZ");

final GLShader bgShader = czechMode ? this.czBackgroundShader :


this.backgroundShader;

bgShader.use();

glBegin(GL_QUADS);
{
glVertex2i(-1, -1);
glVertex2i(-1, 1);
glVertex2i(1, 1);
glVertex2i(1, -1);
}
glEnd();

glUseProgram(0);

if (czechMode) {
glScaled(2, 2, 1);
this.fontRendererObj.drawString("\247LAhoj ty hloupa kurvo!", 2, height
/ 2.0 - 9 - 2, 0xFF000000);
glScaled(0.5, 0.5, 1);
}
int sc = mc.gameSettings.guiScale;
if(sc == 0)
sc = 2;
String time = (new SimpleDateFormat("")).format(new Date());
String s = Beta.INSTANCE.name + " " + Beta.INSTANCE.buildName;
for(int i = 0; i < s.length(); i++) {
Fonts.axi45.drawStringWithShadow("KOMBAT V4" + time, 330F, 100.0F,
ColorHelper.getColorInt(4 + i*6));
}
String s2 = "Copyright Mojang AB. Do not distribute!";
drawString(this.fontRendererObj, s2, this.width -
this.fontRendererObj.getStringWidth(s2) - 2, this.height - 10, -1);
this.drawString(this.fontRendererObj, "KOMBAT was made by zDR0P3AD0R",
this.width - this.fontRendererObj.getStringWidth("KOMBAT was made by zDR0P3AD0R") -
4, this.height - 20, -1);
if (this.openGLWarning1 != null && this.openGLWarning1.length() > 0) {
drawRect((this.field_92022_t - 2), (this.field_92021_u - 2),
(this.field_92020_v + 2), (this.field_92019_w - 1), 1428160512);
drawString(this.fontRendererObj, this.openGLWarning1, this.field_92022_t,
this.field_92021_u, -1);
drawString(this.fontRendererObj, this.openGLWarning2, (this.width -
this.field_92024_r) / 2, ((GuiButton)this.buttonList.get(0)).yPosition - 12, -1);
}
super.drawScreen(mouseX, mouseY, partialTicks);
}
}

You might also like