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 @@ + + id="color-profile8439" /> @@ -2600,17 +2611,17 @@ borderopacity="1.0" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:zoom="1.3764072" - inkscape:cx="151.48133" - inkscape:cy="479.87253" + inkscape:zoom="0.48663344" + inkscape:cx="1230.906" + inkscape:cy="120.21369" inkscape:document-units="px" inkscape:current-layer="layer1" - showgrid="false" + showgrid="true" inkscape:snap-grids="true" - inkscape:window-width="1920" - inkscape:window-height="1044" - inkscape:window-x="0" - inkscape:window-y="36" + inkscape:window-width="2556" + inkscape:window-height="1396" + inkscape:window-x="2560" + inkscape:window-y="40" inkscape:window-maximized="1" inkscape:showpageshadow="false" showborder="true" @@ -2630,18 +2641,12 @@ lock-margins="true"> + id="grid7057" + spacingx="5.0000001" + spacingy="5.0000001" + empspacing="10" + originx="6.0000129" + originy="6.0002754" /> @@ -2658,83 +2663,87 @@ inkscape:label="left" inkscape:groupmode="layer" id="layer1" - transform="translate(-418.61517,556.63084)" + transform="translate(-423.18811,331.95252)" style="display:inline"> - - - + id="g1085" + transform="matrix(0.23367578,0,0,0.23367578,454.038,-111.96432)" + style="stroke-width:7.95984;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none" /> + + + + + + + + + + - - - - - - - - + + + + + + - - - + style="color:#000000;fill:#f9f9f9;stroke-linecap:round;stroke-linejoin:round;-inkscape-stroke:none;paint-order:stroke markers fill" + d="m 445.00391,-428.9082 c -5.44666,0 -10.96263,-0.0113 -15.93555,0.69922 -4.97293,0.7105 -9.49781,2.13651 -12.68359,5.32226 -3.19595,3.19592 -4.61241,7.7758 -5.32227,12.79102 -0.70439,4.97659 -0.69737,10.47654 -0.69727,15.82422 a 1.960785,1.960785 0 0 0 -0.002,0.004 1.960785,1.960785 0 0 0 0.002,0.002 c 10e-6,0.0396 -0.002,0.0796 -0.002,0.11914 v 32.55859 a 1.960785,1.960785 0 0 0 1.95899,1.96094 1.960785,1.960785 0 0 0 1.96093,-1.96094 v -30.71875 h 30.72071 32.72265 32.63672 c 5.4467,0 10.96285,0.009 15.93555,-0.70117 4.9727,-0.71032 9.49836,-2.13515 12.68359,-5.32031 3.18525,-3.18518 4.65819,-7.75869 4.6582,-12.2793 2e-5,-4.52062 -1.4732,-9.09346 -4.6582,-12.2793 -3.18512,-3.18596 -7.70888,-4.61175 -12.68164,-5.32226 -4.97276,-0.71052 -10.49085,-0.69922 -15.9375,-0.69922 h -32.67969 z m 0,3.92187 h 32.67968 32.67969 c 5.44665,0 10.82422,0.009 15.38281,0.66016 4.55859,0.65133 8.20207,1.94952 10.46289,4.21094 2.26095,2.26153 3.50978,5.85856 3.50977,9.50781 -10e-6,3.64925 -1.24895,7.24509 -3.50977,9.50586 -2.26083,2.26078 -5.90426,3.55977 -10.46289,4.21094 -4.55863,0.65116 -9.93611,0.6621 -15.38281,0.6621 h -32.63672 -32.72265 -30.69727 c 0.0115,-4.67742 0.0716,-9.31204 0.63867,-13.31835 0.65199,-4.60632 1.95951,-8.315 4.21094,-10.56641 2.2616,-2.26158 5.90801,-3.56156 10.4668,-4.21289 4.55879,-0.65133 9.9342,-0.66016 15.38086,-0.66016 z" + id="path4442" /> 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 @@ + + id="color-profile6530" /> @@ -2008,15 +2019,15 @@ id="g4989"> @@ -2600,17 +2611,17 @@ borderopacity="1.0" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:zoom="1.3764072" - inkscape:cx="415.21143" - inkscape:cy="256.82807" + inkscape:zoom="0.48663344" + inkscape:cx="271.2514" + inkscape:cy="79.114991" inkscape:document-units="px" inkscape:current-layer="layer1" - showgrid="false" + showgrid="true" inkscape:snap-grids="true" - inkscape:window-width="1920" - inkscape:window-height="1044" - inkscape:window-x="0" - inkscape:window-y="36" + inkscape:window-width="2556" + inkscape:window-height="1396" + inkscape:window-x="2560" + inkscape:window-y="40" inkscape:window-maximized="1" inkscape:showpageshadow="false" showborder="true" @@ -2623,25 +2634,19 @@ inkscape:snap-object-midpoints="true" inkscape:snap-others="true" units="px" - fit-margin-top="100" - fit-margin-left="100" - fit-margin-right="100" - fit-margin-bottom="100" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" lock-margins="true"> + id="grid7057" + spacingx="5.0000001" + spacingy="5.0000001" + empspacing="10" + originx="6.0000129" + originy="6.0002754" /> @@ -2658,130 +2663,137 @@ inkscape:label="left" inkscape:groupmode="layer" id="layer1" - transform="translate(-318.61462,656.63046)" + transform="translate(-423.18811,331.95252)" style="display:inline"> - - - + id="g2366" + transform="matrix(1.2000212,0,0,1.2000212,-111.6051,343.63772)"> + + + + inkscape:original-d="m 950.64427,-391.31818 c 1.00281,-27.94057 0,-55.55105 0,-83.33186 0.33638,-27.16323 0,-55.55101 0,-83.33195 27.78119,0.002 55.55803,0.002 83.33193,0 27.7812,0.002 55.558,0.002 83.3319,0 27.7812,0.002 55.5581,0.002 83.3318,0 27.7812,0.002 55.5581,0.002 83.332,0 0,27.78119 0,55.55808 0,83.33195 -27.7746,0.002 -55.5511,0.002 -83.332,0 -27.7745,0.002 -55.5511,0.002 -83.3318,0 -27.5522,0.50268 -55.5511,0.002 -83.3319,0 -27.7745,0.002 -55.55103,0.002 -83.33193,0" /> + inkscape:original-d="m 1450.6355,-391.31818 c -0.05,-27.32955 0,-55.55105 0,-83.33186 -0.05,-25.88553 0,-55.55101 0,-83.33195 27.9479,-0.10073 55.5582,0.002 83.332,0 29.8367,0.22669 55.558,0.002 83.3318,0 26.3922,-0.44094 55.558,0.002 83.3319,0 27.7811,0.002 55.5581,0.002 83.3319,0 0.1702,27.89255 0,55.55808 0,83.33195 0.8366,27.78119 0,55.55798 0,83.33186" /> + inkscape:original-d="m 783.98059,-557.98199 c -83.32854,0.002 -166.66036,0.002 -249.9956,0 -26.71891,0.44848 -55.55118,0.002 -83.33186,0 0.002,27.78119 0.002,55.55808 0,83.33195 27.78119,0.002 55.55798,0.002 83.33186,0 27.94785,1.00282 55.55795,0.002 83.33195,0 27.78119,0.002 55.55785,0.002 83.33185,0 27.72563,1.33656 55.55795,0.002 83.3318,0 0,27.78119 0,55.55798 0,83.33186 -29.05229,0.55935 -55.55112,0.002 -83.3318,0 -27.77451,0.002 -55.5513,0.002 -83.33185,0 -55.55242,0.002 -111.10583,0.002 -166.66381,0" /> + inkscape:original-d="m 2283.9543,-557.98199 c -83.3287,0.002 -166.6605,0.002 -249.9957,0 -27.7746,0.002 -55.5511,0.002 -83.3318,0 0,27.78119 0,55.55808 0,83.33195 0.5595,26.83684 0,55.55798 0,83.33186 27.781,0.002 55.5579,0.002 83.3318,0 83.4479,1.0595 166.667,0.002 249.9957,0" /> + inkscape:original-d="m 2450.618,-474.65004 c 83.3352,0.002 166.667,0.002 249.9955,0" /> + + + + - - - + inkscape:original-d="m 1783.9632,-224.65438 c -83.3285,0.003 -166.6605,0.003 -249.9956,0 -27.7746,0.003 -55.551,0.003 -83.3319,0 0,27.78116 0,55.55808 0,83.33196 0.5593,26.83681 0,55.557968 0,83.331846 27.7811,0.0023 55.558,0.0023 83.3319,0 83.4479,1.059508 166.6671,0.0023 249.9956,0" /> + inkscape:original-d="m 1950.627,-141.32242 c 83.335,0.002 166.6668,0.002 249.9955,0" /> - + + + + 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 @@