Allow displaying clock only when suit equipped

Closes #17
This commit is contained in:
BuildTools 2024-09-08 12:08:47 +01:00
parent ff2fee854b
commit c8e20bd096
2 changed files with 10 additions and 0 deletions

View File

@ -19,6 +19,7 @@ namespace Clock
private float _width;
private int _displayHeight;
private int _displayWidth;
private bool _displayOnlyWhenSuitOn;
internal static IModHelper Helper;
public static bool CountUp { get; private set; }
@ -66,6 +67,12 @@ namespace Clock
return;
}
// It would be cool to render the UI on the helmet display if this is enabled
if (_displayOnlyWhenSuitOn && !PlayerState.IsWearingSuit())
{
return;
}
var elapsed = TimeLoop.GetSecondsElapsed();
if (elapsed < 1f)
{
@ -138,6 +145,7 @@ namespace Clock
// When the HudScale changes, we need to scale the HUD
RecalculatePosition();
_displayOnlyWhenSuitOn = config.GetSettingsValue<bool>("Only Display When Suit Equipped");
}
#endregion

View File

@ -1,9 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/ow-mods/owml/master/schemas/config_schema.json",
"enabled": true,
"settings": {
"Count Up": true,
"Count In Milliseconds": false,
"Events to Display": 5,
"Only Display When Suit Equipped": false,
"HudScale": {
"title": "Event List Width",
"type": "slider",