sketchy override styles
This commit is contained in:
1 parent
beeac0ee8d
commit
a949f0ab05
6 files changed
+12
-13
No files matched your search
+3
-5
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
@@ -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&guid=cf92f075876ddf7ffb4cd5c59633ad7b&type=3#ShipUi" />
|
||||
<Style src="project://database/Assets/Src/UI/TimingUi.uss?fileID=7433441132597879392&guid=cf92f075876ddf7ffb4cd5c59633ad7b&type=3#TimingUi" />
|
||||
<ui:VisualElement name="VisualElement" style="-unity-font: url('project://database/Assets/UI%20Toolkit/Fonts/Jura-Medium.otf?fileID=12800000&guid=65648a14640996362a6b0929c723b6e4&type=3#Jura-Medium'); -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 " 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>
|
||||
|
||||
@@ -28,6 +28,6 @@ public class ControlsUI : MonoBehaviour {
|
||||
return;
|
||||
}
|
||||
|
||||
speed.text = $"{ship.Speed():0} u/s";
|
||||
speed.text = $"{ship.Speed():0}";
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user