@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;
     }
 }
 /**
  * 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;
     }
 }
Esempio n. 5
0
  /**
   * 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 < 100 && par1GuiButton instanceof GuiSmallButton) {
        this.field_73890_c.setOptionValue(((GuiSmallButton) par1GuiButton).returnEnumOptions(), 1);
        par1GuiButton.displayString =
            this.field_73890_c.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id));
      }

      if (par1GuiButton.id == 200) {
        this.mc.gameSettings.saveOptions();
        this.mc.displayGuiScreen(this.field_73889_b);
      }
    }
  }
 protected void actionPerformed(GuiButton guibutton) {
   if (!guibutton.enabled) {
     return;
   }
   if (guibutton.id < 100 && (guibutton instanceof GuiSmallButton)) {
     guiGameSettings.setOptionValue(((GuiSmallButton) guibutton).returnEnumOptions(), 1);
     guibutton.displayString =
         guiGameSettings.getKeyBinding(EnumOptions.getEnumOptions(guibutton.id));
   }
   if (guibutton.id == 200) {
     mc.gameSettings.saveOptions();
     mc.displayGuiScreen(field_22110_h);
   }
   ScaledResolution scaledresolution =
       new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
   int i = scaledresolution.getScaledWidth();
   int j = scaledresolution.getScaledHeight();
   setWorldAndResolution(mc, i, j);
 }
  /**
   * Fired when a control is clicked. This is the equivalent of
   * ActionListener.actionPerformed(ActionEvent e).
   */
  protected void actionPerformed(GuiButton var1) {
    if (var1.enabled) {
      if (var1.id < 100 && var1 instanceof GuiSmallButton) {
        this.settings.setOptionValue(((GuiSmallButton) var1).returnEnumOptions(), 1);
        var1.displayString = this.settings.getKeyBinding(EnumOptions.getEnumOptions(var1.id));
      }

      if (var1.id == 200) {
        this.mc.gameSettings.saveOptions();
        this.mc.displayGuiScreen(this.prevScreen);
      }

      if (var1.id != EnumOptions.CLOUD_HEIGHT.ordinal()) {
        ScaledResolution var2 =
            new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight);
        int var3 = var2.getScaledWidth();
        int var4 = var2.getScaledHeight();
        this.setWorldAndResolution(this.mc, var3, var4);
      }
    }
  }