diff --git a/Output/Themes/Genius/01_Standard.xml b/Output/Themes/Genius/01_Standard.xml index 4b4b7f46..bc2c91a0 100644 --- a/Output/Themes/Genius/01_Standard.xml +++ b/Output/Themes/Genius/01_Standard.xml @@ -260,6 +260,42 @@ 1.000 0.700 + + 0.878 + 0.274 + 0.254 + 1.000 + + + 0.988 + 0.494 + 0.207 + 1.000 + + + 0.988 + 0.843 + 0.207 + 1.000 + + + 0.921 + 0.988 + 0.207 + 1.000 + + + 0.807 + 0.968 + 0.278 + 1.000 + + + 0.482 + 0.937 + 0.027 + 1.000 + BG_Default.png diff --git a/Output/Themes/Genius/02_Ice_Blue.xml b/Output/Themes/Genius/02_Ice_Blue.xml index bcfab83f..0f61be86 100644 --- a/Output/Themes/Genius/02_Ice_Blue.xml +++ b/Output/Themes/Genius/02_Ice_Blue.xml @@ -260,6 +260,42 @@ 0.945 0.700 + + 0.878 + 0.274 + 0.254 + 1.000 + + + 0.988 + 0.494 + 0.207 + 1.000 + + + 0.988 + 0.843 + 0.207 + 1.000 + + + 0.921 + 0.988 + 0.207 + 1.000 + + + 0.807 + 0.968 + 0.278 + 1.000 + + + 0.482 + 0.937 + 0.027 + 1.000 + BG_Default.png diff --git a/Output/Themes/Genius/03_Crimson_Red.xml b/Output/Themes/Genius/03_Crimson_Red.xml index d9a231c3..d9b61b8a 100644 --- a/Output/Themes/Genius/03_Crimson_Red.xml +++ b/Output/Themes/Genius/03_Crimson_Red.xml @@ -260,6 +260,42 @@ 0.733 0.700 + + 0.878 + 0.274 + 0.254 + 1.000 + + + 0.988 + 0.494 + 0.207 + 1.000 + + + 0.988 + 0.843 + 0.207 + 1.000 + + + 0.921 + 0.988 + 0.207 + 1.000 + + + 0.807 + 0.968 + 0.278 + 1.000 + + + 0.482 + 0.937 + 0.027 + 1.000 + BG_Default.png diff --git a/Output/Themes/Genius/Screens/ScreenSing.xml b/Output/Themes/Genius/Screens/ScreenSing.xml index a883cc3e..57c09eec 100644 --- a/Output/Themes/Genius/Screens/ScreenSing.xml +++ b/Output/Themes/Genius/Screens/ScreenSing.xml @@ -1693,7 +1693,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1701,9 +1701,35 @@ 1085 410 160 - 10 + 13 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1712,7 +1738,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1720,9 +1746,35 @@ 1085 170 160 - 10 + 13 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1731,7 +1783,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1739,9 +1791,35 @@ 1085 430 160 - 10 + 13 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1750,7 +1828,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1761,6 +1839,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1769,7 +1873,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1780,6 +1884,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1788,7 +1918,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1799,6 +1929,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1807,7 +1963,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1815,9 +1971,35 @@ 471 170 160 - 10 + 13 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1826,7 +2008,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1834,9 +2016,35 @@ 471 430 160 - 10 + 13 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1845,7 +2053,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1853,9 +2061,35 @@ 1105 170 160 - 10 + 13 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1864,7 +2098,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1872,9 +2106,35 @@ 1105 430 160 - 10 + 13 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1883,7 +2143,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1894,6 +2154,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1902,7 +2188,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1913,6 +2199,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1921,7 +2233,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1932,6 +2244,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1940,7 +2278,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1951,6 +2289,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1959,7 +2323,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1970,6 +2334,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1978,7 +2368,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -1989,6 +2379,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -1997,7 +2413,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -2008,6 +2424,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -2016,7 +2458,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -2027,6 +2469,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -2035,7 +2503,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -2046,6 +2514,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -2054,7 +2548,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -2065,6 +2559,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + RatingBarBackground @@ -2073,7 +2593,7 @@ RatingBarProgressMid RatingBarProgressRight - + Right TR_CONFIG_ON TR_CONFIG_ON @@ -2084,6 +2604,32 @@ 7 -0.75 + + + 0 + + + + 0.16 + + + + 0.33 + + + + 0.5 + + + + 0.62 + + + + 0.8 + + + diff --git a/VocaluxeLib/Menu/CProgressBar.cs b/VocaluxeLib/Menu/CProgressBar.cs index 2c5d828a..11a33077 100644 --- a/VocaluxeLib/Menu/CProgressBar.cs +++ b/VocaluxeLib/Menu/CProgressBar.cs @@ -16,6 +16,7 @@ #endregion using System; +using System.Collections.Generic; using System.Diagnostics; using System.Xml.Serialization; using VocaluxeLib.Draw; @@ -23,6 +24,13 @@ using VocaluxeLib.Xml; namespace VocaluxeLib.Menu { + [XmlType("ProgressColor")] + public struct SThemeProgressBarColor + { + public float From; + public SThemeColor Color; + } + [XmlType("ProgressBar")] public struct SThemeProgressBar { @@ -38,6 +46,7 @@ namespace VocaluxeLib.Menu public EOffOn AnimateMovement; public EOffOn AnimateColoring; public SRectF Rect; + [XmlArrayItem("ProgressColor"), XmlArray] public List ProgressColors; public SReflection? Reflection; } @@ -115,9 +124,10 @@ namespace VocaluxeLib.Menu set { if (value != _ProgressTarget) + { + _ProgressTarget = value; _UpdateProgress(); - - _ProgressTarget = value; + } } } private float _ProgressCurrent; @@ -163,6 +173,7 @@ namespace VocaluxeLib.Menu { _PartyModeID = partyModeID; _Theme = theme; + _Theme.ProgressColors.Sort((x, y) => x.From.CompareTo(y.From)); _UpdateProgress(); ThemeLoaded = true; } @@ -185,7 +196,7 @@ namespace VocaluxeLib.Menu if (Visible || forceDraw || (CBase.Settings.GetProgramState() == EProgramState.EditTheme)) { - /** + //Draw background SColorF color = new SColorF(ColorBackground.R, ColorBackground.G, ColorBackground.B, ColorBackground.A * Alpha); if (_TextureBackground != null) @@ -196,7 +207,7 @@ namespace VocaluxeLib.Menu } else CBase.Drawing.DrawRect(ColorBackground, Rect); - **/ + //Draw progress if (_TextureProgressBegin != null) { @@ -224,40 +235,8 @@ namespace VocaluxeLib.Menu } else CBase.Drawing.DrawRect(_ColorProgressCurrent, _RectProgressEnd); - /* - //Width-related variables rounded and then floored to prevent 1px gaps in progress bar - SRectF rect = new SRectF(Rect.X, Rect.Y, (float)Math.Round(Rect.W), (float)Math.Round(Rect.H), Rect.Z); - int dh = (int)((1f - scale) * rect.H / 2); - int dw = (int)Math.Min(dh, rect.W / 2); - - var progressRect = new SRectF(rect.X + dw, rect.Y + dh, rect.W - 2 * dw, rect.H - 2 * dh, rect.Z); - - //Width of each of the ends (round parts) - //Need 2 of them so use minimum - int endsW = (int)Math.Min(progressRect.H * _TextureProgressLeft.OrigAspect, progressRect.W / 2); - - CBase.Drawing.DrawTexture(_TextureProgressLeft, new SRectF(progressRect.X, progressRect.Y, endsW, progressRect.H, progressRect.Z), color); - - SRectF middleRect = new SRectF(progressRect.X + endsW, progressRect.Y, progressRect.W - 2 * endsW, progressRect.H, progressRect.Z); - - int midW = (int)Math.Round(progressRect.H * _TextureProgressMid.OrigAspect); - - int midCount = (int)middleRect.W / midW; - - for (int i = 0; i < midCount; ++i) - { - CBase.Drawing.DrawTexture(_TextureProgressMid, new SRectF(middleRect.X + (i * midW), progressRect.Y, midW, progressRect.H, progressRect.Z), color); - } - - SRectF lastMidRect = new SRectF(middleRect.X + midCount * midW, progressRect.Y, middleRect.W - (midCount * midW), progressRect.H, progressRect.Z); - - CBase.Drawing.DrawTexture(_TextureProgressMid, new SRectF(middleRect.X + (midCount * midW), middleRect.Y, midW, middleRect.H, middleRect.Z), color, lastMidRect); - - CBase.Drawing.DrawTexture(_TextureProgressRight, new SRectF(progressRect.X + progressRect.W - endsW, progressRect.Y, endsW, progressRect.H, progressRect.Z), color); - */ //Draw foreground - /** color = new SColorF(ColorForeground.R, ColorForeground.G, ColorForeground.B, ColorForeground.A * Alpha); if (_TextureForeground != null) { @@ -267,23 +246,8 @@ namespace VocaluxeLib.Menu } else CBase.Drawing.DrawRect(ColorForeground, Rect); - */ } - /* - var color = new SColorF(Color.R, Color.G, Color.B, Color.A * Alpha); - if (Visible || forceDraw || (CBase.Settings.GetProgramState() == EProgramState.EditTheme)) - { - if (texture != null) - { - CBase.Drawing.DrawTexture(texture, rect, color, bounds); - if (Reflection) - CBase.Drawing.DrawTextureReflection(texture, rect, color, bounds, ReflectionSpace, ReflectionHeight); - } - else - CBase.Drawing.DrawRect(color, rect); - }*/ - if (Selected && (CBase.Settings.GetProgramState() == EProgramState.EditTheme)) CBase.Drawing.DrawRect(new SColorF(1f, 1f, 1f, 0.5f), Rect); } @@ -326,7 +290,11 @@ namespace VocaluxeLib.Menu private void _UpdateProgress() { - _ColorProgressCurrent = new SColorF(1, 1, 1, 1); + foreach (SThemeProgressBarColor col in _Theme.ProgressColors) + if (col.From < _ProgressTarget) + col.Color.Get(_PartyModeID, out _ColorProgressTarget); + + _ColorProgressCurrent = _ColorProgressTarget; _UpdateProgressLeft(); _UpdateProgressMid(); _UpdateProgressRight();