Skip to content

Commit

Permalink
Extra bindings that should probably be there
Browse files Browse the repository at this point in the history
  • Loading branch information
HumanGamer committed Apr 9, 2024
1 parent 806390f commit c0d8552
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions game/marble/client/scripts/default.bind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,25 +226,37 @@ function movedown(%val)
function turnLeft( %val )
{
setMvExtras();
$mvYawRightSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
$mvDeviceIsKeyboardMouse = false;
$mvAutoCenterCamera = $pref::Input::AutoCenterCamera;
%scale = (ServerConnection.gameState $= "wait") ? -0.1 : 3.14 * 100;
$mvYawRightSpeed = %val ? $Pref::Input::KeyboardTurnSpeed * %scale : 0;
}

function turnRight( %val )
{
setMvExtras();
$mvYawLeftSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
$mvDeviceIsKeyboardMouse = false;
$mvAutoCenterCamera = $pref::Input::AutoCenterCamera;
%scale = (ServerConnection.gameState $= "wait") ? -0.1 : 3.14 * 100;
$mvYawLeftSpeed = %val ? $Pref::Input::KeyboardTurnSpeed * %scale : 0;
}

function panUp( %val )
{
setMvExtras();
$mvPitchDownSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
$mvDeviceIsKeyboardMouse = false;
$mvAutoCenterCamera = $pref::Input::AutoCenterCamera;
%scale = (ServerConnection.gameState $= "wait") ? -0.1 : 3.14 * 100;
$mvPitchDownSpeed = %val ? $Pref::Input::KeyboardTurnSpeed * %scale : 0;
}

function panDown( %val )
{
setMvExtras();
$mvPitchUpSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
$mvDeviceIsKeyboardMouse = false;
$mvAutoCenterCamera = $pref::Input::AutoCenterCamera;
%scale = (ServerConnection.gameState $= "wait") ? -0.1 : 3.14 * 100;
$mvPitchUpSpeed = %val ? $Pref::Input::KeyboardTurnSpeed * %scale : 0;
}

function getMouseAdjustAmount(%val)
Expand Down Expand Up @@ -372,6 +384,19 @@ function centercam(%val)
$mvTriggerCount3++;
}

function restartLevelBind(%val)
{
if (%val)
{
if (!ServerConnection.isMultiplayer && ServerConnection.gameState !$= "wait")
{
if( $GameEndNoAllowPause )
return;
restartLevel();
}
}
}

function cycleDebugPredTiles()
{
$curTile++;
Expand Down Expand Up @@ -645,6 +670,19 @@ function clearInputs()
moveMap.bind(keyboard, "ENTER", GlobalChat);
//moveMap.bind(keyboard, "y", TeamChat);

// Extra binds
// ------------
moveMap.bind( keyboard, q, mouseFire );
moveMap.bind( keyboard, e, altTrigger );

moveMap.bind( keyboard, left, turnLeft );
moveMap.bind( keyboard, right, turnRight );
moveMap.bind( keyboard, up, panUp );
moveMap.bind( keyboard, down, panDown );

moveMap.bind( keyboard, r, restartLevelBind );
// ------------

// mouse
moveMap.bind( mouse, button0, mouseFire );
moveMap.bind( mouse, button1, altTrigger );
Expand Down

0 comments on commit c0d8552

Please sign in to comment.