Temp fix table clickable bounds (#6206)
* Temp fix table clickable bounds * Fix single instance clickable data * Consolidate table clickable bounds
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Content.Client.Clickable
|
||||
|
||||
[Dependency] private readonly IClickMapManager _clickMapManager = default!;
|
||||
|
||||
[ViewVariables] [DataField("bounds")] private DirBoundData _data = DirBoundData.Default;
|
||||
[ViewVariables] [DataField("bounds")] private DirBoundData? _data;
|
||||
|
||||
/// <summary>
|
||||
/// Used to check whether a click worked.
|
||||
@@ -47,6 +47,8 @@ namespace Content.Client.Clickable
|
||||
var found = false;
|
||||
var worldRotation = transform.WorldRotation;
|
||||
|
||||
if (_data != null)
|
||||
{
|
||||
if (_data.All.Contains(localPos))
|
||||
{
|
||||
found = true;
|
||||
@@ -55,8 +57,12 @@ namespace Content.Client.Clickable
|
||||
{
|
||||
// TODO: diagonal support?
|
||||
|
||||
var modAngle = sprite.NoRotation ? SpriteComponent.CalcRectWorldAngle(worldRotation, 4) : Angle.Zero;
|
||||
var dir = sprite.EnableDirectionOverride ? sprite.DirectionOverride : worldRotation.GetCardinalDir();
|
||||
var modAngle = sprite.NoRotation
|
||||
? SpriteComponent.CalcRectWorldAngle(worldRotation, 4)
|
||||
: Angle.Zero;
|
||||
var dir = sprite.EnableDirectionOverride
|
||||
? sprite.DirectionOverride
|
||||
: worldRotation.GetCardinalDir();
|
||||
|
||||
modAngle += dir.ToAngle();
|
||||
|
||||
@@ -76,6 +82,7 @@ namespace Content.Client.Clickable
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
|
||||
@@ -17,3 +17,6 @@
|
||||
key: state
|
||||
base: state_
|
||||
- type: Climbable
|
||||
- type: Clickable
|
||||
bounds:
|
||||
all: "-0.5,-0.5,0.5,0.5"
|
||||
|
||||
Reference in New Issue
Block a user