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 float _width;
private int _displayHeight; private int _displayHeight;
private int _displayWidth; private int _displayWidth;
private bool _displayOnlyWhenSuitOn;
internal static IModHelper Helper; internal static IModHelper Helper;
public static bool CountUp { get; private set; } public static bool CountUp { get; private set; }
@ -66,6 +67,12 @@ namespace Clock
return; 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(); var elapsed = TimeLoop.GetSecondsElapsed();
if (elapsed < 1f) if (elapsed < 1f)
{ {
@ -138,6 +145,7 @@ namespace Clock
// When the HudScale changes, we need to scale the HUD // When the HudScale changes, we need to scale the HUD
RecalculatePosition(); RecalculatePosition();
_displayOnlyWhenSuitOn = config.GetSettingsValue<bool>("Only Display When Suit Equipped");
} }
#endregion #endregion

View File

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