Removed code redundancies
This commit is contained in:
1 parent
5cd47f0537
commit
ec766aa7b5
25 files changed
+145
-243
No files matched your search
@@ -711,14 +711,13 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
if (_Fields[_Possibilities[i, j]].Content.Winner > 0)
|
if (_Fields[_Possibilities[i, j]].Content.Winner > 0)
|
||||||
check.Add(_Fields[_Possibilities[i, j]].Content.Winner);
|
check.Add(_Fields[_Possibilities[i, j]].Content.Winner);
|
||||||
}
|
}
|
||||||
if (check.Count == _Possibilities.GetLength(1))
|
if (check.Count != _Possibilities.GetLength(1))
|
||||||
{
|
continue;
|
||||||
//Check for winner
|
//Check for winner
|
||||||
if (check.Contains(1) && !check.Contains(2))
|
if (check.Contains(1) && !check.Contains(2))
|
||||||
return 1;
|
return 1;
|
||||||
else if (check.Contains(2) && !check.Contains(1))
|
if (check.Contains(2) && !check.Contains(1))
|
||||||
return 2;
|
return 2;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
@@ -209,8 +210,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// LeftButton isn't hold anymore, but Selec-Mode is still active -> "Drop" of Avatar
|
// LeftButton isn't hold anymore, but Selec-Mode is still active -> "Drop" of Avatar
|
||||||
else if (_SelectingMouseActive)
|
if (_SelectingMouseActive)
|
||||||
{
|
{
|
||||||
//Check if really a player was selected
|
//Check if really a player was selected
|
||||||
if (_SelectedPlayerNr != -1)
|
if (_SelectedPlayerNr != -1)
|
||||||
@@ -571,44 +572,41 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
|
|
||||||
private bool _OnAdd()
|
private bool _OnAdd()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _PlayerChooseButtons.Count; i++)
|
foreach (CPlayerChooseButton chooseButton in _PlayerChooseButtons.Where(chooseButton => chooseButton.Button.Selected && chooseButton.ProfileID != -1))
|
||||||
{
|
{
|
||||||
if (_PlayerChooseButtons[i].Button.Selected && _PlayerChooseButtons[i].ProfileID != -1)
|
if (_Data.ScreenNames.ProfileIDsTeam1.Count < _NumPlayerTeam1)
|
||||||
{
|
{
|
||||||
if (_Data.ScreenNames.ProfileIDsTeam1.Count < _NumPlayerTeam1)
|
_Data.ScreenNames.ProfileIDsTeam1.Add(chooseButton.ProfileID);
|
||||||
{
|
int added = _Data.ScreenNames.ProfileIDsTeam1.Count - 1;
|
||||||
_Data.ScreenNames.ProfileIDsTeam1.Add(_PlayerChooseButtons[i].ProfileID);
|
_UpdateButtonNext();
|
||||||
int added = _Data.ScreenNames.ProfileIDsTeam1.Count - 1;
|
//Update texture and name
|
||||||
_UpdateButtonNext();
|
_PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
|
||||||
//Update texture and name
|
_PlayerDestinationButtons[added].SelColor = new SColorF(1, 1, 1, 1);
|
||||||
_PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
|
_PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].Avatar.Texture;
|
||||||
_PlayerDestinationButtons[added].SelColor = new SColorF(1, 1, 1, 1);
|
_PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].Avatar.Texture;
|
||||||
_PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
_PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].PlayerName;
|
||||||
_PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
_PlayerDestinationButtons[added].Enabled = true;
|
||||||
_PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].PlayerName;
|
//Update Tiles-List
|
||||||
_PlayerDestinationButtons[added].Enabled = true;
|
_UpdateButtonPlayerChoose();
|
||||||
//Update Tiles-List
|
_CheckInteraction();
|
||||||
_UpdateButtonPlayerChoose();
|
return true;
|
||||||
_CheckInteraction();
|
}
|
||||||
return true;
|
if (_Data.ScreenNames.ProfileIDsTeam2.Count < _NumPlayerTeam2)
|
||||||
}
|
{
|
||||||
else if (_Data.ScreenNames.ProfileIDsTeam2.Count < _NumPlayerTeam2)
|
_Data.ScreenNames.ProfileIDsTeam2.Add(chooseButton.ProfileID);
|
||||||
{
|
int added = (_Data.ScreenNames.ProfileIDsTeam2.Count - 1) + _PlayerDestinationButtonsNumH;
|
||||||
_Data.ScreenNames.ProfileIDsTeam2.Add(_PlayerChooseButtons[i].ProfileID);
|
_UpdateButtonNext();
|
||||||
int added = (_Data.ScreenNames.ProfileIDsTeam2.Count - 1) + _PlayerDestinationButtonsNumH;
|
//Update texture and name
|
||||||
_UpdateButtonNext();
|
_PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
|
||||||
//Update texture and name
|
_PlayerDestinationButtons[added].SelColor = new SColorF(1, 1, 1, 1);
|
||||||
_PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
|
_PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].Avatar.Texture;
|
||||||
_PlayerDestinationButtons[added].SelColor = new SColorF(1, 1, 1, 1);
|
_PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].Avatar.Texture;
|
||||||
_PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
_PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].PlayerName;
|
||||||
_PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
_PlayerDestinationButtons[added].Enabled = true;
|
||||||
_PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].PlayerName;
|
//Update Tiles-List
|
||||||
_PlayerDestinationButtons[added].Enabled = true;
|
_UpdateButtonPlayerChoose();
|
||||||
//Update Tiles-List
|
_CheckInteraction();
|
||||||
_UpdateButtonPlayerChoose();
|
return true;
|
||||||
_CheckInteraction();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
private static bool _OwnMusicAdded;
|
private static bool _OwnMusicAdded;
|
||||||
private static bool _BackgroundMusicAdded;
|
private static bool _BackgroundMusicAdded;
|
||||||
private static bool _Playing;
|
|
||||||
private static bool _Disabled;
|
private static bool _Disabled;
|
||||||
private static bool _CanSing;
|
private static bool _CanSing;
|
||||||
private static bool _RepeatSong;
|
private static bool _RepeatSong;
|
||||||
@@ -107,10 +106,7 @@ namespace Vocaluxe.Base
|
|||||||
get { return File.Exists(_CurrentPlaylistElement.VideoFilePath); }
|
get { return File.Exists(_CurrentPlaylistElement.VideoFilePath); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool Playing
|
public static bool Playing { get; private set; }
|
||||||
{
|
|
||||||
get { return _Playing; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string ArtistAndTitle
|
public static string ArtistAndTitle
|
||||||
{
|
{
|
||||||
@@ -118,8 +114,7 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
if (_CurrentPlaylistElement.Artist != "" && _CurrentPlaylistElement.Title != "")
|
if (_CurrentPlaylistElement.Artist != "" && _CurrentPlaylistElement.Title != "")
|
||||||
return _CurrentPlaylistElement.Artist + " - " + _CurrentPlaylistElement.Title;
|
return _CurrentPlaylistElement.Artist + " - " + _CurrentPlaylistElement.Title;
|
||||||
else
|
return Path.GetFileNameWithoutExtension(_CurrentPlaylistElement.MusicFilePath);
|
||||||
return Path.GetFileNameWithoutExtension(_CurrentPlaylistElement.MusicFilePath);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,12 +138,12 @@ namespace Vocaluxe.Base
|
|||||||
if (CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON)
|
if (CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON)
|
||||||
_VideoEnabled = true;
|
_VideoEnabled = true;
|
||||||
|
|
||||||
_Playing = false;
|
Playing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Play()
|
public static void Play()
|
||||||
{
|
{
|
||||||
if (_Playing)
|
if (Playing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
|
if (CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
|
||||||
@@ -161,7 +156,7 @@ namespace Vocaluxe.Base
|
|||||||
CSound.Play(_CurrentMusicStream);
|
CSound.Play(_CurrentMusicStream);
|
||||||
if (_VideoEnabled && _Video != -1)
|
if (_VideoEnabled && _Video != -1)
|
||||||
CVideo.VdResume(_Video);
|
CVideo.VdResume(_Video);
|
||||||
_Playing = true;
|
Playing = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Next();
|
Next();
|
||||||
@@ -176,7 +171,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void Stop()
|
public static void Stop()
|
||||||
{
|
{
|
||||||
if (!_Playing)
|
if (!Playing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_VideoEnabled && _Video != -1)
|
if (_VideoEnabled && _Video != -1)
|
||||||
@@ -189,12 +184,12 @@ namespace Vocaluxe.Base
|
|||||||
_CurrentMusicStream = -1;
|
_CurrentMusicStream = -1;
|
||||||
|
|
||||||
_CurrentPlaylistElement = new CPlaylistElement();
|
_CurrentPlaylistElement = new CPlaylistElement();
|
||||||
_Playing = false;
|
Playing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Pause()
|
public static void Pause()
|
||||||
{
|
{
|
||||||
if (!_Playing)
|
if (!Playing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_VideoEnabled && _Video != -1)
|
if (_VideoEnabled && _Video != -1)
|
||||||
@@ -203,7 +198,7 @@ namespace Vocaluxe.Base
|
|||||||
CVideo.VdSkip(_Video, CSound.GetPosition(_CurrentMusicStream) + CSettings.BackgroundMusicFadeTime, _CurrentPlaylistElement.VideoGap);
|
CVideo.VdSkip(_Video, CSound.GetPosition(_CurrentMusicStream) + CSettings.BackgroundMusicFadeTime, _CurrentPlaylistElement.VideoGap);
|
||||||
}
|
}
|
||||||
CSound.FadeAndPause(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
|
CSound.FadeAndPause(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
|
||||||
_Playing = false;
|
Playing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Update()
|
public static void Update()
|
||||||
@@ -217,7 +212,7 @@ namespace Vocaluxe.Base
|
|||||||
timeToPlay = _CurrentPlaylistElement.Finish - CSound.GetPosition(_CurrentMusicStream);
|
timeToPlay = _CurrentPlaylistElement.Finish - CSound.GetPosition(_CurrentMusicStream);
|
||||||
|
|
||||||
bool finished = CSound.IsFinished(_CurrentMusicStream);
|
bool finished = CSound.IsFinished(_CurrentMusicStream);
|
||||||
if (_Playing && (timeToPlay <= CSettings.BackgroundMusicFadeTime || finished))
|
if (Playing && (timeToPlay <= CSettings.BackgroundMusicFadeTime || finished))
|
||||||
{
|
{
|
||||||
if (_RepeatSong)
|
if (_RepeatSong)
|
||||||
{
|
{
|
||||||
@@ -228,7 +223,7 @@ namespace Vocaluxe.Base
|
|||||||
CSound.SetPosition(_CurrentMusicStream, 0);
|
CSound.SetPosition(_CurrentMusicStream, 0);
|
||||||
if (_VideoEnabled && _Video != -1)
|
if (_VideoEnabled && _Video != -1)
|
||||||
{
|
{
|
||||||
if (_CurrentPlaylistElement.Start >0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
if (_CurrentPlaylistElement.Start > 0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
||||||
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
|
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
|
||||||
else
|
else
|
||||||
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
|
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
|
||||||
@@ -269,7 +264,7 @@ namespace Vocaluxe.Base
|
|||||||
CSound.SetStreamVolumeMax(_CurrentMusicStream, CConfig.BackgroundMusicVolume);
|
CSound.SetStreamVolumeMax(_CurrentMusicStream, CConfig.BackgroundMusicVolume);
|
||||||
|
|
||||||
//Seek to #Start-Tag, if found
|
//Seek to #Start-Tag, if found
|
||||||
if (_CurrentPlaylistElement.Start >0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
if (_CurrentPlaylistElement.Start > 0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
||||||
CSound.SetPosition(_CurrentMusicStream, _CurrentPlaylistElement.Start);
|
CSound.SetPosition(_CurrentMusicStream, _CurrentPlaylistElement.Start);
|
||||||
|
|
||||||
if (_VideoEnabled)
|
if (_VideoEnabled)
|
||||||
@@ -289,13 +284,13 @@ namespace Vocaluxe.Base
|
|||||||
if (CSound.GetPosition(_CurrentMusicStream) >= 1.5f)
|
if (CSound.GetPosition(_CurrentMusicStream) >= 1.5f)
|
||||||
{
|
{
|
||||||
//Seek to #Start-Tag, if found
|
//Seek to #Start-Tag, if found
|
||||||
if (_CurrentPlaylistElement.Start >0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
if (_CurrentPlaylistElement.Start > 0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
||||||
CSound.SetPosition(_CurrentMusicStream, _CurrentPlaylistElement.Start);
|
CSound.SetPosition(_CurrentMusicStream, _CurrentPlaylistElement.Start);
|
||||||
else
|
else
|
||||||
CSound.SetPosition(_CurrentMusicStream, 0);
|
CSound.SetPosition(_CurrentMusicStream, 0);
|
||||||
if (_VideoEnabled && _Video != -1)
|
if (_VideoEnabled && _Video != -1)
|
||||||
{
|
{
|
||||||
if (_CurrentPlaylistElement.Start >0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
if (_CurrentPlaylistElement.Start > 0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
||||||
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
|
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
|
||||||
else
|
else
|
||||||
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
|
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
|
||||||
@@ -321,7 +316,7 @@ namespace Vocaluxe.Base
|
|||||||
else if (_CurrentMusicStream != -1)
|
else if (_CurrentMusicStream != -1)
|
||||||
{
|
{
|
||||||
//Seek to #Start-Tag, if found
|
//Seek to #Start-Tag, if found
|
||||||
if (_CurrentPlaylistElement.Start >0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
if (_CurrentPlaylistElement.Start > 0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
||||||
CSound.SetPosition(_CurrentMusicStream, _CurrentPlaylistElement.Start);
|
CSound.SetPosition(_CurrentMusicStream, _CurrentPlaylistElement.Start);
|
||||||
else
|
else
|
||||||
CSound.SetPosition(_CurrentMusicStream, 0);
|
CSound.SetPosition(_CurrentMusicStream, 0);
|
||||||
@@ -499,7 +494,7 @@ namespace Vocaluxe.Base
|
|||||||
if (_Video == -1)
|
if (_Video == -1)
|
||||||
{
|
{
|
||||||
_Video = CVideo.VdLoad(_CurrentPlaylistElement.VideoFilePath);
|
_Video = CVideo.VdLoad(_CurrentPlaylistElement.VideoFilePath);
|
||||||
if (_CurrentPlaylistElement.Start >0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
if (_CurrentPlaylistElement.Start > 0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
||||||
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
|
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
|
||||||
else
|
else
|
||||||
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
|
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
|
||||||
|
|||||||
+21
-24
@@ -314,31 +314,28 @@ namespace Vocaluxe.Base
|
|||||||
reader.Dispose();
|
reader.Dispose();
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
else
|
if (reader != null)
|
||||||
|
reader.Close();
|
||||||
|
|
||||||
|
command.CommandText = "INSERT INTO Songs (Title, Artist, NumPlayed) " +
|
||||||
|
"VALUES (@title, @artist, @numplayed)";
|
||||||
|
command.Parameters.Add("@title", DbType.String, 0).Value = title;
|
||||||
|
command.Parameters.Add("@artist", DbType.String, 0).Value = artist;
|
||||||
|
command.Parameters.Add("@numplayed", DbType.Int32, 0).Value = defNumPlayed;
|
||||||
|
command.ExecuteNonQuery();
|
||||||
|
|
||||||
|
command.CommandText = "SELECT id FROM Songs WHERE [Title] = @title AND [Artist] = @artist";
|
||||||
|
command.Parameters.Add("@title", DbType.String, 0).Value = title;
|
||||||
|
command.Parameters.Add("@artist", DbType.String, 0).Value = artist;
|
||||||
|
|
||||||
|
reader = command.ExecuteReader();
|
||||||
|
|
||||||
|
if (reader != null)
|
||||||
{
|
{
|
||||||
if (reader != null)
|
reader.Read();
|
||||||
reader.Close();
|
int id = reader.GetInt32(0);
|
||||||
|
reader.Dispose();
|
||||||
command.CommandText = "INSERT INTO Songs (Title, Artist, NumPlayed) " +
|
return id;
|
||||||
"VALUES (@title, @artist, @numplayed)";
|
|
||||||
command.Parameters.Add("@title", DbType.String, 0).Value = title;
|
|
||||||
command.Parameters.Add("@artist", DbType.String, 0).Value = artist;
|
|
||||||
command.Parameters.Add("@numplayed", DbType.Int32, 0).Value = defNumPlayed;
|
|
||||||
command.ExecuteNonQuery();
|
|
||||||
|
|
||||||
command.CommandText = "SELECT id FROM Songs WHERE [Title] = @title AND [Artist] = @artist";
|
|
||||||
command.Parameters.Add("@title", DbType.String, 0).Value = title;
|
|
||||||
command.Parameters.Add("@artist", DbType.String, 0).Value = artist;
|
|
||||||
|
|
||||||
reader = command.ExecuteReader();
|
|
||||||
|
|
||||||
if (reader != null)
|
|
||||||
{
|
|
||||||
reader.Read();
|
|
||||||
int id = reader.GetInt32(0);
|
|
||||||
reader.Dispose();
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -225,11 +225,8 @@ namespace Vocaluxe.Base
|
|||||||
_Languages[nr].PartyModeTexts.Add(lang);
|
_Languages[nr].PartyModeTexts.Add(lang);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
CLog.LogError("Error reading Party Language File " + file);
|
||||||
{
|
return false;
|
||||||
CLog.LogError("Error reading Party Language File " + file);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void _LoadLanguageFile(string fileName)
|
private static void _LoadLanguageFile(string fileName)
|
||||||
|
|||||||
@@ -160,7 +160,9 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
string version = ProgramName;
|
string version = ProgramName;
|
||||||
|
|
||||||
|
// ReSharper disable ConditionIsAlwaysTrueOrFalse
|
||||||
if (ProgramCodeName != "")
|
if (ProgramCodeName != "")
|
||||||
|
// ReSharper restore ConditionIsAlwaysTrueOrFalse
|
||||||
version += " \"" + ProgramCodeName + "\"";
|
version += " \"" + ProgramCodeName + "\"";
|
||||||
|
|
||||||
return version + " " + GetVersionText();
|
return version + " " + GetVersionText();
|
||||||
|
|||||||
@@ -50,11 +50,10 @@ namespace Vocaluxe.Base
|
|||||||
get { return _IgnoreArticles; }
|
get { return _IgnoreArticles; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value != _IgnoreArticles)
|
if (value == _IgnoreArticles)
|
||||||
{
|
return;
|
||||||
_IgnoreArticles = value;
|
_IgnoreArticles = value;
|
||||||
_SetChanged();
|
_SetChanged();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,11 +62,10 @@ namespace Vocaluxe.Base
|
|||||||
get { return _SongSorting; }
|
get { return _SongSorting; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value != _SongSorting)
|
if (value == _SongSorting)
|
||||||
{
|
return;
|
||||||
_SongSorting = value;
|
_SongSorting = value;
|
||||||
_SetChanged();
|
_SetChanged();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,36 +86,28 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
private int _SortByFieldArtistTitle(SSongPointer s1, SSongPointer s2)
|
private int _SortByFieldArtistTitle(SSongPointer s1, SSongPointer s2)
|
||||||
{
|
{
|
||||||
int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper());
|
int res = String.Compare(s1.SortString, s2.SortString, StringComparison.OrdinalIgnoreCase);
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
{
|
{
|
||||||
if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
|
if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
|
||||||
{
|
{
|
||||||
res = CSongs.Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(CSongs.Songs[s2.SongID].ArtistSorting.ToUpper());
|
res = String.Compare(CSongs.Songs[s1.SongID].ArtistSorting, CSongs.Songs[s2.SongID].ArtistSorting, StringComparison.OrdinalIgnoreCase);
|
||||||
if (res == 0)
|
return res != 0 ? res: String.Compare(CSongs.Songs[s1.SongID].TitleSorting, CSongs.Songs[s2.SongID].TitleSorting, StringComparison.OrdinalIgnoreCase);
|
||||||
return CSongs.Songs[s1.SongID].TitleSorting.ToUpper().CompareTo(CSongs.Songs[s2.SongID].TitleSorting.ToUpper());
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
res = CSongs.Songs[s1.SongID].Artist.ToUpper().CompareTo(CSongs.Songs[s2.SongID].Artist.ToUpper());
|
|
||||||
if (res == 0)
|
|
||||||
return CSongs.Songs[s1.SongID].Title.ToUpper().CompareTo(CSongs.Songs[s2.SongID].Title.ToUpper());
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
res = String.Compare(CSongs.Songs[s1.SongID].Artist, CSongs.Songs[s2.SongID].Artist, StringComparison.OrdinalIgnoreCase);
|
||||||
|
return res != 0 ? res : String.Compare(CSongs.Songs[s1.SongID].Title, CSongs.Songs[s2.SongID].Title, StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int _SortByFieldTitle(SSongPointer s1, SSongPointer s2)
|
private int _SortByFieldTitle(SSongPointer s1, SSongPointer s2)
|
||||||
{
|
{
|
||||||
int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper());
|
int res = String.Compare(s1.SortString, s2.SortString, StringComparison.OrdinalIgnoreCase);
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
{
|
{
|
||||||
if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
|
return _IgnoreArticles == EOffOn.TR_CONFIG_ON
|
||||||
return CSongs.Songs[s1.SongID].TitleSorting.ToUpper().CompareTo(CSongs.Songs[s2.SongID].TitleSorting.ToUpper());
|
? String.Compare(CSongs.Songs[s1.SongID].TitleSorting, CSongs.Songs[s2.SongID].TitleSorting, StringComparison.OrdinalIgnoreCase) :
|
||||||
else
|
String.Compare(CSongs.Songs[s1.SongID].Title, CSongs.Songs[s2.SongID].Title, StringComparison.OrdinalIgnoreCase);
|
||||||
return CSongs.Songs[s1.SongID].Title.ToUpper().CompareTo(CSongs.Songs[s2.SongID].Title.ToUpper());
|
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -177,16 +167,10 @@ namespace Vocaluxe.Base
|
|||||||
break;
|
break;
|
||||||
case ESongSorting.TR_CONFIG_ARTIST_LETTER:
|
case ESongSorting.TR_CONFIG_ARTIST_LETTER:
|
||||||
case ESongSorting.TR_CONFIG_ARTIST:
|
case ESongSorting.TR_CONFIG_ARTIST:
|
||||||
if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
|
fieldName = _IgnoreArticles == EOffOn.TR_CONFIG_ON ? "ArtistSorting" : "Artist";
|
||||||
fieldName = "ArtistSorting";
|
|
||||||
else
|
|
||||||
fieldName = "Artist";
|
|
||||||
break;
|
break;
|
||||||
case ESongSorting.TR_CONFIG_TITLE_LETTER:
|
case ESongSorting.TR_CONFIG_TITLE_LETTER:
|
||||||
if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
|
fieldName = _IgnoreArticles == EOffOn.TR_CONFIG_ON ? "TitleSorting" : "Title";
|
||||||
fieldName = "TitleSorting";
|
|
||||||
else
|
|
||||||
fieldName = "Title";
|
|
||||||
break;
|
break;
|
||||||
case ESongSorting.TR_CONFIG_YEAR:
|
case ESongSorting.TR_CONFIG_YEAR:
|
||||||
case ESongSorting.TR_CONFIG_DECADE:
|
case ESongSorting.TR_CONFIG_DECADE:
|
||||||
|
|||||||
@@ -205,8 +205,7 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
if ((Categorizer.Categories.Count > 0) && (_CatIndex >= 0) && (Categorizer.Categories.Count > _CatIndex))
|
if ((Categorizer.Categories.Count > 0) && (_CatIndex >= 0) && (Categorizer.Categories.Count > _CatIndex))
|
||||||
return Categorizer.Categories[_CatIndex].Name;
|
return Categorizer.Categories[_CatIndex].Name;
|
||||||
else
|
return String.Empty;
|
||||||
return String.Empty;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CSong GetSong(int songID)
|
public static CSong GetSong(int songID)
|
||||||
|
|||||||
+6
-26
@@ -548,7 +548,7 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
if (partyModeID != -1 && _Skins[i].PartyModeID == partyModeID)
|
if (partyModeID != -1 && _Skins[i].PartyModeID == partyModeID)
|
||||||
return i;
|
return i;
|
||||||
else if (partyModeID == -1 && _Skins[i].Name == CConfig.Skin)
|
if (partyModeID == -1 && _Skins[i].Name == CConfig.Skin)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -561,7 +561,7 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
if (partyModeID != -1 && _Themes[i].PartyModeID == partyModeID)
|
if (partyModeID != -1 && _Themes[i].PartyModeID == partyModeID)
|
||||||
return i;
|
return i;
|
||||||
else if (partyModeID == -1 && _Themes[i].Name == CConfig.Theme)
|
if (partyModeID == -1 && _Themes[i].Name == CConfig.Theme)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,22 +597,12 @@ namespace Vocaluxe.Base
|
|||||||
return _GetSkinFileName(skinName, GetSkinIndex(partyModeID), true);
|
return _GetSkinFileName(skinName, GetSkinIndex(partyModeID), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string _GetSkinFileName(string skinName, int skinIndex)
|
private static string _GetSkinFileName(string skinName, int skinIndex, bool returnPath = false)
|
||||||
{
|
|
||||||
return _GetSkinFileName(skinName, skinIndex, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string _GetSkinFileName(string skinName, int skinIndex, bool returnPath)
|
|
||||||
{
|
{
|
||||||
foreach (SSkinElement sk in _Skins[skinIndex].SkinList.Values)
|
foreach (SSkinElement sk in _Skins[skinIndex].SkinList.Values)
|
||||||
{
|
{
|
||||||
if (sk.Name == skinName)
|
if (sk.Name == skinName)
|
||||||
{
|
return !returnPath ? sk.Value : Path.Combine(_Skins[skinIndex].Path, sk.Value);
|
||||||
if (!returnPath)
|
|
||||||
return sk.Value;
|
|
||||||
else
|
|
||||||
return Path.Combine(_Skins[skinIndex].Path, sk.Value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CLog.LogError("Can't find Skin Element \"" + skinName);
|
CLog.LogError("Can't find Skin Element \"" + skinName);
|
||||||
@@ -695,22 +685,12 @@ namespace Vocaluxe.Base
|
|||||||
return _GetVideoFileName(videoName, GetSkinIndex(partyModeID), true);
|
return _GetVideoFileName(videoName, GetSkinIndex(partyModeID), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string _GetVideoFileName(string videoName, int skinIndex)
|
private static string _GetVideoFileName(string videoName, int skinIndex, bool returnPath = false)
|
||||||
{
|
|
||||||
return _GetVideoFileName(videoName, skinIndex, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string _GetVideoFileName(string videoName, int skinIndex, bool returnPath)
|
|
||||||
{
|
{
|
||||||
foreach (SSkinElement sk in _Skins[skinIndex].VideoList)
|
foreach (SSkinElement sk in _Skins[skinIndex].VideoList)
|
||||||
{
|
{
|
||||||
if (sk.Name == videoName)
|
if (sk.Name == videoName)
|
||||||
{
|
return !returnPath ? sk.Value : Path.Combine(_Skins[skinIndex].Path, sk.Value);
|
||||||
if (!returnPath)
|
|
||||||
return sk.Value;
|
|
||||||
else
|
|
||||||
return Path.Combine(_Skins[skinIndex].Path, sk.Value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CLog.LogError("Can't find Video Element \"" + videoName);
|
CLog.LogError("Can't find Video Element \"" + videoName);
|
||||||
|
|||||||
@@ -59,11 +59,9 @@ namespace Vocaluxe.Base
|
|||||||
long ticks = _Stopwatch.ElapsedTicks;
|
long ticks = _Stopwatch.ElapsedTicks;
|
||||||
if (Stopwatch.IsHighResolution && ticks != 0)
|
if (Stopwatch.IsHighResolution && ticks != 0)
|
||||||
return (float)((_NanosecPerTick * ticks) / (1000.0 * 1000.0));
|
return (float)((_NanosecPerTick * ticks) / (1000.0 * 1000.0));
|
||||||
else
|
return _Stopwatch.ElapsedMilliseconds;
|
||||||
return _Stopwatch.ElapsedMilliseconds;
|
|
||||||
}
|
}
|
||||||
else
|
return 0f;
|
||||||
return 0f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float CalculateFPS()
|
public static float CalculateFPS()
|
||||||
@@ -190,8 +188,7 @@ namespace Vocaluxe.Base
|
|||||||
_Del(0);
|
_Del(0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
return false;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CopyEvents()
|
public void CopyEvents()
|
||||||
|
|||||||
@@ -17,8 +17,6 @@
|
|||||||
// */
|
// */
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Sound
|
namespace Vocaluxe.Lib.Sound
|
||||||
{
|
{
|
||||||
struct SAudioStreams
|
struct SAudioStreams
|
||||||
|
|||||||
@@ -661,7 +661,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
|
|
||||||
if (num >= 0)
|
if (num >= 0)
|
||||||
{
|
{
|
||||||
if (frame.Index == -1 || _Width != (int) frame.Width || _Height != (int) frame.Height)
|
if (frame.Index == -1 || _Width != (int)frame.Width || _Height != (int)frame.Height)
|
||||||
{
|
{
|
||||||
CDraw.RemoveTexture(ref frame);
|
CDraw.RemoveTexture(ref frame);
|
||||||
frame = CDraw.AddTexture(_Width, _Height, ref _FrameBuffer[num].Data);
|
frame = CDraw.AddTexture(_Width, _Height, ref _FrameBuffer[num].Data);
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
// */
|
// */
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Video
|
namespace Vocaluxe.Lib.Video
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
// */
|
// */
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
|
||||||
using AForge.Video;
|
using AForge.Video;
|
||||||
using AForge.Video.DirectShow;
|
using AForge.Video.DirectShow;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -57,7 +56,7 @@ namespace Vocaluxe.Lib.Webcam
|
|||||||
{
|
{
|
||||||
lock (_MutexData)
|
lock (_MutexData)
|
||||||
{
|
{
|
||||||
if (frame.Index == -1 || _Width != (int) frame.Width || _Height != (int)frame.Height)
|
if (frame.Index == -1 || _Width != (int)frame.Width || _Height != (int)frame.Height)
|
||||||
{
|
{
|
||||||
CDraw.RemoveTexture(ref frame);
|
CDraw.RemoveTexture(ref frame);
|
||||||
frame = CDraw.AddTexture(_Width, _Height, ref _Data);
|
frame = CDraw.AddTexture(_Width, _Height, ref _Data);
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
_CurrentTime = CSound.GetPosition(_CurrentStream);
|
_CurrentTime = CSound.GetPosition(_CurrentStream);
|
||||||
|
|
||||||
if (_FinishTime >0.001 && _CurrentTime >= _FinishTime)
|
if (_FinishTime > 0.001 && _CurrentTime >= _FinishTime)
|
||||||
finish = true;
|
finish = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1038,13 +1038,11 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
private float[] _CalcFadingAlpha()
|
private float[] _CalcFadingAlpha()
|
||||||
{
|
{
|
||||||
float dt = 4f;
|
const float dt = 4f;
|
||||||
float rt = dt * 0.8f;
|
const float rt = dt * 0.8f;
|
||||||
|
|
||||||
CSong song = CGame.GetSong();
|
CSong song = CGame.GetSong();
|
||||||
if (song == null)
|
if (song == null || !song.NotesLoaded)
|
||||||
return null;
|
|
||||||
else if (!song.NotesLoaded)
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
float[] alpha = new float[song.Notes.Lines.Length * 2];
|
float[] alpha = new float[song.Notes.Lines.Length * 2];
|
||||||
|
|||||||
@@ -463,24 +463,24 @@ namespace Vocaluxe.Screens
|
|||||||
_ToggleSongOptions(ESongOptionsView.General);
|
_ToggleSongOptions(ESongOptionsView.General);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (_Buttons[_ButtonOptionsClose].Selected)
|
if (_Buttons[_ButtonOptionsClose].Selected)
|
||||||
{
|
{
|
||||||
_ToggleSongOptions(ESongOptionsView.None);
|
_ToggleSongOptions(ESongOptionsView.None);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (_Buttons[_ButtonOptionsSing].Selected)
|
if (_Buttons[_ButtonOptionsSing].Selected)
|
||||||
{
|
{
|
||||||
_ToggleSongOptions(ESongOptionsView.None);
|
_ToggleSongOptions(ESongOptionsView.None);
|
||||||
_StartSong(_SongMenus[_SongMenu].GetSelectedSong());
|
_StartSong(_SongMenus[_SongMenu].GetSelectedSong());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (_Buttons[_ButtonOptionsPlaylist].Selected)
|
if (_Buttons[_ButtonOptionsPlaylist].Selected)
|
||||||
{
|
{
|
||||||
_ToggleSongOptions(ESongOptionsView.None);
|
_ToggleSongOptions(ESongOptionsView.None);
|
||||||
_OpenAndAddPlaylistAction();
|
_OpenAndAddPlaylistAction();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (_Buttons[_ButtonOptionsRandom].Selected)
|
if (_Buttons[_ButtonOptionsRandom].Selected)
|
||||||
{
|
{
|
||||||
if (CSongs.IsInCategory)
|
if (CSongs.IsInCategory)
|
||||||
{
|
{
|
||||||
@@ -558,11 +558,8 @@ namespace Vocaluxe.Screens
|
|||||||
_ToggleSongOptions(ESongOptionsView.Song);
|
_ToggleSongOptions(ESongOptionsView.Song);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
_ToggleSongOptions(ESongOptionsView.None);
|
||||||
{
|
return true;
|
||||||
_ToggleSongOptions(ESongOptionsView.None);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -503,7 +503,7 @@ namespace VocaluxeLib.Menu
|
|||||||
if (diff <= 0)
|
if (diff <= 0)
|
||||||
diff = 1;
|
diff = 1;
|
||||||
|
|
||||||
float p = 1f-(currentBeat - _Notes[jumpNote].StartBeat) / diff;
|
float p = 1f - (currentBeat - _Notes[jumpNote].StartBeat) / diff;
|
||||||
|
|
||||||
if (Math.Abs(p) < float.Epsilon)
|
if (Math.Abs(p) < float.Epsilon)
|
||||||
_Text.Draw();
|
_Text.Draw();
|
||||||
|
|||||||
@@ -500,10 +500,7 @@ namespace VocaluxeLib.Menu
|
|||||||
if (_Selection >= _Interactions.Count || _Selection < 0)
|
if (_Selection >= _Interactions.Count || _Selection < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (_Interactions.Count > 0)
|
return _Interactions.Count > 0 && _IsMouseOver(x, y, _Interactions[_Selection]);
|
||||||
return _IsMouseOver(x, y, _Interactions[_Selection]);
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _IsMouseOver(int x, int y, CInteraction interact)
|
private bool _IsMouseOver(int x, int y, CInteraction interact)
|
||||||
@@ -789,10 +786,7 @@ namespace VocaluxeLib.Menu
|
|||||||
inDirection = true;
|
inDirection = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!inDirection)
|
return !inDirection ? float.MaxValue : distance;
|
||||||
return float.MaxValue;
|
|
||||||
else
|
|
||||||
return distance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private float _GetDistance180(SKeyEvent key, SRectF actualRect, SRectF targetRect)
|
private float _GetDistance180(SKeyEvent key, SRectF actualRect, SRectF targetRect)
|
||||||
@@ -825,10 +819,7 @@ namespace VocaluxeLib.Menu
|
|||||||
inDirection = true;
|
inDirection = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!inDirection)
|
return !inDirection ? float.MaxValue : distance;
|
||||||
return float.MaxValue;
|
|
||||||
else
|
|
||||||
return distance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -873,7 +873,7 @@ namespace VocaluxeLib.Menu
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (mouseEvent.Wheel < 0)
|
if (mouseEvent.Wheel < 0)
|
||||||
{
|
{
|
||||||
if (Offset + mouseEvent.Wheel >= 0)
|
if (Offset + mouseEvent.Wheel >= 0)
|
||||||
{
|
{
|
||||||
@@ -925,23 +925,23 @@ namespace VocaluxeLib.Menu
|
|||||||
ClosePlaylist();
|
ClosePlaylist();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (_Theme.ButtonPlaylistSing.Selected)
|
if (_Theme.ButtonPlaylistSing.Selected)
|
||||||
{
|
{
|
||||||
_StartPlaylistSongs();
|
_StartPlaylistSongs();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (_Theme.ButtonPlaylistSave.Selected)
|
if (_Theme.ButtonPlaylistSave.Selected)
|
||||||
{
|
{
|
||||||
CBase.Playlist.SavePlaylist(ActivePlaylistID);
|
CBase.Playlist.SavePlaylist(ActivePlaylistID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (_Theme.ButtonPlaylistDelete.Selected)
|
if (_Theme.ButtonPlaylistDelete.Selected)
|
||||||
{
|
{
|
||||||
CBase.Playlist.DeletePlaylist(ActivePlaylistID);
|
CBase.Playlist.DeletePlaylist(ActivePlaylistID);
|
||||||
ClosePlaylist();
|
ClosePlaylist();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (_Theme.ButtonPlaylistName.Selected)
|
if (_Theme.ButtonPlaylistName.Selected)
|
||||||
{
|
{
|
||||||
EditMode = EEditMode.PlaylistName;
|
EditMode = EEditMode.PlaylistName;
|
||||||
_Theme.ButtonPlaylistName.EditMode = true;
|
_Theme.ButtonPlaylistName.EditMode = true;
|
||||||
@@ -1159,8 +1159,7 @@ namespace VocaluxeLib.Menu
|
|||||||
Update();
|
Update();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
return false;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdatePlaylist()
|
public void UpdatePlaylist()
|
||||||
|
|||||||
@@ -134,8 +134,7 @@ namespace VocaluxeLib.Menu
|
|||||||
{
|
{
|
||||||
if (_Selection >= 0 && _ValueIndexes.Count > _Selection)
|
if (_Selection >= 0 && _ValueIndexes.Count > _Selection)
|
||||||
return _ValueIndexes[_Selection];
|
return _ValueIndexes[_Selection];
|
||||||
else
|
return -1;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,13 +45,7 @@ namespace VocaluxeLib.Menu
|
|||||||
private STexture _Texture;
|
private STexture _Texture;
|
||||||
public STexture Texture
|
public STexture Texture
|
||||||
{
|
{
|
||||||
get
|
get { return _Texture.Index != -1 ? _Texture : CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); }
|
||||||
{
|
|
||||||
if (_Texture.Index != -1)
|
|
||||||
return _Texture;
|
|
||||||
else
|
|
||||||
return CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
|
||||||
}
|
|
||||||
|
|
||||||
set { _Texture = value; }
|
set { _Texture = value; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,7 +143,8 @@ namespace VocaluxeLib.Menu
|
|||||||
get { return _Bounds; }
|
get { return _Bounds; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (Math.Abs(_Bounds.X - value.X) > 0.01 || Math.Abs(_Bounds.Y - value.Y) > 0.01 || Math.Abs(_Bounds.W - value.W) > 0.01 || Math.Abs(_Bounds.H - value.H) > 0.01 || Math.Abs(_Bounds.Z - value.Z) > 0.01)
|
if (Math.Abs(_Bounds.X - value.X) > 0.01 || Math.Abs(_Bounds.Y - value.Y) > 0.01 || Math.Abs(_Bounds.W - value.W) > 0.01 || Math.Abs(_Bounds.H - value.H) > 0.01 ||
|
||||||
|
Math.Abs(_Bounds.Z - value.Z) > 0.01)
|
||||||
{
|
{
|
||||||
_Bounds = value;
|
_Bounds = value;
|
||||||
_PositionNeedsUpdate = true;
|
_PositionNeedsUpdate = true;
|
||||||
|
|||||||
@@ -379,24 +379,12 @@ namespace VocaluxeLib.Menu.SingNotes
|
|||||||
|
|
||||||
public CNote FirstNote
|
public CNote FirstNote
|
||||||
{
|
{
|
||||||
get
|
get { return _Notes.Count > 0 ? _Notes[0] : null; }
|
||||||
{
|
|
||||||
if (_Notes.Count > 0)
|
|
||||||
return _Notes[0];
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CNote LastNote
|
public CNote LastNote
|
||||||
{
|
{
|
||||||
get
|
get { return _Notes.Count > 0 ? _Notes[_Notes.Count - 1] : null; }
|
||||||
{
|
|
||||||
if (_Notes.Count > 0)
|
|
||||||
return _Notes[_Notes.Count - 1];
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int BaseLine
|
public int BaseLine
|
||||||
|
|||||||
@@ -66,13 +66,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
|
|
||||||
public STexture CoverTextureBig
|
public STexture CoverTextureBig
|
||||||
{
|
{
|
||||||
get
|
get { return _CoverBigLoaded ? _CoverTextureBig : _CoverTextureSmall; }
|
||||||
{
|
|
||||||
if (_CoverBigLoaded)
|
|
||||||
return _CoverTextureBig;
|
|
||||||
else
|
|
||||||
return _CoverTextureSmall;
|
|
||||||
}
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value.Index != -1)
|
if (value.Index != -1)
|
||||||
@@ -1016,11 +1010,8 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
ShortEnd = lines.Line[series[i].Start - 1].LastNote.EndBeat;
|
ShortEnd = lines.Line[series[i].Start - 1].LastNote.EndBeat;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
ShortEnd = lines.Line[series[i].End].LastNote.EndBeat;
|
||||||
{
|
return;
|
||||||
ShortEnd = lines.Line[series[i].End].LastNote.EndBeat;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
mouseEvent.Handled = true;
|
mouseEvent.Handled = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (mouseEvent.RB && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && !songOptions.Selection.PartyMode)
|
if (mouseEvent.RB && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && !songOptions.Selection.PartyMode)
|
||||||
CBase.Graphics.FadeTo(EScreens.ScreenMain);
|
CBase.Graphics.FadeTo(EScreens.ScreenMain);
|
||||||
else if (_PreviewSelected != -1 && mouseEvent.LB && CBase.Songs.GetCurrentCategoryIndex() != -1 && !songOptions.Selection.PartyMode)
|
else if (_PreviewSelected != -1 && mouseEvent.LB && CBase.Songs.GetCurrentCategoryIndex() != -1 && !songOptions.Selection.PartyMode)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user