示例#1
0
 public String func_74297_c(EnumOptions p_74297_1_) {
   StringTranslate var2 = StringTranslate.func_74808_a();
   String var3 = var2.func_74805_b(p_74297_1_.func_74378_d()) + ": ";
   if (p_74297_1_.func_74380_a()) {
     float var5 = this.func_74296_a(p_74297_1_);
     return p_74297_1_ == EnumOptions.SENSITIVITY
         ? (var5 == 0.0F
             ? var3 + var2.func_74805_b("options.sensitivity.min")
             : (var5 == 1.0F
                 ? var3 + var2.func_74805_b("options.sensitivity.max")
                 : var3 + (int) (var5 * 200.0F) + "%"))
         : (p_74297_1_ == EnumOptions.FOV
             ? (var5 == 0.0F
                 ? var3 + var2.func_74805_b("options.fov.min")
                 : (var5 == 1.0F
                     ? var3 + var2.func_74805_b("options.fov.max")
                     : var3 + (int) (70.0F + var5 * 40.0F)))
             : (p_74297_1_ == EnumOptions.GAMMA
                 ? (var5 == 0.0F
                     ? var3 + var2.func_74805_b("options.gamma.min")
                     : (var5 == 1.0F
                         ? var3 + var2.func_74805_b("options.gamma.max")
                         : var3 + "+" + (int) (var5 * 100.0F) + "%"))
                 : (p_74297_1_ == EnumOptions.CHAT_OPACITY
                     ? var3 + (int) (var5 * 90.0F + 10.0F) + "%"
                     : (var5 == 0.0F
                         ? var3 + var2.func_74805_b("options.off")
                         : var3 + (int) (var5 * 100.0F) + "%"))));
   } else if (p_74297_1_.func_74382_b()) {
     boolean var4 = this.func_74308_b(p_74297_1_);
     return var4
         ? var3 + var2.func_74805_b("options.on")
         : var3 + var2.func_74805_b("options.off");
   } else {
     return p_74297_1_ == EnumOptions.RENDER_DISTANCE
         ? var3 + func_74299_a(field_74360_ac, this.field_74339_e)
         : (p_74297_1_ == EnumOptions.DIFFICULTY
             ? var3 + func_74299_a(field_74361_ad, this.field_74318_M)
             : (p_74297_1_ == EnumOptions.GUI_SCALE
                 ? var3 + func_74299_a(field_74367_ae, this.field_74335_Z)
                 : (p_74297_1_ == EnumOptions.CHAT_VISIBILITY
                     ? var3 + func_74299_a(field_74369_af, this.field_74343_n)
                     : (p_74297_1_ == EnumOptions.PARTICLES
                         ? var3 + func_74299_a(field_74364_ag, this.field_74362_aa)
                         : (p_74297_1_ == EnumOptions.FRAMERATE_LIMIT
                             ? var3 + func_74299_a(field_74365_ah, this.field_74350_i)
                             : (p_74297_1_ == EnumOptions.GRAPHICS
                                 ? (this.field_74347_j
                                     ? var3 + var2.func_74805_b("options.graphics.fancy")
                                     : var3 + var2.func_74805_b("options.graphics.fast"))
                                 : var3))))));
   }
 }
