Java 类net.minecraft.client.gui.GuiOptions 实例源码

项目:RewiMod    文件:GuiHandler.java   
@SubscribeEvent
public void onOpenGui(GuiOpenEvent event) {
    if (event.gui instanceof GuiMainMenu) {
        event.gui = new RewiMainMenu();
    }
    if (event.gui instanceof GuiIngameMenu) {
        event.gui = new RewiIngameMenu();
    }
    if (event.gui instanceof GuiOptions) {
        event.gui = new RewiOptionsMenu(Minecraft.getMinecraft().currentScreen, Minecraft.getMinecraft().gameSettings);
    }
}
项目:Factorization    文件:MiscClientProxy.java   
@SubscribeEvent
public void patchupTheStupidSecretButton(InitGuiEvent.Post event) {
    if (!(event.gui instanceof GuiOptions)) return;

    for (Object obj : event.buttonList) {
        if (obj instanceof GuiButton) {
            GuiButton button = (GuiButton) obj;
            if (button.id == 8675309) {
                button.displayString = "Shaders; press F4 to reset";
                button.xPosition = 0;
                button.yPosition = 0;
                return;
            }
        }
    }
}
项目:Obsidian    文件:ObsidianMainMenu.java   
@Override
protected void actionPerformed(GuiButton button) {
    switch (button.id) {
        case 1: // Singleplayer
            RenderUtil.MINECRAFT.displayGuiScreen(new GuiSelectWorld(this));
            break;
        case 2: // Multiplayer
            RenderUtil.MINECRAFT.displayGuiScreen(new GuiMultiplayer(this));
            break;
        case 3: // Options
            RenderUtil.MINECRAFT.displayGuiScreen(new GuiOptions(this, RenderUtil.MINECRAFT.gameSettings));
            break;
        case 4: // Mods
            RenderUtil.MINECRAFT.displayGuiScreen(new GuiModList(this));
            break;
        case 5: // Addons
            break;
        case 6: // Quit
            RenderUtil.MINECRAFT.shutdown();
    }
}
项目:MC-Ray-Tracer    文件:TransformerUtil.java   
/**
 * Called from asm modified code:
 * {@link net.minecraft.client.gui.GuiOptions#actionPerformed() actionPerformed(GuiButton)}
 */
