소스 검색

Merge pull request #688 from rextimmy/vehicle_gamepad_fix

Vehicle gamepad fix for full template.
Daniel Buckmaster 11 년 전
부모
커밋
aa6571330b
2개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      Templates/Full/game/scripts/client/client.cs
  2. 8 0
      Templates/Full/game/scripts/client/default.bind.cs

+ 3 - 0
Templates/Full/game/scripts/client/client.cs

@@ -145,6 +145,9 @@ function clientCmdtoggleVehicleMap(%toggle)
    if(%toggle)
    {
       moveMap.pop();
+	  // clear movement
+	  $mvForwardAction = 0;
+	  $mvBackwardAction = 0;
       vehicleMap.push();
    }
    else

+ 8 - 0
Templates/Full/game/scripts/client/default.bind.cs

@@ -734,3 +734,11 @@ vehicleMap.bindCmd(keyboard, "escape", "", "handleEscape();");
 vehicleMap.bind( keyboard, v, toggleFreeLook ); // v for vanity
 //vehicleMap.bind(keyboard, tab, toggleFirstPerson );
 vehicleMap.bind(keyboard, "alt c", toggleCamera);
+// bind the left thumbstick for steering
+vehicleMap.bind( gamepad, thumblx, "D", "-0.23 0.23", gamepadYaw );
+// bind the gas, break, and reverse buttons
+vehicleMap.bind( gamepad, btn_a, moveforward );
+vehicleMap.bind( gamepad, btn_b, brake );
+vehicleMap.bind( gamepad, btn_x, movebackward );
+// bind exiting the vehicle to a button
+vehicleMap.bindCmd(gamepad, btn_y,"getout();","");