(4f4395b00) Reduced the size of the disallowed item interface area around the chatbox

This commit is contained in:
Joonas Rikkonen
2019-04-04 11:07:45 +03:00
parent 860e5204ab
commit 79ea41e6c9
54 changed files with 571 additions and 540 deletions
@@ -235,30 +235,6 @@ namespace Barotrauma
set { /*do nothing*/ }
}
/// <summary>
/// Should the item's Use method be called with the "Use" or with the "Shoot" key?
/// </summary>
[Serialize(false, false)]
public bool IsShootable { get; set; }
/// <summary>
/// If true, the user has to hold the "aim" key before use is registered. False by default.
/// </summary>
[Serialize(false, false)]
public bool RequireAimToUse
{
get; set;
}
/// <summary>
/// If true, the user has to hold the "aim" key before secondary use is registered. True by default.
/// </summary>
[Serialize(true, false)]
public bool RequireAimToSecondaryUse
{
get; set;
}
public Color Color
{
get { return spriteColor; }
@@ -1145,6 +1121,12 @@ namespace Barotrauma
return;
}
float forceFactor = 1.0f;
if (CurrentHull != null)
{
return;
}
float forceFactor = 1.0f;
if (CurrentHull != null)
{
@@ -1389,27 +1371,20 @@ namespace Barotrauma
}
else
{
if (picker.IsKeyDown(InputType.Aim))
if (forceSelectKey)
{
pickHit = false;
selectHit = false;
if (ic.PickKey == InputType.Select) pickHit = true;
if (ic.SelectKey == InputType.Select) selectHit = true;
}
else if (forceActionKey)
{
if (ic.PickKey == InputType.Use) pickHit = true;
if (ic.SelectKey == InputType.Use) selectHit = true;
}
else
{
if (forceSelectKey)
{
if (ic.PickKey == InputType.Select) pickHit = true;
if (ic.SelectKey == InputType.Select) selectHit = true;
}
else if (forceActionKey)
{
if (ic.PickKey == InputType.Use) pickHit = true;
if (ic.SelectKey == InputType.Use) selectHit = true;
}
else
{
pickHit = picker.IsKeyHit(ic.PickKey);
selectHit = picker.IsKeyHit(ic.SelectKey);
pickHit = picker.IsKeyHit(ic.PickKey);
selectHit = picker.IsKeyHit(ic.SelectKey);
#if CLIENT
//if the cursor is on a UI component, disable interaction with the left mouse button
@@ -1420,10 +1395,10 @@ namespace Barotrauma
if (GameMain.Config.KeyBind(ic.SelectKey).MouseButton == 0) selectHit = false;
}
#endif
}
}
}
if (!pickHit && !selectHit) continue;
if (!ic.HasRequiredSkills(picker, out Skill tempRequiredSkill)) hasRequiredSkills = false;
@@ -1475,6 +1450,7 @@ namespace Barotrauma
return true;
}
public void Use(float deltaTime, Character character = null, Limb targetLimb = null)
{
if (RequireAimToUse && !character.IsKeyDown(InputType.Aim))
@@ -1625,6 +1601,8 @@ namespace Barotrauma
GameMain.NetworkMember != null && (GameMain.NetworkMember.IsServer || Character.Controlled == dropper))
{
parentInventory.CreateNetworkEvent();
//send frequent updates after the item has been dropped
PositionUpdateInterval = 0.0f;
}
}