Merge branch 'develop' of github.com:Vocaluxe/Vocaluxe into develop
This commit is contained in:
commit
d568e1b01f
1 file changed
+27
-11
+27
-11
@@ -236,13 +236,14 @@ namespace Vocaluxe.Base
|
|||||||
public static event OnSongMenuChanged SongMenuChanged;
|
public static event OnSongMenuChanged SongMenuChanged;
|
||||||
|
|
||||||
//Folders
|
//Folders
|
||||||
|
//We need full path for folders for matching folder path with textfile path when loading
|
||||||
public static readonly List<string> SongFolders = new List<string>
|
public static readonly List<string> SongFolders = new List<string>
|
||||||
{
|
{
|
||||||
#if INSTALLER
|
#if INSTALLER
|
||||||
Path.Combine(CSettings.DataFolder, CSettings.FolderNameSongs),
|
Path.Combine(CSettings.DataFolder, CSettings.FolderNameSongs),
|
||||||
CSettings.FolderNameSongs
|
Path.Combine(CSettings.ProgramFolder, FolderNameSongs)
|
||||||
#elif WIN
|
#elif WIN
|
||||||
CSettings.FolderNameSongs
|
Path.Combine(CSettings.ProgramFolder, CSettings.FolderNameSongs)
|
||||||
#elif LINUX
|
#elif LINUX
|
||||||
Path.Combine(CSettings.DataFolder, CSettings.FolderNameSongs)
|
Path.Combine(CSettings.DataFolder, CSettings.FolderNameSongs)
|
||||||
#endif
|
#endif
|
||||||
@@ -380,15 +381,7 @@ namespace Vocaluxe.Base
|
|||||||
else
|
else
|
||||||
Config = xml.DeserializeString<SConfig>("<root />");
|
Config = xml.DeserializeString<SConfig>("<root />");
|
||||||
|
|
||||||
if (Config.Game.SongFolder.Length > 0 && Config.Game.SongFolder[0] != "")
|
NormalizeSongPaths();
|
||||||
{
|
|
||||||
SongFolders.Clear();
|
|
||||||
SongFolders.AddRange(Config.Game.SongFolder);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Config.Game.SongFolder = SongFolders.ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Config.Game.MinLineBreakTime < 0)
|
if (Config.Game.MinLineBreakTime < 0)
|
||||||
Config.Game.MinLineBreakTime = 0.1f;
|
Config.Game.MinLineBreakTime = 0.1f;
|
||||||
@@ -680,6 +673,29 @@ namespace Vocaluxe.Base
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set song path if none is find in config and check if every path exists
|
||||||
|
/// </summary>
|
||||||
|
public static void NormalizeSongPaths()
|
||||||
|
{
|
||||||
|
//Check if there are configured songfolders
|
||||||
|
if (Config.Game.SongFolder.Length > 0 && Config.Game.SongFolder[0] != "")
|
||||||
|
{
|
||||||
|
SongFolders.Clear();
|
||||||
|
|
||||||
|
foreach (string folder in Config.Game.SongFolder)
|
||||||
|
{
|
||||||
|
//Check if folder exists
|
||||||
|
if (Directory.Exists(folder))
|
||||||
|
SongFolders.Add(folder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Test if songfolders are still empty or now empty
|
||||||
|
if(Config.Game.SongFolder.Length == 0)
|
||||||
|
Config.Game.SongFolder = SongFolders.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load command-line-parameters and their values to lists.
|
/// Load command-line-parameters and their values to lists.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in new issue
Block a user