public void init(FMLInitializationEvent event) { // Register for various events: FMLCommonHandler.instance().bus().register(this); MinecraftForge.EVENT_BUS.register(this); GameSettings settings = Minecraft.getMinecraft().gameSettings; setUpExtraKeys(settings); this.stateMachine = new ClientStateMachine(ClientState.WAITING_FOR_MOD_READY, this); this.originalMouseHelper = Minecraft.getMinecraft().mouseHelper; this.mouseHook = new MouseHook(); this.mouseHook.isOverriding = true; Minecraft.getMinecraft().mouseHelper = this.mouseHook; setInputType(InputType.AI); }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ protected void actionPerformed(GuiButton button) throws IOException { if (button.enabled) { if (button.id < 100 && button instanceof GuiOptionButton) { this.game_settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1); button.displayString = this.game_settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); } if (button.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.parentScreen); } } }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ public void initGui() { int i = 0; this.title = I18n.format("options.skinCustomisation.title", new Object[0]); for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts.values()) { this.buttonList.add(new GuiCustomizeSkin.ButtonPart(enumplayermodelparts.getPartId(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20, enumplayermodelparts)); ++i; } this.buttonList.add(new GuiOptionButton(199, this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), GameSettings.Options.MAIN_HAND, this.mc.gameSettings.getKeyBinding(GameSettings.Options.MAIN_HAND))); ++i; if (i % 2 == 1) { ++i; } this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 24 * (i >> 1), I18n.format("gui.done", new Object[0]))); }
public SoundManager(SoundHandler p_i45119_1_, GameSettings p_i45119_2_) { this.invPlayingSounds = ((BiMap)this.playingSounds).inverse(); this.categorySounds = HashMultimap.<SoundCategory, String>create(); this.tickableSounds = Lists.<ITickableSound>newArrayList(); this.delayedSounds = Maps.<ISound, Integer>newHashMap(); this.playingSoundsStopTime = Maps.<String, Integer>newHashMap(); this.listeners = Lists.<ISoundEventListener>newArrayList(); this.pausedChannels = Lists.<String>newArrayList(); this.sndHandler = p_i45119_1_; this.options = p_i45119_2_; try { SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class); SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); } catch (SoundSystemException soundsystemexception) { LOGGER.error(LOG_MARKER, (String)"Error linking with the LibraryJavaSound plug-in", (Throwable)soundsystemexception); } }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ public void initGui() { int i = 0; this.field_146401_i = I18n.format("options.chat.title", new Object[0]); for (GameSettings.Options gamesettings$options : field_146399_a) { if (gamesettings$options.getEnumFloat()) { this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options)); } else { this.buttonList.add(new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options, this.game_settings.getKeyBinding(gamesettings$options))); } ++i; } this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 120, I18n.format("gui.done", new Object[0]))); }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ public void initGui() { this.title = I18n.format("options.sounds.title", new Object[0]); this.offDisplayString = I18n.format("options.off", new Object[0]); int i = 0; this.buttonList.add(new GuiScreenOptionsSounds.Button(SoundCategory.MASTER.ordinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), SoundCategory.MASTER, true)); i = i + 2; for (SoundCategory soundcategory : SoundCategory.values()) { if (soundcategory != SoundCategory.MASTER) { this.buttonList.add(new GuiScreenOptionsSounds.Button(soundcategory.ordinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), soundcategory, false)); ++i; } } int j = this.width / 2 - 75; int k = this.height / 6 - 12; ++i; this.buttonList.add(new GuiOptionButton(201, j, k + 24 * (i >> 1), GameSettings.Options.SHOW_SUBTITLES, this.game_settings_4.getKeyBinding(GameSettings.Options.SHOW_SUBTITLES))); this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done", new Object[0]))); }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ protected void actionPerformed(GuiButton button) throws IOException { if (button.id == 200) { this.mc.displayGuiScreen(this.parentScreen); } else if (button.id == 201) { for (KeyBinding keybinding : this.mc.gameSettings.keyBindings) { keybinding.setKeyCode(keybinding.getKeyCodeDefault()); } KeyBinding.resetKeyBindingArrayAndHash(); } else if (button.id < 100 && button instanceof GuiOptionButton) { this.options.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1); button.displayString = this.options.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); } }
/** * Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks */ public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); int i = (this.width - 248) / 2 + 10; int j = (this.height - 166) / 2 + 8; this.fontRendererObj.drawString(I18n.format("demo.help.title", new Object[0]), i, j, 2039583); j = j + 12; GameSettings gamesettings = this.mc.gameSettings; this.fontRendererObj.drawString(I18n.format("demo.help.movementShort", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())}), i, j, 5197647); this.fontRendererObj.drawString(I18n.format("demo.help.movementMouse", new Object[0]), i, j + 12, 5197647); this.fontRendererObj.drawString(I18n.format("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())}), i, j + 24, 5197647); this.fontRendererObj.drawString(I18n.format("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())}), i, j + 36, 5197647); this.fontRendererObj.drawSplitString(I18n.format("demo.help.fullWrapped", new Object[0]), i, j + 68, 218, 2039583); super.drawScreen(mouseX, mouseY, partialTicks); }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ protected void actionPerformed(GuiButton button) throws IOException { if (button.enabled) { if (button.id == 2) { this.game_settings_2.saveOptions(); this.game_settings_2.saveOptions(); this.mc.displayGuiScreen(this.lastScreen); } if (button.id == 1) { this.game_settings_2.setOptionValue(GameSettings.Options.SNOOPER_ENABLED, 1); this.toggleButton.displayString = this.game_settings_2.getKeyBinding(GameSettings.Options.SNOOPER_ENABLED); } } }
private void renderSlot(int p_175266_1_, int p_175266_2_, float p_175266_3_, float p_175266_4_, ISpectatorMenuObject p_175266_5_) { this.mc.getTextureManager().bindTexture(SPECTATOR_WIDGETS); if (p_175266_5_ != SpectatorMenu.EMPTY_SLOT) { int i = (int)(p_175266_4_ * 255.0F); GlStateManager.pushMatrix(); GlStateManager.translate((float)p_175266_2_, p_175266_3_, 0.0F); float f = p_175266_5_.isEnabled() ? 1.0F : 0.25F; GlStateManager.color(f, f, f, p_175266_4_); p_175266_5_.renderIcon(f, i); GlStateManager.popMatrix(); String s = String.valueOf((Object)GameSettings.getKeyDisplayString(this.mc.gameSettings.keyBindsHotbar[p_175266_1_].getKeyCode())); if (i > 3 && p_175266_5_.isEnabled()) { this.mc.fontRendererObj.drawStringWithShadow(s, (float)(p_175266_2_ + 19 - 2 - this.mc.fontRendererObj.getStringWidth(s)), p_175266_3_ + 6.0F + 3.0F, 16777215 + (i << 24)); } } }
/** * Draws the screen and all the components in it. */ public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); int i = (this.width - 248) / 2 + 10; int j = (this.height - 166) / 2 + 8; this.fontRendererObj.drawString(I18n.format("demo.help.title", new Object[0]), i, j, 2039583); j = j + 12; GameSettings gamesettings = this.mc.gameSettings; this.fontRendererObj.drawString(I18n.format("demo.help.movementShort", new Object[] {gamesettings.keyBindForward.getDisplayName(), gamesettings.keyBindLeft.getDisplayName(), gamesettings.keyBindBack.getDisplayName(), gamesettings.keyBindRight.getDisplayName()}), i, j, 5197647); this.fontRendererObj.drawString(I18n.format("demo.help.movementMouse", new Object[0]), i, j + 12, 5197647); this.fontRendererObj.drawString(I18n.format("demo.help.jump", new Object[] {gamesettings.keyBindJump.getDisplayName()}), i, j + 24, 5197647); this.fontRendererObj.drawString(I18n.format("demo.help.inventory", new Object[] {gamesettings.keyBindInventory.getDisplayName()}), i, j + 36, 5197647); this.fontRendererObj.drawSplitString(I18n.format("demo.help.fullWrapped", new Object[0]), i, j + 68, 218, 2039583); super.drawScreen(mouseX, mouseY, partialTicks); }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ protected void actionPerformed(GuiButton button) { if (button.enabled) { if (button.id < 200 && button instanceof GuiOptionButton) { this.settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1); button.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); } if (button.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.prevScreen); } if (button.id != GameSettings.Options.AA_LEVEL.ordinal()) { ScaledResolution scaledresolution = new ScaledResolution(this.mc); this.setWorldAndResolution(this.mc, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight()); } } }
/** * Draws the screen and all the components in it. */ public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); int i = (this.width - 248) / 2 + 10; int j = (this.height - 166) / 2 + 8; this.fontRendererObj.drawString(I18n.format("demo.help.title", new Object[0]), i, j, 2039583); j = j + 12; GameSettings gamesettings = this.mc.gameSettings; this.fontRendererObj.drawString(I18n.format("demo.help.movementShort", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())}), i, j, 5197647); this.fontRendererObj.drawString(I18n.format("demo.help.movementMouse", new Object[0]), i, j + 12, 5197647); this.fontRendererObj.drawString(I18n.format("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())}), i, j + 24, 5197647); this.fontRendererObj.drawString(I18n.format("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())}), i, j + 36, 5197647); this.fontRendererObj.drawSplitString(I18n.format("demo.help.fullWrapped", new Object[0]), i, j + 68, 218, 2039583); super.drawScreen(mouseX, mouseY, partialTicks); }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ public void initGui() { this.title = I18n.format("of.options.animationsTitle", new Object[0]); this.buttonList.clear(); for (int i = 0; i < enumOptions.length; ++i) { GameSettings.Options gamesettings$options = enumOptions[i]; int j = this.width / 2 - 155 + i % 2 * 160; int k = this.height / 6 + 21 * (i / 2) - 12; if (!gamesettings$options.getEnumFloat()) { this.buttonList.add(new GuiOptionButtonOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options))); } else { this.buttonList.add(new GuiOptionSliderOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options)); } } this.buttonList.add(new GuiButton(210, this.width / 2 - 155, this.height / 6 + 168 + 11, 70, 20, Lang.get("of.options.animation.allOn"))); this.buttonList.add(new GuiButton(211, this.width / 2 - 155 + 80, this.height / 6 + 168 + 11, 70, 20, Lang.get("of.options.animation.allOff"))); this.buttonList.add(new GuiOptionButton(200, this.width / 2 + 5, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ protected void actionPerformed(GuiButton button) throws IOException { if (button.enabled) { if (button.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.parent); } else if (button.id == 201) { this.mc.gameSettings.setOptionValue(GameSettings.Options.SHOW_SUBTITLES, 1); button.displayString = this.mc.gameSettings.getKeyBinding(GameSettings.Options.SHOW_SUBTITLES); this.mc.gameSettings.saveOptions(); } } }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ public void initGui() { int i = 0; for (GameSettings.Options gamesettings$options : enumOptions) { int j = this.width / 2 - 155 + i % 2 * 160; int k = this.height / 6 + 21 * (i / 2) - 10; if (!gamesettings$options.getEnumFloat()) { this.buttonList.add(new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options))); } else { this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options)); } ++i; } this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ public void initGui() { this.keyBindingList = new GuiKeyBindingList(this, this.mc); this.buttonList.add(new GuiButton(200, this.width / 2 - 155, this.height - 29, 150, 20, I18n.format("gui.done", new Object[0]))); this.buttonReset = this.addButton(new GuiButton(201, this.width / 2 - 155 + 160, this.height - 29, 150, 20, I18n.format("controls.resetAll", new Object[0]))); this.screenTitle = I18n.format("controls.title", new Object[0]); int i = 0; for (GameSettings.Options gamesettings$options : OPTIONS_ARR) { if (gamesettings$options.getEnumFloat()) { this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, 18 + 24 * (i >> 1), gamesettings$options)); } else { this.buttonList.add(new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, 18 + 24 * (i >> 1), gamesettings$options, this.options.getKeyBinding(gamesettings$options))); } ++i; } }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ protected void actionPerformed(GuiButton button) { if (button.enabled) { if (button.id < 200 && button instanceof GuiOptionButton) { this.settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1); button.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); } if (button.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.prevScreen); } if (button.id == 210) { this.mc.gameSettings.saveOptions(); GuiYesNo guiyesno = new GuiYesNo(this, I18n.format("of.message.other.reset", new Object[0]), "", 9999); this.mc.displayGuiScreen(guiyesno); } } }
/** * Called when the mouse is clicked within this entry. Returning true means that something within this entry * was clicked and the list should not be dragged. */ public boolean mousePressed(int slotIndex, int mouseX, int mouseY, int mouseEvent, int relativeX, int relativeY) { if(this.buttonA.mousePressed(this.client, mouseX, mouseY)) { if(this.buttonA instanceof GuiOptionButton) { this.client.gameSettings.setOptionValue(((GuiOptionButton) this.buttonA).returnEnumOptions(), 1); this.buttonA.displayString = this.client.gameSettings.getKeyBinding(GameSettings.Options.getEnumOptions(this.buttonA.id)); } return true; } else if(this.buttonB != null && this.buttonB.mousePressed(this.client, mouseX, mouseY)) { if(this.buttonB instanceof GuiOptionButton) { this.client.gameSettings.setOptionValue(((GuiOptionButton) this.buttonB).returnEnumOptions(), 1); this.buttonB.displayString = this.client.gameSettings.getKeyBinding(GameSettings.Options.getEnumOptions(this.buttonB.id)); } return true; } else { return false; } }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ protected void actionPerformed(GuiButton button) throws IOException { if (button.enabled) { if (button.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.parentScreen); } else if (button.id == 199) { this.mc.gameSettings.setOptionValue(GameSettings.Options.MAIN_HAND, 1); button.displayString = this.mc.gameSettings.getKeyBinding(GameSettings.Options.MAIN_HAND); this.mc.gameSettings.sendSettingsToServer(); } else if (button instanceof GuiCustomizeSkin.ButtonPart) { EnumPlayerModelParts enumplayermodelparts = ((GuiCustomizeSkin.ButtonPart)button).playerModelParts; this.mc.gameSettings.switchModelPartEnabled(enumplayermodelparts); button.displayString = this.getMessage(enumplayermodelparts); } } }
public SoundManager(SoundHandler p_i45119_1_, GameSettings p_i45119_2_) { this.invPlayingSounds = ((BiMap)this.playingSounds).inverse(); this.playingSoundPoolEntries = Maps.<ISound, SoundPoolEntry>newHashMap(); this.categorySounds = HashMultimap.<SoundCategory, String>create(); this.tickableSounds = Lists.<ITickableSound>newArrayList(); this.delayedSounds = Maps.<ISound, Integer>newHashMap(); this.playingSoundsStopTime = Maps.<String, Integer>newHashMap(); this.sndHandler = p_i45119_1_; this.options = p_i45119_2_; try { SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class); SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); } catch (SoundSystemException soundsystemexception) { logger.error(LOG_MARKER, (String)"Error linking with the LibraryJavaSound plug-in", (Throwable)soundsystemexception); } }
public GuiNewOptionsRowList(Minecraft mcIn, int p_i45015_2_, int p_i45015_3_, int p_i45015_4_, int p_i45015_5_, int p_i45015_6_, GameSettings.Options... p_i45015_7_) { super(mcIn, p_i45015_2_, p_i45015_3_, p_i45015_4_, p_i45015_5_, p_i45015_6_); this.centerListVertically = false; for(int i = 0; i < p_i45015_7_.length; i += 2) { GameSettings.Options gamesettings$options = p_i45015_7_[i]; GameSettings.Options gamesettings$options1 = i < p_i45015_7_.length - 1 ? p_i45015_7_[i + 1] : null; GuiButton guibutton = this.createButton(mcIn, p_i45015_2_ / 2 - 155, 0, gamesettings$options); GuiButton guibutton1 = this.createButton(mcIn, p_i45015_2_ / 2 - 155 + 160, 0, gamesettings$options1); this.options.add(new GuiNewOptionsRowList.Row(guibutton, guibutton1)); } }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ protected void actionPerformed(GuiButton button) { if (button.enabled) { if (button.id < 200 && button instanceof GuiOptionButton) { this.settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1); button.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); } if (button.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.prevScreen); } if (button.id == 210) { this.mc.gameSettings.setAllAnimations(true); } if (button.id == 211) { this.mc.gameSettings.setAllAnimations(false); } ScaledResolution scaledresolution = new ScaledResolution(this.mc); this.setWorldAndResolution(this.mc, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight()); } }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ public void initGui() { this.buttonList.add(this.forceUnicodeFontBtn = new GuiOptionButton(100, this.width / 2 - 155, this.height - 38, GameSettings.Options.FORCE_UNICODE_FONT, this.game_settings_3.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT))); this.buttonList.add(this.confirmSettingsBtn = new GuiOptionButton(6, this.width / 2 - 155 + 160, this.height - 38, I18n.format("gui.done", new Object[0]))); this.list = new GuiLanguage.List(this.mc); this.list.registerScrollButtons(7, 8); }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ public void initGui() { this.field_146610_i = I18n.format("options.snooper.title", new Object[0]); String s = I18n.format("options.snooper.desc", new Object[0]); java.util.List<String> list = Lists.<String>newArrayList(); for (String s1 : this.fontRendererObj.listFormattedStringToWidth(s, this.width - 30)) { list.add(s1); } this.field_146607_r = (String[])list.toArray(new String[list.size()]); this.field_146604_g.clear(); this.field_146609_h.clear(); this.buttonList.add(this.field_146605_t = new GuiButton(1, this.width / 2 - 152, this.height - 30, 150, 20, this.game_settings_2.getKeyBinding(GameSettings.Options.SNOOPER_ENABLED))); this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height - 30, 150, 20, I18n.format("gui.done", new Object[0]))); boolean flag = this.mc.getIntegratedServer() != null && this.mc.getIntegratedServer().getPlayerUsageSnooper() != null; for (Entry<String, String> entry : (new TreeMap<String, String>(this.mc.getPlayerUsageSnooper().getCurrentStats())).entrySet()) { this.field_146604_g.add((flag ? "C " : "") + (String)entry.getKey()); this.field_146609_h.add(this.fontRendererObj.trimStringToWidth((String)entry.getValue(), this.width - 220)); } if (flag) { for (Entry<String, String> entry1 : (new TreeMap<String, String>(this.mc.getIntegratedServer().getPlayerUsageSnooper().getCurrentStats())).entrySet()) { this.field_146604_g.add("S " + (String)entry1.getKey()); this.field_146609_h.add(this.fontRendererObj.trimStringToWidth((String)entry1.getValue(), this.width - 220)); } } this.field_146606_s = new GuiSnooper.List(); }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ public void initGui() { this.title = I18n.format("options.snooper.title", new Object[0]); String s = I18n.format("options.snooper.desc", new Object[0]); java.util.List<String> list = Lists.<String>newArrayList(); for (String s1 : this.fontRendererObj.listFormattedStringToWidth(s, this.width - 30)) { list.add(s1); } this.desc = (String[])list.toArray(new String[list.size()]); this.keys.clear(); this.values.clear(); this.toggleButton = this.addButton(new GuiButton(1, this.width / 2 - 152, this.height - 30, 150, 20, this.game_settings_2.getKeyBinding(GameSettings.Options.SNOOPER_ENABLED))); this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height - 30, 150, 20, I18n.format("gui.done", new Object[0]))); boolean flag = this.mc.getIntegratedServer() != null && this.mc.getIntegratedServer().getPlayerUsageSnooper() != null; for (Entry<String, String> entry : (new TreeMap<String, String>(this.mc.getPlayerUsageSnooper().getCurrentStats())).entrySet()) { this.keys.add((flag ? "C " : "") + (String)entry.getKey()); this.values.add(this.fontRendererObj.trimStringToWidth((String)entry.getValue(), this.width - 220)); } if (flag) { for (Entry<String, String> entry1 : (new TreeMap<String, String>(this.mc.getIntegratedServer().getPlayerUsageSnooper().getCurrentStats())).entrySet()) { this.keys.add("S " + (String)entry1.getKey()); this.values.add(this.fontRendererObj.trimStringToWidth((String)entry1.getValue(), this.width - 220)); } } this.list = new GuiSnooper.List(); }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ public void initGui() { this.screenTitle = I18n.format("options.videoTitle", new Object[0]); this.buttonList.clear(); this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height - 27, I18n.format("gui.done", new Object[0]))); if (!OpenGlHelper.vboSupported) { GameSettings.Options[] agamesettings$options = new GameSettings.Options[videoOptions.length - 1]; int i = 0; for (GameSettings.Options gamesettings$options : videoOptions) { if (gamesettings$options == GameSettings.Options.USE_VBO) { break; } agamesettings$options[i] = gamesettings$options; ++i; } this.optionsRowList = new GuiOptionsRowList(this.mc, this.width, this.height, 32, this.height - 32, 25, agamesettings$options); } else { this.optionsRowList = new GuiOptionsRowList(this.mc, this.width, this.height, 32, this.height - 32, 25, videoOptions); } }
protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) { Language language = (Language)this.languageMap.get(this.langCodeList.get(slotIndex)); GuiLanguage.this.languageManager.setCurrentLanguage(language); GuiLanguage.this.game_settings_3.language = language.getLanguageCode(); this.mc.refreshResources(); GuiLanguage.this.fontRendererObj.setUnicodeFlag(GuiLanguage.this.languageManager.isCurrentLocaleUnicode() || GuiLanguage.this.game_settings_3.forceUnicodeFont); GuiLanguage.this.fontRendererObj.setBidiFlag(GuiLanguage.this.languageManager.isCurrentLanguageBidirectional()); GuiLanguage.this.confirmSettingsBtn.displayString = I18n.format("gui.done", new Object[0]); GuiLanguage.this.forceUnicodeFontBtn.displayString = GuiLanguage.this.game_settings_3.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT); GuiLanguage.this.game_settings_3.saveOptions(); }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ protected void actionPerformed(GuiButton button) throws IOException { if (button.enabled) { switch (button.id) { case 5: break; case 6: this.mc.displayGuiScreen(this.parentScreen); break; case 100: if (button instanceof GuiOptionButton) { this.game_settings_3.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1); button.displayString = this.game_settings_3.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT); ScaledResolution scaledresolution = new ScaledResolution(this.mc); int i = scaledresolution.getScaledWidth(); int j = scaledresolution.getScaledHeight(); this.setWorldAndResolution(this.mc, i, j); } break; default: this.list.actionPerformed(button); } } }
/** Set up some handy extra keys: * @param settings Minecraft's original GameSettings object */ private void setUpExtraKeys(GameSettings settings) { // Create extra key bindings here and pass them to the KeyManager. ArrayList<InternalKey> extraKeys = new ArrayList<InternalKey>(); // Create a key binding to toggle between player and Malmo control: extraKeys.add(new InternalKey("key.toggleMalmo", 28, "key.categories.malmo") // 28 is the keycode for enter. { @Override public void onPressed() { InputType it = (inputType != InputType.AI) ? InputType.AI : InputType.HUMAN; System.out.println("Toggling control between human and AI - now " + it); setInputType(it); super.onPressed(); } }); extraKeys.add(new InternalKey("key.handyTestHook", 22, "key.categories.malmo") { @Override public void onPressed() { // Use this if you want to test some code with a handy key press try { CraftingHelper.dumpRecipes("recipe_dump.txt"); } catch (IOException e) { e.printStackTrace(); } } }); this.keyManager = new KeyManager(settings, extraKeys); }
@Override protected void execute() throws Exception { ClientStateMachine.this.initialiseComms(); // This is necessary in order to allow user to exit the Minecraft window without halting the experiment: GameSettings settings = Minecraft.getMinecraft().gameSettings; settings.pauseOnLostFocus = false; }
public void handleSetPassengers(SPacketSetPassengers packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId()); if (entity == null) { LOGGER.warn("Received passengers for unknown entity"); } else { boolean flag = entity.isRidingOrBeingRiddenBy(this.gameController.player); entity.removePassengers(); for (int i : packetIn.getPassengerIds()) { Entity entity1 = this.clientWorldController.getEntityByID(i); if (entity1 != null) { entity1.startRiding(entity, true); if (entity1 == this.gameController.player && !flag) { this.gameController.ingameGUI.setRecordPlaying(I18n.format("mount.onboard", new Object[] {GameSettings.getKeyDisplayString(this.gameController.gameSettings.keyBindSneak.getKeyCode())}), false); } } } } }
public GuiShaderOptions(GuiScreen guiscreen, GameSettings gamesettings) { this.lastMouseX = 0; this.lastMouseY = 0; this.mouseStillTime = 0L; this.screenName = null; this.screenText = null; this.changed = false; this.title = "Shader Options"; this.prevScreen = guiscreen; this.settings = gamesettings; }
public static void initGameSettings(GameSettings p_initGameSettings_0_) { if (gameSettings == null) { gameSettings = p_initGameSettings_0_; desktopDisplayMode = Display.getDesktopDisplayMode(); updateAvailableProcessors(); ReflectorForge.putLaunchBlackboard("optifine.ForgeSplashCompatible", Boolean.TRUE); } }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the * window resizes, the buttonList is cleared beforehand. */ public void initGui() { this.field_146610_i = I18n.format("options.snooper.title", new Object[0]); String s = I18n.format("options.snooper.desc", new Object[0]); java.util.List<String> list = Lists.<String>newArrayList(); for (Object s1 : this.fontRendererObj.listFormattedStringToWidth(s, this.width - 30)) { list.add((String) s1); } this.field_146607_r = (String[])list.toArray(new String[list.size()]); this.field_146604_g.clear(); this.field_146609_h.clear(); this.buttonList.add(this.field_146605_t = new GuiButton(1, this.width / 2 - 152, this.height - 30, 150, 20, this.game_settings_2.getKeyBinding(GameSettings.Options.SNOOPER_ENABLED))); this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height - 30, 150, 20, I18n.format("gui.done", new Object[0]))); boolean flag = this.mc.getIntegratedServer() != null && this.mc.getIntegratedServer().getPlayerUsageSnooper() != null; for (Entry<String, String> entry : (new TreeMap<String, String>(this.mc.getPlayerUsageSnooper().getCurrentStats())).entrySet()) { this.field_146604_g.add((flag ? "C " : "") + (String)entry.getKey()); this.field_146609_h.add(this.fontRendererObj.trimStringToWidth((String)entry.getValue(), this.width - 220)); } if (flag) { for (Entry<String, String> entry1 : (new TreeMap<String, String>(this.mc.getIntegratedServer().getPlayerUsageSnooper().getCurrentStats())).entrySet()) { this.field_146604_g.add("S " + (String)entry1.getKey()); this.field_146609_h.add(this.fontRendererObj.trimStringToWidth((String)entry1.getValue(), this.width - 220)); } } this.field_146606_s = new GuiSnooper.List(); }