Merge branch 'Automatic_Covers' into develop
Conflicts: Vocaluxe/Base/CBackgroundMusic.cs VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs
This commit is contained in:
commit
f1c89b9a8e
94 files changed
+4513
-3344
No files matched your search
@@ -16,12 +16,12 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
@@ -37,16 +37,11 @@ namespace VocaluxeLib.Menu
|
||||
[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;
|
||||
[XmlAttribute(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;
|
||||
public SThemeColor Color;
|
||||
}
|
||||
|
||||
@@ -58,7 +53,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private int _SlideShowCurrent;
|
||||
private readonly Stopwatch _SlideShowTimer = new Stopwatch();
|
||||
private readonly List<CTexture> _SlideShowTextures = new List<CTexture>();
|
||||
private readonly List<CTextureRef> _SlideShowTextures = new List<CTextureRef>();
|
||||
|
||||
public SColorF Color;
|
||||
public bool ThemeLoaded
|
||||
@@ -149,36 +144,31 @@ namespace VocaluxeLib.Menu
|
||||
CBase.Theme.SkinVideoPause(_Theme.VideoName, _PartyModeID);
|
||||
}
|
||||
|
||||
public bool Draw()
|
||||
public void Draw()
|
||||
{
|
||||
bool ok = false;
|
||||
if (_Theme.Type == EBackgroundTypes.Video && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON &&
|
||||
CBase.Config.GetVideosToBackground() == EOffOn.TR_CONFIG_ON && CBase.BackgroundMusic.IsPlaying() && CBase.BackgroundMusic.SongHasVideo() &&
|
||||
CBase.BackgroundMusic.VideoEnabled() && !CBase.BackgroundMusic.IsDisabled())
|
||||
if (_Theme.Type == EBackgroundTypes.Video && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
Pause();
|
||||
ok = _DrawBackgroundMusicVideo();
|
||||
if (CBase.Config.GetVideosToBackground() == EOffOn.TR_CONFIG_ON && CBase.BackgroundMusic.IsPlaying() && CBase.BackgroundMusic.SongHasVideo() &&
|
||||
CBase.BackgroundMusic.VideoEnabled())
|
||||
{
|
||||
Pause();
|
||||
ok = _DrawBackgroundMusicVideo();
|
||||
}
|
||||
else
|
||||
{
|
||||
Resume();
|
||||
ok = _DrawVideo();
|
||||
}
|
||||
}
|
||||
else if (_Theme.Type == EBackgroundTypes.Video && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
Resume();
|
||||
ok = _DrawVideo();
|
||||
}
|
||||
|
||||
|
||||
if (_Theme.Type == EBackgroundTypes.SlideShow && _Theme.SlideShowTextures.Count > 0)
|
||||
else if (_Theme.Type == EBackgroundTypes.SlideShow && _Theme.SlideShowTextures.Count > 0)
|
||||
ok = _DrawSlideShow();
|
||||
|
||||
if (!String.IsNullOrEmpty(_Theme.TextureName) &&
|
||||
(_Theme.Type == EBackgroundTypes.Texture ||
|
||||
(_Theme.Type == EBackgroundTypes.Video && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_OFF)))
|
||||
if (!String.IsNullOrEmpty(_Theme.TextureName) && (_Theme.Type == EBackgroundTypes.Texture || !ok))
|
||||
ok = _DrawTexture();
|
||||
|
||||
if (_Theme.Type == EBackgroundTypes.Color || _Theme.Type == EBackgroundTypes.Texture && !ok ||
|
||||
(_Theme.Type == EBackgroundTypes.Video && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_OFF && !ok))
|
||||
if (_Theme.Type == EBackgroundTypes.Color || !ok)
|
||||
_DrawColor();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void UnloadTextures()
|
||||
@@ -200,7 +190,7 @@ namespace VocaluxeLib.Menu
|
||||
_Theme.Type = EBackgroundTypes.SlideShow;
|
||||
if (!String.IsNullOrEmpty(image))
|
||||
{
|
||||
CTexture texture = CBase.Drawing.AddTexture(image);
|
||||
CTextureRef texture = CBase.Drawing.AddTexture(image);
|
||||
if (texture != null)
|
||||
_SlideShowTextures.Add(texture);
|
||||
}
|
||||
@@ -208,9 +198,9 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void RemoveSlideShowTextures()
|
||||
{
|
||||
foreach (CTexture tex in _SlideShowTextures)
|
||||
foreach (CTextureRef tex in _SlideShowTextures)
|
||||
{
|
||||
CTexture texture = tex;
|
||||
CTextureRef texture = tex;
|
||||
CBase.Drawing.RemoveTexture(ref texture);
|
||||
}
|
||||
_SlideShowTextures.Clear();
|
||||
@@ -229,23 +219,22 @@ namespace VocaluxeLib.Menu
|
||||
#endregion public
|
||||
|
||||
#region internal
|
||||
private static SRectF _GetDrawRect()
|
||||
{
|
||||
return new SRectF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), CBase.Settings.GetZFar() / 4);
|
||||
}
|
||||
|
||||
private void _DrawColor()
|
||||
{
|
||||
var bounds = new SRectF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), CBase.Settings.GetZFar() / 4);
|
||||
|
||||
CBase.Drawing.DrawColor(Color, bounds);
|
||||
CBase.Drawing.DrawRect(Color, _GetDrawRect());
|
||||
}
|
||||
|
||||
private bool _DrawTexture()
|
||||
{
|
||||
CTexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
CTextureRef texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
if (texture != null)
|
||||
{
|
||||
var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||
RectangleF rect;
|
||||
CHelper.SetRect(bounds, out rect, texture.OrigAspect, EAspect.Crop);
|
||||
|
||||
CBase.Drawing.DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||
CBase.Drawing.DrawTexture(texture, _GetDrawRect(), EAspect.Crop);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -266,20 +255,16 @@ namespace VocaluxeLib.Menu
|
||||
_SlideShowTimer.Restart();
|
||||
if (_SlideShowCurrent + 1 < _SlideShowTextures.Count)
|
||||
_SlideShowCurrent++;
|
||||
else if (_SlideShowCurrent != 0)
|
||||
else
|
||||
_SlideShowCurrent = 0;
|
||||
}
|
||||
|
||||
CTexture texture = _SlideShowTextures[_SlideShowCurrent];
|
||||
CTextureRef texture = _SlideShowTextures[_SlideShowCurrent];
|
||||
|
||||
if (texture == null)
|
||||
return false;
|
||||
|
||||
var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||
RectangleF rect;
|
||||
CHelper.SetRect(bounds, out rect, texture.OrigAspect, EAspect.Crop);
|
||||
|
||||
CBase.Drawing.DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||
CBase.Drawing.DrawTexture(texture, _GetDrawRect(), EAspect.Crop);
|
||||
|
||||
if (_SlideShowTimer.ElapsedMilliseconds >= CBase.Settings.GetSlideShowImageTime())
|
||||
{
|
||||
@@ -292,9 +277,9 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (texture != null)
|
||||
{
|
||||
float alpha = (_SlideShowTimer.ElapsedMilliseconds - CBase.Settings.GetSlideShowImageTime()) / CBase.Settings.GetSlideShowFadeTime();
|
||||
CHelper.SetRect(bounds, out rect, texture.OrigAspect, EAspect.Crop);
|
||||
CBase.Drawing.DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, (CBase.Settings.GetZFar() / 4) - 1), new SColorF(1, 1, 1, alpha));
|
||||
SColorF color = texture.Color;
|
||||
color.A = (_SlideShowTimer.ElapsedMilliseconds - CBase.Settings.GetSlideShowImageTime()) / CBase.Settings.GetSlideShowFadeTime();
|
||||
CBase.Drawing.DrawTexture(texture, _GetDrawRect(), EAspect.Crop, color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,14 +290,10 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private bool _DrawVideo()
|
||||
{
|
||||
CTexture videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID);
|
||||
CTextureRef videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID);
|
||||
if (videoTexture != null)
|
||||
{
|
||||
var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||
RectangleF rect;
|
||||
CHelper.SetRect(bounds, out rect, videoTexture.OrigAspect, EAspect.Crop);
|
||||
|
||||
CBase.Drawing.DrawTexture(videoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||
CBase.Drawing.DrawTexture(videoTexture, _GetDrawRect(), EAspect.Crop);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -320,14 +301,10 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private bool _DrawBackgroundMusicVideo()
|
||||
{
|
||||
CTexture videoTexture = CBase.BackgroundMusic.GetVideoTexture();
|
||||
CTextureRef videoTexture = CBase.BackgroundMusic.GetVideoTexture();
|
||||
if (videoTexture != null)
|
||||
{
|
||||
var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||
RectangleF rect;
|
||||
CHelper.SetRect(bounds, out rect, videoTexture.OrigAspect, EAspect.Crop);
|
||||
|
||||
CBase.Drawing.DrawTexture(videoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||
CBase.Drawing.DrawTexture(videoTexture, _GetDrawRect(), EAspect.Crop);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
+16
-25
@@ -19,33 +19,25 @@ using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
[XmlType("Button")]
|
||||
public struct SThemeButton
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
|
||||
[XmlElement("Skin")]
|
||||
public string TextureName;
|
||||
[XmlElement("SkinSelected")]
|
||||
public string SelTextureName;
|
||||
[XmlElement("Skin")] public string TextureName;
|
||||
[XmlElement("SkinSelected")] public string SelTextureName;
|
||||
public SRectF Rect;
|
||||
[XmlElement("Color")]
|
||||
public SThemeColor Color;
|
||||
[XmlElement("SelColor")]
|
||||
public SThemeColor SelColor;
|
||||
[XmlElement("Text")]
|
||||
public SThemeText Text;
|
||||
[XmlElement("SText")]
|
||||
public SThemeText SText;
|
||||
[XmlElement("Color")] public SThemeColor Color;
|
||||
[XmlElement("SelColor")] public SThemeColor SelColor;
|
||||
[XmlElement("Text")] public SThemeText Text;
|
||||
[XmlElement("SText")] public SThemeText SText;
|
||||
public bool STextSpecified;
|
||||
[XmlElement("Reflection")]
|
||||
public SReflection Reflection;
|
||||
[XmlElement("SelReflection")]
|
||||
public SReflection SelReflection;
|
||||
[XmlElement("Reflection")] public SReflection Reflection;
|
||||
[XmlElement("SelReflection")] public SReflection SelReflection;
|
||||
}
|
||||
|
||||
public class CButton : IMenuElement
|
||||
@@ -54,8 +46,8 @@ namespace VocaluxeLib.Menu
|
||||
private bool _ThemeLoaded;
|
||||
private readonly int _PartyModeID;
|
||||
|
||||
public CTexture Texture;
|
||||
public CTexture SelTexture;
|
||||
public CTextureRef Texture;
|
||||
public CTextureRef SelTexture;
|
||||
public SRectF Rect;
|
||||
public SColorF Color;
|
||||
public SColorF SelColor;
|
||||
@@ -257,13 +249,12 @@ namespace VocaluxeLib.Menu
|
||||
return _ThemeLoaded;
|
||||
}
|
||||
|
||||
|
||||
public void Draw(bool forceDraw = false)
|
||||
{
|
||||
if (!Visible && CBase.Settings.GetProgramState() != EProgramState.EditTheme && !forceDraw)
|
||||
return;
|
||||
|
||||
CTexture texture;
|
||||
CTextureRef texture;
|
||||
|
||||
if (!Selected && !Pressed || !_Enabled)
|
||||
{
|
||||
@@ -273,7 +264,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (_Reflection)
|
||||
{
|
||||
CBase.Drawing.DrawTextureReflection(texture, Rect, Color, Rect, _ReflectionSpace, _ReflectionHeight);
|
||||
CBase.Drawing.DrawTextureReflection(texture, Rect, Color, _ReflectionSpace, _ReflectionHeight);
|
||||
Text.DrawRelative(Rect.X, Rect.Y, _ReflectionHeight, _ReflectionSpace, Rect.H);
|
||||
}
|
||||
else
|
||||
@@ -287,7 +278,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (_Reflection)
|
||||
{
|
||||
CBase.Drawing.DrawTextureReflection(texture, Rect, SelColor, Rect, _ReflectionSpace, _ReflectionHeight);
|
||||
CBase.Drawing.DrawTextureReflection(texture, Rect, SelColor, _ReflectionSpace, _ReflectionHeight);
|
||||
Text.DrawRelative(Rect.X, Rect.Y, _ReflectionHeight, _ReflectionSpace, Rect.H);
|
||||
}
|
||||
else
|
||||
@@ -301,7 +292,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (_Reflection)
|
||||
{
|
||||
CBase.Drawing.DrawTextureReflection(texture, Rect, SelColor, Rect, _ReflectionSpace, _ReflectionHeight);
|
||||
CBase.Drawing.DrawTextureReflection(texture, Rect, SelColor, _ReflectionSpace, _ReflectionHeight);
|
||||
_SelText.DrawRelative(Rect.X, Rect.Y, _ReflectionHeight, _ReflectionSpace, Rect.H);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
@@ -29,30 +30,20 @@ namespace VocaluxeLib.Menu
|
||||
[XmlType("Equalizer")]
|
||||
public struct SThemeEqualizer
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
|
||||
[XmlElement("Skin")]
|
||||
public string TextureName;
|
||||
[XmlElement("Skin")] public string TextureName;
|
||||
|
||||
[XmlElement("Rect")]
|
||||
public SRectF Rect;
|
||||
[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("NumBars")] public int NumBars;
|
||||
[XmlElement("Space")] public float Space;
|
||||
[XmlElement("Style")] public EEqualizerStyle Style;
|
||||
[XmlElement("DrawNegative")] public EOffOn DrawNegative;
|
||||
|
||||
[XmlElement("Color")]
|
||||
public SThemeColor Color;
|
||||
[XmlElement("MaxColor")]
|
||||
public SThemeColor MaxColor;
|
||||
[XmlElement("Reflection")]
|
||||
public SReflection Reflection;
|
||||
[XmlElement("Color")] public SThemeColor Color;
|
||||
[XmlElement("MaxColor")] public SThemeColor MaxColor;
|
||||
[XmlElement("Reflection")] public SReflection Reflection;
|
||||
}
|
||||
|
||||
public class CEqualizer : IMenuElement
|
||||
@@ -249,10 +240,10 @@ namespace VocaluxeLib.Menu
|
||||
if (i == _MaxBar)
|
||||
color = MaxColor;
|
||||
|
||||
CBase.Drawing.DrawColor(color, bar);
|
||||
CBase.Drawing.DrawRect(color, bar);
|
||||
|
||||
if (Reflection)
|
||||
CBase.Drawing.DrawColorReflection(color, bar, ReflectionSpace, ReflectionHeight);
|
||||
CBase.Drawing.DrawRectReflection(color, bar, ReflectionSpace, ReflectionHeight);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,7 +264,7 @@ namespace VocaluxeLib.Menu
|
||||
Rect = _Theme.Rect;
|
||||
Space = _Theme.Space;
|
||||
Reflection = _Theme.Reflection.Enabled;
|
||||
if(Reflection)
|
||||
if (Reflection)
|
||||
{
|
||||
ReflectionHeight = _Theme.Reflection.Height;
|
||||
ReflectionSpace = _Theme.Reflection.Space;
|
||||
|
||||
+10
-16
@@ -19,22 +19,19 @@ using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Songs;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
[XmlType("Lyric")]
|
||||
public struct SThemeLyrics
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
|
||||
[XmlElement("Rect")]
|
||||
public SRectF Rect;
|
||||
[XmlElement("Rect")] public SRectF Rect;
|
||||
|
||||
[XmlElement("Color")]
|
||||
public SThemeColor Color;
|
||||
[XmlElement("SColor")]
|
||||
public SThemeColor SColor;
|
||||
[XmlElement("Color")] public SThemeColor Color;
|
||||
[XmlElement("SColor")] public SThemeColor SColor;
|
||||
}
|
||||
|
||||
public class CLyric : IMenuElement
|
||||
@@ -192,10 +189,7 @@ namespace VocaluxeLib.Menu
|
||||
private void _SetText(CSongNote note)
|
||||
{
|
||||
_Text.Text = note.Text;
|
||||
_Text.Style = EStyle.Bold;
|
||||
|
||||
if (note.Type == ENoteType.Freestyle)
|
||||
_Text.Style = EStyle.BoldItalic;
|
||||
_Text.Font.Style = (note.Type == ENoteType.Freestyle) ? EStyle.BoldItalic : EStyle.Bold;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
@@ -337,11 +331,11 @@ namespace VocaluxeLib.Menu
|
||||
p = 1f - p;
|
||||
|
||||
float ty = _Text.Y;
|
||||
float th = _Text.Height;
|
||||
float th = _Text.Font.Height;
|
||||
float tz = _Text.Z;
|
||||
|
||||
SRectF normalRect = _Text.Rect;
|
||||
_Text.Height += _Text.Height * p * 0.4f;
|
||||
_Text.Font.Height *= 1f + p * 0.4f;
|
||||
_Text.X -= (_Text.Rect.W - normalRect.W) / 2f;
|
||||
_Text.Y -= (_Text.Rect.H - normalRect.H) / 2f;
|
||||
_Text.Z -= 0.1f;
|
||||
@@ -351,7 +345,7 @@ namespace VocaluxeLib.Menu
|
||||
_Text.Draw();
|
||||
|
||||
_Text.Y = ty;
|
||||
_Text.Height = th;
|
||||
_Text.Font.Height = th;
|
||||
_Text.Z = tz;
|
||||
}
|
||||
}
|
||||
@@ -443,7 +437,7 @@ namespace VocaluxeLib.Menu
|
||||
else
|
||||
{
|
||||
float y = _Text.Y;
|
||||
_Text.Y -= _Text.Height * 0.1f * p;
|
||||
_Text.Y -= _Text.Font.Height * 0.1f * p;
|
||||
_Text.Draw();
|
||||
_Text.Y = y;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu.SingNotes;
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
@@ -587,7 +588,7 @@ namespace VocaluxeLib.Menu
|
||||
return new CStatic(oldStatic);
|
||||
}
|
||||
|
||||
public CStatic GetNewStatic(CTexture texture, SColorF color, SRectF rect)
|
||||
public CStatic GetNewStatic(CTextureRef texture, SColorF color, SRectF rect)
|
||||
{
|
||||
return new CStatic(_PartyModeID, texture, color, rect);
|
||||
}
|
||||
@@ -632,7 +633,7 @@ namespace VocaluxeLib.Menu
|
||||
return new CPlaylist(_PartyModeID);
|
||||
}
|
||||
|
||||
public CParticleEffect GetNewParticleEffect(int maxNumber, SColorF color, SRectF area, CTexture texture, float size, EParticleType type)
|
||||
public CParticleEffect GetNewParticleEffect(int maxNumber, SColorF color, SRectF area, CTextureRef texture, float size, EParticleType type)
|
||||
{
|
||||
return new CParticleEffect(_PartyModeID, maxNumber, color, area, texture, size, type);
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ namespace VocaluxeLib.Menu
|
||||
for (int i = 0; i < _TeamList[_CurrentTeam].Count; i++)
|
||||
{
|
||||
string name = CBase.Profiles.GetPlayerName(_TeamList[_CurrentTeam][i]);
|
||||
CTexture avatar = CBase.Profiles.GetAvatar(_TeamList[_CurrentTeam][i]);
|
||||
CTextureRef avatar = CBase.Profiles.GetAvatar(_TeamList[_CurrentTeam][i]);
|
||||
_SelectSlides[_SelectSlidePlayer].AddValue(name, avatar);
|
||||
}
|
||||
for (int i = _TeamList[_CurrentTeam].Count; i < _NumPlayerTeams[_CurrentTeam]; i++)
|
||||
|
||||
@@ -22,56 +22,39 @@ using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Profile;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
[XmlType("NameSelection")]
|
||||
public struct SThemeNameSelection
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlElement("Rect")]
|
||||
public SRectF Rect;
|
||||
[XmlElement("SkinEmptyTile")]
|
||||
public string TextureEmptyTileName;
|
||||
[XmlElement("ColorEmptyTile")]
|
||||
public SThemeColor ColorEmptyTile;
|
||||
[XmlElement("SkinTileSelected")]
|
||||
public string TextureTileSelectedName;
|
||||
[XmlElement("Tiles")]
|
||||
public SThemeNameSelectionTiles Tiles;
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
[XmlElement("Rect")] public SRectF Rect;
|
||||
[XmlElement("SkinEmptyTile")] public string TextureEmptyTileName;
|
||||
[XmlElement("ColorEmptyTile")] public SThemeColor ColorEmptyTile;
|
||||
[XmlElement("SkinTileSelected")] public string TextureTileSelectedName;
|
||||
[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("SpaceW")]
|
||||
public float SpaceW;
|
||||
[XmlElement("SpaceH")]
|
||||
public float SpaceH;
|
||||
[XmlElement("Name")]
|
||||
public SThemeNameSelectionName Name;
|
||||
[XmlElement("W")] public int W;
|
||||
[XmlElement("H")] public int H;
|
||||
[XmlElement("NumW")] public int NumW;
|
||||
[XmlElement("NumH")] public int NumH;
|
||||
[XmlElement("SpaceW")] public float SpaceW;
|
||||
[XmlElement("SpaceH")] public float SpaceH;
|
||||
[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("Color")]
|
||||
public SThemeColor Color;
|
||||
[XmlElement("Space")] public float Space;
|
||||
[XmlElement("H")] public float Height;
|
||||
[XmlElement("Font")] public string Font;
|
||||
[XmlElement("Style")] public EStyle Style;
|
||||
[XmlElement("Color")] public SThemeColor Color;
|
||||
}
|
||||
|
||||
public class CNameSelection : IMenuElement
|
||||
@@ -110,16 +93,15 @@ namespace VocaluxeLib.Menu
|
||||
public SRectF Rect;
|
||||
private readonly List<CTile> _Tiles;
|
||||
|
||||
private CTexture _TextureEmptyTile;
|
||||
private CTexture _TextureTileSelected;
|
||||
public CTexture TextureEmptyTile
|
||||
private CTextureRef _TextureEmptyTile;
|
||||
private CTextureRef _TextureTileSelected;
|
||||
public CTextureRef TextureEmptyTile
|
||||
{
|
||||
get { return _TextureEmptyTile; }
|
||||
}
|
||||
|
||||
public SColorF ColorEmptyTile;
|
||||
|
||||
|
||||
public int Offset;
|
||||
private int _ActualSelection = -1;
|
||||
public int Selection = -1;
|
||||
@@ -517,9 +499,11 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
for (int j = 0; j < _Theme.Tiles.NumW; j++)
|
||||
{
|
||||
var rect = new SRectF(Rect.X + j * (_Theme.Tiles.W + _Theme.Tiles.SpaceW), Rect.Y + i * (_Theme.Tiles.H + _Theme.Tiles.SpaceH), _Theme.Tiles.W, _Theme.Tiles.H, Rect.Z);
|
||||
var rect = new SRectF(Rect.X + j * (_Theme.Tiles.W + _Theme.Tiles.SpaceW), Rect.Y + i * (_Theme.Tiles.H + _Theme.Tiles.SpaceH), _Theme.Tiles.W, _Theme.Tiles.H,
|
||||
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.Tiles.Name.Space, rect.Z, _Theme.Tiles.Name.Height, rect.W, EAlignment.Center, _Theme.Tiles.Name.Style,
|
||||
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.Color, "");
|
||||
_Tiles.Add(new CTile(tileStatic, tileText, -1));
|
||||
}
|
||||
|
||||
@@ -21,27 +21,21 @@ using System.Diagnostics;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
[XmlType("ParticleEffect")]
|
||||
public struct SThemeParticleEffect
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
|
||||
[XmlElement("Skin")]
|
||||
public string TextureName;
|
||||
[XmlElement("Rect")]
|
||||
public SRectF Rect;
|
||||
[XmlElement("Color")]
|
||||
public SThemeColor Color;
|
||||
[XmlElement("Type")]
|
||||
public EParticleType Type;
|
||||
[XmlElement("Size")]
|
||||
public float Size;
|
||||
[XmlElement("MaxNumber")]
|
||||
public int MaxNumber;
|
||||
[XmlElement("Skin")] public string TextureName;
|
||||
[XmlElement("Rect")] public SRectF Rect;
|
||||
[XmlElement("Color")] public SThemeColor Color;
|
||||
[XmlElement("Type")] public EParticleType Type;
|
||||
[XmlElement("Size")] public float Size;
|
||||
[XmlElement("MaxNumber")] public int MaxNumber;
|
||||
}
|
||||
|
||||
public enum EParticleType
|
||||
@@ -58,7 +52,7 @@ namespace VocaluxeLib.Menu
|
||||
#region private vars
|
||||
private readonly int _PartyModeID;
|
||||
private readonly string _TextureName;
|
||||
private readonly CTexture _Texture;
|
||||
private readonly CTextureRef _Texture;
|
||||
private SRectF _Rect;
|
||||
private float _Size;
|
||||
private SColorF _Color;
|
||||
@@ -141,7 +135,7 @@ namespace VocaluxeLib.Menu
|
||||
_Rotation = (float)(CBase.Game.GetRandomDouble() * 360.0);
|
||||
}
|
||||
|
||||
public CParticle(int partyModeID, CTexture texture, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize,
|
||||
public CParticle(int partyModeID, CTextureRef texture, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize,
|
||||
EParticleType type)
|
||||
{
|
||||
_PartyModeID = partyModeID;
|
||||
@@ -159,8 +153,6 @@ namespace VocaluxeLib.Menu
|
||||
_MaxAge = maxage;
|
||||
_Rotation = (float)(CBase.Game.GetRandomDouble() * 360.0);
|
||||
}
|
||||
|
||||
|
||||
#endregion Constructors
|
||||
|
||||
public void Update()
|
||||
@@ -316,7 +308,7 @@ namespace VocaluxeLib.Menu
|
||||
private SThemeParticleEffect _Theme;
|
||||
private bool _ThemeLoaded;
|
||||
|
||||
public CTexture Texture;
|
||||
public CTextureRef Texture;
|
||||
public SColorF Color;
|
||||
public SRectF Rect;
|
||||
|
||||
@@ -370,7 +362,7 @@ namespace VocaluxeLib.Menu
|
||||
Visible = true;
|
||||
}
|
||||
|
||||
public CParticleEffect(int partyModeID, int maxNumber, SColorF color, SRectF rect, CTexture texture, float size, EParticleType type)
|
||||
public CParticleEffect(int partyModeID, int maxNumber, SColorF color, SRectF rect, CTextureRef texture, float size, EParticleType type)
|
||||
{
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeParticleEffect();
|
||||
|
||||
@@ -21,6 +21,7 @@ using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Songs;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
@@ -57,48 +58,31 @@ namespace VocaluxeLib.Menu
|
||||
[XmlType("Playlist")]
|
||||
public struct SThemePlaylist
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
|
||||
[XmlElement("Rect")]
|
||||
public SRectF Rect;
|
||||
[XmlElement("Rect")] public SRectF Rect;
|
||||
|
||||
[XmlElement("EntryHeight")]
|
||||
public float EntryHeight;
|
||||
[XmlElement("EntryHeight")] public float EntryHeight;
|
||||
|
||||
[XmlElement("SkinBackground")]
|
||||
public string TextureBackgroundName;
|
||||
[XmlElement("SkinBackgroundSelected")]
|
||||
public string SelTextureBackgroundName;
|
||||
[XmlElement("SkinBackground")] public string TextureBackgroundName;
|
||||
[XmlElement("SkinBackgroundSelected")] public string SelTextureBackgroundName;
|
||||
|
||||
[XmlElement("ColorBackground")]
|
||||
public SThemeColor ColorBackground;
|
||||
[XmlElement("SColorBackground")]
|
||||
public SThemeColor SelColorBackground;
|
||||
[XmlElement("ColorBackground")] public SThemeColor ColorBackground;
|
||||
[XmlElement("SColorBackground")] public SThemeColor SelColorBackground;
|
||||
|
||||
[XmlElement("Text1")]
|
||||
public SThemeText SText1;
|
||||
[XmlElement("Text1")] public SThemeText SText1;
|
||||
|
||||
[XmlElement("StaticCover")]
|
||||
public SThemeStatic SStaticCover;
|
||||
[XmlElement("StaticPlaylistHeader")]
|
||||
public SThemeStatic SStaticPlaylistHeader;
|
||||
[XmlElement("StaticPlaylistFooter")]
|
||||
public SThemeStatic SStaticPlaylistFooter;
|
||||
[XmlElement("StaticCover")] public SThemeStatic SStaticCover;
|
||||
[XmlElement("StaticPlaylistHeader")] public SThemeStatic SStaticPlaylistHeader;
|
||||
[XmlElement("StaticPlaylistFooter")] public SThemeStatic SStaticPlaylistFooter;
|
||||
|
||||
[XmlElement("ButtonPlaylistName")]
|
||||
public SThemeButton SButtonPlaylistName;
|
||||
[XmlElement("ButtonPlaylistClose")]
|
||||
public SThemeButton SButtonPlaylistClose;
|
||||
[XmlElement("ButtonPlaylistSave")]
|
||||
public SThemeButton SButtonPlaylistSave;
|
||||
[XmlElement("ButtonPlaylistDelete")]
|
||||
public SThemeButton SButtonPlaylistDelete;
|
||||
[XmlElement("ButtonPlaylistSing")]
|
||||
public SThemeButton SButtonPlaylistSing;
|
||||
[XmlElement("ButtonPlaylistName")] public SThemeButton SButtonPlaylistName;
|
||||
[XmlElement("ButtonPlaylistClose")] public SThemeButton SButtonPlaylistClose;
|
||||
[XmlElement("ButtonPlaylistSave")] public SThemeButton SButtonPlaylistSave;
|
||||
[XmlElement("ButtonPlaylistDelete")] public SThemeButton SButtonPlaylistDelete;
|
||||
[XmlElement("ButtonPlaylistSing")] public SThemeButton SButtonPlaylistSing;
|
||||
|
||||
[XmlElement("SelectSlideGameMode")]
|
||||
public SThemeSelectSlide SSelectSlideGameMode;
|
||||
[XmlElement("SelectSlideGameMode")] public SThemeSelectSlide SSelectSlideGameMode;
|
||||
}
|
||||
|
||||
public class CPlaylist : IMenuElement
|
||||
@@ -187,7 +171,7 @@ namespace VocaluxeLib.Menu
|
||||
public SColorF BackgroundSelColor;
|
||||
|
||||
public CButton ButtonPlaylistName;
|
||||
public CButton ButtonPlaylistClose;
|
||||
public CButton ButtonPlaylistClose;
|
||||
public CButton ButtonPlaylistSave;
|
||||
public CButton ButtonPlaylistDelete;
|
||||
public CButton ButtonPlaylistSing;
|
||||
@@ -353,7 +337,7 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= ButtonPlaylistSave.LoadTheme(item, "ButtonPlaylistSave", xmlReader, skinIndex);
|
||||
_ThemeLoaded &= ButtonPlaylistDelete.LoadTheme(item, "ButtonPlaylistDelete", xmlReader, skinIndex);
|
||||
|
||||
_ThemeLoaded &=SelectSlideGameMode.LoadTheme(item, "SelectSlideGameMode", xmlReader, skinIndex);
|
||||
_ThemeLoaded &= SelectSlideGameMode.LoadTheme(item, "SelectSlideGameMode", xmlReader, skinIndex);
|
||||
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/EntryHeight", ref _Theme.EntryHeight);
|
||||
if (_ThemeLoaded)
|
||||
@@ -366,11 +350,11 @@ namespace VocaluxeLib.Menu
|
||||
_Theme.SStaticCover = StaticCover.GetTheme();
|
||||
_Theme.SStaticPlaylistFooter = StaticPlaylistFooter.GetTheme();
|
||||
_Theme.SStaticPlaylistHeader = StaticPlaylistHeader.GetTheme();
|
||||
_Theme.SButtonPlaylistName =ButtonPlaylistName.GetTheme();
|
||||
_Theme.SButtonPlaylistSing =ButtonPlaylistSing.GetTheme();
|
||||
_Theme.SButtonPlaylistClose =ButtonPlaylistClose.GetTheme();
|
||||
_Theme.SButtonPlaylistSave =ButtonPlaylistSave.GetTheme();
|
||||
_Theme.SButtonPlaylistDelete =ButtonPlaylistDelete.GetTheme();
|
||||
_Theme.SButtonPlaylistName = ButtonPlaylistName.GetTheme();
|
||||
_Theme.SButtonPlaylistSing = ButtonPlaylistSing.GetTheme();
|
||||
_Theme.SButtonPlaylistClose = ButtonPlaylistClose.GetTheme();
|
||||
_Theme.SButtonPlaylistSave = ButtonPlaylistSave.GetTheme();
|
||||
_Theme.SButtonPlaylistDelete = ButtonPlaylistDelete.GetTheme();
|
||||
|
||||
LoadTextures();
|
||||
}
|
||||
@@ -405,7 +389,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public bool IsMouseOver(SMouseEvent mouseEvent)
|
||||
{
|
||||
return CHelper.IsInBounds(CompleteRect, mouseEvent.X, mouseEvent.Y) || _Interactions.IsMouseOver(mouseEvent);
|
||||
return CHelper.IsInBounds(CompleteRect, mouseEvent) || _Interactions.IsMouseOver(mouseEvent);
|
||||
}
|
||||
|
||||
public void UnloadTextures()
|
||||
|
||||
@@ -19,6 +19,7 @@ using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
@@ -33,12 +34,9 @@ namespace VocaluxeLib.Menu
|
||||
[XmlType("ScreenSetting")]
|
||||
public struct SScreenSetting
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlElement("Value")]
|
||||
public string Value;
|
||||
[XmlElement("Type")]
|
||||
public ESettingType Type;
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
[XmlElement("Value")] public string Value;
|
||||
[XmlElement("Type")] public ESettingType Type;
|
||||
}
|
||||
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
@@ -131,7 +129,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private CTexture _GetTextureValue(string value)
|
||||
private CTextureRef _GetTextureValue(string value)
|
||||
{
|
||||
return CBase.Theme.GetSkinTexture(value, _PartyModeID);
|
||||
}
|
||||
|
||||
@@ -18,75 +18,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
[XmlType("SelectSlide")]
|
||||
public struct SThemeSelectSlide
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
|
||||
[XmlElement("Skin")]
|
||||
public string TextureName;
|
||||
[XmlElement("SkinArrowLeft")]
|
||||
public string TextureArrowLeftName;
|
||||
[XmlElement("SkinArrowRight")]
|
||||
public string TextureArrowRightName;
|
||||
[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("SkinSelected")] public string SelTextureName;
|
||||
[XmlElement("SkinArrowLeftSelected")] public string SelTextureArrowLeftName;
|
||||
[XmlElement("SkinArrowRightSelected")] public string SelTextureArrowRightName;
|
||||
|
||||
[XmlElement("SkinHighlighted")]
|
||||
public string HighlightTextureName;
|
||||
[XmlElement("SkinHighlighted")] public string HighlightTextureName;
|
||||
|
||||
[XmlElement("Rect")]
|
||||
public SRectF Rect;
|
||||
[XmlElement("RectArrowLeft")]
|
||||
public SRectF RectArrowLeft;
|
||||
[XmlElement("RectArrowRight")]
|
||||
public SRectF RectArrowRight;
|
||||
[XmlElement("Rect")] public SRectF Rect;
|
||||
[XmlElement("RectArrowLeft")] public SRectF RectArrowLeft;
|
||||
[XmlElement("RectArrowRight")] public SRectF RectArrowRight;
|
||||
|
||||
[XmlElement("Color")]
|
||||
public SThemeColor Color;
|
||||
[XmlElement("SColor")]
|
||||
public SThemeColor SColor;
|
||||
[XmlElement("HColor")]
|
||||
public SThemeColor HColor;
|
||||
[XmlElement("Color")] public SThemeColor Color;
|
||||
[XmlElement("SColor")] public SThemeColor SColor;
|
||||
[XmlElement("HColor")] public SThemeColor HColor;
|
||||
|
||||
[XmlElement("ArrowColor")]
|
||||
public SThemeColor ArrowColor;
|
||||
[XmlElement("ArrowSColor")]
|
||||
public SThemeColor ArrowSColor;
|
||||
[XmlElement("ArrowColor")] public SThemeColor ArrowColor;
|
||||
[XmlElement("ArrowSColor")] public SThemeColor ArrowSColor;
|
||||
|
||||
[XmlElement("TextColor")]
|
||||
public SThemeColor TextColor;
|
||||
[XmlElement("TextSColor")]
|
||||
public SThemeColor TextSColor;
|
||||
[XmlElement("TextColor")] public SThemeColor TextColor;
|
||||
[XmlElement("TextSColor")] public SThemeColor TextSColor;
|
||||
|
||||
[XmlElement("TextH")]
|
||||
public float TextH;
|
||||
[XmlElement("TextRelativeX")]
|
||||
public float TextRelativeX;
|
||||
[XmlElement("TextRelativeY")]
|
||||
public float TextRelativeY;
|
||||
[XmlElement("TextMaxW")]
|
||||
public float TextMaxW;
|
||||
[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("TextFont")] public string TextFont;
|
||||
[XmlElement("TextStyle")] public EStyle TextStyle;
|
||||
|
||||
[XmlElement("NumVisible")]
|
||||
public int NumVisible;
|
||||
[XmlElement("NumVisible")] public int NumVisible;
|
||||
}
|
||||
|
||||
public class CSelectSlide : IMenuElement, ICloneable
|
||||
@@ -154,7 +129,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private readonly List<string> _ValueNames;
|
||||
private readonly List<int> _ValuePartyModeIDs;
|
||||
private readonly List<CTexture> _Textures;
|
||||
private readonly List<CTextureRef> _Textures;
|
||||
private readonly List<int> _ValueIndexes;
|
||||
|
||||
private readonly List<SRectF> _ValueBounds = new List<SRectF>();
|
||||
@@ -222,7 +197,7 @@ namespace VocaluxeLib.Menu
|
||||
MaxW = 0f;
|
||||
|
||||
_Selected = false;
|
||||
_Textures = new List<CTexture>();
|
||||
_Textures = new List<CTextureRef>();
|
||||
_ValueIndexes = new List<int>();
|
||||
_ValueNames = new List<string>();
|
||||
_ValuePartyModeIDs = new List<int>();
|
||||
@@ -270,7 +245,7 @@ namespace VocaluxeLib.Menu
|
||||
MaxW = slide.MaxW;
|
||||
|
||||
_Selected = slide._Selected;
|
||||
_Textures = new List<CTexture>(slide._Textures);
|
||||
_Textures = new List<CTextureRef>(slide._Textures);
|
||||
_ValueIndexes = new List<int>(slide._ValueIndexes);
|
||||
_ValueNames = new List<string>(slide._ValueNames);
|
||||
_ValueBounds = new List<SRectF>(slide._ValueBounds);
|
||||
@@ -288,7 +263,7 @@ namespace VocaluxeLib.Menu
|
||||
_Theme = theme;
|
||||
|
||||
_Selected = false;
|
||||
_Textures = new List<CTexture>();
|
||||
_Textures = new List<CTextureRef>();
|
||||
_ValueIndexes = new List<int>();
|
||||
_ValueNames = new List<string>();
|
||||
_ValuePartyModeIDs = new List<int>();
|
||||
@@ -444,17 +419,17 @@ namespace VocaluxeLib.Menu
|
||||
AddValue(value, null, _ValueIndexes.Count, partyModeID);
|
||||
}
|
||||
|
||||
public void AddValue(string value, CTexture texture)
|
||||
public void AddValue(string value, CTextureRef texture)
|
||||
{
|
||||
AddValue(value, texture, _ValueIndexes.Count, _PartyModeID);
|
||||
}
|
||||
|
||||
private void _AddValue(string value, CTexture texture, int valueIndex)
|
||||
private void _AddValue(string value, CTextureRef texture, int valueIndex)
|
||||
{
|
||||
AddValue(value, texture, valueIndex, _PartyModeID);
|
||||
}
|
||||
|
||||
public void AddValue(string value, CTexture texture, int valueIndex, int partyModeID)
|
||||
public void AddValue(string value, CTextureRef texture, int valueIndex, int partyModeID)
|
||||
{
|
||||
_ValueNames.Add(value);
|
||||
_Textures.Add(texture);
|
||||
@@ -475,7 +450,7 @@ namespace VocaluxeLib.Menu
|
||||
_ValueBounds.Clear();
|
||||
}
|
||||
|
||||
public void AddValues(string[] values, CTexture[] textures)
|
||||
public void AddValues(string[] values, CTextureRef[] textures)
|
||||
{
|
||||
if (values.Length != textures.Length)
|
||||
return;
|
||||
@@ -499,7 +474,7 @@ namespace VocaluxeLib.Menu
|
||||
RenameValue(Selection, newName);
|
||||
}
|
||||
|
||||
public void RenameValue(int selection, string newName, CTexture newTexture = null)
|
||||
public void RenameValue(int selection, string newName, CTextureRef newTexture = null)
|
||||
{
|
||||
if (selection < 0 && selection >= _ValueNames.Count)
|
||||
return;
|
||||
@@ -623,15 +598,15 @@ namespace VocaluxeLib.Menu
|
||||
if (!Visible && CBase.Settings.GetProgramState() != EProgramState.EditTheme)
|
||||
return;
|
||||
|
||||
CTexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
CTexture textureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.TextureArrowLeftName, _PartyModeID);
|
||||
CTexture textureArrowRight = CBase.Theme.GetSkinTexture(_Theme.TextureArrowRightName, _PartyModeID);
|
||||
CTextureRef texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
CTextureRef textureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.TextureArrowLeftName, _PartyModeID);
|
||||
CTextureRef textureArrowRight = CBase.Theme.GetSkinTexture(_Theme.TextureArrowRightName, _PartyModeID);
|
||||
|
||||
CTexture selTexture = CBase.Theme.GetSkinTexture(_Theme.SelTextureName, _PartyModeID);
|
||||
CTexture selTextureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowLeftName, _PartyModeID);
|
||||
CTexture selTextureArrowRight = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowRightName, _PartyModeID);
|
||||
CTextureRef selTexture = CBase.Theme.GetSkinTexture(_Theme.SelTextureName, _PartyModeID);
|
||||
CTextureRef selTextureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowLeftName, _PartyModeID);
|
||||
CTextureRef selTextureArrowRight = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowRightName, _PartyModeID);
|
||||
|
||||
CTexture highlightTexture = CBase.Theme.GetSkinTexture(_Theme.HighlightTextureName, _PartyModeID);
|
||||
CTextureRef highlightTexture = CBase.Theme.GetSkinTexture(_Theme.HighlightTextureName, _PartyModeID);
|
||||
|
||||
if (Selected)
|
||||
{
|
||||
@@ -773,7 +748,6 @@ namespace VocaluxeLib.Menu
|
||||
TextRelativeX = _Theme.TextRelativeX;
|
||||
TextRelativeY = _Theme.TextRelativeY;
|
||||
MaxW = _Theme.TextMaxW;
|
||||
|
||||
}
|
||||
|
||||
public void ReloadTextures()
|
||||
|
||||
+21
-24
@@ -19,16 +19,15 @@ using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
[XmlType("Static")]
|
||||
public struct SThemeStatic
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlElement("Skin")]
|
||||
public string TextureName;
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
[XmlElement("Skin")] public string TextureName;
|
||||
public SThemeColor Color;
|
||||
public SRectF Rect;
|
||||
public SReflection Reflection;
|
||||
@@ -51,8 +50,8 @@ namespace VocaluxeLib.Menu
|
||||
get { return _ThemeLoaded; }
|
||||
}
|
||||
|
||||
private CTexture _Texture;
|
||||
public CTexture Texture
|
||||
private CTextureRef _Texture;
|
||||
public CTextureRef Texture
|
||||
{
|
||||
get { return _Texture ?? CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); }
|
||||
|
||||
@@ -73,10 +72,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public EAspect Aspect = EAspect.Stretch;
|
||||
|
||||
public CStatic()
|
||||
{
|
||||
|
||||
}
|
||||
public CStatic() {}
|
||||
|
||||
public CStatic(int partyModeID)
|
||||
{
|
||||
@@ -99,7 +95,7 @@ namespace VocaluxeLib.Menu
|
||||
Visible = s.Visible;
|
||||
}
|
||||
|
||||
public CStatic(int partyModeID, CTexture texture, SColorF color, SRectF rect)
|
||||
public CStatic(int partyModeID, CTextureRef texture, SColorF color, SRectF rect)
|
||||
{
|
||||
_PartyModeID = partyModeID;
|
||||
|
||||
@@ -179,26 +175,27 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void Draw(EAspect aspect, float scale = 1f, float zModify = 0f, bool forceDraw = false)
|
||||
{
|
||||
CTexture texture = Texture ?? new CTexture((int)Rect.W, (int)Rect.H);
|
||||
|
||||
SRectF bounds = Rect.Scale(scale);
|
||||
SRectF rect;
|
||||
if (aspect != EAspect.Stretch)
|
||||
CHelper.SetRect(bounds, out rect, texture.OrigAspect, aspect);
|
||||
else
|
||||
rect = bounds;
|
||||
rect.Z = Rect.Z + zModify;
|
||||
CTextureRef texture = Texture;
|
||||
SRectF rect = Rect.Scale(scale);
|
||||
rect.Z += zModify;
|
||||
if (texture != null)
|
||||
rect = CHelper.FitInBounds(rect, texture.OrigAspect, aspect);
|
||||
|
||||
var color = new SColorF(Color.R, Color.G, Color.B, Color.A * Alpha);
|
||||
if (Visible || forceDraw || (CBase.Settings.GetProgramState() == EProgramState.EditTheme))
|
||||
{
|
||||
CBase.Drawing.DrawTexture(texture, rect, color, bounds);
|
||||
if (Reflection)
|
||||
CBase.Drawing.DrawTextureReflection(texture, rect, color, bounds, ReflectionSpace, ReflectionHeight);
|
||||
if (texture != null)
|
||||
{
|
||||
CBase.Drawing.DrawTexture(texture, rect, color);
|
||||
if (Reflection)
|
||||
CBase.Drawing.DrawTextureReflection(texture, rect, color, ReflectionSpace, ReflectionHeight);
|
||||
}
|
||||
else
|
||||
CBase.Drawing.DrawRect(color, rect);
|
||||
}
|
||||
|
||||
if (Selected && (CBase.Settings.GetProgramState() == EProgramState.EditTheme))
|
||||
CBase.Drawing.DrawColor(new SColorF(1f, 1f, 1f, 0.5f), rect);
|
||||
CBase.Drawing.DrawRect(new SColorF(1f, 1f, 1f, 0.5f), rect);
|
||||
}
|
||||
|
||||
public void UnloadTextures() {}
|
||||
|
||||
+56
-101
@@ -17,43 +17,32 @@
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
[XmlType("Text")]
|
||||
public struct SThemeText
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
|
||||
[XmlElement("X")]
|
||||
public float X;
|
||||
[XmlElement("Y")]
|
||||
public float Y;
|
||||
[XmlElement("Z")]
|
||||
public float Z;
|
||||
[XmlElement("H")]
|
||||
public float Height;
|
||||
[XmlElement("MaxW")]
|
||||
public float MaxWidth;
|
||||
[XmlElement("X")] public float X;
|
||||
[XmlElement("Y")] public float Y;
|
||||
[XmlElement("Z")] public float Z;
|
||||
[XmlElement("H")] public float FontHeight;
|
||||
[XmlElement("MaxW")] public float MaxWidth;
|
||||
public SThemeColor Color;
|
||||
public SThemeColor SColor; //for Buttons
|
||||
[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;
|
||||
[XmlElement("Align")] public EAlignment Align;
|
||||
[XmlElement("ResizeAlign")] public EHAlignment ResizeAlign;
|
||||
[XmlElement("Style")] public EStyle FontStyle;
|
||||
[XmlElement("Font")] public string FontFamily;
|
||||
[XmlElement("Text")] public string Text;
|
||||
public SReflection Reflection;
|
||||
}
|
||||
|
||||
public class CText : IMenuElement
|
||||
public class CText : IMenuElement, IFontObserver
|
||||
{
|
||||
private SThemeText _Theme;
|
||||
private bool _ThemeLoaded;
|
||||
@@ -110,20 +99,6 @@ namespace VocaluxeLib.Menu
|
||||
set { _Z = value; }
|
||||
}
|
||||
|
||||
private float _Height;
|
||||
public float Height
|
||||
{
|
||||
get { return _Height; }
|
||||
set
|
||||
{
|
||||
if (Math.Abs(_Height - value) > 0.01)
|
||||
{
|
||||
_Height = value;
|
||||
_PositionNeedsUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float _MaxWidth;
|
||||
public float MaxWidth
|
||||
{
|
||||
@@ -166,29 +141,17 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private EStyle _Style = EStyle.Normal;
|
||||
public EStyle Style
|
||||
{
|
||||
get { return _Style; }
|
||||
set
|
||||
{
|
||||
if (_Style != value)
|
||||
{
|
||||
_Style = value;
|
||||
_PositionNeedsUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string _Font = String.Empty;
|
||||
public string Font
|
||||
private CFont _Font = new CFont();
|
||||
public CFont Font
|
||||
{
|
||||
get { return _Font; }
|
||||
set
|
||||
{
|
||||
if (_Font != value)
|
||||
if (!_Font.Equals(value))
|
||||
{
|
||||
_Font.RemoveObserver(this);
|
||||
_Font = value;
|
||||
_Font.AddObserver(this);
|
||||
_PositionNeedsUpdate = true;
|
||||
}
|
||||
}
|
||||
@@ -227,10 +190,16 @@ namespace VocaluxeLib.Menu
|
||||
_Text = translation;
|
||||
if (_EditMode)
|
||||
_Text += "|";
|
||||
//Reset height, it might have been reduced in _UpdatePosition
|
||||
Font.Height = _Theme.FontHeight;
|
||||
_PositionNeedsUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
public string TranslatedText
|
||||
{
|
||||
get { return _Text; }
|
||||
}
|
||||
|
||||
public int PartyModeID
|
||||
{
|
||||
@@ -274,7 +243,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
_PartyModeID = partyModeID;
|
||||
_TranslationID = _PartyModeID;
|
||||
_Font = "Normal";
|
||||
_Font.AddObserver(this);
|
||||
}
|
||||
|
||||
public CText(CText text)
|
||||
@@ -285,12 +254,10 @@ namespace VocaluxeLib.Menu
|
||||
_X = text._X;
|
||||
_Y = text._Y;
|
||||
_Z = text._Z;
|
||||
_Height = text._Height;
|
||||
_MaxWidth = text._MaxWidth;
|
||||
_Align = text._Align;
|
||||
_ResizeAlign = text._ResizeAlign;
|
||||
_Style = text._Style;
|
||||
_Font = text._Font;
|
||||
Font = text.Font; //Use setter to set observer
|
||||
|
||||
Color = new SColorF(text.Color);
|
||||
SelColor = new SColorF(text.SelColor);
|
||||
@@ -305,24 +272,23 @@ namespace VocaluxeLib.Menu
|
||||
_EditMode = text._EditMode;
|
||||
}
|
||||
|
||||
public CText(float x, float y, float z, float h, float mw, EAlignment align, EStyle style, string font, SColorF col, string text, int partyModeID = -1, float rheight = 0,
|
||||
float rspace = 0)
|
||||
public CText(float x, float y, float z, float h, float mw, EAlignment align, EStyle style, string fontFamily, SColorF col, string text, int partyModeID = -1,
|
||||
float rheight = 0,
|
||||
float rspace = 0) : this(partyModeID)
|
||||
{
|
||||
_Theme = new SThemeText();
|
||||
_Theme = new SThemeText {FontFamily = fontFamily, FontStyle = style, FontHeight = h, Text = text};
|
||||
_ThemeLoaded = false;
|
||||
_ButtonText = false;
|
||||
_PartyModeID = partyModeID;
|
||||
_TranslationID = _PartyModeID;
|
||||
|
||||
X = x;
|
||||
Y = y;
|
||||
Z = z;
|
||||
Height = h;
|
||||
MaxWidth = mw;
|
||||
Align = align;
|
||||
ResizeAlign = EHAlignment.Center;
|
||||
Style = style;
|
||||
Font = font;
|
||||
_Font.Name = fontFamily;
|
||||
_Font.Style = style;
|
||||
_Font.Height = h;
|
||||
|
||||
Color = col;
|
||||
SelColor = new SColorF(col);
|
||||
@@ -362,7 +328,6 @@ namespace VocaluxeLib.Menu
|
||||
if (!buttonText)
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Z", ref _Z);
|
||||
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/H", ref _Height);
|
||||
xmlReader.TryGetFloatValue(item + "/MaxW", ref _MaxWidth);
|
||||
|
||||
if (xmlReader.GetValue(item + "/Color", out _Theme.Color.Name, String.Empty))
|
||||
@@ -389,8 +354,9 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
_ThemeLoaded &= xmlReader.TryGetEnumValue(item + "/Align", ref _Align);
|
||||
xmlReader.TryGetEnumValue(item + "/ResizeAlign", ref _ResizeAlign);
|
||||
_ThemeLoaded &= xmlReader.TryGetEnumValue(item + "/Style", ref _Style);
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/Font", out _Font, "Normal");
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/H", ref _Theme.FontHeight);
|
||||
_ThemeLoaded &= xmlReader.TryGetEnumValue(item + "/Style", ref _Theme.FontStyle);
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/Font", out _Theme.FontFamily);
|
||||
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/Text", out _Theme.Text, String.Empty);
|
||||
|
||||
@@ -407,15 +373,12 @@ namespace VocaluxeLib.Menu
|
||||
_Theme.Name = elementName;
|
||||
_Theme.Align = _Align;
|
||||
_Theme.Color.Color = Color;
|
||||
_Theme.Font = _Font;
|
||||
_Theme.ResizeAlign = _ResizeAlign;
|
||||
_Theme.SColor.Color = SelColor;
|
||||
_Theme.Style = _Style;
|
||||
_Theme.MaxWidth = _MaxWidth;
|
||||
_Theme.X = _X;
|
||||
_Theme.Y = _Y;
|
||||
_Theme.Z = _Z;
|
||||
_Theme.Height = _Height;
|
||||
|
||||
_ButtonText = buttonText;
|
||||
_PositionNeedsUpdate = true;
|
||||
@@ -425,7 +388,6 @@ namespace VocaluxeLib.Menu
|
||||
return _ThemeLoaded;
|
||||
}
|
||||
|
||||
|
||||
public void Draw(bool forceDraw = false)
|
||||
{
|
||||
if (!forceDraw && !Visible && CBase.Settings.GetProgramState() != EProgramState.EditTheme)
|
||||
@@ -434,30 +396,24 @@ namespace VocaluxeLib.Menu
|
||||
// Update Text
|
||||
Text = Text;
|
||||
|
||||
CBase.Fonts.SetFont(Font);
|
||||
CBase.Fonts.SetStyle(Style);
|
||||
|
||||
SColorF currentColor = (Selected) ? SelColor : Color;
|
||||
var color = new SColorF(currentColor.R, currentColor.G, currentColor.B, currentColor.A * Alpha);
|
||||
|
||||
CBase.Fonts.DrawText(_Text, Rect.H, Rect.X, Rect.Y, Z, color);
|
||||
CBase.Fonts.DrawText(_Text, Font, Rect.X, Rect.Y, Z, color);
|
||||
|
||||
if (ReflectionHeight > 0)
|
||||
CBase.Fonts.DrawTextReflection(_Text, Rect.H, Rect.X, Rect.Y, Z, color, ReflectionSpace, ReflectionHeight);
|
||||
CBase.Fonts.DrawTextReflection(_Text, Font, Rect.X, Rect.Y, Z, color, ReflectionSpace, ReflectionHeight);
|
||||
|
||||
if (Selected && (CBase.Settings.GetProgramState() == EProgramState.EditTheme))
|
||||
CBase.Drawing.DrawColor(new SColorF(0.5f, 1f, 0.5f, 0.5f), new SRectF(Rect.X, Rect.Y, Rect.W, Rect.H, Z));
|
||||
CBase.Drawing.DrawRect(new SColorF(0.5f, 1f, 0.5f, 0.5f), new SRectF(Rect.X, Rect.Y, Rect.W, Rect.H, Z));
|
||||
}
|
||||
|
||||
public void Draw(float begin, float end)
|
||||
{
|
||||
CBase.Fonts.SetFont(Font);
|
||||
CBase.Fonts.SetStyle(Style);
|
||||
|
||||
SColorF currentColor = (Selected) ? SelColor : Color;
|
||||
var color = new SColorF(currentColor.R, currentColor.G, currentColor.B, currentColor.A * Alpha);
|
||||
|
||||
CBase.Fonts.DrawText(Text, Rect.H, Rect.X, Rect.Y, Z, color, begin, end);
|
||||
CBase.Fonts.DrawText(Text, Font, Rect.X, Rect.Y, Z, color, begin, end);
|
||||
|
||||
if (ReflectionHeight > 0)
|
||||
{
|
||||
@@ -465,7 +421,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
if (Selected && (CBase.Settings.GetProgramState() == EProgramState.EditTheme))
|
||||
CBase.Drawing.DrawColor(new SColorF(0.5f, 1f, 0.5f, 0.5f), new SRectF(X, Y, Rect.W, Rect.H, Z));
|
||||
CBase.Drawing.DrawRect(new SColorF(0.5f, 1f, 0.5f, 0.5f), new SRectF(X, Y, Rect.W, Rect.H, Z));
|
||||
}
|
||||
|
||||
public void DrawRelative(float rx, float ry, float reflectionHeight = 0f, float reflectionSpace = 0f, float rectHeight = 0f)
|
||||
@@ -505,12 +461,10 @@ namespace VocaluxeLib.Menu
|
||||
_X = _Theme.X;
|
||||
_Y = _Theme.Y;
|
||||
_Z = _Theme.Z;
|
||||
_Height = _Theme.Height;
|
||||
_MaxWidth = _Theme.MaxWidth;
|
||||
_Align = _Theme.Align;
|
||||
_ResizeAlign = _Theme.ResizeAlign;
|
||||
_Style = _Theme.Style;
|
||||
_Font = _Theme.Font;
|
||||
Font = new CFont(_Theme.FontFamily, _Theme.FontStyle, _Theme.FontHeight);
|
||||
|
||||
if (_Theme.Reflection.Enabled)
|
||||
{
|
||||
@@ -541,17 +495,16 @@ namespace VocaluxeLib.Menu
|
||||
X += stepX;
|
||||
Y += stepY;
|
||||
|
||||
_Theme.X += stepX;
|
||||
_Theme.Y += stepY;
|
||||
_Theme.X = X;
|
||||
_Theme.Y = Y;
|
||||
}
|
||||
|
||||
public void ResizeElement(int stepW, int stepH)
|
||||
{
|
||||
Height += stepH;
|
||||
if (Height <= 0)
|
||||
Height = 1;
|
||||
|
||||
_Theme.Height = _Height;
|
||||
_Theme.FontHeight += stepH;
|
||||
if (_Theme.FontHeight <= 0)
|
||||
_Theme.FontHeight = 1;
|
||||
_Font.Height = _Theme.FontHeight;
|
||||
}
|
||||
#endregion ThemeEdit
|
||||
|
||||
@@ -560,10 +513,7 @@ namespace VocaluxeLib.Menu
|
||||
if (_Text == "")
|
||||
return;
|
||||
|
||||
CBase.Fonts.SetFont(Font);
|
||||
CBase.Fonts.SetStyle(Style);
|
||||
|
||||
float h = Height;
|
||||
float h = Font.Height;
|
||||
float y = Y;
|
||||
RectangleF bounds = CBase.Fonts.GetTextBounds(this);
|
||||
|
||||
@@ -584,8 +534,8 @@ namespace VocaluxeLib.Menu
|
||||
y += step * 0.75f;
|
||||
break;
|
||||
}
|
||||
|
||||
bounds = CBase.Fonts.GetTextBounds(this, h);
|
||||
Font.Height = h;
|
||||
bounds = CBase.Fonts.GetTextBounds(this);
|
||||
}
|
||||
|
||||
float x = X;
|
||||
@@ -606,5 +556,10 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
_PositionNeedsUpdate = false;
|
||||
}
|
||||
|
||||
public void FontChanged()
|
||||
{
|
||||
_PositionNeedsUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
#endregion
|
||||
|
||||
using System.Xml;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Songs;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu.SingNotes
|
||||
{
|
||||
@@ -42,42 +42,30 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
}
|
||||
|
||||
[XmlType("Position")]
|
||||
public struct SBarPosition
|
||||
public struct SBarPosition
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
public SRectF Rect;
|
||||
}
|
||||
|
||||
[XmlType("SingBar")]
|
||||
public struct SThemeSingBar
|
||||
{
|
||||
[XmlAttributeAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
|
||||
[XmlElement("SkinLeft")]
|
||||
public string SkinLeftName;
|
||||
[XmlElement("SkinMiddle")]
|
||||
public string SkinMiddleName;
|
||||
[XmlElement("SkinRight")]
|
||||
public string SkinRightName;
|
||||
[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("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;
|
||||
[XmlElement("SkinGoldenStar")] public string SkinGoldenStarName;
|
||||
[XmlElement("SkinToneHelper")] public string SkinToneHelperName;
|
||||
[XmlElement("SkinPerfectNoteStart")] public string SkinPerfectNoteStarName;
|
||||
|
||||
[XmlArray("BarPositions")]
|
||||
public SBarPosition[] BarPos;
|
||||
[XmlArray("BarPositions")] public SBarPosition[] BarPos;
|
||||
}
|
||||
|
||||
public abstract class CSingNotes : IMenuElement
|
||||
@@ -116,7 +104,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_PlayerNotes = new List<SPlayerNotes>();
|
||||
_ActID = 0;
|
||||
|
||||
BarPos = new SRectF[CBase.Settings.GetMaxNumPlayer(), CBase.Settings.GetMaxNumPlayer()];
|
||||
BarPos = new SRectF[CBase.Settings.GetMaxNumPlayer(),CBase.Settings.GetMaxNumPlayer()];
|
||||
|
||||
LoadTextures();
|
||||
}
|
||||
@@ -152,21 +140,18 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
BarPos = new SRectF[CBase.Settings.GetMaxNumPlayer(),CBase.Settings.GetMaxNumPlayer()];
|
||||
for (int numplayer = 0; numplayer < CBase.Settings.GetMaxNumPlayer(); numplayer++)
|
||||
{
|
||||
for (int player = 0; player < CBase.Settings.GetMaxNumPlayer(); player++)
|
||||
for (int player = 0; player <= numplayer; player++)
|
||||
{
|
||||
if (player <= numplayer)
|
||||
{
|
||||
BarPos[player, numplayer] = new SRectF();
|
||||
string target = "/BarPositions/P" + (player + 1) + "N" + (numplayer + 1);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + target + "X", ref BarPos[player, numplayer].X);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + target + "Y", ref BarPos[player, numplayer].Y);
|
||||
_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++;
|
||||
}
|
||||
BarPos[player, numplayer] = new SRectF();
|
||||
string target = "/BarPositions/P" + (player + 1) + "N" + (numplayer + 1);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + target + "X", ref BarPos[player, numplayer].X);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + target + "Y", ref BarPos[player, numplayer].Y);
|
||||
_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++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +164,6 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
return _ThemeLoaded;
|
||||
}
|
||||
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_PlayerNotes.Clear();
|
||||
@@ -317,7 +301,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
);
|
||||
|
||||
_DrawNoteBG(rect, color, 1f, _PlayerNotes[n].Timer);
|
||||
_DrawNote(rect, new SColorF(5f, 5f, 5f, 0.7f * _PlayerNotes[n].Alpha), 0.7f);
|
||||
_DrawNote(rect, new SColorF(1f, 1f, 1f, 0.7f * _PlayerNotes[n].Alpha), 0.7f);
|
||||
|
||||
if (note.Type == ENoteType.Golden)
|
||||
{
|
||||
@@ -428,7 +412,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
public void UnloadTextures() {}
|
||||
|
||||
public void LoadTextures()
|
||||
public void LoadTextures()
|
||||
{
|
||||
foreach (SBarPosition bp in _Theme.BarPos)
|
||||
{
|
||||
@@ -471,9 +455,9 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
var noteRect = new SRectF(rect.X + dw, rect.Y + dh, rect.W - 2 * dw, rect.H - 2 * dh, rect.Z);
|
||||
|
||||
CTexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
|
||||
CTexture noteMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinMiddleName, _PartyModeID);
|
||||
CTexture noteEnd = CBase.Theme.GetSkinTexture(_Theme.SkinRightName, _PartyModeID);
|
||||
CTextureRef noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
|
||||
CTextureRef noteMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinMiddleName, _PartyModeID);
|
||||
CTextureRef noteEnd = CBase.Theme.GetSkinTexture(_Theme.SkinRightName, _PartyModeID);
|
||||
|
||||
//Width of each of the ends (round parts)
|
||||
//Need 2 of them so use minimum
|
||||
@@ -518,9 +502,9 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
rect.Z
|
||||
);
|
||||
|
||||
CTexture noteBackgroundBegin = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundLeftName, _PartyModeID);
|
||||
CTexture noteBackgroundMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundMiddleName, _PartyModeID);
|
||||
CTexture noteBackgroundEnd = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundRightName, _PartyModeID);
|
||||
CTextureRef noteBackgroundBegin = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundLeftName, _PartyModeID);
|
||||
CTextureRef noteBackgroundMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundMiddleName, _PartyModeID);
|
||||
CTextureRef noteBackgroundEnd = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundRightName, _PartyModeID);
|
||||
|
||||
float dx = r.H * noteBackgroundBegin.OrigAspect;
|
||||
if (2 * dx > r.W)
|
||||
@@ -538,12 +522,13 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
CBase.Drawing.DrawTexture(noteBackgroundEnd, new SRectF(r.X + r.W - dx, r.Y, dx, r.H, r.Z), col);
|
||||
}
|
||||
|
||||
protected void _DrawNoteLines(SRectF rect, SColorF color)
|
||||
private static void _DrawNoteLines(SRectF rect, SColorF color)
|
||||
{
|
||||
for (int i = 0; i < CBase.Settings.GetNumNoteLines() - 1; i++)
|
||||
SRectF lineRect = new SRectF(rect) {H = 1.5f};
|
||||
for (int i = 0; i < CBase.Settings.GetNumNoteLines(); i++)
|
||||
{
|
||||
float y = rect.Y + rect.H / CBase.Settings.GetNumNoteLines() * (i + 1);
|
||||
CBase.Drawing.DrawColor(color, new SRectF(rect.X, y, rect.W, 1, -1.0f));
|
||||
lineRect.Y = rect.Y + rect.H / CBase.Settings.GetNumNoteLines() * (i + 1);
|
||||
CBase.Drawing.DrawRect(color, lineRect);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -613,7 +598,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
rect.Z
|
||||
);
|
||||
|
||||
CTexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
|
||||
CTextureRef noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
|
||||
float dx = r.H * noteBegin.OrigAspect;
|
||||
if (2 * dx > r.W)
|
||||
dx = r.W / 2;
|
||||
@@ -670,7 +655,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_PlayerNotes[n].Color.B,
|
||||
_PlayerNotes[n].Color.A * _PlayerNotes[n].Alpha);
|
||||
|
||||
CTexture toneHelper = CBase.Theme.GetSkinTexture(_Theme.SkinToneHelperName, _PartyModeID);
|
||||
CTextureRef toneHelper = CBase.Theme.GetSkinTexture(_Theme.SkinToneHelperName, _PartyModeID);
|
||||
CBase.Drawing.DrawTexture(toneHelper, drawRect, color);
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
using System.Xml;
|
||||
using VocaluxeLib.PartyModes;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
|
||||
@@ -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,7 +268,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
|
||||
public virtual void OnShow() {}
|
||||
|
||||
|
||||
public virtual void OnHide()
|
||||
{
|
||||
if(CBase.Graphics.GetNextScreen() != EScreens.ScreenNames || CBase.Config.GetBackgroundMusicStatus() == EBackgroundMusicOffOn.TR_CONFIG_OFF)
|
||||
@@ -373,7 +347,6 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_ColorInternal = CBase.Theme.GetColor(_Theme.Color.Name, _PartyModeID);
|
||||
else
|
||||
_ColorInternal = _Theme.Color.Color;
|
||||
|
||||
}
|
||||
|
||||
public void ReloadTextures()
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.PartyModes;
|
||||
using VocaluxeLib.Songs;
|
||||
using VocaluxeLib.Xml;
|
||||
|
||||
namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
@@ -38,8 +38,8 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
private CStatic _MedleyCalcIcon;
|
||||
private CStatic _MedleyTagIcon;
|
||||
|
||||
private CTexture _CoverBigBGTexture;
|
||||
private CTexture _CoverBGTexture;
|
||||
private CTextureRef _CoverBigBGTexture;
|
||||
private CTextureRef _CoverBGTexture;
|
||||
|
||||
private CText _Artist;
|
||||
private CText _Title;
|
||||
@@ -494,20 +494,16 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
_TextBG.Draw();
|
||||
|
||||
CTexture vidtex = CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null;
|
||||
CTextureRef vidtex = CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null;
|
||||
|
||||
if (vidtex != null)
|
||||
{
|
||||
if (vidtex.Color.A < 1)
|
||||
_CoverBig.Draw(EAspect.Crop);
|
||||
var bounds = new RectangleF(_CoverBig.Rect.X, _CoverBig.Rect.Y, _CoverBig.Rect.W, _CoverBig.Rect.H);
|
||||
RectangleF rect;
|
||||
CHelper.SetRect(bounds, out rect, vidtex.OrigAspect, EAspect.Crop);
|
||||
var vidRect = new SRectF(rect.X, rect.Y, rect.Width, rect.Height, _CoverBig.Rect.Z);
|
||||
var vidRectBounds = new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f);
|
||||
SRectF rect = CHelper.FitInBounds(_CoverBig.Rect, vidtex.OrigAspect, EAspect.Crop);
|
||||
|
||||
CBase.Drawing.DrawTexture(vidtex, vidRect, vidtex.Color, vidRectBounds);
|
||||
CBase.Drawing.DrawTextureReflection(vidtex, vidRect, vidtex.Color, vidRectBounds, _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight);
|
||||
CBase.Drawing.DrawTexture(vidtex, rect);
|
||||
CBase.Drawing.DrawTextureReflection(vidtex, rect, vidtex.Color, _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight);
|
||||
}
|
||||
else
|
||||
_CoverBig.Draw(EAspect.Crop);
|
||||
|
||||
Reference in new issue
Block a user