本文整理汇总了Java中net.minecraft.client.gui.GuiControls类的典型用法代码示例。如果您正苦于以下问题:Java GuiControls类的具体用法?Java GuiControls怎么用?Java GuiControls使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GuiControls类属于net.minecraft.client.gui包,在下文中一共展示了GuiControls类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispatchKeypresses
import net.minecraft.client.gui.GuiControls; //导入依赖的package包/类
public void dispatchKeypresses()
{
int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey();
if (i != 0 && !Keyboard.isRepeatEvent())
{
if (!(this.currentScreen instanceof GuiControls) || ((GuiControls)this.currentScreen).time <= getSystemTime() - 20L)
{
if (Keyboard.getEventKeyState())
{
if (i == this.gameSettings.keyBindFullscreen.getKeyCode())
{
this.toggleFullscreen();
}
else if (i == this.gameSettings.keyBindScreenshot.getKeyCode())
{
this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight, this.framebufferMc));
}
}
}
}
}
示例2: dispatchKeypresses
import net.minecraft.client.gui.GuiControls; //导入依赖的package包/类
public void dispatchKeypresses()
{
int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey();
if (i != 0 && !Keyboard.isRepeatEvent())
{
if (!(this.currentScreen instanceof GuiControls) || ((GuiControls)this.currentScreen).time <= getSystemTime() - 20L)
{
if (Keyboard.getEventKeyState())
{
if (this.gameSettings.keyBindFullscreen.isActiveAndMatches(i))
{
this.toggleFullscreen();
}
else if (this.gameSettings.keyBindScreenshot.isActiveAndMatches(i))
{
this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight, this.framebufferMc));
}
}
else if (this.currentScreen instanceof GuiControls) ((GuiControls)this.currentScreen).buttonId = null;
}
}
}
示例3: keyTyped
import net.minecraft.client.gui.GuiControls; //导入依赖的package包/类
public void keyTyped(char ch, int key) {
if (focusedSlotIndex != -1){
saves[focusedSlotIndex].keyTyped(ch, key);
}
else{
if (key == Keyboard.KEY_C && GuiControls.isCtrlKeyDown())
copy();
if (key == Keyboard.KEY_V && GuiControls.isCtrlKeyDown() && canPaste())
paste();
if (key == Keyboard.KEY_X && GuiControls.isCtrlKeyDown())
cut();
}
}
示例4: addInformation
import net.minecraft.client.gui.GuiControls; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
list.add("Hold Shift for more information");
if(GuiControls.isShiftKeyDown()){
list.add("");
list.add("The core of your crafting");
//list.add("");
list.add("Binding Tier : 1");
}
}
示例5: GuiControlsScrollPanel
import net.minecraft.client.gui.GuiControls; //导入依赖的package包/类
public GuiControlsScrollPanel(GuiControls controls, GameSettings options, Minecraft mc)
{
super(mc, controls.width, controls.height, 16, (controls.height - 32) + 4, 25);
this.controls = controls;
this.options = options;
this.mc = mc;
}
示例6: dispatchKeypresses
import net.minecraft.client.gui.GuiControls; //导入依赖的package包/类
public void dispatchKeypresses() {
int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() : Keyboard.getEventKey();
if (i != 0 && !Keyboard.isRepeatEvent()) {
if (!(this.currentScreen instanceof GuiControls)
|| ((GuiControls) this.currentScreen).time <= getSystemTime() - 20L) {
if (Keyboard.getEventKeyState()) {
if (i == this.gameSettings.keyBindStreamStartStop.getKeyCode()) {
if (this.getTwitchStream().isBroadcasting()) {
this.getTwitchStream().stopBroadcasting();
} else if (this.getTwitchStream().isReadyToBroadcast()) {
this.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() {
public void confirmClicked(boolean result, int id) {
if (result) {
Minecraft.this.getTwitchStream().func_152930_t();
}
Minecraft.this.displayGuiScreen((GuiScreen) null);
}
}, I18n.format("stream.confirm_start", new Object[0]), "", 0));
} else if (this.getTwitchStream().func_152928_D() && this.getTwitchStream().func_152936_l()) {
if (this.theWorld != null) {
this.ingameGUI.getChatGUI()
.printChatMessage(new ChatComponentText("Not ready to start streaming yet!"));
}
} else {
GuiStreamUnavailable.func_152321_a(this.currentScreen);
}
} else if (i == this.gameSettings.keyBindStreamPauseUnpause.getKeyCode()) {
if (this.getTwitchStream().isBroadcasting()) {
if (this.getTwitchStream().isPaused()) {
this.getTwitchStream().unpause();
} else {
this.getTwitchStream().pause();
}
}
} else if (i == this.gameSettings.keyBindStreamCommercials.getKeyCode()) {
if (this.getTwitchStream().isBroadcasting()) {
this.getTwitchStream().requestCommercial();
}
} else if (i == this.gameSettings.keyBindStreamToggleMic.getKeyCode()) {
this.stream.muteMicrophone(true);
} else if (i == this.gameSettings.keyBindFullscreen.getKeyCode()) {
this.toggleFullscreen();
} else if (i == this.gameSettings.keyBindScreenshot.getKeyCode()) {
this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir,
this.displayWidth, this.displayHeight, this.framebufferMc));
}
} else if (i == this.gameSettings.keyBindStreamToggleMic.getKeyCode()) {
this.stream.muteMicrophone(false);
}
}
}
}
示例7: func_73875_a
import net.minecraft.client.gui.GuiControls; //导入依赖的package包/类
protected void func_73875_a(GuiButton p_73875_1_) {
if(p_73875_1_.field_73742_g) {
if(p_73875_1_.field_73741_f < 100 && p_73875_1_ instanceof GuiSmallButton) {
this.field_74051_d.func_74306_a(((GuiSmallButton)p_73875_1_).func_73753_a(), 1);
p_73875_1_.field_73744_e = this.field_74051_d.func_74297_c(EnumOptions.func_74379_a(p_73875_1_.field_73741_f));
}
if(p_73875_1_.field_73741_f == 101) {
this.field_73882_e.field_71474_y.func_74303_b();
this.field_73882_e.func_71373_a(new GuiVideoSettings(this, this.field_74051_d));
}
if(p_73875_1_.field_73741_f == 100) {
this.field_73882_e.field_71474_y.func_74303_b();
this.field_73882_e.func_71373_a(new GuiControls(this, this.field_74051_d));
}
if(p_73875_1_.field_73741_f == 102) {
this.field_73882_e.field_71474_y.func_74303_b();
this.field_73882_e.func_71373_a(new GuiLanguage(this, this.field_74051_d, this.field_73882_e.func_135016_M()));
}
if(p_73875_1_.field_73741_f == 103) {
this.field_73882_e.field_71474_y.func_74303_b();
this.field_73882_e.func_71373_a(new ScreenChatOptions(this, this.field_74051_d));
}
if(p_73875_1_.field_73741_f == 104) {
this.field_73882_e.field_71474_y.func_74303_b();
this.field_73882_e.func_71373_a(new GuiSnooper(this, this.field_74051_d));
}
if(p_73875_1_.field_73741_f == 200) {
this.field_73882_e.field_71474_y.func_74303_b();
this.field_73882_e.func_71373_a(this.field_74053_c);
}
if(p_73875_1_.field_73741_f == 105) {
this.field_73882_e.field_71474_y.func_74303_b();
this.field_73882_e.func_71373_a(new GuiScreenTemporaryResourcePackSelect(this, this.field_74051_d));
}
}
}