menu fixes

This commit is contained in:
ntr committed 2023-07-26 21:51:12 +10:00
1 parent 6704c3ae59
commit cb94407cef
2 files changed
+6 -3

No files matched your search

+1 -2
View File
@@ -21,7 +21,6 @@ public class MenuControls : MonoBehaviour, SpaceRaceInput.IMenuActions {
input.menu.SetCallbacks(this); input.menu.SetCallbacks(this);
} }
input.menu.Enable(); input.menu.Enable();
Debug.Log($"Menu {visible}");
Hide(); Hide();
} }
@@ -48,7 +47,7 @@ public class MenuControls : MonoBehaviour, SpaceRaceInput.IMenuActions {
public void OnToggleMenu(InputAction.CallbackContext ctx) { public void OnToggleMenu(InputAction.CallbackContext ctx) {
visible = !visible; visible = !visible;
Debug.Log($"Menu {visible}"); // Debug.Log($"Menu {visible}");
if (visible) { if (visible) {
Show(); Show();
+5 -1
View File
@@ -28,7 +28,7 @@ public class ShipUi : MonoBehaviour {
} }
void FixedUpdate() { void FixedUpdate() {
timer.text = $"{TimeSpan.FromSeconds(timing.lapTime):g}"; timer.text = $"{TimeSpan.FromSeconds(timing.lapTime):m\\:ss\\.fff}";
speed.text = $"{ship.Speed():0} u/s"; speed.text = $"{ship.Speed():0} u/s";
// clearly this is not ideal but idk atm // clearly this is not ideal but idk atm
@@ -39,6 +39,10 @@ public class ShipUi : MonoBehaviour {
if (sectors == null) if (sectors == null)
Debug.LogWarning("null sectors"); Debug.LogWarning("null sectors");
// timing not ready yet or smth?
if (timing.lapTimes == null)
return;
timeSheet.Clear(); timeSheet.Clear();
foreach (Lap lap in timing.lapTimes) { foreach (Lap lap in timing.lapTimes) {
Label l = new Label(); Label l = new Label();