Merge branch 'develop' of github.com:Vocaluxe/Vocaluxe into develop
This commit is contained in:
commit
e04020779a
21 files changed
+832
-309
No files matched your search
@@ -265,14 +265,14 @@ namespace VocaluxeLib.Menu
|
||||
_Timer.Start();
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
public void Draw(bool allMonitors = true)
|
||||
{
|
||||
// ReSharper disable ConvertIfStatementToConditionalTernaryExpression
|
||||
if (!String.IsNullOrEmpty(_TextureName))
|
||||
// ReSharper restore ConvertIfStatementToConditionalTernaryExpression
|
||||
CBase.Drawing.DrawTexture(CBase.Themes.GetSkinTexture(_TextureName, _PartyModeID), _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
|
||||
CBase.Drawing.DrawTexture(CBase.Themes.GetSkinTexture(_TextureName, _PartyModeID), _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha), allMonitors);
|
||||
else
|
||||
CBase.Drawing.DrawTexture(_Texture, _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
|
||||
CBase.Drawing.DrawTexture(_Texture, _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha), allMonitors);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,8 @@ namespace VocaluxeLib.Menu
|
||||
[XmlType("ParticleEffect")]
|
||||
public struct SThemeParticleEffect
|
||||
{
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
|
||||
public string Skin;
|
||||
public SRectF Rect;
|
||||
@@ -34,6 +35,7 @@ namespace VocaluxeLib.Menu
|
||||
public EParticleType Type;
|
||||
public float Size;
|
||||
public int MaxNumber;
|
||||
public bool? AllMonitors;
|
||||
}
|
||||
|
||||
public enum EParticleType
|
||||
@@ -59,6 +61,8 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public float Alpha = 1f;
|
||||
|
||||
public bool AllMonitors = true;
|
||||
|
||||
public string GetThemeName()
|
||||
{
|
||||
return _Theme.Name;
|
||||
@@ -264,7 +268,7 @@ namespace VocaluxeLib.Menu
|
||||
foreach (CParticle star in _Stars)
|
||||
{
|
||||
star.Alpha2 = Alpha;
|
||||
star.Draw();
|
||||
star.Draw(AllMonitors);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace VocaluxeLib.Menu
|
||||
public SRectF Rect;
|
||||
[XmlArrayItem("ProgressColor"), XmlArray] public List<SThemeProgressBarColor> ProgressColors;
|
||||
public SReflection? Reflection;
|
||||
public bool? AllMonitors;
|
||||
}
|
||||
|
||||
public sealed class CProgressBar : CMenuElementBase, IMenuElement, IThemeable
|
||||
@@ -108,6 +109,11 @@ namespace VocaluxeLib.Menu
|
||||
set { _TextureProgressRight = value; }
|
||||
}
|
||||
|
||||
private EDirection _Direction;
|
||||
private EOffOn _AnimateMovement;
|
||||
private EOffOn _AnimateColoring;
|
||||
private List<SThemeProgressBarColor> _ProgressColors;
|
||||
|
||||
public SColorF ColorBackground;
|
||||
public SColorF ColorForeground;
|
||||
|
||||
@@ -115,6 +121,8 @@ namespace VocaluxeLib.Menu
|
||||
public float ReflectionSpace;
|
||||
public float ReflectionHeight;
|
||||
|
||||
public bool AllMonitors = true;
|
||||
|
||||
public float Alpha = 1;
|
||||
|
||||
private float _ProgressTarget;
|
||||
@@ -165,6 +173,10 @@ namespace VocaluxeLib.Menu
|
||||
_TextureProgressLeft = pb.TextureProgressLeft;
|
||||
_TextureProgressMid = pb._TextureProgressMid;
|
||||
_TextureProgressRight = pb._TextureProgressRight;
|
||||
_AnimateMovement = pb._AnimateMovement;
|
||||
_AnimateColoring = pb._AnimateColoring;
|
||||
_Direction = pb._Direction;
|
||||
_ProgressColors = pb._ProgressColors;
|
||||
|
||||
ColorBackground = pb.ColorBackground;
|
||||
ColorForeground = pb.ColorForeground;
|
||||
@@ -174,6 +186,8 @@ namespace VocaluxeLib.Menu
|
||||
ReflectionSpace = pb.ReflectionHeight;
|
||||
ReflectionHeight = pb.ReflectionSpace;
|
||||
|
||||
AllMonitors = pb.AllMonitors;
|
||||
|
||||
Alpha = pb.Alpha;
|
||||
Visible = pb.Visible;
|
||||
|
||||
@@ -185,6 +199,10 @@ namespace VocaluxeLib.Menu
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = theme;
|
||||
_Theme.ProgressColors.Sort((x, y) => x.From.CompareTo(y.From));
|
||||
_ProgressColors = _Theme.ProgressColors;
|
||||
_Direction = _Theme.Direction;
|
||||
_AnimateMovement = _Theme.AnimateMovement;
|
||||
_AnimateColoring = _Theme.AnimateColoring;
|
||||
_UpdateProgress();
|
||||
ThemeLoaded = true;
|
||||
|
||||
@@ -195,7 +213,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
_Animate = animateInit;
|
||||
|
||||
_Theme.ProgressColors[0].Color.Get(_PartyModeID, out _ColorProgressLast);
|
||||
_ProgressColors[0].Color.Get(_PartyModeID, out _ColorProgressLast);
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
@@ -216,43 +234,43 @@ namespace VocaluxeLib.Menu
|
||||
SColorF color = new SColorF(ColorBackground.R, ColorBackground.G, ColorBackground.B, ColorBackground.A * Alpha);
|
||||
if (_TextureBackground != null)
|
||||
{
|
||||
CBase.Drawing.DrawTexture(_TextureBackground, Rect, color);
|
||||
CBase.Drawing.DrawTexture(_TextureBackground, Rect, color, AllMonitors);
|
||||
if (Reflection)
|
||||
CBase.Drawing.DrawTextureReflection(_TextureBackground, Rect, color, Rect, ReflectionSpace, ReflectionHeight);
|
||||
CBase.Drawing.DrawTextureReflection(_TextureBackground, Rect, color, Rect, ReflectionSpace, ReflectionHeight, AllMonitors);
|
||||
}
|
||||
|
||||
//Draw progress
|
||||
color = new SColorF(_ColorProgressCurrent.R, _ColorProgressCurrent.G, _ColorProgressCurrent.B, _ColorProgressCurrent.A * Alpha);
|
||||
if (_TextureProgressBegin != null)
|
||||
{
|
||||
CBase.Drawing.DrawTexture(_TextureProgressBegin, _RectProgressBegin, color);
|
||||
CBase.Drawing.DrawTexture(_TextureProgressBegin, _RectProgressBegin, color, AllMonitors);
|
||||
if (Reflection)
|
||||
CBase.Drawing.DrawTextureReflection(_TextureProgressBegin, _RectProgressBegin, color, _RectProgressBegin, ReflectionSpace, ReflectionHeight);
|
||||
CBase.Drawing.DrawTextureReflection(_TextureProgressBegin, _RectProgressBegin, color, _RectProgressBegin, ReflectionSpace, ReflectionHeight, AllMonitors);
|
||||
}
|
||||
|
||||
if (_TextureProgressMid != null)
|
||||
{
|
||||
CBase.Drawing.DrawTexture(_TextureProgressMid, _RectProgressMid, color);
|
||||
CBase.Drawing.DrawTexture(_TextureProgressMid, _RectProgressMid, color, AllMonitors);
|
||||
if (Reflection)
|
||||
CBase.Drawing.DrawTextureReflection(_TextureProgressMid, _RectProgressMid, color, _RectProgressMid, ReflectionSpace, ReflectionHeight);
|
||||
CBase.Drawing.DrawTextureReflection(_TextureProgressMid, _RectProgressMid, color, _RectProgressMid, ReflectionSpace, ReflectionHeight, AllMonitors);
|
||||
}
|
||||
else
|
||||
CBase.Drawing.DrawRect(_ColorProgressCurrent, _RectProgressMid);
|
||||
|
||||
if (_TextureProgressEnd != null)
|
||||
{
|
||||
CBase.Drawing.DrawTexture(_TextureProgressEnd, _RectProgressEnd, color);
|
||||
CBase.Drawing.DrawTexture(_TextureProgressEnd, _RectProgressEnd, color, AllMonitors);
|
||||
if (Reflection)
|
||||
CBase.Drawing.DrawTextureReflection(_TextureProgressEnd, _RectProgressEnd, color, _RectProgressEnd, ReflectionSpace, ReflectionHeight);
|
||||
CBase.Drawing.DrawTextureReflection(_TextureProgressEnd, _RectProgressEnd, color, _RectProgressEnd, ReflectionSpace, ReflectionHeight, AllMonitors);
|
||||
}
|
||||
|
||||
//Draw foreground
|
||||
color = new SColorF(ColorForeground.R, ColorForeground.G, ColorForeground.B, ColorForeground.A * Alpha);
|
||||
if (_TextureForeground != null)
|
||||
{
|
||||
CBase.Drawing.DrawTexture(_TextureForeground, Rect, color);
|
||||
CBase.Drawing.DrawTexture(_TextureForeground, Rect, color, AllMonitors);
|
||||
if (Reflection)
|
||||
CBase.Drawing.DrawTextureReflection(_TextureForeground, Rect, color, Rect, ReflectionSpace, ReflectionHeight);
|
||||
CBase.Drawing.DrawTextureReflection(_TextureForeground, Rect, color, Rect, ReflectionSpace, ReflectionHeight, AllMonitors);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,20 +334,20 @@ namespace VocaluxeLib.Menu
|
||||
private void _CheckAnimation()
|
||||
{
|
||||
//Check if animation needs to be started
|
||||
if (_Theme.AnimateColoring == EOffOn.TR_CONFIG_ON || _Theme.AnimateMovement == EOffOn.TR_CONFIG_ON)
|
||||
if (_AnimateColoring == EOffOn.TR_CONFIG_ON || _AnimateMovement == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
if (!_AnimTimer.IsRunning)
|
||||
{
|
||||
_AnimTimer.Restart();
|
||||
//Calc animation duration in ms based on rect size and progress change
|
||||
if (_Theme.Direction == EDirection.Left || _Theme.Direction == EDirection.Right)
|
||||
_AnimDuration = Math.Max(100f, (_Theme.Rect.W * 0.015f * 1000) * Math.Abs(_ProgressTarget - _ProgressCurrent));
|
||||
if (_Direction == EDirection.Left || _Direction == EDirection.Right)
|
||||
_AnimDuration = Math.Max(100f, (Rect.W * 0.015f * 1000) * Math.Abs(_ProgressTarget - _ProgressCurrent));
|
||||
else
|
||||
_AnimDuration = Math.Max(100f, (_Theme.Rect.H * 0.015f * 1000) * Math.Abs(_ProgressTarget - _ProgressCurrent));
|
||||
_AnimDuration = Math.Max(100f, (Rect.H * 0.015f * 1000) * Math.Abs(_ProgressTarget - _ProgressCurrent));
|
||||
}
|
||||
}
|
||||
//Movement animation
|
||||
if (_Theme.AnimateMovement == EOffOn.TR_CONFIG_ON)
|
||||
if (_AnimateMovement == EOffOn.TR_CONFIG_ON)
|
||||
_ProgressCurrent = _ProgressLast + (_AnimTimer.ElapsedMilliseconds / _AnimDuration).Clamp(0, 1) * (_ProgressTarget - _ProgressLast);
|
||||
|
||||
//Check if animation needs to be stopped
|
||||
@@ -346,11 +364,11 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private void _UpdateProgressColor()
|
||||
{
|
||||
foreach (SThemeProgressBarColor col in _Theme.ProgressColors)
|
||||
foreach (SThemeProgressBarColor col in _ProgressColors)
|
||||
if (col.From < _ProgressTarget)
|
||||
col.Color.Get(_PartyModeID, out _ColorProgressTarget);
|
||||
|
||||
if(_Animate && _Theme.AnimateColoring == EOffOn.TR_CONFIG_ON)
|
||||
if(_Animate && _AnimateColoring == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
float animFactor = (_AnimTimer.ElapsedMilliseconds / _AnimDuration).Clamp(0, 1);
|
||||
|
||||
@@ -365,7 +383,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private void _UpdateProgressLeft()
|
||||
{
|
||||
switch (_Theme.Direction)
|
||||
switch (_Direction)
|
||||
{
|
||||
case EDirection.Right:
|
||||
_TextureProgressBegin = TextureProgressLeft;
|
||||
@@ -403,7 +421,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private void _UpdateProgressMid()
|
||||
{
|
||||
switch (_Theme.Direction)
|
||||
switch (_Direction)
|
||||
{
|
||||
case EDirection.Right:
|
||||
_RectProgressMid = new SRectF(_RectProgressBegin.X + _RectProgressBegin.W, Rect.Y, (Rect.W - 2 * _RectProgressBegin.W) * _ProgressCurrent, Rect.H, Rect.Z);
|
||||
@@ -427,7 +445,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private void _UpdateProgressRight()
|
||||
{
|
||||
switch (_Theme.Direction)
|
||||
switch (_Direction)
|
||||
{
|
||||
case EDirection.Right:
|
||||
_TextureProgressEnd = _TextureProgressRight;
|
||||
|
||||
@@ -24,11 +24,13 @@ namespace VocaluxeLib.Menu
|
||||
[XmlType("Static")]
|
||||
public struct SThemeStatic
|
||||
{
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
public string Skin;
|
||||
public SThemeColor Color;
|
||||
public SRectF Rect;
|
||||
public SReflection? Reflection;
|
||||
public bool? AllMonitors;
|
||||
}
|
||||
|
||||
public sealed class CStatic : CMenuElementBase, IMenuElement, IThemeable
|
||||
@@ -63,6 +65,8 @@ namespace VocaluxeLib.Menu
|
||||
public float ReflectionSpace;
|
||||
public float ReflectionHeight;
|
||||
|
||||
public bool AllMonitors = true;
|
||||
|
||||
public float Alpha = 1;
|
||||
|
||||
public EAspect Aspect = EAspect.Stretch;
|
||||
@@ -91,6 +95,7 @@ namespace VocaluxeLib.Menu
|
||||
Reflection = s.Reflection;
|
||||
ReflectionSpace = s.ReflectionHeight;
|
||||
ReflectionHeight = s.ReflectionSpace;
|
||||
AllMonitors = s.AllMonitors;
|
||||
|
||||
Alpha = s.Alpha;
|
||||
Visible = s.Visible;
|
||||
@@ -149,9 +154,9 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
if (texture != null)
|
||||
{
|
||||
CBase.Drawing.DrawTexture(texture, rect, color, bounds);
|
||||
CBase.Drawing.DrawTexture(texture, rect, color, bounds, false, AllMonitors);
|
||||
if (Reflection)
|
||||
CBase.Drawing.DrawTextureReflection(texture, rect, color, bounds, ReflectionSpace, ReflectionHeight);
|
||||
CBase.Drawing.DrawTextureReflection(texture, rect, color, bounds, ReflectionSpace, ReflectionHeight, AllMonitors);
|
||||
}
|
||||
else
|
||||
CBase.Drawing.DrawRect(color, rect);
|
||||
@@ -161,7 +166,7 @@ namespace VocaluxeLib.Menu
|
||||
CBase.Drawing.DrawRect(new SColorF(1f, 1f, 1f, 0.5f), rect);
|
||||
}
|
||||
|
||||
public void UnloadSkin() {}
|
||||
public void UnloadSkin() { }
|
||||
|
||||
public void LoadSkin()
|
||||
{
|
||||
|
||||
@@ -24,21 +24,27 @@ namespace VocaluxeLib.Menu
|
||||
[XmlType("Text")]
|
||||
public struct SThemeText
|
||||
{
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
|
||||
public float X;
|
||||
public float Y;
|
||||
public float Z;
|
||||
[XmlElement("H")] public float FontHeight;
|
||||
[XmlElement("MaxW")] public float MaxWidth;
|
||||
[XmlElement("H")]
|
||||
public float FontHeight;
|
||||
[XmlElement("MaxW")]
|
||||
public float MaxWidth;
|
||||
public SThemeColor Color;
|
||||
public SThemeColor SelColor; //for Buttons
|
||||
public EAlignment Align;
|
||||
public EHAlignment ResizeAlign;
|
||||
[XmlElement("Style")] public EStyle FontStyle;
|
||||
[XmlElement("Font")] public string FontFamily;
|
||||
[XmlElement("Style")]
|
||||
public EStyle FontStyle;
|
||||
[XmlElement("Font")]
|
||||
public string FontFamily;
|
||||
public string Text;
|
||||
public SReflection? Reflection;
|
||||
public bool? AllMonitors;
|
||||
}
|
||||
|
||||
public sealed class CText : CMenuElementBase, IMenuElement, IThemeable, IFontObserver
|
||||
@@ -161,6 +167,8 @@ namespace VocaluxeLib.Menu
|
||||
private float _ReflectionSpace;
|
||||
private float _ReflectionHeight;
|
||||
|
||||
public bool AllMonitors = true;
|
||||
|
||||
private string _Text = String.Empty;
|
||||
public string Text
|
||||
{
|
||||
@@ -248,6 +256,7 @@ namespace VocaluxeLib.Menu
|
||||
SelColor = text.SelColor;
|
||||
_ReflectionSpace = text._ReflectionSpace;
|
||||
_ReflectionHeight = text._ReflectionHeight;
|
||||
AllMonitors = text.AllMonitors;
|
||||
|
||||
Text = text.Text;
|
||||
Visible = text.Visible;
|
||||
@@ -309,7 +318,7 @@ namespace VocaluxeLib.Menu
|
||||
SColorF currentColor = (Selected) ? SelColor : Color;
|
||||
var color = new SColorF(currentColor.R, currentColor.G, currentColor.B, currentColor.A * Alpha);
|
||||
|
||||
CBase.Fonts.DrawText(_Text, CalculatedFont, Rect.X, Rect.Y, Z, color);
|
||||
CBase.Fonts.DrawText(_Text, CalculatedFont, Rect.X, Rect.Y, Z, color, AllMonitors);
|
||||
|
||||
if (_ReflectionHeight > 0)
|
||||
CBase.Fonts.DrawTextReflection(_Text, CalculatedFont, Rect.X, Rect.Y, Z, color, _ReflectionSpace, _ReflectionHeight);
|
||||
@@ -354,7 +363,7 @@ namespace VocaluxeLib.Menu
|
||||
Y -= ry;
|
||||
}
|
||||
|
||||
public void UnloadSkin() {}
|
||||
public void UnloadSkin() { }
|
||||
|
||||
public void LoadSkin()
|
||||
{
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
for (int i = 0; i < CBase.Settings.GetNumNoteLines(); i++)
|
||||
{
|
||||
lineRect.Y = (Rect.Y + Rect.H / CBase.Settings.GetNumNoteLines() * (i + 1)) - (lineRect.H / 2);
|
||||
CBase.Drawing.DrawRect(color, lineRect);
|
||||
CBase.Drawing.DrawRect(color, lineRect, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
var color = new SColorF(_Color, _Color.A * Alpha);
|
||||
|
||||
CTextureRef toneHelper = CBase.Themes.GetSkinTexture(_Theme.SkinToneHelper, _PartyModeID);
|
||||
CBase.Drawing.DrawTexture(toneHelper, drawRect, color);
|
||||
CBase.Drawing.DrawTexture(toneHelper, drawRect, color, false);
|
||||
}
|
||||
|
||||
private void _DrawNote(SRectF rect, SColorF color, CTextureRef noteBegin, CTextureRef noteMiddle, CTextureRef noteEnd, float factor)
|
||||
@@ -247,7 +247,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
//Need 2 of them so use minimum
|
||||
int endsW = (int)Math.Min(noteRect.H * noteBegin.OrigAspect, noteRect.W / 2);
|
||||
|
||||
CBase.Drawing.DrawTexture(noteBegin, new SRectF(noteRect.X, noteRect.Y, endsW, noteRect.H, noteRect.Z), color);
|
||||
CBase.Drawing.DrawTexture(noteBegin, new SRectF(noteRect.X, noteRect.Y, endsW, noteRect.H, noteRect.Z), color, false);
|
||||
|
||||
SRectF middleRect = new SRectF(noteRect.X + endsW, noteRect.Y, noteRect.W - 2 * endsW, noteRect.H, noteRect.Z);
|
||||
|
||||
@@ -257,14 +257,14 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
for (int i = 0; i < midCount; ++i)
|
||||
{
|
||||
CBase.Drawing.DrawTexture(noteMiddle, new SRectF(middleRect.X + (i * midW), noteRect.Y, midW, noteRect.H, noteRect.Z), color);
|
||||
CBase.Drawing.DrawTexture(noteMiddle, new SRectF(middleRect.X + (i * midW), noteRect.Y, midW, noteRect.H, noteRect.Z), color, false);
|
||||
}
|
||||
|
||||
SRectF lastMidRect = new SRectF(middleRect.X + midCount * midW, noteRect.Y, middleRect.W - (midCount * midW), noteRect.H, noteRect.Z);
|
||||
|
||||
CBase.Drawing.DrawTexture(noteMiddle, new SRectF(middleRect.X + (midCount * midW), middleRect.Y, midW, middleRect.H, middleRect.Z), color, lastMidRect);
|
||||
CBase.Drawing.DrawTexture(noteMiddle, new SRectF(middleRect.X + (midCount * midW), middleRect.Y, midW, middleRect.H, middleRect.Z), color, lastMidRect, false, false);
|
||||
|
||||
CBase.Drawing.DrawTexture(noteEnd, new SRectF(noteRect.X + noteRect.W - endsW, noteRect.Y, endsW, noteRect.H, noteRect.Z), color);
|
||||
CBase.Drawing.DrawTexture(noteEnd, new SRectF(noteRect.X + noteRect.W - endsW, noteRect.Y, endsW, noteRect.H, noteRect.Z), color, false);
|
||||
}
|
||||
|
||||
private void _DrawNoteBase(SRectF rect, SColorF color, float factor)
|
||||
@@ -311,6 +311,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
{
|
||||
var numstars = (int)(noteRect.W * 0.25f);
|
||||
var stars = new CParticleEffect(_PartyModeID, numstars, new SColorF(Color.Yellow), noteRect, _Theme.SkinGoldenStar, 20, EParticleType.Star);
|
||||
stars.AllMonitors = false;
|
||||
_GoldenStars.Add(stars);
|
||||
}
|
||||
|
||||
@@ -319,6 +320,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
var rect = new SRectF(noteRect.Right, noteRect.Y, 0f, noteRect.H, noteRect.Z);
|
||||
|
||||
var flares = new CParticleEffect(_PartyModeID, 15, new SColorF(Color.White), rect, _Theme.SkinGoldenStar, 20, EParticleType.Flare);
|
||||
flares.AllMonitors = false;
|
||||
_Flares.Add(flares);
|
||||
}
|
||||
|
||||
@@ -333,12 +335,14 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
var stars = new CParticleEffect(_PartyModeID, CBase.Game.GetRandom(2) + 1, new SColorF(Color.White), r, _Theme.SkinPerfectNoteStart, 35,
|
||||
EParticleType.PerfNoteStar);
|
||||
stars.AllMonitors = false;
|
||||
_PerfectNoteEffect.Add(stars);
|
||||
}
|
||||
|
||||
private void _AddPerfectLine()
|
||||
{
|
||||
var twinkle = new CParticleEffect(_PartyModeID, 200, _Color, Rect, _Theme.SkinGoldenStar, 25, EParticleType.Twinkle);
|
||||
twinkle.AllMonitors = false;
|
||||
_PerfectLineTwinkle.Add(twinkle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,14 +26,16 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
[XmlType("Position")]
|
||||
public struct SBarPosition
|
||||
{
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
public SRectF Rect;
|
||||
}
|
||||
|
||||
[XmlType("SingBar")]
|
||||
public struct SThemeSingBar
|
||||
{
|
||||
[XmlAttribute(AttributeName = "Name")] public string Name;
|
||||
[XmlAttribute(AttributeName = "Name")]
|
||||
public string Name;
|
||||
|
||||
public string SkinLeft;
|
||||
public string SkinMiddle;
|
||||
@@ -51,7 +53,8 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
public string SkinToneHelper;
|
||||
public string SkinPerfectNoteStart;
|
||||
|
||||
[XmlArray("BarPositions")] public SBarPosition[] BarPos;
|
||||
[XmlArray("BarPositions")]
|
||||
public SBarPosition[] BarPos;
|
||||
}
|
||||
|
||||
public class CSingNotes : CMenuElementBase, IMenuElement, IThemeable
|
||||
@@ -78,12 +81,12 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
/// <remarks>
|
||||
/// first index = player number; second index = num players seen on screen
|
||||
/// </remarks>
|
||||
private SRectF[,] _BarPos { get; set; }
|
||||
private SRectF[,,] _BarPos { get; set; }
|
||||
|
||||
public CSingNotes(int partyModeID)
|
||||
{
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeSingBar {BarPos = new SBarPosition[CHelper.Sum(CBase.Settings.GetMaxNumPlayer())]};
|
||||
_Theme = new SThemeSingBar { BarPos = new SBarPosition[CHelper.Sum(CBase.Settings.GetMaxNumPlayer() * CBase.Settings.GetMaxNumScreens())] };
|
||||
ThemeLoaded = false;
|
||||
}
|
||||
|
||||
@@ -92,7 +95,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = theme;
|
||||
|
||||
_BarPos = new SRectF[CBase.Settings.GetMaxNumPlayer(),CBase.Settings.GetMaxNumPlayer()];
|
||||
_BarPos = new SRectF[CBase.Settings.GetMaxNumScreens(), CBase.Settings.GetMaxNumPlayer(), CBase.Settings.GetMaxNumPlayer()];
|
||||
|
||||
ThemeLoaded = true;
|
||||
}
|
||||
@@ -104,17 +107,51 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
public bool ThemeLoaded { get; private set; }
|
||||
|
||||
public void Init(int numPlayers)
|
||||
public void Init(int numPlayers, int numScreens = 0)
|
||||
{
|
||||
|
||||
PlayerNotes.Clear();
|
||||
for (int p = 0; p < numPlayers; p++)
|
||||
PlayerNotes.Add(new CNoteBars(_PartyModeID, p, _BarPos[p, numPlayers - 1], _Theme));
|
||||
if (numPlayers > 0 && numScreens > 0)
|
||||
{
|
||||
int[] screenAssignment = new int[numPlayers];
|
||||
int screenPlayers = numPlayers / numScreens;
|
||||
int remainingPlayers = numPlayers - (screenPlayers * numScreens);
|
||||
int player = 0;
|
||||
|
||||
for (int s = 0; s < numScreens; s++)
|
||||
{
|
||||
for (int p = 0; p < screenPlayers; p++)
|
||||
{
|
||||
if (remainingPlayers > 0)
|
||||
{
|
||||
PlayerNotes.Add(new CNoteBars(_PartyModeID, player++, _BarPos[s, p, screenPlayers], _Theme));
|
||||
if (p == screenPlayers - 1)
|
||||
{
|
||||
PlayerNotes.Add(new CNoteBars(_PartyModeID, player++, _BarPos[s, p + 1, screenPlayers], _Theme));
|
||||
remainingPlayers--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerNotes.Add(new CNoteBars(_PartyModeID, player++, _BarPos[s, p, screenPlayers - 1], _Theme));
|
||||
}
|
||||
|
||||
}
|
||||
//Handle when players < screens
|
||||
if (screenPlayers == 0 && remainingPlayers > 0)
|
||||
{
|
||||
PlayerNotes.Add(new CNoteBars(_PartyModeID, player++, _BarPos[s, 0, 0], _Theme));
|
||||
remainingPlayers--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (numPlayers == 0)
|
||||
_Rect = new SRectF(0, 0, 0, 0, Rect.Z);
|
||||
else
|
||||
{
|
||||
_Rect.X = PlayerNotes.Select(bp => bp.Rect.X).Min();
|
||||
_Rect.Y = PlayerNotes.Select(bp => bp.Rect.X).Min();
|
||||
_Rect.Y = PlayerNotes.Select(bp => bp.Rect.Y).Min();
|
||||
_Rect.Right = PlayerNotes.Select(bp => bp.Rect.Right).Max();
|
||||
_Rect.Bottom = PlayerNotes.Select(bp => bp.Rect.Bottom).Max();
|
||||
_Rect.Z = PlayerNotes.Select(bp => bp.Rect.Z).Average();
|
||||
@@ -127,7 +164,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
noteBars.Draw();
|
||||
}
|
||||
|
||||
public void UnloadSkin() {}
|
||||
public void UnloadSkin() { }
|
||||
|
||||
public void LoadSkin()
|
||||
{
|
||||
@@ -141,8 +178,11 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
{
|
||||
int n = Int32.Parse(bp.Name.Substring(3, 1)) - 1;
|
||||
int p = Int32.Parse(bp.Name.Substring(1, 1)) - 1;
|
||||
|
||||
_BarPos[p, n] = bp.Rect;
|
||||
for (int s = 0; s < CBase.Settings.GetMaxNumScreens(); s++)
|
||||
{
|
||||
_BarPos[s, p, n] = bp.Rect;
|
||||
_BarPos[s, p, n].X += s * CBase.Settings.GetRenderW();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,9 +198,9 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
}
|
||||
|
||||
#region ThemeEdit
|
||||
public void MoveElement(int stepX, int stepY) {}
|
||||
public void MoveElement(int stepX, int stepY) { }
|
||||
|
||||
public void ResizeElement(int stepW, int stepH) {}
|
||||
public void ResizeElement(int stepW, int stepH) { }
|
||||
#endregion ThemeEdit
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user