Polish HUD radar lock visibility, pointer hit-testing, blip clamping, and README dims
This commit is contained in:
parent
edcc143f74
commit
23eaf05e0c
2 changed files with 26 additions and 11 deletions
|
|
@ -19,8 +19,8 @@ royale, aliens, language design). This repo holds no lore.
|
|||
- Shrinking `SpectatorRing` perimeter (`Tourist`, `Patron`, and `Exemplar`
|
||||
tiers with `Neutral` / `Cleared` / `Provoked` stances and Weksa-voiced
|
||||
`BroadcastFeed` commentary).
|
||||
- `TerrainField`: deterministic `384m x 384m` desert terrain divided into a
|
||||
`4x4` (`96m x 96m`) tile grid with procedural dunes, mesas, salvage pads,
|
||||
- `TerrainField`: deterministic `1536m x 1536m` desert terrain divided into an
|
||||
`8x8` (`192m x 192m`) tile grid with procedural dunes, mesas, salvage pads,
|
||||
dirt roads, and runtime crater / tire-track / thermal-scorch stamping.
|
||||
- **`RustToDust.Ymir`**:
|
||||
- `ArenaSession` bridging `MatchState` onto Ymir's `Box3DSoaWorld` with
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ public partial class Hud : CanvasLayer
|
|||
private PanelContainer _topLeftPanel = null!;
|
||||
private PanelContainer _topRightPanel = null!;
|
||||
private PanelContainer _bottomLeftPanel = null!;
|
||||
private PanelContainer _chyronPanel = null!;
|
||||
|
||||
private VBoxContainer _chyronBox = null!;
|
||||
private readonly Label[] _chyronLabels = new Label[3];
|
||||
|
|
@ -93,7 +94,10 @@ public partial class Hud : CanvasLayer
|
|||
{
|
||||
return (_topLeftPanel.Visible && _topLeftPanel.GetGlobalRect().HasPoint(screenPos))
|
||||
|| (_topRightPanel.Visible && _topRightPanel.GetGlobalRect().HasPoint(screenPos))
|
||||
|| (_bottomLeftPanel.Visible && _bottomLeftPanel.GetGlobalRect().HasPoint(screenPos));
|
||||
|| (_bottomLeftPanel.Visible && _bottomLeftPanel.GetGlobalRect().HasPoint(screenPos))
|
||||
|| (_chyronPanel.Visible && _chyronPanel.GetGlobalRect().HasPoint(screenPos))
|
||||
|| (_chyronBox.Visible && _chyronBox.GetGlobalRect().HasPoint(screenPos))
|
||||
|| (_outcomeBanner.Visible && _outcomeBanner.GetGlobalRect().HasPoint(screenPos));
|
||||
}
|
||||
|
||||
public void Sync(ArenaSession session)
|
||||
|
|
@ -351,7 +355,8 @@ public partial class Hud : CanvasLayer
|
|||
|
||||
private void BuildBottomCenterChyron()
|
||||
{
|
||||
var panel = CreateStyledPanel();
|
||||
_chyronPanel = CreateStyledPanel();
|
||||
var panel = _chyronPanel;
|
||||
panel.AnchorLeft = 0.5f;
|
||||
panel.AnchorRight = 0.5f;
|
||||
panel.AnchorTop = 1f;
|
||||
|
|
@ -719,7 +724,7 @@ public partial class Hud : CanvasLayer
|
|||
{
|
||||
var d = _state.GroundDrops[i];
|
||||
if (d.PickedUp) continue;
|
||||
var p = ClampToRadarDisc(center, maxBlipRadius, WorldToRadar(center, scale, d.X, d.Z, _cameraYaw));
|
||||
var p = ClampToRadarDisc(center, MathF.Max(4f, radius - 4f), WorldToRadar(center, scale, d.X, d.Z, _cameraYaw));
|
||||
if (d.Chassis is not null)
|
||||
{
|
||||
DrawRect(new Rect2(p - new Vector2(2.5f, 2.5f), new Vector2(5f, 5f)), CyanCol);
|
||||
|
|
@ -746,8 +751,9 @@ public partial class Hud : CanvasLayer
|
|||
bool live = mem!.VisibleToPlayer;
|
||||
float drawX = live || mem.FaintHorizonPing ? s.X : mem.LastSeenX;
|
||||
float drawZ = live || mem.FaintHorizonPing ? s.Z : mem.LastSeenZ;
|
||||
var p = ClampToRadarDisc(center, maxBlipRadius, WorldToRadar(center, scale, drawX, drawZ, _cameraYaw));
|
||||
float blipR = 1.6f + s.RadarSignature * 3.1f;
|
||||
float specClampR = MathF.Max(4f, radius - blipR - 1f);
|
||||
var p = ClampToRadarDisc(center, specClampR, WorldToRadar(center, scale, drawX, drawZ, _cameraYaw));
|
||||
|
||||
Color col = s.Tier switch
|
||||
{
|
||||
|
|
@ -762,8 +768,14 @@ public partial class Hud : CanvasLayer
|
|||
if (tid >= 0 && tid < _state.Contenders.Count && _state.Contenders[tid].Alive)
|
||||
{
|
||||
var tgt = _state.Contenders[tid];
|
||||
var tp = ClampToRadarDisc(center, maxBlipRadius, WorldToRadar(center, scale, tgt.X, tgt.Z, _cameraYaw));
|
||||
DrawLine(p, tp, new Color(RedCol.R, RedCol.G, RedCol.B, 0.65f), 1.3f);
|
||||
bool targetVisible = tgt.IsPlayer ||
|
||||
(_state.ContenderContacts.TryGetValue(tgt.Id, out var tgtMem) && tgtMem.VisibleToPlayer);
|
||||
if (targetVisible)
|
||||
{
|
||||
float tgtClampR = MathF.Max(4f, radius - (tgt.IsPlayer ? 7.5f : 4.3f));
|
||||
var tp = ClampToRadarDisc(center, tgtClampR, WorldToRadar(center, scale, tgt.X, tgt.Z, _cameraYaw));
|
||||
DrawLine(p, tp, new Color(RedCol.R, RedCol.G, RedCol.B, 0.65f), 1.3f);
|
||||
}
|
||||
}
|
||||
col = RedCol;
|
||||
}
|
||||
|
|
@ -792,7 +804,8 @@ public partial class Hud : CanvasLayer
|
|||
|
||||
if (c.IsPlayer)
|
||||
{
|
||||
var p = ClampToRadarDisc(center, maxBlipRadius, WorldToRadar(center, scale, c.X, c.Z, _cameraYaw));
|
||||
float playerClampR = MathF.Max(4f, radius - 6.5f - 1f);
|
||||
var p = ClampToRadarDisc(center, playerClampR, WorldToRadar(center, scale, c.X, c.Z, _cameraYaw));
|
||||
var dir = new Vector2(
|
||||
-MathF.Sin(c.Yaw) * cosY + MathF.Cos(c.Yaw) * sinY,
|
||||
-(MathF.Sin(c.Yaw) * sinY + MathF.Cos(c.Yaw) * cosY));
|
||||
|
|
@ -815,12 +828,14 @@ public partial class Hud : CanvasLayer
|
|||
|
||||
if (mem!.VisibleToPlayer)
|
||||
{
|
||||
var p = ClampToRadarDisc(center, maxBlipRadius, WorldToRadar(center, scale, c.X, c.Z, _cameraYaw));
|
||||
float rivalClampR = MathF.Max(4f, radius - 3.3f - 1f);
|
||||
var p = ClampToRadarDisc(center, rivalClampR, WorldToRadar(center, scale, c.X, c.Z, _cameraYaw));
|
||||
DrawCircle(p, 3.3f, OrangeCol);
|
||||
}
|
||||
else
|
||||
{
|
||||
var p = ClampToRadarDisc(center, maxBlipRadius, WorldToRadar(center, scale, mem.LastSeenX, mem.LastSeenZ, _cameraYaw));
|
||||
float ghostClampR = MathF.Max(4f, radius - 2.8f - 1f);
|
||||
var p = ClampToRadarDisc(center, ghostClampR, WorldToRadar(center, scale, mem.LastSeenX, mem.LastSeenZ, _cameraYaw));
|
||||
float alpha = Math.Clamp((1f - mem.LastSeenAge / MatchState.ContactGhostDuration) * 0.48f, 0.08f, 0.48f);
|
||||
DrawCircle(p, 2.8f, new Color(OrangeCol.R, OrangeCol.G, OrangeCol.B, alpha));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue