Files
RobustToolbox/Robust.Client/Interfaces/GameObjects/Components/IClientClickableComponent.cs
T
AcruidandPieter-Jan Briers f2eb035ed8 Physics Shapes (#847)
* Adds a new IPhysicsShape object where you can define what collisions shape a PhysBody has.
AABB is now accessed through the PhysicsShape, so the BoundingBoxComponent is not required.

* Default PhysShape now copies the AABB of the BoundingBoxComponent.

* Fixed issue with serialization of PhysShapeAabbComp.

* Spatial queries now use ICollidableComponent instead of BoundingBoxComponent.
showbb now draws entities using the obsolete BoundingBoxComponent in Aqua.

* Renamed PhysShapeAabbComp to PhysShapeAabb.
Removed BoundingBoxComponent.

* Default CollidableComponent does not collide with anything now.

* Renamed ICollidable to IPhysBody.
Moved ICollidable to the Robust.Shared/Physics namespace.

* PhysShapes are now a collection of primitive shapes that contribute to the whole PhysBody.
ObjectSerializer.DataField can now deal with abstract types using YAML tags.

* Added LocalBounds property to ClickableComponent.
Added state to ClickableComponent.

* Added a Rectangle physics shape.

* ClickableComponent now actually checks that a click is inside its bounds.

* Reverted the addition of a try/catch around map loading. Any errors can propagate to the code trying to load the map again.
2019-09-03 22:06:50 +02:00

43 lines
1.6 KiB
C#

using Robust.Client.State.States;
using Robust.Shared.Enums;
using Robust.Shared.GameObjects;
using Robust.Shared.Input;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Map;
using Robust.Shared.Maths;
namespace Robust.Client.Interfaces.GameObjects.Components
{
public interface IClientClickableComponent : IClickableComponent
{
/// <summary>
/// Used to check whether a click worked.
/// </summary>
/// <param name="worldPos">The world position that was clicked.</param>
/// <param name="drawdepth">
/// The draw depth for the sprite that captured the click.
/// Used by <see cref="GameScreen" /> to sort and pick the highest successful one when multiple overlapping entities passed.
/// </param>
/// <returns>True if the click worked, false otherwise.</returns>
bool CheckClick(Vector2 worldPos, out int drawdepth);
/// <summary>
/// Sends the click to the sister component on the server and things subscribed to
/// </summary>
/// <param name="userUID">The entity owned by the player that clicked.</param>
/// <param name="clickType">See <see cref="MouseClickType" />.</param>
void DispatchClick(IEntity user, ClickType clickType);
/// <summary>
/// Invoked whenever the mouse hovers over this entity.
/// </summary>
void OnMouseEnter();
/// <summary>
/// Invoked whenever the mouse stops hovering over this entity.
/// </summary>
void OnMouseLeave();
}
}