Removed code redundancies
This commit is contained in:
1 parent
5cd47f0537
commit
ec766aa7b5
23 files changed
+69
-167
No files matched your search
@@ -711,15 +711,14 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
if (_Fields[_Possibilities[i, j]].Content.Winner > 0)
|
||||
check.Add(_Fields[_Possibilities[i, j]].Content.Winner);
|
||||
}
|
||||
if (check.Count == _Possibilities.GetLength(1))
|
||||
{
|
||||
if (check.Count != _Possibilities.GetLength(1))
|
||||
continue;
|
||||
//Check for winner
|
||||
if (check.Contains(1) && !check.Contains(2))
|
||||
return 1;
|
||||
else if (check.Contains(2) && !check.Contains(1))
|
||||
if (check.Contains(2) && !check.Contains(1))
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
@@ -210,7 +211,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
return true;
|
||||
}
|
||||
// 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
|
||||
if (_SelectedPlayerNr != -1)
|
||||
@@ -571,38 +572,36 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
private bool _OnAdd()
|
||||
{
|
||||
for (int i = 0; i < _PlayerChooseButtons.Count; i++)
|
||||
{
|
||||
if (_PlayerChooseButtons[i].Button.Selected && _PlayerChooseButtons[i].ProfileID != -1)
|
||||
foreach (CPlayerChooseButton chooseButton in _PlayerChooseButtons.Where(chooseButton => chooseButton.Button.Selected && chooseButton.ProfileID != -1))
|
||||
{
|
||||
if (_Data.ScreenNames.ProfileIDsTeam1.Count < _NumPlayerTeam1)
|
||||
{
|
||||
_Data.ScreenNames.ProfileIDsTeam1.Add(_PlayerChooseButtons[i].ProfileID);
|
||||
_Data.ScreenNames.ProfileIDsTeam1.Add(chooseButton.ProfileID);
|
||||
int added = _Data.ScreenNames.ProfileIDsTeam1.Count - 1;
|
||||
_UpdateButtonNext();
|
||||
//Update texture and name
|
||||
_PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
|
||||
_PlayerDestinationButtons[added].SelColor = new SColorF(1, 1, 1, 1);
|
||||
_PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].PlayerName;
|
||||
_PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].PlayerName;
|
||||
_PlayerDestinationButtons[added].Enabled = true;
|
||||
//Update Tiles-List
|
||||
_UpdateButtonPlayerChoose();
|
||||
_CheckInteraction();
|
||||
return true;
|
||||
}
|
||||
else if (_Data.ScreenNames.ProfileIDsTeam2.Count < _NumPlayerTeam2)
|
||||
if (_Data.ScreenNames.ProfileIDsTeam2.Count < _NumPlayerTeam2)
|
||||
{
|
||||
_Data.ScreenNames.ProfileIDsTeam2.Add(_PlayerChooseButtons[i].ProfileID);
|
||||
_Data.ScreenNames.ProfileIDsTeam2.Add(chooseButton.ProfileID);
|
||||
int added = (_Data.ScreenNames.ProfileIDsTeam2.Count - 1) + _PlayerDestinationButtonsNumH;
|
||||
_UpdateButtonNext();
|
||||
//Update texture and name
|
||||
_PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
|
||||
_PlayerDestinationButtons[added].SelColor = new SColorF(1, 1, 1, 1);
|
||||
_PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].PlayerName;
|
||||
_PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].PlayerName;
|
||||
_PlayerDestinationButtons[added].Enabled = true;
|
||||
//Update Tiles-List
|
||||
_UpdateButtonPlayerChoose();
|
||||
@@ -610,7 +609,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace Vocaluxe.Base
|
||||
|
||||
private static bool _OwnMusicAdded;
|
||||
private static bool _BackgroundMusicAdded;
|
||||
private static bool _Playing;
|
||||
private static bool _Disabled;
|
||||
private static bool _CanSing;
|
||||
private static bool _RepeatSong;
|
||||
@@ -107,10 +106,7 @@ namespace Vocaluxe.Base
|
||||
get { return File.Exists(_CurrentPlaylistElement.VideoFilePath); }
|
||||
}
|
||||
|
||||
public static bool Playing
|
||||
{
|
||||
get { return _Playing; }
|
||||
}
|
||||
public static bool Playing { get; private set; }
|
||||
|
||||
public static string ArtistAndTitle
|
||||
{
|
||||
@@ -118,7 +114,6 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
if (_CurrentPlaylistElement.Artist != "" && _CurrentPlaylistElement.Title != "")
|
||||
return _CurrentPlaylistElement.Artist + " - " + _CurrentPlaylistElement.Title;
|
||||
else
|
||||
return Path.GetFileNameWithoutExtension(_CurrentPlaylistElement.MusicFilePath);
|
||||
}
|
||||
}
|
||||
@@ -143,12 +138,12 @@ namespace Vocaluxe.Base
|
||||
if (CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON)
|
||||
_VideoEnabled = true;
|
||||
|
||||
_Playing = false;
|
||||
Playing = false;
|
||||
}
|
||||
|
||||
public static void Play()
|
||||
{
|
||||
if (_Playing)
|
||||
if (Playing)
|
||||
return;
|
||||
|
||||
if (CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
|
||||
@@ -161,7 +156,7 @@ namespace Vocaluxe.Base
|
||||
CSound.Play(_CurrentMusicStream);
|
||||
if (_VideoEnabled && _Video != -1)
|
||||
CVideo.VdResume(_Video);
|
||||
_Playing = true;
|
||||
Playing = true;
|
||||
}
|
||||
else
|
||||
Next();
|
||||
@@ -176,7 +171,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static void Stop()
|
||||
{
|
||||
if (!_Playing)
|
||||
if (!Playing)
|
||||
return;
|
||||
|
||||
if (_VideoEnabled && _Video != -1)
|
||||
@@ -189,12 +184,12 @@ namespace Vocaluxe.Base
|
||||
_CurrentMusicStream = -1;
|
||||
|
||||
_CurrentPlaylistElement = new CPlaylistElement();
|
||||
_Playing = false;
|
||||
Playing = false;
|
||||
}
|
||||
|
||||
public static void Pause()
|
||||
{
|
||||
if (!_Playing)
|
||||
if (!Playing)
|
||||
return;
|
||||
|
||||
if (_VideoEnabled && _Video != -1)
|
||||
@@ -203,7 +198,7 @@ namespace Vocaluxe.Base
|
||||
CVideo.VdSkip(_Video, CSound.GetPosition(_CurrentMusicStream) + CSettings.BackgroundMusicFadeTime, _CurrentPlaylistElement.VideoGap);
|
||||
}
|
||||
CSound.FadeAndPause(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
|
||||
_Playing = false;
|
||||
Playing = false;
|
||||
}
|
||||
|
||||
public static void Update()
|
||||
@@ -217,7 +212,7 @@ namespace Vocaluxe.Base
|
||||
timeToPlay = _CurrentPlaylistElement.Finish - CSound.GetPosition(_CurrentMusicStream);
|
||||
|
||||
bool finished = CSound.IsFinished(_CurrentMusicStream);
|
||||
if (_Playing && (timeToPlay <= CSettings.BackgroundMusicFadeTime || finished))
|
||||
if (Playing && (timeToPlay <= CSettings.BackgroundMusicFadeTime || finished))
|
||||
{
|
||||
if (_RepeatSong)
|
||||
{
|
||||
|
||||
@@ -314,8 +314,6 @@ namespace Vocaluxe.Base
|
||||
reader.Dispose();
|
||||
return id;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (reader != null)
|
||||
reader.Close();
|
||||
|
||||
@@ -339,7 +337,6 @@ namespace Vocaluxe.Base
|
||||
reader.Dispose();
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -225,12 +225,9 @@ namespace Vocaluxe.Base
|
||||
_Languages[nr].PartyModeTexts.Add(lang);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
CLog.LogError("Error reading Party Language File " + file);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void _LoadLanguageFile(string fileName)
|
||||
{
|
||||
|
||||
@@ -160,7 +160,9 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
string version = ProgramName;
|
||||
|
||||
// ReSharper disable ConditionIsAlwaysTrueOrFalse
|
||||
if (ProgramCodeName != "")
|
||||
// ReSharper restore ConditionIsAlwaysTrueOrFalse
|
||||
version += " \"" + ProgramCodeName + "\"";
|
||||
|
||||
return version + " " + GetVersionText();
|
||||
|
||||
@@ -50,26 +50,24 @@ namespace Vocaluxe.Base
|
||||
get { return _IgnoreArticles; }
|
||||
set
|
||||
{
|
||||
if (value != _IgnoreArticles)
|
||||
{
|
||||
if (value == _IgnoreArticles)
|
||||
return;
|
||||
_IgnoreArticles = value;
|
||||
_SetChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ESongSorting SongSorting
|
||||
{
|
||||
get { return _SongSorting; }
|
||||
set
|
||||
{
|
||||
if (value != _SongSorting)
|
||||
{
|
||||
if (value == _SongSorting)
|
||||
return;
|
||||
_SongSorting = value;
|
||||
_SetChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetOptions(ESongSorting songSorting, EOffOn ignoreArticles)
|
||||
{
|
||||
@@ -88,36 +86,28 @@ namespace Vocaluxe.Base
|
||||
|
||||
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 (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
res = CSongs.Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(CSongs.Songs[s2.SongID].ArtistSorting.ToUpper());
|
||||
if (res == 0)
|
||||
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].ArtistSorting, CSongs.Songs[s2.SongID].ArtistSorting, StringComparison.OrdinalIgnoreCase);
|
||||
return res != 0 ? res: String.Compare(CSongs.Songs[s1.SongID].TitleSorting, CSongs.Songs[s2.SongID].TitleSorting, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
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 (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
|
||||
return CSongs.Songs[s1.SongID].TitleSorting.ToUpper().CompareTo(CSongs.Songs[s2.SongID].TitleSorting.ToUpper());
|
||||
else
|
||||
return CSongs.Songs[s1.SongID].Title.ToUpper().CompareTo(CSongs.Songs[s2.SongID].Title.ToUpper());
|
||||
return _IgnoreArticles == EOffOn.TR_CONFIG_ON
|
||||
? String.Compare(CSongs.Songs[s1.SongID].TitleSorting, CSongs.Songs[s2.SongID].TitleSorting, StringComparison.OrdinalIgnoreCase) :
|
||||
String.Compare(CSongs.Songs[s1.SongID].Title, CSongs.Songs[s2.SongID].Title, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -177,16 +167,10 @@ namespace Vocaluxe.Base
|
||||
break;
|
||||
case ESongSorting.TR_CONFIG_ARTIST_LETTER:
|
||||
case ESongSorting.TR_CONFIG_ARTIST:
|
||||
if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
|
||||
fieldName = "ArtistSorting";
|
||||
else
|
||||
fieldName = "Artist";
|
||||
fieldName = _IgnoreArticles == EOffOn.TR_CONFIG_ON ? "ArtistSorting" : "Artist";
|
||||
break;
|
||||
case ESongSorting.TR_CONFIG_TITLE_LETTER:
|
||||
if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
|
||||
fieldName = "TitleSorting";
|
||||
else
|
||||
fieldName = "Title";
|
||||
fieldName = _IgnoreArticles == EOffOn.TR_CONFIG_ON ? "TitleSorting" : "Title";
|
||||
break;
|
||||
case ESongSorting.TR_CONFIG_YEAR:
|
||||
case ESongSorting.TR_CONFIG_DECADE:
|
||||
|
||||
@@ -205,7 +205,6 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
if ((Categorizer.Categories.Count > 0) && (_CatIndex >= 0) && (Categorizer.Categories.Count > _CatIndex))
|
||||
return Categorizer.Categories[_CatIndex].Name;
|
||||
else
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
|
||||
+6
-26
@@ -548,7 +548,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
if (partyModeID != -1 && _Skins[i].PartyModeID == partyModeID)
|
||||
return i;
|
||||
else if (partyModeID == -1 && _Skins[i].Name == CConfig.Skin)
|
||||
if (partyModeID == -1 && _Skins[i].Name == CConfig.Skin)
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -561,7 +561,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
if (partyModeID != -1 && _Themes[i].PartyModeID == partyModeID)
|
||||
return i;
|
||||
else if (partyModeID == -1 && _Themes[i].Name == CConfig.Theme)
|
||||
if (partyModeID == -1 && _Themes[i].Name == CConfig.Theme)
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -597,22 +597,12 @@ namespace Vocaluxe.Base
|
||||
return _GetSkinFileName(skinName, GetSkinIndex(partyModeID), true);
|
||||
}
|
||||
|
||||
private static string _GetSkinFileName(string skinName, int skinIndex)
|
||||
{
|
||||
return _GetSkinFileName(skinName, skinIndex, false);
|
||||
}
|
||||
|
||||
private static string _GetSkinFileName(string skinName, int skinIndex, bool returnPath)
|
||||
private static string _GetSkinFileName(string skinName, int skinIndex, bool returnPath = false)
|
||||
{
|
||||
foreach (SSkinElement sk in _Skins[skinIndex].SkinList.Values)
|
||||
{
|
||||
if (sk.Name == skinName)
|
||||
{
|
||||
if (!returnPath)
|
||||
return sk.Value;
|
||||
else
|
||||
return Path.Combine(_Skins[skinIndex].Path, sk.Value);
|
||||
}
|
||||
return !returnPath ? sk.Value : Path.Combine(_Skins[skinIndex].Path, sk.Value);
|
||||
}
|
||||
|
||||
CLog.LogError("Can't find Skin Element \"" + skinName);
|
||||
@@ -695,22 +685,12 @@ namespace Vocaluxe.Base
|
||||
return _GetVideoFileName(videoName, GetSkinIndex(partyModeID), true);
|
||||
}
|
||||
|
||||
private static string _GetVideoFileName(string videoName, int skinIndex)
|
||||
{
|
||||
return _GetVideoFileName(videoName, skinIndex, false);
|
||||
}
|
||||
|
||||
private static string _GetVideoFileName(string videoName, int skinIndex, bool returnPath)
|
||||
private static string _GetVideoFileName(string videoName, int skinIndex, bool returnPath = false)
|
||||
{
|
||||
foreach (SSkinElement sk in _Skins[skinIndex].VideoList)
|
||||
{
|
||||
if (sk.Name == videoName)
|
||||
{
|
||||
if (!returnPath)
|
||||
return sk.Value;
|
||||
else
|
||||
return Path.Combine(_Skins[skinIndex].Path, sk.Value);
|
||||
}
|
||||
return !returnPath ? sk.Value : Path.Combine(_Skins[skinIndex].Path, sk.Value);
|
||||
}
|
||||
|
||||
CLog.LogError("Can't find Video Element \"" + videoName);
|
||||
|
||||
@@ -59,10 +59,8 @@ namespace Vocaluxe.Base
|
||||
long ticks = _Stopwatch.ElapsedTicks;
|
||||
if (Stopwatch.IsHighResolution && ticks != 0)
|
||||
return (float)((_NanosecPerTick * ticks) / (1000.0 * 1000.0));
|
||||
else
|
||||
return _Stopwatch.ElapsedMilliseconds;
|
||||
}
|
||||
else
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -190,7 +188,6 @@ namespace Vocaluxe.Base
|
||||
_Del(0);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
|
||||
namespace Vocaluxe.Lib.Sound
|
||||
{
|
||||
struct SAudioStreams
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Lib.Video
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using AForge.Video;
|
||||
using AForge.Video.DirectShow;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1038,13 +1038,11 @@ namespace Vocaluxe.Screens
|
||||
|
||||
private float[] _CalcFadingAlpha()
|
||||
{
|
||||
float dt = 4f;
|
||||
float rt = dt * 0.8f;
|
||||
const float dt = 4f;
|
||||
const float rt = dt * 0.8f;
|
||||
|
||||
CSong song = CGame.GetSong();
|
||||
if (song == null)
|
||||
return null;
|
||||
else if (!song.NotesLoaded)
|
||||
if (song == null || !song.NotesLoaded)
|
||||
return null;
|
||||
|
||||
float[] alpha = new float[song.Notes.Lines.Length * 2];
|
||||
|
||||
@@ -463,24 +463,24 @@ namespace Vocaluxe.Screens
|
||||
_ToggleSongOptions(ESongOptionsView.General);
|
||||
return true;
|
||||
}
|
||||
else if (_Buttons[_ButtonOptionsClose].Selected)
|
||||
if (_Buttons[_ButtonOptionsClose].Selected)
|
||||
{
|
||||
_ToggleSongOptions(ESongOptionsView.None);
|
||||
return true;
|
||||
}
|
||||
else if (_Buttons[_ButtonOptionsSing].Selected)
|
||||
if (_Buttons[_ButtonOptionsSing].Selected)
|
||||
{
|
||||
_ToggleSongOptions(ESongOptionsView.None);
|
||||
_StartSong(_SongMenus[_SongMenu].GetSelectedSong());
|
||||
return true;
|
||||
}
|
||||
else if (_Buttons[_ButtonOptionsPlaylist].Selected)
|
||||
if (_Buttons[_ButtonOptionsPlaylist].Selected)
|
||||
{
|
||||
_ToggleSongOptions(ESongOptionsView.None);
|
||||
_OpenAndAddPlaylistAction();
|
||||
return true;
|
||||
}
|
||||
else if (_Buttons[_ButtonOptionsRandom].Selected)
|
||||
if (_Buttons[_ButtonOptionsRandom].Selected)
|
||||
{
|
||||
if (CSongs.IsInCategory)
|
||||
{
|
||||
@@ -558,13 +558,10 @@ namespace Vocaluxe.Screens
|
||||
_ToggleSongOptions(ESongOptionsView.Song);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_ToggleSongOptions(ESongOptionsView.None);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mouseEvent.LBH)
|
||||
{
|
||||
|
||||
@@ -500,10 +500,7 @@ namespace VocaluxeLib.Menu
|
||||
if (_Selection >= _Interactions.Count || _Selection < 0)
|
||||
return false;
|
||||
|
||||
if (_Interactions.Count > 0)
|
||||
return _IsMouseOver(x, y, _Interactions[_Selection]);
|
||||
else
|
||||
return false;
|
||||
return _Interactions.Count > 0 && _IsMouseOver(x, y, _Interactions[_Selection]);
|
||||
}
|
||||
|
||||
private bool _IsMouseOver(int x, int y, CInteraction interact)
|
||||
@@ -789,10 +786,7 @@ namespace VocaluxeLib.Menu
|
||||
inDirection = true;
|
||||
break;
|
||||
}
|
||||
if (!inDirection)
|
||||
return float.MaxValue;
|
||||
else
|
||||
return distance;
|
||||
return !inDirection ? float.MaxValue : distance;
|
||||
}
|
||||
|
||||
private float _GetDistance180(SKeyEvent key, SRectF actualRect, SRectF targetRect)
|
||||
@@ -825,10 +819,7 @@ namespace VocaluxeLib.Menu
|
||||
inDirection = true;
|
||||
break;
|
||||
}
|
||||
if (!inDirection)
|
||||
return float.MaxValue;
|
||||
else
|
||||
return distance;
|
||||
return !inDirection ? float.MaxValue : distance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -873,7 +873,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (mouseEvent.Wheel < 0)
|
||||
if (mouseEvent.Wheel < 0)
|
||||
{
|
||||
if (Offset + mouseEvent.Wheel >= 0)
|
||||
{
|
||||
@@ -925,23 +925,23 @@ namespace VocaluxeLib.Menu
|
||||
ClosePlaylist();
|
||||
return true;
|
||||
}
|
||||
else if (_Theme.ButtonPlaylistSing.Selected)
|
||||
if (_Theme.ButtonPlaylistSing.Selected)
|
||||
{
|
||||
_StartPlaylistSongs();
|
||||
return true;
|
||||
}
|
||||
else if (_Theme.ButtonPlaylistSave.Selected)
|
||||
if (_Theme.ButtonPlaylistSave.Selected)
|
||||
{
|
||||
CBase.Playlist.SavePlaylist(ActivePlaylistID);
|
||||
return true;
|
||||
}
|
||||
else if (_Theme.ButtonPlaylistDelete.Selected)
|
||||
if (_Theme.ButtonPlaylistDelete.Selected)
|
||||
{
|
||||
CBase.Playlist.DeletePlaylist(ActivePlaylistID);
|
||||
ClosePlaylist();
|
||||
return true;
|
||||
}
|
||||
else if (_Theme.ButtonPlaylistName.Selected)
|
||||
if (_Theme.ButtonPlaylistName.Selected)
|
||||
{
|
||||
EditMode = EEditMode.PlaylistName;
|
||||
_Theme.ButtonPlaylistName.EditMode = true;
|
||||
@@ -1159,7 +1159,6 @@ namespace VocaluxeLib.Menu
|
||||
Update();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,6 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
if (_Selection >= 0 && _ValueIndexes.Count > _Selection)
|
||||
return _ValueIndexes[_Selection];
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,13 +45,7 @@ namespace VocaluxeLib.Menu
|
||||
private STexture _Texture;
|
||||
public STexture Texture
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Texture.Index != -1)
|
||||
return _Texture;
|
||||
else
|
||||
return CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
}
|
||||
get { return _Texture.Index != -1 ? _Texture : CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); }
|
||||
|
||||
set { _Texture = value; }
|
||||
}
|
||||
|
||||
@@ -143,7 +143,8 @@ namespace VocaluxeLib.Menu
|
||||
get { return _Bounds; }
|
||||
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;
|
||||
_PositionNeedsUpdate = true;
|
||||
|
||||
@@ -379,24 +379,12 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
public CNote FirstNote
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Notes.Count > 0)
|
||||
return _Notes[0];
|
||||
else
|
||||
return null;
|
||||
}
|
||||
get { return _Notes.Count > 0 ? _Notes[0] : null; }
|
||||
}
|
||||
|
||||
public CNote LastNote
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Notes.Count > 0)
|
||||
return _Notes[_Notes.Count - 1];
|
||||
else
|
||||
return null;
|
||||
}
|
||||
get { return _Notes.Count > 0 ? _Notes[_Notes.Count - 1] : null; }
|
||||
}
|
||||
|
||||
public int BaseLine
|
||||
|
||||
@@ -66,13 +66,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
public STexture CoverTextureBig
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_CoverBigLoaded)
|
||||
return _CoverTextureBig;
|
||||
else
|
||||
return _CoverTextureSmall;
|
||||
}
|
||||
get { return _CoverBigLoaded ? _CoverTextureBig : _CoverTextureSmall; }
|
||||
set
|
||||
{
|
||||
if (value.Index != -1)
|
||||
@@ -1016,13 +1010,10 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
ShortEnd = lines.Line[series[i].Start - 1].LastNote.EndBeat;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShortEnd = lines.Line[series[i].End].LastNote.EndBeat;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Check if stop is in line
|
||||
for (int i = 0; i < lines.Line.Length; i++)
|
||||
|
||||
@@ -367,7 +367,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
mouseEvent.Handled = true;
|
||||
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);
|
||||
else if (_PreviewSelected != -1 && mouseEvent.LB && CBase.Songs.GetCurrentCategoryIndex() != -1 && !songOptions.Selection.PartyMode)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user