Add serialization for all theme-elements.

This commit is contained in:
Florian Küpper committed 2014-08-26 16:48:30 +02:00
1 parent 4bbb0bfb14
commit b2102b11d9
17 files changed
+740 -61

No files matched your search

+29 -1
View File
@@ -17,16 +17,28 @@
using System;
using System.Xml;
using System.Xml.Serialization;
using VocaluxeLib.Songs;
namespace VocaluxeLib.Menu
{
struct SThemeLyrics
[XmlType("Lyric")]
public struct SThemeLyrics
{
[XmlAttributeAttribute(AttributeName = "Name")]
public string Name;
[XmlElement("Rect")]
public SRectF Rect;
[XmlElement("ColorName")]
public string ColorName;
[XmlElement("Color")]
public SColorF Color;
[XmlElement("SColorName")]
public string SelColorName;
[XmlElement("SColor")]
public SColorF SColor;
}
public class CLyric : IMenuElement
@@ -56,6 +68,11 @@ namespace VocaluxeLib.Menu
return _Theme.Name;
}
public bool ThemeLoaded
{
get { return _ThemeLoaded; }
}
public SRectF Rect
{
get { return new SRectF(_X, _Y, _MaxW, _H, _Z); }
@@ -141,6 +158,10 @@ namespace VocaluxeLib.Menu
if (_ThemeLoaded)
{
_Theme.Name = elementName;
_Theme.Color = new SColorF(_Color);
_Theme.SColor = new SColorF(_ColorProcessed);
_Theme.Rect = new SRectF(Rect);
LoadTextures();
_Text = new CText(_X, _Y, _Z, _H, _MaxW, EAlignment.Left, EStyle.Bold, "Normal", _Color, String.Empty);
}
@@ -480,6 +501,11 @@ namespace VocaluxeLib.Menu
LoadTextures();
}
public SThemeLyrics GetTheme()
{
return _Theme;
}
#region ThemeEdit
public void MoveElement(int stepX, int stepY)
{
@@ -487,6 +513,7 @@ namespace VocaluxeLib.Menu
rect.X += stepX;
rect.Y += stepY;
Rect = rect;
_Theme.Rect = rect;
}
public void ResizeElement(int stepW, int stepH)
@@ -501,6 +528,7 @@ namespace VocaluxeLib.Menu
rect.H = 1;
Rect = rect;
_Theme.Rect = rect;
}
#endregion ThemeEdit
}