• Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Solved Problème menu custom

    1.7.x
    1.7.x
    2
    3
    766
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Sebenf0rce last edited by

      Bonjour,
      J’ai modifié le menu principal ainsi que le menu en jeu mais impossible de réussir pour le menu option.
      Voici ce que j’ai fait pour l’instant :
      Dans la classe principale :

      ​package com.example.examplemod;
      
      import net.minecraft.client.Minecraft;
      import net.minecraft.client.gui.GuiIngameMenu;
      import net.minecraft.client.gui.GuiMainMenu;
      import net.minecraft.client.gui.GuiOptions;
      import net.minecraft.client.gui.GuiScreen;
      import net.minecraft.client.gui.GuiVideoSettings;
      import cpw.mods.fml.common.FMLCommonHandler;
      import cpw.mods.fml.common.Mod;
      import cpw.mods.fml.common.Mod.EventHandler;
      import cpw.mods.fml.common.event.FMLInitializationEvent;
      import cpw.mods.fml.common.eventhandler.SubscribeEvent;
      import cpw.mods.fml.common.gameevent.TickEvent;
      import cpw.mods.fml.common.gameevent.TickEvent.Phase;
      
      @Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION)
      public class ExampleMod
      {
          public static final String MODID = "menu";
          public static final String VERSION = "1.0";
      
          @EventHandler
          public void init(FMLInitializationEvent event)
          {
          FMLCommonHandler.instance().bus().register(this);
          }
          @SubscribeEvent
      
          public void onTickClient(TickEvent.ClientTickEvent event)
      
             {
      
                 if(event.phase == Phase.END)
      
                 {
      
                     Minecraft mc = Minecraft.getMinecraft();
      
                     GuiScreen currentScreen = mc.currentScreen;
      
                     GuiCustomMainMenu customMenu = new GuiCustomMainMenu();
      
                     if(currentScreen instanceof GuiMainMenu && !currentScreen.equals(customMenu))
      
                     {
      
                         mc.displayGuiScreen(customMenu);
      
                     }
      
                     GuiCustomIngameMenu customIngame = new GuiCustomIngameMenu();
          if(currentScreen instanceof GuiIngameMenu && !currentScreen.equals(customIngame))
          {
          mc.displayGuiScreen(customIngame);
          }
      
          GuiCustomOptions customOptions = new GuiCustomOptions();
        if(currentScreen instanceof GuiOptions && !currentScreen.equals(customOptions))
        {
        mc.displayGuiScreen(customOptions);
        }
      
        GuiCustomVideoSettings customVideoSettings = new GuiCustomVideoSettings();
        if(currentScreen instanceof GuiVideoSettings && !currentScreen.equals(customVideoSettings))
        {
        mc.displayGuiScreen(customVideoSettings);
        }
      
                 }
      
                }
      
             }
      

      J’ai donc repris le code de la classe GuiOptions mais j’obtiens l’erreur suivante : 
      The constructor GuiCustomOptions() is undefined

      Merci d’avance.

      1 Reply Last reply Reply Quote 0
      • robin4002
        robin4002 Moddeurs confirmés Rédacteurs Administrateurs last edited by

        Pour faire un menu d’option différent pas besoin de tout ça.
        Dans le code de ton menu custom au niveau des actions des boutons change GuiOptions par ta gui à toi.

        1 Reply Last reply Reply Quote 0
        • S
          Sebenf0rce last edited by

          Effectivement merci 😉

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Design by Woryk
          Contact / Mentions Légales

          MINECRAFT FORGE FRANCE © 2018

          Powered by NodeBB