Merge branch 'develop' into Font_Rewrite

This commit is contained in:
Flamefire committed 2013-04-30 19:47:35 +02:00
commit b54a4c3608
13 files changed
+286 -91

No files matched your search

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<ScreenOptionsLyrics> <ScreenOptionsLyrics>
<ScreenVersion>1</ScreenVersion> <ScreenVersion>2</ScreenVersion>
<Background1> <Background1>
<!--<Type>: Background type: None, Color, Texture, Video--> <!--<Type>: Background type: None, Color, Texture, Video-->
<Type>Video</Type> <Type>Video</Type>
@@ -111,7 +111,7 @@
<!--<Font>: Text font name--> <!--<Font>: Text font name-->
<Font>Outline</Font> <Font>Outline</Font>
<!--<Text>: Nothing or translation tag--> <!--<Text>: Nothing or translation tag-->
<Text>TR_SCREENOLYRICS_ONTOP</Text> <Text>TR_SCREENOLYRICS_POSITION</Text>
<!--<Reflection> If exists:--> <!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space--> <!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height--> <!-- <Height>: Reflection Height-->
@@ -240,7 +240,7 @@
<!--<NumVisible>: Number of visible elements in the slide--> <!--<NumVisible>: Number of visible elements in the slide-->
<NumVisible>4</NumVisible> <NumVisible>4</NumVisible>
</SelectSlideLyricStyle> </SelectSlideLyricStyle>
<SelectSlideLyricsOnTop> <SelectSlideLyricsPosition>
<!--<Skin>: Texture name--> <!--<Skin>: Texture name-->
<Skin>Invisible</Skin> <Skin>Invisible</Skin>
<!--<SkinArrowLeft>: Texture name of left arrow--> <!--<SkinArrowLeft>: Texture name of left arrow-->
@@ -306,6 +306,6 @@
<TextStyle>Bold</TextStyle> <TextStyle>Bold</TextStyle>
<!--<NumVisible>: Number of visible elements in the slide--> <!--<NumVisible>: Number of visible elements in the slide-->
<NumVisible>2</NumVisible> <NumVisible>2</NumVisible>
</SelectSlideLyricsOnTop> </SelectSlideLyricsPosition>
</ScreenOptionsLyrics> </ScreenOptionsLyrics>
</root> </root>
@@ -1,5 +1,7 @@
ScreenOptionsSound ScreenOptionsSound
++++++++++
Version 2:
Rename <SelectSlideLyricsOnTop> to <SelectSlideLyricsPosition>
++++++++++ ++++++++++
Version 1: Version 1:
+4 -4
View File
@@ -94,7 +94,7 @@ namespace Vocaluxe.Base
public static int NumPlayer = 2; public static int NumPlayer = 2;
public static EOffOn Tabs = EOffOn.TR_CONFIG_OFF; public static EOffOn Tabs = EOffOn.TR_CONFIG_OFF;
public static string Language = "English"; public static string Language = "English";
public static EOffOn LyricsOnTop = EOffOn.TR_CONFIG_OFF; public static ELyricsPosition LyricsPosition = ELyricsPosition.TR_CONFIG_LYRICSPOSITION_BOTTOM;
public static readonly string[] Players = new string[CSettings.MaxNumPlayer]; public static readonly string[] Players = new string[CSettings.MaxNumPlayer];
public static float MinLineBreakTime = 0.1f; //Minimum time to show the text before it is (to be) sung (if possible) public static float MinLineBreakTime = 0.1f; //Minimum time to show the text before it is (to be) sung (if possible)
@@ -222,7 +222,7 @@ namespace Vocaluxe.Base
xmlReader.TryGetIntValue("//root/Game/NumPlayer", ref NumPlayer); xmlReader.TryGetIntValue("//root/Game/NumPlayer", ref NumPlayer);
xmlReader.TryGetEnumValue("//root/Game/Tabs", ref Tabs); xmlReader.TryGetEnumValue("//root/Game/Tabs", ref Tabs);
xmlReader.GetValue("//root/Game/Language", out Language, Language); xmlReader.GetValue("//root/Game/Language", out Language, Language);
xmlReader.TryGetEnumValue("//root/Game/LyricsOnTop", ref LyricsOnTop); xmlReader.TryGetEnumValue("//root/Game/LyricsOnTop", ref LyricsPosition);
xmlReader.TryGetFloatValue("//root/Game/MinLineBreakTime", ref MinLineBreakTime); xmlReader.TryGetFloatValue("//root/Game/MinLineBreakTime", ref MinLineBreakTime);
if ((ScoreAnimationTime > 0 && ScoreAnimationTime < 1) || ScoreAnimationTime < 0) if ((ScoreAnimationTime > 0 && ScoreAnimationTime < 1) || ScoreAnimationTime < 0)
@@ -461,8 +461,8 @@ namespace Vocaluxe.Base
writer.WriteComment("Order songs in tabs: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn)))); writer.WriteComment("Order songs in tabs: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("Tabs", Enum.GetName(typeof(EOffOn), Tabs)); writer.WriteElementString("Tabs", Enum.GetName(typeof(EOffOn), Tabs));
writer.WriteComment("Lyrics also on Top of screen: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn)))); writer.WriteComment("Lyrics also on Top of screen: " + CHelper.ListStrings(Enum.GetNames(typeof(ELyricsPosition))));
writer.WriteElementString("LyricsOnTop", Enum.GetName(typeof(EOffOn), LyricsOnTop)); writer.WriteElementString("LyricsOnTop", Enum.GetName(typeof(ELyricsPosition), LyricsPosition));
writer.WriteComment("MinLineBreakTime: Value >= 0 in s. Minimum time the text is shown before it is to be sung"); writer.WriteComment("MinLineBreakTime: Value >= 0 in s. Minimum time the text is shown before it is to be sung");
writer.WriteElementString("MinLineBreakTime", MinLineBreakTime.ToString()); writer.WriteElementString("MinLineBreakTime", MinLineBreakTime.ToString());
+1 -1
View File
@@ -255,7 +255,7 @@ namespace Vocaluxe.Screens
if (points.NumRounds > 1) if (points.NumRounds > 1)
_Texts[_TextSongName].Text += " (" + (_Round + 1) + "/" + points.NumRounds + ")"; _Texts[_TextSongName].Text += " (" + (_Round + 1) + "/" + points.NumRounds + ")";
switch (CGame.GetGameMode(_Round)) switch (CGame.GetGameMode(_Round + 1))
{ {
case EGameMode.TR_GAMEMODE_NORMAL: case EGameMode.TR_GAMEMODE_NORMAL:
_Texts[_TextSongMode].Text = "TR_GAMEMODE_NORMAL"; _Texts[_TextSongMode].Text = "TR_GAMEMODE_NORMAL";
+206 -48
View File
@@ -56,9 +56,10 @@ namespace Vocaluxe.Screens
private readonly STexture[] _OriginalPlayerAvatarTextures = new STexture[CSettings.MaxNumPlayer]; private readonly STexture[] _OriginalPlayerAvatarTextures = new STexture[CSettings.MaxNumPlayer];
private bool _SelectingKeyboardActive; private bool _SelectingKeyboardActive;
private bool _SelectingKeyboardUnendless; private bool _SelectingFast;
private int _SelectingKeyboardPlayerNr; private int _SelectingSwitchNr = -1;
private int _SelectedPlayerNr; private int _SelectingFastPlayerNr = 0;
private int _SelectedPlayerNr = -1;
public override void Init() public override void Init()
{ {
@@ -137,16 +138,17 @@ namespace Vocaluxe.Screens
case Keys.P: case Keys.P:
if (!_SelectingKeyboardActive) if (!_SelectingKeyboardActive)
{ {
_SelectingKeyboardPlayerNr = 1; _SelectingFastPlayerNr = 1;
_SelectingKeyboardUnendless = true; _SelectingFast = true;
_ResetPlayerSelections();
} }
else else
{ {
if (_SelectingKeyboardPlayerNr + 1 <= CGame.NumPlayer) if (_SelectingFastPlayerNr + 1 <= CGame.NumPlayer)
_SelectingKeyboardPlayerNr++; _SelectingFastPlayerNr++;
else else
_SelectingKeyboardPlayerNr = 1; _SelectingFastPlayerNr = 1;
_NameSelections[_NameSelection].KeyboardSelection(true, _SelectingKeyboardPlayerNr); _NameSelections[_NameSelection].FastSelection(true, _SelectingFastPlayerNr);
} }
break; break;
} }
@@ -165,13 +167,13 @@ namespace Vocaluxe.Screens
{ {
_SelectedPlayerNr = _NameSelections[_NameSelection].Selection; _SelectedPlayerNr = _NameSelections[_NameSelection].Selection;
//Update Game-infos with new player //Update Game-infos with new player
CGame.Players[_SelectingKeyboardPlayerNr - 1].ProfileID = _SelectedPlayerNr; CGame.Players[_SelectingFastPlayerNr - 1].ProfileID = _SelectedPlayerNr;
//Update config for default players. //Update config for default players.
CConfig.Players[_SelectingKeyboardPlayerNr - 1] = CProfiles.Profiles[_SelectedPlayerNr].ProfileFile; CConfig.Players[_SelectingFastPlayerNr - 1] = CProfiles.Profiles[_SelectedPlayerNr].ProfileFile;
CConfig.SaveConfig(); CConfig.SaveConfig();
//Update texture and name //Update texture and name
_Statics[_StaticPlayerAvatar[_SelectingKeyboardPlayerNr - 1]].Texture = CProfiles.Profiles[_SelectedPlayerNr].Avatar.Texture; _Statics[_StaticPlayerAvatar[_SelectingFastPlayerNr - 1]].Texture = CProfiles.Profiles[_SelectedPlayerNr].Avatar.Texture;
_Texts[_TextPlayer[_SelectingKeyboardPlayerNr - 1]].Text = CProfiles.Profiles[_SelectedPlayerNr].PlayerName; _Texts[_TextPlayer[_SelectingFastPlayerNr - 1]].Text = CProfiles.Profiles[_SelectedPlayerNr].PlayerName;
//Update profile-warning //Update profile-warning
_CheckPlayers(); _CheckPlayers();
//Update Tiles-List //Update Tiles-List
@@ -179,14 +181,14 @@ namespace Vocaluxe.Screens
_SetInteractionToButton(_Buttons[_ButtonStart]); _SetInteractionToButton(_Buttons[_ButtonStart]);
} }
//Started selecting with 'P' //Started selecting with 'P'
if (_SelectingKeyboardUnendless) if (_SelectingFast)
{ {
if (_SelectingKeyboardPlayerNr == CGame.NumPlayer) if (_SelectingFastPlayerNr == CGame.NumPlayer)
resetSelection = true; resetSelection = true;
else else
{ {
_SelectingKeyboardPlayerNr++; _SelectingFastPlayerNr++;
_NameSelections[_NameSelection].KeyboardSelection(true, _SelectingKeyboardPlayerNr); _NameSelections[_NameSelection].FastSelection(true, _SelectingFastPlayerNr);
} }
} }
else else
@@ -224,19 +226,19 @@ namespace Vocaluxe.Screens
case Keys.Delete: case Keys.Delete:
//Delete profile-selection //Delete profile-selection
CGame.Players[_SelectingKeyboardPlayerNr - 1].ProfileID = -1; CGame.Players[_SelectingFastPlayerNr - 1].ProfileID = -1;
//Update config for default players. //Update config for default players.
CConfig.Players[_SelectingKeyboardPlayerNr - 1] = String.Empty; CConfig.Players[_SelectingFastPlayerNr - 1] = String.Empty;
CConfig.SaveConfig(); CConfig.SaveConfig();
//Update texture and name //Update texture and name
_Statics[_StaticPlayerAvatar[_SelectingKeyboardPlayerNr - 1]].Texture = _OriginalPlayerAvatarTextures[_SelectingKeyboardPlayerNr - 1]; _Statics[_StaticPlayerAvatar[_SelectingFastPlayerNr - 1]].Texture = _OriginalPlayerAvatarTextures[_SelectingFastPlayerNr - 1];
_Texts[_TextPlayer[_SelectingKeyboardPlayerNr - 1]].Text = CProfiles.GetPlayerName(-1, _SelectingKeyboardPlayerNr); _Texts[_TextPlayer[_SelectingFastPlayerNr - 1]].Text = CProfiles.GetPlayerName(-1, _SelectingFastPlayerNr);
//Update profile-warning //Update profile-warning
_CheckPlayers(); _CheckPlayers();
//Reset all values //Reset all values
_SelectingKeyboardPlayerNr = 0; _SelectingFastPlayerNr = 0;
_SelectingKeyboardActive = false; _SelectingKeyboardActive = false;
_NameSelections[_NameSelection].KeyboardSelection(false, -1); _NameSelections[_NameSelection].FastSelection(false, -1);
//Update Tiles-List //Update Tiles-List
_NameSelections[_NameSelection].UpdateList(); _NameSelections[_NameSelection].UpdateList();
break; break;
@@ -244,32 +246,32 @@ namespace Vocaluxe.Screens
case Keys.F10: case Keys.F10:
if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet)
{ {
CSelectSlide selectSlideDuetPart = _SelectSlides[_SelectSlideDuetPlayer[_SelectingKeyboardPlayerNr - 1]]; CSelectSlide selectSlideDuetPart = _SelectSlides[_SelectSlideDuetPlayer[_SelectingFastPlayerNr - 1]];
selectSlideDuetPart.Selection = (selectSlideDuetPart.Selection + 1) % 2; selectSlideDuetPart.Selection = (selectSlideDuetPart.Selection + 1) % 2;
//Reset all values //Reset all values
_SelectingKeyboardPlayerNr = 0; _SelectingFastPlayerNr = 0;
_SelectingKeyboardActive = false; _SelectingKeyboardActive = false;
_SelectingKeyboardUnendless = false; _SelectingFast = false;
_NameSelections[_NameSelection].KeyboardSelection(false, -1); _NameSelections[_NameSelection].FastSelection(false, -1);
_SetInteractionToButton(_Buttons[_ButtonStart]); _SetInteractionToButton(_Buttons[_ButtonStart]);
} }
break; break;
} }
if (numberPressed > 0 || resetSelection) if (numberPressed > 0 || resetSelection)
{ {
if (numberPressed == _SelectingKeyboardPlayerNr || resetSelection) if (numberPressed == _SelectingFastPlayerNr || resetSelection)
{ {
//Reset all values //Reset all values
_SelectingKeyboardPlayerNr = 0; _SelectingFastPlayerNr = 0;
_SelectingKeyboardActive = false; _SelectingKeyboardActive = false;
_NameSelections[_NameSelection].KeyboardSelection(false, -1); _NameSelections[_NameSelection].FastSelection(false, -1);
} }
else if (numberPressed <= CConfig.NumPlayer) else if (numberPressed <= CConfig.NumPlayer)
{ {
_SelectingKeyboardPlayerNr = numberPressed; _SelectingFastPlayerNr = numberPressed;
_NameSelections[_NameSelection].KeyboardSelection(true, numberPressed); _NameSelections[_NameSelection].FastSelection(true, numberPressed);
} }
_SelectingKeyboardUnendless = false; _SelectingFast = false;
} }
} }
//Normal Keyboard handling //Normal Keyboard handling
@@ -294,32 +296,32 @@ namespace Vocaluxe.Screens
case Keys.D1: case Keys.D1:
case Keys.NumPad1: case Keys.NumPad1:
_SelectingKeyboardPlayerNr = 1; _SelectingFastPlayerNr = 1;
break; break;
case Keys.D2: case Keys.D2:
case Keys.NumPad2: case Keys.NumPad2:
_SelectingKeyboardPlayerNr = 2; _SelectingFastPlayerNr = 2;
break; break;
case Keys.D3: case Keys.D3:
case Keys.NumPad3: case Keys.NumPad3:
_SelectingKeyboardPlayerNr = 3; _SelectingFastPlayerNr = 3;
break; break;
case Keys.D4: case Keys.D4:
case Keys.NumPad4: case Keys.NumPad4:
_SelectingKeyboardPlayerNr = 4; _SelectingFastPlayerNr = 4;
break; break;
case Keys.D5: case Keys.D5:
case Keys.NumPad5: case Keys.NumPad5:
_SelectingKeyboardPlayerNr = 5; _SelectingFastPlayerNr = 5;
break; break;
case Keys.D6: case Keys.D6:
case Keys.NumPad6: case Keys.NumPad6:
_SelectingKeyboardPlayerNr = 6; _SelectingFastPlayerNr = 6;
break; break;
default: default:
_UpdatePlayerNumber(); _UpdatePlayerNumber();
@@ -327,10 +329,10 @@ namespace Vocaluxe.Screens
} }
if (_SelectingKeyboardPlayerNr > 0 && _SelectingKeyboardPlayerNr <= CConfig.NumPlayer) if (_SelectingFastPlayerNr > 0 && _SelectingFastPlayerNr <= CConfig.NumPlayer)
{ {
_SelectingKeyboardActive = true; _SelectingKeyboardActive = true;
_NameSelections[_NameSelection].KeyboardSelection(true, _SelectingKeyboardPlayerNr); _NameSelections[_NameSelection].FastSelection(true, _SelectingFastPlayerNr);
} }
} }
@@ -339,10 +341,15 @@ namespace Vocaluxe.Screens
public override bool HandleMouse(SMouseEvent mouseEvent) public override bool HandleMouse(SMouseEvent mouseEvent)
{ {
base.HandleMouse(mouseEvent); bool stopSelectingFast = false;
if (_SelectingFast)
_NameSelections[_NameSelection].HandleMouse(mouseEvent);
else
base.HandleMouse(mouseEvent);
//Check if LeftButton is hold and Select-Mode inactive //Check if LeftButton is hold and Select-Mode inactive
if (mouseEvent.LBH && _SelectedPlayerNr < 0) if (mouseEvent.LBH && _SelectedPlayerNr < 0 && !_SelectingFast)
{ {
//Save mouse-coords //Save mouse-coords
_OldMouseX = mouseEvent.X; _OldMouseX = mouseEvent.X;
@@ -363,10 +370,29 @@ namespace Vocaluxe.Screens
_ChooseAvatarStatic.Texture = selectedPlayer.Texture; _ChooseAvatarStatic.Texture = selectedPlayer.Texture;
} }
} }
else
{
for (int i = 0; i < CGame.NumPlayer; i++)
{
if (CHelper.IsInBounds(_Statics[_StaticPlayer[i]].Rect, mouseEvent))
{
_SelectingSwitchNr = i;
_SelectedPlayerNr = CGame.Players[i].ProfileID;
//Update of Drag/Drop-Texture
CStatic selectedPlayer = _Statics[_StaticPlayerAvatar[i]];
_ChooseAvatarStatic.Visible = true;
_ChooseAvatarStatic.Rect = selectedPlayer.Rect;
_ChooseAvatarStatic.Rect.Z = CSettings.ZNear;
_ChooseAvatarStatic.Color = new SColorF(1, 1, 1, 1);
_ChooseAvatarStatic.Texture = selectedPlayer.Texture;
break;
}
}
}
} }
//Check if LeftButton is hold and Select-Mode active //Check if LeftButton is hold and Select-Mode active
if (mouseEvent.LBH && _SelectedPlayerNr >= 0) if (mouseEvent.LBH && _SelectedPlayerNr >= 0 && !_SelectingFast)
{ {
//Update coords for Drag/Drop-Texture //Update coords for Drag/Drop-Texture
_ChooseAvatarStatic.Rect.X += mouseEvent.X - _OldMouseX; _ChooseAvatarStatic.Rect.X += mouseEvent.X - _OldMouseX;
@@ -374,8 +400,8 @@ namespace Vocaluxe.Screens
_OldMouseX = mouseEvent.X; _OldMouseX = mouseEvent.X;
_OldMouseY = mouseEvent.Y; _OldMouseY = mouseEvent.Y;
} }
// LeftButton isn't hold anymore, but Selec-Mode is still active -> "Drop" of Avatar // LeftButton isn't hold anymore, but Select-Mode is still active -> "Drop" of Avatar
else if (_SelectedPlayerNr >= 0) else if (_SelectedPlayerNr >= 0 && !_SelectingFast)
{ {
//Foreach Drop-Area //Foreach Drop-Area
for (int i = 0; i < _StaticPlayer.Length; i++) for (int i = 0; i < _StaticPlayer.Length; i++)
@@ -386,6 +412,26 @@ namespace Vocaluxe.Screens
//Check if Mouse is in area //Check if Mouse is in area
if (CHelper.IsInBounds(_Statics[_StaticPlayer[i]].Rect, mouseEvent)) if (CHelper.IsInBounds(_Statics[_StaticPlayer[i]].Rect, mouseEvent))
{ {
if (_SelectingSwitchNr > -1 && CGame.Players[i].ProfileID > -1)
{
//Update Game-infos with new player
CGame.Players[_SelectingSwitchNr].ProfileID = CGame.Players[i].ProfileID;
//Update config for default players.
CConfig.Players[_SelectingSwitchNr] = CProfiles.Profiles[i].ProfileFile;
//Update texture and name
_Statics[_StaticPlayerAvatar[_SelectingSwitchNr]].Texture = CProfiles.Profiles[CGame.Players[i].ProfileID].Avatar.Texture;
_Texts[_TextPlayer[_SelectingSwitchNr]].Text = CProfiles.Profiles[CGame.Players[i].ProfileID].PlayerName;
}
else if (_SelectingSwitchNr > -1)
{
//Update Game-infos with new player
CGame.Players[_SelectingSwitchNr].ProfileID = -1;
//Update config for default players.
CConfig.Players[_SelectingSwitchNr] = string.Empty;
//Update texture and name
_Statics[_StaticPlayerAvatar[_SelectingSwitchNr]].Texture = _OriginalPlayerAvatarTextures[_SelectingSwitchNr];
_Texts[_TextPlayer[_SelectingSwitchNr]].Text = CProfiles.GetPlayerName(-1, (_SelectingSwitchNr+1));
}
//Update Game-infos with new player //Update Game-infos with new player
CGame.Players[i].ProfileID = _SelectedPlayerNr; CGame.Players[i].ProfileID = _SelectedPlayerNr;
//Update config for default players. //Update config for default players.
@@ -398,14 +444,57 @@ namespace Vocaluxe.Screens
_CheckPlayers(); _CheckPlayers();
//Update Tiles-List //Update Tiles-List
_NameSelections[_NameSelection].UpdateList(); _NameSelections[_NameSelection].UpdateList();
break;
}
//Selected player is dropped out of area
else if (_SelectingSwitchNr > -1)
{
//Update Game-infos with new player
CGame.Players[_SelectingSwitchNr].ProfileID = -1;
//Update config for default players.
CConfig.Players[_SelectingSwitchNr] = string.Empty;
//Update texture and name
_Statics[_StaticPlayerAvatar[_SelectingSwitchNr]].Texture = _OriginalPlayerAvatarTextures[_SelectingSwitchNr];
_Texts[_TextPlayer[_SelectingSwitchNr]].Text = CProfiles.GetPlayerName(-1, (_SelectingSwitchNr + 1));
} }
} }
_SelectingSwitchNr = -1;
_SelectedPlayerNr = -1; _SelectedPlayerNr = -1;
//Reset variables //Reset variables
_ChooseAvatarStatic.Visible = false; _ChooseAvatarStatic.Visible = false;
} }
if (mouseEvent.LB && _IsMouseOver(mouseEvent)) if (mouseEvent.LB && _SelectingFast)
{
if (_NameSelections[_NameSelection].IsOverTile(mouseEvent))
{
//Get player-number of tile
_SelectedPlayerNr = _NameSelections[_NameSelection].TilePlayerNr(mouseEvent);
if (_SelectedPlayerNr != -1)
{
//Update Game-infos with new player
CGame.Players[_SelectingFastPlayerNr - 1].ProfileID = _SelectedPlayerNr;
//Update config for default players.
CConfig.Players[_SelectingFastPlayerNr - 1] = CProfiles.Profiles[_SelectedPlayerNr].ProfileFile;
CConfig.SaveConfig();
//Update texture and name
_Statics[_StaticPlayerAvatar[_SelectingFastPlayerNr - 1]].Texture = CProfiles.Profiles[_SelectedPlayerNr].Avatar.Texture;
_Texts[_TextPlayer[_SelectingFastPlayerNr - 1]].Text = CProfiles.Profiles[_SelectedPlayerNr].PlayerName;
//Update profile-warning
_CheckPlayers();
//Update Tiles-List
_NameSelections[_NameSelection].UpdateList();
_SelectingFastPlayerNr++;
if (_SelectingFastPlayerNr <= CGame.NumPlayer)
_NameSelections[_NameSelection].FastSelection(true, _SelectingFastPlayerNr);
else
stopSelectingFast = true;
}
else
stopSelectingFast = true;
}
}
else if (mouseEvent.LB && _IsMouseOver(mouseEvent))
{ {
if (_Buttons[_ButtonBack].Selected) if (_Buttons[_ButtonBack].Selected)
CGraphics.FadeTo(EScreens.ScreenSong); CGraphics.FadeTo(EScreens.ScreenSong);
@@ -417,7 +506,36 @@ namespace Vocaluxe.Screens
_NameSelections[_NameSelection].UpdateList(); _NameSelections[_NameSelection].UpdateList();
} }
if (mouseEvent.RB) if (mouseEvent.LD && _NameSelections[_NameSelection].IsOverTile(mouseEvent) && !_SelectingFast)
{
_SelectedPlayerNr = _NameSelections[_NameSelection].TilePlayerNr(mouseEvent);
if (_SelectedPlayerNr > -1)
{
for (int i = 0; i < CGame.NumPlayer; i++)
{
if (CGame.Players[i].ProfileID == -1)
{
//Update Game-infos with new player
CGame.Players[i].ProfileID = _SelectedPlayerNr;
//Update config for default players.
CConfig.Players[i] = CProfiles.Profiles[_SelectedPlayerNr].ProfileFile;
CConfig.SaveConfig();
//Update texture and name
_Statics[_StaticPlayerAvatar[i]].Texture = CProfiles.Profiles[_SelectedPlayerNr].Avatar.Texture;
_Texts[_TextPlayer[i]].Text = CProfiles.Profiles[_SelectedPlayerNr].PlayerName;
//Update profile-warning
_CheckPlayers();
//Update Tiles-List
_NameSelections[_NameSelection].UpdateList();
break;
}
}
}
}
if (mouseEvent.RB && _SelectingFast)
stopSelectingFast = true;
else if (mouseEvent.RB)
{ {
bool exit = true; bool exit = true;
//Remove profile-selection //Remove profile-selection
@@ -443,6 +561,23 @@ namespace Vocaluxe.Screens
CGraphics.FadeTo(EScreens.ScreenSong); CGraphics.FadeTo(EScreens.ScreenSong);
} }
if (mouseEvent.MB && _SelectingFast)
{
_SelectingFastPlayerNr++;
if (_SelectingFastPlayerNr <= CGame.NumPlayer)
_NameSelections[_NameSelection].FastSelection(true, _SelectingFastPlayerNr);
else
stopSelectingFast = true;
}
else if(mouseEvent.MB)
{
_ResetPlayerSelections();
_SelectingFast = true;
_SelectingFastPlayerNr = 1;
_SelectingKeyboardActive = true;
_NameSelections[_NameSelection].FastSelection(true, _SelectingFastPlayerNr);
}
//Check mouse-wheel for scrolling //Check mouse-wheel for scrolling
if (mouseEvent.Wheel != 0) if (mouseEvent.Wheel != 0)
{ {
@@ -452,6 +587,14 @@ namespace Vocaluxe.Screens
_NameSelections[_NameSelection].UpdateList(offset); _NameSelections[_NameSelection].UpdateList(offset);
} }
} }
if (stopSelectingFast)
{
_SelectingFast = false;
_SelectingFastPlayerNr = 0;
_SelectingKeyboardActive = false;
_NameSelections[_NameSelection].FastSelection(false, -1);
}
return true; return true;
} }
@@ -565,6 +708,21 @@ namespace Vocaluxe.Screens
_CheckPlayers(); _CheckPlayers();
} }
private void _ResetPlayerSelections()
{
for (int i = 0; i < CGame.NumPlayer; i++)
{
CGame.Players[i].ProfileID = -1;
//Update config for default players.
CConfig.Players[i] = String.Empty;
//Update texture and name
_Statics[_StaticPlayerAvatar[i]].Texture = _OriginalPlayerAvatarTextures[i];
_Texts[_TextPlayer[i]].Text = CProfiles.GetPlayerName(-1, i + 1);
}
_NameSelections[_NameSelection].UpdateList();
CConfig.SaveConfig();
}
private void _CheckMics() private void _CheckMics()
{ {
List<int> playerWithoutMicro = new List<int>(); List<int> playerWithoutMicro = new List<int>();
+5 -5
View File
@@ -28,11 +28,11 @@ 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 1; } get { return 2; }
} }
private const string _SelectSlideLyricStyle = "SelectSlideLyricStyle"; private const string _SelectSlideLyricStyle = "SelectSlideLyricStyle";
private const string _SelectSlideLyricsOnTop = "SelectSlideLyricsOnTop"; private const string _SelectSlideLyricsPosition = "SelectSlideLyricsPosition";
private const string _ButtonExit = "ButtonExit"; private const string _ButtonExit = "ButtonExit";
@@ -41,14 +41,14 @@ namespace Vocaluxe.Screens
base.Init(); base.Init();
_ThemeButtons = new string[] {_ButtonExit}; _ThemeButtons = new string[] {_ButtonExit};
_ThemeSelectSlides = new string[] {_SelectSlideLyricStyle, _SelectSlideLyricsOnTop}; _ThemeSelectSlides = new string[] {_SelectSlideLyricStyle, _SelectSlideLyricsPosition};
} }
public override void LoadTheme(string xmlPath) public override void LoadTheme(string xmlPath)
{ {
base.LoadTheme(xmlPath); base.LoadTheme(xmlPath);
_SelectSlides[_SelectSlideLyricStyle].SetValues<ELyricStyle>((int)CConfig.LyricStyle); _SelectSlides[_SelectSlideLyricStyle].SetValues<ELyricStyle>((int)CConfig.LyricStyle);
_SelectSlides[_SelectSlideLyricsOnTop].SetValues<EOffOn>((int)CConfig.LyricsOnTop); _SelectSlides[_SelectSlideLyricsPosition].SetValues<ELyricsPosition>((int)CConfig.LyricsPosition);
} }
public override bool HandleInput(SKeyEvent keyEvent) public override bool HandleInput(SKeyEvent keyEvent)
@@ -122,7 +122,7 @@ namespace Vocaluxe.Screens
private void _SaveConfig() private void _SaveConfig()
{ {
CConfig.LyricsOnTop = (EOffOn)_SelectSlides[_SelectSlideLyricsOnTop].Selection; CConfig.LyricsPosition = (ELyricsPosition)_SelectSlides[_SelectSlideLyricsPosition].Selection;
CConfig.LyricStyle = (ELyricStyle)_SelectSlides[_SelectSlideLyricStyle].Selection; CConfig.LyricStyle = (ELyricStyle)_SelectSlides[_SelectSlideLyricStyle].Selection;
CConfig.SaveConfig(); CConfig.SaveConfig();
} }
+6 -7
View File
@@ -180,6 +180,12 @@ namespace Vocaluxe.Screens
_Texts[_TextError].Text = "TR_SCREENPARTY_ERROR"; _Texts[_TextError].Text = "TR_SCREENPARTY_ERROR";
_Texts[_TextError].Visible = true; _Texts[_TextError].Visible = true;
} }
else if (CConfig.GetMaxNumMics() == 0)
{
_Buttons[_ButtonStart].Visible = false;
_Texts[_TextError].Text = "TR_SCREENPARTY_ERROR_MICS";
_Texts[_TextError].Visible = true;
}
else else
{ {
_Buttons[_ButtonStart].Visible = true; _Buttons[_ButtonStart].Visible = true;
@@ -198,13 +204,6 @@ namespace Vocaluxe.Screens
_Buttons[_ButtonStart].Visible = false; _Buttons[_ButtonStart].Visible = false;
_Texts[_TextError].Text = "TR_SCREENPARTY_ERROR"; _Texts[_TextError].Text = "TR_SCREENPARTY_ERROR";
_Texts[_TextError].Visible = true; _Texts[_TextError].Visible = true;
}
if (CConfig.GetMaxNumMics() == 0)
{
_Buttons[_ButtonStart].Visible = false;
_Texts[_TextError].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_MICS_PL").Replace("%v", "");
_Texts[_TextError].Visible = true;
return; return;
} }
+2 -4
View File
@@ -314,11 +314,9 @@ namespace Vocaluxe.Screens
{ {
if (_Snapshot == null) if (_Snapshot == null)
CWebcam.GetFrame(ref _WebcamTexture); CWebcam.GetFrame(ref _WebcamTexture);
_Statics[_StaticAvatar].Texture = _WebcamTexture;
RectangleF bounds = new RectangleF(_WebcamTexture.Rect.X, _WebcamTexture.Rect.Y, _WebcamTexture.Rect.W, _WebcamTexture.Rect.H); _Statics[_StaticAvatar].Aspect = EAspect.Crop;
RectangleF rect = new RectangleF(0f, 0f, _WebcamTexture.Rect.W, _WebcamTexture.Rect.H); _Statics[_StaticAvatar].Texture = _WebcamTexture;
CHelper.SetRect(bounds, out rect, rect.Width / rect.Height, EAspect.Crop);
} }
else else
_Statics[_StaticAvatar].Texture = CProfiles.Avatars[avatarNr].Texture; _Statics[_StaticAvatar].Texture = CProfiles.Avatars[avatarNr].Texture;
+27 -13
View File
@@ -651,6 +651,7 @@ namespace Vocaluxe.Screens
} }
} }
_SetDuetLyricsVisibility(song.IsDuet); _SetDuetLyricsVisibility(song.IsDuet);
_SetNormalLyricsVisibility();
for (int p = 0; p < CGame.NumPlayer; p++) for (int p = 0; p < CGame.NumPlayer; p++)
_NoteLines[p] = _SingNotes[_SingBars].AddPlayer(_SingNotes[_SingBars].BarPos[p, CGame.NumPlayer - 1], CTheme.GetPlayerColor(p + 1), p); _NoteLines[p] = _SingNotes[_SingBars].AddPlayer(_SingNotes[_SingBars].BarPos[p, CGame.NumPlayer - 1], CTheme.GetPlayerColor(p + 1), p);
@@ -690,13 +691,23 @@ namespace Vocaluxe.Screens
} }
else else
{ {
bool lyricsOnTop = (CGame.NumPlayer != 1) && CConfig.LyricsOnTop == EOffOn.TR_CONFIG_ON; bool lyricsOnTop = CConfig.LyricsPosition == ELyricsPosition.TR_CONFIG_LYRICSPOSITION_TOP
|| CConfig.LyricsPosition == ELyricsPosition.TR_CONFIG_LYRICSPOSITION_BOTH
|| (CConfig.LyricsPosition == ELyricsPosition.TR_CONFIG_LYRICSPOSITION_DYNAMIC && (CGame.NumPlayer > 2 && CGame.NumPlayer != 4));
_Lyrics[_LyricMainTop].Visible = lyricsOnTop; _Lyrics[_LyricMainTop].Visible = lyricsOnTop;
_Lyrics[_LyricSubTop].Visible = lyricsOnTop; _Lyrics[_LyricSubTop].Visible = lyricsOnTop;
_Statics[_StaticLyricsTop].Visible = lyricsOnTop; _Statics[_StaticLyricsTop].Visible = lyricsOnTop;
} }
} }
private void _SetNormalLyricsVisibility()
{
bool visible = CConfig.LyricsPosition != ELyricsPosition.TR_CONFIG_LYRICSPOSITION_TOP;
_Lyrics[_LyricMain].Visible = visible;
_Lyrics[_LyricSub].Visible = visible;
_Statics[_StaticLyrics].Visible = visible;
}
private void _StartSong() private void _StartSong()
{ {
_PrepareTimeLine(); _PrepareTimeLine();
@@ -1001,27 +1012,30 @@ namespace Vocaluxe.Screens
if (time > totaltime) if (time > totaltime)
time = totaltime; time = totaltime;
SRectF rect = _Statics[_StaticLyricHelper].Rect; if (_Statics[_StaticLyrics].Visible)
SColorF color = new SColorF( {
_Statics[_StaticLyricHelper].Color.R, SRectF rect = _Statics[_StaticLyricHelper].Rect;
_Statics[_StaticLyricHelper].Color.G, SColorF color = new SColorF(
_Statics[_StaticLyricHelper].Color.B, _Statics[_StaticLyricHelper].Color.R,
_Statics[_StaticLyricHelper].Color.A * _Statics[_StaticLyricHelper].Alpha * alpha); _Statics[_StaticLyricHelper].Color.G,
_Statics[_StaticLyricHelper].Color.B,
_Statics[_StaticLyricHelper].Color.A * _Statics[_StaticLyricHelper].Alpha * alpha);
float distance = _Lyrics[_LyricMain].GetCurrentLyricPosX() - rect.X - rect.W; float distance = _Lyrics[_LyricMain].GetCurrentLyricPosX() - rect.X - rect.W;
CDraw.DrawTexture(_Statics[_StaticLyricHelper].Texture, CDraw.DrawTexture(_Statics[_StaticLyricHelper].Texture,
new SRectF(rect.X + distance * (1f - time / totaltime), rect.Y, rect.W, rect.H, rect.Z), color); new SRectF(rect.X + distance * (1f - time / totaltime), rect.Y, rect.W, rect.H, rect.Z), color);
}
if (_Statics[_StaticLyricsTop].Visible) if (_Statics[_StaticLyricsTop].Visible)
{ {
rect = _Statics[_StaticLyricHelperTop].Rect; SRectF rect = _Statics[_StaticLyricHelperTop].Rect;
color = new SColorF( SColorF color = new SColorF(
_Statics[_StaticLyricHelperTop].Color.R, _Statics[_StaticLyricHelperTop].Color.R,
_Statics[_StaticLyricHelperTop].Color.G, _Statics[_StaticLyricHelperTop].Color.G,
_Statics[_StaticLyricHelperTop].Color.B, _Statics[_StaticLyricHelperTop].Color.B,
_Statics[_StaticLyricHelperTop].Color.A * _Statics[_StaticLyricHelper].Alpha * alpha); _Statics[_StaticLyricHelperTop].Color.A * _Statics[_StaticLyricHelper].Alpha * alpha);
distance = _Lyrics[_LyricMainTop].GetCurrentLyricPosX() - rect.X - rect.W; float distance = _Lyrics[_LyricMainTop].GetCurrentLyricPosX() - rect.X - rect.W;
CDraw.DrawTexture(_Statics[_StaticLyricHelperTop].Texture, CDraw.DrawTexture(_Statics[_StaticLyricHelperTop].Texture,
new SRectF(rect.X + distance * (1f - time / totaltime), rect.Y, rect.W, rect.H, rect.Z), color); new SRectF(rect.X + distance * (1f - time / totaltime), rect.Y, rect.W, rect.H, rect.Z), color);
} }
+1 -1
View File
@@ -1196,7 +1196,7 @@ namespace Vocaluxe.Screens
private void _OpenPlaylist(int playlistID) private void _OpenPlaylist(int playlistID)
{ {
if (CPlaylists.Playlists.Length > playlistID && playlistID >= 0) if (CPlaylists.Playlists.Length > playlistID && playlistID >= 0 && _Playlists[_Playlist].ActivePlaylistID != playlistID)
{ {
_Playlists[_Playlist].LoadPlaylist(playlistID); _Playlists[_Playlist].LoadPlaylist(playlistID);
_SongMenus[_SongMenu].SetSmallView(true); _SongMenus[_SongMenu].SetSmallView(true);
+17 -1
View File
@@ -346,7 +346,23 @@ namespace VocaluxeLib.Menu
Selection = -1; Selection = -1;
} }
public void KeyboardSelection(bool active, int player) public void HandleMouse(SMouseEvent mevent)
{
for (int i = 0; i < _Tiles.Count; i++ )
{
if (CHelper.IsInBounds(_Tiles[i].Avatar.Rect, mevent))
{
_ActualSelection = i;
if (Offset * _Tiles.Count + _ActualSelection < _VisibleProfiles.Count)
Selection = _VisibleProfiles[Offset * _Tiles.Count + _ActualSelection];
else
Selection = -1;
}
}
}
public void FastSelection(bool active, int player)
{ {
//Overwrite player-selection; Same profile, but other player //Overwrite player-selection; Same profile, but other player
if (active && Selection != -1) if (active && Selection != -1)
+1 -1
View File
@@ -1138,8 +1138,8 @@ namespace VocaluxeLib.Menu
{ {
if (playlistID > -1 && playlistID < CBase.Playlist.GetNumPlaylists()) if (playlistID > -1 && playlistID < CBase.Playlist.GetNumPlaylists())
{ {
_Theme.ButtonPlaylistName.Text.Text = CBase.Playlist.GetPlaylistName(ActivePlaylistID);
ActivePlaylistID = playlistID; ActivePlaylistID = playlistID;
_Theme.ButtonPlaylistName.Text.Text = CBase.Playlist.GetPlaylistName(ActivePlaylistID);
_PlaylistElementContents.Clear(); _PlaylistElementContents.Clear();
for (int i = 0; i < CBase.Playlist.GetPlaylistSongCount(ActivePlaylistID); i++) for (int i = 0; i < CBase.Playlist.GetPlaylistSongCount(ActivePlaylistID); i++)
{ {
+8
View File
@@ -272,6 +272,14 @@ namespace VocaluxeLib.Menu
// ReSharper restore InconsistentNaming // ReSharper restore InconsistentNaming
} }
public enum ELyricsPosition
{
TR_CONFIG_LYRICSPOSITION_BOTTOM,
TR_CONFIG_LYRICSPOSITION_TOP,
TR_CONFIG_LYRICSPOSITION_BOTH,
TR_CONFIG_LYRICSPOSITION_DYNAMIC
}
public enum ELyricStyle public enum ELyricStyle
{ {
Fill, Fill,