Skip to content

Commit c0d8552

Browse files
committed
Extra bindings that should probably be there
1 parent 806390f commit c0d8552

File tree

1 file changed

+42
-4
lines changed

1 file changed

+42
-4
lines changed

game/marble/client/scripts/default.bind.cs

+42-4
Original file line numberDiff line numberDiff line change
@@ -226,25 +226,37 @@ function movedown(%val)
226226
function turnLeft( %val )
227227
{
228228
setMvExtras();
229-
$mvYawRightSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
229+
$mvDeviceIsKeyboardMouse = false;
230+
$mvAutoCenterCamera = $pref::Input::AutoCenterCamera;
231+
%scale = (ServerConnection.gameState $= "wait") ? -0.1 : 3.14 * 100;
232+
$mvYawRightSpeed = %val ? $Pref::Input::KeyboardTurnSpeed * %scale : 0;
230233
}
231234

232235
function turnRight( %val )
233236
{
234237
setMvExtras();
235-
$mvYawLeftSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
238+
$mvDeviceIsKeyboardMouse = false;
239+
$mvAutoCenterCamera = $pref::Input::AutoCenterCamera;
240+
%scale = (ServerConnection.gameState $= "wait") ? -0.1 : 3.14 * 100;
241+
$mvYawLeftSpeed = %val ? $Pref::Input::KeyboardTurnSpeed * %scale : 0;
236242
}
237243

238244
function panUp( %val )
239245
{
240246
setMvExtras();
241-
$mvPitchDownSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
247+
$mvDeviceIsKeyboardMouse = false;
248+
$mvAutoCenterCamera = $pref::Input::AutoCenterCamera;
249+
%scale = (ServerConnection.gameState $= "wait") ? -0.1 : 3.14 * 100;
250+
$mvPitchDownSpeed = %val ? $Pref::Input::KeyboardTurnSpeed * %scale : 0;
242251
}
243252

244253
function panDown( %val )
245254
{
246255
setMvExtras();
247-
$mvPitchUpSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
256+
$mvDeviceIsKeyboardMouse = false;
257+
$mvAutoCenterCamera = $pref::Input::AutoCenterCamera;
258+
%scale = (ServerConnection.gameState $= "wait") ? -0.1 : 3.14 * 100;
259+
$mvPitchUpSpeed = %val ? $Pref::Input::KeyboardTurnSpeed * %scale : 0;
248260
}
249261

250262
function getMouseAdjustAmount(%val)
@@ -372,6 +384,19 @@ function centercam(%val)
372384
$mvTriggerCount3++;
373385
}
374386

387+
function restartLevelBind(%val)
388+
{
389+
if (%val)
390+
{
391+
if (!ServerConnection.isMultiplayer && ServerConnection.gameState !$= "wait")
392+
{
393+
if( $GameEndNoAllowPause )
394+
return;
395+
restartLevel();
396+
}
397+
}
398+
}
399+
375400
function cycleDebugPredTiles()
376401
{
377402
$curTile++;
@@ -645,6 +670,19 @@ function clearInputs()
645670
moveMap.bind(keyboard, "ENTER", GlobalChat);
646671
//moveMap.bind(keyboard, "y", TeamChat);
647672

673+
// Extra binds
674+
// ------------
675+
moveMap.bind( keyboard, q, mouseFire );
676+
moveMap.bind( keyboard, e, altTrigger );
677+
678+
moveMap.bind( keyboard, left, turnLeft );
679+
moveMap.bind( keyboard, right, turnRight );
680+
moveMap.bind( keyboard, up, panUp );
681+
moveMap.bind( keyboard, down, panDown );
682+
683+
moveMap.bind( keyboard, r, restartLevelBind );
684+
// ------------
685+
648686
// mouse
649687
moveMap.bind( mouse, button0, mouseFire );
650688
moveMap.bind( mouse, button1, altTrigger );

0 commit comments

Comments
 (0)