Package com.mtbs3d.minecrift.control

Examples of com.mtbs3d.minecrift.control.ControlBinding


    void activate() {
      Controller cont = Controllers.getEventSource();
      int index = Controllers.getEventControlIndex();
      if( Controllers.isEventAxis() ) {
        float joyVal = cont.getAxisValue(index);
        ControlBinding bindPos = axisBinds.get( Pair.of(index,true ) );
        ControlBinding bindNeg = axisBinds.get( Pair.of(index,false) );
        if( bindPos == bindNeg ) {
          if( bindPos != null)
            bindPos.setValue( joyVal );
        } else {
          if( joyVal > 0 ) {
            if( bindNeg != null )
              bindNeg.setValue( 0 );
            if( bindPos != null )
              bindPos.setValue( joyVal );
          } else {
            if( bindPos != null )
              bindPos.setValue( 0 );
            if( bindNeg != null )
              bindNeg.setValue( -joyVal );
          }
        }
      } else if( Controllers.isEventButton() ) {
        ControlBinding bind = buttonBinds.get(index);
        if( bind != null ) {
          bind.setState( cont.isButtonPressed(index));
        }
      } else if( Controllers.isEventPovX()) {
        if( cont.getPovX() > 0) {
          if( povXBindPos != null)
            povXBindPos.setState(true);
View Full Code Here


    protected void drawSlot(int index, int xPos, int yPos, int height, Tessellator var5) {
      String display = "";
      if( index == currentlyBinding ) {
        display = "" + EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + "??? " + EnumChatFormatting.WHITE + "<";
      } else {
        ControlBinding binding = ControlBinding.bindings.get(index);
        display = (binding.isValid() ? "" : (""+ EnumChatFormatting.RED )) +StringTranslate.getInstance().translateKey(binding.getDescription())+": "+binding.boundTo();
      }
      drawString(fontRenderer,display, xPos, yPos, 8421504);
    }
View Full Code Here

TOP

Related Classes of com.mtbs3d.minecrift.control.ControlBinding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.