public static void addButtonAction(GuiOptions guiOptions, GuiButton button) {
    if (button.id == 18107) {
        Minecraft.getMinecraft().gameSettings.saveOptions();
        Minecraft.getMinecraft().displayGuiScreen(new RayTracerSettings(guiOptions));
    }
}
项目:ShadyMod    文件:ShadyMod.java   
@SubscribeEvent
public void onActionPerformed(ActionPerformedEvent event)
{
    if(event.gui instanceof GuiOptions)
    {
        if(event.button.id == 0x42)
        {
            Minecraft.getMinecraft().displayGuiScreen(new GuiShadyOptions(event.gui));
        }
    }
}
项目:ShadyMod    文件:ShadyMod.java   
@SuppressWarnings("unchecked")
@SubscribeEvent
public void onGuiInit(InitGuiEvent event)
{
    if(event.gui instanceof GuiOptions)
    {
        int x = event.gui.width / 2 + 5 + 150 + 5;
        int y = event.gui.height / 6 + 48 - 6;
        event.buttonList.add(new GuiIconButton(0x42, x, y, new ResourceLocation(MODID, "textures/gui/palette.png")));
    }
}
项目:CustomSelectionBox    文件:CSBClientProxy.java   
@SubscribeEvent
public void onTick(TickEvent event) {
    if (event.side != Side.CLIENT || !event.phase.equals(TickEvent.Phase.START))
        return;
    if (event.type.equals(TickEvent.Type.RENDER)) {
        Minecraft mc = Minecraft.getMinecraft();
        if ((mc.currentScreen instanceof GuiOptions)) {
            GuiOptions gui = (GuiOptions) mc.currentScreen;
            List buttons = getList(gui);
            if (buttons == null) {
                CSB.logger.warn("no buttonsList?! " + gui);
                doDebug(gui);
                return;
            }
            for (Iterator i$ = buttons.iterator(); i$.hasNext();) {
                Object o = i$.next();
                if ((o instanceof CSBButton)) {
                    return;
                }
            }
            if (CSB.diffButtonLoc)
                buttons.add(new CSBButton(404, gui.width - 150, 0, 150, 20, "Custom Selection Box"));
            else  // see GuiOptions.initGui
                buttons.add(new CSBButton(404, gui.width / 2 - 75, gui.height / 6 + 24 - 6, 150, 20, "Custom Selection Box"));
        }
    }
}
项目:Hard-Science    文件:ClientEventHandler.java   
@SubscribeEvent
public static void onActionPerformed(ActionPerformedEvent.Pre event)
{
    if(event.getGui() != null && event.getGui() instanceof GuiOptions )
    {
        SuperTileEntity.updateRenderDistance();
    }
}
项目:TwitchNotifier    文件:GuiEvents.java   
@SubscribeEvent
public void onButtonClickPost(GuiScreenEvent.ActionPerformedEvent.Post event) {
    if (event.getGui() instanceof GuiOptions) {
        if (event.getButton().id == 1725) {
            try {
                IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(Loader.instance().getIndexedModList().get(Reference.MOD_ID));
                GuiScreen newScreen = guiFactory.mainConfigGuiClass().getConstructor(GuiScreen.class).newInstance(event.getGui());
                event.getGui().mc.displayGuiScreen(newScreen);
            } catch (Exception ex) {}
        }
    }
}
项目:RuneCraftery    文件:GuiIngameMenu.java   
protected void func_73875_a(GuiButton p_73875_1_) {
   switch(p_73875_1_.field_73741_f) {
   case 0:
      this.field_73882_e.func_71373_a(new GuiOptions(this, this.field_73882_e.field_71474_y));
      break;
   case 1:
      p_73875_1_.field_73742_g = false;
      this.field_73882_e.field_71413_E.func_77450_a(StatList.field_75947_j, 1);
      this.field_73882_e.field_71441_e.func_72882_A();
      this.field_73882_e.func_71403_a((WorldClient)null);
      this.field_73882_e.func_71373_a(new GuiMainMenu());
   case 2:
   case 3:
   default:
      break;
   case 4:
      this.field_73882_e.func_71373_a((GuiScreen)null);
      this.field_73882_e.func_71381_h();
      this.field_73882_e.field_71416_A.func_82461_f();
      break;
   case 5:
      this.field_73882_e.func_71373_a(new GuiAchievements(this.field_73882_e.field_71413_E));
      break;
   case 6:
      this.field_73882_e.func_71373_a(new GuiStats(this, this.field_73882_e.field_71413_E));
      break;
   case 7:
      this.field_73882_e.func_71373_a(new GuiShareToLan(this));
   }

}
项目:RuneCraftery    文件:GuiMainMenu.java   
protected void func_73875_a(GuiButton p_73875_1_) {
   if(p_73875_1_.field_73741_f == 0) {
      this.field_73882_e.func_71373_a(new GuiOptions(this, this.field_73882_e.field_71474_y));
   }

   if(p_73875_1_.field_73741_f == 5) {
      this.field_73882_e.func_71373_a(new GuiLanguage(this, this.field_73882_e.field_71474_y, this.field_73882_e.func_135016_M()));
   }

   if(p_73875_1_.field_73741_f == 1) {
      this.field_73882_e.func_71373_a(new GuiSelectWorld(this));
   }

   if(p_73875_1_.field_73741_f == 2) {
      this.field_73882_e.func_71373_a(new GuiMultiplayer(this));
   }

   if(p_73875_1_.field_73741_f == 14 && this.field_130023_H.field_73748_h) {
      this.func_140005_i();
   }

   if(p_73875_1_.field_73741_f == 4) {
      this.field_73882_e.func_71400_g();
   }

   if(p_73875_1_.field_73741_f == 11) {
      this.field_73882_e.func_71371_a("Demo_World", "Demo_World", DemoWorldServer.field_73071_a);
   }

   if(p_73875_1_.field_73741_f == 12) {
      ISaveFormat var2 = this.field_73882_e.func_71359_d();
      WorldInfo var3 = var2.func_75803_c("Demo_World");
      if(var3 != null) {
         GuiYesNo var4 = GuiSelectWorld.func_74061_a(this, var3.func_76065_j(), 12);
         this.field_73882_e.func_71373_a(var4);
      }
   }

}
项目:MacroKey    文件:GuiEventHandler.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void actionPreformed(GuiScreenEvent.ActionPerformedEvent.Post event) {
    GuiScreen gui = event.getGui();

    if (gui instanceof GuiOptions) {
        if(event.getButton().id == Reference.MACROKEY_OPTIONS_BUTTON){
            Minecraft.getMinecraft().displayGuiScreen(new GuiManageKeybindings(gui, Minecraft.getMinecraft().gameSettings));

        }
    }
    if(gui instanceof GuiIngameMenu){
        if(event.getButton().id == Reference.MACROKEY_INGAME_LAYER_TOGGLE) {

            currentSelectedLayer++;

            if(currentSelectedLayer< MacroKey.instance.layers.size()) {
                event.getButton().displayString = "Layer: " + MacroKey.instance.layers.get(currentSelectedLayer).getDisplayName();
                Layer.setActiveLayer(MacroKey.instance.layers.get(currentSelectedLayer));

            }else if(currentSelectedLayer+1>=MacroKey.instance.layers.size()){
                currentSelectedLayer=-1;
                event.getButton().displayString = "Layer: Master";
                Layer.setActiveLayer(null);

            }
        }
    }
}
项目:CheataClientSrc    文件:CheataMainMenu.java   
/**
  * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
  */
 protected void actionPerformed(GuiButton button) throws IOException
 {
     if (button.id == 0)
     {
         this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
     }

     if (button.id == 5)
     {
         this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager()));
     }

     if (button.id == 1)
     {
         this.mc.displayGuiScreen(new GuiWorldSelection(this));
     }

     if (button.id == 2)
     {
         this.mc.displayGuiScreen(new GuiMultiplayer(this));
     }

     if (button.id == 4)
     {
         this.mc.shutdown();
     }

     if (button.id == 11)
     {
         this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings);
     }

     if (button.id == 12)
     {
         ISaveFormat isaveformat = this.mc.getSaveLoader();
         WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
         if (worldinfo != null)
         {
             this.mc.displayGuiScreen(new GuiYesNo(this, I18n.format("selectWorld.deleteQuestion", new Object[0]), "\'" + worldinfo.getWorldName() + "\' " + I18n.format("selectWorld.deleteWarning", new Object[0]), I18n.format("selectWorld.deleteButton", new Object[0]), I18n.format("gui.cancel", new Object[0]), 12));
         }
     }

     if (button.id == 21)
     {
        this.mc.displayGuiScreen(new CheataGui(this));
     }

     if (button.id == 24)
     {
try {
            final URL url = new URL("https://github.com/CheataClient/CheataClient");
    URI uri = url.toURI();                                                                                                                                              
             Desktop.getDesktop().browse(uri);
} catch (URISyntaxException e) {
    e.printStackTrace();
}
     }
 }
