当前位置: 首页>>代码示例>>Java>>正文


Java GuiOptions类代码示例

本文整理汇总了Java中net.minecraft.client.gui.GuiOptions的典型用法代码示例。如果您正苦于以下问题:Java GuiOptions类的具体用法?Java GuiOptions怎么用?Java GuiOptions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GuiOptions类属于net.minecraft.client.gui包,在下文中一共展示了GuiOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onOpenGui

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
@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);
	}
}
 
开发者ID:CreepPlaysDE,项目名称:RewiMod,代码行数:13,代码来源:GuiHandler.java

示例2: patchupTheStupidSecretButton

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
@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;
            }
        }
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:17,代码来源:MiscClientProxy.java

示例3: actionPerformed

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
@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();
    }
}
 
开发者ID:ObsidianBox,项目名称:Obsidian,代码行数:22,代码来源:ObsidianMainMenu.java

示例4: addButtonAction

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
/**
 * 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));
	}
}
 
开发者ID:18107,项目名称:MC-Ray-Tracer,代码行数:11,代码来源:TransformerUtil.java

示例5: onActionPerformed

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
@SubscribeEvent
public void onActionPerformed(ActionPerformedEvent event)
{
    if(event.gui instanceof GuiOptions)
    {
        if(event.button.id == 0x42)
        {
            Minecraft.getMinecraft().displayGuiScreen(new GuiShadyOptions(event.gui));
        }
    }
}
 
开发者ID:jglrxavpok,项目名称:ShadyMod,代码行数:12,代码来源:ShadyMod.java

示例6: onGuiInit

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
@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")));
    }
}
 
开发者ID:jglrxavpok,项目名称:ShadyMod,代码行数:12,代码来源:ShadyMod.java

示例7: onTick

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
@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"));
		}
	}
}
 
开发者ID:TeNNoX-Mods,项目名称:CustomSelectionBox,代码行数:28,代码来源:CSBClientProxy.java

示例8: onActionPerformed

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
@SubscribeEvent
public static void onActionPerformed(ActionPerformedEvent.Pre event)
{
    if(event.getGui() != null && event.getGui() instanceof GuiOptions )
    {
        SuperTileEntity.updateRenderDistance();
    }
}
 
开发者ID:grondag,项目名称:Hard-Science,代码行数:9,代码来源:ClientEventHandler.java

示例9: onButtonClickPost

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
@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) {}
        }
    }
}
 
开发者ID:FireBall1725,项目名称:TwitchNotifier,代码行数:13,代码来源:GuiEvents.java

示例10: func_73875_a

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
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));
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:32,代码来源:GuiIngameMenu.java

示例11: func_73875_a

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
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);
      }
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:40,代码来源:GuiMainMenu.java

示例12: actionPreformed

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
@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);

            }
        }
    }
}
 
开发者ID:Matts,项目名称:MacroKey,代码行数:30,代码来源:GuiEventHandler.java

示例13: actionPerformed

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
/**
  * 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();
}
     }
 }
 
开发者ID:CheataClient,项目名称:CheataClientSrc,代码行数:62,代码来源:CheataMainMenu.java

示例14: actionPerformed

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
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);
        }
    }
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:55,代码来源:GuiMainMenu.java

示例15: GuiOpenEvent

import net.minecraft.client.gui.GuiOptions; //导入依赖的package包/类
@SubscribeEvent
public void GuiOpenEvent(GuiOpenEvent event)
{
	if(event.gui instanceof GuiOptions && mc.theWorld != null)
	{
		event.gui = new GuiOptionsReplace(new GuiIngameMenu(), mc.gameSettings);
	}
}
 
开发者ID:Shotbow,项目名称:ToggleSneak,代码行数:9,代码来源:ToggleSneakEvents.java


注:本文中的net.minecraft.client.gui.GuiOptions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。