Control settings, more server settings, selecting character face
This commit is contained in:
@@ -193,7 +193,7 @@ namespace Barotrauma.Items.Components
|
||||
public override bool Use(float deltaTime, Character character = null)
|
||||
{
|
||||
if (!attachable || item.body==null) return true;
|
||||
if (character != null && !character.GetInputState(InputType.SecondaryHeld)) return false;
|
||||
if (character != null && !character.IsKeyDown(InputType.Aim)) return false;
|
||||
|
||||
item.Drop();
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
//item.sprite.Depth = picker.AnimController.GetLimb(LimbType.RightHand).sprite.Depth + 0.01f;
|
||||
|
||||
ac.HoldItem(deltaTime, item, handlePos, holdPos, aimPos, picker.GetInputState(InputType.SecondaryHeld), holdAngle);
|
||||
ac.HoldItem(deltaTime, item, handlePos, holdPos, aimPos, picker.IsKeyDown(InputType.Aim), holdAngle);
|
||||
}
|
||||
|
||||
protected void Flip(Item item)
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Barotrauma.Items.Components
|
||||
public override bool Use(float deltaTime, Character character = null)
|
||||
{
|
||||
if (character == null || reloadTimer>0.0f) return false;
|
||||
if (!character.GetInputState(InputType.SecondaryHeld) || hitting) return false;
|
||||
if (!character.IsKeyDown(InputType.Aim) || hitting) return false;
|
||||
|
||||
user = character;
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
foreach (Limb l in character.AnimController.Limbs)
|
||||
{
|
||||
item.body.FarseerBody.IgnoreCollisionWith(l.body.FarseerBody);
|
||||
//item.body.FarseerBody.IgnoreCollisionWith(l.body.FarseerBody);
|
||||
|
||||
if (character.AnimController.InWater) continue;
|
||||
if (l.type == LimbType.LeftFoot || l.type == LimbType.LeftThigh || l.type == LimbType.LeftLeg) continue;
|
||||
@@ -107,7 +107,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
reloadTimer -= deltaTime;
|
||||
|
||||
if (!picker.GetInputState(InputType.SecondaryHeld) && !hitting) hitPos = 0.0f;
|
||||
if (!picker.IsKeyDown(InputType.Aim) && !hitting) hitPos = 0.0f;
|
||||
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, picker);
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (!hitting)
|
||||
{
|
||||
if (picker.GetInputState(InputType.SecondaryHeld))
|
||||
if (picker.IsKeyDown(InputType.Aim))
|
||||
{
|
||||
hitPos = (float)System.Math.Min(hitPos+deltaTime*5.0f, MathHelper.Pi*0.7f);
|
||||
|
||||
@@ -167,10 +167,10 @@ namespace Barotrauma.Items.Components
|
||||
item.body.CollisionCategories = Physics.CollisionMisc;
|
||||
item.body.CollidesWith = Physics.CollisionWall;
|
||||
|
||||
foreach (Limb l in picker.AnimController.Limbs)
|
||||
{
|
||||
item.body.FarseerBody.RestoreCollisionWith(l.body.FarseerBody);
|
||||
}
|
||||
//foreach (Limb l in picker.AnimController.Limbs)
|
||||
//{
|
||||
// item.body.FarseerBody.RestoreCollisionWith(l.body.FarseerBody);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Barotrauma.Items.Components
|
||||
public override bool Use(float deltaTime, Character character = null)
|
||||
{
|
||||
if (character == null) return false;
|
||||
if (!character.GetInputState(InputType.SecondaryHeld) || reload > 0.0f) return false;
|
||||
if (!character.IsKeyDown(InputType.Aim) || reload > 0.0f) return false;
|
||||
IsActive = true;
|
||||
reload = 1.0f;
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace Barotrauma.Items.Components
|
||||
public override bool Use(float deltaTime, Character character = null)
|
||||
{
|
||||
if (character == null) return false;
|
||||
if (!character.GetInputState(InputType.SecondaryHeld)) return false;
|
||||
if (!character.IsKeyDown(InputType.Aim)) return false;
|
||||
|
||||
//if (DoesUseFail(character)) return false;
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
else if ((targetLimb = (targetBody.UserData as Limb)) != null)
|
||||
{
|
||||
if (character.GetInputState(InputType.SecondaryHeld))
|
||||
if (character.IsKeyDown(InputType.Aim))
|
||||
{
|
||||
targetLimb.character.Health += limbFixAmount * degreeOfSuccess;
|
||||
//isActive = true;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Barotrauma.Items.Components
|
||||
public override bool Use(float deltaTime, Character character = null)
|
||||
{
|
||||
if (character == null) return false;
|
||||
if (!character.GetInputState(InputType.SecondaryHeld) || throwing) return false;
|
||||
if (!character.IsKeyDown(InputType.Aim) || throwing) return false;
|
||||
|
||||
//Vector2 diff = Vector2.Normalize(character.CursorPosition - character.AnimController.RefLimb.Position);
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Barotrauma.Items.Components
|
||||
if (!item.body.Enabled) return;
|
||||
if (!picker.HasSelectedItem(item)) IsActive = false;
|
||||
|
||||
if (!picker.GetInputState(InputType.SecondaryHeld) && !throwing) throwPos = 0.0f;
|
||||
if (!picker.IsKeyDown(InputType.Aim) && !throwing) throwPos = 0.0f;
|
||||
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, picker);
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (!throwing)
|
||||
{
|
||||
if (picker.GetInputState(InputType.SecondaryHeld))
|
||||
if (picker.IsKeyDown(InputType.Aim))
|
||||
{
|
||||
throwPos = (float)System.Math.Min(throwPos+deltaTime*5.0f, MathHelper.Pi*0.7f);
|
||||
|
||||
|
||||
@@ -63,6 +63,8 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
currPowerConsumption = Math.Abs(targetForce)/100.0f * powerConsumption;
|
||||
|
||||
if (powerConsumption == 0.0f) voltage = 1.0f;
|
||||
|
||||
Force = MathHelper.Lerp(force, (voltage < minVoltage) ? 0.0f : targetForce, 0.1f);
|
||||
if (Force != 0.0f)
|
||||
{
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
item.body.FarseerBody.RestoreCollisionWith(stickTarget);
|
||||
}
|
||||
catch
|
||||
catch (Exception e)
|
||||
{
|
||||
#if DEBUG
|
||||
DebugConsole.ThrowError("Failed to restore collision with stickTarget", e);
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Barotrauma.Items.Components
|
||||
if (character != Character.Controlled || character != user) return;
|
||||
|
||||
if (Screen.Selected != GameMain.EditMapScreen &&
|
||||
character.GetInputState(InputType.Select) &&
|
||||
character.IsKeyHit(InputType.Select) &&
|
||||
character.SelectedConstruction==this.item) character.SelectedConstruction = null;
|
||||
|
||||
Connection.DrawConnections(spriteBatch, this, character);
|
||||
|
||||
Reference in New Issue
Block a user