示例#2
0
 public boolean func_74308_b(EnumOptions p_74308_1_) {
   switch (EnumOptionsHelper.field_74414_a[p_74308_1_.ordinal()]) {
     case 1:
       return this.field_74338_d;
     case 2:
       return this.field_74336_f;
     case 3:
       return this.field_74337_g;
     case 4:
       return this.field_74349_h;
     case 5:
       return this.field_74348_k;
     case 6:
       return this.field_74345_l;
     case 7:
       return this.field_74344_o;
     case 8:
       return this.field_74359_p;
     case 9:
       return this.field_74358_q;
     case 10:
       return this.field_74356_s;
     case 11:
       return this.field_74355_t;
     case 12:
       return this.field_74353_u;
     case 13:
       return this.field_74352_v;
     default:
       return false;
   }
 }
 @Override
 protected String[] getTooltipLines(String displayString, int buttonId) {
   EnumOptions e = EnumOptions.getEnumOptions(buttonId);
   if (e != null)
     switch (e) {
       case CALIBRATION_STRATEGY:
         return new String[] {
           "Sets whether device calibration is performed when",
           "Minecraft is started.",
           "  At Startup: Calibration routines for all",
           "     utilised devices are run at startup.",
           "  Skip: No calibration will be performed. The user",
           "     will have to manually trigger calibration",
           "     at some point for correct device operation."
         };
       default:
         return null;
     }
   else
     switch (buttonId) {
         //                case 201:
         //                    return new String[] {
         //                            "Open this configuration screen to adjust the Head",
         //                            "  Tracker orientation (direction) settings. ",
         //                            "  Ex: Head Tracking Selection (Hydra/Oculus), Prediction"
         //                    };
       default:
         return null;
     }
 }
  private boolean getEnabledState(EnumOptions var8) {
    String s = var8.getEnumString();

    if (var8 == EnumOptions.HEAD_TRACK_SENSITIVITY) {
      if (this.mc.vrSettings.useQuaternions) return false;
      else return true;
    }

    return true;
  }
 /**
  * Fired when a control is clicked. This is the equivalent of
  * ActionListener.actionPerformed(ActionEvent e).
  */
 protected void actionPerformed(GuiButton par1GuiButton) {
   if (par1GuiButton.enabled) {
     if (par1GuiButton.id < 200 && par1GuiButton instanceof GuiSmallButtonEx) {
       EnumOptions num = EnumOptions.getEnumOptions(par1GuiButton.id);
       this.guivrSettings.setOptionValue(
           ((GuiSmallButtonEx) par1GuiButton).returnEnumOptions(), 1);
       par1GuiButton.displayString =
           this.guivrSettings.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id));
     } else if (par1GuiButton.id == 200) {
       this.mc.vrSettings.saveOptions();
       this.mc.displayGuiScreen(this.parentGuiScreen);
     } else if (par1GuiButton.id == 201) {
       this.guivrSettings.calibrationStrategy = VRSettings.CALIBRATION_STRATEGY_AT_STARTUP;
       this.mc.vrSettings.saveOptions();
       this.reinit = true;
     } else if (par1GuiButton.id == 202) {
       if (vrRenderer != null) vrRenderer.startCalibration();
     }
   }
 }
  /**
   * Fired when a control is clicked. This is the equivalent of
   * ActionListener.actionPerformed(ActionEvent e).
   */
  protected void actionPerformed(GuiButton par1GuiButton) {
    EnumOptions num = EnumOptions.getEnumOptions(par1GuiButton.id);

    if (par1GuiButton.enabled) {
      if (par1GuiButton.id < 200 && par1GuiButton instanceof GuiSmallButtonEx) {
        this.guivrSettings.setOptionValue(
            ((GuiSmallButtonEx) par1GuiButton).returnEnumOptions(), 1);
        par1GuiButton.displayString =
            this.guivrSettings.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id));

        if (num == EnumOptions.HEAD_TRACK_PREDICTION) {
          mc.headTracker.setPrediction(
              this.mc.vrSettings.headTrackPredictionTimeSecs,
              this.mc.vrSettings.useHeadTrackPrediction);
        }
      } else if (par1GuiButton.id == 200) {
        this.mc.vrSettings.saveOptions();
        this.mc.displayGuiScreen(this.parentGuiScreen);
      } else if (par1GuiButton.id == 201) {
        this.mc.vrSettings.useHeadTracking = true;
        if (this.mc.headTracker instanceof MCOculus) {
          this.mc.vrSettings.useHeadTrackPrediction = true;
          this.mc.vrSettings.headTrackPredictionTimeSecs = 0f;
          mc.headTracker.setPrediction(
              this.mc.vrSettings.headTrackPredictionTimeSecs,
              this.mc.vrSettings.useHeadTrackPrediction);
        }
        this.mc.vrSettings.setHeadTrackSensitivity(1.0f);
        this.reinit = true;
      } else if (par1GuiButton.id == 202) {
        if (vrRenderer != null) vrRenderer.startCalibration();
      } else if (par1GuiButton.id == 203) // Mode Change
      {
        this.mc.vrSettings.headTrackerPluginID = pluginModeChangeutton.getSelectedID();
        this.mc.vrSettings.saveOptions();
        this.mc.headTracker =
            PluginManager.configureOrientation(this.mc.vrSettings.headTrackerPluginID);
        this.reinit = true;
      }
    }
  }
 @Override
 protected String[] getTooltipLines(String displayString, int buttonId) {
   EnumOptions e = EnumOptions.getEnumOptions(buttonId);
   if (e != null)
     switch (e) {
       case HEAD_TRACKING:
         return new String[] {
           "If head tracking should be enabled or not",
           "  OFF: No head tracking",
           "  ON: Head tracking enabled",
           "  Recommended: ON"
         };
       case HEAD_TRACK_PREDICTION:
         return new String[] {
           "For the Oculus Rift, enable Prediction?",
           " OFF: Prediction disabled",
           " ON:  Prediction enabled",
           " Recommended value: ON to reduce latency"
         };
       case HEAD_TRACK_SENSITIVITY:
         return new String[] {
           "In-game camera orientation multiplied by this value.",
           "  Recommended value: 1.0",
           "NOTE: Will be locked at 1.0 if the Orientation render",
           "mode is set to 'Quaternion'."
         };
       case HEAD_TRACK_PREDICTION_TIME:
         return new String[] {
           "Number of seconds to predict motion. Higher values will",
           "enhance the perceived precision of slow movements, but ",
           "cause issues with sudden movements. Auto attempts to",
           "dynamically set the value based on previous frame time.",
           "  Recommended value: AUTO (set to 0)"
         };
       default:
         return null;
     }
   else
     switch (buttonId) {
       case 201:
         return new String[] {"Resets all values on this screen to their defaults"};
       case 202:
         return new String[] {
           "Starts calibration of the Oculus Rift headset",
           "  Press this button while facing forward.",
           "  Then, look to the left.",
           "  Then, look to the right.",
           "  Then, look up."
         };
       default:
         return null;
     }
 }
  /** Adds the buttons (and other controls) to the screen in question. */
  public void initGui() {
    StringTranslate stringTranslate = StringTranslate.getInstance();
    this.buttonList.clear();
    //        this.buttonList.add(new GuiSmallButtonEx(EnumOptions.USE_VR.returnEnumOrdinal(),
    // this.width / 2 - 78, this.height / 6 - 14, EnumOptions.USE_VR,
    // this.guivrSettings.getKeyBinding(EnumOptions.USE_VR)));
    this.buttonList.add(
        new GuiButtonEx(202, this.width / 2 - 100, this.height / 6 + 128, "Recalibrate..."));
    this.buttonList.add(
        new GuiButtonEx(201, this.width / 2 - 100, this.height / 6 + 148, "Reset To Defaults"));
    this.buttonList.add(
        new GuiButtonEx(
            200,
            this.width / 2 - 100,
            this.height / 6 + 168,
            stringTranslate.translateKey("gui.done")));
    EnumOptions[] buttons = calibrationOptions;

    for (int var12 = 2; var12 < buttons.length + 2; ++var12) {
      EnumOptions var8 = buttons[var12 - 2];
      int width = this.width / 2 - 155 + var12 % 2 * 160;
      int height = this.height / 6 + 21 * (var12 / 2) - 10;

      if (var8.getEnumFloat()) {
        float minValue = 0.0f;
        float maxValue = 1.0f;
        float increment = 0.01f;

        if (var8 == EnumOptions.HUD_SCALE) {
          minValue = 0.5f;
          maxValue = 1.5f;
          increment = 0.01f;
        }
        if (var8 == EnumOptions.HUD_DISTANCE) {
          minValue = 0.5f;
          maxValue = 3.0f;
          increment = 0.02f;
        }

        this.buttonList.add(
            new GuiSliderEx(
                var8.returnEnumOrdinal(),
                width,
                height,
                var8,
                this.guivrSettings.getKeyBinding(var8),
                minValue,
                maxValue,
                increment,
                this.guivrSettings.getOptionFloatValue(var8)));
      } else {
        this.buttonList.add(
            new GuiSmallButtonEx(
                var8.returnEnumOrdinal(),
                width,
                height,
                var8,
                this.guivrSettings.getKeyBinding(var8)));
      }
    }
  }
  /** Adds the buttons (and other controls) to the screen in question. */
  public void initGui() {
    StringTranslate stringTranslate = StringTranslate.getInstance();
    this.buttonList.clear();
    this.buttonList.add(
        new GuiButtonEx(
            200,
            this.width / 2 - 100,
            this.height / 6 + 168,
            stringTranslate.translateKey("gui.done")));
    this.buttonList.add(
        new GuiButtonEx(201, this.width / 2 - 100, this.height / 6 + 148, "Reset To Defaults"));
    this.buttonList.add(
        new GuiButtonEx(202, this.width / 2 - 100, this.height / 6 + 128, "Recalibrate..."));
    pluginModeChangeutton =
        new PluginModeChangeButton(
            203,
            this.width / 2 - 78,
            this.height / 6 - 14,
            (List<IBasePlugin>) (List<?>) PluginManager.thePluginManager.orientPlugins,
            this.guivrSettings.headTrackerPluginID);
    this.buttonList.add(pluginModeChangeutton);
    EnumOptions[] var10 = null;
    if (this.mc.headTracker instanceof MCHydra) var10 = hydraHeadOrientationOptions;
    else var10 = oculusHeadOrientationOptions;

    int var11 = var10.length;

    for (int var12 = 2; var12 < var11 + 2; ++var12) {
      EnumOptions var8 = var10[var12 - 2];
      int width = this.width / 2 - 155 + var12 % 2 * 160;
      int height = this.height / 6 + 21 * (var12 / 2) - 10;

      if (var8.getEnumFloat()) {
        float minValue = 0.0f;
        float maxValue = 1.0f;
        float increment = 0.001f;

        if (var8 == EnumOptions.HEAD_TRACK_SENSITIVITY) {
          minValue = 0.5f;
          maxValue = 3.0f;
          increment = 0.01f;
        } else if (var8 == EnumOptions.HEAD_TRACK_PREDICTION_TIME) {
          minValue = 0.000f;
          maxValue = 0.100f;
          increment = 0.001f;
        }

        GuiSliderEx slider =
            new GuiSliderEx(
                var8.returnEnumOrdinal(),
                width,
                height,
                var8,
                this.guivrSettings.getKeyBinding(var8),
                minValue,
                maxValue,
                increment,
                this.guivrSettings.getOptionFloatValue(var8));
        slider.setEventHandler(this);
        slider.enabled = getEnabledState(var8);
        this.buttonList.add(slider);
      } else {
        this.buttonList.add(
            new GuiSmallButtonEx(
                var8.returnEnumOrdinal(),
                width,
                height,
                var8,
                this.guivrSettings.getKeyBinding(var8)));
      }
    }
  }