2f107db...5202af9

This commit is contained in:
Joonas Rikkonen
2019-03-18 21:42:26 +02:00
parent 58c92888b7
commit 044fd3344b
395 changed files with 27417 additions and 19754 deletions
@@ -3,18 +3,19 @@ using Microsoft.Xna.Framework.Input;
namespace Barotrauma
{
public enum InputType
{
Select,
public enum InputType
{
Select,
Use,
Aim,
Up, Down, Left, Right,
Attack,
Run, Crouch,
Chat, RadioChat, CrewOrders,
InfoTab, Chat, RadioChat, CrewOrders,
Ragdoll, Health, Grab,
SelectNextCharacter,
SelectPreviousCharacter
SelectPreviousCharacter,
Voice
}
public class KeyOrMouse
@@ -44,6 +45,14 @@ namespace Barotrauma
return PlayerInput.RightButtonHeld();
case 2:
return PlayerInput.MidButtonHeld();
case 3:
return PlayerInput.Mouse4ButtonHeld();
case 4:
return PlayerInput.Mouse5ButtonHeld();
case 5: // No real way of "holding" a mouse wheel key, but then again it makes no sense to bind the key to this kind of task.
return PlayerInput.MouseWheelUpClicked();
case 6:
return PlayerInput.MouseWheelDownClicked();
}
return false;
@@ -61,6 +70,14 @@ namespace Barotrauma
return PlayerInput.RightButtonClicked();
case 2:
return PlayerInput.MidButtonClicked();
case 3:
return PlayerInput.Mouse4ButtonClicked();
case 4:
return PlayerInput.Mouse5ButtonClicked();
case 5:
return PlayerInput.MouseWheelUpClicked();
case 6:
return PlayerInput.MouseWheelDownClicked();
}
return false;
@@ -78,6 +95,14 @@ namespace Barotrauma
return "Mouse2";
case 2:
return "Mouse3";
case 3:
return "Mouse4";
case 4:
return "Mouse5";
case 5:
return "MouseWheelUp";
case 6:
return "MouseWheelDown";
}
return "None";
@@ -97,16 +122,21 @@ namespace Barotrauma
this.inputType = inputType;
}
private InputType inputType;
public Key(InputType inputType)
{
this.inputType = inputType;
}
#if CLIENT
private KeyOrMouse binding
{
get { return GameMain.Config.KeyBind(inputType); }
}
#else
private KeyOrMouse binding;
}
public Key(KeyOrMouse binding)
public KeyOrMouse State
{
this.binding = binding;
get { return binding; }
}
#endif
@@ -115,11 +145,21 @@ namespace Barotrauma
get { return binding; }
}
public void SetState()
{
hit = binding.IsHit();
if (hit) hitQueue = true;
held = binding.IsDown();
if (held) heldQueue = true;
}
#endif
public bool Hit
{
get
get
{
return hit;
return hit;
}
set
{
@@ -138,15 +178,7 @@ namespace Barotrauma
held = value;
}
}
public void SetState()
{
hit = binding.IsHit();
if (hit) hitQueue = true;
held = binding.IsDown();
if (held) heldQueue = true;
}
public void SetState(bool hit, bool held)
{
@@ -158,14 +190,14 @@ namespace Barotrauma
{
bool value = hitQueue;
hitQueue = false;
return value;
return value;
}
public bool DequeueHeld()
{
bool value = heldQueue;
heldQueue = false;
return value;
return value;
}
public bool GetHeldQueue