Skip to content

Commit f6c45d6

Browse files
committed
Fix 'Sticky' Block Points Display (#1962)
Still not a perfect fix, but way better than it was.
1 parent ab9c11e commit f6c45d6

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Gamemode Mods/Starcore_Sharetrack/Data/Scripts/ShipPoints/BuildingBlockPoints.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Sandbox.Game.Gui;
33
using Sandbox.ModAPI;
44
using StarCore.ShareTrack.API;
5+
using VRage.Input;
56
using VRageMath;
67
using VRageRender;
78

@@ -19,14 +20,26 @@ public BuildingBlockPoints()
1920
_pointsMessage = new HudAPIv2.HUDMessage(scale: 1f, font: "BI_SEOutlined", Message: new StringBuilder(""),
2021
origin: new Vector2D(-0.969, 0.57), blend: MyBillboard.BlendTypeEnum.PostPP);
2122
};
23+
24+
2225
}
2326

2427
private int _ticks;
2528
public void Update()
2629
{
30+
if (MyAPIGateway.Input.WasKeyPress(MyKeys.D0))
31+
UpdateHud(null);
32+
2733
if (_ticks++ % 10 != 0)
2834
return;
2935

36+
if (MyAPIGateway.Session.ControlledObject is IMyShipController)
37+
{
38+
UpdateHud(null);
39+
LastHeldSubtype = null;
40+
return;
41+
}
42+
3043
if (LastHeldSubtype != MyHud.BlockInfo?.DefinitionId.SubtypeName)
3144
{
3245
LastHeldSubtype = MyHud.BlockInfo?.DefinitionId.SubtypeName;

0 commit comments

Comments
 (0)