diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml
index 6554f2dc..c0ece78c 100644
--- a/Output/Languages/English.xml
+++ b/Output/Languages/English.xml
@@ -93,6 +93,7 @@
Party
Options
Profiles
+ No profiles found!
Party Mode Selection
Party Mode
Description
diff --git a/Output/Languages/German.xml b/Output/Languages/German.xml
index 50ffef0a..4ded8f3f 100644
--- a/Output/Languages/German.xml
+++ b/Output/Languages/German.xml
@@ -92,6 +92,7 @@
Party
Optionen
Profile
+ Keine Profile gefunden!
Party-Modus Auswahl
Party-Modus
Beschreibung
diff --git a/Output/Themes/Ambient/Screens/ScreenMain.xml b/Output/Themes/Ambient/Screens/ScreenMain.xml
index 0d256cd2..50e3a04c 100644
--- a/Output/Themes/Ambient/Screens/ScreenMain.xml
+++ b/Output/Themes/Ambient/Screens/ScreenMain.xml
@@ -1,7 +1,7 @@
- 1
+ 2
Video
@@ -314,5 +314,79 @@
26
+
+
+ 10
+ 690
+
+ -1
+
+ 15
+
+
+ TextWhite
+
+
+ TextWhite
+
+ Left
+
+ Center
+
+
+
+ Normal
+
+
+
+
+
+
+
+
+ TextBG
+
+ 150
+ 610
+ -1,90
+ 355
+ 30
+
+
+ StaticWarningColor
+
+
+
+
+
+
+ 320
+ 612
+
+ -2,00
+
+ 27
+
+ 355
+
+
+ TextWarningColor
+
+
+ TextWarningColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENMAIN_TEXT_NOPROFILES
+
+
+
+
diff --git a/Output/Themes/Ambient/Skin Blue.xml b/Output/Themes/Ambient/Skin Blue.xml
index 34cff336..bba00650 100644
--- a/Output/Themes/Ambient/Skin Blue.xml
+++ b/Output/Themes/Ambient/Skin Blue.xml
@@ -140,7 +140,7 @@
0,675
0,890
0,969
- 1,000
+ 0,600
0,675
@@ -227,9 +227,9 @@
1,000
- 0,000
- 0,000
- 0,000
+ 1,000
+ 1,000
+ 1,000
1,000
diff --git a/Output/Themes/Ambient/Skin Green.xml b/Output/Themes/Ambient/Skin Green.xml
index 868a0b0f..5b1b4d5f 100644
--- a/Output/Themes/Ambient/Skin Green.xml
+++ b/Output/Themes/Ambient/Skin Green.xml
@@ -140,7 +140,7 @@
0,709
0,968
0,674
- 1,000
+ 0,600
0,709
@@ -221,9 +221,9 @@
1,000
- 0,000
- 0,000
- 0,000
+ 1,000
+ 1,000
+ 1,000
1,000
diff --git a/Output/Themes/Ambient/Skin Red.xml b/Output/Themes/Ambient/Skin Red.xml
index a0929c67..50f1eecc 100644
--- a/Output/Themes/Ambient/Skin Red.xml
+++ b/Output/Themes/Ambient/Skin Red.xml
@@ -140,7 +140,7 @@
0,968
0,674
0,674
- 1,000
+ 0,600
0,968
@@ -221,9 +221,9 @@
1,000
- 0,000
- 0,000
- 0,000
+ 1,000
+ 1,000
+ 1,000
1,000
diff --git a/Output/Themes/Ambient/Skin Yellow.xml b/Output/Themes/Ambient/Skin Yellow.xml
index 141050a2..9dd57a3b 100644
--- a/Output/Themes/Ambient/Skin Yellow.xml
+++ b/Output/Themes/Ambient/Skin Yellow.xml
@@ -140,7 +140,7 @@
0,968
0,956
0,674
- 1,000
+ 0,600
0,968
@@ -221,9 +221,9 @@
1,000
- 0,000
- 0,000
- 0,000
+ 1,000
+ 1,000
+ 1,000
1,000
diff --git a/Output/Themes/Changelog/Changelog_ScreenMain.txt b/Output/Themes/Changelog/Changelog_ScreenMain.txt
new file mode 100644
index 00000000..b3eb3bb7
--- /dev/null
+++ b/Output/Themes/Changelog/Changelog_ScreenMain.txt
@@ -0,0 +1,10 @@
+SceenMain
+
+++++++++++
+Version 2:
+
+Add:
+
+
+
+
diff --git a/PartyModes/PartyModeChallengeMedley/CPartyModeChallengeMedley.cs b/PartyModes/PartyModeChallengeMedley/CPartyModeChallengeMedley.cs
index c6f0d619..623681b6 100644
--- a/PartyModes/PartyModeChallengeMedley/CPartyModeChallengeMedley.cs
+++ b/PartyModes/PartyModeChallengeMedley/CPartyModeChallengeMedley.cs
@@ -457,7 +457,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
public override void LeavingHighscore()
{
- for (int i = 0; i < CBase.Game.GetNumSongs();i++ )
+ for (int i = 0; i < CBase.Game.GetNumSongs(); i++)
CBase.Songs.AddPartySongSung(CBase.Game.GetSong(i).ID);
_GameData.CurrentRoundNr++;
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
@@ -588,12 +588,6 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
{
CProfile[] profiles = CBase.Profiles.GetProfiles();
- if (profiles == null)
- {
- _ScreenSongOptions.Selection.TeamNames = new string[] {"foo", "bar"};
- return;
- }
-
if (_GameData.NumPlayerAtOnce < 1 || _GameData.ProfileIDs.Count < _GameData.NumPlayerAtOnce || profiles.Length < _GameData.NumPlayerAtOnce)
{
_ScreenSongOptions.Selection.TeamNames = new string[] {"foo", "bar"};
diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs
index dc922b6a..d34d5432 100644
--- a/Vocaluxe/Base/CBackgroundMusic.cs
+++ b/Vocaluxe/Base/CBackgroundMusic.cs
@@ -184,7 +184,7 @@ namespace Vocaluxe.Base
if (_PlaysPreview)
_PreviewPlayer.Play();
- else
+ else if(CConfig.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_OFF)
if (_SongPlayer.SongLoaded)
//Resume
_SongPlayer.TogglePause();
@@ -218,11 +218,13 @@ namespace Vocaluxe.Base
return;
_PreviewPlayer.TogglePause();
}
- else
+ else if (CConfig.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_ON)
+ {
if (!_SongPlayer.SongLoaded)
Next();
else
_SongPlayer.TogglePause();
+ }
}
public static void Next()
diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs
index 5b42d5aa..d7aee117 100644
--- a/Vocaluxe/Base/CConfig.cs
+++ b/Vocaluxe/Base/CConfig.cs
@@ -888,7 +888,7 @@ namespace Vocaluxe.Base
for (int j = 0; j < CSettings.MaxNumPlayer; j++)
{
CGame.Players[j].ProfileID = -1;
- if (Players[j] == "" || profiles == null)
+ if (Players[j] == "")
continue;
foreach (CProfile profile in profiles)
diff --git a/Vocaluxe/Base/CCover.cs b/Vocaluxe/Base/CCover.cs
index ac9cc10c..61692ce7 100644
--- a/Vocaluxe/Base/CCover.cs
+++ b/Vocaluxe/Base/CCover.cs
@@ -40,7 +40,7 @@ namespace Vocaluxe.Base
public static void Init()
{
_LoadCoverThemes();
- _LoadCover(CConfig.CoverTheme);
+ _LoadCovers(CConfig.CoverTheme);
}
public static void Close()
@@ -107,7 +107,7 @@ namespace Vocaluxe.Base
public static void ReloadCovers()
{
_UnloadCovers();
- _LoadCover(CConfig.CoverTheme);
+ _LoadCovers(CConfig.CoverTheme);
}
private static void _UnloadCovers()
@@ -170,69 +170,36 @@ namespace Vocaluxe.Base
///
/// Loads all cover which are defined in the cover config file.
///
- private static void _LoadCover(string coverThemeName)
+ private static void _LoadCovers(string coverThemeName)
{
SCoverTheme coverTheme = _CoverTheme(coverThemeName);
if (String.IsNullOrEmpty(coverTheme.Name))
return;
- var ignoreList = new List();
-
string coverPath = Path.Combine(CSettings.ProgramFolder, CSettings.FolderNameCover, coverTheme.Folder);
List files = CHelper.ListImageFiles(coverPath, true, true);
- CXMLReader xmlReader = CXMLReader.OpenFile(Path.Combine(CSettings.ProgramFolder, CSettings.FolderNameCover, coverTheme.File));
lock (_Covers)
{
- if (xmlReader != null)
- {
- _Covers.Clear();
- List cover = xmlReader.GetNames("//root/Cover/*");
- foreach (string coverName in cover)
- {
- string name;
- string filePath;
- xmlReader.GetValue("//root/Cover/" + coverName + "/Name", out name, String.Empty);
- xmlReader.GetValue("//root/Cover/" + coverName + "/Path", out filePath, String.Empty);
- string coverFilePath = Path.Combine(CSettings.ProgramFolder, CSettings.FolderNameCover, coverTheme.Folder, filePath);
- if (!File.Exists(coverFilePath))
- continue;
-
- _AddCover(name, coverFilePath);
- ignoreList.Add(Path.GetFileName(coverFilePath));
-
- if (name == "NoCover")
- NoCover = _Covers[name];
- }
- }
-
-
foreach (string file in files)
- {
- if (!ignoreList.Contains(Path.GetFileName(file)))
- _AddCover(Path.GetFileNameWithoutExtension(file), file);
- }
+ _AddCover(Path.GetFileNameWithoutExtension(file), file);
+ if (_CoverExists("No Cover"))
+ NoCover = _Covers["No Cover"];
}
}
///
/// Ads a cover with the given name if it does not exist yet
- /// MUST HOLD _Covers lock at this point
///
/// Name of the cover
/// Filename of image file
private static void _AddCover(string name, string file)
{
- CTexture texture = CDraw.AddTexture(file);
-
- if (!_CoverExists(name))
- _Covers.Add(name, texture);
- else
+ lock (_Covers)
{
- CTexture tex = _Covers[name];
- CDraw.RemoveTexture(ref tex);
- _Covers[name] = texture;
+ if (!_CoverExists(name))
+ _Covers.Add(name, CDraw.AddTexture(file));
}
}
}
diff --git a/Vocaluxe/Base/CLanguage.cs b/Vocaluxe/Base/CLanguage.cs
index a86faf0f..fb452747 100644
--- a/Vocaluxe/Base/CLanguage.cs
+++ b/Vocaluxe/Base/CLanguage.cs
@@ -180,7 +180,7 @@ namespace Vocaluxe.Base
}
catch (Exception e)
{
- CLog.LogError("Error reading language file " + xmlReader.FileName + ": " + e.Message);
+ CLog.LogError("Error reading language file " + xmlReader.FilePath + ": " + e.Message);
return false;
}
}
diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs
index 68bdb588..cf99c472 100644
--- a/Vocaluxe/Base/CMain.cs
+++ b/Vocaluxe/Base/CMain.cs
@@ -479,9 +479,9 @@ namespace Vocaluxe.Base
class CBlog : ILog
{
- public void LogError(string errorText)
+ public void LogError(string errorText, bool showMsg = false, bool exit = false)
{
- CLog.LogError(errorText);
+ CLog.LogError(errorText, showMsg, exit);
}
public void LogDebug(string text)
diff --git a/Vocaluxe/Base/CProfiles.cs b/Vocaluxe/Base/CProfiles.cs
index 8c5c9887..5c05719f 100644
--- a/Vocaluxe/Base/CProfiles.cs
+++ b/Vocaluxe/Base/CProfiles.cs
@@ -297,7 +297,7 @@ namespace Vocaluxe.Base
public static CProfile[] GetProfiles()
{
if (_Profiles.Count == 0)
- return null;
+ return new CProfile[0];
var list = new List(_Profiles.Values);
list.Sort(_CompareByPlayerName);
diff --git a/Vocaluxe/Screens/CScreenMain.cs b/Vocaluxe/Screens/CScreenMain.cs
index 9c9c98ae..c932a1d6 100644
--- a/Vocaluxe/Screens/CScreenMain.cs
+++ b/Vocaluxe/Screens/CScreenMain.cs
@@ -27,7 +27,7 @@ namespace Vocaluxe.Screens
// Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion
{
- get { return 1; }
+ get { return 2; }
}
private const string _ButtonSing = "ButtonSing";
@@ -35,23 +35,30 @@ namespace Vocaluxe.Screens
private const string _ButtonOptions = "ButtonOptions";
private const string _ButtonProfiles = "ButtonProfiles";
private const string _ButtonExit = "ButtonExit";
-
- private CText _ReleaseText;
+ private const string _StaticWarningProfiles = "StaticWarningProfiles";
+ private const string _TextWarningProfiles = "TextWarningProfiles";
+ private const string _TextRelease = "TextRelease";
//CParticleEffect Snowflakes;
public override void Init()
{
base.Init();
- _ThemeStatics = new string[] {"StaticMenuBar"};
+ _ThemeStatics = new string[] {"StaticMenuBar", _StaticWarningProfiles};
_ThemeButtons = new string[] {_ButtonSing, _ButtonParty, _ButtonOptions, _ButtonProfiles, _ButtonExit};
+ _ThemeTexts = new string[] {_TextRelease, _TextWarningProfiles};
}
public override void LoadTheme(string xmlPath)
{
base.LoadTheme(xmlPath);
- _ReleaseText = GetNewText(10, 690, -1, 15, -1, EAlignment.Left, EStyle.Normal, "Normal", new SColorF(1f, 1f, 1f, 1f), CSettings.GetFullVersionText());
+ _Texts[_TextRelease].Text = CSettings.GetFullVersionText();
+ // ReSharper disable ConditionIsAlwaysTrueOrFalse
+ _Texts[_TextRelease].Visible = CSettings.VersionRevision != ERevision.Release;
+ // ReSharper restore ConditionIsAlwaysTrueOrFalse
+ _Statics[_StaticWarningProfiles].Visible = false;
+ _Texts[_TextWarningProfiles].Visible = false;
}
public override bool HandleInput(SKeyEvent keyEvent)
@@ -68,7 +75,8 @@ namespace Vocaluxe.Screens
break;
case Keys.S:
- CGraphics.FadeTo(EScreens.ScreenSong);
+ if (CProfiles.NumProfiles > 0)
+ CGraphics.FadeTo(EScreens.ScreenSong);
break;
case Keys.C:
@@ -145,6 +153,11 @@ namespace Vocaluxe.Screens
public override bool UpdateGame()
{
+ bool profileOK = CProfiles.NumProfiles > 0;
+ _Statics[_StaticWarningProfiles].Visible = !profileOK;
+ _Texts[_TextWarningProfiles].Visible = !profileOK;
+ _Buttons[_ButtonSing].Enabled = profileOK;
+ _Buttons[_ButtonParty].Enabled = profileOK;
return true;
}
@@ -159,11 +172,6 @@ namespace Vocaluxe.Screens
//Snowflakes.Draw();
_DrawFG();
- // ReSharper disable ConditionIsAlwaysTrueOrFalse
- if (CSettings.VersionRevision != ERevision.Release)
- // ReSharper restore ConditionIsAlwaysTrueOrFalse
- _ReleaseText.Draw();
-
return true;
}
diff --git a/VocaluxeLib/CXMLReader.cs b/VocaluxeLib/CXMLReader.cs
index 1603af81..4b06b922 100644
--- a/VocaluxeLib/CXMLReader.cs
+++ b/VocaluxeLib/CXMLReader.cs
@@ -24,17 +24,17 @@ namespace VocaluxeLib
public class CXMLReader
{
private readonly XPathNavigator _Navigator;
- private readonly String _FileName;
+ private readonly String _FilePath;
- public string FileName
+ public string FilePath
{
- get { return _FileName; }
+ get { return _FilePath; }
}
//Private method. Use OpenFile factory method to get an instance
private CXMLReader(string uri)
{
- _FileName = uri;
+ _FilePath = uri;
var xmlDoc = new XPathDocument(uri);
_Navigator = xmlDoc.CreateNavigator();
}
@@ -88,7 +88,24 @@ namespace VocaluxeLib
return GetValue(xPath, out val, value.ToString()) && CHelper.TryParse(val, out value);
}
- public bool GetValue(string xPath, out string value, string defaultValue)
+ public bool TryGetColorFromRGBA(string xPath, ref SColorF value)
+ {
+ bool result = true;
+ result &= TryGetFloatValue(xPath + "/R", ref value.R);
+ result &= TryGetFloatValue(xPath + "/G", ref value.G);
+ result &= TryGetFloatValue(xPath + "/B", ref value.B);
+ result &= TryGetFloatValue(xPath + "/A", ref value.A);
+ if (result)
+ {
+ value.R = value.R.Clamp(0f, 1f);
+ value.G = value.G.Clamp(0f, 1f);
+ value.B = value.B.Clamp(0f, 1f);
+ value.A = value.A.Clamp(0f, 1f);
+ }
+ return result;
+ }
+
+ public bool GetValue(string xPath, out string value, string defaultValue = "")
{
int resultCt = 0;
string val = string.Empty;
diff --git a/VocaluxeLib/IBasic.cs b/VocaluxeLib/IBasic.cs
index d88a4ea7..0583e189 100644
--- a/VocaluxeLib/IBasic.cs
+++ b/VocaluxeLib/IBasic.cs
@@ -166,7 +166,7 @@ namespace VocaluxeLib
public interface ILog
{
- void LogError(string errorText);
+ void LogError(string errorText, bool showMsg = false, bool exit = false);
void LogDebug(string text);
void LogSongInfo(string text);
}
diff --git a/VocaluxeLib/Menu/CButton.cs b/VocaluxeLib/Menu/CButton.cs
index 697f7c18..ff2e3537 100644
--- a/VocaluxeLib/Menu/CButton.cs
+++ b/VocaluxeLib/Menu/CButton.cs
@@ -96,7 +96,18 @@ namespace VocaluxeLib.Menu
}
}
public bool Visible = true;
- public bool Enabled = true;
+ private bool _Enabled = true;
+
+ public bool Enabled
+ {
+ get { return _Enabled; }
+ set
+ {
+ _Enabled = value;
+ if (!_Enabled)
+ _Selected = false;
+ }
+ }
public string GetThemeName()
{
@@ -138,7 +149,7 @@ namespace VocaluxeLib.Menu
_SelText = new CText(button._SelText);
Selected = false;
EditMode = false;
- Enabled = button.Enabled;
+ _Enabled = button._Enabled;
_Reflection = button._Reflection;
_ReflectionHeight = button._ReflectionHeight;
@@ -318,7 +329,7 @@ namespace VocaluxeLib.Menu
CTexture texture;
- if (!Selected && !Pressed || !Enabled)
+ if (!Selected && !Pressed || !_Enabled)
{
texture = Texture ?? CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
diff --git a/VocaluxeLib/Profile/CProfile.cs b/VocaluxeLib/Profile/CProfile.cs
index 24c9de70..cf03f5b0 100644
--- a/VocaluxeLib/Profile/CProfile.cs
+++ b/VocaluxeLib/Profile/CProfile.cs
@@ -84,18 +84,21 @@ namespace VocaluxeLib.Profile
{
PlayerName = value;
string avatarFileName;
- xmlReader.TryGetEnumValue("//root/Info/Difficulty", ref Difficulty);
- xmlReader.GetValue("//root/Info/Avatar", out avatarFileName, String.Empty);
+ bool ok = xmlReader.TryGetEnumValue("//root/Info/Difficulty", ref Difficulty);
+ ok &= xmlReader.GetValue("//root/Info/Avatar", out avatarFileName);
Avatar = CBase.Profiles.GetAvatarByFilename(avatarFileName);
- xmlReader.TryGetEnumValue("//root/Info/UserRole", ref UserRole);
- xmlReader.TryGetEnumValue("//root/Info/Active", ref Active);
+ ok &= Avatar != null;
+ ok &= xmlReader.TryGetEnumValue("//root/Info/UserRole", ref UserRole);
+ ok &= xmlReader.TryGetEnumValue("//root/Info/Active", ref Active);
string passwordHash;
- xmlReader.GetValue("//root/Info/PasswordHash", out passwordHash, "");
+ xmlReader.GetValue("//root/Info/PasswordHash", out passwordHash);
PasswordHash = !string.IsNullOrEmpty(passwordHash) ? Convert.FromBase64String(passwordHash) : null;
string passwordSalt;
- xmlReader.GetValue("//root/Info/PasswordSalt", out passwordSalt, "");
+ xmlReader.GetValue("//root/Info/PasswordSalt", out passwordSalt);
PasswordSalt = !string.IsNullOrEmpty(passwordSalt) ? Convert.FromBase64String(passwordSalt) : null;
- return true;
+ if (!ok)
+ CBase.Log.LogError("Error loading profile file: " + FileName);
+ return ok;
}
CBase.Log.LogError("Can't find PlayerName in Profile File: " + FileName);
diff --git a/VocaluxeLib/Songs/CCategory.cs b/VocaluxeLib/Songs/CCategory.cs
index 43fc78fb..79f5087c 100644
--- a/VocaluxeLib/Songs/CCategory.cs
+++ b/VocaluxeLib/Songs/CCategory.cs
@@ -56,18 +56,11 @@ namespace VocaluxeLib.Songs
return Songs.Count(sp => !sp.IsSung);
}
- public CCategory(string name, CTexture coverSmall, CTexture coverBig)
+ public CSong GetSong(int numInCategory)
{
- Name = name;
- CoverTextureSmall = coverSmall;
- CoverTextureBig = coverBig;
- }
-
- public CCategory(CCategory cat)
- {
- Name = cat.Name;
- CoverTextureSmall = cat.CoverTextureSmall;
- CoverTextureBig = cat.CoverTextureBig;
+ if (numInCategory >= 0 && numInCategory < Songs.Count)
+ return CBase.Songs.GetSongByID(Songs[numInCategory].SongID);
+ return null;
}
}
}
\ No newline at end of file