Merge remote-tracking branch 'origin/master' into moStuff

# Conflicts:
#	Barotrauma/BarotraumaShared/BarotraumaShared.projitems
#	Barotrauma/BarotraumaShared/Data/clientpermissions.xml
This commit is contained in:
Alex Noir
2017-12-23 17:33:24 +03:00
5 changed files with 35 additions and 26 deletions
@@ -436,7 +436,7 @@ namespace Barotrauma
InfoFrame.FindChild("showlog").Visible = GameMain.Server != null; InfoFrame.FindChild("showlog").Visible = GameMain.Server != null;
campaignViewButton = new GUIButton(new Rectangle(0, 0, 130, 30), "Campaign view", Alignment.BottomRight, "", defaultModeContainer); campaignViewButton = new GUIButton(new Rectangle(-80, 0, 120, 30), "Campaign view", Alignment.BottomRight, "", defaultModeContainer);
campaignViewButton.OnClicked = (btn, obj) => { ToggleCampaignView(true); return true; }; campaignViewButton.OnClicked = (btn, obj) => { ToggleCampaignView(true); return true; };
campaignViewButton.Visible = false; campaignViewButton.Visible = false;
@@ -743,7 +743,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="$(MSBuildThisFileDirectory)Data\clientpermissions.xml"> <Content Include="$(MSBuildThisFileDirectory)Data\clientpermissions.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="$(MSBuildThisFileDirectory)Data\ContentPackages\Vanilla 0.7.xml"> <Content Include="$(MSBuildThisFileDirectory)Data\ContentPackages\Vanilla 0.7.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<Permissions> <ClientPermissions>
</ClientPermissions>
</Permissions>
@@ -466,6 +466,12 @@ namespace Barotrauma
get { return focusedItem; } get { return focusedItem; }
} }
public Item PickingItem
{
get;
set;
}
public virtual AIController AIController public virtual AIController AIController
{ {
get { return null; } get { return null; }
@@ -13,7 +13,6 @@ namespace Barotrauma.Items.Components
private float pickTimer; private float pickTimer;
public List<InvSlotType> AllowedSlots public List<InvSlotType> AllowedSlots
{ {
get { return allowedSlots; } get { return allowedSlots; }
@@ -59,9 +58,11 @@ namespace Barotrauma.Items.Components
if (picker == null || picker.Inventory == null) return false; if (picker == null || picker.Inventory == null) return false;
if (PickingTime > 0.0f) if (PickingTime > 0.0f)
{
if (picker.PickingItem == null)
{ {
CoroutineManager.StartCoroutine(WaitForPick(picker, PickingTime)); CoroutineManager.StartCoroutine(WaitForPick(picker, PickingTime));
}
return false; return false;
} }
else else
@@ -104,6 +105,8 @@ namespace Barotrauma.Items.Components
private IEnumerable<object> WaitForPick(Character picker, float requiredTime) private IEnumerable<object> WaitForPick(Character picker, float requiredTime)
{ {
picker.PickingItem = item;
var leftHand = picker.AnimController.GetLimb(LimbType.LeftHand); var leftHand = picker.AnimController.GetLimb(LimbType.LeftHand);
var rightHand = picker.AnimController.GetLimb(LimbType.RightHand); var rightHand = picker.AnimController.GetLimb(LimbType.RightHand);
@@ -151,6 +154,7 @@ namespace Barotrauma.Items.Components
private void StopPicking(Character picker) private void StopPicking(Character picker)
{ {
picker.AnimController.Anim = AnimController.Animation.None; picker.AnimController.Anim = AnimController.Animation.None;
picker.PickingItem = null;
pickTimer = 0.0f; pickTimer = 0.0f;
} }