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