Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.client.gui;
- import java.awt.Desktop;
- import java.net.URI;
- import org.lwjgl.opengl.GL11;
- import org.lwjgl.opengl.GL12;
- import net.minecraft.client.gui.achievement.GuiAchievements;
- import net.minecraft.client.gui.achievement.GuiStats;
- import net.minecraft.client.multiplayer.WorldClient;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.client.renderer.RenderHelper;
- import net.minecraft.client.renderer.entity.RenderManager;
- import net.minecraft.client.resources.I18n;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.util.EnumChatFormatting;
- public class GuiIngameMenu extends GuiScreen
- {
- private int field_146445_a;
- private int field_146444_f;
- private static final String __OBFID = "CL_00000703";
- /**
- * Adds the buttons (and other controls) to the screen in question.
- */
- public void initGui()
- {
- this.field_146445_a = 0;
- this.buttonList.clear();
- byte var1 = -16;
- boolean var2 = true;
- //-----------------------------------------------------------
- //Nouveaux boutons
- this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 160 + var1, I18n.format(EnumChatFormatting.DARK_GREEN + "Déconnexion sécurisée", new Object[0])));
- this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 130 + var1, I18n.format(EnumChatFormatting.GOLD + "Revenir en jeu", new Object[0])));
- this.buttonList.add(new GuiButton(2, this.width / 2 - 200, this.height / 4 + 66 + var1, 98, 20, I18n.format(EnumChatFormatting.BLUE + "Site", new Object[0])));
- this.buttonList.add( new GuiButton(3, this.width / 2 + 102, this.height / 4 + 66 + var1, 98, 20, I18n.format(EnumChatFormatting.DARK_PURPLE + "Craft", new Object[0])));
- //this.buttonList.add(new GuiButton(10, this.width / 2 - ((mc.getSession().getUsername().length() * 8 + 10) / 2), this.height / 4 + 50 , mc.getSession().getUsername().length() * 8 + 10, 20, I18n.format(EnumChatFormatting.UNDERLINE + mc.getSession().getUsername(), new Object[0])));
- this.buttonList.add(new GuiButton(0, this.width / 2 - 200, this.height / 4 + 96 + var1, 98, 20, I18n.format(EnumChatFormatting.GREEN + "Options", new Object[0])));
- this.buttonList.add( new GuiButton(7, this.width / 2 + 102, this.height / 4 + 96 + var1, 98, 20, I18n.format(EnumChatFormatting.YELLOW + "Teamspeak", new Object[0])));
- this.buttonList.add(new GuiButton(5, this.width / 2 - 180, this.height / 4 + 28 + var1, 98, 20, I18n.format(EnumChatFormatting.DARK_AQUA +"Achivements", new Object[0])));
- this.buttonList.add(new GuiButton(6, this.width / 2 + 82, this.height / 4 + 28 + var1, 98, 20, I18n.format(EnumChatFormatting.RED +"Statistiques", new Object[0])));
- //------------------------------------------------------------
- }
- protected void actionPerformed(GuiButton p_146284_1_)
- {
- switch (p_146284_1_.id)
- {
- case 0:
- this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
- break;
- case 1:
- if (this.mc.isSingleplayer()){
- p_146284_1_.enabled = false;
- this.mc.theWorld.sendQuittingDisconnectingPacket();
- this.mc.loadWorld((WorldClient)null);
- this.mc.displayGuiScreen(new GuiMainMenu());
- }
- else {
- this.mc.thePlayer.sendChatMessage("/logout");
- }
- break;
- case 2:
- try
- {
- URI var2 = new URI("http://vanadia.fr");
- if (Desktop.isDesktopSupported())
- {
- Desktop.getDesktop().browse(var2);
- }
- }
- catch (Exception var7)
- {
- var7.printStackTrace();
- }
- break;
- case 3:
- break;
- default:
- break;
- case 4:
- this.mc.displayGuiScreen((GuiScreen)null);
- this.mc.setIngameFocus();
- break;
- case 5:
- this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.func_146107_m()));
- break;
- case 6:
- this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.func_146107_m()));
- break;
- case 7:
- try
- {
- URI var2 = new URI("ts3server://ts.vanadia.fr?nickname=" + mc.getSession().getUsername());
- if (Desktop.isDesktopSupported())
- {
- Desktop.getDesktop().browse(var2);
- }
- }
- catch (Exception var7)
- {
- var7.printStackTrace();
- }
- break;
- case 10:
- try
- {
- URI var2 = new URI("http://vanadia.fr/membre/" + mc.getSession().getUsername());
- if (Desktop.isDesktopSupported())
- {
- Desktop.getDesktop().browse(var2);
- }
- }
- catch (Exception var7)
- {
- var7.printStackTrace();
- }
- break;
- }
- }
- /**
- * Called from the main game loop to update the screen.
- */
- public void updateScreen()
- {
- super.updateScreen();
- ++this.field_146444_f;
- }
- /**
- * Draws the screen and all the components in it.
- */
- public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
- {
- int x = this.width / 2 + 0;
- int y = this.height / 2 + 0;
- drawPlayer(x, y, 55, -p_73863_2_ + y - 90, +p_73863_1_ - x, this.mc.thePlayer);
- this.drawDefaultBackground();
- this.drawCenteredString(this.fontRendererObj, EnumChatFormatting.GOLD + "- Vanadia Menu -", this.width / 2, 40, 16777215);
- super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
- }
- public static void drawPlayer(int x, int y, int scale, float roty, float rotx, EntityLivingBase thePlayer)
- {
- GL11.glEnable(GL11.GL_COLOR_MATERIAL);
- GL11.glPushMatrix();
- GL11.glTranslatef((float)x, (float)y, 50.0F);
- GL11.glScalef((float)(30.0F), (float)30.0F, (float)30.0F);
- GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
- float var6 = thePlayer.renderYawOffset;
- float var7 = thePlayer.rotationYaw;
- float var8 = thePlayer.rotationPitch;
- float var9 = thePlayer.prevRotationYawHead;
- float var10 = thePlayer.rotationYawHead;
- GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
- RenderHelper.enableStandardItemLighting();
- GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(-((float)Math.atan((double)(roty / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
- thePlayer.renderYawOffset = (float)Math.atan((double)(rotx / 40.0F)) * 20.0F;
- thePlayer.rotationYaw = (float)Math.atan((double)(rotx / 40.0F)) * 40.0F;
- thePlayer.rotationPitch = -((float)Math.atan((double)(roty / 40.0F))) * 20.0F;
- thePlayer.rotationYawHead = thePlayer.rotationYaw;
- thePlayer.prevRotationYawHead = thePlayer.rotationYaw;
- GL11.glTranslatef(0.0F, thePlayer.yOffset, 0.0F);
- RenderManager.instance.playerViewY = 180.0F;
- RenderManager.instance.func_147940_a(thePlayer, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
- thePlayer.renderYawOffset = var6;
- thePlayer.rotationYaw = var7;
- thePlayer.rotationPitch = var8;
- thePlayer.prevRotationYawHead = var9;
- thePlayer.rotationYawHead = var10;
- GL11.glPopMatrix();
- RenderHelper.disableStandardItemLighting();
- GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement