Show rating bar in singscreen

This commit is contained in:
Florian Küpper committed 2017-09-03 00:52:21 +02:00
1 parent ce4c3db025
commit cb4dfdabba
9 files changed
+293 -15

No files matched your search

@@ -1,5 +1,11 @@
ScreenSing ScreenSing
+++++++++
Version 9
Add:
<StaticRatingBar$P$N$>
+++++++++ +++++++++
Version 8 Version 8
+2 -1
View File
@@ -316,6 +316,7 @@
<VolUp>VolUp.png</VolUp> <VolUp>VolUp.png</VolUp>
<VolDown>VolDown.png</VolDown> <VolDown>VolDown.png</VolDown>
<Random>RandomIcon.png</Random> <Random>RandomIcon.png</Random>
<RatingBar>RatingBar.png</RatingBar>
<PopupBG>PopupBG.png</PopupBG> <PopupBG>PopupBG.png</PopupBG>
<ScrollUp>ScrollUp.png</ScrollUp> <ScrollUp>ScrollUp.png</ScrollUp>
<ScrollDown>ScrollDown.png</ScrollDown> <ScrollDown>ScrollDown.png</ScrollDown>
@@ -331,4 +332,4 @@
<IntroMid>IntroMid.mp4</IntroMid> <IntroMid>IntroMid.mp4</IntroMid>
<IntroOut>IntroOut.mp4</IntroOut> <IntroOut>IntroOut.mp4</IntroOut>
</Videos> </Videos>
</root> </root>
+2 -1
View File
@@ -316,6 +316,7 @@
<VolUp>VolUp.png</VolUp> <VolUp>VolUp.png</VolUp>
<VolDown>VolDown.png</VolDown> <VolDown>VolDown.png</VolDown>
<Random>RandomIcon.png</Random> <Random>RandomIcon.png</Random>
<RatingBar>RatingBar.png</RatingBar>
<PopupBG>PopupBG.png</PopupBG> <PopupBG>PopupBG.png</PopupBG>
<ScrollUp>ScrollUp.png</ScrollUp> <ScrollUp>ScrollUp.png</ScrollUp>
<ScrollDown>ScrollDown.png</ScrollDown> <ScrollDown>ScrollDown.png</ScrollDown>
@@ -331,4 +332,4 @@
<IntroMid>IntroMid.mp4</IntroMid> <IntroMid>IntroMid.mp4</IntroMid>
<IntroOut>IntroOut.mp4</IntroOut> <IntroOut>IntroOut.mp4</IntroOut>
</Videos> </Videos>
</root> </root>
+2 -1
View File
@@ -316,6 +316,7 @@
<VolUp>VolUp.png</VolUp> <VolUp>VolUp.png</VolUp>
<VolDown>VolDown.png</VolDown> <VolDown>VolDown.png</VolDown>
<Random>RandomIcon.png</Random> <Random>RandomIcon.png</Random>
<RatingBar>RatingBar.png</RatingBar>
<PopupBG>PopupBG.png</PopupBG> <PopupBG>PopupBG.png</PopupBG>
<ScrollUp>ScrollUp.png</ScrollUp> <ScrollUp>ScrollUp.png</ScrollUp>
<ScrollDown>ScrollDown.png</ScrollDown> <ScrollDown>ScrollDown.png</ScrollDown>
@@ -331,4 +332,4 @@
<IntroMid>IntroMid.mp4</IntroMid> <IntroMid>IntroMid.mp4</IntroMid>
<IntroOut>IntroOut.mp4</IntroOut> <IntroOut>IntroOut.mp4</IntroOut>
</Videos> </Videos>
</root> </root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

+233 -2
View File
@@ -2,7 +2,7 @@
<Screen xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Screen xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Informations> <Informations>
<ScreenName>ScreenSing</ScreenName> <ScreenName>ScreenSing</ScreenName>
<ScreenVersion>8</ScreenVersion> <ScreenVersion>9</ScreenVersion>
</Informations> </Informations>
<Backgrounds> <Backgrounds>
<Background Name="Background1"> <Background Name="Background1">
@@ -174,6 +174,17 @@
<H>50</H> <H>50</H>
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static>
<Static Name="StaticRatingBarP1N1">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>1085</X>
<Y>410</Y>
<W>160</W>
<H>10</H>
<Z>-0.75</Z>
</Rect>
</Static> </Static>
<Static Name="StaticAvatarP1N1"> <Static Name="StaticAvatarP1N1">
<Skin/> <Skin/>
@@ -196,6 +207,17 @@
<H>50</H> <H>50</H>
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static>
<Static Name="StaticRatingBarP1N2">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>1085</X>
<Y>170</Y>
<W>160</W>
<H>10</H>
<Z>-0.75</Z>
</Rect>
</Static> </Static>
<Static Name="StaticAvatarP1N2"> <Static Name="StaticAvatarP1N2">
<Skin/> <Skin/>
@@ -218,6 +240,17 @@
<H>50</H> <H>50</H>
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static>
<Static Name="StaticRatingBarP2N2">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>1085</X>
<Y>430</Y>
<W>160</W>
<H>10</H>
<Z>-0.75</Z>
</Rect>
</Static> </Static>
<Static Name="StaticAvatarP2N2"> <Static Name="StaticAvatarP2N2">
<Skin/> <Skin/>
@@ -241,6 +274,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP1N3">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>1155</X>
<Y>135</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP1N3"> <Static Name="StaticAvatarP1N3">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -263,6 +307,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP2N3">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>1155</X>
<Y>305</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP2N3"> <Static Name="StaticAvatarP2N3">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -285,6 +340,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP3N3">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>1155</X>
<Y>475</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP3N3"> <Static Name="StaticAvatarP3N3">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -307,6 +373,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP1N4">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>471</X>
<Y>170</Y>
<W>160</W>
<H>10</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP1N4"> <Static Name="StaticAvatarP1N4">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -329,6 +406,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP2N4">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>471</X>
<Y>430</Y>
<W>160</W>
<H>10</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP2N4"> <Static Name="StaticAvatarP2N4">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -344,13 +432,24 @@
<Skin/> <Skin/>
<Color Name="Invisible" /> <Color Name="Invisible" />
<Rect> <Rect>
<X>1150</X> <X>1085</X>
<Y>150</Y> <Y>150</Y>
<W>100</W> <W>100</W>
<H>50</H> <H>50</H>
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP3N4">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>1105</X>
<Y>170</Y>
<W>160</W>
<H>10</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP3N4"> <Static Name="StaticAvatarP3N4">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -373,6 +472,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP4N4">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>1105</X>
<Y>430</Y>
<W>160</W>
<H>10</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP4N4"> <Static Name="StaticAvatarP4N4">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -395,6 +505,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP1N5">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>540</X>
<Y>135</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP1N5"> <Static Name="StaticAvatarP1N5">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -417,6 +538,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP2N5">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>540</X>
<Y>305</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP2N5"> <Static Name="StaticAvatarP2N5">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -439,6 +571,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP3N5">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>540</X>
<Y>475</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP3N5"> <Static Name="StaticAvatarP3N5">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -461,6 +604,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP4N5">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>1175</X>
<Y>135</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP4N5"> <Static Name="StaticAvatarP4N5">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -483,6 +637,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP5N5">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>1175</X>
<Y>305</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP5N5"> <Static Name="StaticAvatarP5N5">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -505,6 +670,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP1N6">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>540</X>
<Y>135</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP1N6"> <Static Name="StaticAvatarP1N6">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -527,6 +703,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP2N6">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>540</X>
<Y>305</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP2N6"> <Static Name="StaticAvatarP2N6">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -549,6 +736,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP3N6">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>540</X>
<Y>475</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP3N6"> <Static Name="StaticAvatarP3N6">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -571,6 +769,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP4N6">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>1175</X>
<Y>135</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP4N6"> <Static Name="StaticAvatarP4N6">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -593,6 +802,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP5N6">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>1175</X>
<Y>305</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP5N6"> <Static Name="StaticAvatarP5N6">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
@@ -615,6 +835,17 @@
<Z>-0.75</Z> <Z>-0.75</Z>
</Rect> </Rect>
</Static> </Static>
<Static Name="StaticRatingBarP6N6">
<Skin>RatingBar</Skin>
<Color Name="Visible" />
<Rect>
<X>1175</X>
<Y>475</Y>
<W>85</W>
<H>7</H>
<Z>-0.75</Z>
</Rect>
</Static>
<Static Name="StaticAvatarP6N6"> <Static Name="StaticAvatarP6N6">
<Skin/> <Skin/>
<Color Name="StaticAvatarColor" /> <Color Name="StaticAvatarColor" />
+2 -2
View File
@@ -367,9 +367,9 @@ namespace Vocaluxe.Base
Players[p].SungLines[line].BonusPoints += points; Players[p].SungLines[line].BonusPoints += points;
//Calculate rating //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; 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);
} }
} }
} }
+24 -8
View File
@@ -38,7 +38,7 @@ namespace Vocaluxe.Screens
// Version number for theme files. Increment it, if you've changed something on the theme files! // Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion protected override int _ScreenVersion
{ {
get { return 8; } get { return 9; }
} }
private struct STimeRect private struct STimeRect
@@ -73,6 +73,7 @@ namespace Vocaluxe.Screens
private string[,] _StaticScores; private string[,] _StaticScores;
private string[,] _StaticAvatars; private string[,] _StaticAvatars;
private string[,] _StaticRatingBars;
private const string _ButtonCancel = "ButtonCancel"; private const string _ButtonCancel = "ButtonCancel";
private const string _ButtonContinue = "ButtonContinue"; private const string _ButtonContinue = "ButtonContinue";
@@ -303,12 +304,14 @@ namespace Vocaluxe.Screens
_UpdateSongText(); _UpdateSongText();
_UpdateDuetNames(); _UpdateDuetNames();
if (_FadeOut) if (_FadeOut)
return true; return true;
_UpdateTimeLine(); _UpdateTimeLine();
CGame.UpdatePoints(_CurrentTime); CGame.UpdatePoints(_CurrentTime);
_UpdateRatingBars();
_UpdateLyrics(); _UpdateLyrics();
if (CGame.GameMode == EGameMode.TR_GAMEMODE_MEDLEY) if (CGame.GameMode == EGameMode.TR_GAMEMODE_MEDLEY)
_UpdateMedleyCountdown(); _UpdateMedleyCountdown();
@@ -783,6 +786,7 @@ namespace Vocaluxe.Screens
} }
} }
private void _TogglePause() private void _TogglePause()
{ {
_SetPause(!_Pause); _SetPause(!_Pause);
@@ -826,8 +830,9 @@ namespace Vocaluxe.Screens
private void _BuildStaticStrings(ref List<string> statics) private void _BuildStaticStrings(ref List<string> statics)
{ {
_StaticScores = new string[CSettings.MaxNumPlayer,CSettings.MaxNumPlayer]; _StaticScores = new string[CSettings.MaxNumPlayer, CSettings.MaxNumPlayer];
_StaticAvatars = 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++) for (int numplayer = 0; numplayer < CSettings.MaxNumPlayer; numplayer++)
{ {
@@ -838,9 +843,11 @@ namespace Vocaluxe.Screens
string target = "P" + (player + 1) + "N" + (numplayer + 1); string target = "P" + (player + 1) + "N" + (numplayer + 1);
_StaticScores[player, numplayer] = "StaticScore" + target; _StaticScores[player, numplayer] = "StaticScore" + target;
_StaticAvatars[player, numplayer] = "StaticAvatar" + target; _StaticAvatars[player, numplayer] = "StaticAvatar" + target;
_StaticRatingBars[player, numplayer] = "StaticRatingBar" + target;
statics.Add(_StaticScores[player, numplayer]); statics.Add(_StaticScores[player, numplayer]);
statics.Add(_StaticAvatars[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++) for (int player = 0; player < CSettings.MaxNumPlayer && player <= numplayer; player++)
{ {
bool isIvisible = numplayer + 1 == CGame.NumPlayers && player <= CGame.NumPlayers; bool isVisible = numplayer + 1 == CGame.NumPlayers && player <= CGame.NumPlayers;
_Texts[_TextScores[player, numplayer]].Visible = isIvisible; _Texts[_TextScores[player, numplayer]].Visible = isVisible;
_Texts[_TextNames[player, numplayer]].Visible = isIvisible && _Texts[_TextNames[player, numplayer]].Visible = isVisible &&
(CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH || (CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH ||
CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_NAME); CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_NAME);
_Statics[_StaticScores[player, numplayer]].Visible = isIvisible; _Statics[_StaticScores[player, numplayer]].Visible = isVisible;
_Statics[_StaticAvatars[player, numplayer]].Visible = isIvisible && _Statics[_StaticAvatars[player, numplayer]].Visible = isVisible &&
(CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH || (CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH ||
CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_AVATAR); 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; _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;
}
}
} }
} }
+22
View File
@@ -69,6 +69,15 @@ namespace VocaluxeLib.Menu
public EAspect Aspect = EAspect.Stretch; public EAspect Aspect = EAspect.Stretch;
/// <summary>
/// Adjust this value if you want to draw only a part of your texture, width
/// </summary>
public float ModW = -1f;
/// <summary>
/// Adjust this value if you want to draw only a part of your texture, height
/// </summary>
public float ModH = -1f;
public CStatic(int partyModeID) public CStatic(int partyModeID)
{ {
_PartyModeID = partyModeID; _PartyModeID = partyModeID;
@@ -168,8 +177,21 @@ namespace VocaluxeLib.Menu
{ {
CTextureRef texture = Texture; CTextureRef texture = Texture;
SRectF bounds = Rect.Scale(scale); 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; bounds.Z += zModify;
SRectF rect = texture == null ? bounds : CHelper.FitInBounds(bounds, texture.OrigAspect, aspect); 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); var color = new SColorF(Color.R, Color.G, Color.B, Color.A * Alpha);
if (Visible || forceDraw || (CBase.Settings.GetProgramState() == EProgramState.EditTheme)) if (Visible || forceDraw || (CBase.Settings.GetProgramState() == EProgramState.EditTheme))
{ {