|
|
@ -4,33 +4,36 @@ using gaemstone.ECS; |
|
|
|
|
|
|
|
|
|
|
|
namespace gaemstone.Client.Components; |
|
|
|
namespace gaemstone.Client.Components; |
|
|
|
|
|
|
|
|
|
|
|
[Public, Module] |
|
|
|
[Module] |
|
|
|
public partial class InputComponents |
|
|
|
public partial class InputComponents |
|
|
|
{ |
|
|
|
{ |
|
|
|
[Entity, Path("/Input")] |
|
|
|
[Entity, Path("/Input"), Symbol] |
|
|
|
[Add<Input>] |
|
|
|
[Add<Input>] |
|
|
|
public struct Input { } |
|
|
|
public struct Input { } |
|
|
|
|
|
|
|
|
|
|
|
[Entity, Path("/Input/Mouse")] |
|
|
|
[Entity, Path("/Input/Mouse"), Symbol] |
|
|
|
[Add<Mouse>] |
|
|
|
[Add<Mouse>] |
|
|
|
public struct Mouse { } |
|
|
|
public struct Mouse { } |
|
|
|
|
|
|
|
|
|
|
|
[Entity, Path("/Input/Keyboard")] |
|
|
|
[Entity, Path("/Input/Keyboard"), Symbol] |
|
|
|
[Add<Keyboard>] |
|
|
|
[Add<Keyboard>] |
|
|
|
public struct Keyboard { } |
|
|
|
public struct Keyboard { } |
|
|
|
|
|
|
|
|
|
|
|
[Tag] |
|
|
|
[Tag, Symbol] |
|
|
|
public struct Gamepad { } |
|
|
|
public struct Gamepad { } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> Present on inputs / actions that are currently active. </summary> |
|
|
|
/// <summary> Present on inputs / actions that are currently active. </summary> |
|
|
|
[Component] public struct Active { public TimeSpan Duration; } |
|
|
|
[Component, Symbol] |
|
|
|
|
|
|
|
public struct Active { public TimeSpan Duration; } |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> Present on inputs / actions were activated this frame. </summary> |
|
|
|
/// <summary> Present on inputs / actions were activated this frame. </summary> |
|
|
|
[Tag] public struct Activated { } |
|
|
|
[Tag, Symbol] |
|
|
|
|
|
|
|
public struct Activated { } |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> Present on inputs / actions were deactivated this frame. </summary> |
|
|
|
/// <summary> Present on inputs / actions were deactivated this frame. </summary> |
|
|
|
[Tag] public struct Deactivated { } |
|
|
|
[Tag, Symbol] |
|
|
|
|
|
|
|
public struct Deactivated { } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
@ -41,7 +44,7 @@ public partial class InputComponents |
|
|
|
/// This is set if a UI element is focused that captures |
|
|
|
/// This is set if a UI element is focused that captures |
|
|
|
/// navigational or text input. |
|
|
|
/// navigational or text input. |
|
|
|
/// </remarks> |
|
|
|
/// </remarks> |
|
|
|
[Relation, Tag, Exclusive] |
|
|
|
[Relation, Tag, Symbol, Exclusive] |
|
|
|
public struct InputCapturedBy { } |
|
|
|
public struct InputCapturedBy { } |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
@ -52,7 +55,7 @@ public partial class InputComponents |
|
|
|
/// This could for example include the mouse currently being over |
|
|
|
/// This could for example include the mouse currently being over |
|
|
|
/// a UI element, preventing the game from handling mouse input. |
|
|
|
/// a UI element, preventing the game from handling mouse input. |
|
|
|
/// </remarks> |
|
|
|
/// </remarks> |
|
|
|
[Relation, Tag, Exclusive] |
|
|
|
[Relation, Tag, Symbol, Exclusive] |
|
|
|
public struct MouseInputCapturedBy { } |
|
|
|
public struct MouseInputCapturedBy { } |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
@ -62,13 +65,13 @@ public partial class InputComponents |
|
|
|
/// <remarks> |
|
|
|
/// <remarks> |
|
|
|
/// This is set when a camera controller assumes control of the mouse. |
|
|
|
/// This is set when a camera controller assumes control of the mouse. |
|
|
|
/// </remarks> |
|
|
|
/// </remarks> |
|
|
|
[Relation, Tag, Exclusive] |
|
|
|
[Relation, Tag, Symbol, Exclusive] |
|
|
|
[With<InputCapturedBy>] |
|
|
|
[With<InputCapturedBy>] |
|
|
|
[With<MouseInputCapturedBy>] |
|
|
|
[With<MouseInputCapturedBy>] |
|
|
|
public struct CursorCapturedBy { } |
|
|
|
public struct CursorCapturedBy { } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Private, Component] |
|
|
|
[Component] |
|
|
|
internal readonly struct RawValue1D |
|
|
|
internal readonly struct RawValue1D |
|
|
|
{ |
|
|
|
{ |
|
|
|
private readonly float _value; |
|
|
|
private readonly float _value; |
|
|
@ -78,7 +81,7 @@ public partial class InputComponents |
|
|
|
public static implicit operator RawValue1D(float value) => new(value); |
|
|
|
public static implicit operator RawValue1D(float value) => new(value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Private, Component] |
|
|
|
[Component] |
|
|
|
internal readonly struct RawValue2D |
|
|
|
internal readonly struct RawValue2D |
|
|
|
{ |
|
|
|
{ |
|
|
|
private readonly Vector2 _value; |
|
|
|
private readonly Vector2 _value; |
|
|
|