Merge pull request #81 from Crystalwarrior/ragdollbutton

Adds ragdoll button. Because why not.
This commit is contained in:
Juan Pablo Arce
2017-12-06 13:02:35 -03:00
committed by GitHub
10 changed files with 129 additions and 55 deletions
@@ -13,7 +13,7 @@ namespace Barotrauma
{
float volume = Math.Min(impact - 3.0f, 1.0f);
if (body.UserData is Limb)
if (body.UserData is Limb && character.Stun <= 0f)
{
Limb limb = (Limb)body.UserData;
@@ -23,7 +23,7 @@ namespace Barotrauma
limb.HitSound.Play(volume, impact * 100.0f, limb.WorldPosition);
}
}
else if (body == Collider.FarseerBody)
else if (body.UserData is Limb || body == Collider.FarseerBody)
{
if (!character.IsRemotePlayer || GameMain.Server != null)
{
@@ -109,6 +109,10 @@ namespace Barotrauma
TransformCursorPos();
}
bool ragdollInput = msg.ReadBoolean();
keys[(int)InputType.Ragdoll].Held = ragdollInput;
keys[(int)InputType.Ragdoll].SetState(false, ragdollInput);
facingRight = msg.ReadBoolean();
}
@@ -123,7 +127,7 @@ namespace Barotrauma
if (selectedEntity is Character)
{
bool doingCpr = msg.ReadBoolean();
if (doingCpr && selectedCharacter != null)
if (doingCpr && SelectedCharacter != null)
{
animation = AnimController.Animation.CPR;
}
@@ -259,14 +259,14 @@ namespace Barotrauma
{
if (character == null) return false;
GUIComponent existingFrame = crewList.Parent.FindChild("selectedcharacter");
GUIComponent existingFrame = crewList.Parent.FindChild("SelectedCharacter");
if (existingFrame != null) crewList.Parent.RemoveChild(existingFrame);
var previewPlayer = new GUIFrame(
new Rectangle(0, 0, 230, 300),
new Color(0.0f, 0.0f, 0.0f, 0.8f), Alignment.TopRight, "", crewList.Parent);
previewPlayer.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
previewPlayer.UserData = "selectedcharacter";
previewPlayer.UserData = "SelectedCharacter";
character.Info.CreateInfoFrame(previewPlayer);