项目:PopularMMOS-EpicProportions-Mod    文件:GuiMainMenu.java   
protected void actionPerformed(GuiButton p_146284_1_)
{
    if (p_146284_1_.id == 0)
    {
        this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
    }

    if (p_146284_1_.id == 5)
    {
        this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager()));
    }

    if (p_146284_1_.id == 1)
    {
        this.mc.displayGuiScreen(new GuiSelectWorld(this));
    }

    if (p_146284_1_.id == 2)
    {
        this.mc.displayGuiScreen(new GuiMultiplayer(this));
    }

    if (p_146284_1_.id == 14)
    {
        this.func_140005_i();
    }

    if (p_146284_1_.id == 4)
    {
        this.mc.shutdown();
    }

    if (p_146284_1_.id == 6)
    {
        this.mc.displayGuiScreen(new GuiModList(this));
    }

    if (p_146284_1_.id == 11)
    {
        this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings);
    }

    if (p_146284_1_.id == 12)
    {
        ISaveFormat isaveformat = this.mc.getSaveLoader();
        WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");

        if (worldinfo != null)
        {
            GuiYesNo guiyesno = GuiSelectWorld.func_152129_a(this, worldinfo.getWorldName(), 12);
            this.mc.displayGuiScreen(guiyesno);
        }
    }
}
项目:ToggleSneak    文件:ToggleSneakEvents.java   
@SubscribeEvent
public void GuiOpenEvent(GuiOpenEvent event)
{
    if(event.gui instanceof GuiOptions && mc.theWorld != null)
    {
        event.gui = new GuiOptionsReplace(new GuiIngameMenu(), mc.gameSettings);
    }
}
项目:ARKCraft-Code    文件:GuiMainMenuOverride.java   
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.id == 0)
    {
        this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
    }

    if (button.id == 5)
    {
        this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc
                .getLanguageManager()));
    }

    if (button.id == 1)
    {
        this.mc.displayGuiScreen(new GuiSelectWorld(this));
    }

    if (button.id == 2)
    {
        this.mc.displayGuiScreen(new GuiMultiplayer(this));
    }

    if (button.id == 14 && this.realmsButton.visible)
    {
        this.switchToRealms();
    }

    if (button.id == 4)
    {
        this.mc.shutdown();
    }

    if (button.id == 6)
    {
        this.mc.displayGuiScreen(new net.minecraftforge.fml.client.GuiModList(this));
    }

    if (button.id == 11)
    {
        this.mc.launchIntegratedServer("Demo_World", "Demo_World",
                DemoWorldServer.demoWorldSettings);
    }

    if (button.id == 12)
    {
        ISaveFormat isaveformat = this.mc.getSaveLoader();
        WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");

        if (worldinfo != null)
        {
            GuiYesNo guiyesno = GuiSelectWorld
                    .func_152129_a(this, worldinfo.getWorldName(), 12);
            this.mc.displayGuiScreen(guiyesno);
        }
    }
}
项目:TwitchNotifier    文件:GuiEvents.java   
@SubscribeEvent
public void onScreenInitPost(GuiScreenEvent.InitGuiEvent.Post event) {
    if (event.getGui() instanceof GuiOptions) {
        event.getButtonList().add(new GuiButton(1725, event.getGui().width / 2 - 155, event.getGui().height / 6 + 48 - 10 - 20, 150, 20, I18n.format("Twitch Notifier Settings...")));
    }
}
项目:Glass-Pane    文件:GlassPaneTestHarness.java   
@EventHandler
public void onInit(FMLInitializationEvent e) {
    new PaneHarnessOptionsOverlay().autoOverlay(GuiOptions.class);
}
项目:MC-Ray-Tracer    文件:TransformerUtil.java   
/**
 * Called from asm modified code:
 * {@link net.minecraft.client.gui.GuiOptions#initGui() initGui()}
 */
public static void addButtonsToGuiOptions(GuiOptions guiOptions, List<GuiButton> buttonList) {
    buttonList.add(new GuiButton(18107, guiOptions.width / 2 + 5, guiOptions.height / 6 + 12 + 6, 150, 20, "Ray Tracer Settings"));
}