diff --git a/Assets/Images/Shield.Path.svg b/Assets/Images/Shield.Path.svg
new file mode 100644
index 0000000..558478d
--- /dev/null
+++ b/Assets/Images/Shield.Path.svg
@@ -0,0 +1,122 @@
+
+
+
+
diff --git a/Assets/Images/shield.butt.svg.meta b/Assets/Images/Shield.Path.svg.meta
similarity index 93%
rename from Assets/Images/shield.butt.svg.meta
rename to Assets/Images/Shield.Path.svg.meta
index c9d52c9..7fcd662 100644
--- a/Assets/Images/shield.butt.svg.meta
+++ b/Assets/Images/Shield.Path.svg.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 92b68952770797eafbb493b98fbced3d
+guid: 9711c8847640a61d5b73846d08f009ba
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
@@ -50,5 +50,5 @@ ScriptedImporter:
y: 0
width: 0
height: 0
- spriteID: 11ff1ee0ae3af2caea8ac49820af747d
+ spriteID: fa9a44ccf6ffb337e983e37856b3c0e7
PhysicsOutlines: []
diff --git a/Assets/Images/SpaceRace.Logo.Filled.svg b/Assets/Images/SpaceRace.Logo.Filled.svg
index 2b9d9a4..09d0c61 100644
--- a/Assets/Images/SpaceRace.Logo.Filled.svg
+++ b/Assets/Images/SpaceRace.Logo.Filled.svg
@@ -2,9 +2,9 @@
diff --git a/Assets/Images/SpaceRace.Logo.svg b/Assets/Images/SpaceRace.Logo.svg
index 9889d8f..acbafa8 100644
--- a/Assets/Images/SpaceRace.Logo.svg
+++ b/Assets/Images/SpaceRace.Logo.svg
@@ -2,9 +2,9 @@
diff --git a/Assets/Images/shield.butt.svg b/Assets/Images/shield.butt.svg
deleted file mode 100644
index 5f03c73..0000000
--- a/Assets/Images/shield.butt.svg
+++ /dev/null
@@ -1,550 +0,0 @@
-
-
-
-
diff --git a/Assets/Images/shield.svg b/Assets/Images/shield.svg
index 023cb88..054377b 100644
--- a/Assets/Images/shield.svg
+++ b/Assets/Images/shield.svg
@@ -4,7 +4,7 @@
diff --git a/Assets/Resources/SpaceRace-Icons.ttf b/Assets/Resources/SpaceRace-Icons.ttf
index f1b9fac..07cf624 100644
--- a/Assets/Resources/SpaceRace-Icons.ttf
+++ b/Assets/Resources/SpaceRace-Icons.ttf
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:2530030bcf810b527089a4e1a81a9fbbf89964ba6ae314639381c0367db4532e
-size 5364
+oid sha256:ed486bfb33aa9588c61e5208135816e42091a4e8bc7ad4e724f47638eb1a10c3
+size 5500
diff --git a/Assets/Resources/SpaceRace-Icons.ttf.meta b/Assets/Resources/SpaceRace-Icons.ttf.meta
index 7089dcc..a247593 100644
--- a/Assets/Resources/SpaceRace-Icons.ttf.meta
+++ b/Assets/Resources/SpaceRace-Icons.ttf.meta
@@ -3,7 +3,7 @@ guid: 6341925c14bc48c1eaf9fcb299a97234
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
- fontSize: 256
+ fontSize: 32
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
diff --git a/Assets/Src/UI/BoostBar.cs b/Assets/Src/UI/BoostComponents.cs
similarity index 56%
rename from Assets/Src/UI/BoostBar.cs
rename to Assets/Src/UI/BoostComponents.cs
index 95a771d..8447104 100644
--- a/Assets/Src/UI/BoostBar.cs
+++ b/Assets/Src/UI/BoostComponents.cs
@@ -75,7 +75,7 @@ namespace BoostComponents {
var painter = context.painter2D;
painter.lineWidth = 4.0f;
- painter.lineCap = LineCap.Butt;
+ painter.lineCap = LineCap.Round;
painter.strokeColor = strokeColor;
painter.BeginPath();
@@ -93,4 +93,70 @@ namespace BoostComponents {
}
}
}
+
+ public class BoostIndicator : VisualElement {
+ // Need this uxml traits and factory for it to show up in editor
+ public new class UxmlTraits : VisualElement.UxmlTraits {
+ UxmlDoubleAttributeDescription m_ProgressAttribute = new UxmlDoubleAttributeDescription() {
+ name = "progress"
+ };
+
+ public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc) {
+ base.Init(ve, bag, cc);
+ (ve as BoostIndicator).progress = m_ProgressAttribute.GetValueFromBag(bag, cc);
+ }
+ }
+
+ public new class UxmlFactory : UxmlFactory { }
+
+ public static readonly string ussClassName = "BoostIndicator";
+ public static readonly string ussLabelClassName = "BoostIndicator";
+
+ double m_Progress = 0f;
+
+ Color strokeColor = Color.white;
+
+ public double progress {
+ get => m_Progress;
+ set {
+ m_Progress = value;
+ MarkDirtyRepaint();
+ }
+ }
+
+ public BoostIndicator() {
+ AddToClassList(ussClassName);
+ RegisterCallback(evt => CustomStylesResolved(evt));
+ generateVisualContent += GenerateVisualContent;
+ }
+
+ void GenerateVisualContent(MeshGenerationContext context) {
+ float width = contentRect.width;
+ float height = contentRect.height;
+
+ double length = width * m_Progress;
+
+ Vector2 left = new Vector2(0f, height / 2);
+ Vector2 end = new Vector2((float)length, height / 2);
+
+ var painter = context.painter2D;
+ painter.lineWidth = 3.0f;
+ painter.lineCap = LineCap.Round;
+ painter.strokeColor = strokeColor;
+
+ painter.BeginPath();
+ painter.MoveTo(left);
+ painter.LineTo(end);
+ painter.Stroke();
+ }
+
+ static void CustomStylesResolved(CustomStyleResolvedEvent evt) {
+ BoostIndicator element = (BoostIndicator)evt.currentTarget;
+ element.UpdateCustomStyles();
+ }
+
+ void UpdateCustomStyles() {
+ MarkDirtyRepaint();
+ }
+ }
}
diff --git a/Assets/Src/UI/BoostBar.cs.meta b/Assets/Src/UI/BoostComponents.cs.meta
similarity index 100%
rename from Assets/Src/UI/BoostBar.cs.meta
rename to Assets/Src/UI/BoostComponents.cs.meta
diff --git a/Assets/Src/UI/Controls.uxml b/Assets/Src/UI/Controls.uxml
index 96d60e2..e49b821 100644
--- a/Assets/Src/UI/Controls.uxml
+++ b/Assets/Src/UI/Controls.uxml
@@ -2,7 +2,7 @@
-
+
@@ -11,14 +11,27 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
diff --git a/Assets/Src/UI/ControlsUI.cs b/Assets/Src/UI/ControlsUI.cs
index ebc62e4..47f7505 100644
--- a/Assets/Src/UI/ControlsUI.cs
+++ b/Assets/Src/UI/ControlsUI.cs
@@ -14,12 +14,9 @@ public class ControlsUI : MonoBehaviour {
UIDocument uiDocument;
Label speed;
Label shields;
- Label puAccel;
- Label puDecel;
- Label puStrafe;
- Label puShield;
BoostBar boostBar;
+ InterfaceIcon shield;
void OnEnable() {
Init();
@@ -30,11 +27,7 @@ public class ControlsUI : MonoBehaviour {
speed = uiDocument.rootVisualElement.Q