Merge branch 'develop' of github.com:Flamefire/Vocaluxe into theme
This commit is contained in:
commit
a55d724620
21 files changed
+192
-111
No files matched your search
@@ -93,6 +93,7 @@
|
|||||||
<string name="TR_SCREENMAIN_BUTTON_PARTY">Party</string>
|
<string name="TR_SCREENMAIN_BUTTON_PARTY">Party</string>
|
||||||
<string name="TR_SCREENMAIN_BUTTON_OPTIONS">Options</string>
|
<string name="TR_SCREENMAIN_BUTTON_OPTIONS">Options</string>
|
||||||
<string name="TR_SCREENMAIN_BUTTON_PROFILES">Profiles</string>
|
<string name="TR_SCREENMAIN_BUTTON_PROFILES">Profiles</string>
|
||||||
|
<string name="TR_SCREENMAIN_TEXT_NOPROFILES">No profiles found!</string>
|
||||||
<string name="TR_SCREENPARTY_TITLE">Party Mode Selection</string>
|
<string name="TR_SCREENPARTY_TITLE">Party Mode Selection</string>
|
||||||
<string name="TR_SCREENPARTY_MODES">Party Mode</string>
|
<string name="TR_SCREENPARTY_MODES">Party Mode</string>
|
||||||
<string name="TR_SCREENPARTY_DESCRIPTION">Description</string>
|
<string name="TR_SCREENPARTY_DESCRIPTION">Description</string>
|
||||||
|
|||||||
@@ -92,6 +92,7 @@
|
|||||||
<string name="TR_SCREENMAIN_BUTTON_PARTY">Party</string>
|
<string name="TR_SCREENMAIN_BUTTON_PARTY">Party</string>
|
||||||
<string name="TR_SCREENMAIN_BUTTON_OPTIONS">Optionen</string>
|
<string name="TR_SCREENMAIN_BUTTON_OPTIONS">Optionen</string>
|
||||||
<string name="TR_SCREENMAIN_BUTTON_PROFILES">Profile</string>
|
<string name="TR_SCREENMAIN_BUTTON_PROFILES">Profile</string>
|
||||||
|
<string name="TR_SCREENMAIN_TEXT_NOPROFILES">Keine Profile gefunden!</string>
|
||||||
<string name="TR_SCREENPARTY_TITLE">Party-Modus Auswahl</string>
|
<string name="TR_SCREENPARTY_TITLE">Party-Modus Auswahl</string>
|
||||||
<string name="TR_SCREENPARTY_MODES">Party-Modus</string>
|
<string name="TR_SCREENPARTY_MODES">Party-Modus</string>
|
||||||
<string name="TR_SCREENPARTY_DESCRIPTION">Beschreibung</string>
|
<string name="TR_SCREENPARTY_DESCRIPTION">Beschreibung</string>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<ScreenMain>
|
<ScreenMain>
|
||||||
<ScreenVersion>1</ScreenVersion>
|
<ScreenVersion>2</ScreenVersion>
|
||||||
<Background1>
|
<Background1>
|
||||||
<!--<Type>: Background type: None, Color, Texture, Video-->
|
<!--<Type>: Background type: None, Color, Texture, Video-->
|
||||||
<Type>Video</Type>
|
<Type>Video</Type>
|
||||||
@@ -314,5 +314,79 @@
|
|||||||
<Height>26</Height>
|
<Height>26</Height>
|
||||||
</SReflection>
|
</SReflection>
|
||||||
</ButtonExit>
|
</ButtonExit>
|
||||||
|
<TextRelease>
|
||||||
|
<!--<X>, <Y>: Text position-->
|
||||||
|
<X>10</X>
|
||||||
|
<Y>690</Y>
|
||||||
|
<!--<Z>: Text position-->
|
||||||
|
<Z>-1</Z>
|
||||||
|
<!--<H>: Text height-->
|
||||||
|
<H>15</H>
|
||||||
|
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>TextWhite</Color>
|
||||||
|
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
|
||||||
|
<SColor>TextWhite</SColor>
|
||||||
|
<!--<Align>: Text align horizontal: Left, Center, Right-->
|
||||||
|
<Align>Left</Align>
|
||||||
|
<!--<ResizeAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
|
||||||
|
<HAlign>Center</HAlign>
|
||||||
|
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
|
||||||
|
<Style>Normal</Style>
|
||||||
|
<!--<Font>: Text font name-->
|
||||||
|
<Font>Normal</Font>
|
||||||
|
<!--<Text>: Nothing or translation tag-->
|
||||||
|
<Text />
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</TextRelease>
|
||||||
|
<StaticWarningProfiles>
|
||||||
|
<!--<Skin>: Texture name-->
|
||||||
|
<Skin>TextBG</Skin>
|
||||||
|
<!--<X>, <Y>, <Z>, <W>, <H>: Static position, width and height-->
|
||||||
|
<X>150</X>
|
||||||
|
<Y>610</Y>
|
||||||
|
<Z>-1,90</Z>
|
||||||
|
<W>355</W>
|
||||||
|
<H>30</H>
|
||||||
|
<!--<Color>: Static color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>StaticWarningColor</Color>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</StaticWarningProfiles>
|
||||||
|
<TextWarningProfiles>
|
||||||
|
<!--<X>, <Y>: Text position-->
|
||||||
|
<X>320</X>
|
||||||
|
<Y>612</Y>
|
||||||
|
<!--<Z>: Text position-->
|
||||||
|
<Z>-2,00</Z>
|
||||||
|
<!--<H>: Text height-->
|
||||||
|
<H>27</H>
|
||||||
|
<!--<MaxW>: Maximum text width (if exists)-->
|
||||||
|
<MaxW>355</MaxW>
|
||||||
|
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>TextWarningColor</Color>
|
||||||
|
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
|
||||||
|
<SColor>TextWarningColor</SColor>
|
||||||
|
<!--<Align>: Text align horizontal: Left, Center, Right-->
|
||||||
|
<Align>Center</Align>
|
||||||
|
<!--<ResizeAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
|
||||||
|
<HAlign>Center</HAlign>
|
||||||
|
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
|
||||||
|
<Style>Bold</Style>
|
||||||
|
<!--<Font>: Text font name-->
|
||||||
|
<Font>Outline</Font>
|
||||||
|
<!--<Text>: Nothing or translation tag-->
|
||||||
|
<Text>TR_SCREENMAIN_TEXT_NOPROFILES</Text>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</TextWarningProfiles>
|
||||||
</ScreenMain>
|
</ScreenMain>
|
||||||
</root>
|
</root>
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
<R>0,675</R>
|
<R>0,675</R>
|
||||||
<G>0,890</G>
|
<G>0,890</G>
|
||||||
<B>0,969</B>
|
<B>0,969</B>
|
||||||
<A>1,000</A>
|
<A>0,600</A>
|
||||||
</StaticWarningColor>
|
</StaticWarningColor>
|
||||||
<ButtonColor>
|
<ButtonColor>
|
||||||
<R>0,675</R>
|
<R>0,675</R>
|
||||||
@@ -227,9 +227,9 @@
|
|||||||
<A>1,000</A>
|
<A>1,000</A>
|
||||||
</TextBlack>
|
</TextBlack>
|
||||||
<TextWhite>
|
<TextWhite>
|
||||||
<R>0,000</R>
|
<R>1,000</R>
|
||||||
<G>0,000</G>
|
<G>1,000</G>
|
||||||
<B>0,000</B>
|
<B>1,000</B>
|
||||||
<A>1,000</A>
|
<A>1,000</A>
|
||||||
</TextWhite>
|
</TextWhite>
|
||||||
<Visible>
|
<Visible>
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
<R>0,709</R>
|
<R>0,709</R>
|
||||||
<G>0,968</G>
|
<G>0,968</G>
|
||||||
<B>0,674</B>
|
<B>0,674</B>
|
||||||
<A>1,000</A>
|
<A>0,600</A>
|
||||||
</StaticWarningColor>
|
</StaticWarningColor>
|
||||||
<ButtonColor>
|
<ButtonColor>
|
||||||
<R>0,709</R>
|
<R>0,709</R>
|
||||||
@@ -221,9 +221,9 @@
|
|||||||
<A>1,000</A>
|
<A>1,000</A>
|
||||||
</TextBlack>
|
</TextBlack>
|
||||||
<TextWhite>
|
<TextWhite>
|
||||||
<R>0,000</R>
|
<R>1,000</R>
|
||||||
<G>0,000</G>
|
<G>1,000</G>
|
||||||
<B>0,000</B>
|
<B>1,000</B>
|
||||||
<A>1,000</A>
|
<A>1,000</A>
|
||||||
</TextWhite>
|
</TextWhite>
|
||||||
<Visible>
|
<Visible>
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
<R>0,968</R>
|
<R>0,968</R>
|
||||||
<G>0,674</G>
|
<G>0,674</G>
|
||||||
<B>0,674</B>
|
<B>0,674</B>
|
||||||
<A>1,000</A>
|
<A>0,600</A>
|
||||||
</StaticWarningColor>
|
</StaticWarningColor>
|
||||||
<ButtonColor>
|
<ButtonColor>
|
||||||
<R>0,968</R>
|
<R>0,968</R>
|
||||||
@@ -221,9 +221,9 @@
|
|||||||
<A>1,000</A>
|
<A>1,000</A>
|
||||||
</TextBlack>
|
</TextBlack>
|
||||||
<TextWhite>
|
<TextWhite>
|
||||||
<R>0,000</R>
|
<R>1,000</R>
|
||||||
<G>0,000</G>
|
<G>1,000</G>
|
||||||
<B>0,000</B>
|
<B>1,000</B>
|
||||||
<A>1,000</A>
|
<A>1,000</A>
|
||||||
</TextWhite>
|
</TextWhite>
|
||||||
<Visible>
|
<Visible>
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
<R>0,968</R>
|
<R>0,968</R>
|
||||||
<G>0,956</G>
|
<G>0,956</G>
|
||||||
<B>0,674</B>
|
<B>0,674</B>
|
||||||
<A>1,000</A>
|
<A>0,600</A>
|
||||||
</StaticWarningColor>
|
</StaticWarningColor>
|
||||||
<ButtonColor>
|
<ButtonColor>
|
||||||
<R>0,968</R>
|
<R>0,968</R>
|
||||||
@@ -221,9 +221,9 @@
|
|||||||
<A>1,000</A>
|
<A>1,000</A>
|
||||||
</TextBlack>
|
</TextBlack>
|
||||||
<TextWhite>
|
<TextWhite>
|
||||||
<R>0,000</R>
|
<R>1,000</R>
|
||||||
<G>0,000</G>
|
<G>1,000</G>
|
||||||
<B>0,000</B>
|
<B>1,000</B>
|
||||||
<A>1,000</A>
|
<A>1,000</A>
|
||||||
</TextWhite>
|
</TextWhite>
|
||||||
<Visible>
|
<Visible>
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
SceenMain
|
||||||
|
|
||||||
|
++++++++++
|
||||||
|
Version 2:
|
||||||
|
|
||||||
|
Add:
|
||||||
|
<StaticWarningProfiles>
|
||||||
|
<TextWarningProfiles>
|
||||||
|
<TextRelease>
|
||||||
|
|
||||||
@@ -457,7 +457,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
|
|
||||||
public override void LeavingHighscore()
|
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);
|
CBase.Songs.AddPartySongSung(CBase.Game.GetSong(i).ID);
|
||||||
_GameData.CurrentRoundNr++;
|
_GameData.CurrentRoundNr++;
|
||||||
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
||||||
@@ -588,12 +588,6 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
{
|
{
|
||||||
CProfile[] profiles = CBase.Profiles.GetProfiles();
|
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)
|
if (_GameData.NumPlayerAtOnce < 1 || _GameData.ProfileIDs.Count < _GameData.NumPlayerAtOnce || profiles.Length < _GameData.NumPlayerAtOnce)
|
||||||
{
|
{
|
||||||
_ScreenSongOptions.Selection.TeamNames = new string[] {"foo", "bar"};
|
_ScreenSongOptions.Selection.TeamNames = new string[] {"foo", "bar"};
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
if (_PlaysPreview)
|
if (_PlaysPreview)
|
||||||
_PreviewPlayer.Play();
|
_PreviewPlayer.Play();
|
||||||
else
|
else if(CConfig.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_OFF)
|
||||||
if (_SongPlayer.SongLoaded)
|
if (_SongPlayer.SongLoaded)
|
||||||
//Resume
|
//Resume
|
||||||
_SongPlayer.TogglePause();
|
_SongPlayer.TogglePause();
|
||||||
@@ -218,11 +218,13 @@ namespace Vocaluxe.Base
|
|||||||
return;
|
return;
|
||||||
_PreviewPlayer.TogglePause();
|
_PreviewPlayer.TogglePause();
|
||||||
}
|
}
|
||||||
else
|
else if (CConfig.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_ON)
|
||||||
|
{
|
||||||
if (!_SongPlayer.SongLoaded)
|
if (!_SongPlayer.SongLoaded)
|
||||||
Next();
|
Next();
|
||||||
else
|
else
|
||||||
_SongPlayer.TogglePause();
|
_SongPlayer.TogglePause();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Next()
|
public static void Next()
|
||||||
|
|||||||
@@ -888,7 +888,7 @@ namespace Vocaluxe.Base
|
|||||||
for (int j = 0; j < CSettings.MaxNumPlayer; j++)
|
for (int j = 0; j < CSettings.MaxNumPlayer; j++)
|
||||||
{
|
{
|
||||||
CGame.Players[j].ProfileID = -1;
|
CGame.Players[j].ProfileID = -1;
|
||||||
if (Players[j] == "" || profiles == null)
|
if (Players[j] == "")
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
foreach (CProfile profile in profiles)
|
foreach (CProfile profile in profiles)
|
||||||
|
|||||||
+9
-42
@@ -40,7 +40,7 @@ namespace Vocaluxe.Base
|
|||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
_LoadCoverThemes();
|
_LoadCoverThemes();
|
||||||
_LoadCover(CConfig.CoverTheme);
|
_LoadCovers(CConfig.CoverTheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Close()
|
public static void Close()
|
||||||
@@ -107,7 +107,7 @@ namespace Vocaluxe.Base
|
|||||||
public static void ReloadCovers()
|
public static void ReloadCovers()
|
||||||
{
|
{
|
||||||
_UnloadCovers();
|
_UnloadCovers();
|
||||||
_LoadCover(CConfig.CoverTheme);
|
_LoadCovers(CConfig.CoverTheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void _UnloadCovers()
|
private static void _UnloadCovers()
|
||||||
@@ -170,69 +170,36 @@ namespace Vocaluxe.Base
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads all cover which are defined in the cover config file.
|
/// Loads all cover which are defined in the cover config file.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static void _LoadCover(string coverThemeName)
|
private static void _LoadCovers(string coverThemeName)
|
||||||
{
|
{
|
||||||
SCoverTheme coverTheme = _CoverTheme(coverThemeName);
|
SCoverTheme coverTheme = _CoverTheme(coverThemeName);
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(coverTheme.Name))
|
if (String.IsNullOrEmpty(coverTheme.Name))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var ignoreList = new List<string>();
|
|
||||||
|
|
||||||
string coverPath = Path.Combine(CSettings.ProgramFolder, CSettings.FolderNameCover, coverTheme.Folder);
|
string coverPath = Path.Combine(CSettings.ProgramFolder, CSettings.FolderNameCover, coverTheme.Folder);
|
||||||
List<string> files = CHelper.ListImageFiles(coverPath, true, true);
|
List<string> files = CHelper.ListImageFiles(coverPath, true, true);
|
||||||
|
|
||||||
CXMLReader xmlReader = CXMLReader.OpenFile(Path.Combine(CSettings.ProgramFolder, CSettings.FolderNameCover, coverTheme.File));
|
|
||||||
lock (_Covers)
|
lock (_Covers)
|
||||||
{
|
{
|
||||||
if (xmlReader != null)
|
|
||||||
{
|
|
||||||
_Covers.Clear();
|
|
||||||
List<string> 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)
|
foreach (string file in files)
|
||||||
{
|
_AddCover(Path.GetFileNameWithoutExtension(file), file);
|
||||||
if (!ignoreList.Contains(Path.GetFileName(file)))
|
if (_CoverExists("No Cover"))
|
||||||
_AddCover(Path.GetFileNameWithoutExtension(file), file);
|
NoCover = _Covers["No Cover"];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ads a cover with the given name if it does not exist yet
|
/// Ads a cover with the given name if it does not exist yet
|
||||||
/// MUST HOLD _Covers lock at this point
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">Name of the cover</param>
|
/// <param name="name">Name of the cover</param>
|
||||||
/// <param name="file">Filename of image file</param>
|
/// <param name="file">Filename of image file</param>
|
||||||
private static void _AddCover(string name, string file)
|
private static void _AddCover(string name, string file)
|
||||||
{
|
{
|
||||||
CTexture texture = CDraw.AddTexture(file);
|
lock (_Covers)
|
||||||
|
|
||||||
if (!_CoverExists(name))
|
|
||||||
_Covers.Add(name, texture);
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
CTexture tex = _Covers[name];
|
if (!_CoverExists(name))
|
||||||
CDraw.RemoveTexture(ref tex);
|
_Covers.Add(name, CDraw.AddTexture(file));
|
||||||
_Covers[name] = texture;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ namespace Vocaluxe.Base
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -479,9 +479,9 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
class CBlog : ILog
|
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)
|
public void LogDebug(string text)
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ namespace Vocaluxe.Base
|
|||||||
public static CProfile[] GetProfiles()
|
public static CProfile[] GetProfiles()
|
||||||
{
|
{
|
||||||
if (_Profiles.Count == 0)
|
if (_Profiles.Count == 0)
|
||||||
return null;
|
return new CProfile[0];
|
||||||
|
|
||||||
var list = new List<CProfile>(_Profiles.Values);
|
var list = new List<CProfile>(_Profiles.Values);
|
||||||
list.Sort(_CompareByPlayerName);
|
list.Sort(_CompareByPlayerName);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace Vocaluxe.Screens
|
|||||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
protected override int _ScreenVersion
|
protected override int _ScreenVersion
|
||||||
{
|
{
|
||||||
get { return 1; }
|
get { return 2; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private const string _ButtonSing = "ButtonSing";
|
private const string _ButtonSing = "ButtonSing";
|
||||||
@@ -35,23 +35,30 @@ namespace Vocaluxe.Screens
|
|||||||
private const string _ButtonOptions = "ButtonOptions";
|
private const string _ButtonOptions = "ButtonOptions";
|
||||||
private const string _ButtonProfiles = "ButtonProfiles";
|
private const string _ButtonProfiles = "ButtonProfiles";
|
||||||
private const string _ButtonExit = "ButtonExit";
|
private const string _ButtonExit = "ButtonExit";
|
||||||
|
private const string _StaticWarningProfiles = "StaticWarningProfiles";
|
||||||
private CText _ReleaseText;
|
private const string _TextWarningProfiles = "TextWarningProfiles";
|
||||||
|
private const string _TextRelease = "TextRelease";
|
||||||
|
|
||||||
//CParticleEffect Snowflakes;
|
//CParticleEffect Snowflakes;
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
|
|
||||||
_ThemeStatics = new string[] {"StaticMenuBar"};
|
_ThemeStatics = new string[] {"StaticMenuBar", _StaticWarningProfiles};
|
||||||
_ThemeButtons = new string[] {_ButtonSing, _ButtonParty, _ButtonOptions, _ButtonProfiles, _ButtonExit};
|
_ThemeButtons = new string[] {_ButtonSing, _ButtonParty, _ButtonOptions, _ButtonProfiles, _ButtonExit};
|
||||||
|
_ThemeTexts = new string[] {_TextRelease, _TextWarningProfiles};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LoadTheme(string xmlPath)
|
public override void LoadTheme(string xmlPath)
|
||||||
{
|
{
|
||||||
base.LoadTheme(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)
|
public override bool HandleInput(SKeyEvent keyEvent)
|
||||||
@@ -68,7 +75,8 @@ namespace Vocaluxe.Screens
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.S:
|
case Keys.S:
|
||||||
CGraphics.FadeTo(EScreens.ScreenSong);
|
if (CProfiles.NumProfiles > 0)
|
||||||
|
CGraphics.FadeTo(EScreens.ScreenSong);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.C:
|
case Keys.C:
|
||||||
@@ -145,6 +153,11 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
public override bool UpdateGame()
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,11 +172,6 @@ namespace Vocaluxe.Screens
|
|||||||
//Snowflakes.Draw();
|
//Snowflakes.Draw();
|
||||||
_DrawFG();
|
_DrawFG();
|
||||||
|
|
||||||
// ReSharper disable ConditionIsAlwaysTrueOrFalse
|
|
||||||
if (CSettings.VersionRevision != ERevision.Release)
|
|
||||||
// ReSharper restore ConditionIsAlwaysTrueOrFalse
|
|
||||||
_ReleaseText.Draw();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,17 +24,17 @@ namespace VocaluxeLib
|
|||||||
public class CXMLReader
|
public class CXMLReader
|
||||||
{
|
{
|
||||||
private readonly XPathNavigator _Navigator;
|
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 method. Use OpenFile factory method to get an instance
|
||||||
private CXMLReader(string uri)
|
private CXMLReader(string uri)
|
||||||
{
|
{
|
||||||
_FileName = uri;
|
_FilePath = uri;
|
||||||
var xmlDoc = new XPathDocument(uri);
|
var xmlDoc = new XPathDocument(uri);
|
||||||
_Navigator = xmlDoc.CreateNavigator();
|
_Navigator = xmlDoc.CreateNavigator();
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,24 @@ namespace VocaluxeLib
|
|||||||
return GetValue(xPath, out val, value.ToString()) && CHelper.TryParse(val, out value);
|
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;
|
int resultCt = 0;
|
||||||
string val = string.Empty;
|
string val = string.Empty;
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ namespace VocaluxeLib
|
|||||||
|
|
||||||
public interface ILog
|
public interface ILog
|
||||||
{
|
{
|
||||||
void LogError(string errorText);
|
void LogError(string errorText, bool showMsg = false, bool exit = false);
|
||||||
void LogDebug(string text);
|
void LogDebug(string text);
|
||||||
void LogSongInfo(string text);
|
void LogSongInfo(string text);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,18 @@ namespace VocaluxeLib.Menu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public bool Visible = true;
|
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()
|
public string GetThemeName()
|
||||||
{
|
{
|
||||||
@@ -138,7 +149,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_SelText = new CText(button._SelText);
|
_SelText = new CText(button._SelText);
|
||||||
Selected = false;
|
Selected = false;
|
||||||
EditMode = false;
|
EditMode = false;
|
||||||
Enabled = button.Enabled;
|
_Enabled = button._Enabled;
|
||||||
|
|
||||||
_Reflection = button._Reflection;
|
_Reflection = button._Reflection;
|
||||||
_ReflectionHeight = button._ReflectionHeight;
|
_ReflectionHeight = button._ReflectionHeight;
|
||||||
@@ -318,7 +329,7 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
CTexture texture;
|
CTexture texture;
|
||||||
|
|
||||||
if (!Selected && !Pressed || !Enabled)
|
if (!Selected && !Pressed || !_Enabled)
|
||||||
{
|
{
|
||||||
texture = Texture ?? CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
texture = Texture ?? CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||||
|
|
||||||
|
|||||||
@@ -84,18 +84,21 @@ namespace VocaluxeLib.Profile
|
|||||||
{
|
{
|
||||||
PlayerName = value;
|
PlayerName = value;
|
||||||
string avatarFileName;
|
string avatarFileName;
|
||||||
xmlReader.TryGetEnumValue("//root/Info/Difficulty", ref Difficulty);
|
bool ok = xmlReader.TryGetEnumValue("//root/Info/Difficulty", ref Difficulty);
|
||||||
xmlReader.GetValue("//root/Info/Avatar", out avatarFileName, String.Empty);
|
ok &= xmlReader.GetValue("//root/Info/Avatar", out avatarFileName);
|
||||||
Avatar = CBase.Profiles.GetAvatarByFilename(avatarFileName);
|
Avatar = CBase.Profiles.GetAvatarByFilename(avatarFileName);
|
||||||
xmlReader.TryGetEnumValue("//root/Info/UserRole", ref UserRole);
|
ok &= Avatar != null;
|
||||||
xmlReader.TryGetEnumValue("//root/Info/Active", ref Active);
|
ok &= xmlReader.TryGetEnumValue("//root/Info/UserRole", ref UserRole);
|
||||||
|
ok &= xmlReader.TryGetEnumValue("//root/Info/Active", ref Active);
|
||||||
string passwordHash;
|
string passwordHash;
|
||||||
xmlReader.GetValue("//root/Info/PasswordHash", out passwordHash, "");
|
xmlReader.GetValue("//root/Info/PasswordHash", out passwordHash);
|
||||||
PasswordHash = !string.IsNullOrEmpty(passwordHash) ? Convert.FromBase64String(passwordHash) : null;
|
PasswordHash = !string.IsNullOrEmpty(passwordHash) ? Convert.FromBase64String(passwordHash) : null;
|
||||||
string passwordSalt;
|
string passwordSalt;
|
||||||
xmlReader.GetValue("//root/Info/PasswordSalt", out passwordSalt, "");
|
xmlReader.GetValue("//root/Info/PasswordSalt", out passwordSalt);
|
||||||
PasswordSalt = !string.IsNullOrEmpty(passwordSalt) ? Convert.FromBase64String(passwordSalt) : null;
|
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);
|
CBase.Log.LogError("Can't find PlayerName in Profile File: " + FileName);
|
||||||
|
|||||||
@@ -56,18 +56,11 @@ namespace VocaluxeLib.Songs
|
|||||||
return Songs.Count(sp => !sp.IsSung);
|
return Songs.Count(sp => !sp.IsSung);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CCategory(string name, CTexture coverSmall, CTexture coverBig)
|
public CSong GetSong(int numInCategory)
|
||||||
{
|
{
|
||||||
Name = name;
|
if (numInCategory >= 0 && numInCategory < Songs.Count)
|
||||||
CoverTextureSmall = coverSmall;
|
return CBase.Songs.GetSongByID(Songs[numInCategory].SongID);
|
||||||
CoverTextureBig = coverBig;
|
return null;
|
||||||
}
|
|
||||||
|
|
||||||
public CCategory(CCategory cat)
|
|
||||||
{
|
|
||||||
Name = cat.Name;
|
|
||||||
CoverTextureSmall = cat.CoverTextureSmall;
|
|
||||||
CoverTextureBig = cat.CoverTextureBig;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user