Changed string comparisons to easier != "" syntax
This commit is contained in:
1 parent
1540be9120
commit
cf39a4b107
74 files changed
+318
-338
No files matched your search
@@ -157,21 +157,15 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
//filter against PlayerNrDemand
|
||||
List<CCombination> combsFiltered = new List<CCombination>();
|
||||
if (playerNrDemand != null)
|
||||
{
|
||||
combsFiltered.AddRange(_Combs.Where(t => t.IsAvailableAll(playerNrDemand)));
|
||||
}
|
||||
|
||||
//1st fallback
|
||||
if (playerNrDemand != null && combsFiltered.Count == 0)
|
||||
{
|
||||
combsFiltered.AddRange(_Combs.Where(t => t.IsAvailableSomeone(playerNrDemand)));
|
||||
}
|
||||
|
||||
//2nd fallback
|
||||
if (combsFiltered.Count == 0)
|
||||
{
|
||||
combsFiltered.AddRange(_Combs);
|
||||
}
|
||||
|
||||
int num = combsFiltered.Count;
|
||||
int rand = _Rand.Next(num);
|
||||
|
||||
@@ -368,9 +368,9 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
return _ScreenSongOptions;
|
||||
}
|
||||
|
||||
// ReSharper disable RedundantAssignment
|
||||
// ReSharper disable RedundantAssignment
|
||||
public override void OnSongChange(int songIndex, ref SScreenSongOptions screenSongOptions)
|
||||
// ReSharper restore RedundantAssignment
|
||||
// ReSharper restore RedundantAssignment
|
||||
{
|
||||
_ScreenSongOptions.Selection.SongIndex = -1;
|
||||
|
||||
@@ -389,9 +389,9 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
screenSongOptions = _ScreenSongOptions;
|
||||
}
|
||||
|
||||
// ReSharper disable RedundantAssignment
|
||||
// ReSharper disable RedundantAssignment
|
||||
public override void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions)
|
||||
// ReSharper restore RedundantAssignment
|
||||
// ReSharper restore RedundantAssignment
|
||||
{
|
||||
if (_GameData.CatSongIndices != null && categoryIndex != -1)
|
||||
{
|
||||
|
||||
@@ -23,9 +23,9 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
public class CPartyScreenChallengeConfig : CMenuParty
|
||||
// ReSharper restore UnusedMember.Global
|
||||
// ReSharper restore UnusedMember.Global
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
|
||||
@@ -41,9 +41,9 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
public List<CText> TextScores;
|
||||
}
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
public class CPartyScreenChallengeMain : CMenuParty
|
||||
// ReSharper restore UnusedMember.Global
|
||||
// ReSharper restore UnusedMember.Global
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
@@ -352,7 +352,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
private void _UpdateNextPlayerPositions()
|
||||
{
|
||||
float x = (float) CBase.Settings.GetRenderW() / 2 - ((_GameState.NumPlayerAtOnce * _Statics[_StaticNextPlayer].Rect.W) + ((_GameState.NumPlayerAtOnce - 1) * 15)) / 2;
|
||||
float x = (float)CBase.Settings.GetRenderW() / 2 - ((_GameState.NumPlayerAtOnce * _Statics[_StaticNextPlayer].Rect.W) + ((_GameState.NumPlayerAtOnce - 1) * 15)) / 2;
|
||||
const float staticY = 590;
|
||||
const float textY = 550;
|
||||
for (int i = 0; i < _GameState.NumPlayerAtOnce; i++)
|
||||
|
||||
@@ -25,9 +25,9 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
public class CPartyScreenChallengeNames : CMenuParty
|
||||
// ReSharper restore UnusedMember.Global
|
||||
// ReSharper restore UnusedMember.Global
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
@@ -382,9 +382,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
bool visible = false;
|
||||
//Show profile only if active
|
||||
if (CBase.Profiles.GetProfiles()[i].Active == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
visible = _Data.ScreenNames.ProfileIDs.All(profileID => profileID != i);
|
||||
}
|
||||
if (visible)
|
||||
_PlayerChooseButtonsVisibleProfiles.Add(i);
|
||||
}
|
||||
|
||||
@@ -375,9 +375,9 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
return _ScreenSongOptions;
|
||||
}
|
||||
|
||||
// ReSharper disable RedundantAssignment
|
||||
// ReSharper disable RedundantAssignment
|
||||
public override void OnSongChange(int songIndex, ref SScreenSongOptions screenSongOptions)
|
||||
// ReSharper restore RedundantAssignment
|
||||
// ReSharper restore RedundantAssignment
|
||||
{
|
||||
_ScreenSongOptions.Selection.SongIndex = -1;
|
||||
|
||||
@@ -396,9 +396,9 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
screenSongOptions = _ScreenSongOptions;
|
||||
}
|
||||
|
||||
// ReSharper disable RedundantAssignment
|
||||
// ReSharper disable RedundantAssignment
|
||||
public override void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions)
|
||||
// ReSharper restore RedundantAssignment
|
||||
// ReSharper restore RedundantAssignment
|
||||
{
|
||||
if (_GameData.CatSongIndices != null && categoryIndex != -1)
|
||||
{
|
||||
|
||||
@@ -23,9 +23,9 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
public class CPartyScreenChallengeMedleyConfig : CMenuParty
|
||||
// ReSharper restore UnusedMember.Global
|
||||
// ReSharper restore UnusedMember.Global
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
|
||||
@@ -41,9 +41,9 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
public List<CText> TextScores;
|
||||
}
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
public class CPartyScreenChallengeMedleyMain : CMenuParty
|
||||
// ReSharper restore UnusedMember.Global
|
||||
// ReSharper restore UnusedMember.Global
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
@@ -352,7 +352,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
private void _UpdateNextPlayerPositions()
|
||||
{
|
||||
float x = (float) CBase.Settings.GetRenderW() / 2 - ((_GameState.NumPlayerAtOnce * _Statics[_StaticNextPlayer].Rect.W) + ((_GameState.NumPlayerAtOnce - 1) * 15)) / 2;
|
||||
float x = (float)CBase.Settings.GetRenderW() / 2 - ((_GameState.NumPlayerAtOnce * _Statics[_StaticNextPlayer].Rect.W) + ((_GameState.NumPlayerAtOnce - 1) * 15)) / 2;
|
||||
const float staticY = 590;
|
||||
const float textY = 550;
|
||||
for (int i = 0; i < _GameState.NumPlayerAtOnce; i++)
|
||||
|
||||
@@ -24,9 +24,9 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
public class CPartyScreenChallengeMedleyNames : CMenuParty
|
||||
// ReSharper restore UnusedMember.Global
|
||||
// ReSharper restore UnusedMember.Global
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
|
||||
@@ -456,16 +456,16 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
return _ScreenSongOptions;
|
||||
}
|
||||
|
||||
// ReSharper disable RedundantAssignment
|
||||
// ReSharper disable RedundantAssignment
|
||||
public override void OnSongChange(int songIndex, ref SScreenSongOptions screenSongOptions)
|
||||
// ReSharper restore RedundantAssignment
|
||||
// ReSharper restore RedundantAssignment
|
||||
{
|
||||
screenSongOptions = _ScreenSongOptions;
|
||||
}
|
||||
|
||||
// ReSharper disable RedundantAssignment
|
||||
// ReSharper disable RedundantAssignment
|
||||
public override void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions)
|
||||
// ReSharper restore RedundantAssignment
|
||||
// ReSharper restore RedundantAssignment
|
||||
{
|
||||
screenSongOptions = _ScreenSongOptions;
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
public class CPartyScreenTicTacToeConfig : CMenuParty
|
||||
// ReSharper restore UnusedMember.Global
|
||||
// ReSharper restore UnusedMember.Global
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
@@ -289,7 +289,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
_ConfigOk = false;
|
||||
for (int i = 0; i < CBase.Songs.NumSongsInCategory(_Data.ScreenConfig.CategoryID); i++)
|
||||
{
|
||||
_ConfigOk=CBase.Songs.GetVisibleSong(i).AvailableGameModes.Any(mode => mode == gm);
|
||||
_ConfigOk = CBase.Songs.GetVisibleSong(i).AvailableGameModes.Any(mode => mode == gm);
|
||||
if (_ConfigOk)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
_Texts[_TextFinishMessage].Color = CBase.Theme.GetPlayerColor(winner);
|
||||
_Texts[_TextFinishMessage].Text = CBase.Language.Translate("TR_SCREENMAIN_WINNER", _PartyModeID) + " " + CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " +
|
||||
winner;
|
||||
winner;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -607,7 +607,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
_Texts[_TextTeamChoosing].Color = CBase.Theme.GetPlayerColor(_GameData.Team + 1);
|
||||
_Texts[_TextTeamChoosing].Text = CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " + (_GameData.Team + 1) + "! " +
|
||||
CBase.Language.Translate("TR_SCREENMAIN_TEAM_CHOOSE", _PartyModeID);
|
||||
CBase.Language.Translate("TR_SCREENMAIN_TEAM_CHOOSE", _PartyModeID);
|
||||
if (_Status == EStatus.JokerRetry || _Status == EStatus.FieldChoosing)
|
||||
_Texts[_TextTeamChoosing].Visible = true;
|
||||
else
|
||||
|
||||
@@ -24,9 +24,9 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
public class CPartyScreenTicTacToeNames : CMenuParty
|
||||
// ReSharper restore UnusedMember.Global
|
||||
// ReSharper restore UnusedMember.Global
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
@@ -405,7 +405,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
_UpdateButtonPlayerChoose(_PlayerChooseButtonsOffset);
|
||||
_Buttons[_ButtonPlayerChooseScrollUp].Enabled = _PlayerChooseButtonsOffset > 0;
|
||||
_Buttons[_ButtonPlayerChooseScrollDown].Enabled = _PlayerChooseButtonsVisibleProfiles.Count >
|
||||
_PlayerChooseButtons.Count + _PlayerChooseButtonsOffset * _PlayerChooseButtonsNumH;
|
||||
_PlayerChooseButtons.Count + _PlayerChooseButtonsOffset * _PlayerChooseButtonsNumH;
|
||||
}
|
||||
|
||||
private void _UpdateButtonPlayerChoose(int offset)
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_CurrentPlaylistElement.Artist.Length > 0 && _CurrentPlaylistElement.Title.Length > 0)
|
||||
if (_CurrentPlaylistElement.Artist != "" && _CurrentPlaylistElement.Title != "")
|
||||
return _CurrentPlaylistElement.Artist + " - " + _CurrentPlaylistElement.Title;
|
||||
else
|
||||
return Path.GetFileNameWithoutExtension(_CurrentPlaylistElement.MusicFilePath);
|
||||
|
||||
+11
-11
@@ -505,7 +505,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
for (int p = 1; p <= CSettings.MaxNumPlayer; p++)
|
||||
{
|
||||
if (MicConfig[p - 1].DeviceName.Length > 0 && MicConfig[p - 1].InputName.Length > 0 && MicConfig[p - 1].Channel > 0)
|
||||
if (MicConfig[p - 1].DeviceName != "" && MicConfig[p - 1].InputName != "" && MicConfig[p - 1].Channel > 0)
|
||||
{
|
||||
writer.WriteStartElement("MicConfig" + p);
|
||||
|
||||
@@ -580,15 +580,15 @@ namespace Vocaluxe.Base
|
||||
if (devices == null)
|
||||
return false;
|
||||
|
||||
for (int dev = 0; dev < devices.Length; dev++)
|
||||
for (int dev = 0; dev < devices.Length; dev++)
|
||||
{
|
||||
for (int inp = 0; inp < devices[dev].Inputs.Count; inp++)
|
||||
{
|
||||
for (int inp = 0; inp < devices[dev].Inputs.Count; inp++)
|
||||
{
|
||||
if (devices[dev].Inputs[inp].PlayerChannel1 == player || devices[dev].Inputs[inp].PlayerChannel2 == player)
|
||||
return true;
|
||||
}
|
||||
if (devices[dev].Inputs[inp].PlayerChannel1 == player || devices[dev].Inputs[inp].PlayerChannel2 == player)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -689,7 +689,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
//Only found a parameter
|
||||
case 1:
|
||||
if (!Regex.IsMatch(parts[0], @"ReplacedStr:::3:::") && parts[0].Length > 0)
|
||||
if (!Regex.IsMatch(parts[0], @"ReplacedStr:::3:::") && parts[0] != "")
|
||||
{
|
||||
//Add parameter
|
||||
_Params.Add(parts[0]);
|
||||
@@ -702,7 +702,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
//Found parameter and value
|
||||
case 2:
|
||||
if (!Regex.IsMatch(parts[0], @"ReplacedStr:::5:::") && parts[0].Length > 0)
|
||||
if (!Regex.IsMatch(parts[0], @"ReplacedStr:::5:::") && parts[0] != "")
|
||||
{
|
||||
//Add parameter
|
||||
_Params.Add(parts[0]);
|
||||
@@ -810,7 +810,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
for (int j = 0; j < CSettings.MaxNumPlayer; j++)
|
||||
{
|
||||
if (Players[j].Length > 0)
|
||||
if (Players[j] != "")
|
||||
{
|
||||
if (Path.GetFileName(CProfiles.Profiles[i].ProfileFile) == Players[j] && CProfiles.Profiles[i].Active == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace Vocaluxe.Base
|
||||
xmlReader.GetValue("//root/Info/Name", out coverTheme.Name, String.Empty);
|
||||
xmlReader.GetValue("//root/Info/Folder", out coverTheme.Folder, String.Empty);
|
||||
|
||||
if (coverTheme.Folder.Length > 0 && coverTheme.Name.Length > 0)
|
||||
if (coverTheme.Folder != "" && coverTheme.Name != "")
|
||||
{
|
||||
coverTheme.File = file;
|
||||
|
||||
@@ -239,9 +239,9 @@ namespace Vocaluxe.Base
|
||||
|
||||
if (_CoverExists(name))
|
||||
continue;
|
||||
// ReSharper disable AssignNullToNotNullAttribute
|
||||
// ReSharper disable AssignNullToNotNullAttribute
|
||||
SCover sk = new SCover {Name = name, Value = Path.Combine(coverTheme.Folder, Path.GetFileName(file))};
|
||||
// ReSharper restore AssignNullToNotNullAttribute
|
||||
// ReSharper restore AssignNullToNotNullAttribute
|
||||
|
||||
sk.Texture = CDraw.AddTexture(Path.Combine(CSettings.FolderCover, sk.Value));
|
||||
|
||||
|
||||
@@ -174,9 +174,7 @@ namespace Vocaluxe.Base
|
||||
}
|
||||
|
||||
if (reader != null)
|
||||
{
|
||||
reader.Dispose();
|
||||
}
|
||||
|
||||
command.CommandText = "INSERT INTO Scores (SongID, PlayerName, Score, LineNr, Date, Medley, Duet, ShortSong, Difficulty) " +
|
||||
"VALUES (@SongID, @PlayerName, @Score, @LineNr, @Date, @Medley, @Duet, @ShortSong, @Difficulty)";
|
||||
|
||||
+8
-10
@@ -341,9 +341,7 @@ namespace Vocaluxe.Base
|
||||
public static float Height
|
||||
{
|
||||
get { return _Height; }
|
||||
set {
|
||||
_Height = value < 0f ? 0f : value;
|
||||
}
|
||||
set { _Height = value < 0f ? 0f : value; }
|
||||
}
|
||||
|
||||
public static float Outline
|
||||
@@ -413,7 +411,7 @@ namespace Vocaluxe.Base
|
||||
if (h <= 0f)
|
||||
return;
|
||||
|
||||
if (text.Length == 0)
|
||||
if (text == "")
|
||||
return;
|
||||
|
||||
Height = h;
|
||||
@@ -432,7 +430,7 @@ namespace Vocaluxe.Base
|
||||
if (h <= 0f)
|
||||
return;
|
||||
|
||||
if (text.Length == 0)
|
||||
if (text == "")
|
||||
return;
|
||||
|
||||
Height = h;
|
||||
@@ -451,7 +449,7 @@ namespace Vocaluxe.Base
|
||||
if (h <= 0f)
|
||||
return;
|
||||
|
||||
if (text.Length == 0)
|
||||
if (text == "")
|
||||
return;
|
||||
|
||||
Height = h;
|
||||
@@ -581,7 +579,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
SFont sf = new SFont();
|
||||
sf.Folder = value;
|
||||
sf.IsThemeFont = themeName.Length > 0;
|
||||
sf.IsThemeFont = themeName != "";
|
||||
sf.ThemeName = themeName;
|
||||
sf.PartyModeID = partyModeId;
|
||||
|
||||
@@ -631,7 +629,7 @@ namespace Vocaluxe.Base
|
||||
string fontTypes;
|
||||
if (partyModeId >= 0)
|
||||
fontTypes = "theme fonts for party mode";
|
||||
else if (themeName.Length > 0)
|
||||
else if (themeName != "")
|
||||
fontTypes = "theme fonts for theme \"" + themeName + "\"";
|
||||
else
|
||||
fontTypes = "basic fonts";
|
||||
@@ -747,7 +745,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
private static int _GetFontIndex(string themeName, string fontName)
|
||||
{
|
||||
if (themeName.Length == 0 || fontName.Length == 0)
|
||||
if (themeName == "" || fontName == "")
|
||||
return -1;
|
||||
|
||||
for (int i = 0; i < _Fonts.Count; i++)
|
||||
@@ -761,7 +759,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
private static int _GetFontIndexParty(int partyModeID, string fontName)
|
||||
{
|
||||
if (partyModeID == -1 || fontName.Length == 0)
|
||||
if (partyModeID == -1 || fontName == "")
|
||||
return -1;
|
||||
|
||||
for (int i = 0; i < _Fonts.Count; i++)
|
||||
|
||||
@@ -772,9 +772,7 @@ namespace Vocaluxe.Base
|
||||
debugOutput.Add(CSongs.NumSongsWithCoverLoaded.ToString(CLanguage.Translate("TR_DEBUG_SONGS") + ": 00000"));
|
||||
|
||||
if (CConfig.DebugLevel >= EDebugLevel.TR_CONFIG_LEVEL_MAX)
|
||||
{
|
||||
debugOutput.Add(_Cursor.X.ToString(CLanguage.Translate("TR_DEBUG_MOUSE") + " : (0000/") + _Cursor.Y.ToString("0000)"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -783,7 +781,7 @@ namespace Vocaluxe.Base
|
||||
CFonts.Height = 30;
|
||||
SColorF gray = new SColorF(1f, 1f, 1f, 0.5f);
|
||||
float y = 0;
|
||||
foreach (var txt in debugOutput)
|
||||
foreach (string txt in debugOutput)
|
||||
{
|
||||
RectangleF rect = new RectangleF(CSettings.RenderW - CFonts.GetTextWidth(txt), y, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt));
|
||||
CDraw.DrawColor(gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear));
|
||||
@@ -796,7 +794,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
_Cursor.UnloadTextures();
|
||||
|
||||
if (CTheme.Cursor.Color.Length > 0)
|
||||
if (CTheme.Cursor.Color != "")
|
||||
{
|
||||
SColorF color;
|
||||
color = CTheme.GetColor(CTheme.Cursor.Color, -1);
|
||||
|
||||
@@ -62,9 +62,9 @@ namespace Vocaluxe.Base
|
||||
if (_LogFile == null)
|
||||
_Open();
|
||||
|
||||
// ReSharper disable PossibleNullReferenceException
|
||||
// ReSharper disable PossibleNullReferenceException
|
||||
_LogFile.WriteLine(text);
|
||||
// ReSharper restore PossibleNullReferenceException
|
||||
// ReSharper restore PossibleNullReferenceException
|
||||
_LogFile.Flush();
|
||||
}
|
||||
|
||||
|
||||
@@ -343,10 +343,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
private static Assembly _CompileFiles(string[] files)
|
||||
{
|
||||
if (files == null)
|
||||
return null;
|
||||
|
||||
if (files.Length == 0)
|
||||
if (files == null || files.Length == 0)
|
||||
return null;
|
||||
|
||||
CompilerParameters compilerParams = new CompilerParameters();
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
if (playlistID < 0 || playlistID >= _Playlists.Count)
|
||||
return;
|
||||
if (_Playlists[playlistID].PlaylistFile.Length > 0)
|
||||
if (_Playlists[playlistID].PlaylistFile != "")
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace Vocaluxe.Base
|
||||
profile.GuestProfile = EOffOn.TR_CONFIG_OFF;
|
||||
profile.Active = EOffOn.TR_CONFIG_ON;
|
||||
|
||||
if (fileName.Length > 0)
|
||||
if (fileName != "")
|
||||
profile.ProfileFile = Path.Combine(CSettings.FolderProfiles, fileName);
|
||||
else
|
||||
profile.ProfileFile = String.Empty;
|
||||
@@ -163,7 +163,7 @@ namespace Vocaluxe.Base
|
||||
return String.Empty;
|
||||
|
||||
SProfile profile = _Profiles[profileNr];
|
||||
if (profile.PlayerName.Length > 0)
|
||||
if (profile.PlayerName != "")
|
||||
profile.PlayerName = profile.PlayerName.Remove(profile.PlayerName.Length - 1);
|
||||
_Profiles[profileNr] = profile;
|
||||
|
||||
@@ -266,7 +266,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
if (profileID < 0 || profileID >= _Profiles.Count)
|
||||
return;
|
||||
if (_Profiles[profileID].ProfileFile.Length > 0)
|
||||
if (_Profiles[profileID].ProfileFile != "")
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -306,7 +306,7 @@ namespace Vocaluxe.Base
|
||||
if (profileID < 0 || profileID >= _Profiles.Count)
|
||||
return;
|
||||
|
||||
if (_Profiles[profileID].ProfileFile.Length == 0)
|
||||
if (_Profiles[profileID].ProfileFile == "")
|
||||
{
|
||||
string filename = string.Empty;
|
||||
foreach (char chr in _Profiles[profileID].PlayerName)
|
||||
@@ -315,7 +315,7 @@ namespace Vocaluxe.Base
|
||||
filename += chr.ToString();
|
||||
}
|
||||
|
||||
if (filename.Length == 0)
|
||||
if (filename == "")
|
||||
filename = "1";
|
||||
|
||||
int i = 0;
|
||||
|
||||
@@ -148,9 +148,9 @@ namespace Vocaluxe.Base
|
||||
VersionMinor + "." +
|
||||
VersionSub + " (" + Arch + ")";
|
||||
|
||||
// ReSharper disable ConditionIsAlwaysTrueOrFalse
|
||||
// ReSharper disable ConditionIsAlwaysTrueOrFalse
|
||||
if (VersionRevision != ERevision.Release)
|
||||
// ReSharper restore ConditionIsAlwaysTrueOrFalse
|
||||
// ReSharper restore ConditionIsAlwaysTrueOrFalse
|
||||
version += " " + _GetVersionStatus() + String.Format(" ({0:0000)}", Build);
|
||||
|
||||
return version;
|
||||
@@ -160,7 +160,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
string version = ProgramName;
|
||||
|
||||
if (ProgramCodeName.Length > 0)
|
||||
if (ProgramCodeName != "")
|
||||
version += " \"" + ProgramCodeName + "\"";
|
||||
|
||||
return version + " " + GetVersionText();
|
||||
@@ -170,9 +170,9 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
string result;
|
||||
|
||||
// ReSharper disable ConditionIsAlwaysTrueOrFalse
|
||||
// ReSharper disable ConditionIsAlwaysTrueOrFalse
|
||||
if (VersionRevision != ERevision.Release)
|
||||
// ReSharper restore ConditionIsAlwaysTrueOrFalse
|
||||
// ReSharper restore ConditionIsAlwaysTrueOrFalse
|
||||
result = Enum.GetName(typeof(ERevision), VersionRevision);
|
||||
|
||||
return result;
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace Vocaluxe.Base
|
||||
int noCategoryIndex = -1;
|
||||
for (int i = 0; i < CSongs.Sorter.SortedSongs.Length; i++)
|
||||
{
|
||||
if (CSongs.Sorter.SortedSongs[i].SortString.Length > 0)
|
||||
if (CSongs.Sorter.SortedSongs[i].SortString != "")
|
||||
{
|
||||
if (CSongs.Sorter.SortedSongs[i].SortString != category)
|
||||
{
|
||||
@@ -154,7 +154,7 @@ namespace Vocaluxe.Base
|
||||
for (int i = 0; i < CSongs.Sorter.SortedSongs.Length; i++)
|
||||
{
|
||||
string year = CSongs.Sorter.SortedSongs[i].SortString;
|
||||
if (year.Length > 0)
|
||||
if (year != "")
|
||||
{
|
||||
year = year.Substring(0, 3);
|
||||
CSongs.Sorter.SortedSongs[i].SortString = year + "0 - " + year + "9";
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Vocaluxe.Base
|
||||
_FilteredSongs.Clear();
|
||||
|
||||
string[] searchStrings = null;
|
||||
if (_SearchString.Length > 0)
|
||||
if (_SearchString != "")
|
||||
searchStrings = _SearchString.ToUpper().Split(new char[] {' '});
|
||||
|
||||
foreach (CSong song in CSongs.Songs)
|
||||
|
||||
@@ -125,14 +125,14 @@ namespace Vocaluxe.Base
|
||||
private List<SSongPointer> _CreateSortList(string fieldName)
|
||||
{
|
||||
List<SSongPointer> sortList = new List<SSongPointer>();
|
||||
if (fieldName.Length == 0)
|
||||
if (fieldName == "")
|
||||
CSongs.Filter.FilteredSongs.ForEach(song => sortList.Add(new SSongPointer(song.ID, "")));
|
||||
else
|
||||
{
|
||||
FieldInfo field = typeof(CSong).GetField(fieldName, BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public);
|
||||
if (field == null)
|
||||
{
|
||||
CLog.LogError("Unknow sorting field: "+fieldName);
|
||||
CLog.LogError("Unknow sorting field: " + fieldName);
|
||||
return _CreateSortList("");
|
||||
}
|
||||
bool isString = field.FieldType == typeof(string);
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace Vocaluxe.Base
|
||||
break;
|
||||
}
|
||||
|
||||
if (file.Length == 0)
|
||||
if (file == "")
|
||||
return -1;
|
||||
|
||||
int stream = Load(file);
|
||||
|
||||
@@ -426,7 +426,7 @@ namespace Vocaluxe.Base
|
||||
if (version == _ThemeSystemVersion)
|
||||
{
|
||||
xmlReader.GetValue("//root/Info/Name", out theme.Name, String.Empty);
|
||||
if (theme.Name.Length > 0)
|
||||
if (theme.Name != "")
|
||||
{
|
||||
xmlReader.GetValue("//root/Info/Author", out theme.Author, String.Empty);
|
||||
xmlReader.GetValue("//root/Info/SkinFolder", out theme.SkinFolder, String.Empty);
|
||||
@@ -493,7 +493,7 @@ namespace Vocaluxe.Base
|
||||
if (version == _SkinSystemVersion)
|
||||
{
|
||||
xmlReader.GetValue("//root/Info/Name", out skin.Name, String.Empty);
|
||||
if (skin.Name.Length > 0)
|
||||
if (skin.Name != "")
|
||||
{
|
||||
xmlReader.GetValue("//root/Info/Author", out skin.Author, String.Empty);
|
||||
xmlReader.TryGetIntValue("//root/Info/SkinVersionMajor", ref skin.SkinVersionMajor);
|
||||
@@ -835,7 +835,7 @@ namespace Vocaluxe.Base
|
||||
writer.WriteElementString("W", Cursor.W.ToString("#0.000"));
|
||||
writer.WriteElementString("H", Cursor.H.ToString("#0.000"));
|
||||
|
||||
if (Cursor.Color.Length > 0)
|
||||
if (Cursor.Color != "")
|
||||
writer.WriteElementString("Color", Cursor.Color);
|
||||
else
|
||||
{
|
||||
|
||||
@@ -86,5 +86,10 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
return _Webcam.GetDevices();
|
||||
}
|
||||
|
||||
public static bool IsDeviceAvailable()
|
||||
{
|
||||
return _Webcam.IsDeviceAvailable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,5 @@
|
||||
namespace Vocaluxe.GameModes
|
||||
{
|
||||
// Nomal singing
|
||||
class CGameModeNormal : CGameMode
|
||||
{}
|
||||
class CGameModeNormal : CGameMode {}
|
||||
}
|
||||
@@ -346,7 +346,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
}
|
||||
|
||||
// Draw Basic Text
|
||||
public void DrawText(string text, int x, int y, int h, int z=0)
|
||||
public void DrawText(string text, int x, int y, int h, int z = 0)
|
||||
{
|
||||
CFonts.DrawText(text, h, x, y, z, new SColorF(1, 1, 1, 1));
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
if (setValue > 32)
|
||||
setValue = 32;
|
||||
|
||||
while (samples<=setValue)
|
||||
while (samples <= setValue)
|
||||
{
|
||||
GraphicsMode mode;
|
||||
try
|
||||
@@ -563,7 +563,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
public void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2) {}
|
||||
|
||||
// Draw Basic Text (must be deleted later)
|
||||
public void DrawText(string text, int x, int y, int h, int z=0)
|
||||
public void DrawText(string text, int x, int y, int h, int z = 0)
|
||||
{
|
||||
CFonts.DrawText(text, h, x, y, z, new SColorF(1, 1, 1, 1));
|
||||
}
|
||||
@@ -1094,7 +1094,8 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
public void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored)
|
||||
{
|
||||
if (Math.Abs(rect.W) < float.Epsilon || Math.Abs(rect.H) < float.Epsilon || Math.Abs(bounds.H) < float.Epsilon || Math.Abs(bounds.W) < float.Epsilon || Math.Abs(color.A) < float.Epsilon)
|
||||
if (Math.Abs(rect.W) < float.Epsilon || Math.Abs(rect.H) < float.Epsilon || Math.Abs(bounds.H) < float.Epsilon || Math.Abs(bounds.W) < float.Epsilon ||
|
||||
Math.Abs(color.A) < float.Epsilon)
|
||||
return;
|
||||
|
||||
if (bounds.X > rect.X + rect.W || bounds.X + bounds.W < rect.X)
|
||||
@@ -1233,7 +1234,8 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
public void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height)
|
||||
{
|
||||
if (Math.Abs(rect.W) < float.Epsilon || Math.Abs(rect.H) < float.Epsilon || Math.Abs(bounds.H) < float.Epsilon || Math.Abs(bounds.W) < float.Epsilon || Math.Abs(color.A) < float.Epsilon || height <= float.Epsilon)
|
||||
if (Math.Abs(rect.W) < float.Epsilon || Math.Abs(rect.H) < float.Epsilon || Math.Abs(bounds.H) < float.Epsilon || Math.Abs(bounds.W) < float.Epsilon ||
|
||||
Math.Abs(color.A) < float.Epsilon || height <= float.Epsilon)
|
||||
return;
|
||||
|
||||
if (bounds.X > rect.X + rect.W || bounds.X + bounds.W < rect.X)
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
void MakeScreenShot();
|
||||
|
||||
// Draw Basic Text (must be deleted later)
|
||||
void DrawText(string text, int x, int y, int h, int z=0);
|
||||
void DrawText(string text, int x, int y, int h, int z = 0);
|
||||
|
||||
STexture AddTexture(string texturePath);
|
||||
STexture AddTexture(Bitmap bitmap);
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Vocaluxe.Lib.Playlist
|
||||
|
||||
public void SavePlaylist()
|
||||
{
|
||||
if (PlaylistFile.Length == 0)
|
||||
if (PlaylistFile == "")
|
||||
{
|
||||
string filename = string.Empty;
|
||||
foreach (char chr in PlaylistName)
|
||||
@@ -68,7 +68,7 @@ namespace Vocaluxe.Lib.Playlist
|
||||
filename += chr.ToString();
|
||||
}
|
||||
|
||||
if (filename.Length == 0)
|
||||
if (filename == "")
|
||||
filename = "1";
|
||||
|
||||
int i = 0;
|
||||
@@ -146,7 +146,8 @@ namespace Vocaluxe.Lib.Playlist
|
||||
List<string> songs = xmlReader.GetValues("Songs");
|
||||
EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL;
|
||||
|
||||
foreach (string song in songs) {
|
||||
foreach (string song in songs)
|
||||
{
|
||||
string artist;
|
||||
string title;
|
||||
xmlReader.GetValue("//root/Songs/" + song + "/Artist", out artist, String.Empty);
|
||||
@@ -157,7 +158,8 @@ namespace Vocaluxe.Lib.Playlist
|
||||
playlistSong.SongID = -1;
|
||||
CSong[] allSongs = CSongs.AllSongs;
|
||||
|
||||
foreach (CSong curSong in allSongs) {
|
||||
foreach (CSong curSong in allSongs)
|
||||
{
|
||||
if (curSong.Artist != artist || curSong.Title != title)
|
||||
continue;
|
||||
playlistSong.SongID = curSong.ID;
|
||||
|
||||
@@ -844,7 +844,7 @@ namespace Vocaluxe.Lib.Sound
|
||||
|
||||
if (buffer != 0)
|
||||
{
|
||||
ALFormat alFormat = (_Format.ChannelCount == 2)?ALFormat.Stereo16:ALFormat.Mono16;
|
||||
ALFormat alFormat = (_Format.ChannelCount == 2) ? ALFormat.Stereo16 : ALFormat.Mono16;
|
||||
AL.BufferData(buffer, alFormat, buf, buf.Length, _Format.SamplesPerSecond);
|
||||
Console.WriteLine("Write to Buffer: " + buffer);
|
||||
AL.SourceQueueBuffer(_Source, buffer);
|
||||
|
||||
@@ -120,19 +120,16 @@ namespace Vocaluxe.Lib.Sound
|
||||
if (deviceConfig == null)
|
||||
return false;
|
||||
|
||||
if (_RecHandle == null)
|
||||
if (_RecHandle == null || _RecHandle.Length == 0)
|
||||
return false;
|
||||
|
||||
if (_RecHandle.Length == 0)
|
||||
return false;
|
||||
foreach (CBuffer buffer in _Buffer)
|
||||
buffer.Reset();
|
||||
|
||||
for (int i = 0; i < _Buffer.Length; i++)
|
||||
_Buffer[i].Reset();
|
||||
|
||||
for (int i = 0; i < _RecHandle.Length; i++)
|
||||
foreach (IntPtr handle in _RecHandle)
|
||||
{
|
||||
int waitcount = 0;
|
||||
while (waitcount < 5 && CPortAudio.Pa_IsStreamStopped(_RecHandle[i]) == CPortAudio.EPaError.PaStreamIsNotStopped)
|
||||
while (waitcount < 5 && CPortAudio.Pa_IsStreamStopped(handle) == CPortAudio.EPaError.PaStreamIsNotStopped)
|
||||
{
|
||||
Thread.Sleep(1);
|
||||
waitcount++;
|
||||
|
||||
@@ -36,9 +36,7 @@ namespace Vocaluxe.Lib.Sound.Decoder
|
||||
private string _FileName;
|
||||
private bool _FileOpened;
|
||||
|
||||
public void Init()
|
||||
{
|
||||
}
|
||||
public void Init() {}
|
||||
|
||||
public void Open(string fileName, bool loop)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Vocaluxe.Lib.Sound.Decoder
|
||||
void Init();
|
||||
void Close();
|
||||
|
||||
void Open(string fileName, bool loop=false);
|
||||
void Open(string fileName, bool loop = false);
|
||||
SFormatInfo GetFormatInfo();
|
||||
|
||||
float GetLength();
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Vocaluxe.Lib.Sound.PortAudio
|
||||
</summary>
|
||||
*/
|
||||
|
||||
public static partial class CPortAudio
|
||||
public static class CPortAudio
|
||||
{
|
||||
#region **** PORTAUDIO CALLBACKS ****
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
|
||||
@@ -141,6 +141,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
//Size of the data in the buffer.
|
||||
public readonly Int32 BufferSize;
|
||||
}
|
||||
|
||||
// Contains information about an Acinerella package.
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct SACPackage
|
||||
@@ -278,9 +279,9 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
string filename
|
||||
);
|
||||
|
||||
// ReSharper disable UnusedMethodReturnValue.Global
|
||||
// ReSharper disable UnusedMethodReturnValue.Global
|
||||
public static Int32 AcOpen2(
|
||||
// ReSharper restore UnusedMethodReturnValue.Global
|
||||
// ReSharper restore UnusedMethodReturnValue.Global
|
||||
IntPtr pAcInstance,
|
||||
string filename
|
||||
)
|
||||
@@ -430,9 +431,9 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
[DllImport(_AcDll, EntryPoint = "ac_seek", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
|
||||
private static extern Int32 _ac_seek(IntPtr pAcDecoder, Int32 dir, Int64 targetPos);
|
||||
|
||||
// ReSharper disable UnusedMethodReturnValue.Global
|
||||
// ReSharper disable UnusedMethodReturnValue.Global
|
||||
public static Int32 AcSeek(IntPtr pAcDecoder, Int32 dir, Int64 targetPos)
|
||||
// ReSharper restore UnusedMethodReturnValue.Global
|
||||
// ReSharper restore UnusedMethodReturnValue.Global
|
||||
{
|
||||
lock (_Lock)
|
||||
{
|
||||
@@ -450,5 +451,6 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
out Int32 scoreMax
|
||||
);
|
||||
}
|
||||
|
||||
// ReSharper restore UnusedMember.Global
|
||||
}
|
||||
@@ -262,10 +262,7 @@ namespace Vocaluxe.Lib.Video
|
||||
|
||||
public float Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return _FileOpened ? _Duration : 0f;
|
||||
}
|
||||
get { return _FileOpened ? _Duration : 0f; }
|
||||
}
|
||||
|
||||
public bool Paused
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Vocaluxe.Lib.Video.Gstreamer
|
||||
{
|
||||
public struct SNativeFrame
|
||||
{
|
||||
// ReSharper disable UnassignedField.Global
|
||||
// ReSharper disable UnassignedField.Global
|
||||
internal IntPtr Buffer;
|
||||
public int Size;
|
||||
public int Width;
|
||||
|
||||
@@ -101,7 +101,8 @@ namespace Vocaluxe.Lib.Webcam
|
||||
num++;
|
||||
VideoCaptureDevice tmpdev = new VideoCaptureDevice(info.MonikerString);
|
||||
|
||||
foreach (VideoCapabilities capabilities in tmpdev.VideoCapabilities) {
|
||||
foreach (VideoCapabilities capabilities in tmpdev.VideoCapabilities)
|
||||
{
|
||||
SCapabilities item = new SCapabilities
|
||||
{
|
||||
Framerate = capabilities.FrameRate,
|
||||
@@ -162,6 +163,11 @@ namespace Vocaluxe.Lib.Webcam
|
||||
return _Devices.ToArray();
|
||||
}
|
||||
|
||||
public bool IsDeviceAvailable()
|
||||
{
|
||||
return _Devices.Count > 0;
|
||||
}
|
||||
|
||||
public bool Select(SWebcamConfig config)
|
||||
{
|
||||
//Close old camera connection
|
||||
|
||||
@@ -59,6 +59,7 @@ namespace Vocaluxe.Lib.Webcam
|
||||
Bitmap GetBitmap();
|
||||
SWebcamConfig GetConfig();
|
||||
SWebcamDevice[] GetDevices();
|
||||
bool IsDeviceAvailable();
|
||||
|
||||
bool Select(SWebcamConfig webcamConfig);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Vocaluxe.Screens
|
||||
_ThemeStatics = new string[] {_StaticBG, _StaticCover};
|
||||
_ThemeTexts = new string[] {_TextCurrentSong};
|
||||
|
||||
_ThemeButtons = new string[]{_ButtonPlay,_ButtonPause,_ButtonPrevious,_ButtonNext,_ButtonRepeat,_ButtonShowVideo,_ButtonSing,_ButtonToBackgroundVideo};
|
||||
_ThemeButtons = new string[] {_ButtonPlay, _ButtonPause, _ButtonPrevious, _ButtonNext, _ButtonRepeat, _ButtonShowVideo, _ButtonSing, _ButtonToBackgroundVideo};
|
||||
}
|
||||
|
||||
public override void LoadTheme(string xmlPath)
|
||||
|
||||
@@ -105,8 +105,8 @@ namespace Vocaluxe.Screens
|
||||
_SongLoaderThread = new Thread(CSongs.LoadSongs) {Name = "SongLoader"};
|
||||
|
||||
_Texts[_TextStatus].Text = CLanguage.Translate("TR_SCREENLOAD_TOTAL") + ": 0 " +
|
||||
CLanguage.Translate("TR_SCREENLOAD_SONGS") + " (0 " +
|
||||
CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")";
|
||||
CLanguage.Translate("TR_SCREENLOAD_SONGS") + " (0 " +
|
||||
CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")";
|
||||
|
||||
_SkipIntro = false;
|
||||
_CurrentIntroVideoNr = -1;
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Vocaluxe.Screens
|
||||
return true;
|
||||
}
|
||||
|
||||
// ReSharper disable RedundantOverridenMember
|
||||
// ReSharper disable RedundantOverridenMember
|
||||
public override void OnShow()
|
||||
{
|
||||
base.OnShow();
|
||||
@@ -132,7 +132,8 @@ namespace Vocaluxe.Screens
|
||||
//if (Snowflakes != null)
|
||||
// Snowflakes.Resume();
|
||||
}
|
||||
// ReSharper restore RedundantOverridenMember
|
||||
|
||||
// ReSharper restore RedundantOverridenMember
|
||||
|
||||
public override bool UpdateGame()
|
||||
{
|
||||
@@ -150,9 +151,9 @@ namespace Vocaluxe.Screens
|
||||
//Snowflakes.Draw();
|
||||
_DrawFG();
|
||||
|
||||
// ReSharper disable ConditionIsAlwaysTrueOrFalse
|
||||
// ReSharper disable ConditionIsAlwaysTrueOrFalse
|
||||
if (CSettings.VersionRevision != ERevision.Release)
|
||||
// ReSharper restore ConditionIsAlwaysTrueOrFalse
|
||||
// ReSharper restore ConditionIsAlwaysTrueOrFalse
|
||||
{
|
||||
CFonts.SetFont("Normal");
|
||||
CFonts.Style = EStyle.Normal;
|
||||
@@ -162,7 +163,7 @@ namespace Vocaluxe.Screens
|
||||
return true;
|
||||
}
|
||||
|
||||
// ReSharper disable RedundantOverridenMember
|
||||
// ReSharper disable RedundantOverridenMember
|
||||
public override void OnClose()
|
||||
{
|
||||
base.OnClose();
|
||||
@@ -170,6 +171,7 @@ namespace Vocaluxe.Screens
|
||||
//if (Snowflakes != null)
|
||||
// Snowflakes.Pause();
|
||||
}
|
||||
// ReSharper restore RedundantOverridenMember
|
||||
|
||||
// ReSharper restore RedundantOverridenMember
|
||||
}
|
||||
}
|
||||
@@ -375,7 +375,8 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
processed = true;
|
||||
CGraphics.FadeTo(EScreens.ScreenSong);
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
processed = true;
|
||||
_StartSong();
|
||||
@@ -511,12 +512,10 @@ namespace Vocaluxe.Screens
|
||||
if (mouseEvent.LB && _IsMouseOver(mouseEvent))
|
||||
{
|
||||
if (_Buttons[_ButtonBack].Selected)
|
||||
{
|
||||
CGraphics.FadeTo(EScreens.ScreenSong);
|
||||
}else if (_Buttons[_ButtonStart].Selected)
|
||||
{
|
||||
else if (_Buttons[_ButtonStart].Selected)
|
||||
_StartSong();
|
||||
}else
|
||||
else
|
||||
_UpdatePlayerNumber();
|
||||
//Update Tiles-List
|
||||
_NameSelections[_NameSelection].UpdateList();
|
||||
@@ -587,7 +586,7 @@ namespace Vocaluxe.Screens
|
||||
for (int i = 0; i < CSettings.MaxNumPlayer; i++)
|
||||
{
|
||||
//Update texture and name
|
||||
if (CConfig.Players[i].Length > 0)
|
||||
if (CConfig.Players[i] != "")
|
||||
{
|
||||
if (CGame.Player[i].ProfileID > -1 && CProfiles.NumProfiles > CGame.Player[i].ProfileID)
|
||||
{
|
||||
@@ -675,7 +674,7 @@ namespace Vocaluxe.Screens
|
||||
_Statics["StaticPlayer" + i].Visible = true;
|
||||
_Statics["StaticPlayerAvatar" + i].Visible = true;
|
||||
_Texts["TextPlayer" + i].Visible = true;
|
||||
if (_Texts["TextPlayer" + i].Text.Length == 0)
|
||||
if (_Texts["TextPlayer" + i].Text == "")
|
||||
_Texts["TextPlayer" + i].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + i;
|
||||
_Equalizers["EqualizerPlayer" + i].Visible = true;
|
||||
if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet)
|
||||
|
||||
@@ -175,42 +175,40 @@ namespace Vocaluxe.Screens
|
||||
|
||||
SWebcamDevice[] devices = CWebcam.GetDevices();
|
||||
|
||||
bool ssVisible = false;
|
||||
try
|
||||
{
|
||||
if (devices != null)
|
||||
if (devices != null && devices.Length > 0)
|
||||
{
|
||||
if (devices.Length > 0)
|
||||
{
|
||||
_DeviceNr = 0;
|
||||
_CapabilityNr = 0;
|
||||
_GetFirstConfiguredWebcamDevice(ref _DeviceNr, ref _CapabilityNr);
|
||||
_DeviceNr = 0;
|
||||
_CapabilityNr = 0;
|
||||
_GetFirstConfiguredWebcamDevice(ref _DeviceNr, ref _CapabilityNr);
|
||||
|
||||
foreach (SWebcamDevice d in devices)
|
||||
_SelectSlides[_SelectSlideWebcamDevices].AddValue(d.Name);
|
||||
_SelectSlides[_SelectSlideWebcamDevices].Selection = _DeviceNr;
|
||||
foreach (SWebcamDevice d in devices)
|
||||
_SelectSlides[_SelectSlideWebcamDevices].AddValue(d.Name);
|
||||
_SelectSlides[_SelectSlideWebcamDevices].Selection = _DeviceNr;
|
||||
|
||||
foreach (SCapabilities c in devices[_DeviceNr].Capabilities)
|
||||
_SelectSlides[_SelectSlideWebcamCapabilities].AddValue(c.Width + " x " + c.Height + " @ " + c.Framerate + " FPS ");
|
||||
_Config.MonikerString = devices[_SelectSlides[_SelectSlideWebcamDevices].Selection].MonikerString;
|
||||
_Config.Width = devices[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Width;
|
||||
_Config.Height = devices[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Height;
|
||||
_Config.Framerate =
|
||||
devices[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Framerate;
|
||||
CWebcam.Close();
|
||||
CWebcam.Select(CConfig.WebcamConfig);
|
||||
CWebcam.Start();
|
||||
}
|
||||
foreach (SCapabilities c in devices[_DeviceNr].Capabilities)
|
||||
_SelectSlides[_SelectSlideWebcamCapabilities].AddValue(c.Width + " x " + c.Height + " @ " + c.Framerate + " FPS ");
|
||||
_Config.MonikerString = devices[_SelectSlides[_SelectSlideWebcamDevices].Selection].MonikerString;
|
||||
_Config.Width = devices[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Width;
|
||||
_Config.Height = devices[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Height;
|
||||
_Config.Framerate =
|
||||
devices[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Framerate;
|
||||
CWebcam.Close();
|
||||
CWebcam.Select(CConfig.WebcamConfig);
|
||||
CWebcam.Start();
|
||||
ssVisible = true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CLog.LogError("Error on listing webcam capabilities: " + e.Message);
|
||||
devices = null;
|
||||
}
|
||||
|
||||
_SelectSlides[_SelectSlideWebcamDevices].Visible = devices != null && devices.Length > 0;
|
||||
_SelectSlides[_SelectSlideWebcamCapabilities].Visible = devices != null && devices.Length > 0;
|
||||
_Statics[_StaticWebcamOutput].Visible = devices != null && devices.Length > 0;
|
||||
_SelectSlides[_SelectSlideWebcamDevices].Visible = ssVisible;
|
||||
_SelectSlides[_SelectSlideWebcamCapabilities].Visible = ssVisible;
|
||||
_Statics[_StaticWebcamOutput].Visible = ssVisible;
|
||||
}
|
||||
|
||||
private void _SaveConfig()
|
||||
@@ -234,18 +232,18 @@ namespace Vocaluxe.Screens
|
||||
_DeviceNr = _SelectSlides[_SelectSlideWebcamDevices].Selection;
|
||||
_CapabilityNr = 0;
|
||||
|
||||
SWebcamDevice[] d = CWebcam.GetDevices();
|
||||
for (int i = 0; i < d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities.Count; i++)
|
||||
SWebcamDevice d = CWebcam.GetDevices()[_DeviceNr];
|
||||
for (int i = 0; i < d.Capabilities.Count; i++)
|
||||
{
|
||||
_SelectSlides[_SelectSlideWebcamCapabilities].AddValue(d[_DeviceNr].Capabilities[i].Width + " x " + d[_DeviceNr].Capabilities[i].Height +
|
||||
" @ " + d[_DeviceNr].Capabilities[i].Framerate + "FPS");
|
||||
_SelectSlides[_SelectSlideWebcamCapabilities].AddValue(d.Capabilities[i].Width + " x " + d.Capabilities[i].Height +
|
||||
" @ " + d.Capabilities[i].Framerate + "FPS");
|
||||
}
|
||||
_SelectSlides[_SelectSlideWebcamCapabilities].Selection = 0;
|
||||
|
||||
_Config.MonikerString = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].MonikerString;
|
||||
_Config.Width = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Width;
|
||||
_Config.Height = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Height;
|
||||
_Config.Framerate = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Framerate;
|
||||
_Config.MonikerString = d.MonikerString;
|
||||
_Config.Width = d.Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Width;
|
||||
_Config.Height = d.Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Height;
|
||||
_Config.Framerate = d.Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Framerate;
|
||||
|
||||
CWebcam.Close();
|
||||
CWebcam.Select(_Config);
|
||||
@@ -259,11 +257,11 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
_CapabilityNr = _SelectSlides[_SelectSlideWebcamCapabilities].Selection;
|
||||
|
||||
SWebcamDevice[] d = CWebcam.GetDevices();
|
||||
_Config.MonikerString = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].MonikerString;
|
||||
_Config.Width = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Width;
|
||||
_Config.Height = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Height;
|
||||
_Config.Framerate = d[_SelectSlides[_SelectSlideWebcamDevices].Selection].Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Framerate;
|
||||
SWebcamDevice d = CWebcam.GetDevices()[_SelectSlides[_SelectSlideWebcamDevices].Selection];
|
||||
_Config.MonikerString = d.MonikerString;
|
||||
_Config.Width = d.Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Width;
|
||||
_Config.Height = d.Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Height;
|
||||
_Config.Framerate = d.Capabilities[_SelectSlides[_SelectSlideWebcamCapabilities].Selection].Framerate;
|
||||
|
||||
CWebcam.Close();
|
||||
CWebcam.Select(_Config);
|
||||
@@ -280,17 +278,16 @@ namespace Vocaluxe.Screens
|
||||
|
||||
for (int i = 0; i < devices.Length; i++)
|
||||
{
|
||||
if (devices[i].MonikerString == CConfig.WebcamConfig.MonikerString)
|
||||
if (devices[i].MonikerString != CConfig.WebcamConfig.MonikerString)
|
||||
continue;
|
||||
for (int j = 0; j < devices[i].Capabilities.Count; j++)
|
||||
{
|
||||
for (int j = 0; j < devices[i].Capabilities.Count; j++)
|
||||
if (devices[i].Capabilities[j].Framerate == CConfig.WebcamConfig.Framerate && devices[i].Capabilities[j].Width == CConfig.WebcamConfig.Width &&
|
||||
devices[i].Capabilities[j].Height == CConfig.WebcamConfig.Height)
|
||||
{
|
||||
if (devices[i].Capabilities[j].Framerate == CConfig.WebcamConfig.Framerate && devices[i].Capabilities[j].Width == CConfig.WebcamConfig.Width &&
|
||||
devices[i].Capabilities[j].Height == CConfig.WebcamConfig.Height)
|
||||
{
|
||||
device = i;
|
||||
capabilities = j;
|
||||
return;
|
||||
}
|
||||
device = i;
|
||||
capabilities = j;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,10 +82,7 @@ namespace Vocaluxe.Screens
|
||||
_Buttons[_ButtonSaveSnapshot].Visible = false;
|
||||
_Buttons[_ButtonDiscardSnapshot].Visible = false;
|
||||
_Buttons[_ButtonTakeSnapshot].Visible = false;
|
||||
if (CWebcam.GetDevices().Length > 0)
|
||||
_Buttons[_ButtonWebcam].Visible = true;
|
||||
else
|
||||
_Buttons[_ButtonWebcam].Visible = false;
|
||||
_Buttons[_ButtonWebcam].Visible = CWebcam.IsDeviceAvailable();
|
||||
_SelectSlides[_SelectSlideDifficulty].SetValues<EGameDifficulty>(0);
|
||||
_SelectSlides[_SelectSlideGuestProfile].SetValues<EOffOn>(0);
|
||||
_SelectSlides[_SelectSlideActive].SetValues<EOffOn>(0);
|
||||
@@ -132,13 +129,13 @@ namespace Vocaluxe.Screens
|
||||
}
|
||||
else if (_Buttons[_ButtonDelete].Selected)
|
||||
_DeleteProfile();
|
||||
else if (_Buttons[_ButtonWebcam].Selected && CWebcam.GetDevices().Length > 0)
|
||||
else if (_Buttons[_ButtonWebcam].Selected && CWebcam.IsDeviceAvailable())
|
||||
_OnWebcam();
|
||||
else if (_Buttons[_ButtonSaveSnapshot].Selected && CWebcam.GetDevices().Length > 0)
|
||||
else if (_Buttons[_ButtonSaveSnapshot].Selected && CWebcam.IsDeviceAvailable())
|
||||
_OnSaveSnapshot();
|
||||
else if (_Buttons[_ButtonDiscardSnapshot].Selected && CWebcam.GetDevices().Length > 0)
|
||||
else if (_Buttons[_ButtonDiscardSnapshot].Selected && CWebcam.IsDeviceAvailable())
|
||||
_OnDiscardSnapshot();
|
||||
else if (_Buttons[_ButtonTakeSnapshot].Selected && CWebcam.GetDevices().Length > 0)
|
||||
else if (_Buttons[_ButtonTakeSnapshot].Selected && CWebcam.IsDeviceAvailable())
|
||||
_OnTakeSnapshot();
|
||||
break;
|
||||
|
||||
@@ -212,7 +209,7 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
CProfiles.SetAvatar(_SelectSlides[_SelectSlideProfiles].Selection,
|
||||
_SelectSlides[_SelectSlideAvatars].Selection);
|
||||
if (CWebcam.GetDevices().Length > 0 && _WebcamTexture.Index > 0)
|
||||
if (CWebcam.IsDeviceAvailable() && _WebcamTexture.Index > 0)
|
||||
_OnDiscardSnapshot();
|
||||
}
|
||||
else if (_SelectSlides[_SelectSlideGuestProfile].Selected)
|
||||
@@ -225,13 +222,13 @@ namespace Vocaluxe.Screens
|
||||
CProfiles.SetActive(_SelectSlides[_SelectSlideProfiles].Selection,
|
||||
(EOffOn)_SelectSlides[_SelectSlideActive].Selection);
|
||||
}
|
||||
else if (_Buttons[_ButtonWebcam].Selected && CWebcam.GetDevices().Length > 0)
|
||||
else if (_Buttons[_ButtonWebcam].Selected && CWebcam.IsDeviceAvailable())
|
||||
_OnWebcam();
|
||||
else if (_Buttons[_ButtonSaveSnapshot].Selected && CWebcam.GetDevices().Length > 0)
|
||||
else if (_Buttons[_ButtonSaveSnapshot].Selected && CWebcam.IsDeviceAvailable())
|
||||
_OnSaveSnapshot();
|
||||
else if (_Buttons[_ButtonDiscardSnapshot].Selected && CWebcam.GetDevices().Length > 0)
|
||||
else if (_Buttons[_ButtonDiscardSnapshot].Selected && CWebcam.IsDeviceAvailable())
|
||||
_OnDiscardSnapshot();
|
||||
else if (_Buttons[_ButtonTakeSnapshot].Selected && CWebcam.GetDevices().Length > 0)
|
||||
else if (_Buttons[_ButtonTakeSnapshot].Selected && CWebcam.IsDeviceAvailable())
|
||||
_OnTakeSnapshot();
|
||||
}
|
||||
|
||||
@@ -313,7 +310,7 @@ namespace Vocaluxe.Screens
|
||||
|
||||
int avatarNr = CProfiles.GetAvatarNr(_SelectSlides[_SelectSlideProfiles].Selection);
|
||||
_SelectSlides[_SelectSlideAvatars].Selection = avatarNr;
|
||||
if (CWebcam.GetDevices().Length > 0 && _WebcamTexture.Index > 0)
|
||||
if (CWebcam.IsDeviceAvailable() && _WebcamTexture.Index > 0)
|
||||
{
|
||||
if (_Snapshot == null)
|
||||
CWebcam.GetFrame(ref _WebcamTexture);
|
||||
|
||||
@@ -156,15 +156,15 @@ namespace Vocaluxe.Screens
|
||||
if (direction.ToLower() == "vertical")
|
||||
{
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.W = ((float)_StaticPointsBarDrawnPoints[p]) *
|
||||
(_Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.W / 10000);
|
||||
(_Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.W / 10000);
|
||||
}
|
||||
else
|
||||
{
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H = ((float)_StaticPointsBarDrawnPoints[p]) *
|
||||
(_Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.H / 10000);
|
||||
(_Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.H / 10000);
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.Y = _Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.H +
|
||||
_Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.Y -
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H;
|
||||
_Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.Y -
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -316,14 +316,14 @@ namespace Vocaluxe.Screens
|
||||
if (CGame.NumPlayer < (int)_ScreenSettings[_ScreenSettingShortDifficulty].GetValue())
|
||||
{
|
||||
_Texts[_TextDifficulty[p, CGame.NumPlayer - 1]].Text = CLanguage.Translate("TR_SCREENSCORE_GAMEDIFFICULTY") + ": " +
|
||||
CLanguage.Translate(player[p].Difficulty.ToString());
|
||||
CLanguage.Translate(player[p].Difficulty.ToString());
|
||||
}
|
||||
else
|
||||
_Texts[_TextDifficulty[p, CGame.NumPlayer - 1]].Text = CLanguage.Translate(player[p].Difficulty.ToString());
|
||||
if (CGame.NumPlayer < (int)_ScreenSettings[_ScreenSettingShortRating].GetValue())
|
||||
{
|
||||
_Texts[_TextRatings[p, CGame.NumPlayer - 1]].Text = CLanguage.Translate("TR_SCREENSCORE_RATING") + ": " +
|
||||
CLanguage.Translate(_GetRating((int)Math.Round(player[p].Points)));
|
||||
CLanguage.Translate(_GetRating((int)Math.Round(player[p].Points)));
|
||||
}
|
||||
else
|
||||
_Texts[_TextRatings[p, CGame.NumPlayer - 1]].Text = CLanguage.Translate(_GetRating((int)Math.Round(player[p].Points)));
|
||||
@@ -336,8 +336,8 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H = 0;
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.Y = _Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.H +
|
||||
_Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.Y -
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H;
|
||||
_Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.Y -
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H;
|
||||
}
|
||||
if (player[p].ProfileID >= 0 && player[p].ProfileID < CProfiles.NumProfiles)
|
||||
_Statics[_StaticAvatar[p, CGame.NumPlayer - 1]].Texture = CProfiles.Profiles[player[p].ProfileID].Avatar.Texture;
|
||||
@@ -349,8 +349,8 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H = ((float)player[p].Points) * (_Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.H / 10000);
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.Y = _Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.H +
|
||||
_Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.Y -
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H;
|
||||
_Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.Y -
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H;
|
||||
_StaticPointsBarDrawnPoints[p] = player[p].Points;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace Vocaluxe.Screens
|
||||
}
|
||||
break;
|
||||
case Keys.W:
|
||||
if (CWebcam.GetDevices().Length > 0)
|
||||
if (CWebcam.IsDeviceAvailable())
|
||||
{
|
||||
_Webcam = !_Webcam;
|
||||
if (_Webcam)
|
||||
@@ -614,7 +614,7 @@ namespace Vocaluxe.Screens
|
||||
|
||||
CDraw.RemoveTexture(ref _CurrentVideoTexture);
|
||||
|
||||
if (song.VideoFileName.Length > 0)
|
||||
if (song.VideoFileName != "")
|
||||
{
|
||||
_CurrentVideo = CVideo.VdLoad(Path.Combine(song.Folder, song.VideoFileName));
|
||||
CVideo.VdSkip(_CurrentVideo, song.Start, song.VideoGap);
|
||||
@@ -622,7 +622,7 @@ namespace Vocaluxe.Screens
|
||||
}
|
||||
|
||||
CDraw.RemoveTexture(ref _Background);
|
||||
if (song.BackgroundFileName.Length > 0)
|
||||
if (song.BackgroundFileName != "")
|
||||
_Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileName));
|
||||
|
||||
_SingNotes[_SingBars].Reset();
|
||||
@@ -924,14 +924,14 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
_Texts[_TextScores[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayer;
|
||||
_Texts[_TextNames[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer)
|
||||
&&
|
||||
(CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH ||
|
||||
CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_NAME);
|
||||
&&
|
||||
(CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH ||
|
||||
CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_NAME);
|
||||
_Statics[_StaticScores[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayer;
|
||||
_Statics[_StaticAvatars[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer)
|
||||
&&
|
||||
(CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH ||
|
||||
CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_AVATAR);
|
||||
&&
|
||||
(CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH ||
|
||||
CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_AVATAR);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1325,7 +1325,8 @@ namespace Vocaluxe.Screens
|
||||
return;
|
||||
|
||||
CLines[] partLines = song.Notes.Lines;
|
||||
foreach (CLines partLine in partLines) {
|
||||
foreach (CLines partLine in partLines)
|
||||
{
|
||||
CLine[] line = partLine.Line;
|
||||
for (int j = 0; j < line.Length; j++)
|
||||
{
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace Vocaluxe.Screens
|
||||
break;
|
||||
|
||||
case Keys.Back:
|
||||
if (_SearchActive && _SearchText.Length > 0)
|
||||
if (_SearchActive && _SearchText != "")
|
||||
_ApplyNewSearchFilter(_SearchText.Remove(_SearchText.Length - 1));
|
||||
|
||||
if ((CSongs.Category < 0 || _Sso.Sorting.Tabs == EOffOn.TR_CONFIG_OFF) && !_Sso.Selection.PartyMode && !_SearchActive)
|
||||
@@ -1041,13 +1041,13 @@ namespace Vocaluxe.Screens
|
||||
if (songIndex != -1 && CSongs.NumVisibleSongs > 0 && CSongs.NumVisibleSongs > songIndex)
|
||||
songID = CSongs.VisibleSongs[songIndex].ID;
|
||||
|
||||
if (newFilterString.Length == 0 && _Sso.Sorting.Tabs == EOffOn.TR_CONFIG_ON)
|
||||
if (newFilterString == "" && _Sso.Sorting.Tabs == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
CSongs.Category = -1;
|
||||
refresh = true;
|
||||
}
|
||||
|
||||
if (newFilterString.Length > 0 && CSongs.Category != 0)
|
||||
if (newFilterString != "" && CSongs.Category != 0)
|
||||
{
|
||||
CSongs.Category = 0;
|
||||
refresh = true;
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Background color for type \"Color\" from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -139,13 +139,13 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void Resume()
|
||||
{
|
||||
if (_Theme.Type == EBackgroundTypes.Video && _Theme.VideoName.Length > 0 && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON)
|
||||
if (_Theme.Type == EBackgroundTypes.Video && _Theme.VideoName != "" && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON)
|
||||
CBase.Theme.SkinVideoResume(_Theme.VideoName, _PartyModeID);
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
{
|
||||
if (_Theme.VideoName.Length > 0)
|
||||
if (_Theme.VideoName != "")
|
||||
CBase.Theme.SkinVideoPause(_Theme.VideoName, _PartyModeID);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace VocaluxeLib.Menu
|
||||
ok = _DrawVideo();
|
||||
}
|
||||
|
||||
if (_Theme.TextureName.Length > 0 &&
|
||||
if (_Theme.TextureName != "" &&
|
||||
(_Theme.Type == EBackgroundTypes.Texture ||
|
||||
(_Theme.Type == EBackgroundTypes.Video && (CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_OFF || !ok))))
|
||||
ok = _DrawTexture();
|
||||
@@ -181,7 +181,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Button color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -251,7 +251,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<SColor>: Selected button color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
|
||||
if (_Theme.SelColorName.Length > 0)
|
||||
if (_Theme.SelColorName != "")
|
||||
writer.WriteElementString("SColor", _Theme.SelColorName);
|
||||
else
|
||||
{
|
||||
@@ -378,10 +378,10 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
Text.LoadTextures();
|
||||
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelColorName.Length > 0)
|
||||
if (_Theme.SelColorName != "")
|
||||
SelColor = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Equalizer color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -186,7 +186,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
writer.WriteComment("<MaxColor>: Equalizer color for maximal volume from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <MaxR>, <MaxG>, <MaxB>, <MaxA> (lower priority)");
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
writer.WriteElementString("MaxColor", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -241,7 +241,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
if (_Bars == null || _Theme.Style!=EEqualizerStyle.Collums)
|
||||
if (_Bars == null || _Theme.Style != EEqualizerStyle.Collums)
|
||||
return;
|
||||
|
||||
float dx = Rect.W / _Bars.Length;
|
||||
@@ -274,10 +274,10 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.MaxColorName.Length > 0)
|
||||
if (_Theme.MaxColorName != "")
|
||||
MaxColor = CBase.Theme.GetColor(_Theme.MaxColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -157,9 +157,7 @@ namespace VocaluxeLib.Menu
|
||||
try
|
||||
{
|
||||
foreach (FileInfo file in dir.GetFiles(cast))
|
||||
{
|
||||
files.Add(!fullpath ? file.Name : file.FullName);
|
||||
}
|
||||
|
||||
if (recursive)
|
||||
{
|
||||
|
||||
@@ -172,7 +172,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Lyric text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -184,7 +184,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<SColor>: Highlighted lyric color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
|
||||
if (_Theme.SelColorName.Length > 0)
|
||||
if (_Theme.SelColorName != "")
|
||||
writer.WriteElementString("SColor", _Theme.SelColorName);
|
||||
else
|
||||
{
|
||||
@@ -525,10 +525,10 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
_Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelColorName.Length > 0)
|
||||
if (_Theme.SelColorName != "")
|
||||
_ColorProcessed = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public virtual void SaveTheme()
|
||||
{
|
||||
if (_ThemePath.Length == 0)
|
||||
if (_ThemePath == "")
|
||||
return;
|
||||
|
||||
XmlWriterSettings settings = new XmlWriterSettings {Indent = true, Encoding = Encoding.UTF8, ConformanceLevel = ConformanceLevel.Document};
|
||||
@@ -357,7 +357,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public virtual void ReloadTheme(string xmlPath)
|
||||
{
|
||||
if (_ThemePath.Length == 0)
|
||||
if (_ThemePath == "")
|
||||
return;
|
||||
|
||||
UnloadTextures();
|
||||
@@ -436,7 +436,7 @@ namespace VocaluxeLib.Menu
|
||||
#region ElementHandler
|
||||
|
||||
#region Create Elements
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable MemberCanBeProtected.Global
|
||||
public CButton GetNewButton()
|
||||
{
|
||||
@@ -527,6 +527,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
return new CParticleEffect(_PartyModeID, maxNumber, color, area, texture, size, type);
|
||||
}
|
||||
|
||||
// ReSharper restore MemberCanBeProtected.Global
|
||||
// ReSharper restore UnusedMember.Global
|
||||
#endregion Create Elements
|
||||
@@ -793,7 +794,7 @@ namespace VocaluxeLib.Menu
|
||||
#endregion Drawing
|
||||
|
||||
#region Elements
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
protected void _AddBackground(CBackground bg, String key = null)
|
||||
{
|
||||
_AddInteraction(_Backgrounds.Add(bg, key), EType.Background);
|
||||
@@ -858,6 +859,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
_ScreenSettings.Add(se, key);
|
||||
}
|
||||
|
||||
// ReSharper restore MemberCanBePrivate.Global
|
||||
#endregion Elements
|
||||
|
||||
@@ -1515,7 +1517,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
// ReSharper disable UnusedMember.Local
|
||||
// ReSharper disable UnusedMember.Local
|
||||
private void _ToggleHighlighted()
|
||||
{
|
||||
if (_Selection >= _Interactions.Count || _Selection < 0)
|
||||
@@ -1532,6 +1534,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
return _Interactions[_Selection].Type == EType.SelectSlide && _SelectSlides[_Interactions[_Selection].Num].Highlighted;
|
||||
}
|
||||
|
||||
// ReSharper restore UnusedMember.Local
|
||||
|
||||
private bool _IsVisible(int interaction)
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<ColorEmptyTile>: Static color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorEmptyTileName.Length > 0)
|
||||
if (_Theme.ColorEmptyTileName != "")
|
||||
writer.WriteElementString("ColorEmptyTile", _Theme.ColorEmptyTileName);
|
||||
else
|
||||
{
|
||||
@@ -221,7 +221,7 @@ namespace VocaluxeLib.Menu
|
||||
writer.WriteComment("<Font>: Text font name");
|
||||
writer.WriteElementString("Font", _Theme.NameFont);
|
||||
writer.WriteComment("<Color>: Text color from ColorScheme (high priority)");
|
||||
if (_Theme.NameColorName.Length > 0)
|
||||
if (_Theme.NameColorName != "")
|
||||
writer.WriteElementString("Color", _Theme.NameColorName);
|
||||
else
|
||||
{
|
||||
@@ -455,10 +455,10 @@ namespace VocaluxeLib.Menu
|
||||
_TextureEmptyTile = CBase.Theme.GetSkinTexture(_Theme.TextureEmptyTileName, _PartyModeID);
|
||||
_TextureTileSelected = CBase.Theme.GetSkinTexture(_Theme.TextureTileSelectedName, _PartyModeID);
|
||||
|
||||
if (_Theme.ColorEmptyTileName.Length > 0)
|
||||
if (_Theme.ColorEmptyTileName != "")
|
||||
ColorEmptyTile = CBase.Theme.GetColor(_Theme.ColorEmptyTileName, _PartyModeID);
|
||||
|
||||
if (_Theme.NameColorName.Length > 0)
|
||||
if (_Theme.NameColorName != "")
|
||||
_Theme.NameColor = CBase.Theme.GetColor(_Theme.NameColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -297,7 +297,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
if (_TextureName.Length > 0)
|
||||
if (_TextureName != "")
|
||||
CBase.Drawing.DrawTexture(CBase.Theme.GetSkinTexture(_TextureName, _PartyModeID), _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
|
||||
else
|
||||
CBase.Drawing.DrawTexture(_Texture, _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
|
||||
@@ -433,7 +433,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: ParticleEffect color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -544,7 +544,7 @@ namespace VocaluxeLib.Menu
|
||||
h = 0;
|
||||
|
||||
CParticle star;
|
||||
if (_Theme.TextureName.Length > 0)
|
||||
if (_Theme.TextureName != "")
|
||||
{
|
||||
star = new CParticle(_PartyModeID, _Theme.TextureName, Color,
|
||||
CBase.Game.GetRandom(w) + Rect.X - size / 4f,
|
||||
@@ -605,9 +605,9 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
if (_Theme.TextureName.Length > 0)
|
||||
if (_Theme.TextureName != "")
|
||||
Texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -370,7 +370,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<ColorBackground>: Button color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <BackgroundR>, <BackgroundG>, <BackgroundB>, <BackgroundA> (lower priority)");
|
||||
if (_Theme.ColorBackgroundName.Length > 0)
|
||||
if (_Theme.ColorBackgroundName != "")
|
||||
writer.WriteElementString("ColorBackground", _Theme.ColorBackgroundName);
|
||||
else
|
||||
{
|
||||
@@ -382,7 +382,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<SColorBackground>: Selected paylist-entry color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SBackgroundR>, <SBackgroundG>, <SBackgroundB>, <SBackgroundA> (lower priority)");
|
||||
if (_Theme.SelColorBackgroundName.Length > 0)
|
||||
if (_Theme.SelColorBackgroundName != "")
|
||||
writer.WriteElementString("SColorBackground", _Theme.SelColorBackgroundName);
|
||||
else
|
||||
{
|
||||
@@ -471,10 +471,10 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorBackgroundName.Length > 0)
|
||||
if (_Theme.ColorBackgroundName != "")
|
||||
BackgroundColor = CBase.Theme.GetColor(_Theme.ColorBackgroundName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelColorBackgroundName.Length > 0)
|
||||
if (_Theme.SelColorBackgroundName != "")
|
||||
BackgroundSelColor = CBase.Theme.GetColor(_Theme.SelColorBackgroundName, _PartyModeID);
|
||||
|
||||
_Theme.Text1.LoadTextures();
|
||||
@@ -523,7 +523,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
else if (keyEvent.Key == Keys.Back || keyEvent.Key == Keys.Delete)
|
||||
{
|
||||
if (_Theme.ButtonPlaylistName.Text.Text.Length > 0)
|
||||
if (_Theme.ButtonPlaylistName.Text.Text != "")
|
||||
_Theme.ButtonPlaylistName.Text.Text = _Theme.ButtonPlaylistName.Text.Text.Remove(_Theme.ButtonPlaylistName.Text.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ namespace VocaluxeLib.Menu
|
||||
public ESettingType Type;
|
||||
}
|
||||
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
//Instantiated by reflection
|
||||
public class CScreenSetting : IMenuElement
|
||||
// ReSharper restore ClassNeverInstantiated.Global
|
||||
// ReSharper restore ClassNeverInstantiated.Global
|
||||
{
|
||||
private readonly int _PartyModeID;
|
||||
|
||||
|
||||
@@ -417,7 +417,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: SelectSlide color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -429,7 +429,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<SColor>: Selected SelectSlide color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
|
||||
if (_Theme.SelColorName.Length > 0)
|
||||
if (_Theme.SelColorName != "")
|
||||
writer.WriteElementString("SColor", _Theme.SelColorName);
|
||||
else
|
||||
{
|
||||
@@ -441,7 +441,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <HR>, <HG>, <HB>, <HA> (lower priority)");
|
||||
if (_Theme.HighlightColorName.Length > 0)
|
||||
if (_Theme.HighlightColorName != "")
|
||||
writer.WriteElementString("HColor", _Theme.HighlightColorName);
|
||||
else
|
||||
{
|
||||
@@ -453,7 +453,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<ArrowColor>: Arrow color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)");
|
||||
if (_Theme.ArrowColorName.Length > 0)
|
||||
if (_Theme.ArrowColorName != "")
|
||||
writer.WriteElementString("ArrowColor", _Theme.ArrowColorName);
|
||||
else
|
||||
{
|
||||
@@ -465,7 +465,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<ArrowSColor>: Selected arrow color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <ArrowSR>, <ArrowSG>, <ArrowSB>, <ArrowSA> (lower priority)");
|
||||
if (_Theme.SelArrowColorName.Length > 0)
|
||||
if (_Theme.SelArrowColorName != "")
|
||||
writer.WriteElementString("ArrowSColor", _Theme.SelArrowColorName);
|
||||
else
|
||||
{
|
||||
@@ -477,7 +477,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<TextColor>: Text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <TextR>, <TextG>, <TextB>, <TextA> (lower priority)");
|
||||
if (_Theme.TextColorName.Length > 0)
|
||||
if (_Theme.TextColorName != "")
|
||||
writer.WriteElementString("TextColor", _Theme.TextColorName);
|
||||
else
|
||||
{
|
||||
@@ -489,7 +489,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<TextSColor>: Selected text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)");
|
||||
if (_Theme.SelTextColorName.Length > 0)
|
||||
if (_Theme.SelTextColorName != "")
|
||||
writer.WriteElementString("TextSColor", _Theme.SelTextColorName);
|
||||
else
|
||||
{
|
||||
@@ -797,25 +797,25 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelColorName.Length > 0)
|
||||
if (_Theme.SelColorName != "")
|
||||
SelColor = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.HighlightColorName.Length > 0)
|
||||
if (_Theme.HighlightColorName != "")
|
||||
HighlightColor = CBase.Theme.GetColor(_Theme.HighlightColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.ArrowColorName.Length > 0)
|
||||
if (_Theme.ArrowColorName != "")
|
||||
ColorArrow = CBase.Theme.GetColor(_Theme.ArrowColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelArrowColorName.Length > 0)
|
||||
if (_Theme.SelArrowColorName != "")
|
||||
SelColorArrow = CBase.Theme.GetColor(_Theme.SelArrowColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.TextColorName.Length > 0)
|
||||
if (_Theme.TextColorName != "")
|
||||
TextColor = CBase.Theme.GetColor(_Theme.TextColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelColorName.Length > 0)
|
||||
if (_Theme.SelColorName != "")
|
||||
SelTextColor = CBase.Theme.GetColor(_Theme.SelTextColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Static color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -293,7 +293,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -541,7 +541,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -553,7 +553,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<SColor>: Selected Text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
|
||||
if (_Theme.SelColorName.Length > 0)
|
||||
if (_Theme.SelColorName != "")
|
||||
writer.WriteElementString("SColor", _Theme.SelColorName);
|
||||
else
|
||||
{
|
||||
@@ -776,10 +776,10 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SelColorName.Length > 0)
|
||||
if (_Theme.SelColorName != "")
|
||||
SelColor = CBase.Theme.GetColor(_Theme.SelColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
@@ -806,7 +806,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private void _UpdateTextPosition()
|
||||
{
|
||||
if (_Text.Length == 0)
|
||||
if (_Text == "")
|
||||
return;
|
||||
|
||||
CBase.Fonts.SetFont(Font);
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace VocaluxeLib.Menu
|
||||
resultCt++;
|
||||
}
|
||||
|
||||
if (resultCt!=1)
|
||||
if (resultCt != 1)
|
||||
{
|
||||
value = defaultValue;
|
||||
return false;
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public enum EBufferSize
|
||||
{
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
B0 = 0,
|
||||
B512 = 512,
|
||||
B1024 = 1024,
|
||||
|
||||
@@ -245,7 +245,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
SPlayerNotes notes = _PlayerNotes[n];
|
||||
|
||||
if (line.Length == 0 || line.Length <= lineNr)
|
||||
if (line.Length <= lineNr)
|
||||
return;
|
||||
|
||||
notes.Lines = line;
|
||||
|
||||
@@ -369,7 +369,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
while (!sr.EndOfStream)
|
||||
{
|
||||
string line = sr.ReadLine();
|
||||
if (line.Length == 0)
|
||||
if (line == "")
|
||||
continue;
|
||||
if (!line[0].ToString().Equals("#"))
|
||||
break;
|
||||
@@ -381,7 +381,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
string identifier = line.Substring(1, pos - 1).Trim().ToUpper();
|
||||
string value = line.Substring(pos + 1, line.Length - pos - 1).Trim();
|
||||
|
||||
if (value.Length > 0)
|
||||
if (value != "")
|
||||
{
|
||||
switch (identifier)
|
||||
{
|
||||
@@ -395,7 +395,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
while (!sr.EndOfStream)
|
||||
{
|
||||
line = sr.ReadLine();
|
||||
if (line.Length == 0)
|
||||
if (line == "")
|
||||
continue;
|
||||
if (!line[0].ToString().Equals("#"))
|
||||
break;
|
||||
@@ -411,33 +411,33 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
break;
|
||||
case "TITLE":
|
||||
if (value.Length > 0)
|
||||
if (value != "")
|
||||
{
|
||||
Title = value;
|
||||
headerFlags |= EHeaderFlags.Title;
|
||||
}
|
||||
break;
|
||||
case "ARTIST":
|
||||
if (value.Length > 0)
|
||||
if (value != "")
|
||||
{
|
||||
Artist = value;
|
||||
headerFlags |= EHeaderFlags.Artist;
|
||||
}
|
||||
break;
|
||||
case "TITLE-ON-SORTING":
|
||||
if (value.Length > 0)
|
||||
if (value != "")
|
||||
TitleSorting = value;
|
||||
break;
|
||||
case "ARTIST-ON-SORTING":
|
||||
if (value.Length > 0)
|
||||
if (value != "")
|
||||
ArtistSorting = value;
|
||||
break;
|
||||
case "P1":
|
||||
if (value.Length > 0)
|
||||
if (value != "")
|
||||
DuetPart1 = value;
|
||||
break;
|
||||
case "P2":
|
||||
if (value.Length > 0)
|
||||
if (value != "")
|
||||
DuetPart2 = value;
|
||||
break;
|
||||
case "MP3":
|
||||
@@ -608,10 +608,10 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_CheckFiles();
|
||||
|
||||
//Before saving this tags to .txt: Check, if ArtistSorting and Artist are equal, then don't save this tag.
|
||||
if (ArtistSorting.Length == 0)
|
||||
if (ArtistSorting == "")
|
||||
ArtistSorting = Artist;
|
||||
|
||||
if (TitleSorting.Length == 0)
|
||||
if (TitleSorting == "")
|
||||
TitleSorting = Title;
|
||||
|
||||
return true;
|
||||
@@ -821,7 +821,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
if (_CoverSmallLoaded)
|
||||
return;
|
||||
if (CoverFileName.Length > 0)
|
||||
if (CoverFileName != "")
|
||||
{
|
||||
if (!CBase.DataBase.GetCover(Path.Combine(Folder, CoverFileName), ref _CoverTextureSmall, CBase.Config.GetCoverSize()))
|
||||
_CoverTextureSmall = CBase.Cover.GetNoCover();
|
||||
@@ -834,7 +834,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
private void _CheckFiles()
|
||||
{
|
||||
if (CoverFileName.Length == 0)
|
||||
if (CoverFileName == "")
|
||||
{
|
||||
List<string> files = CHelper.ListFiles(Folder, "*.jpg", false);
|
||||
files.AddRange(CHelper.ListFiles(Folder, "*.png", false));
|
||||
@@ -846,7 +846,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
}
|
||||
|
||||
if (BackgroundFileName.Length == 0)
|
||||
if (BackgroundFileName == "")
|
||||
{
|
||||
List<string> files = CHelper.ListFiles(Folder, "*.jpg", false);
|
||||
files.AddRange(CHelper.ListFiles(Folder, "*.png", false));
|
||||
@@ -861,12 +861,12 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
private void _CheckDuet()
|
||||
{
|
||||
if (DuetPart1.Length == 0)
|
||||
if (DuetPart1 == "")
|
||||
{
|
||||
DuetPart1 = "Part 1";
|
||||
CBase.Log.LogError("Warning: Can't find #P1-tag for duets in \"" + Artist + " - " + Title + "\".");
|
||||
}
|
||||
if (DuetPart2.Length == 0)
|
||||
if (DuetPart2 == "")
|
||||
{
|
||||
DuetPart2 = "Part 2";
|
||||
CBase.Log.LogError("Warning: Can't find #P2-tag for duets in \"" + Artist + " - " + Title + "\".");
|
||||
@@ -915,7 +915,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
for (int k = 1; k <= max; k++)
|
||||
{
|
||||
if (sentences[i + k] == sentences[j + k] && sentences[i + k]!="")
|
||||
if (sentences[i + k] == sentences[j + k] && sentences[i + k] != "")
|
||||
tempSeries.End = i + k;
|
||||
else
|
||||
break;
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
public CSongMenuDreidel(int partyModeID)
|
||||
: base(partyModeID) {}
|
||||
|
||||
// ReSharper disable RedundantOverridenMember
|
||||
// ReSharper disable RedundantOverridenMember
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
@@ -59,6 +59,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_SongLength = _Theme.songMenuDreidel.TextSongLength;
|
||||
**/
|
||||
}
|
||||
// ReSharper restore RedundantOverridenMember
|
||||
|
||||
// ReSharper restore RedundantOverridenMember
|
||||
}
|
||||
}
|
||||
@@ -349,7 +349,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
writer.WriteComment("<Color>: Tile color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
else
|
||||
{
|
||||
@@ -481,13 +481,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_SelectedInternal = _SelectedPending;
|
||||
}
|
||||
|
||||
public virtual void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions)
|
||||
{
|
||||
}
|
||||
public virtual void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions) {}
|
||||
|
||||
public virtual void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions)
|
||||
{
|
||||
}
|
||||
public virtual void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions) {}
|
||||
|
||||
public virtual void Draw()
|
||||
{
|
||||
@@ -531,17 +527,11 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return -1;
|
||||
}
|
||||
|
||||
public virtual void SetSelectedSong(int visibleSongNr)
|
||||
{
|
||||
}
|
||||
public virtual void SetSelectedSong(int visibleSongNr) {}
|
||||
|
||||
public virtual void SetSelectedCategory(int categoryNr)
|
||||
{
|
||||
}
|
||||
public virtual void SetSelectedCategory(int categoryNr) {}
|
||||
|
||||
public virtual void SetSmallView(bool smallView)
|
||||
{
|
||||
}
|
||||
public virtual void SetSmallView(bool smallView) {}
|
||||
|
||||
public virtual bool IsSmallView()
|
||||
{
|
||||
@@ -554,7 +544,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
Init();
|
||||
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
if (_Theme.ColorName != "")
|
||||
_Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
@@ -635,7 +625,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_Streams.Add(stream);
|
||||
_Actsongstream = stream;
|
||||
|
||||
if (CBase.Songs.GetVisibleSong(_Actsong).VideoFileName.Length > 0 && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
|
||||
if (CBase.Songs.GetVisibleSong(_Actsong).VideoFileName != "" && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
_Video = CBase.Video.Load(Path.Combine(CBase.Songs.GetVisibleSong(_Actsong).Folder, CBase.Songs.GetVisibleSong(_Actsong).VideoFileName));
|
||||
if (_Video == -1)
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_MedleyTagIcon.Visible = false;
|
||||
}
|
||||
|
||||
if (CBase.Songs.GetNumVisibleSongs() == 0 && CBase.Songs.GetSearchFilter().Length > 0)
|
||||
if (CBase.Songs.GetNumVisibleSongs() == 0 && CBase.Songs.GetSearchFilter() != "")
|
||||
{
|
||||
_CoverBig.Texture = _CoverBigTexture;
|
||||
_Artist.Text = String.Empty;
|
||||
@@ -418,7 +418,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_Artist.Text = song.Artist;
|
||||
_Title.Text = song.Title;
|
||||
_DuetIcon.Visible = song.IsDuet;
|
||||
_VideoIcon.Visible = song.VideoFileName.Length > 0;
|
||||
_VideoIcon.Visible = song.VideoFileName != "";
|
||||
_MedleyCalcIcon.Visible = song.Medley.Source == EMedleySource.Calculated;
|
||||
_MedleyTagIcon.Visible = song.Medley.Source == EMedleySource.Tag;
|
||||
|
||||
|
||||
Reference in new issue
Block a user