예제 #1
0
  protected void actionPerformed(GuiButton p_146284_1_) {
    if (p_146284_1_.enabled) {
      if (p_146284_1_.id < 100 && p_146284_1_ instanceof GuiOptionButton) {
        GameSettings.Options options = ((GuiOptionButton) p_146284_1_).returnEnumOptions();
        this.field_152318_h.setOptionValue(options, 1);
        p_146284_1_.displayString =
            this.field_152318_h.getKeyBinding(GameSettings.Options.getEnumOptions(p_146284_1_.id));

        if (this.mc.func_152346_Z().func_152934_n()
            && options != GameSettings.Options.STREAM_CHAT_ENABLED
            && options != GameSettings.Options.STREAM_CHAT_USER_FILTER) {
          this.field_152315_t = true;
        }
      } else if (p_146284_1_ instanceof GuiOptionSlider) {
        if (p_146284_1_.id == GameSettings.Options.STREAM_VOLUME_MIC.returnEnumOrdinal()) {
          this.mc.func_152346_Z().func_152915_s();
        } else if (p_146284_1_.id
            == GameSettings.Options.STREAM_VOLUME_SYSTEM.returnEnumOrdinal()) {
          this.mc.func_152346_Z().func_152915_s();
        } else if (this.mc.func_152346_Z().func_152934_n()) {
          this.field_152315_t = true;
        }
      }

      if (p_146284_1_.id == 200) {
        this.mc.gameSettings.saveOptions();
        this.mc.displayGuiScreen(this.field_152317_g);
      } else if (p_146284_1_.id == 201) {
        this.mc.gameSettings.saveOptions();
        this.mc.displayGuiScreen(new GuiIngestServers(this));
      }
    }
  }
예제 #2
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 < 100 && button instanceof GuiOptionButton) {
        GameSettings.Options gamesettings$options = ((GuiOptionButton) button).returnEnumOptions();
        this.field_152318_h.setOptionValue(gamesettings$options, 1);
        button.displayString =
            this.field_152318_h.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));

        if (this.mc.getTwitchStream().isBroadcasting()
            && gamesettings$options != GameSettings.Options.STREAM_CHAT_ENABLED
            && gamesettings$options != GameSettings.Options.STREAM_CHAT_USER_FILTER) {
          this.field_152315_t = true;
        }
      } else if (button instanceof GuiOptionSlider) {
        if (button.id == GameSettings.Options.STREAM_VOLUME_MIC.returnEnumOrdinal()) {
          this.mc.getTwitchStream().updateStreamVolume();
        } else if (button.id == GameSettings.Options.STREAM_VOLUME_SYSTEM.returnEnumOrdinal()) {
          this.mc.getTwitchStream().updateStreamVolume();
        } else if (this.mc.getTwitchStream().isBroadcasting()) {
          this.field_152315_t = true;
        }
      }

      if (button.id == 200) {
        this.mc.gameSettings.saveOptions();
        this.mc.displayGuiScreen(this.parentScreen);
      } else if (button.id == 201) {
        this.mc.gameSettings.saveOptions();
        this.mc.displayGuiScreen(new GuiIngestServers(this));
      }
    }
  }