From 5dfdad61c4b18ba3f808fecdf275b1c514dad5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 10 Sep 2017 11:17:21 +0200 Subject: [PATCH] Use ProgressBar on ScoreScreen, removed unused stuff --- .../Changelog/Changelog_ScreenScore.txt | 4 + Output/Themes/Genius/Screens/ScreenScore.xml | 993 ++++++++++-------- Vocaluxe/Base/CConfig.cs | 5 - Vocaluxe/Screens/CScreenScore.cs | 108 +- VocaluxeLib/Menu/CProgressBar.cs | 77 +- 5 files changed, 614 insertions(+), 573 deletions(-) diff --git a/Output/Themes/Changelog/Changelog_ScreenScore.txt b/Output/Themes/Changelog/Changelog_ScreenScore.txt index 611a2621..d34205f0 100644 --- a/Output/Themes/Changelog/Changelog_ScreenScore.txt +++ b/Output/Themes/Changelog/Changelog_ScreenScore.txt @@ -1,5 +1,9 @@ ScreenScore ++++++++++ +Version 4: +Removed , , +Added +++++++++++++++++++++ Version 3: Add , , to change text-string with player-num >= Add , set to "vertical" to draw animation in vertical direction. diff --git a/Output/Themes/Genius/Screens/ScreenScore.xml b/Output/Themes/Genius/Screens/ScreenScore.xml index d2727b00..6ebbf94a 100644 --- a/Output/Themes/Genius/Screens/ScreenScore.xml +++ b/Output/Themes/Genius/Screens/ScreenScore.xml @@ -2,7 +2,7 @@ ScreenScore - 3 + 4 @@ -25,28 +25,6 @@ 0 - - PointsBarBG - - - 520 - 360 - 390 - 10 - 0 - - - - PointsBar - - - 520 - 360 - 390 - 10 - 0 - - @@ -58,28 +36,6 @@ 0 - - PointsBarBG - - - 520 - 290 - 390 - 10 - 0 - - - - PointsBar - - - 520 - 290 - 390 - 10 - 0 - - @@ -91,28 +47,6 @@ 0 - - PointsBarBG - - - 520 - 535 - 390 - 10 - 0 - - - - PointsBar - - - 520 - 535 - 390 - 10 - 0 - - @@ -124,28 +58,6 @@ 0 - - PointsBarBG - - - 520 - 221 - 390 - 10 - 0 - - - - PointsBar - - - 520 - 221 - 390 - 10 - 0 - - @@ -157,28 +69,6 @@ 0 - - PointsBarBG - - - 520 - 412 - 390 - 10 - 0 - - - - PointsBar - - - 520 - 412 - 390 - 10 - 0 - - @@ -190,28 +80,6 @@ 0 - - PointsBarBG - - - 520 - 603 - 390 - 10 - 0 - - - - PointsBar - - - 520 - 603 - 390 - 10 - 0 - - @@ -223,28 +91,6 @@ 0 - - PointsBarBG - - - 210 - 290 - 390 - 10 - 0 - - - - PointsBar - - - 210 - 290 - 390 - 10 - 0 - - @@ -256,28 +102,6 @@ 0 - - PointsBarBG - - - 210 - 535 - 390 - 10 - 0 - - - - PointsBar - - - 210 - 535 - 390 - 10 - 0 - - @@ -289,28 +113,6 @@ 0 - - PointsBarBG - - - 820 - 290 - 390 - 10 - 0 - - - - PointsBar - - - 820 - 290 - 390 - 10 - 0 - - @@ -322,28 +124,6 @@ 0 - - PointsBarBG - - - 820 - 535 - 390 - 10 - 0 - - - - PointsBar - - - 820 - 535 - 390 - 10 - 0 - - @@ -355,28 +135,6 @@ 0 - - PointsBarBG - - - 210 - 221 - 390 - 10 - 0 - - - - PointsBar - - - 210 - 221 - 390 - 10 - 0 - - @@ -388,28 +146,6 @@ 0 - - PointsBarBG - - - 210 - 412 - 390 - 10 - 0 - - - - PointsBar - - - 210 - 412 - 390 - 10 - 0 - - @@ -421,28 +157,6 @@ 0 - - PointsBarBG - - - 210 - 603 - 390 - 10 - 0 - - - - PointsBar - - - 210 - 603 - 390 - 10 - 0 - - @@ -454,28 +168,6 @@ 0 - - PointsBarBG - - - 820 - 221 - 390 - 10 - 0 - - - - PointsBar - - - 820 - 221 - 390 - 10 - 0 - - @@ -487,28 +179,6 @@ 0 - - PointsBarBG - - - 820 - 412 - 390 - 10 - 0 - - - - PointsBar - - - 820 - 412 - 390 - 10 - 0 - - @@ -520,28 +190,6 @@ 0 - - PointsBarBG - - - 210 - 221 - 390 - 10 - 0 - - - - PointsBar - - - 210 - 221 - 390 - 10 - 0 - - @@ -553,28 +201,6 @@ 0 - - PointsBarBG - - - 210 - 412 - 390 - 10 - 0 - - - - PointsBar - - - 210 - 412 - 390 - 10 - 0 - - @@ -586,28 +212,6 @@ 0 - - PointsBarBG - - - 210 - 603 - 390 - 10 - 0 - - - - PointsBar - - - 210 - 603 - 390 - 10 - 0 - - @@ -619,28 +223,6 @@ 0 - - PointsBarBG - - - 820 - 221 - 390 - 10 - 0 - - - - PointsBar - - - 820 - 221 - 390 - 10 - 0 - - @@ -652,28 +234,6 @@ 0 - - PointsBarBG - - - 820 - 412 - 390 - 10 - 0 - - - - PointsBar - - - 820 - 412 - 390 - 10 - 0 - - @@ -685,28 +245,6 @@ 0 - - PointsBarBG - - - 820 - 603 - 390 - 10 - 0 - - - - PointsBar - - - 820 - 603 - 390 - 10 - 0 - - @@ -1952,4 +1490,531 @@ String - \ No newline at end of file + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 520 + 360 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 520 + 290 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 520 + 535 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 520 + 221 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 520 + 412 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 520 + 603 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 210 + 290 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 210 + 535 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 820 + 290 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 820 + 535 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 210 + 221 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 210 + 412 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 210 + 603 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 820 + 221 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 820 + 412 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 210 + 221 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 210 + 412 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 210 + 603 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 820 + 221 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 820 + 412 + 390 + 10 + 0 + + + + PointsBarBG + + + + + + + Right + TR_CONFIG_ON + TR_CONFIG_ON + + + 0 + + + + + 820 + 603 + 390 + 10 + 0 + + + + diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs index 4cb98e49..3cc7d685 100644 --- a/Vocaluxe/Base/CConfig.cs +++ b/Vocaluxe/Base/CConfig.cs @@ -134,7 +134,6 @@ namespace Vocaluxe.Base // ReSharper restore MemberHidesStaticFromOuterClass [DefaultValue(ESongSorting.TR_CONFIG_ARTIST)] public ESongSorting SongSorting; [DefaultValue(EOffOn.TR_CONFIG_ON)] public EOffOn IgnoreArticles; - [DefaultValue(10)] public float ScoreAnimationTime; [DefaultValue(ETimerMode.TR_CONFIG_TIMERMODE_REMAINING)] public ETimerMode TimerMode; [XmlAltName("NumPlayer"), DefaultValue(2)] public int NumPlayers; [DefaultValue(EOffOn.TR_CONFIG_OFF)] public EOffOn Tabs; @@ -344,8 +343,6 @@ namespace Vocaluxe.Base { Config.Game.SongFolder = SongFolders.ToArray(); } - if ((Config.Game.ScoreAnimationTime > 0 && Config.Game.ScoreAnimationTime < 1) || Config.Game.ScoreAnimationTime < 0) - Config.Game.ScoreAnimationTime = 1; if (Config.Game.MinLineBreakTime < 0) Config.Game.MinLineBreakTime = 0.1f; @@ -469,8 +466,6 @@ namespace Vocaluxe.Base return "SongSorting: " + CHelper.ListStrings(Enum.GetNames(typeof(ESongSorting))); case "IgnoreArticles": return "Ignore articles on song-sorting: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))); - case "ScoreAnimationTime": - return "ScoreAnimationTime: Values >= 1 or 0 for no animation. Time is in seconds."; case "TimerMode": return "TimerMode: " + CHelper.ListStrings(Enum.GetNames(typeof(ETimerMode))); case "NumPlayers": diff --git a/Vocaluxe/Screens/CScreenScore.cs b/Vocaluxe/Screens/CScreenScore.cs index 2f4f564a..33bc3983 100644 --- a/Vocaluxe/Screens/CScreenScore.cs +++ b/Vocaluxe/Screens/CScreenScore.cs @@ -33,7 +33,7 @@ namespace Vocaluxe.Screens // Version number for theme files. Increment it, if you've changed something on the theme files! protected override int _ScreenVersion { - get { return 3; } + get { return 4; } } private const string _TextSong = "TextSong"; @@ -41,7 +41,6 @@ namespace Vocaluxe.Screens private const string _ScreenSettingShortScore = "ScreenSettingShortScore"; private const string _ScreenSettingShortRating = "ScreenSettingShortRating"; private const string _ScreenSettingShortDifficulty = "ScreenSettingShortDifficulty"; - private const string _ScreenSettingAnimationDirection = "ScreenSettingAnimationDirection"; private CBackground _SlideShowBG; @@ -49,13 +48,10 @@ namespace Vocaluxe.Screens private string[,] _TextScores; private string[,] _TextRatings; private string[,] _TextDifficulty; - private string[,] _StaticPointsBarBG; - private string[,] _StaticPointsBar; + private string[,] _ProgressBarPoints; private string[,] _StaticAvatar; - private double[] _StaticPointsBarDrawnPoints; private int _Round; private CPoints _Points; - private Stopwatch _Timer; public override EMusicType CurrentMusicType { @@ -77,9 +73,12 @@ namespace Vocaluxe.Screens _ThemeStatics = statics.ToArray(); - _ThemeScreenSettings = new string[] {_ScreenSettingShortScore, _ScreenSettingShortRating, _ScreenSettingShortDifficulty, _ScreenSettingAnimationDirection}; + var progressBars = new List(); + _BuildProgressBarString(ref progressBars); - _StaticPointsBarDrawnPoints = new double[CSettings.MaxNumPlayer]; + _ThemeProgressBars = progressBars.ToArray(); + + _ThemeScreenSettings = new string[] {_ScreenSettingShortScore, _ScreenSettingShortRating, _ScreenSettingShortDifficulty}; _SlideShowBG = GetNewBackground(); _AddBackground(_SlideShowBG); @@ -157,34 +156,6 @@ namespace Vocaluxe.Screens for (int p = 0; p < players.Length; p++) players[p].Points = (int)(players[p].Points / CGame.NumRounds); } - for (int p = 0; p < players.Length; p++) - { - if (_StaticPointsBarDrawnPoints[p] < players[p].Points) - { - if (CConfig.Config.Game.ScoreAnimationTime >= 1) - { - _StaticPointsBarDrawnPoints[p] = (_Timer.ElapsedMilliseconds / 1000f) / CConfig.Config.Game.ScoreAnimationTime * 10000; - - - if (_StaticPointsBarDrawnPoints[p] > players[p].Points) - _StaticPointsBarDrawnPoints[p] = players[p].Points; - var direction = (string)_ScreenSettings[_ScreenSettingAnimationDirection].GetValue(); - if (direction.ToLower() == "vertical") - { - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].W = ((float)_StaticPointsBarDrawnPoints[p]) * - (_Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].W / CSettings.MaxScore); - } - else - { - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].H = ((float)_StaticPointsBarDrawnPoints[p]) * - (_Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].H / CSettings.MaxScore); - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].Y = _Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].H + - _Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].Y - - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].H; - } - } - } - } return true; } @@ -242,8 +213,6 @@ namespace Vocaluxe.Screens private void _BuildStaticStrings(ref List statics) { - _StaticPointsBar = new string[CSettings.MaxNumPlayer,CSettings.MaxNumPlayer]; - _StaticPointsBarBG = new string[CSettings.MaxNumPlayer,CSettings.MaxNumPlayer]; _StaticAvatar = new string[CSettings.MaxNumPlayer,CSettings.MaxNumPlayer]; for (int numplayer = 0; numplayer < CSettings.MaxNumPlayer; numplayer++) @@ -253,17 +222,31 @@ namespace Vocaluxe.Screens if (player > numplayer) continue; string target = "P" + (player + 1) + "N" + (numplayer + 1); - _StaticPointsBarBG[player, numplayer] = "StaticPointsBarBG" + target; - _StaticPointsBar[player, numplayer] = "StaticPointsBar" + target; _StaticAvatar[player, numplayer] = "StaticAvatar" + target; - statics.Add(_StaticPointsBarBG[player, numplayer]); - statics.Add(_StaticPointsBar[player, numplayer]); statics.Add(_StaticAvatar[player, numplayer]); } } } + private void _BuildProgressBarString(ref List progressBars) + { + _ProgressBarPoints = new string[CSettings.MaxNumPlayer, CSettings.MaxNumPlayer]; + + for (int numplayer = 0; numplayer < CSettings.MaxNumPlayer; numplayer++) + { + for (int player = 0; player < CSettings.MaxNumPlayer; player++) + { + if (player > numplayer) + continue; + string target = "P" + (player + 1) + "N" + (numplayer + 1); + _ProgressBarPoints[player, numplayer] = "ProgressBarPoints" + target; + + progressBars.Add(_ProgressBarPoints[player, numplayer]); + } + } + } + private void _UpdateRatings() { CSong song = null; @@ -296,7 +279,6 @@ namespace Vocaluxe.Screens players[p].Points = (int)Math.Round(players[p].Points / CGame.NumRounds); } - var pointAnimDirection = (string)_ScreenSettings[_ScreenSettingAnimationDirection].GetValue(); for (int p = 0; p < players.Length; p++) { string name = CProfiles.GetPlayerName(players[p].ProfileID, p); @@ -326,43 +308,11 @@ namespace Vocaluxe.Screens else _Texts[_TextRatings[p, CGame.NumPlayers - 1]].Text = CLanguage.Translate(_GetRating((int)Math.Round(players[p].Points))); - _StaticPointsBarDrawnPoints[p] = 0.0; - if (pointAnimDirection.ToLower() == "vertical") - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].W = 0; - else - { - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].H = 0; - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].Y = _Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].H + - _Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].Y - - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].H; - } + _ProgressBars[_ProgressBarPoints[p, CGame.NumPlayers - 1]].Progress = (float)players[p].Points / CSettings.MaxScore; + if (CProfiles.IsProfileIDValid(players[p].ProfileID)) _Statics[_StaticAvatar[p, CGame.NumPlayers - 1]].Texture = CProfiles.GetAvatarTextureFromProfile(players[p].ProfileID); } - - if (CConfig.Config.Game.ScoreAnimationTime < 1) - { - for (int p = 0; p < CGame.NumPlayers; p++) - { - if (pointAnimDirection.ToLower() == "vertical") - { - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].W = ((float)players[p].Points) * - (_Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].W / CSettings.MaxScore); - } - else - { - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].H = ((float)players[p].Points) * - (_Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].H / CSettings.MaxScore); - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].Y = _Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].H + - _Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].Y - - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].H; - } - _StaticPointsBarDrawnPoints[p] = players[p].Points; - } - } - - _Timer = new Stopwatch(); - _Timer.Start(); } private void _SetVisibility() @@ -377,8 +327,8 @@ namespace Vocaluxe.Screens _Texts[_TextScores[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayers; _Texts[_TextRatings[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayers; _Texts[_TextDifficulty[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayers; - _Statics[_StaticPointsBar[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayers; - _Statics[_StaticPointsBarBG[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayers; + _ProgressBars[_ProgressBarPoints[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayers; + _ProgressBars[_ProgressBarPoints[player, numplayer]].Reset(true); _Statics[_StaticAvatar[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayers; _Statics[_StaticAvatar[player, numplayer]].Texture = null; diff --git a/VocaluxeLib/Menu/CProgressBar.cs b/VocaluxeLib/Menu/CProgressBar.cs index 8c6de2f0..5f68766e 100644 --- a/VocaluxeLib/Menu/CProgressBar.cs +++ b/VocaluxeLib/Menu/CProgressBar.cs @@ -121,10 +121,19 @@ namespace VocaluxeLib.Menu public float Progress { get { return _ProgressTarget; } - set { _ProgressTarget = value; } + set + { + //Animation is still running, so use current state for calculations + if(_ProgressCurrent != _ProgressTarget) + { + _ProgressLast = _ProgressCurrent; + _ColorProgressLast = _ColorProgressCurrent; + } + _ProgressTarget = value; + } } private float _ProgressCurrent; - private float _ProgressLast = -1f; + private float _ProgressLast; private SColorF _ColorProgressCurrent; private SColorF _ColorProgressTarget; @@ -139,6 +148,7 @@ namespace VocaluxeLib.Menu private Stopwatch _AnimTimer; private float _AnimDuration; + private bool _Animate; public CProgressBar(int partyModeID) { @@ -187,9 +197,9 @@ namespace VocaluxeLib.Menu return false; } - public void Reset() + public void Reset(bool animateInit = false) { - _ProgressLast = -1; + _Animate = animateInit; } public void Draw() @@ -214,8 +224,6 @@ namespace VocaluxeLib.Menu if (Reflection) CBase.Drawing.DrawTextureReflection(_TextureBackground, Rect, color, Rect, ReflectionSpace, ReflectionHeight); } - else - CBase.Drawing.DrawRect(ColorBackground, Rect); //Draw progress if (_TextureProgressBegin != null) @@ -224,8 +232,6 @@ namespace VocaluxeLib.Menu if (Reflection) CBase.Drawing.DrawTextureReflection(_TextureProgressBegin, _RectProgressBegin, _ColorProgressCurrent, _RectProgressBegin, ReflectionSpace, ReflectionHeight); } - else - CBase.Drawing.DrawRect(_ColorProgressCurrent, _RectProgressBegin); if (_TextureProgressMid != null) { @@ -242,8 +248,6 @@ namespace VocaluxeLib.Menu if (Reflection) CBase.Drawing.DrawTextureReflection(_TextureProgressEnd, _RectProgressEnd, _ColorProgressCurrent, _RectProgressEnd, ReflectionSpace, ReflectionHeight); } - else - CBase.Drawing.DrawRect(_ColorProgressCurrent, _RectProgressEnd); //Draw foreground color = new SColorF(ColorForeground.R, ColorForeground.G, ColorForeground.B, ColorForeground.A * Alpha); @@ -253,8 +257,6 @@ namespace VocaluxeLib.Menu if (Reflection) CBase.Drawing.DrawTextureReflection(_TextureForeground, Rect, color, Rect, ReflectionSpace, ReflectionHeight); } - else - CBase.Drawing.DrawRect(ColorForeground, Rect); } if (Selected && (CBase.Settings.GetProgramState() == EProgramState.EditTheme)) @@ -302,14 +304,13 @@ namespace VocaluxeLib.Menu if (_ProgressCurrent == _ProgressTarget) return; - if (_ProgressLast != -1) + if (_Animate) _CheckAnimation(); + else + _ProgressCurrent = _ProgressLast = _ProgressTarget; _UpdateProgressColor(); - if (_ProgressLast == -1) - _ProgressCurrent = _ProgressLast = _ProgressTarget; - _UpdateProgressLeft(); _UpdateProgressMid(); _UpdateProgressRight(); @@ -342,6 +343,8 @@ namespace VocaluxeLib.Menu _ProgressLast = _ProgressCurrent = _ProgressTarget; _ColorProgressLast = _ColorProgressCurrent = _ColorProgressTarget; } + + _Animate = true; } private void _UpdateProgressColor() @@ -350,7 +353,7 @@ namespace VocaluxeLib.Menu if (col.From < _ProgressTarget) col.Color.Get(_PartyModeID, out _ColorProgressTarget); - if(_ProgressLast != -1 && _Theme.AnimateColoring == EOffOn.TR_CONFIG_ON) + if(_Animate && _Theme.AnimateColoring == EOffOn.TR_CONFIG_ON) { float animFactor = (_AnimTimer.ElapsedMilliseconds / _AnimDuration).Clamp(0, 1); @@ -369,22 +372,34 @@ namespace VocaluxeLib.Menu { case EDirection.Right: _TextureProgressBegin = TextureProgressLeft; - _RectProgressBegin = new SRectF(Rect.X, Rect.Y, Rect.H * _TextureProgressBegin.OrigAspect, Rect.H, Rect.Z); + if (_TextureProgressBegin == null) + _RectProgressBegin = new SRectF(Rect.X, Rect.Y, 0, 0, Rect.Z); + else + _RectProgressBegin = new SRectF(Rect.X, Rect.Y, Rect.H * _TextureProgressBegin.OrigAspect, Rect.H, Rect.Z); break; case EDirection.Up: _TextureProgressBegin = TextureProgressRight; - _RectProgressBegin = new SRectF(Rect.X, Rect.Y + Rect.H - Rect.W * _TextureProgressBegin.OrigAspect, Rect.W, Rect.W * _TextureProgressBegin.OrigAspect, Rect.Z); + if (_TextureProgressBegin == null) + _RectProgressBegin = new SRectF(Rect.X, Rect.Y + Rect.H, 0, 0, Rect.Z); + else + _RectProgressBegin = new SRectF(Rect.X, Rect.Y + Rect.H - Rect.W * _TextureProgressBegin.OrigAspect, Rect.W, Rect.W * _TextureProgressBegin.OrigAspect, Rect.Z); break; case EDirection.Left: _TextureProgressBegin = TextureProgressRight; - _RectProgressBegin = new SRectF(Rect.X + Rect.W - Rect.H * _TextureProgressBegin.OrigAspect, Rect.Y, Rect.H *_TextureProgressBegin.OrigAspect, Rect.H, Rect.Z); + if (_TextureProgressBegin == null) + _RectProgressBegin = new SRectF(Rect.X + Rect.W, Rect.Y, 0, 0, Rect.Z); + else + _RectProgressBegin = new SRectF(Rect.X + Rect.W - Rect.H * _TextureProgressBegin.OrigAspect, Rect.Y, Rect.H *_TextureProgressBegin.OrigAspect, Rect.H, Rect.Z); break; case EDirection.Down: _TextureProgressBegin = TextureProgressLeft; - _RectProgressBegin = new SRectF(Rect.X, Rect.Y, Rect.W, Rect.W * _TextureProgressBegin.OrigAspect, Rect.Z); + if (_TextureProgressBegin == null) + _RectProgressBegin = new SRectF(Rect.X, Rect.Y, 0, 0, Rect.Z); + else + _RectProgressBegin = new SRectF(Rect.X, Rect.Y, Rect.W, Rect.W * _TextureProgressBegin.OrigAspect, Rect.Z); break; } } @@ -419,22 +434,34 @@ namespace VocaluxeLib.Menu { case EDirection.Right: _TextureProgressEnd = _TextureProgressRight; - _RectProgressEnd = new SRectF(_RectProgressMid.X + _RectProgressMid.W, Rect.Y, Rect.H * _TextureProgressBegin.OrigAspect, Rect.H, Rect.Z); + if (_TextureProgressEnd == null) + _RectProgressEnd = new SRectF(_RectProgressMid.X + _RectProgressMid.W, Rect.Y, 0, 0, Rect.Z); + else + _RectProgressEnd = new SRectF(_RectProgressMid.X + _RectProgressMid.W, Rect.Y, Rect.H * _TextureProgressBegin.OrigAspect, Rect.H, Rect.Z); break; case EDirection.Up: _TextureProgressEnd = _TextureProgressLeft; - _RectProgressEnd = new SRectF(Rect.X, _RectProgressMid.Y + Rect.W, Rect.W, Rect.W * _TextureProgressBegin.OrigAspect, Rect.Z); + if (_TextureProgressEnd == null) + _RectProgressEnd = new SRectF(Rect.X, _RectProgressMid.Y + Rect.W, 0, 0, Rect.Z); + else + _RectProgressEnd = new SRectF(Rect.X, _RectProgressMid.Y + Rect.W, Rect.W, Rect.W * _TextureProgressBegin.OrigAspect, Rect.Z); break; case EDirection.Left: _TextureProgressEnd = _TextureProgressLeft; - _RectProgressEnd = new SRectF(_RectProgressMid.X - Rect.H, Rect.Y, Rect.H * _TextureProgressBegin.OrigAspect, Rect.H, Rect.Z); + if (_TextureProgressEnd == null) + _RectProgressEnd = new SRectF(_RectProgressMid.X - Rect.H, Rect.Y, 0, 0, Rect.Z); + else + _RectProgressEnd = new SRectF(_RectProgressMid.X - Rect.H, Rect.Y, Rect.H * _TextureProgressBegin.OrigAspect, Rect.H, Rect.Z); break; case EDirection.Down: _TextureProgressEnd = _TextureProgressRight; - _RectProgressEnd = new SRectF(Rect.X, _RectProgressMid.Y + _RectProgressMid.H, Rect.W, Rect.W * _TextureProgressBegin.OrigAspect, Rect.Z); + if (_TextureProgressEnd == null) + _RectProgressEnd = new SRectF(Rect.X, _RectProgressMid.Y + _RectProgressMid.H, 0, 0, Rect.Z); + else + _RectProgressEnd = new SRectF(Rect.X, _RectProgressMid.Y + _RectProgressMid.H, Rect.W, Rect.W * _TextureProgressBegin.OrigAspect, Rect.Z); break; } }