MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    GUI qui ne s'ouvre qu'en solo

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.10
    14 Messages 4 Publieurs 2.0k Vues 1 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • P Hors-ligne
      PlayFlop_
      dernière édition par

      @‘Plaigon’:

      Bonjour, pouvons nous avoir ta classe Gui et la manière d’ou tu le display, merci d’avance

      package fr.playflop.extania.client.menu;
      
      import cpw.mods.fml.relauncher.Side;
      
      import cpw.mods.fml.relauncher.SideOnly;
      
      import java.awt.Desktop;
      import java.net.URI;
      import java.util.List;
      
      import fr.playflop.extania.client.cps.settings.GuiSettings;
      import fr.playflop.extania.client.keystroke.render.GuiScreenKeystrokes;
      import fr.playflop.extania.client.radio.GuiRadio;
      import net.minecraft.client.Minecraft;
      import net.minecraft.client.entity.EntityClientPlayerMP;
      import net.minecraft.client.gui.GuiButton;
      import net.minecraft.client.gui.GuiMainMenu;
      import net.minecraft.client.gui.GuiOptions;
      import net.minecraft.client.gui.GuiScreen;
      import net.minecraft.client.gui.achievement.GuiAchievements;
      import net.minecraft.client.gui.achievement.GuiStats;
      import net.minecraft.client.multiplayer.WorldClient;
      import net.minecraft.client.resources.I18n;
      import net.minecraft.util.EnumChatFormatting;
      import net.minecraft.util.Session;
      
      public class GuiExtaOption
        extends GuiScreen
      {
        private static final GuiScreen LOL = null;
      private int a;
        private int b;
      
        public void initGui()
        {
          this.a = 0;
          this.buttonList.clear();
          int i = -16;
          int j = 1;
          //this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + i, EnumChatFormatting.AQUA + "" + I18n.format("bouton.Deconnecter.name", new Object[0])));
          if (!this.mc.isIntegratedServerRunning()) {
            ((GuiButton)this.buttonList.get(0)).displayString = (EnumChatFormatting.AQUA + "" + I18n.format("bouton.Deconnecter.name", new Object[0]));
          }
          this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 2 + 60 + i, EnumChatFormatting.RED + "" + "Retourner en jeu"));
          this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 2 + 30 + i, EnumChatFormatting.AQUA + "" + "Particules"));
          this.buttonList.add(new GuiButton(6, this.width / 2 - 100, this.height / 2 + 10 + i, EnumChatFormatting.AQUA + "" + "Radio Extania"));
          this.buttonList.add(new GuiButton(7, this.width / 2 - 100, this.height / 2 - 10 + i, EnumChatFormatting.AQUA + "" + "KeyStrokesMod"));
          this.buttonList.add(new GuiButton(8, this.width / 2 - 100, this.height / 2 - 30 + i, EnumChatFormatting.AQUA + "" + "CPS"));
          this.buttonList.add(new GuiButton(9, this.width / 2 - 100, this.height / 2 - 50 + i, EnumChatFormatting.AQUA + "" + "Effect de Potion"));
          this.buttonList.add(new GuiButton(10, this.width / 2 - 100, this.height / 2 - 70 + i, EnumChatFormatting.AQUA + "" + "Armures"));
          //this.buttonList.add(new GuiButton(9, this.width / 2 - 22, this.height / 2 - 50 + i, EnumChatFormatting.AQUA + "" + "SideBar"));
          //this.buttonList.add(new GuiButton(10, this.width / 2 - 22, this.height / 2 - 70 + i, EnumChatFormatting.AQUA + "" + "Sprint"));
          //this.buttonList.add(new GuiButton(6, this.width / 2 - 22, this.height / 4 + 48 + i, 122, 20, EnumChatFormatting.AQUA + "" + "Stats"));
          //this.buttonList.add(new GuiButton(25, this.width / 2 - 100, this.height / 4 + 24 + i, 72, 20, EnumChatFormatting.YELLOW + "" + "Site"));
          //this.buttonList.add(new GuiButton(40, this.width / 2 - 100, this.height / 4 + 96 + i, 72, 20, EnumChatFormatting.BLUE + "" + "Forum"));
          //this.buttonList.add(new GuiButton(26, this.width / 2 - 100, this.height / 4 + 72 + i, 72, 20, EnumChatFormatting.GREEN + "" + "Teamspeak"));
          //this.buttonList.add(new GuiButton(10000, this.width / 2 - 100, this.height / 4 + 48 + i, 72, 20, EnumChatFormatting.DARK_PURPLE + "" + "Boutique"));/**/
        }
      
        public boolean doesGuiPauseGame()
        {
          return false;
        }
      
        protected void actionPerformed(GuiButton paramGuiButton)
        {
          Desktop localDesktop = null;
          switch (paramGuiButton.id)
          {
          case 0: 
            this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
            break;
          case 1: 
            paramGuiButton.enabled = false;
            this.mc.theWorld.sendQuittingDisconnectingPacket();
            this.mc.loadWorld((WorldClient)null);
            this.mc.displayGuiScreen(new GuiMainMenu());
            break;
          case 2: 
          case 3: 
          default: 
            break;
          case 4: 
            this.mc.displayGuiScreen((GuiScreen)null);
            this.mc.setIngameFocus();
            break;
          case 5: 
          Minecraft.getMinecraft().displayGuiScreen(new GuiParticules());
            break;
          case 6: 
          Minecraft.getMinecraft().displayGuiScreen(new GuiRadio());
            break;
          case 7: 
          Minecraft.getMinecraft().displayGuiScreen(new GuiScreenKeystrokes());
            break;
          case 8: 
          Minecraft.getMinecraft().displayGuiScreen(new GuiSettings());
            break;
          case 9: 
          Minecraft.getMinecraft().thePlayer.sendChatMessage("/statuseffect config");
            break;
          case 10: 
          Minecraft.getMinecraft().thePlayer.sendChatMessage("/armorstatus config");
            break;
          case 25: 
            try
            {
              URI localURI1 = new URI("http://extania-pvp.livehost.fr/");
              if (Desktop.isDesktopSupported())
              {
                localDesktop = Desktop.getDesktop();
                localDesktop.browse(localURI1);
              }
            }
               catch (Exception localException1)
            {
              localException1.printStackTrace();
            }
      
          case 40: 
            try
            {
              URI localURI2 = new URI("http://extania-pvp.livehost.fr/?page=forum");
              if (Desktop.isDesktopSupported())
              {
                localDesktop = Desktop.getDesktop();
                localDesktop.browse(localURI2);
              }
            }
            catch (Exception localException2)
            {
              localException2.printStackTrace();
            }
          case 26: 
            try
            {
              URI localURI3 = new URI("ts3server://eu2.freets3.ovh:3850&nickname=" + Minecraft.getMinecraft().getSession().getUsername());
              if (Desktop.isDesktopSupported())
              {
                localDesktop = Desktop.getDesktop();
                localDesktop.browse(localURI3);
              }
            }
            catch (Exception localException3)
            {
              localException3.printStackTrace();
            }
          case 10000: 
            try
            {
              URI localURI4 = new URI("http://extania-pvp.livehost.fr/?&page=boutique");
              if (Desktop.isDesktopSupported())
              {
                localDesktop = Desktop.getDesktop();
                localDesktop.browse(localURI4);
              }
            }
            catch (Exception localException4)
            {
              localException4.printStackTrace();
            }
          }
        }
      
      public void updateScreen()
        {
          super.updateScreen();
          this.b += 1;
        }
      
        public void drawScreen(int paramInt1, int paramInt2, float paramFloat)
        {
          drawDefaultBackground();
          //drawCenteredString(this.fontRendererObj, EnumChatFormatting.GOLD + "" + EnumChatFormatting.BOLD + "–-[" + EnumChatFormatting.WHITE + EnumChatFormatting.BOLD + "" + "Exta" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + "" + "nia" + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + "" + "]–- ", this.width / 2, 20, 16777215);
          drawCenteredString(this.fontRendererObj, EnumChatFormatting.GOLD + "Options Extania" + EnumChatFormatting.RED/* + Minecraft.getMinecraft().getSession().getUsername()/**/, this.width / 2, 40, 16777215);
          super.drawScreen(paramInt1, paramInt2, paramFloat);
        }
      }
      
      
      1 réponse Dernière réponse Répondre Citer 0
      • DeletedD Hors-ligne
        Deleted
        dernière édition par

        Comment affiches-tu ce gui ?

        1 réponse Dernière réponse Répondre Citer 0
        • P Hors-ligne
          PlayFlop_
          dernière édition par

          @‘Plaigon’:

          Comment affiches-tu ce gui ?

          En cliquant sur un bouton dans un GuiInGameMenu custom

          1 réponse Dernière réponse Répondre Citer 0
          • AymericRedA Hors-ligne
            AymericRed
            dernière édition par

            Je pense qu’il parlait de la fonction que tu utilises.

            Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

            AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

            Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
            Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

            1 réponse Dernière réponse Répondre Citer 0
            • P Hors-ligne
              PlayFlop_
              dernière édition par

              @‘AymericRed’:

              Je pense qu’il parlait de la fonction que tu utilises.

              Bha j’ai envoyé ma class…

              1 réponse Dernière réponse Répondre Citer 0
              • AymericRedA Hors-ligne
                AymericRed
                dernière édition par

                Non tas envoyé la classe du gui mais pas le code qui tu utilises pour ouvrir le gui (du type mc.displayGuiScreen ou player. openGui).

                Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

                AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

                Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
                Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

                1 réponse Dernière réponse Répondre Citer 0
                • P Hors-ligne
                  PlayFlop_
                  dernière édition par

                  @‘AymericRed’:

                  Non tas envoyé la classe du gui mais pas le code qui tu utilises pour ouvrir le gui (du type mc.displayGuiScreen ou player. openGui).

                  AHHH

                  j’utilise ça:

                  “Minecraft.getMinecraft().displayGuiScreen(new GuiExtaOption());”

                  1 réponse Dernière réponse Répondre Citer 0
                  • Romain120105R Hors-ligne
                    Romain120105
                    dernière édition par

                    Je crois qu’il faut mettre un SideOnly

                    J'adore le modding !  :D

                    1 réponse Dernière réponse Répondre Citer 0
                    • P Hors-ligne
                      PlayFlop_
                      dernière édition par

                      @‘Romain120105’:

                      Je crois qu’il faut mettre un SideOnly

                      Ou ça ?
                      Et je ne pense pas que ce soit ça.

                      1 réponse Dernière réponse Répondre Citer 0
                      • DeletedD Hors-ligne
                        Deleted
                        dernière édition par

                        Oui le SideOnly n’aiderait en rien.
                        Essaie de mettre un breakpoints ou plusieurs surtout pour voir où s’arrête le code lu lorsque tu joues sur serveur.

                        1 réponse Dernière réponse Répondre Citer 0
                        • P Hors-ligne
                          PlayFlop_
                          dernière édition par

                          Bon j’ai fixé mon problème seul!

                          1 réponse Dernière réponse Répondre Citer 0
                          • DeletedD Hors-ligne
                            Deleted
                            dernière édition par

                            Bien, tu deviens autonome !

                            1 réponse Dernière réponse Répondre Citer 0
                            • 1 / 1
                            • Premier message
                              Dernier message
                            Design by Woryk
                            ContactMentions Légales

                            MINECRAFT FORGE FRANCE © 2024

                            Powered by NodeBB