Faction Test v1.0.1.0
This commit is contained in:
@@ -11,15 +11,13 @@ namespace Barotrauma
|
||||
public enum MouseButton
|
||||
{
|
||||
None = -1,
|
||||
LeftMouse = 0,
|
||||
RightMouse = 1,
|
||||
PrimaryMouse = 0,
|
||||
SecondaryMouse = 1,
|
||||
MiddleMouse = 2,
|
||||
MouseButton4 = 3,
|
||||
MouseButton5 = 4,
|
||||
MouseWheelUp = 5,
|
||||
MouseWheelDown = 6,
|
||||
PrimaryMouse,
|
||||
SecondaryMouse
|
||||
MouseWheelDown = 6
|
||||
}
|
||||
|
||||
public class KeyOrMouse
|
||||
@@ -65,10 +63,6 @@ namespace Barotrauma
|
||||
return PlayerInput.PrimaryMouseButtonHeld();
|
||||
case MouseButton.SecondaryMouse:
|
||||
return PlayerInput.SecondaryMouseButtonHeld();
|
||||
case MouseButton.LeftMouse:
|
||||
return PlayerInput.LeftButtonHeld();
|
||||
case MouseButton.RightMouse:
|
||||
return PlayerInput.RightButtonHeld();
|
||||
case MouseButton.MiddleMouse:
|
||||
return PlayerInput.MidButtonHeld();
|
||||
case MouseButton.MouseButton4:
|
||||
@@ -95,10 +89,6 @@ namespace Barotrauma
|
||||
return PlayerInput.PrimaryMouseButtonClicked();
|
||||
case MouseButton.SecondaryMouse:
|
||||
return PlayerInput.SecondaryMouseButtonClicked();
|
||||
case MouseButton.LeftMouse:
|
||||
return PlayerInput.LeftButtonClicked();
|
||||
case MouseButton.RightMouse:
|
||||
return PlayerInput.RightButtonClicked();
|
||||
case MouseButton.MiddleMouse:
|
||||
return PlayerInput.MidButtonClicked();
|
||||
case MouseButton.MouseButton4:
|
||||
@@ -218,11 +208,11 @@ namespace Barotrauma
|
||||
switch (MouseButton)
|
||||
{
|
||||
case MouseButton.PrimaryMouse:
|
||||
return PlayerInput.MouseButtonsSwapped() ? TextManager.Get("input.rightmouse") : TextManager.Get("input.leftmouse");
|
||||
return PlayerInput.PrimaryMouseLabel;
|
||||
case MouseButton.SecondaryMouse:
|
||||
return PlayerInput.MouseButtonsSwapped() ? TextManager.Get("input.leftmouse") : TextManager.Get("input.rightmouse");
|
||||
return PlayerInput.SecondaryMouseLabel;
|
||||
default:
|
||||
return TextManager.Get("input." + MouseButton.ToString().ToLowerInvariant());
|
||||
return TextManager.Get($"Input.{MouseButton}");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -270,6 +260,9 @@ namespace Barotrauma
|
||||
}
|
||||
#endif
|
||||
|
||||
public static readonly LocalizedString PrimaryMouseLabel = TextManager.Get($"Input.{(!MouseButtonsSwapped() ? "Left" : "Right")}Mouse");
|
||||
public static readonly LocalizedString SecondaryMouseLabel = TextManager.Get($"Input.{(!MouseButtonsSwapped() ? "Right" : "Left")}Mouse");
|
||||
|
||||
public static Vector2 MousePosition
|
||||
{
|
||||
get { return new Vector2(mouseState.Position.X, mouseState.Position.Y); }
|
||||
@@ -317,120 +310,48 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
public static bool PrimaryMouseButtonHeld()
|
||||
{
|
||||
if (MouseButtonsSwapped())
|
||||
{
|
||||
return RightButtonHeld();
|
||||
}
|
||||
return LeftButtonHeld();
|
||||
}
|
||||
|
||||
public static bool PrimaryMouseButtonDown()
|
||||
{
|
||||
if (MouseButtonsSwapped())
|
||||
{
|
||||
return RightButtonDown();
|
||||
}
|
||||
return LeftButtonDown();
|
||||
}
|
||||
|
||||
public static bool PrimaryMouseButtonReleased()
|
||||
{
|
||||
if (MouseButtonsSwapped())
|
||||
{
|
||||
return RightButtonReleased();
|
||||
}
|
||||
return LeftButtonReleased();
|
||||
}
|
||||
|
||||
public static bool PrimaryMouseButtonClicked()
|
||||
{
|
||||
if (MouseButtonsSwapped())
|
||||
{
|
||||
return RightButtonClicked();
|
||||
}
|
||||
return LeftButtonClicked();
|
||||
}
|
||||
|
||||
public static bool SecondaryMouseButtonHeld()
|
||||
{
|
||||
if (!MouseButtonsSwapped())
|
||||
{
|
||||
return RightButtonHeld();
|
||||
}
|
||||
return LeftButtonHeld();
|
||||
}
|
||||
|
||||
public static bool SecondaryMouseButtonDown()
|
||||
{
|
||||
if (!MouseButtonsSwapped())
|
||||
{
|
||||
return RightButtonDown();
|
||||
}
|
||||
return LeftButtonDown();
|
||||
}
|
||||
|
||||
public static bool SecondaryMouseButtonReleased()
|
||||
{
|
||||
if (!MouseButtonsSwapped())
|
||||
{
|
||||
return RightButtonReleased();
|
||||
}
|
||||
return LeftButtonReleased();
|
||||
}
|
||||
|
||||
public static bool SecondaryMouseButtonClicked()
|
||||
{
|
||||
if (!MouseButtonsSwapped())
|
||||
{
|
||||
return RightButtonClicked();
|
||||
}
|
||||
return LeftButtonClicked();
|
||||
}
|
||||
|
||||
public static bool LeftButtonHeld()
|
||||
{
|
||||
return AllowInput && mouseState.LeftButton == ButtonState.Pressed;
|
||||
}
|
||||
|
||||
public static bool LeftButtonDown()
|
||||
public static bool PrimaryMouseButtonDown()
|
||||
{
|
||||
return AllowInput &&
|
||||
oldMouseState.LeftButton == ButtonState.Released &&
|
||||
mouseState.LeftButton == ButtonState.Pressed;
|
||||
}
|
||||
|
||||
public static bool LeftButtonReleased()
|
||||
public static bool PrimaryMouseButtonReleased()
|
||||
{
|
||||
return AllowInput && mouseState.LeftButton == ButtonState.Released;
|
||||
}
|
||||
|
||||
|
||||
public static bool LeftButtonClicked()
|
||||
public static bool PrimaryMouseButtonClicked()
|
||||
{
|
||||
return (AllowInput &&
|
||||
oldMouseState.LeftButton == ButtonState.Pressed
|
||||
&& mouseState.LeftButton == ButtonState.Released);
|
||||
}
|
||||
|
||||
public static bool RightButtonHeld()
|
||||
public static bool SecondaryMouseButtonHeld()
|
||||
{
|
||||
return AllowInput && mouseState.RightButton == ButtonState.Pressed;
|
||||
}
|
||||
|
||||
public static bool RightButtonDown()
|
||||
public static bool SecondaryMouseButtonDown()
|
||||
{
|
||||
return AllowInput &&
|
||||
oldMouseState.RightButton == ButtonState.Released &&
|
||||
mouseState.RightButton == ButtonState.Pressed;
|
||||
}
|
||||
|
||||
public static bool RightButtonReleased()
|
||||
public static bool SecondaryMouseButtonReleased()
|
||||
{
|
||||
return AllowInput && mouseState.RightButton == ButtonState.Released;
|
||||
}
|
||||
|
||||
public static bool RightButtonClicked()
|
||||
public static bool SecondaryMouseButtonClicked()
|
||||
{
|
||||
return (AllowInput &&
|
||||
oldMouseState.RightButton == ButtonState.Pressed
|
||||
|
||||
Reference in New Issue
Block a user