controls broked
This commit is contained in:
1 parent
b8059a2511
commit
324062ecec
9 files changed
+900
-1670
No files matched your search
+4
-2
@@ -32,17 +32,19 @@ public class TimingNotice {
|
||||
|
||||
public Label ToLabel() {
|
||||
Label l = Category switch {
|
||||
NoticeCategory.Initial => new Label($"{TimeSpan.FromSeconds(Seconds):m\\:ss\\.fff}"),
|
||||
NoticeCategory.Slower => new Label($"+{Seconds:0.000}"),
|
||||
NoticeCategory.Faster => new Label($"-{Seconds:0.000}"),
|
||||
NoticeCategory.Fastest => new Label($"-{Seconds:0.000}"),
|
||||
NoticeCategory.Initial => new Label($"{TimeSpan.FromSeconds(Seconds):m\\:ss\\.fff}"),
|
||||
_ => new Label($"-{Seconds:0.000}"),
|
||||
};
|
||||
|
||||
string colourClass = Category switch {
|
||||
NoticeCategory.Initial => "",
|
||||
NoticeCategory.Slower => "yellow",
|
||||
NoticeCategory.Faster => "green",
|
||||
NoticeCategory.Fastest => "purple",
|
||||
NoticeCategory.Initial => "",
|
||||
_ => "",
|
||||
};
|
||||
|
||||
l.AddToClassList(colourClass);
|
||||
|
||||
@@ -17,6 +17,7 @@ public class ControlsUI : MonoBehaviour {
|
||||
}
|
||||
|
||||
void Init() {
|
||||
Debug.Log("controls ui init");
|
||||
uiDocument = GetComponent<UIDocument>();
|
||||
speed = uiDocument.rootVisualElement.Q<Label>("speed");
|
||||
}
|
||||
|
||||
@@ -8,6 +8,12 @@ public class MenuControls : MonoBehaviour, SpaceRaceInput.IMenuActions {
|
||||
[SerializeField]
|
||||
UIDocument timingDoc;
|
||||
|
||||
[SerializeField]
|
||||
UIDocument crosshairDoc;
|
||||
|
||||
[SerializeField]
|
||||
UIDocument controlsDoc;
|
||||
|
||||
[SerializeField]
|
||||
ShipControls shipControls;
|
||||
|
||||
@@ -48,8 +54,11 @@ public class MenuControls : MonoBehaviour, SpaceRaceInput.IMenuActions {
|
||||
menuDoc.enabled = true;
|
||||
menuUi.AddTracks();
|
||||
|
||||
// TODO abstract all this cause it's shit
|
||||
// take control off the ship
|
||||
timingDoc.enabled = false;
|
||||
crosshairDoc.enabled = false;
|
||||
controlsDoc.enabled = false;
|
||||
timingUi.enabled = false;
|
||||
shipControls.enabled = false;
|
||||
}
|
||||
@@ -61,6 +70,8 @@ public class MenuControls : MonoBehaviour, SpaceRaceInput.IMenuActions {
|
||||
|
||||
// resume control of the ship
|
||||
timingDoc.enabled = true;
|
||||
crosshairDoc.enabled = true;
|
||||
controlsDoc.enabled = true;
|
||||
timingUi.enabled = true;
|
||||
shipControls.enabled = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user