Add serialization for all theme-elements.
This commit is contained in:
1 parent
4bbb0bfb14
commit
b2102b11d9
17 files changed
+740
-61
No files matched your search
@@ -302,6 +302,11 @@ namespace VocaluxeLib
|
||||
filename = Path.Combine(path, filename);
|
||||
return filename + ext;
|
||||
}
|
||||
|
||||
public static int Sum(int n)
|
||||
{
|
||||
return (n * n + n) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
static class CEncoding
|
||||
|
||||
@@ -63,6 +63,10 @@ namespace VocaluxeLib.Menu
|
||||
private readonly List<CTexture> _SlideShowTextures = new List<CTexture>();
|
||||
|
||||
public SColorF Color;
|
||||
public bool ThemeLoaded
|
||||
{
|
||||
get { return _ThemeLoaded; }
|
||||
}
|
||||
|
||||
public string GetThemeName()
|
||||
{
|
||||
|
||||
@@ -17,19 +17,36 @@
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
struct SThemeButton
|
||||
[XmlType("Button")]
|
||||
public struct SThemeButton
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
|
||||
public string ColorName;
|
||||
public string SelColorName;
|
||||
|
||||
[XmlElement("Skin")]
|
||||
public string TextureName;
|
||||
[XmlElement("SkinSelected")]
|
||||
public string SelTextureName;
|
||||
public SRectF Rect;
|
||||
[XmlElement("ColorName")]
|
||||
public string ColorName;
|
||||
[XmlElement("Color")]
|
||||
public SColorF Color;
|
||||
[XmlElement("SelColorName")]
|
||||
public string SelColorName;
|
||||
[XmlElement("SelColor")]
|
||||
public SColorF SelColor;
|
||||
[XmlElement("Text")]
|
||||
public SThemeText Text;
|
||||
[XmlElement("Reflection")]
|
||||
public SReflection Reflection;
|
||||
[XmlElement("SelReflection")]
|
||||
public SReflection SelReflection;
|
||||
}
|
||||
|
||||
public class CButton : IMenuElement
|
||||
@@ -86,6 +103,11 @@ namespace VocaluxeLib.Menu
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public bool ThemeLoaded
|
||||
{
|
||||
get { return _ThemeLoaded; }
|
||||
}
|
||||
|
||||
public CButton(int partyModeID)
|
||||
{
|
||||
_PartyModeID = partyModeID;
|
||||
@@ -177,22 +199,37 @@ namespace VocaluxeLib.Menu
|
||||
_Reflection = true;
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Reflection/Space", ref _ReflectionSpace);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Reflection/Height", ref _ReflectionHeight);
|
||||
|
||||
_Theme.Reflection = new SReflection(true, _ReflectionHeight, _ReflectionSpace);
|
||||
}
|
||||
else
|
||||
{
|
||||
_Reflection = false;
|
||||
_Theme.Reflection = new SReflection(false, 0f, 0f);
|
||||
}
|
||||
|
||||
if (xmlReader.ItemExists(item + "/SReflection"))
|
||||
{
|
||||
_SelReflection = true;
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SReflection/Space", ref _SelReflectionSpace);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SReflection/Height", ref _SelReflectionHeight);
|
||||
|
||||
_Theme.SelReflection = new SReflection(true, _SelReflectionHeight, _SelReflectionSpace);
|
||||
}
|
||||
else
|
||||
{
|
||||
_SelReflection = false;
|
||||
_Theme.SelReflection = new SReflection(false, 0f, 0f);
|
||||
}
|
||||
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = elementName;
|
||||
_Theme.Rect = new SRectF(Rect);
|
||||
_Theme.Color = new SColorF(Color);
|
||||
_Theme.SelColor = new SColorF(SelColor);
|
||||
_Theme.Text = Text.GetTheme();
|
||||
|
||||
LoadTextures();
|
||||
}
|
||||
return _ThemeLoaded;
|
||||
@@ -352,11 +389,19 @@ namespace VocaluxeLib.Menu
|
||||
LoadTextures();
|
||||
}
|
||||
|
||||
public SThemeButton GetTheme()
|
||||
{
|
||||
return _Theme;
|
||||
}
|
||||
|
||||
#region ThemeEdit
|
||||
public void MoveElement(int stepX, int stepY)
|
||||
{
|
||||
Rect.X += stepX;
|
||||
Rect.Y += stepY;
|
||||
|
||||
_Theme.Rect.X += stepX;
|
||||
_Theme.Rect.Y += stepY;
|
||||
}
|
||||
|
||||
public void ResizeElement(int stepW, int stepH)
|
||||
@@ -368,6 +413,9 @@ namespace VocaluxeLib.Menu
|
||||
Rect.H += stepH;
|
||||
if (Rect.H <= 0)
|
||||
Rect.H = 1;
|
||||
|
||||
_Theme.Rect.W = Rect.W;
|
||||
_Theme.Rect.H = Rect.H;
|
||||
}
|
||||
#endregion ThemeEdit
|
||||
}
|
||||
|
||||
@@ -17,26 +17,46 @@
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
enum EEqualizerStyle
|
||||
public enum EEqualizerStyle
|
||||
{
|
||||
Columns
|
||||
}
|
||||
|
||||
struct SThemeEqualizer
|
||||
[XmlType("Equalizer")]
|
||||
public struct SThemeEqualizer
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
|
||||
public string ColorName;
|
||||
public string MaxColorName;
|
||||
[XmlElement("Skin")]
|
||||
public string TextureName;
|
||||
|
||||
public int NumBars;
|
||||
[XmlElement("Rect")]
|
||||
public SRectF Rect;
|
||||
|
||||
[XmlElement("NumBars")]
|
||||
public int NumBars;
|
||||
[XmlElement("Space")]
|
||||
public float Space;
|
||||
[XmlElement("Style")]
|
||||
public EEqualizerStyle Style;
|
||||
[XmlElement("DrawNegative")]
|
||||
public EOffOn DrawNegative;
|
||||
|
||||
[XmlElement("ColorName")]
|
||||
public string ColorName;
|
||||
[XmlElement("Color")]
|
||||
public SColorF Color;
|
||||
[XmlElement("MaxColorName")]
|
||||
public string MaxColorName;
|
||||
[XmlElement("MaxColor")]
|
||||
public SColorF MaxColor;
|
||||
[XmlElement("Reflection")]
|
||||
public SReflection Reflection;
|
||||
}
|
||||
|
||||
public class CEqualizer : IMenuElement
|
||||
@@ -63,6 +83,11 @@ namespace VocaluxeLib.Menu
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public bool ThemeLoaded
|
||||
{
|
||||
get { return _ThemeLoaded; }
|
||||
}
|
||||
|
||||
private float[] _Bars;
|
||||
private int _MaxBar;
|
||||
private float _MaxVolume;
|
||||
@@ -133,13 +158,23 @@ namespace VocaluxeLib.Menu
|
||||
Reflection = true;
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Reflection/Space", ref ReflectionSpace);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Reflection/Height", ref ReflectionHeight);
|
||||
|
||||
_Theme.Reflection = new SReflection(true, ReflectionHeight, ReflectionSpace);
|
||||
}
|
||||
else
|
||||
{
|
||||
Reflection = false;
|
||||
_Theme.Reflection = new SReflection(false, 0f, 0f);
|
||||
}
|
||||
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = elementName;
|
||||
_Theme.Space = Space;
|
||||
_Theme.Color = new SColorF(Color);
|
||||
_Theme.MaxColor = new SColorF(MaxColor);
|
||||
_Theme.Rect = Rect;
|
||||
|
||||
_Bars = new float[_Theme.NumBars];
|
||||
for (int i = 0; i < _Bars.Length; i++)
|
||||
_Bars[i] = 0f;
|
||||
@@ -299,11 +334,19 @@ namespace VocaluxeLib.Menu
|
||||
LoadTextures();
|
||||
}
|
||||
|
||||
public SThemeEqualizer GetTheme()
|
||||
{
|
||||
return _Theme;
|
||||
}
|
||||
|
||||
#region ThemeEdit
|
||||
public void MoveElement(int stepX, int stepY)
|
||||
{
|
||||
Rect.X += stepX;
|
||||
Rect.Y += stepY;
|
||||
|
||||
_Theme.Rect.X += stepX;
|
||||
_Theme.Rect.Y += stepY;
|
||||
}
|
||||
|
||||
public void ResizeElement(int stepW, int stepH)
|
||||
@@ -312,9 +355,13 @@ namespace VocaluxeLib.Menu
|
||||
if (Rect.W <= 0)
|
||||
Rect.W = 1;
|
||||
|
||||
_Theme.Rect.W = Rect.W;
|
||||
|
||||
Rect.H += stepH;
|
||||
if (Rect.H <= 0)
|
||||
Rect.H = 1;
|
||||
|
||||
_Theme.Rect.H = Rect.H;
|
||||
}
|
||||
#endregion ThemeEdit
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -276,16 +276,106 @@ namespace VocaluxeLib.Menu
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(List<SThemeBackground>));
|
||||
List<SThemeBackground> backgroundThemes = new List<SThemeBackground>();
|
||||
foreach (CBackground bg in _Backgrounds)
|
||||
backgroundThemes.Add(bg.GetTheme());
|
||||
if(bg.ThemeLoaded)
|
||||
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());
|
||||
if(st.ThemeLoaded)
|
||||
staticsThemes.Add(st.GetTheme());
|
||||
serializer.Serialize(textWriter, staticsThemes);
|
||||
|
||||
//Texts
|
||||
serializer = new XmlSerializer(typeof(List<SThemeText>));
|
||||
List<SThemeText> textsThemes = new List<SThemeText>();
|
||||
foreach (CText txt in _Texts)
|
||||
if(txt.ThemeLoaded)
|
||||
textsThemes.Add(txt.GetTheme());
|
||||
serializer.Serialize(textWriter, textsThemes);
|
||||
|
||||
//Buttons
|
||||
serializer = new XmlSerializer(typeof(List<SThemeButton>));
|
||||
List<SThemeButton> buttonsThemes = new List<SThemeButton>();
|
||||
foreach (CButton btn in _Buttons)
|
||||
if (btn.ThemeLoaded)
|
||||
buttonsThemes.Add(btn.GetTheme());
|
||||
serializer.Serialize(textWriter, buttonsThemes);
|
||||
|
||||
//SelectSlides
|
||||
serializer = new XmlSerializer(typeof(List<SThemeSelectSlide>));
|
||||
List<SThemeSelectSlide> selslidesThemes = new List<SThemeSelectSlide>();
|
||||
foreach (CSelectSlide ss in _SelectSlides)
|
||||
if (ss.ThemeLoaded)
|
||||
selslidesThemes.Add(ss.GetTheme());
|
||||
serializer.Serialize(textWriter, selslidesThemes);
|
||||
|
||||
//SongMenu
|
||||
serializer = new XmlSerializer(typeof(List<SThemeSongMenu>));
|
||||
List<SThemeSongMenu> smThemes = new List<SThemeSongMenu>();
|
||||
foreach (CSongMenu sm in _SongMenus)
|
||||
if (sm.ThemeLoaded)
|
||||
smThemes.Add(sm.GetTheme());
|
||||
serializer.Serialize(textWriter, smThemes);
|
||||
|
||||
//Lyrics
|
||||
serializer = new XmlSerializer(typeof(List<SThemeLyrics>));
|
||||
List<SThemeLyrics> lyThemes = new List<SThemeLyrics>();
|
||||
foreach (CLyric ly in _Lyrics)
|
||||
if (ly.ThemeLoaded)
|
||||
lyThemes.Add(ly.GetTheme());
|
||||
serializer.Serialize(textWriter, lyThemes);
|
||||
|
||||
//Singbars
|
||||
serializer = new XmlSerializer(typeof(List<SThemeSingBar>));
|
||||
List<SThemeSingBar> snThemes = new List<SThemeSingBar>();
|
||||
foreach (CSingNotes sn in _SingNotes)
|
||||
if (sn.ThemeLoaded)
|
||||
snThemes.Add(sn.GetTheme());
|
||||
serializer.Serialize(textWriter, snThemes);
|
||||
|
||||
//NameSelections
|
||||
serializer = new XmlSerializer(typeof(List<SThemeNameSelection>));
|
||||
List<SThemeNameSelection> nsThemes = new List<SThemeNameSelection>();
|
||||
foreach (CNameSelection ns in _NameSelections)
|
||||
if (ns.ThemeLoaded)
|
||||
nsThemes.Add(ns.GetTheme());
|
||||
serializer.Serialize(textWriter, nsThemes);
|
||||
|
||||
//Equalizers
|
||||
serializer = new XmlSerializer(typeof(List<SThemeEqualizer>));
|
||||
List<SThemeEqualizer> eqThemes = new List<SThemeEqualizer>();
|
||||
foreach (CEqualizer eq in _Equalizers)
|
||||
if (eq.ThemeLoaded)
|
||||
eqThemes.Add(eq.GetTheme());
|
||||
serializer.Serialize(textWriter, eqThemes);
|
||||
|
||||
//Playlists
|
||||
serializer = new XmlSerializer(typeof(List<SThemePlaylist>));
|
||||
List<SThemePlaylist> plThemes = new List<SThemePlaylist>();
|
||||
foreach (CPlaylist pl in _Playlists)
|
||||
if (pl.ThemeLoaded)
|
||||
plThemes.Add(pl.GetTheme());
|
||||
serializer.Serialize(textWriter, plThemes);
|
||||
|
||||
//ParticleEffects
|
||||
serializer = new XmlSerializer(typeof(List<SThemeParticleEffect>));
|
||||
List<SThemeParticleEffect> peThemes = new List<SThemeParticleEffect>();
|
||||
foreach (CParticleEffect pe in _ParticleEffects)
|
||||
if (pe.ThemeLoaded)
|
||||
peThemes.Add(pe.GetTheme());
|
||||
serializer.Serialize(textWriter, peThemes);
|
||||
|
||||
//ScreenSettings
|
||||
serializer = new XmlSerializer(typeof(List<SScreenSetting>));
|
||||
List<SScreenSetting> seThemes = new List<SScreenSetting>();
|
||||
foreach (CScreenSetting se in _ScreenSettings)
|
||||
if (se.ThemeLoaded)
|
||||
seThemes.Add(se.GetTheme());
|
||||
serializer.Serialize(textWriter, seThemes);
|
||||
|
||||
textWriter.Close();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,23 +19,59 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Profile;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
struct SThemeNameSelection
|
||||
[XmlType("NameSelection")]
|
||||
public struct SThemeNameSelection
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlElement("Rect")]
|
||||
public SRectF Rect;
|
||||
[XmlElement("SkinEmptyTile")]
|
||||
public string TextureEmptyTileName;
|
||||
[XmlElement("ColorNameEmptyTile")]
|
||||
public string ColorEmptyTileName;
|
||||
[XmlElement("ColorEmptyTile")]
|
||||
public SColorF ColorEmptyTile;
|
||||
[XmlElement("SkinTileSelected")]
|
||||
public string TextureTileSelectedName;
|
||||
public float NameSpace;
|
||||
public float NameHeight;
|
||||
public string NameFont;
|
||||
public EStyle NameStyle;
|
||||
public SColorF NameColor;
|
||||
public string NameColorName;
|
||||
[XmlElement("Tiles")]
|
||||
public SThemeNameSelectionTiles Tiles;
|
||||
}
|
||||
|
||||
public struct SThemeNameSelectionTiles
|
||||
{
|
||||
[XmlElement("W")]
|
||||
public int W;
|
||||
[XmlElement("H")]
|
||||
public int H;
|
||||
[XmlElement("NumW")]
|
||||
public int NumW;
|
||||
[XmlElement("NumH")]
|
||||
public int NumH;
|
||||
[XmlElement("Name")]
|
||||
public SThemeNameSelectionName Name;
|
||||
}
|
||||
|
||||
public struct SThemeNameSelectionName
|
||||
{
|
||||
[XmlElement("Space")]
|
||||
public float Space;
|
||||
[XmlElement("H")]
|
||||
public float Height;
|
||||
[XmlElement("Font")]
|
||||
public string Font;
|
||||
[XmlElement("Style")]
|
||||
public EStyle Style;
|
||||
[XmlElement("ColorName")]
|
||||
public string ColorName;
|
||||
[XmlElement("Color")]
|
||||
public SColorF Color;
|
||||
}
|
||||
|
||||
public class CNameSelection : IMenuElement
|
||||
@@ -63,6 +99,11 @@ namespace VocaluxeLib.Menu
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public bool ThemeLoaded
|
||||
{
|
||||
get { return _ThemeLoaded; }
|
||||
}
|
||||
|
||||
public bool Selected;
|
||||
public bool Visible = true;
|
||||
|
||||
@@ -102,6 +143,8 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeNameSelection();
|
||||
_Theme.Tiles = new SThemeNameSelectionTiles();
|
||||
_Theme.Tiles.Name = new SThemeNameSelectionName();
|
||||
|
||||
_Tiles = new List<CTile>();
|
||||
_VisibleProfiles = new List<int>();
|
||||
@@ -155,19 +198,19 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/Tiles/NumH", ref _NumH);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Tiles/SpaceW", ref _SpaceW);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Tiles/SpaceH", ref _SpaceH);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Tiles/Name/Space", ref _Theme.NameSpace);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Tiles/Name/H", ref _Theme.NameHeight);
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/Tiles/Name/Font", out _Theme.NameFont, "Normal");
|
||||
_ThemeLoaded &= xmlReader.TryGetEnumValue(item + "/Tiles/Name/Style", ref _Theme.NameStyle);
|
||||
if (xmlReader.GetValue(item + "/Tiles/Name/Color", out _Theme.NameColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.NameColorName, skinIndex, out _Theme.NameColor);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Tiles/Name/Space", ref _Theme.Tiles.Name.Space);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Tiles/Name/H", ref _Theme.Tiles.Name.Height);
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/Tiles/Name/Font", out _Theme.Tiles.Name.Font, "Normal");
|
||||
_ThemeLoaded &= xmlReader.TryGetEnumValue(item + "/Tiles/Name/Style", ref _Theme.Tiles.Name.Style);
|
||||
if (xmlReader.GetValue(item + "/Tiles/Name/Color", out _Theme.Tiles.Name.ColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.Tiles.Name.ColorName, skinIndex, out _Theme.Tiles.Name.Color);
|
||||
else
|
||||
{
|
||||
if (xmlReader.TryGetFloatValue(item + "/Tiles/Name/R", ref _Theme.NameColor.R))
|
||||
if (xmlReader.TryGetFloatValue(item + "/Tiles/Name/R", ref _Theme.Tiles.Name.Color.R))
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Tiles/Name/G", ref _Theme.NameColor.G);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Tiles/Name/B", ref _Theme.NameColor.B);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Tiles/Name/A", ref _Theme.NameColor.A);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Tiles/Name/G", ref _Theme.Tiles.Name.Color.G);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Tiles/Name/B", ref _Theme.Tiles.Name.Color.B);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Tiles/Name/A", ref _Theme.Tiles.Name.Color.A);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,6 +218,14 @@ namespace VocaluxeLib.Menu
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = elementName;
|
||||
|
||||
_Theme.Rect = new SRectF(Rect);
|
||||
_Theme.Tiles.H = _TileH;
|
||||
_Theme.Tiles.W = _TileW;
|
||||
_Theme.Tiles.NumH = _NumH;
|
||||
_Theme.Tiles.NumW = _NumW;
|
||||
_Theme.ColorEmptyTile = new SColorF(ColorEmptyTile);
|
||||
|
||||
LoadTextures();
|
||||
}
|
||||
return _ThemeLoaded;
|
||||
@@ -225,23 +276,23 @@ namespace VocaluxeLib.Menu
|
||||
writer.WriteComment("<Name>: Options for player-name");
|
||||
writer.WriteStartElement("Name");
|
||||
writer.WriteComment("<Space>: Space between name and tile");
|
||||
writer.WriteElementString("Space", _Theme.NameSpace.ToString("#0.0"));
|
||||
writer.WriteElementString("Space", _Theme.Tiles.Name.Space.ToString("#0.0"));
|
||||
writer.WriteComment("<Font>: Text font name");
|
||||
writer.WriteElementString("Font", _Theme.NameFont);
|
||||
writer.WriteElementString("Font", _Theme.Tiles.Name.Font);
|
||||
writer.WriteComment("<Color>: Text color from ColorScheme (high priority)");
|
||||
if (!String.IsNullOrEmpty(_Theme.NameColorName))
|
||||
writer.WriteElementString("Color", _Theme.NameColorName);
|
||||
if (!String.IsNullOrEmpty(_Theme.Tiles.Name.ColorName))
|
||||
writer.WriteElementString("Color", _Theme.Tiles.Name.ColorName);
|
||||
else
|
||||
{
|
||||
writer.WriteElementString("R", _Theme.NameColor.R.ToString("#0.00"));
|
||||
writer.WriteElementString("G", _Theme.NameColor.G.ToString("#0.00"));
|
||||
writer.WriteElementString("B", _Theme.NameColor.B.ToString("#0.00"));
|
||||
writer.WriteElementString("A", _Theme.NameColor.A.ToString("#0.00"));
|
||||
writer.WriteElementString("R", _Theme.Tiles.Name.Color.R.ToString("#0.00"));
|
||||
writer.WriteElementString("G", _Theme.Tiles.Name.Color.G.ToString("#0.00"));
|
||||
writer.WriteElementString("B", _Theme.Tiles.Name.Color.B.ToString("#0.00"));
|
||||
writer.WriteElementString("A", _Theme.Tiles.Name.Color.A.ToString("#0.00"));
|
||||
}
|
||||
writer.WriteComment("<Style>: Text style: " + CHelper.ListStrings(Enum.GetNames(typeof(EStyle))));
|
||||
writer.WriteElementString("Style", _Theme.NameStyle.ToString());
|
||||
writer.WriteElementString("Style", _Theme.Tiles.Name.Style.ToString());
|
||||
writer.WriteComment("<H>: Text height");
|
||||
writer.WriteElementString("H", _Theme.NameHeight.ToString("#0"));
|
||||
writer.WriteElementString("H", _Theme.Tiles.Name.Height.ToString("#0"));
|
||||
writer.WriteEndElement();
|
||||
writer.WriteEndElement();
|
||||
|
||||
@@ -472,8 +523,8 @@ namespace VocaluxeLib.Menu
|
||||
if (!String.IsNullOrEmpty(_Theme.ColorEmptyTileName))
|
||||
ColorEmptyTile = CBase.Theme.GetColor(_Theme.ColorEmptyTileName, _PartyModeID);
|
||||
|
||||
if (!String.IsNullOrEmpty(_Theme.NameColorName))
|
||||
_Theme.NameColor = CBase.Theme.GetColor(_Theme.NameColorName, _PartyModeID);
|
||||
if (!String.IsNullOrEmpty(_Theme.Tiles.Name.ColorName))
|
||||
_Theme.Tiles.Name.Color = CBase.Theme.GetColor(_Theme.Tiles.Name.ColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
public void ReloadTextures()
|
||||
@@ -535,8 +586,8 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
var rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z);
|
||||
var tileStatic = new CStatic(_PartyModeID, _TextureEmptyTile, ColorEmptyTile, rect) {Aspect = EAspect.Crop};
|
||||
var tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.NameSpace, rect.Z, _Theme.NameHeight, rect.W, EAlignment.Center, _Theme.NameStyle,
|
||||
_Theme.NameFont, _Theme.NameColor, "");
|
||||
var tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.Tiles.Name.Space, rect.Z, _Theme.Tiles.Name.Height, rect.W, EAlignment.Center, _Theme.Tiles.Name.Style,
|
||||
_Theme.Tiles.Name.Font, _Theme.Tiles.Name.Color, "");
|
||||
_Tiles.Add(new CTile(tileStatic, tileText, -1));
|
||||
}
|
||||
}
|
||||
@@ -560,11 +611,19 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public SThemeNameSelection GetTheme()
|
||||
{
|
||||
return _Theme;
|
||||
}
|
||||
|
||||
#region ThemeEdit
|
||||
public void MoveElement(int stepX, int stepY)
|
||||
{
|
||||
Rect.X += stepX;
|
||||
Rect.Y += stepY;
|
||||
|
||||
_Theme.Rect.X += stepX;
|
||||
_Theme.Rect.Y += stepY;
|
||||
}
|
||||
|
||||
public void ResizeElement(int stepW, int stepH)
|
||||
@@ -576,6 +635,9 @@ namespace VocaluxeLib.Menu
|
||||
Rect.H += stepH;
|
||||
if (Rect.H <= 0)
|
||||
Rect.H = 1;
|
||||
|
||||
_Theme.Rect.W = Rect.W;
|
||||
_Theme.Rect.H = Rect.H;
|
||||
}
|
||||
#endregion ThemeEdit
|
||||
}
|
||||
|
||||
@@ -19,15 +19,31 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
struct SThemeParticleEffect
|
||||
[XmlType("ParticleEffect")]
|
||||
public struct SThemeParticleEffect
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
|
||||
[XmlElement("Skin")]
|
||||
public string TextureName;
|
||||
[XmlElement("Rect")]
|
||||
public SRectF Rect;
|
||||
[XmlElement("ColorName")]
|
||||
public string ColorName;
|
||||
[XmlElement("Color")]
|
||||
public SColorF Color;
|
||||
[XmlElement("Type")]
|
||||
public EParticleType Type;
|
||||
[XmlElement("Size")]
|
||||
public float Size;
|
||||
[XmlElement("MaxNumber")]
|
||||
public int MaxNumber;
|
||||
}
|
||||
|
||||
public enum EParticleType
|
||||
@@ -321,6 +337,11 @@ namespace VocaluxeLib.Menu
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public bool ThemeLoaded
|
||||
{
|
||||
get { return _ThemeLoaded; }
|
||||
}
|
||||
|
||||
public bool IsAlive
|
||||
{
|
||||
get { return _Stars.Count > 0 || !_SpawnTimer.IsRunning; }
|
||||
@@ -399,6 +420,11 @@ namespace VocaluxeLib.Menu
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = elementName;
|
||||
_Theme.Rect = new SRectF(Rect);
|
||||
_Theme.Color = new SColorF(Color);
|
||||
_Theme.Type = _Type;
|
||||
_Theme.Size = _Size;
|
||||
_Theme.MaxNumber = _MaxNumber;
|
||||
LoadTextures();
|
||||
}
|
||||
return _ThemeLoaded;
|
||||
@@ -606,11 +632,19 @@ namespace VocaluxeLib.Menu
|
||||
LoadTextures();
|
||||
}
|
||||
|
||||
public SThemeParticleEffect GetTheme()
|
||||
{
|
||||
return _Theme;
|
||||
}
|
||||
|
||||
#region ThemeEdit
|
||||
public void MoveElement(int stepX, int stepY)
|
||||
{
|
||||
Rect.X += stepX;
|
||||
Rect.Y += stepY;
|
||||
|
||||
_Theme.Rect.X += stepX;
|
||||
_Theme.Rect.Y += stepY;
|
||||
}
|
||||
|
||||
public void ResizeElement(int stepW, int stepH)
|
||||
@@ -622,6 +656,9 @@ namespace VocaluxeLib.Menu
|
||||
Rect.H += stepH;
|
||||
if (Rect.H <= 0)
|
||||
Rect.H = 1;
|
||||
|
||||
_Theme.Rect.W = Rect.W;
|
||||
_Theme.Rect.H = Rect.H;
|
||||
}
|
||||
#endregion ThemeEdit
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
@@ -53,30 +54,74 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
struct SThemePlaylist
|
||||
[XmlType("Playlist")]
|
||||
public struct SThemePlaylist
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
|
||||
public string ColorBackgroundName;
|
||||
public string SelColorBackgroundName;
|
||||
|
||||
public string TextureBackgroundName;
|
||||
public string SelTextureBackgroundName;
|
||||
[XmlElement("Rect")]
|
||||
public SRectF Rect;
|
||||
|
||||
[XmlElement("EntryHeight")]
|
||||
public float EntryHeight;
|
||||
|
||||
[XmlElement("SkinBackground")]
|
||||
public string TextureBackgroundName;
|
||||
[XmlElement("SkinBackgroundSelected")]
|
||||
public string SelTextureBackgroundName;
|
||||
|
||||
[XmlElement("ColorNameBackground")]
|
||||
public string ColorBackgroundName;
|
||||
[XmlElement("ColorBackground")]
|
||||
public SColorF ColorBackground;
|
||||
[XmlElement("SColorNameBackground")]
|
||||
public string SelColorBackgroundName;
|
||||
[XmlElement("SColorBackground")]
|
||||
public SColorF SelColorBackground;
|
||||
|
||||
[XmlElement("Text1")]
|
||||
public SThemeText SText1;
|
||||
[XmlIgnore]
|
||||
public CText Text1;
|
||||
|
||||
[XmlElement("StaticCover")]
|
||||
public SThemeStatic SStaticCover;
|
||||
[XmlIgnore]
|
||||
public CStatic StaticCover;
|
||||
[XmlElement("StaticPlaylistHeader")]
|
||||
public SThemeStatic SStaticPlaylistHeader;
|
||||
[XmlIgnore]
|
||||
public CStatic StaticPlaylistHeader;
|
||||
[XmlElement("StaticPlaylistFooter")]
|
||||
public SThemeStatic SStaticPlaylistFooter;
|
||||
[XmlIgnore]
|
||||
public CStatic StaticPlaylistFooter;
|
||||
|
||||
[XmlElement("ButtonPlaylistName")]
|
||||
public SThemeButton SButtonPlaylistName;
|
||||
[XmlIgnore]
|
||||
public CButton ButtonPlaylistName;
|
||||
[XmlElement("ButtonPlaylistClose")]
|
||||
public SThemeButton SButtonPlaylistClose;
|
||||
[XmlIgnore]
|
||||
public CButton ButtonPlaylistClose;
|
||||
[XmlElement("ButtonPlaylistSave")]
|
||||
public SThemeButton SButtonPlaylistSave;
|
||||
[XmlIgnore]
|
||||
public CButton ButtonPlaylistSave;
|
||||
[XmlElement("ButtonPlaylistDelete")]
|
||||
public SThemeButton SButtonPlaylistDelete;
|
||||
[XmlIgnore]
|
||||
public CButton ButtonPlaylistDelete;
|
||||
[XmlElement("ButtonPlaylistSing")]
|
||||
public SThemeButton SButtonPlaylistSing;
|
||||
[XmlIgnore]
|
||||
public CButton ButtonPlaylistSing;
|
||||
|
||||
[XmlElement("SelectSlideGameMode")]
|
||||
public SThemeSelectSlide SSelectSlideGameMode;
|
||||
[XmlIgnore]
|
||||
public CSelectSlide SelectSlideGameMode;
|
||||
}
|
||||
|
||||
@@ -150,6 +195,11 @@ namespace VocaluxeLib.Menu
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public bool ThemeLoaded
|
||||
{
|
||||
get { return _ThemeLoaded; }
|
||||
}
|
||||
|
||||
private readonly CObjectInteractions _Interactions;
|
||||
|
||||
private readonly List<CPlaylistElement> _PlaylistElements;
|
||||
@@ -294,6 +344,18 @@ namespace VocaluxeLib.Menu
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = elementName;
|
||||
_Theme.Rect = Rect;
|
||||
_Theme.ColorBackground = BackgroundColor;
|
||||
_Theme.SelColorBackground = BackgroundSelColor;
|
||||
_Theme.SText1 = _Theme.Text1.GetTheme();
|
||||
_Theme.SStaticCover = _Theme.StaticCover.GetTheme();
|
||||
_Theme.SStaticPlaylistFooter = _Theme.StaticPlaylistFooter.GetTheme();
|
||||
_Theme.SStaticPlaylistHeader = _Theme.StaticPlaylistHeader.GetTheme();
|
||||
_Theme.SButtonPlaylistName = _Theme.ButtonPlaylistName.GetTheme();
|
||||
_Theme.SButtonPlaylistSing = _Theme.ButtonPlaylistSing.GetTheme();
|
||||
_Theme.SButtonPlaylistClose = _Theme.ButtonPlaylistClose.GetTheme();
|
||||
_Theme.SButtonPlaylistSave = _Theme.ButtonPlaylistSave.GetTheme();
|
||||
_Theme.SButtonPlaylistDelete = _Theme.ButtonPlaylistDelete.GetTheme();
|
||||
|
||||
//Check for highest x/y-coords
|
||||
CompleteRect = Rect;
|
||||
@@ -1237,6 +1299,11 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public SThemePlaylist GetTheme()
|
||||
{
|
||||
return _Theme;
|
||||
}
|
||||
|
||||
#region ThemeEdit
|
||||
public void MoveElement(int stepX, int stepY)
|
||||
{
|
||||
|
||||
@@ -17,11 +17,12 @@
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
enum ESettingType
|
||||
public enum ESettingType
|
||||
{
|
||||
Int,
|
||||
String,
|
||||
@@ -29,10 +30,14 @@ namespace VocaluxeLib.Menu
|
||||
Texture
|
||||
}
|
||||
|
||||
struct SScreenSetting
|
||||
[XmlType("ScreenSetting")]
|
||||
public struct SScreenSetting
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlElement("Value")]
|
||||
public string Value;
|
||||
[XmlElement("Type")]
|
||||
public ESettingType Type;
|
||||
}
|
||||
|
||||
@@ -51,6 +56,11 @@ namespace VocaluxeLib.Menu
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public bool ThemeLoaded
|
||||
{
|
||||
get { return _ThemeLoaded; }
|
||||
}
|
||||
|
||||
public CScreenSetting(int partyModeID)
|
||||
{
|
||||
_PartyModeID = partyModeID;
|
||||
@@ -113,6 +123,11 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void ReloadTextures() {}
|
||||
|
||||
public SScreenSetting GetTheme()
|
||||
{
|
||||
return _Theme;
|
||||
}
|
||||
|
||||
#region Private
|
||||
private int _GetIntValue(string value)
|
||||
{
|
||||
|
||||
@@ -19,36 +19,88 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
struct SThemeSelectSlide
|
||||
[XmlType("SelectSlide")]
|
||||
public struct SThemeSelectSlide
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
|
||||
[XmlElement("Skin")]
|
||||
public string TextureName;
|
||||
[XmlElement("SkinArrowLeft")]
|
||||
public string TextureArrowLeftName;
|
||||
[XmlElement("SkinArrowRight")]
|
||||
public string TextureArrowRightName;
|
||||
|
||||
[XmlElement("SkinSelected")]
|
||||
public string SelTextureName;
|
||||
[XmlElement("SkinArrowLeftSelected")]
|
||||
public string SelTextureArrowLeftName;
|
||||
[XmlElement("SkinArrowRightSelected")]
|
||||
public string SelTextureArrowRightName;
|
||||
|
||||
[XmlElement("SkinHighlighted")]
|
||||
public string HighlightTextureName;
|
||||
|
||||
[XmlElement("Rect")]
|
||||
public SRectF Rect;
|
||||
[XmlElement("RectArrowLeft")]
|
||||
public SRectF RectArrowLeft;
|
||||
[XmlElement("RectArrowRight")]
|
||||
public SRectF RectArrowRight;
|
||||
|
||||
[XmlElement("ColorName")]
|
||||
public string ColorName;
|
||||
[XmlElement("Color")]
|
||||
public SColorF Color;
|
||||
[XmlElement("SColorName")]
|
||||
public string SelColorName;
|
||||
[XmlElement("SColor")]
|
||||
public SColorF SColor;
|
||||
[XmlElement("HColorName")]
|
||||
public string HighlightColorName;
|
||||
[XmlElement("HColor")]
|
||||
public SColorF HColor;
|
||||
|
||||
[XmlElement("ArrowColorName")]
|
||||
public string ArrowColorName;
|
||||
[XmlElement("ArrowColor")]
|
||||
public SColorF ArrowColor;
|
||||
[XmlElement("ArrowSColorName")]
|
||||
public string SelArrowColorName;
|
||||
[XmlElement("ArrowSColor")]
|
||||
public SColorF ArrowSColor;
|
||||
|
||||
[XmlElement("TextColorName")]
|
||||
public string TextColorName;
|
||||
[XmlElement("TextColor")]
|
||||
public SColorF TextColor;
|
||||
[XmlElement("TextSColorName")]
|
||||
public string SelTextColorName;
|
||||
[XmlElement("TextSColor")]
|
||||
public SColorF TextSColor;
|
||||
|
||||
[XmlElement("TextH")]
|
||||
public float TextH;
|
||||
[XmlElement("TextRelativeX")]
|
||||
public float TextRelativeX;
|
||||
[XmlElement("TextRelativeY")]
|
||||
public float TextRelativeY;
|
||||
[XmlElement("TextMaxW")]
|
||||
public float TextMaxW;
|
||||
|
||||
[XmlElement("TextFont")]
|
||||
public string TextFont;
|
||||
[XmlElement("TextStyle")]
|
||||
public EStyle TextStyle;
|
||||
|
||||
[XmlElement("NumVisible")]
|
||||
public int NumVisible;
|
||||
}
|
||||
|
||||
public class CSelectSlide : IMenuElement, ICloneable
|
||||
@@ -62,6 +114,11 @@ namespace VocaluxeLib.Menu
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public bool ThemeLoaded
|
||||
{
|
||||
get { return _ThemeLoaded; }
|
||||
}
|
||||
|
||||
public SRectF Rect;
|
||||
public SRectF RectArrowLeft;
|
||||
public SRectF RectArrowRight;
|
||||
@@ -356,6 +413,22 @@ namespace VocaluxeLib.Menu
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = elementName;
|
||||
_Theme.ArrowColor = new SColorF(ColorArrow);
|
||||
_Theme.ArrowSColor = new SColorF(SelColorArrow);
|
||||
_Theme.Color = new SColorF(Color);
|
||||
_Theme.HColor = new SColorF(HighlightColor);
|
||||
_Theme.NumVisible = _NumVisible;
|
||||
_Theme.Rect = new SRectF(Rect);
|
||||
_Theme.RectArrowLeft = new SRectF(RectArrowLeft);
|
||||
_Theme.RectArrowRight = new SRectF(RectArrowRight);
|
||||
_Theme.SColor = new SColorF(SelColor);
|
||||
_Theme.TextColor = new SColorF(TextColor);
|
||||
_Theme.TextH = TextH;
|
||||
_Theme.TextMaxW = MaxW;
|
||||
_Theme.TextRelativeX = TextRelativeX;
|
||||
_Theme.TextRelativeY = TextRelativeY;
|
||||
_Theme.TextSColor = new SColorF(SelTextColor);
|
||||
|
||||
LoadTextures();
|
||||
}
|
||||
return _ThemeLoaded;
|
||||
@@ -809,6 +882,11 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public SThemeSelectSlide GetTheme()
|
||||
{
|
||||
return _Theme;
|
||||
}
|
||||
|
||||
public void UnloadTextures() {}
|
||||
|
||||
public void LoadTextures()
|
||||
@@ -853,18 +931,27 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
Rect.X += stepX;
|
||||
Rect.Y += stepY;
|
||||
|
||||
_Theme.Rect.X += stepX;
|
||||
_Theme.Rect.Y += stepY;
|
||||
}
|
||||
|
||||
if (_ArrowLeftSelected)
|
||||
{
|
||||
RectArrowLeft.X += stepX;
|
||||
RectArrowLeft.Y += stepY;
|
||||
|
||||
_Theme.RectArrowLeft.X += stepX;
|
||||
_Theme.RectArrowLeft.Y += stepY;
|
||||
}
|
||||
|
||||
if (_ArrowRightSelected)
|
||||
{
|
||||
RectArrowRight.X += stepX;
|
||||
RectArrowRight.Y += stepY;
|
||||
|
||||
_Theme.RectArrowRight.X += stepX;
|
||||
_Theme.RectArrowRight.Y += stepY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -879,6 +966,9 @@ namespace VocaluxeLib.Menu
|
||||
Rect.H += stepH;
|
||||
if (Rect.H <= 0)
|
||||
Rect.H = 1;
|
||||
|
||||
_Theme.Rect.W = Rect.W;
|
||||
_Theme.Rect.H = Rect.H;
|
||||
}
|
||||
|
||||
if (_ArrowLeftSelected)
|
||||
@@ -890,6 +980,9 @@ namespace VocaluxeLib.Menu
|
||||
RectArrowLeft.H += stepH;
|
||||
if (RectArrowLeft.H <= 0)
|
||||
RectArrowLeft.H = 1;
|
||||
|
||||
_Theme.RectArrowLeft.W = RectArrowLeft.W;
|
||||
_Theme.RectArrowLeft.H = RectArrowLeft.H;
|
||||
}
|
||||
|
||||
if (_ArrowRightSelected)
|
||||
@@ -901,6 +994,9 @@ namespace VocaluxeLib.Menu
|
||||
RectArrowRight.H += stepH;
|
||||
if (RectArrowRight.H <= 0)
|
||||
RectArrowRight.H = 1;
|
||||
|
||||
_Theme.RectArrowRight.W = RectArrowRight.W;
|
||||
_Theme.RectArrowRight.H = RectArrowRight.H;
|
||||
}
|
||||
}
|
||||
#endregion ThemeEdit
|
||||
|
||||
@@ -48,6 +48,11 @@ namespace VocaluxeLib.Menu
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public bool ThemeLoaded
|
||||
{
|
||||
get { return _ThemeLoaded; }
|
||||
}
|
||||
|
||||
private CTexture _Texture;
|
||||
public CTexture Texture
|
||||
{
|
||||
|
||||
@@ -18,16 +18,43 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
struct SThemeText
|
||||
[XmlType("Text")]
|
||||
public struct SThemeText
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
|
||||
public string Text;
|
||||
[XmlElement("X")]
|
||||
public float X;
|
||||
[XmlElement("Y")]
|
||||
public float Y;
|
||||
[XmlElement("Z")]
|
||||
public float Z;
|
||||
[XmlElement("H")]
|
||||
public float Height;
|
||||
[XmlElement("ColorName")]
|
||||
public string ColorName;
|
||||
public SColorF Color;
|
||||
[XmlElement("SColorName")]
|
||||
public string SelColorName; //for Buttons
|
||||
public SColorF SColor;
|
||||
[XmlElement("Align")]
|
||||
public EAlignment Align;
|
||||
[XmlElement("ResizeAlign")]
|
||||
public EHAlignment ResizeAlign;
|
||||
[XmlElement("Style")]
|
||||
public EStyle Style;
|
||||
[XmlElement("Font")]
|
||||
public string Font;
|
||||
[XmlElement("Text")]
|
||||
public string Text;
|
||||
public SReflection Reflection;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class CText : IMenuElement
|
||||
@@ -42,6 +69,11 @@ namespace VocaluxeLib.Menu
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public bool ThemeLoaded
|
||||
{
|
||||
get { return _ThemeLoaded; }
|
||||
}
|
||||
|
||||
private bool _ButtonText;
|
||||
private bool _PositionNeedsUpdate = true;
|
||||
|
||||
@@ -359,10 +391,24 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Reflection/Space", ref ReflectionSpace);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Reflection/Height", ref ReflectionHeight);
|
||||
_Theme.Reflection = new SReflection(true, ReflectionSpace, ReflectionHeight);
|
||||
}
|
||||
else
|
||||
_Theme.Reflection = new SReflection(false, 0f, 0f);
|
||||
|
||||
// Set values
|
||||
_Theme.Name = elementName;
|
||||
_Theme.Align = _Align;
|
||||
_Theme.Color = Color;
|
||||
_Theme.Font = _Font;
|
||||
_Theme.ResizeAlign = _ResizeAlign;
|
||||
_Theme.SColor = SelColor;
|
||||
_Theme.Style = _Style;
|
||||
_Theme.X = _X;
|
||||
_Theme.Y = _Y;
|
||||
_Theme.Z = _Z;
|
||||
_Theme.Height = _Height;
|
||||
|
||||
_ButtonText = buttonText;
|
||||
_PositionNeedsUpdate = true;
|
||||
|
||||
@@ -534,11 +580,19 @@ namespace VocaluxeLib.Menu
|
||||
LoadTextures();
|
||||
}
|
||||
|
||||
public SThemeText GetTheme()
|
||||
{
|
||||
return _Theme;
|
||||
}
|
||||
|
||||
#region ThemeEdit
|
||||
public void MoveElement(int stepX, int stepY)
|
||||
{
|
||||
X += stepX;
|
||||
Y += stepY;
|
||||
|
||||
_Theme.X += stepX;
|
||||
_Theme.Y += stepY;
|
||||
}
|
||||
|
||||
public void ResizeElement(int stepW, int stepH)
|
||||
@@ -546,6 +600,8 @@ namespace VocaluxeLib.Menu
|
||||
Height += stepH;
|
||||
if (Height <= 0)
|
||||
Height = 1;
|
||||
|
||||
_Theme.Height = _Height;
|
||||
}
|
||||
#endregion ThemeEdit
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
@@ -40,21 +41,43 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
public List<CParticleEffect> PerfectLineTwinkle;
|
||||
}
|
||||
|
||||
struct SThemeSingBar
|
||||
[XmlType("Position")]
|
||||
public struct SBarPosition
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
public SRectF Rect;
|
||||
}
|
||||
|
||||
[XmlType("SingBar")]
|
||||
public struct SThemeSingBar
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
|
||||
[XmlElement("SkinLeft")]
|
||||
public string SkinLeftName;
|
||||
[XmlElement("SkinMiddle")]
|
||||
public string SkinMiddleName;
|
||||
[XmlElement("SkinRight")]
|
||||
public string SkinRightName;
|
||||
|
||||
[XmlElement("SkinBackgroundLeft")]
|
||||
public string SkinBackgroundLeftName;
|
||||
[XmlElement("SkinBackgroundMiddle")]
|
||||
public string SkinBackgroundMiddleName;
|
||||
[XmlElement("SkinBackgroundRight")]
|
||||
public string SkinBackgroundRightName;
|
||||
|
||||
[XmlElement("SkinGoldenStar")]
|
||||
public string SkinGoldenStarName;
|
||||
[XmlElement("SkinToneHelper")]
|
||||
public string SkinToneHelperName;
|
||||
[XmlElement("SkinPerfectNoteStart")]
|
||||
public string SkinPerfectNoteStarName;
|
||||
|
||||
[XmlArray("BarPositions")]
|
||||
public SBarPosition[] BarPos;
|
||||
}
|
||||
|
||||
public abstract class CSingNotes : IMenuElement
|
||||
@@ -78,6 +101,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
{
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeSingBar();
|
||||
_Theme.BarPos = new SBarPosition[CHelper.Sum(CBase.Settings.GetMaxNumPlayer())];
|
||||
_ThemeLoaded = false;
|
||||
|
||||
_PlayerNotes = new List<SPlayerNotes>();
|
||||
@@ -89,6 +113,11 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public bool ThemeLoaded
|
||||
{
|
||||
get { return _ThemeLoaded; }
|
||||
}
|
||||
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string item = xmlPath + "/" + elementName;
|
||||
@@ -106,6 +135,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/SkinToneHelper", out _Theme.SkinToneHelperName, String.Empty);
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/SkinPerfectNoteStar", out _Theme.SkinPerfectNoteStarName, String.Empty);
|
||||
|
||||
int i = 0;
|
||||
BarPos = new SRectF[CBase.Settings.GetMaxNumPlayer(),CBase.Settings.GetMaxNumPlayer()];
|
||||
for (int numplayer = 0; numplayer < CBase.Settings.GetMaxNumPlayer(); numplayer++)
|
||||
{
|
||||
@@ -120,6 +150,9 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + target + "Z", ref BarPos[player, numplayer].Z);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + target + "W", ref BarPos[player, numplayer].W);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + target + "H", ref BarPos[player, numplayer].H);
|
||||
_Theme.BarPos[i].Name = "P" + (player + 1) + "N" + (numplayer + 1);
|
||||
_Theme.BarPos[i].Rect = new SRectF(BarPos[player, numplayer]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -451,6 +484,11 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
LoadTextures();
|
||||
}
|
||||
|
||||
public SThemeSingBar GetTheme()
|
||||
{
|
||||
return _Theme;
|
||||
}
|
||||
|
||||
private int _FindPlayerNotes(int id)
|
||||
{
|
||||
for (int i = 0; i < _PlayerNotes.Count; i++)
|
||||
|
||||
@@ -63,6 +63,11 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
get { return _SongMenu.Rect; }
|
||||
}
|
||||
|
||||
public bool ThemeLoaded
|
||||
{
|
||||
get { return _SongMenu.ThemeLoaded; }
|
||||
}
|
||||
|
||||
public void Update(SScreenSongOptions songOptions)
|
||||
{
|
||||
_SongMenu.Update(songOptions);
|
||||
@@ -179,6 +184,11 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
_SongMenu.ResizeElement(stepW, stepH);
|
||||
}
|
||||
|
||||
public SThemeSongMenu GetTheme()
|
||||
{
|
||||
return _SongMenu.GetTheme();
|
||||
}
|
||||
#endregion IMenuElement
|
||||
|
||||
private void _CreateSongMenu()
|
||||
|
||||
@@ -19,76 +19,122 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.PartyModes;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
struct SThemeSongMenu
|
||||
[XmlType("SongMenu")]
|
||||
public struct SThemeSongMenu
|
||||
{
|
||||
[XmlAttributeAttribute(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("ColorName")]
|
||||
public string ColorName;
|
||||
[XmlElement("Color")]
|
||||
public SColorF Color;
|
||||
|
||||
//public SThemeSongMenuBook songMenuBook;
|
||||
//public SThemeSongMenuDreidel songMenuDreidel;
|
||||
//public SThemeSongMenuList songMenuList;
|
||||
[XmlElement("SongMenuTileBoard")]
|
||||
public SThemeSongMenuTileBoard SongMenuTileBoard;
|
||||
}
|
||||
|
||||
struct SThemeSongMenuTileBoard
|
||||
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 STextArtist;
|
||||
[XmlIgnore]
|
||||
public CText TextArtist;
|
||||
[XmlElement("TextTitle")]
|
||||
public SThemeText STextTitle;
|
||||
[XmlIgnore]
|
||||
public CText TextTitle;
|
||||
[XmlElement("TextSongLength")]
|
||||
public SThemeText STextSongLength;
|
||||
[XmlIgnore]
|
||||
public CText TextSongLength;
|
||||
|
||||
[XmlElement("StaticCoverBig")]
|
||||
public SThemeStatic SStaticCoverBig;
|
||||
[XmlIgnore]
|
||||
public CStatic StaticCoverBig;
|
||||
[XmlElement("StaticTextBG")]
|
||||
public SThemeStatic SStaticTextBG;
|
||||
[XmlIgnore]
|
||||
public CStatic StaticTextBG;
|
||||
[XmlElement("StaticDuetIcon")]
|
||||
public SThemeStatic SStaticDuetIcon;
|
||||
[XmlIgnore]
|
||||
public CStatic StaticDuetIcon;
|
||||
[XmlElement("StaticVideoIcon")]
|
||||
public SThemeStatic SStaticVideoIcon;
|
||||
[XmlIgnore]
|
||||
public CStatic StaticVideoIcon;
|
||||
[XmlElement("StaticMedleyCalcIcon")]
|
||||
public SThemeStatic SStaticMedleyCalcIcon;
|
||||
[XmlIgnore]
|
||||
public CStatic StaticMedleyCalcIcon;
|
||||
[XmlElement("StaticMedleyTagIcon")]
|
||||
public SThemeStatic SStaticMedleyTagIcon;
|
||||
[XmlIgnore]
|
||||
public CStatic StaticMedleyTagIcon;
|
||||
}
|
||||
|
||||
@@ -98,6 +144,11 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
protected SThemeSongMenu _Theme;
|
||||
private bool _ThemeLoaded;
|
||||
|
||||
public bool ThemeLoaded
|
||||
{
|
||||
get { return _ThemeLoaded; }
|
||||
}
|
||||
|
||||
protected bool _Initialized;
|
||||
|
||||
private int _PreviewNrInternal = -1;
|
||||
@@ -180,6 +231,11 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public SThemeSongMenu GetTheme()
|
||||
{
|
||||
return _Theme;
|
||||
}
|
||||
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string item = xmlPath + "/" + elementName;
|
||||
@@ -201,6 +257,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/B", ref _ColorInternal.B);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/A", ref _ColorInternal.A);
|
||||
}
|
||||
_Theme.Color = new SColorF(_ColorInternal);
|
||||
|
||||
#region SongMenuTileBoard
|
||||
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumW", ref _Theme.SongMenuTileBoard.NumW);
|
||||
@@ -238,6 +295,17 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = elementName;
|
||||
|
||||
_Theme.SongMenuTileBoard.STextArtist = _Theme.SongMenuTileBoard.TextArtist.GetTheme();
|
||||
_Theme.SongMenuTileBoard.STextSongLength = _Theme.SongMenuTileBoard.TextSongLength.GetTheme();
|
||||
_Theme.SongMenuTileBoard.STextTitle = _Theme.SongMenuTileBoard.TextTitle.GetTheme();
|
||||
_Theme.SongMenuTileBoard.SStaticCoverBig = _Theme.SongMenuTileBoard.StaticCoverBig.GetTheme();
|
||||
_Theme.SongMenuTileBoard.SStaticDuetIcon = _Theme.SongMenuTileBoard.StaticDuetIcon.GetTheme();
|
||||
_Theme.SongMenuTileBoard.SStaticMedleyCalcIcon = _Theme.SongMenuTileBoard.StaticMedleyCalcIcon.GetTheme();
|
||||
_Theme.SongMenuTileBoard.SStaticMedleyTagIcon = _Theme.SongMenuTileBoard.StaticMedleyTagIcon.GetTheme();
|
||||
_Theme.SongMenuTileBoard.SStaticTextBG = _Theme.SongMenuTileBoard.StaticTextBG.GetTheme();
|
||||
_Theme.SongMenuTileBoard.SStaticVideoIcon = _Theme.SongMenuTileBoard.StaticVideoIcon.GetTheme();
|
||||
|
||||
LoadTextures();
|
||||
Init();
|
||||
}
|
||||
|
||||
@@ -50,5 +50,8 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
bool Selected { get; set; }
|
||||
bool Visible { get; set; }
|
||||
bool SmallView { get; set; }
|
||||
|
||||
bool ThemeLoaded { get; }
|
||||
SThemeSongMenu GetTheme();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user