(bbd192053) Rebind Select and Use keys. Refactor GameSettings to support legacy bindings, when they are set. That is, if the new "deselect" and "shoot" keys are not defined, but the player config file is found, use the "select" and the "use" keys instead of the defaults.

This commit is contained in:
Joonas Rikkonen
2019-04-04 11:08:02 +03:00
parent 79ea41e6c9
commit 7491b06a5d
55 changed files with 594 additions and 584 deletions
@@ -1,5 +1,4 @@
using Barotrauma.Networking;
using FarseerPhysics;
using FarseerPhysics;
using FarseerPhysics.Collision;
using FarseerPhysics.Dynamics;
using Microsoft.Xna.Framework;
@@ -167,12 +166,11 @@ namespace Barotrauma.Items.Components
//set the rotation of the projectile again because dropping the projectile resets the rotation
projectile.Item.SetTransform(projectilePos,
rotation + (projectile.Item.body.Dir * projectile.LaunchRotationRadians));
rotation + ((item.body.Dir == 1.0f) ? projectile.LaunchRotationRadians : projectile.LaunchRotationRadians - MathHelper.Pi));
//recoil
item.body.ApplyLinearImpulse(
new Vector2((float)Math.Cos(projectile.Item.body.Rotation), (float)Math.Sin(projectile.Item.body.Rotation)) * item.body.Mass * -50.0f,
maxVelocity: NetConfig.MaxPhysicsBodyVelocity);
new Vector2((float)Math.Cos(projectile.Item.body.Rotation), (float)Math.Sin(projectile.Item.body.Rotation)) * item.body.Mass * -50.0f);
item.RemoveContained(projectile.Item);