Try it for background.
This commit is contained in:
1 parent
6b958527ce
commit
4bbb0bfb14
2 files changed
+27
-7
No files matched your search
@@ -18,6 +18,7 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using VocaluxeLib.Draw;
|
||||
@@ -33,18 +34,22 @@ namespace VocaluxeLib.Menu
|
||||
Video
|
||||
}
|
||||
|
||||
struct SThemeBackground
|
||||
[XmlType("Background")]
|
||||
public struct SThemeBackground
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
|
||||
[XmlElement("Type")]
|
||||
public EBackgroundTypes Type;
|
||||
|
||||
[XmlArray]
|
||||
public List<string> SlideShowTextures;
|
||||
|
||||
[XmlElement("Video")]
|
||||
public string VideoName;
|
||||
[XmlElement("Skin")]
|
||||
public string TextureName;
|
||||
|
||||
[XmlElement("ColorName")]
|
||||
public string ColorName;
|
||||
public SColorF Color;
|
||||
}
|
||||
|
||||
public class CBackground : IMenuElement
|
||||
@@ -101,6 +106,8 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= success;
|
||||
}
|
||||
|
||||
_Theme.Color = new SColorF(Color);
|
||||
|
||||
int i = 1;
|
||||
|
||||
while (xmlReader.ItemExists(item + "/SlideShow" + i))
|
||||
@@ -244,6 +251,11 @@ namespace VocaluxeLib.Menu
|
||||
UnloadTextures();
|
||||
LoadTextures();
|
||||
}
|
||||
|
||||
public SThemeBackground GetTheme()
|
||||
{
|
||||
return _Theme;
|
||||
}
|
||||
#endregion public
|
||||
|
||||
#region internal
|
||||
|
||||
@@ -270,14 +270,22 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
//This is only test-stuff and will be removed later
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(List<SThemeStatic>));
|
||||
TextWriter textWriter = new StreamWriter(@Path.Combine(_ThemePath, ThemeName + "_test.xml"));
|
||||
|
||||
//Backgrounds
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(List<SThemeBackground>));
|
||||
List<SThemeBackground> backgroundThemes = new List<SThemeBackground>();
|
||||
foreach (CBackground bg in _Backgrounds)
|
||||
backgroundThemes.Add(bg.GetTheme());
|
||||
serializer.Serialize(textWriter, backgroundThemes);
|
||||
|
||||
//Statics
|
||||
serializer = new XmlSerializer(typeof(List<SThemeStatic>));
|
||||
List<SThemeStatic> staticsThemes = new List<SThemeStatic>();
|
||||
foreach (CStatic st in _Statics)
|
||||
staticsThemes.Add(st.GetTheme());
|
||||
|
||||
serializer.Serialize(textWriter, staticsThemes);
|
||||
|
||||
textWriter.Close();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user