Added possibility to choose duet-part on Name-Selection. Added new tags: #P1 and #P2.

This commit is contained in:
Florian Kuepper committed 2012-08-04 13:55:57 +02:00
1 parent 4d6bac2e2b
commit 9fda9eb06e
7 files changed
+587 -10

No files matched your search

+1 -1
View File
@@ -256,7 +256,7 @@ namespace Vocaluxe.GameModes
public virtual CSong GetSong(int Num)
{
if (Num - 1 < _SongQueque.Count)
if (Num - 1 < _SongQueque.Count && Num - 1 > -1)
return CSongs.GetSong(_SongQueque[Num - 1].SongID);
return null;
+28
View File
@@ -99,6 +99,9 @@ namespace Vocaluxe.Lib.Song
public float Gap = 0f;
public float VideoGap = 0f;
public string DuetPart1 = String.Empty;
public string DuetPart2 = String.Empty;
public List<string> Comment = new List<string>();
// Sorting
@@ -254,6 +257,18 @@ namespace Vocaluxe.Lib.Song
this.ArtistSorting = Value;
}
break;
case "P1":
if (Value != String.Empty)
{
this.DuetPart1 = Value;
}
break;
case "P2":
if (Value != String.Empty)
{
this.DuetPart2 = Value;
}
break;
case "MP3":
if (File.Exists(Path.Combine(this.Folder, Value)))
{
@@ -366,6 +381,19 @@ namespace Vocaluxe.Lib.Song
this.TitleSorting = this.Title;
}
//Check if Duet-Tags are set
if (IsDuet)
{
if (DuetPart1 == String.Empty)
{
DuetPart1 = "Part 1";
}
if (DuetPart2 == String.Empty)
{
DuetPart2 = "Part 2";
}
}
return true;
}
+4 -4
View File
@@ -581,14 +581,14 @@ namespace Vocaluxe.Menu
public void ProcessMouseMove(int x, int y)
{
_ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y);
_ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y);
_ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y) && _Selection > 0;
_ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y) && _Selection < _ValueNames.Count - 1;
}
public void ProcessMouseLBClick(int x, int y)
{
_ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y);
_ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y);
_ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y) && _Selection > 0;
_ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y) && _Selection < _ValueNames.Count - 1;
if (_ArrowLeftSelected)
PrevValue();
@@ -1,10 +1,31 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Vocaluxe.Base;
using Vocaluxe.Lib.Draw;
using Vocaluxe.Lib.Song;
namespace Vocaluxe.Menu.SongMenu
{
class CSongMenuDreidel : CSongMenuFramework
{
private SRectF _ScrollRect;
private CStatic _DuetIcon;
private CStatic _VideoIcon;
private CText _Artist;
private CText _Title;
private CText _SongLength;
private int _actualSelection = -1;
public override int GetActualSelection()
{
return _actualSelection;
}
}
}
+26 -2
View File
@@ -30,6 +30,7 @@ namespace Vocaluxe.Screens
private readonly string[] StaticPlayerAvatar = new string[] { "StaticPlayerAvatar1", "StaticPlayerAvatar2", "StaticPlayerAvatar3", "StaticPlayerAvatar4", "StaticPlayerAvatar5", "StaticPlayerAvatar6" };
private readonly string[] TextPlayer = new string[] { "TextPlayer1", "TextPlayer2", "TextPlayer3", "TextPlayer4", "TextPlayer5", "TextPlayer6" };
private readonly string[] EqualizerPlayer = new string[] { "EqualizerPlayer1", "EqualizerPlayer2", "EqualizerPlayer3", "EqualizerPlayer4", "EqualizerPlayer5", "EqualizerPlayer6" };
private readonly string[] SelectSlideDuetPlayer = new string[] { "SelectSlideDuetPlayer1", "SelectSlideDuetPlayer2", "SelectSlideDuetPlayer3", "SelectSlideDuetPlayer4", "SelectSlideDuetPlayer5", "SelectSlideDuetPlayer6" };
private STexture[] OriginalPlayerAvatarTextures = new STexture[CSettings.MaxNumPlayer];
private bool selectingMouseActive = false;
@@ -65,8 +66,9 @@ namespace Vocaluxe.Screens
_ThemeStatics = statics.ToArray();
List<string> texts = new List<string>();
_ThemeSelectSlides = new string[] { SelectSlidePlayerNumber };
texts.Add(SelectSlidePlayerNumber);
texts.AddRange(SelectSlideDuetPlayer);
_ThemeSelectSlides = texts.ToArray();
texts.Clear();
texts.Add(TextWarningMics);
@@ -585,6 +587,21 @@ namespace Vocaluxe.Screens
Statics[htStatics(StaticPlayerAvatar[i])].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture;
Texts[htTexts(TextPlayer[i])].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName;
}
if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet)
{
if (i + 1 <= CGame.NumPlayer)
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = true;
else
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = false;
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].AddValue(CGame.GetSong(1).DuetPart1);
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].AddValue(CGame.GetSong(1).DuetPart2);
if ((i + 1) % 2 == 0)
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].SetSelectionByValueIndex(1);
else
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].SetSelectionByValueIndex(0);
}
else
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = false;
}
SetInteractionToButton(Buttons[htButtons(ButtonStart)]);
@@ -629,6 +646,10 @@ namespace Vocaluxe.Screens
CGame.Player[i].Name = "";
}
}
if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet)
{
CGame.Player[i].LineNr = SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Selection;
}
}
CGraphics.FadeTo(EScreens.ScreenSing);
@@ -660,6 +681,8 @@ namespace Vocaluxe.Screens
Texts[htTexts("TextPlayer" + i)].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + i.ToString();
}
Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = true;
if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet)
SelectSlides[htSelectSlides("SelectSlideDuetPlayer" + i)].Visible = true;
}
else
{
@@ -667,6 +690,7 @@ namespace Vocaluxe.Screens
Statics[htStatics("StaticPlayerAvatar" + i)].Visible = false;
Texts[htTexts("TextPlayer" + i)].Visible = false;
Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = false;
SelectSlides[htSelectSlides("SelectSlideDuetPlayer" + i)].Visible = false;
}
}
CConfig.SaveConfig();
+21 -3
View File
@@ -523,6 +523,12 @@ namespace Vocaluxe.Screens
_FinishTime = song.Finish;
_TimeToFirstNote = 0f;
_TimeToFirstNoteDuet = 0f;
//Save duet-assignment before resetting
int[] duet_player = new int[CGame.NumPlayer];
for (int i = 0; i < duet_player.Length; i++)
{
duet_player[i] = CGame.Player[i].LineNr;
}
CGame.ResetPlayer();
CDraw.RemoveTexture(ref _CurrentVideoTexture);
@@ -542,10 +548,22 @@ namespace Vocaluxe.Screens
bool LyricsOnTop = (CGame.NumPlayer != 1) && CConfig.LyricsOnTop == EOffOn.TR_CONFIG_ON;
if (song.IsDuet)
{
for (int i = 1; i <= CGame.NumPlayer; i = i + 2)
{
//More than one song: Player is not assigned to line by user
//Otherwise, this is done by CScreenNames
if (CGame.GetNumSongs() > 1)
{
CGame.Player[i].LineNr = 1;
for (int i = 1; i <= CGame.NumPlayer; i = i + 2)
{
CGame.Player[i].LineNr = 1;
}
}
else
{
for (int i = 0; i < CGame.NumPlayer; i++)
{
CGame.Player[i].LineNr = duet_player[i];
}
}
Statics[htStatics(StaticLyricsDuet)].Visible = true;
Lyrics[htLyrics(LyricMainDuet)].Visible = true;