diff --git a/Output/Themes/Changelog/Changelog_ScreenSing.txt b/Output/Themes/Changelog/Changelog_ScreenSing.txt index 3d735b97..0a87c825 100644 --- a/Output/Themes/Changelog/Changelog_ScreenSing.txt +++ b/Output/Themes/Changelog/Changelog_ScreenSing.txt @@ -1,5 +1,11 @@ ScreenSing ++++++++++ +Version 9 + +Add: + + +++++++++ Version 8 diff --git a/Output/Themes/Genius/01_Standard.xml b/Output/Themes/Genius/01_Standard.xml index d0daa747..7b5571aa 100644 --- a/Output/Themes/Genius/01_Standard.xml +++ b/Output/Themes/Genius/01_Standard.xml @@ -316,6 +316,7 @@ VolUp.png VolDown.png RandomIcon.png + RatingBar.png PopupBG.png ScrollUp.png ScrollDown.png @@ -331,4 +332,4 @@ IntroMid.mp4 IntroOut.mp4 - \ No newline at end of file + diff --git a/Output/Themes/Genius/02_Ice_Blue.xml b/Output/Themes/Genius/02_Ice_Blue.xml index c2d71ec4..176242b1 100644 --- a/Output/Themes/Genius/02_Ice_Blue.xml +++ b/Output/Themes/Genius/02_Ice_Blue.xml @@ -316,6 +316,7 @@ VolUp.png VolDown.png RandomIcon.png + RatingBar.png PopupBG.png ScrollUp.png ScrollDown.png @@ -331,4 +332,4 @@ IntroMid.mp4 IntroOut.mp4 - \ No newline at end of file + diff --git a/Output/Themes/Genius/03_Crimson_Red.xml b/Output/Themes/Genius/03_Crimson_Red.xml index 87f0b965..b7c8a237 100644 --- a/Output/Themes/Genius/03_Crimson_Red.xml +++ b/Output/Themes/Genius/03_Crimson_Red.xml @@ -316,6 +316,7 @@ VolUp.png VolDown.png RandomIcon.png + RatingBar.png PopupBG.png ScrollUp.png ScrollDown.png @@ -331,4 +332,4 @@ IntroMid.mp4 IntroOut.mp4 - \ No newline at end of file + diff --git a/Output/Themes/Genius/RatingBar.png b/Output/Themes/Genius/RatingBar.png new file mode 100644 index 00000000..e2c9ad41 Binary files /dev/null and b/Output/Themes/Genius/RatingBar.png differ diff --git a/Output/Themes/Genius/Screens/ScreenSing.xml b/Output/Themes/Genius/Screens/ScreenSing.xml index 6213c368..4a14d583 100644 --- a/Output/Themes/Genius/Screens/ScreenSing.xml +++ b/Output/Themes/Genius/Screens/ScreenSing.xml @@ -2,7 +2,7 @@ ScreenSing - 8 + 9 @@ -174,6 +174,17 @@ 50 -0.75 + + + RatingBar + + + 1085 + 410 + 160 + 10 + -0.75 + @@ -196,6 +207,17 @@ 50 -0.75 + + + RatingBar + + + 1085 + 170 + 160 + 10 + -0.75 + @@ -218,6 +240,17 @@ 50 -0.75 + + + RatingBar + + + 1085 + 430 + 160 + 10 + -0.75 + @@ -241,6 +274,17 @@ -0.75 + + RatingBar + + + 1155 + 135 + 85 + 7 + -0.75 + + @@ -263,6 +307,17 @@ -0.75 + + RatingBar + + + 1155 + 305 + 85 + 7 + -0.75 + + @@ -285,6 +340,17 @@ -0.75 + + RatingBar + + + 1155 + 475 + 85 + 7 + -0.75 + + @@ -307,6 +373,17 @@ -0.75 + + RatingBar + + + 471 + 170 + 160 + 10 + -0.75 + + @@ -329,6 +406,17 @@ -0.75 + + RatingBar + + + 471 + 430 + 160 + 10 + -0.75 + + @@ -344,13 +432,24 @@ - 1150 + 1085 150 100 50 -0.75 + + RatingBar + + + 1105 + 170 + 160 + 10 + -0.75 + + @@ -373,6 +472,17 @@ -0.75 + + RatingBar + + + 1105 + 430 + 160 + 10 + -0.75 + + @@ -395,6 +505,17 @@ -0.75 + + RatingBar + + + 540 + 135 + 85 + 7 + -0.75 + + @@ -417,6 +538,17 @@ -0.75 + + RatingBar + + + 540 + 305 + 85 + 7 + -0.75 + + @@ -439,6 +571,17 @@ -0.75 + + RatingBar + + + 540 + 475 + 85 + 7 + -0.75 + + @@ -461,6 +604,17 @@ -0.75 + + RatingBar + + + 1175 + 135 + 85 + 7 + -0.75 + + @@ -483,6 +637,17 @@ -0.75 + + RatingBar + + + 1175 + 305 + 85 + 7 + -0.75 + + @@ -505,6 +670,17 @@ -0.75 + + RatingBar + + + 540 + 135 + 85 + 7 + -0.75 + + @@ -527,6 +703,17 @@ -0.75 + + RatingBar + + + 540 + 305 + 85 + 7 + -0.75 + + @@ -549,6 +736,17 @@ -0.75 + + RatingBar + + + 540 + 475 + 85 + 7 + -0.75 + + @@ -571,6 +769,17 @@ -0.75 + + RatingBar + + + 1175 + 135 + 85 + 7 + -0.75 + + @@ -593,6 +802,17 @@ -0.75 + + RatingBar + + + 1175 + 305 + 85 + 7 + -0.75 + + @@ -615,6 +835,17 @@ -0.75 + + RatingBar + + + 1175 + 475 + 85 + 7 + -0.75 + + diff --git a/Vocaluxe/Base/CGame.cs b/Vocaluxe/Base/CGame.cs index 4e4a7b21..baddbf11 100644 --- a/Vocaluxe/Base/CGame.cs +++ b/Vocaluxe/Base/CGame.cs @@ -367,9 +367,9 @@ namespace Vocaluxe.Base Players[p].SungLines[line].BonusPoints += points; //Calculate rating - double stretchFactor = 0.2; + //Shift fraction of correct sung notes to [-0.1, 0.1], player needs to sing five lines fully correctly to get highest ranking double current = Players[p].SungLines[line].Points / (double)lines[line].Points; - Players[p].Rating = (Players[p].Rating + (current * stretchFactor - 0.1)).Clamp(0, 1); + Players[p].Rating = (Players[p].Rating + (current * 0.2 - 0.1)).Clamp(0, 1); } } } diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 0ec56ba1..45dc2baa 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -38,7 +38,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 8; } + get { return 9; } } private struct STimeRect @@ -73,6 +73,7 @@ namespace Vocaluxe.Screens private string[,] _StaticScores; private string[,] _StaticAvatars; + private string[,] _StaticRatingBars; private const string _ButtonCancel = "ButtonCancel"; private const string _ButtonContinue = "ButtonContinue"; @@ -303,12 +304,14 @@ namespace Vocaluxe.Screens _UpdateSongText(); _UpdateDuetNames(); + if (_FadeOut) return true; _UpdateTimeLine(); CGame.UpdatePoints(_CurrentTime); + _UpdateRatingBars(); _UpdateLyrics(); if (CGame.GameMode == EGameMode.TR_GAMEMODE_MEDLEY) _UpdateMedleyCountdown(); @@ -783,6 +786,7 @@ namespace Vocaluxe.Screens } } + private void _TogglePause() { _SetPause(!_Pause); @@ -826,8 +830,9 @@ namespace Vocaluxe.Screens private void _BuildStaticStrings(ref List statics) { - _StaticScores = new string[CSettings.MaxNumPlayer,CSettings.MaxNumPlayer]; - _StaticAvatars = new string[CSettings.MaxNumPlayer,CSettings.MaxNumPlayer]; + _StaticScores = new string[CSettings.MaxNumPlayer, CSettings.MaxNumPlayer]; + _StaticAvatars = new string[CSettings.MaxNumPlayer, CSettings.MaxNumPlayer]; + _StaticRatingBars = new string[CSettings.MaxNumPlayer, CSettings.MaxNumPlayer]; for (int numplayer = 0; numplayer < CSettings.MaxNumPlayer; numplayer++) { @@ -838,9 +843,11 @@ namespace Vocaluxe.Screens string target = "P" + (player + 1) + "N" + (numplayer + 1); _StaticScores[player, numplayer] = "StaticScore" + target; _StaticAvatars[player, numplayer] = "StaticAvatar" + target; + _StaticRatingBars[player, numplayer] = "StaticRatingBar" + target; statics.Add(_StaticScores[player, numplayer]); statics.Add(_StaticAvatars[player, numplayer]); + statics.Add(_StaticRatingBars[player, numplayer]); } } } @@ -890,15 +897,16 @@ namespace Vocaluxe.Screens { for (int player = 0; player < CSettings.MaxNumPlayer && player <= numplayer; player++) { - bool isIvisible = numplayer + 1 == CGame.NumPlayers && player <= CGame.NumPlayers; - _Texts[_TextScores[player, numplayer]].Visible = isIvisible; - _Texts[_TextNames[player, numplayer]].Visible = isIvisible && + bool isVisible = numplayer + 1 == CGame.NumPlayers && player <= CGame.NumPlayers; + _Texts[_TextScores[player, numplayer]].Visible = isVisible; + _Texts[_TextNames[player, numplayer]].Visible = isVisible && (CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH || CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_NAME); - _Statics[_StaticScores[player, numplayer]].Visible = isIvisible; - _Statics[_StaticAvatars[player, numplayer]].Visible = isIvisible && + _Statics[_StaticScores[player, numplayer]].Visible = isVisible; + _Statics[_StaticAvatars[player, numplayer]].Visible = isVisible && (CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH || CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_AVATAR); + _Statics[_StaticRatingBars[player, numplayer]].Visible = isVisible; } } @@ -1371,5 +1379,13 @@ namespace Vocaluxe.Screens _Texts[_TextNames[i, CGame.NumPlayers - 1]].Visible = false; } } + + private void _UpdateRatingBars() + { + for (int i = 0; i < CGame.NumPlayers; i++) + { + _Statics[_StaticRatingBars[i, CGame.NumPlayers - 1]].ModW = _Statics[_StaticRatingBars[i, CGame.NumPlayers - 1]].Rect.W * (float)CGame.Players[i].Rating; + } + } } } \ No newline at end of file diff --git a/VocaluxeLib/Menu/CStatic.cs b/VocaluxeLib/Menu/CStatic.cs index c655ddab..9f7ca429 100644 --- a/VocaluxeLib/Menu/CStatic.cs +++ b/VocaluxeLib/Menu/CStatic.cs @@ -69,6 +69,15 @@ namespace VocaluxeLib.Menu public EAspect Aspect = EAspect.Stretch; + /// + /// Adjust this value if you want to draw only a part of your texture, width + /// + public float ModW = -1f; + /// + /// Adjust this value if you want to draw only a part of your texture, height + /// + public float ModH = -1f; + public CStatic(int partyModeID) { _PartyModeID = partyModeID; @@ -168,8 +177,21 @@ namespace VocaluxeLib.Menu { CTextureRef texture = Texture; SRectF bounds = Rect.Scale(scale); + + //Change bounds if rect size should be modified without adjusting texture + if (ModH != -1) + bounds.H = ModH * scale; + if (ModW != -1) + bounds.W = ModW * scale; + bounds.Z += zModify; + SRectF rect = texture == null ? bounds : CHelper.FitInBounds(bounds, texture.OrigAspect, aspect); + + //Use original rect + if (ModH != -1 || ModW != -1) + rect = Rect.Scale(scale); + var color = new SColorF(Color.R, Color.G, Color.B, Color.A * Alpha); if (Visible || forceDraw || (CBase.Settings.GetProgramState() == EProgramState.EditTheme)) {