sketchy override styles

This commit is contained in:
ntr committed 2023-08-04 14:29:28 +10:00
1 parent beeac0ee8d
commit a949f0ab05
6 files changed
+12 -13

No files matched your search

+3 -5
View File
@@ -55,12 +55,10 @@ public class Lap {
// 0:1:39
public override string ToString() {
return $"{TimeSpan.FromSeconds(TotalTime()):m\\:ss\\.fff}";
return $"{TimeSpan.FromSeconds(TotalTime):m\\:ss\\.fff}";
}
public double TotalTime() {
return Sectors.Sum(s => s.Seconds);
}
public double TotalTime => Sectors.Sum(s => s.Seconds);
}
@@ -126,6 +124,6 @@ static class LapStorageService {
public static Lap PB(string mapName) {
return lapsByMap[mapName].Laps
.MinBy(l => l.TotalTime());
.MinBy(l => l.TotalTime);
}
}
+1 -1
View File
@@ -138,7 +138,7 @@ public class Timing: MonoBehaviour {
};
public double PBLapDiff(Lap lap) => PB() switch {
Lap pb => lap.TotalTime() - pb.TotalTime(),
Lap pb => lap.TotalTime - pb.TotalTime,
null => -1d,
};
+4 -3
View File
@@ -1,9 +1,10 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<Style src="project://database/Assets/Src/UI/TimingUi.uss?fileID=7433441132597879392&amp;guid=cf92f075876ddf7ffb4cd5c59633ad7b&amp;type=3#ShipUi" />
<Style src="project://database/Assets/Src/UI/TimingUi.uss?fileID=7433441132597879392&amp;guid=cf92f075876ddf7ffb4cd5c59633ad7b&amp;type=3#TimingUi" />
<ui:VisualElement name="VisualElement" style="-unity-font: url(&apos;project://database/Assets/UI%20Toolkit/Fonts/Jura-Medium.otf?fileID=12800000&amp;guid=65648a14640996362a6b0929c723b6e4&amp;type=3#Jura-Medium&apos;); -unity-font-definition: initial; flex-direction: row; flex-grow: 1;">
<ui:VisualElement name="left" style="flex-grow: 1; background-color: rgba(0, 0, 0, 0); justify-content: center; align-items: center;" />
<ui:VisualElement name="middle" style="flex-grow: 1; background-color: rgba(0, 0, 0, 0); justify-content: center; align-items: center;">
<ui:Label tabindex="-1" text="128 u/s" display-tooltip-when-elided="true" name="speed" style="translate: 0 500%;" />
<ui:VisualElement name="middle" style="flex-direction: row; flex-grow: 1; justify-content: center; align-self: center; margin-top: 20%;">
<ui:Label tabindex="-1" text="128&#10;" display-tooltip-when-elided="true" name="speed" style="min-width: 5%; -unity-text-align: upper-center;" />
<ui:Label tabindex="-1" text="u/s" display-tooltip-when-elided="true" name="units" style="min-width: 5%;" />
</ui:VisualElement>
<ui:VisualElement name="right" style="flex-grow: 1; background-color: rgba(0, 0, 0, 0); justify-content: center; align-items: center;" />
</ui:VisualElement>
+1 -1
View File
@@ -28,6 +28,6 @@ public class ControlsUI : MonoBehaviour {
return;
}
speed.text = $"{ship.Speed():0} u/s";
speed.text = $"{ship.Speed():0}";
}
}
+1 -1
View File
@@ -22,7 +22,7 @@
</ui:VisualElement>
<ui:VisualElement name="timerSectors" class="sectors" style="flex-grow: 0; background-color: rgba(0, 0, 0, 0); flex-direction: row; align-self: stretch; align-items: auto;">
<ui:Label tabindex="-1" text="32.0" display-tooltip-when-elided="true" class="yellow" />
<ui:Label tabindex="-1" text="64.0" display-tooltip-when-elided="true" class="green middle" />
<ui:Label tabindex="-1" text="64.0" display-tooltip-when-elided="true" class="green" />
<ui:Label tabindex="-1" text="1:28.8" display-tooltip-when-elided="true" class="purple" />
</ui:VisualElement>
</ui:VisualElement>
+2 -2
View File
@@ -15,10 +15,10 @@
}
.sectors Label {
flex-shrink: 1;
flex-shrink: 0;
flex-grow: 1;
flex-basis: 0;
-unity-text-align: upper-center;
width: 30%;
}
.green {