Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.altiscraft.altiscraft.common;
- import org.lwjgl.opengl.GL11;
- import diabolicatrix.project.Base;
- import diabolicatrix.project.PacketGetPlayersAndSendMessage;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.GuiButton;
- import net.minecraft.client.gui.GuiScreen;
- import net.minecraft.client.gui.GuiTextField;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.util.EnumChatFormatting;
- import net.minecraft.util.ResourceLocation;
- public class GuiTel extends GuiScreen {
- int guiWidth = 350;
- int guiHeight = 200;
- private EntityPlayer player = Minecraft.getMinecraft().thePlayer;
- private GuiTextField textfield;
- private GuiTextField textefield;
- @Override
- public void drawScreen(int x, int y, float ticks) {
- int guix = (width - guiWidth) / 2;
- int guiy = (height - guiHeight) / 2;
- GL11.glColor4f(1, 1, 1, 1);
- mc.renderEngine.bindTexture(new ResourceLocation(ModAltisCraft.MODID, "textures/gui/Fondinv.png"));
- drawTexturedModalRect(guix, guiy, 0, 0, guiWidth - 3, 15);
- mc.renderEngine.bindTexture(new ResourceLocation(ModAltisCraft.MODID, "textures/gui/BackGround.png"));
- drawTexturedModalRect(guix, guiy + 16, 0, 0, guiWidth - 3, 150);
- fontRendererObj.drawString("Tà©là©phone", guix + 5, guiy + 5, 0xFFFFFF);
- this.textfield.drawTextBox();
- this.textefield.drawTextBox();
- super.drawScreen(x, y, ticks);
- }
- @Override
- public void initGui() {
- int guiX = (this.width - guiWidth) / 2;
- int guiY = (this.height - guiHeight) / 2;
- buttonList.clear();
- buttonList.add(new GuiAC6(0, guiX + 295, guiY + 144, "FERMER"));
- buttonList.add(new GuiAC6(1, guiX + 2, guiY + 144, "RETOUR"));
- buttonList.add(new GuiAC7(3, guiX + 15, guiY + 80, "ENVOYER"));
- buttonList.add(new GuiAC7(4, guiX + 78, guiY + 80, "POLICE"));
- buttonList.add(new GuiAC7(5, guiX + 141, guiY + 80, "S.A.M.U"));
- buttonList.add(new GuiAC7(6, guiX + 204, guiY + 80, "DEPANNEUR"));
- buttonList.add(new GuiAC7(7, guiX + 267, guiY + 80, "TRANSALTIS"));
- buttonList.add(new GuiAC7(2, guiX + 141, guiY + 105, "STAFF"));
- this.textfield = new GuiTextField(this.fontRendererObj, this.width / 2 - 158, 190, 310, 15);
- textfield.setMaxStringLength(300);
- textfield.setText("");
- this.textefield = new GuiTextField(this.fontRendererObj, this.width / 2 - 158, 251, 120, 15);
- textefield.setMaxStringLength(300);
- textefield.setText("");
- Minecraft.getMinecraft().thePlayer.getDisplayName();
- super.initGui();
- }
- protected void keyTyped(char par1, int par2) {
- super.keyTyped(par1, par2);
- this.textfield.textboxKeyTyped(par1, par2);
- this.textefield.textboxKeyTyped(par1, par2);
- }
- protected void mouseClicked(int x, int y, int btn) {
- super.mouseClicked(x, y, btn);
- this.textfield.mouseClicked(x, y, btn);
- this.textefield.mouseClicked(x, y, btn);
- }
- @Override
- protected void actionPerformed(GuiButton btn) {
- if (btn.id == 0) {
- Minecraft.getMinecraft().displayGuiScreen(null);
- }
- else if (btn.id == 1) {
- Minecraft.getMinecraft().displayGuiScreen(new GuiInv());
- }
- else if (btn.id == 2) {
- Minecraft.getMinecraft().thePlayer.sendChatMessage("/helpop " + textfield.getText());
- Minecraft.getMinecraft().displayGuiScreen(new GuiTel());
- }
- else if (btn.id == 3) {
- Minecraft.getMinecraft().thePlayer.sendChatMessage("/msg" + " " + textefield.getText() + " " + textfield.getText());
- Minecraft.getMinecraft().displayGuiScreen(new GuiTel());
- }
- else if (btn.id == 4) {
- Base.instance.network.sendToServer(new PacketGetPlayersAndSendMessage(EnumChatFormatting.AQUA + "[Gendarmes]" + EnumChatFormatting.DARK_BLUE + " [x:" + Minecraft.getMinecraft().thePlayer.getPlayerCoordinates().posX + " z:" + Minecraft.getMinecraft().thePlayer.getPlayerCoordinates().posZ + "] " + EnumChatFormatting.RESET + Minecraft.getMinecraft().thePlayer.getDisplayName() + ": " + textfield.getText(), "Policier"));
- Minecraft.getMinecraft().displayGuiScreen(new GuiTel());
- }
- else if (btn.id == 5) {
- Base.instance.network.sendToServer(new PacketGetPlayersAndSendMessage(EnumChatFormatting.RED + "[SAMU]" + EnumChatFormatting.RED + " [x:" + Minecraft.getMinecraft().thePlayer.getPlayerCoordinates().posX + " z:" + Minecraft.getMinecraft().thePlayer.getPlayerCoordinates().posZ + "] " + EnumChatFormatting.RESET + Minecraft.getMinecraft().thePlayer.getDisplayName() + ": " + textfield.getText(), "SAMU"));
- Minecraft.getMinecraft().displayGuiScreen(new GuiTel());
- }
- else if (btn.id == 6) {
- Base.instance.network.sendToServer(new PacketGetPlayersAndSendMessage(EnumChatFormatting.YELLOW + "[Dépanneurs]" + EnumChatFormatting.YELLOW + " [x:" + Minecraft.getMinecraft().thePlayer.getPlayerCoordinates().posX + " z:" + Minecraft.getMinecraft().thePlayer.getPlayerCoordinates().posZ + "] " + EnumChatFormatting.RESET + Minecraft.getMinecraft().thePlayer.getDisplayName() + ": " + textfield.getText(), "Garagiste"));
- Minecraft.getMinecraft().displayGuiScreen(new GuiTel());
- }
- else if (btn.id == 7) {
- Base.instance.network.sendToServer(new PacketGetPlayersAndSendMessage(EnumChatFormatting.GOLD + "[TransAltis]" + EnumChatFormatting.GOLD + " [x:" + Minecraft.getMinecraft().thePlayer.getPlayerCoordinates().posX + " z:" + Minecraft.getMinecraft().thePlayer.getPlayerCoordinates().posZ + "] " + EnumChatFormatting.RESET + Minecraft.getMinecraft().thePlayer.getDisplayName() + ": " + textfield.getText(), "TransAltis"));
- Minecraft.getMinecraft().displayGuiScreen(new GuiTel());
- }
- }
- @Override
- public boolean doesGuiPauseGame() {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement