Introduce example for a more flexible deserialization

Also make the CoverGenerator themes serializeable
Rest is automatic reformatting.
This commit is contained in:
Flamefire committed 2014-10-01 00:54:04 +02:00
1 parent 467b619f0a
commit 6ebbf7df6f
33 files changed
+428 -397

No files matched your search

+12 -39
View File
@@ -23,34 +23,26 @@ using System.Xml.Serialization;
using VocaluxeLib.Draw;
using VocaluxeLib.PartyModes;
using VocaluxeLib.Songs;
using VocaluxeLib.Xml;
namespace VocaluxeLib.Menu.SongMenu
{
[XmlType("SongMenu")]
public struct SThemeSongMenu
{
[XmlAttributeAttribute(AttributeName = "Name")]
public string Name;
[XmlAttribute(AttributeName = "Name")] public string Name;
[XmlElement("CoverBackground")]
public string CoverBackgroundName;
[XmlElement("CoverBigBackground")]
public string CoverBigBackgroundName;
[XmlElement("DuetIcon")]
public string DuetIconName;
[XmlElement("VideoIcon")]
public string VideoIconName;
[XmlElement("MedleyCalcIcon")]
public string MedleyCalcIcon;
[XmlElement("MedleyTagIcon")]
public string MedleyTagIcon;
[XmlElement("Color")]
public SThemeColor Color;
[XmlElement("CoverBackground")] public string CoverBackgroundName;
[XmlElement("CoverBigBackground")] public string CoverBigBackgroundName;
[XmlElement("DuetIcon")] public string DuetIconName;
[XmlElement("VideoIcon")] public string VideoIconName;
[XmlElement("MedleyCalcIcon")] public string MedleyCalcIcon;
[XmlElement("MedleyTagIcon")] public string MedleyTagIcon;
[XmlElement("Color")] public SThemeColor Color;
//public SThemeSongMenuBook songMenuBook;
//public SThemeSongMenuDreidel songMenuDreidel;
//public SThemeSongMenuList songMenuList;
[XmlElement("SongMenuTileBoard")]
public SThemeSongMenuTileBoard SongMenuTileBoard;
public SThemeSongMenu(SThemeSongMenu theme)
@@ -69,65 +61,48 @@ namespace VocaluxeLib.Menu.SongMenu
public struct SThemeSongMenuTileBoard
{
[XmlElement("NumW")]
/// <summary>
/// Number of tiles horizontal
/// </summary>
public int NumW;
[XmlElement("NumH")]
/// <summary>
/// Number of tiles vertical
/// </summary>
public int NumH;
[XmlElement("NumWsmall")]
/// <summary>
/// Number of tiles horizontal in small-modus
/// </summary>
public int NumWsmall;
[XmlElement("NumHsmall")]
/// <summary>
/// Number of tiles vertical in small-modus
/// </summary>
public int NumHsmall;
[XmlElement("SpaceW")]
/// <summary>
/// Space between tiles horizontal
/// </summary>
public float SpaceW;
[XmlElement("SpaceH")]
/// <summary>
/// Space between tiles vertical
/// </summary>
public float SpaceH;
[XmlElement("TileRect")]
public SRectF TileRect;
[XmlElement("TileRectSmall")]
public SRectF TileRectSmall;
[XmlElement("TextArtist")]
public SThemeText TextArtist;
[XmlElement("TextTitle")]
public SThemeText TextTitle;
[XmlElement("TextSongLength")]
public SThemeText TextSongLength;
[XmlElement("StaticCoverBig")]
public SThemeStatic StaticCoverBig;
[XmlElement("StaticTextBG")]
public SThemeStatic StaticTextBG;
[XmlElement("StaticDuetIcon")]
public SThemeStatic StaticDuetIcon;
[XmlElement("StaticVideoIcon")]
public SThemeStatic StaticVideoIcon;
[XmlElement("StaticMedleyCalcIcon")]
public SThemeStatic StaticMedleyCalcIcon;
[XmlElement("StaticMedleyTagIcon")]
public SThemeStatic StaticMedleyTagIcon;
}
@@ -278,7 +253,6 @@ namespace VocaluxeLib.Menu.SongMenu
return _ThemeLoaded;
}
#endregion Theme
public virtual void Init()
@@ -294,10 +268,10 @@ namespace VocaluxeLib.Menu.SongMenu
}
public virtual void OnShow() {}
public virtual void OnHide()
{
if(CBase.Graphics.GetNextScreen() != EScreens.ScreenNames)
if (CBase.Graphics.GetNextScreen() != EScreens.ScreenNames)
_ResetPreview();
}
@@ -373,7 +347,6 @@ namespace VocaluxeLib.Menu.SongMenu
_ColorInternal = CBase.Theme.GetColor(_Theme.Color.Name, _PartyModeID);
else
_ColorInternal = _Theme.Color.Color;
}
public void ReloadTextures()