Renaming for namesheme
This commit is contained in:
1 parent
1336a6fa36
commit
67da90427b
131 files changed
+11905
-11812
No files matched your search
@@ -38,9 +38,9 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
#region Constructors
|
||||
public CBackground(int PartyModeID)
|
||||
public CBackground(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_ThemeLoaded = false;
|
||||
_Theme = new SThemeBackground();
|
||||
|
||||
@@ -49,9 +49,9 @@ namespace VocaluxeLib.Menu
|
||||
#endregion Constructors
|
||||
|
||||
#region public
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string item = XmlPath + "/" + ElementName;
|
||||
string item = xmlPath + "/" + elementName;
|
||||
_ThemeLoaded = true;
|
||||
|
||||
_ThemeLoaded &= xmlReader.TryGetEnumValue(item + "/Type", ref _Theme.Type);
|
||||
@@ -61,7 +61,7 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= vid || tex || _Theme.Type == EBackgroundTypes.None;
|
||||
|
||||
if (xmlReader.GetValue(item + "/Color", ref _Theme.ColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, out Color);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, skinIndex, out Color);
|
||||
else
|
||||
{
|
||||
bool success = true;
|
||||
@@ -76,7 +76,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = ElementName;
|
||||
_Theme.Name = elementName;
|
||||
LoadTextures();
|
||||
}
|
||||
return _ThemeLoaded;
|
||||
@@ -138,22 +138,22 @@ namespace VocaluxeLib.Menu
|
||||
CBase.BackgroundMusic.VideoEnabled() && !CBase.BackgroundMusic.IsDisabled())
|
||||
{
|
||||
Pause();
|
||||
ok = DrawBackgroundMusicVideo();
|
||||
ok = _DrawBackgroundMusicVideo();
|
||||
}
|
||||
else if (_Theme.Type == EBackgroundTypes.Video && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
Resume();
|
||||
ok = DrawVideo();
|
||||
ok = _DrawVideo();
|
||||
}
|
||||
|
||||
if (_Theme.TextureName.Length > 0 &&
|
||||
(_Theme.Type == EBackgroundTypes.Texture ||
|
||||
(_Theme.Type == EBackgroundTypes.Video && (CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_OFF || !ok))))
|
||||
ok = DrawTexture();
|
||||
ok = _DrawTexture();
|
||||
|
||||
if (_Theme.Type == EBackgroundTypes.Color || _Theme.Type == EBackgroundTypes.Texture && !ok ||
|
||||
(_Theme.Type == EBackgroundTypes.Video && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_OFF && !ok))
|
||||
DrawColor();
|
||||
_DrawColor();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -174,53 +174,53 @@ namespace VocaluxeLib.Menu
|
||||
#endregion public
|
||||
|
||||
#region internal
|
||||
private void DrawColor()
|
||||
private void _DrawColor()
|
||||
{
|
||||
SRectF bounds = new SRectF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), CBase.Settings.GetZFar() / 4);
|
||||
|
||||
CBase.Drawing.DrawColor(Color, bounds);
|
||||
}
|
||||
|
||||
private bool DrawTexture()
|
||||
private bool _DrawTexture()
|
||||
{
|
||||
STexture Texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
if (Texture.height > 0)
|
||||
STexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
if (texture.Height > 0)
|
||||
{
|
||||
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||
RectangleF rect = new RectangleF(0f, 0f, Texture.width, Texture.height);
|
||||
RectangleF rect = new RectangleF(0f, 0f, texture.Width, texture.Height);
|
||||
CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);
|
||||
|
||||
CBase.Drawing.DrawTexture(Texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||
CBase.Drawing.DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool DrawVideo()
|
||||
private bool _DrawVideo()
|
||||
{
|
||||
STexture VideoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID);
|
||||
if (VideoTexture.height > 0)
|
||||
STexture videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID);
|
||||
if (videoTexture.Height > 0)
|
||||
{
|
||||
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||
RectangleF rect = new RectangleF(0f, 0f, VideoTexture.width, VideoTexture.height);
|
||||
RectangleF rect = new RectangleF(0f, 0f, videoTexture.Width, videoTexture.Height);
|
||||
CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);
|
||||
|
||||
CBase.Drawing.DrawTexture(VideoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||
CBase.Drawing.DrawTexture(videoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool DrawBackgroundMusicVideo()
|
||||
private bool _DrawBackgroundMusicVideo()
|
||||
{
|
||||
STexture VideoTexture = CBase.BackgroundMusic.GetVideoTexture();
|
||||
if (VideoTexture.height > 0)
|
||||
STexture videoTexture = CBase.BackgroundMusic.GetVideoTexture();
|
||||
if (videoTexture.Height > 0)
|
||||
{
|
||||
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||
RectangleF rect = new RectangleF(0f, 0f, VideoTexture.width, VideoTexture.height);
|
||||
RectangleF rect = new RectangleF(0f, 0f, videoTexture.Width, videoTexture.Height);
|
||||
CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);
|
||||
|
||||
CBase.Drawing.DrawTexture(VideoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||
CBase.Drawing.DrawTexture(videoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
+14
-14
@@ -68,9 +68,9 @@ namespace VocaluxeLib.Menu
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public CButton(int PartyModeID)
|
||||
public CButton(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeButton();
|
||||
Rect = new SRectF();
|
||||
Color = new SColorF();
|
||||
@@ -128,9 +128,9 @@ namespace VocaluxeLib.Menu
|
||||
SelReflectionSpace = button.SelReflectionSpace;
|
||||
}
|
||||
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string item = XmlPath + "/" + ElementName;
|
||||
string item = xmlPath + "/" + elementName;
|
||||
_ThemeLoaded = true;
|
||||
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/Skin", ref _Theme.TextureName, String.Empty);
|
||||
@@ -143,7 +143,7 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/H", ref Rect.H);
|
||||
|
||||
if (xmlReader.GetValue(item + "/Color", ref _Theme.ColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, out Color);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, skinIndex, out Color);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/R", ref Color.R);
|
||||
@@ -153,7 +153,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
if (xmlReader.GetValue(item + "/SColor", ref _Theme.SelColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SelColorName, SkinIndex, out SelColor);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SelColorName, skinIndex, out SelColor);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SR", ref SelColor.R);
|
||||
@@ -162,12 +162,12 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SA", ref SelColor.A);
|
||||
}
|
||||
|
||||
_ThemeLoaded &= Text.LoadTheme(item, "Text", xmlReader, SkinIndex, true);
|
||||
_ThemeLoaded &= Text.LoadTheme(item, "Text", xmlReader, skinIndex, true);
|
||||
Text.Z = Rect.Z;
|
||||
if (xmlReader.ItemExists(item + "/SText"))
|
||||
{
|
||||
IsSelText = true;
|
||||
_ThemeLoaded &= SelText.LoadTheme(item, "SText", xmlReader, SkinIndex, true);
|
||||
_ThemeLoaded &= SelText.LoadTheme(item, "SText", xmlReader, skinIndex, true);
|
||||
SelText.Z = Rect.Z;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = ElementName;
|
||||
_Theme.Name = elementName;
|
||||
LoadTextures();
|
||||
}
|
||||
return _ThemeLoaded;
|
||||
@@ -285,16 +285,16 @@ namespace VocaluxeLib.Menu
|
||||
Draw(true);
|
||||
}
|
||||
|
||||
public void Draw(bool ForceDraw)
|
||||
public void Draw(bool forceDraw)
|
||||
{
|
||||
if (!Visible && CBase.Settings.GetGameState() != EGameState.EditTheme && !ForceDraw)
|
||||
if (!Visible && CBase.Settings.GetGameState() != EGameState.EditTheme && !forceDraw)
|
||||
return;
|
||||
|
||||
STexture texture = new STexture(-1);
|
||||
|
||||
if (!Selected && !Pressed || !Enabled)
|
||||
{
|
||||
if (Texture.index != -1)
|
||||
if (Texture.Index != -1)
|
||||
texture = Texture;
|
||||
else
|
||||
texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
@@ -311,7 +311,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
else if (!IsSelText)
|
||||
{
|
||||
if (Texture.index != -1)
|
||||
if (Texture.Index != -1)
|
||||
texture = Texture;
|
||||
else
|
||||
texture = CBase.Theme.GetSkinTexture(_Theme.SelTextureName, _PartyModeID);
|
||||
@@ -328,7 +328,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
else if (IsSelText)
|
||||
{
|
||||
if (SelTexture.index != -1)
|
||||
if (SelTexture.Index != -1)
|
||||
texture = SelTexture;
|
||||
else
|
||||
texture = CBase.Theme.GetSkinTexture(_Theme.SelTextureName, _PartyModeID);
|
||||
|
||||
@@ -48,9 +48,9 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private float[] _Bars;
|
||||
|
||||
public CEqualizer(int PartyModeID)
|
||||
public CEqualizer(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeEqualizer();
|
||||
_ThemeLoaded = false;
|
||||
|
||||
@@ -67,9 +67,9 @@ namespace VocaluxeLib.Menu
|
||||
ReflectionHeight = 0f;
|
||||
}
|
||||
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string item = XmlPath + "/" + ElementName;
|
||||
string item = xmlPath + "/" + elementName;
|
||||
_ThemeLoaded = true;
|
||||
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/Skin", ref _Theme.TextureName, String.Empty);
|
||||
@@ -89,7 +89,7 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= xmlReader.TryGetEnumValue(item + "/DrawNegative", ref _Theme.DrawNegative);
|
||||
|
||||
if (xmlReader.GetValue(item + "/Color", ref _Theme.ColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, out Color);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, skinIndex, out Color);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/R", ref Color.R);
|
||||
@@ -99,7 +99,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
if (xmlReader.GetValue(item + "/MaxColor", ref _Theme.MaxColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, out Color);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, skinIndex, out Color);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/MaxR", ref MaxColor.R);
|
||||
@@ -120,7 +120,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = ElementName;
|
||||
_Theme.Name = elementName;
|
||||
_Bars = new float[_Theme.NumBars];
|
||||
for (int i = 0; i < _Bars.Length; i++)
|
||||
_Bars[i] = 0f;
|
||||
|
||||
+38
-38
@@ -35,16 +35,16 @@ namespace VocaluxeLib.Menu
|
||||
/// </summary>
|
||||
public static string ListStrings(string[] str)
|
||||
{
|
||||
string _Result = string.Empty;
|
||||
string result = string.Empty;
|
||||
|
||||
for (int i = 0; i < str.Length; i++)
|
||||
{
|
||||
_Result += str[i];
|
||||
result += str[i];
|
||||
if (i < str.Length - 1)
|
||||
_Result += ", ";
|
||||
result += ", ";
|
||||
}
|
||||
|
||||
return _Result;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int TryReadInt(StreamReader sr)
|
||||
@@ -73,54 +73,54 @@ namespace VocaluxeLib.Menu
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void SetRect(RectangleF Bounds, ref RectangleF Rect, float RectAspect, EAspect Aspect)
|
||||
public static void SetRect(RectangleF bounds, ref RectangleF rect, float rectAspect, EAspect aspect)
|
||||
{
|
||||
float rW = Bounds.Right - Bounds.Left;
|
||||
float rH = Bounds.Bottom - Bounds.Top;
|
||||
float rW = bounds.Right - bounds.Left;
|
||||
float rH = bounds.Bottom - bounds.Top;
|
||||
float rA = rW / rH;
|
||||
|
||||
float ScaledWidth = rW;
|
||||
float ScaledHeight = rH;
|
||||
float scaledWidth = rW;
|
||||
float scaledHeight = rH;
|
||||
|
||||
switch (Aspect)
|
||||
switch (aspect)
|
||||
{
|
||||
case EAspect.Crop:
|
||||
if (rA >= RectAspect)
|
||||
if (rA >= rectAspect)
|
||||
{
|
||||
ScaledWidth = rW;
|
||||
ScaledHeight = rH * rA / RectAspect;
|
||||
scaledWidth = rW;
|
||||
scaledHeight = rH * rA / rectAspect;
|
||||
}
|
||||
else
|
||||
{
|
||||
ScaledHeight = rH;
|
||||
ScaledWidth = rW * RectAspect / rA;
|
||||
scaledHeight = rH;
|
||||
scaledWidth = rW * rectAspect / rA;
|
||||
}
|
||||
break;
|
||||
case EAspect.LetterBox:
|
||||
if (RectAspect >= 1)
|
||||
if (rectAspect >= 1)
|
||||
{
|
||||
ScaledWidth = rW;
|
||||
ScaledHeight = rH * rA / RectAspect;
|
||||
scaledWidth = rW;
|
||||
scaledHeight = rH * rA / rectAspect;
|
||||
}
|
||||
else
|
||||
{
|
||||
ScaledHeight = rH;
|
||||
ScaledWidth = rW * RectAspect / rA;
|
||||
scaledHeight = rH;
|
||||
scaledWidth = rW * rectAspect / rA;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ScaledWidth = rW;
|
||||
ScaledHeight = rH;
|
||||
scaledWidth = rW;
|
||||
scaledHeight = rH;
|
||||
break;
|
||||
}
|
||||
|
||||
float Left = (rW - ScaledWidth) / 2 + Bounds.Left;
|
||||
float Rigth = Left + ScaledWidth;
|
||||
float left = (rW - scaledWidth) / 2 + bounds.Left;
|
||||
float rigth = left + scaledWidth;
|
||||
|
||||
float Upper = (rH - ScaledHeight) / 2 + Bounds.Top;
|
||||
float Lower = Upper + ScaledHeight;
|
||||
float upper = (rH - scaledHeight) / 2 + bounds.Top;
|
||||
float lower = upper + scaledHeight;
|
||||
|
||||
Rect = new RectangleF(Left, Upper, Rigth - Left, Lower - Upper);
|
||||
rect = new RectangleF(left, upper, rigth - left, lower - upper);
|
||||
}
|
||||
|
||||
public static List<string> ListFiles(string path, string cast)
|
||||
@@ -185,9 +185,9 @@ namespace VocaluxeLib.Menu
|
||||
return float.TryParse(value, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, NumberFormatInfo.InvariantInfo, out result);
|
||||
}
|
||||
|
||||
public static bool IsInBounds(SRectF bounds, MouseEvent MouseEvent)
|
||||
public static bool IsInBounds(SRectF bounds, SMouseEvent mouseEvent)
|
||||
{
|
||||
return IsInBounds(bounds, MouseEvent.X, MouseEvent.Y);
|
||||
return IsInBounds(bounds, mouseEvent.X, mouseEvent.Y);
|
||||
}
|
||||
|
||||
public static bool IsInBounds(SRectF bounds, int x, int y)
|
||||
@@ -198,9 +198,9 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
static class CEncoding
|
||||
{
|
||||
public static Encoding GetEncoding(string EncodingName)
|
||||
public static Encoding GetEncoding(string encodingName)
|
||||
{
|
||||
switch (EncodingName)
|
||||
switch (encodingName)
|
||||
{
|
||||
case "AUTO":
|
||||
return Encoding.Default;
|
||||
@@ -217,17 +217,17 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetEncodingName(Encoding Enc)
|
||||
public static string GetEncodingName(Encoding enc)
|
||||
{
|
||||
string Result = "UTF8";
|
||||
string result = "UTF8";
|
||||
|
||||
if (Enc.CodePage == 1250)
|
||||
Result = "CP1250";
|
||||
if (enc.CodePage == 1250)
|
||||
result = "CP1250";
|
||||
|
||||
if (Enc.CodePage == 1252)
|
||||
Result = "CP1252";
|
||||
if (enc.CodePage == 1252)
|
||||
result = "CP1252";
|
||||
|
||||
return Result;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
+65
-65
@@ -38,7 +38,7 @@ namespace VocaluxeLib.Menu
|
||||
private float _Z;
|
||||
private float _H;
|
||||
|
||||
private float _width;
|
||||
private float _Width;
|
||||
private ELyricStyle _Style;
|
||||
|
||||
private float _Alpha = 1f;
|
||||
@@ -83,9 +83,9 @@ namespace VocaluxeLib.Menu
|
||||
set { _Style = value; }
|
||||
}
|
||||
|
||||
public CLyric(int PartyModeID)
|
||||
public CLyric(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeLyrics();
|
||||
_ThemeLoaded = false;
|
||||
Color = new SColorF();
|
||||
@@ -96,16 +96,16 @@ namespace VocaluxeLib.Menu
|
||||
_Z = 0f;
|
||||
_MaxW = 1f;
|
||||
_H = 1f;
|
||||
_width = 1f;
|
||||
_Width = 1f;
|
||||
_Notes = new List<SNote>();
|
||||
_Text = new CText(_PartyModeID);
|
||||
|
||||
_Style = ELyricStyle.Fill;
|
||||
}
|
||||
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string item = XmlPath + "/" + ElementName;
|
||||
string item = xmlPath + "/" + elementName;
|
||||
_ThemeLoaded = true;
|
||||
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/X", ref _X);
|
||||
@@ -115,7 +115,7 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/H", ref _H);
|
||||
|
||||
if (xmlReader.GetValue(item + "/Color", ref _Theme.ColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, out Color);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, skinIndex, out Color);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/R", ref Color.R);
|
||||
@@ -125,7 +125,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
if (xmlReader.GetValue(item + "/SColor", ref _Theme.SelColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SelColorName, SkinIndex, out ColorProcessed);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SelColorName, skinIndex, out ColorProcessed);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SR", ref ColorProcessed.R);
|
||||
@@ -136,7 +136,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = ElementName;
|
||||
_Theme.Name = elementName;
|
||||
LoadTextures();
|
||||
_Text = new CText(_X, _Y, _Z, _H, _MaxW, EAlignment.Left, EStyle.Bold, "Normal", Color, String.Empty);
|
||||
}
|
||||
@@ -187,12 +187,12 @@ namespace VocaluxeLib.Menu
|
||||
return false;
|
||||
}
|
||||
|
||||
public void SetLine(CLine Line)
|
||||
public void SetLine(CLine line)
|
||||
{
|
||||
_Notes.Clear();
|
||||
|
||||
_width = 0f;
|
||||
foreach (CNote note in Line.Notes)
|
||||
_Width = 0f;
|
||||
foreach (CNote note in line.Notes)
|
||||
{
|
||||
SNote n = new SNote();
|
||||
|
||||
@@ -209,7 +209,7 @@ namespace VocaluxeLib.Menu
|
||||
_Text.Style = EStyle.BoldItalic;
|
||||
|
||||
RectangleF rect = CBase.Drawing.GetTextBounds(_Text);
|
||||
_width += rect.Width;
|
||||
_Width += rect.Width;
|
||||
_Notes.Add(n);
|
||||
}
|
||||
}
|
||||
@@ -221,38 +221,38 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public float GetCurrentLyricPosX()
|
||||
{
|
||||
return _X - _width / 2;
|
||||
return _X - _Width / 2;
|
||||
}
|
||||
|
||||
#region draw
|
||||
public void Draw(float ActualBeat)
|
||||
public void Draw(float actualBeat)
|
||||
{
|
||||
if (Visible || CBase.Settings.GetGameState() == EGameState.EditTheme)
|
||||
{
|
||||
switch (_Style)
|
||||
{
|
||||
case ELyricStyle.Fill:
|
||||
DrawFill(ActualBeat);
|
||||
_DrawFill(actualBeat);
|
||||
break;
|
||||
case ELyricStyle.Jump:
|
||||
DrawJump(ActualBeat);
|
||||
_DrawJump(actualBeat);
|
||||
break;
|
||||
case ELyricStyle.Slide:
|
||||
DrawSlide(ActualBeat);
|
||||
_DrawSlide(actualBeat);
|
||||
break;
|
||||
case ELyricStyle.Zoom:
|
||||
DrawZoom(ActualBeat);
|
||||
_DrawZoom(actualBeat);
|
||||
break;
|
||||
default:
|
||||
DrawSlide(ActualBeat);
|
||||
_DrawSlide(actualBeat);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawSlide(float CurrentBeat)
|
||||
private void _DrawSlide(float currentBeat)
|
||||
{
|
||||
float x = _X - _width / 2;
|
||||
float x = _X - _Width / 2;
|
||||
|
||||
foreach (SNote note in _Notes)
|
||||
{
|
||||
@@ -264,9 +264,9 @@ namespace VocaluxeLib.Menu
|
||||
if (note.Type == ENoteType.Freestyle)
|
||||
_Text.Style = EStyle.BoldItalic;
|
||||
|
||||
if (CurrentBeat >= note.StartBeat)
|
||||
if (currentBeat >= note.StartBeat)
|
||||
{
|
||||
if (CurrentBeat <= note.EndBeat)
|
||||
if (currentBeat <= note.EndBeat)
|
||||
{
|
||||
_Text.Color = ColorProcessed;
|
||||
|
||||
@@ -276,9 +276,9 @@ namespace VocaluxeLib.Menu
|
||||
_Text.Draw(0f, 1f);
|
||||
else
|
||||
{
|
||||
_Text.Draw(0f, (CurrentBeat - note.StartBeat) / diff);
|
||||
_Text.Draw(0f, (currentBeat - note.StartBeat) / diff);
|
||||
_Text.Color = Color;
|
||||
_Text.Draw((CurrentBeat - note.StartBeat) / diff, 1f);
|
||||
_Text.Draw((currentBeat - note.StartBeat) / diff, 1f);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -297,20 +297,20 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawZoom(float CurrentBeat)
|
||||
private void _DrawZoom(float currentBeat)
|
||||
{
|
||||
float x = _X - _width / 2; // most left position
|
||||
float x = _X - _Width / 2; // most left position
|
||||
|
||||
//find last active note
|
||||
int last_note = -1;
|
||||
int lastNote = -1;
|
||||
for (int i = 0; i < _Notes.Count; i++)
|
||||
{
|
||||
if (CurrentBeat >= _Notes[i].StartBeat)
|
||||
last_note = i;
|
||||
if (currentBeat >= _Notes[i].StartBeat)
|
||||
lastNote = i;
|
||||
}
|
||||
|
||||
int zoom_note = -1;
|
||||
int end_beat = -1;
|
||||
int zoomNote = -1;
|
||||
int endBeat = -1;
|
||||
float zoomx = 0f;
|
||||
|
||||
for (int note = 0; note < _Notes.Count; note++)
|
||||
@@ -323,23 +323,23 @@ namespace VocaluxeLib.Menu
|
||||
if (_Notes[note].Type == ENoteType.Freestyle)
|
||||
_Text.Style = EStyle.BoldItalic;
|
||||
|
||||
if (CurrentBeat >= _Notes[note].StartBeat)
|
||||
if (currentBeat >= _Notes[note].StartBeat)
|
||||
{
|
||||
bool last = note == _Notes.Count - 1;
|
||||
int endbeat = _Notes[note].EndBeat;
|
||||
if (note < _Notes.Count - 1)
|
||||
endbeat = _Notes[note + 1].StartBeat - 1;
|
||||
|
||||
if (CurrentBeat <= endbeat)
|
||||
if (currentBeat <= endbeat)
|
||||
{
|
||||
zoom_note = note;
|
||||
end_beat = endbeat;
|
||||
zoomNote = note;
|
||||
endBeat = endbeat;
|
||||
zoomx = _Text.X;
|
||||
}
|
||||
else
|
||||
{
|
||||
// already passed
|
||||
if (note == last_note)
|
||||
if (note == lastNote)
|
||||
_Text.Color = ColorProcessed;
|
||||
else
|
||||
_Text.Color = Color;
|
||||
@@ -357,26 +357,26 @@ namespace VocaluxeLib.Menu
|
||||
x += rect.Width;
|
||||
}
|
||||
|
||||
if (zoom_note > -1)
|
||||
if (zoomNote > -1)
|
||||
{
|
||||
if (_Notes[zoom_note].Duration == 0)
|
||||
if (_Notes[zoomNote].Duration == 0)
|
||||
return;
|
||||
|
||||
_Text.X = zoomx;
|
||||
_Text.Text = _Notes[zoom_note].Text;
|
||||
_Text.Text = _Notes[zoomNote].Text;
|
||||
_Text.Color = ColorProcessed;
|
||||
_Text.Style = EStyle.Bold;
|
||||
|
||||
if (_Notes[zoom_note].Type == ENoteType.Freestyle)
|
||||
if (_Notes[zoomNote].Type == ENoteType.Freestyle)
|
||||
_Text.Style = EStyle.BoldItalic;
|
||||
|
||||
RectangleF rect = CBase.Drawing.GetTextBounds(_Text);
|
||||
|
||||
float diff = end_beat - _Notes[zoom_note].StartBeat;
|
||||
float diff = endBeat - _Notes[zoomNote].StartBeat;
|
||||
if (diff <= 0f)
|
||||
diff = 1f;
|
||||
|
||||
float p = (CurrentBeat - _Notes[zoom_note].StartBeat) / diff;
|
||||
float p = (currentBeat - _Notes[zoomNote].StartBeat) / diff;
|
||||
if (p > 1f)
|
||||
p = 1f;
|
||||
|
||||
@@ -402,9 +402,9 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawFill(float CurrentBeat)
|
||||
private void _DrawFill(float currentBeat)
|
||||
{
|
||||
float x = _X - _width / 2; // most left position
|
||||
float x = _X - _Width / 2; // most left position
|
||||
|
||||
foreach (SNote note in _Notes)
|
||||
{
|
||||
@@ -416,7 +416,7 @@ namespace VocaluxeLib.Menu
|
||||
if (note.Type == ENoteType.Freestyle)
|
||||
_Text.Style = EStyle.BoldItalic;
|
||||
|
||||
if (CurrentBeat >= note.StartBeat)
|
||||
if (currentBeat >= note.StartBeat)
|
||||
{
|
||||
_Text.Color = ColorProcessed;
|
||||
_Text.Draw();
|
||||
@@ -432,20 +432,20 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawJump(float CurrentBeat)
|
||||
private void _DrawJump(float currentBeat)
|
||||
{
|
||||
float x = _X - _width / 2; // most left position
|
||||
float x = _X - _Width / 2; // most left position
|
||||
|
||||
//find last active note
|
||||
int last_note = -1;
|
||||
int lastNote = -1;
|
||||
for (int i = 0; i < _Notes.Count; i++)
|
||||
{
|
||||
if (CurrentBeat >= _Notes[i].StartBeat)
|
||||
last_note = i;
|
||||
if (currentBeat >= _Notes[i].StartBeat)
|
||||
lastNote = i;
|
||||
}
|
||||
|
||||
int jump_note = -1;
|
||||
int end_beat = -1;
|
||||
int jumpNote = -1;
|
||||
int endBeat = -1;
|
||||
float jumpx = 0f;
|
||||
|
||||
for (int note = 0; note < _Notes.Count; note++)
|
||||
@@ -458,23 +458,23 @@ namespace VocaluxeLib.Menu
|
||||
if (_Notes[note].Type == ENoteType.Freestyle)
|
||||
_Text.Style = EStyle.BoldItalic;
|
||||
|
||||
if (CurrentBeat >= _Notes[note].StartBeat)
|
||||
if (currentBeat >= _Notes[note].StartBeat)
|
||||
{
|
||||
bool last = note == _Notes.Count - 1;
|
||||
int endbeat = _Notes[note].EndBeat;
|
||||
if (note < _Notes.Count - 1)
|
||||
endbeat = _Notes[note + 1].StartBeat - 1;
|
||||
|
||||
if (CurrentBeat <= _Notes[note].EndBeat)
|
||||
if (currentBeat <= _Notes[note].EndBeat)
|
||||
{
|
||||
jump_note = note;
|
||||
end_beat = endbeat;
|
||||
jumpNote = note;
|
||||
endBeat = endbeat;
|
||||
jumpx = _Text.X;
|
||||
}
|
||||
else
|
||||
{
|
||||
// already passed
|
||||
if (note == last_note)
|
||||
if (note == lastNote)
|
||||
_Text.Color = ColorProcessed;
|
||||
else
|
||||
_Text.Color = Color;
|
||||
@@ -492,24 +492,24 @@ namespace VocaluxeLib.Menu
|
||||
x += rect.Width;
|
||||
}
|
||||
|
||||
if (jump_note > -1)
|
||||
if (jumpNote > -1)
|
||||
{
|
||||
if (_Notes[jump_note].Duration == 0)
|
||||
if (_Notes[jumpNote].Duration == 0)
|
||||
return;
|
||||
|
||||
_Text.X = jumpx;
|
||||
_Text.Text = _Notes[jump_note].Text;
|
||||
_Text.Text = _Notes[jumpNote].Text;
|
||||
_Text.Color = ColorProcessed;
|
||||
_Text.Style = EStyle.Bold;
|
||||
|
||||
if (_Notes[jump_note].Type == ENoteType.Freestyle)
|
||||
if (_Notes[jumpNote].Type == ENoteType.Freestyle)
|
||||
_Text.Style = EStyle.BoldItalic;
|
||||
|
||||
float diff = _Notes[jump_note].EndBeat - _Notes[jump_note].StartBeat;
|
||||
float diff = _Notes[jumpNote].EndBeat - _Notes[jumpNote].StartBeat;
|
||||
if (diff <= 0f)
|
||||
diff = 1f;
|
||||
|
||||
float p = (CurrentBeat - _Notes[jump_note].StartBeat) / diff;
|
||||
float p = (currentBeat - _Notes[jumpNote].StartBeat) / diff;
|
||||
if (p > 1f)
|
||||
p = 1f;
|
||||
|
||||
|
||||
+142
-142
@@ -10,10 +10,10 @@ using VocaluxeLib.Menu.SongMenu;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
struct ZSort
|
||||
struct SZSort
|
||||
{
|
||||
public int ID;
|
||||
public float z;
|
||||
public float Z;
|
||||
}
|
||||
|
||||
public abstract class CMenu : IMenu
|
||||
@@ -124,60 +124,60 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeScreenSettings = null;
|
||||
}
|
||||
|
||||
protected void FadeTo(EScreens NextScreen)
|
||||
protected void _FadeTo(EScreens nextScreen)
|
||||
{
|
||||
CBase.Graphics.FadeTo(NextScreen);
|
||||
CBase.Graphics.FadeTo(nextScreen);
|
||||
}
|
||||
|
||||
#region ThemeHandler
|
||||
protected delegate void AddElementHandler<T>(T Element, String key);
|
||||
protected delegate void AddElementHandler<T>(T element, String key);
|
||||
|
||||
private void LoadThemeElement<T>(string[] Elements, AddElementHandler<T> AddElementHandler, CXMLReader xmlReader, int SkinIndex) where T : IMenuElement
|
||||
private void _LoadThemeElement<T>(string[] elements, AddElementHandler<T> addElementHandler, CXMLReader xmlReader, int skinIndex) where T : IMenuElement
|
||||
{
|
||||
if (Elements != null)
|
||||
if (elements != null)
|
||||
{
|
||||
foreach (string elName in Elements)
|
||||
foreach (string elName in elements)
|
||||
{
|
||||
T Element = (T)Activator.CreateInstance(typeof(T), _PartyModeID);
|
||||
if (Element.LoadTheme("//root/" + ThemeName, elName, xmlReader, SkinIndex))
|
||||
AddElementHandler(Element, elName);
|
||||
T element = (T)Activator.CreateInstance(typeof(T), _PartyModeID);
|
||||
if (element.LoadTheme("//root/" + ThemeName, elName, xmlReader, skinIndex))
|
||||
addElementHandler(element, elName);
|
||||
else
|
||||
CBase.Log.LogError("Can't load " + typeof(T).Name.Substring(1) + " \"" + elName + "\" in screen " + ThemeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void LoadTheme(string XmlPath)
|
||||
public virtual void LoadTheme(string xmlPath)
|
||||
{
|
||||
string file = Path.Combine(XmlPath, ThemeName + ".xml");
|
||||
string file = Path.Combine(xmlPath, ThemeName + ".xml");
|
||||
|
||||
CXMLReader xmlReader = CXMLReader.OpenFile(file);
|
||||
if (xmlReader == null)
|
||||
return;
|
||||
|
||||
bool VersionCheck = false;
|
||||
VersionCheck = CheckVersion(_ScreenVersion, xmlReader);
|
||||
bool versionCheck = false;
|
||||
versionCheck = _CheckVersion(_ScreenVersion, xmlReader);
|
||||
|
||||
int SkinIndex = CBase.Theme.GetSkinIndex(_PartyModeID);
|
||||
int skinIndex = CBase.Theme.GetSkinIndex(_PartyModeID);
|
||||
|
||||
if (VersionCheck && SkinIndex != -1)
|
||||
if (versionCheck && skinIndex != -1)
|
||||
{
|
||||
_ThemePath = XmlPath;
|
||||
LoadThemeBasics(xmlReader, SkinIndex);
|
||||
_ThemePath = xmlPath;
|
||||
_LoadThemeBasics(xmlReader, skinIndex);
|
||||
|
||||
LoadThemeElement<CBackground>(_ThemeBackgrounds, AddBackground, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CStatic>(_ThemeStatics, AddStatic, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CText>(_ThemeTexts, AddText, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CButton>(_ThemeButtons, AddButton, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CSelectSlide>(_ThemeSelectSlides, AddSelectSlide, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CSongMenu>(_ThemeSongMenus, AddSongMenu, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CLyric>(_ThemeLyrics, AddLyric, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CSingNotesClassic>(_ThemeSingNotes, AddSingNote, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CNameSelection>(_ThemeNameSelections, AddNameSelection, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CEqualizer>(_ThemeEqualizers, AddEqualizer, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CPlaylist>(_ThemePlaylists, AddPlaylist, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CParticleEffect>(_ThemeParticleEffects, AddParticleEffect, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CScreenSetting>(_ThemeScreenSettings, AddScreenSetting, xmlReader, SkinIndex);
|
||||
_LoadThemeElement<CBackground>(_ThemeBackgrounds, AddBackground, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CStatic>(_ThemeStatics, AddStatic, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CText>(_ThemeTexts, AddText, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CButton>(_ThemeButtons, AddButton, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CSelectSlide>(_ThemeSelectSlides, AddSelectSlide, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CSongMenu>(_ThemeSongMenus, AddSongMenu, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CLyric>(_ThemeLyrics, AddLyric, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CSingNotesClassic>(_ThemeSingNotes, AddSingNote, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CNameSelection>(_ThemeNameSelections, AddNameSelection, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CEqualizer>(_ThemeEqualizers, AddEqualizer, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CPlaylist>(_ThemePlaylists, AddPlaylist, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CParticleEffect>(_ThemeParticleEffects, AddParticleEffect, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CScreenSetting>(_ThemeScreenSettings, AddScreenSetting, xmlReader, skinIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,14 +347,14 @@ namespace VocaluxeLib.Menu
|
||||
se.UnloadTextures();
|
||||
}
|
||||
|
||||
public virtual void ReloadTheme(string XmlPath)
|
||||
public virtual void ReloadTheme(string xmlPath)
|
||||
{
|
||||
if (_ThemePath.Length == 0)
|
||||
return;
|
||||
|
||||
UnloadTextures();
|
||||
Init();
|
||||
LoadTheme(XmlPath);
|
||||
LoadTheme(xmlPath);
|
||||
}
|
||||
#endregion ThemeHandler
|
||||
|
||||
@@ -468,9 +468,9 @@ namespace VocaluxeLib.Menu
|
||||
return new CStatic(oldStatic);
|
||||
}
|
||||
|
||||
public CStatic GetNewStatic(STexture Texture, SColorF Color, SRectF Rect)
|
||||
public CStatic GetNewStatic(STexture texture, SColorF color, SRectF rect)
|
||||
{
|
||||
return new CStatic(_PartyModeID, Texture, Color, Rect);
|
||||
return new CStatic(_PartyModeID, texture, color, rect);
|
||||
}
|
||||
|
||||
public CSelectSlide GetNewSelectSlide()
|
||||
@@ -513,9 +513,9 @@ namespace VocaluxeLib.Menu
|
||||
return new CPlaylist(_PartyModeID);
|
||||
}
|
||||
|
||||
public CParticleEffect GetNewParticleEffect(int MaxNumber, SColorF Color, SRectF Area, STexture Texture, float Size, EParticleType Type)
|
||||
public CParticleEffect GetNewParticleEffect(int maxNumber, SColorF color, SRectF area, STexture texture, float size, EParticleType type)
|
||||
{
|
||||
return new CParticleEffect(_PartyModeID, MaxNumber, Color, Area, Texture, Size, Type);
|
||||
return new CParticleEffect(_PartyModeID, maxNumber, color, area, texture, size, type);
|
||||
}
|
||||
#endregion Create Elements
|
||||
|
||||
@@ -589,7 +589,7 @@ namespace VocaluxeLib.Menu
|
||||
#endregion ElementHandler
|
||||
|
||||
#region MenuHandler
|
||||
public virtual bool HandleInput(KeyEvent keyEvent)
|
||||
public virtual bool HandleInput(SKeyEvent keyEvent)
|
||||
{
|
||||
if (!CBase.Settings.IsTabNavigation())
|
||||
{
|
||||
@@ -632,7 +632,7 @@ namespace VocaluxeLib.Menu
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool HandleMouse(MouseEvent mouseEvent)
|
||||
public virtual bool HandleMouse(SMouseEvent mouseEvent)
|
||||
{
|
||||
int selection = _Selection;
|
||||
ProcessMouseMove(mouseEvent.X, mouseEvent.Y);
|
||||
@@ -651,56 +651,56 @@ namespace VocaluxeLib.Menu
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool HandleInputThemeEditor(KeyEvent KeyEvent)
|
||||
public virtual bool HandleInputThemeEditor(SKeyEvent keyEvent)
|
||||
{
|
||||
_UnsetHighlighted(_Selection);
|
||||
if (!KeyEvent.KeyPressed)
|
||||
if (!keyEvent.KeyPressed)
|
||||
{
|
||||
switch (KeyEvent.Key)
|
||||
switch (keyEvent.Key)
|
||||
{
|
||||
case Keys.S:
|
||||
CBase.Graphics.SaveTheme();
|
||||
break;
|
||||
|
||||
case Keys.R:
|
||||
ReloadThemeEditMode();
|
||||
_ReloadThemeEditMode();
|
||||
break;
|
||||
|
||||
case Keys.Up:
|
||||
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(0, -1);
|
||||
if (keyEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(0, -1);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(0, 1);
|
||||
if (keyEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(0, 1);
|
||||
|
||||
break;
|
||||
case Keys.Down:
|
||||
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(0, 1);
|
||||
if (keyEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(0, 1);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(0, -1);
|
||||
if (keyEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(0, -1);
|
||||
|
||||
break;
|
||||
|
||||
case Keys.Right:
|
||||
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(1, 0);
|
||||
if (keyEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(1, 0);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(1, 0);
|
||||
if (keyEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(1, 0);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.None)
|
||||
if (keyEvent.Mod == EModifier.None)
|
||||
NextInteraction();
|
||||
break;
|
||||
case Keys.Left:
|
||||
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(-1, 0);
|
||||
if (keyEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(-1, 0);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(-1, 0);
|
||||
if (keyEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(-1, 0);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.None)
|
||||
if (keyEvent.Mod == EModifier.None)
|
||||
PrevInteraction();
|
||||
break;
|
||||
}
|
||||
@@ -708,64 +708,64 @@ namespace VocaluxeLib.Menu
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool HandleMouseThemeEditor(MouseEvent MouseEvent)
|
||||
public virtual bool HandleMouseThemeEditor(SMouseEvent mouseEvent)
|
||||
{
|
||||
_UnsetHighlighted(_Selection);
|
||||
_MouseDX = MouseEvent.X - _PrevMouseX;
|
||||
_MouseDY = MouseEvent.Y - _PrevMouseY;
|
||||
_MouseDX = mouseEvent.X - _PrevMouseX;
|
||||
_MouseDY = mouseEvent.Y - _PrevMouseY;
|
||||
|
||||
int stepX = 0;
|
||||
int stepY = 0;
|
||||
|
||||
if ((MouseEvent.Mod & EModifier.Ctrl) == EModifier.Ctrl)
|
||||
if ((mouseEvent.Mod & EModifier.Ctrl) == EModifier.Ctrl)
|
||||
{
|
||||
_PrevMouseX = MouseEvent.X;
|
||||
_PrevMouseY = MouseEvent.Y;
|
||||
_PrevMouseX = mouseEvent.X;
|
||||
_PrevMouseY = mouseEvent.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (Math.Abs(MouseEvent.X - _PrevMouseX) >= 5)
|
||||
while (Math.Abs(mouseEvent.X - _PrevMouseX) >= 5)
|
||||
{
|
||||
if (MouseEvent.X - _PrevMouseX >= 5)
|
||||
if (mouseEvent.X - _PrevMouseX >= 5)
|
||||
stepX += 5;
|
||||
|
||||
if (MouseEvent.X - _PrevMouseX <= -5)
|
||||
if (mouseEvent.X - _PrevMouseX <= -5)
|
||||
stepX -= 5;
|
||||
|
||||
_PrevMouseX = MouseEvent.X - (_MouseDX - stepX);
|
||||
_PrevMouseX = mouseEvent.X - (_MouseDX - stepX);
|
||||
}
|
||||
|
||||
while (Math.Abs(MouseEvent.Y - _PrevMouseY) >= 5)
|
||||
while (Math.Abs(mouseEvent.Y - _PrevMouseY) >= 5)
|
||||
{
|
||||
if (MouseEvent.Y - _PrevMouseY >= 5)
|
||||
if (mouseEvent.Y - _PrevMouseY >= 5)
|
||||
stepY += 5;
|
||||
|
||||
if (MouseEvent.Y - _PrevMouseY <= -5)
|
||||
if (mouseEvent.Y - _PrevMouseY <= -5)
|
||||
stepY -= 5;
|
||||
|
||||
_PrevMouseY = MouseEvent.Y - (_MouseDY - stepY);
|
||||
_PrevMouseY = mouseEvent.Y - (_MouseDY - stepY);
|
||||
}
|
||||
}
|
||||
|
||||
if (MouseEvent.LBH)
|
||||
if (mouseEvent.LBH)
|
||||
{
|
||||
//if (IsMouseOver(MouseEvent.X, _PrevMouseY))
|
||||
//{
|
||||
if (MouseEvent.Mod == EModifier.None)
|
||||
MoveElement(stepX, stepY);
|
||||
if (mouseEvent.Mod == EModifier.None)
|
||||
_MoveElement(stepX, stepY);
|
||||
|
||||
if (MouseEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(_MouseDX, _MouseDY);
|
||||
if (mouseEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(_MouseDX, _MouseDY);
|
||||
|
||||
if (MouseEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(stepX, stepY);
|
||||
if (mouseEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(stepX, stepY);
|
||||
|
||||
if (MouseEvent.Mod == (EModifier.Shift | EModifier.Ctrl))
|
||||
ResizeElement(_MouseDX, _MouseDY);
|
||||
if (mouseEvent.Mod == (EModifier.Shift | EModifier.Ctrl))
|
||||
_ResizeElement(_MouseDX, _MouseDY);
|
||||
//}
|
||||
}
|
||||
else
|
||||
ProcessMouseMove(MouseEvent.X, MouseEvent.Y);
|
||||
ProcessMouseMove(mouseEvent.X, mouseEvent.Y);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -776,29 +776,29 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public virtual void OnShow()
|
||||
{
|
||||
ResumeBG();
|
||||
_ResumeBG();
|
||||
}
|
||||
|
||||
public virtual void OnShowFinish()
|
||||
{
|
||||
ResumeBG();
|
||||
_ResumeBG();
|
||||
_Active = true;
|
||||
}
|
||||
|
||||
public virtual void OnClose()
|
||||
{
|
||||
PauseBG();
|
||||
_PauseBG();
|
||||
_Active = false;
|
||||
}
|
||||
#endregion MenuHandler
|
||||
|
||||
protected void ResumeBG()
|
||||
protected void _ResumeBG()
|
||||
{
|
||||
foreach (CBackground bg in _Backgrounds)
|
||||
bg.Resume();
|
||||
}
|
||||
|
||||
protected void PauseBG()
|
||||
protected void _PauseBG()
|
||||
{
|
||||
foreach (CBackground bg in _Backgrounds)
|
||||
bg.Pause();
|
||||
@@ -823,7 +823,7 @@ namespace VocaluxeLib.Menu
|
||||
if (_Interactions.Count <= 0)
|
||||
return;
|
||||
|
||||
List<ZSort> items = new List<ZSort>();
|
||||
List<SZSort> items = new List<SZSort>();
|
||||
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
@@ -838,9 +838,9 @@ namespace VocaluxeLib.Menu
|
||||
_Interactions[i].Type == EType.Playlist ||
|
||||
_Interactions[i].Type == EType.ParticleEffect))
|
||||
{
|
||||
ZSort zs = new ZSort();
|
||||
SZSort zs = new SZSort();
|
||||
zs.ID = i;
|
||||
zs.z = _GetZValue(i);
|
||||
zs.Z = _GetZValue(i);
|
||||
items.Add(zs);
|
||||
}
|
||||
}
|
||||
@@ -849,7 +849,7 @@ namespace VocaluxeLib.Menu
|
||||
return;
|
||||
|
||||
|
||||
items.Sort(delegate(ZSort s1, ZSort s2) { return s2.z.CompareTo(s1.z); });
|
||||
items.Sort(delegate(SZSort s1, SZSort s2) { return s2.Z.CompareTo(s1.Z); });
|
||||
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
_DrawInteraction(items[i].ID);
|
||||
@@ -1116,9 +1116,9 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsMouseOver(MouseEvent MouseEvent)
|
||||
public bool IsMouseOver(SMouseEvent mouseEvent)
|
||||
{
|
||||
return IsMouseOver(MouseEvent.X, MouseEvent.Y);
|
||||
return IsMouseOver(mouseEvent.X, mouseEvent.Y);
|
||||
}
|
||||
|
||||
public bool IsMouseOver(int x, int y)
|
||||
@@ -1273,25 +1273,25 @@ namespace VocaluxeLib.Menu
|
||||
/// <summary>
|
||||
/// Selects the next best interaction in a menu.
|
||||
/// </summary>
|
||||
/// <param name="Key"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
private bool _NextInteraction(KeyEvent Key)
|
||||
private bool _NextInteraction(SKeyEvent key)
|
||||
{
|
||||
KeyEvent[] Directions = new KeyEvent[4];
|
||||
float[] Distances = new float[4];
|
||||
SKeyEvent[] directions = new SKeyEvent[4];
|
||||
float[] distances = new float[4];
|
||||
int[] stages = new int[4];
|
||||
int[] elements = new int[4];
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
Directions[i] = new KeyEvent();
|
||||
directions[i] = new SKeyEvent();
|
||||
|
||||
Directions[0].Key = Keys.Up;
|
||||
Directions[1].Key = Keys.Right;
|
||||
Directions[2].Key = Keys.Down;
|
||||
Directions[3].Key = Keys.Left;
|
||||
directions[0].Key = Keys.Up;
|
||||
directions[1].Key = Keys.Right;
|
||||
directions[2].Key = Keys.Down;
|
||||
directions[3].Key = Keys.Left;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
elements[i] = _GetNextElement(Directions[i], out Distances[i], out stages[i]);
|
||||
elements[i] = _GetNextElement(directions[i], out distances[i], out stages[i]);
|
||||
|
||||
int element = _Selection;
|
||||
int stage = int.MaxValue;
|
||||
@@ -1299,7 +1299,7 @@ namespace VocaluxeLib.Menu
|
||||
int direction = -1;
|
||||
|
||||
int mute = -1;
|
||||
switch (Key.Key)
|
||||
switch (key.Key)
|
||||
{
|
||||
case Keys.Up:
|
||||
mute = 2;
|
||||
@@ -1317,11 +1317,11 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (i != mute && elements[i] != _Selection && (stages[i] <= stage && Directions[i].Key == Key.Key))
|
||||
if (i != mute && elements[i] != _Selection && (stages[i] <= stage && directions[i].Key == key.Key))
|
||||
{
|
||||
stage = stages[i];
|
||||
element = elements[i];
|
||||
distance = Distances[i];
|
||||
distance = distances[i];
|
||||
direction = i;
|
||||
}
|
||||
}
|
||||
@@ -1329,7 +1329,7 @@ namespace VocaluxeLib.Menu
|
||||
if (direction != -1)
|
||||
{
|
||||
// select the new element
|
||||
if (Directions[direction].Key == Key.Key)
|
||||
if (directions[direction].Key == key.Key)
|
||||
{
|
||||
_UnsetHighlighted(_Selection);
|
||||
_UnsetSelected();
|
||||
@@ -1344,24 +1344,24 @@ namespace VocaluxeLib.Menu
|
||||
return false;
|
||||
}
|
||||
|
||||
private int _GetNextElement(KeyEvent Key, out float Distance, out int Stage)
|
||||
private int _GetNextElement(SKeyEvent key, out float distance, out int stage)
|
||||
{
|
||||
Distance = float.MaxValue;
|
||||
distance = float.MaxValue;
|
||||
int min = _Selection;
|
||||
SRectF actualRect = _GetRect(_Selection);
|
||||
Stage = int.MaxValue;
|
||||
stage = int.MaxValue;
|
||||
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistanceDirect(Key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < Distance)
|
||||
float dist = _GetDistanceDirect(key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < distance)
|
||||
{
|
||||
Distance = dist;
|
||||
distance = dist;
|
||||
min = i;
|
||||
Stage = 10;
|
||||
stage = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1373,12 +1373,12 @@ namespace VocaluxeLib.Menu
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistance180(Key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < Distance)
|
||||
float dist = _GetDistance180(key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < distance)
|
||||
{
|
||||
Distance = dist;
|
||||
distance = dist;
|
||||
min = i;
|
||||
Stage = 20;
|
||||
stage = 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1386,7 +1386,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (min == _Selection)
|
||||
{
|
||||
switch (Key.Key)
|
||||
switch (key.Key)
|
||||
{
|
||||
case Keys.Up:
|
||||
actualRect = new SRectF(actualRect.X, CBase.Settings.GetRenderH(), 1, 1, actualRect.Z);
|
||||
@@ -1407,12 +1407,12 @@ namespace VocaluxeLib.Menu
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistance180(Key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < Distance)
|
||||
float dist = _GetDistance180(key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < distance)
|
||||
{
|
||||
Distance = dist;
|
||||
distance = dist;
|
||||
min = i;
|
||||
Stage = 30;
|
||||
stage = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1420,7 +1420,7 @@ namespace VocaluxeLib.Menu
|
||||
return min;
|
||||
}
|
||||
|
||||
private float _GetDistanceDirect(KeyEvent Key, SRectF actualRect, SRectF targetRect)
|
||||
private float _GetDistanceDirect(SKeyEvent key, SRectF actualRect, SRectF targetRect)
|
||||
{
|
||||
PointF source = new PointF(actualRect.X + actualRect.W / 2f, actualRect.Y + actualRect.H / 2f);
|
||||
PointF dest = new PointF(targetRect.X + targetRect.W / 2f, targetRect.Y + targetRect.H / 2f);
|
||||
@@ -1428,7 +1428,7 @@ namespace VocaluxeLib.Menu
|
||||
PointF vector = new PointF(dest.X - source.X, dest.Y - source.Y);
|
||||
float distance = (float)Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y);
|
||||
bool inDirection = false;
|
||||
switch (Key.Key)
|
||||
switch (key.Key)
|
||||
{
|
||||
case Keys.Up:
|
||||
if (vector.Y < 0f && (targetRect.X + targetRect.W > actualRect.X && actualRect.X + actualRect.W > targetRect.X))
|
||||
@@ -1456,7 +1456,7 @@ namespace VocaluxeLib.Menu
|
||||
return distance;
|
||||
}
|
||||
|
||||
private float _GetDistance180(KeyEvent Key, SRectF actualRect, SRectF targetRect)
|
||||
private float _GetDistance180(SKeyEvent key, SRectF actualRect, SRectF targetRect)
|
||||
{
|
||||
PointF source = new PointF(actualRect.X + actualRect.W / 2f, actualRect.Y + actualRect.H / 2f);
|
||||
PointF dest = new PointF(targetRect.X + targetRect.W / 2f, targetRect.Y + targetRect.H / 2f);
|
||||
@@ -1464,7 +1464,7 @@ namespace VocaluxeLib.Menu
|
||||
PointF vector = new PointF(dest.X - source.X, dest.Y - source.Y);
|
||||
float distance = (float)Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y);
|
||||
bool inDirection = false;
|
||||
switch (Key.Key)
|
||||
switch (key.Key)
|
||||
{
|
||||
case Keys.Up:
|
||||
if (vector.Y < 0f)
|
||||
@@ -1764,7 +1764,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private SRectF _GetRect(int interaction)
|
||||
{
|
||||
SRectF Result = new SRectF();
|
||||
SRectF result = new SRectF();
|
||||
switch (_Interactions[interaction].Type)
|
||||
{
|
||||
case EType.Button:
|
||||
@@ -1798,7 +1798,7 @@ namespace VocaluxeLib.Menu
|
||||
return _ParticleEffects[_Interactions[interaction].Num].Rect;
|
||||
}
|
||||
|
||||
return Result;
|
||||
return result;
|
||||
}
|
||||
|
||||
private void _AddInteraction(int num, EType type)
|
||||
@@ -1864,7 +1864,7 @@ namespace VocaluxeLib.Menu
|
||||
#endregion InteractionHandling
|
||||
|
||||
#region Theme Handling
|
||||
private void MoveElement(int stepX, int stepY)
|
||||
private void _MoveElement(int stepX, int stepY)
|
||||
{
|
||||
if (_Interactions.Count > 0)
|
||||
{
|
||||
@@ -1913,7 +1913,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private void ResizeElement(int stepW, int stepH)
|
||||
private void _ResizeElement(int stepW, int stepH)
|
||||
{
|
||||
if (_Interactions.Count > 0)
|
||||
{
|
||||
@@ -1962,7 +1962,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckVersion(int reqVersion, CXMLReader xmlReader)
|
||||
private bool _CheckVersion(int reqVersion, CXMLReader xmlReader)
|
||||
{
|
||||
int actualVersion = 0;
|
||||
xmlReader.TryGetIntValue("//root/" + ThemeName + "/ScreenVersion", ref actualVersion);
|
||||
@@ -1983,14 +1983,14 @@ namespace VocaluxeLib.Menu
|
||||
return false;
|
||||
}
|
||||
|
||||
private void LoadThemeBasics(CXMLReader xmlReader, int SkinIndex)
|
||||
private void _LoadThemeBasics(CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string value = String.Empty;
|
||||
|
||||
// Backgrounds
|
||||
CBackground background = new CBackground(_PartyModeID);
|
||||
int i = 1;
|
||||
while (background.LoadTheme("//root/" + ThemeName, "Background" + i.ToString(), xmlReader, SkinIndex))
|
||||
while (background.LoadTheme("//root/" + ThemeName, "Background" + i.ToString(), xmlReader, skinIndex))
|
||||
{
|
||||
AddBackground(background);
|
||||
background = new CBackground(_PartyModeID);
|
||||
@@ -2000,7 +2000,7 @@ namespace VocaluxeLib.Menu
|
||||
// Statics
|
||||
CStatic stat = new CStatic(_PartyModeID);
|
||||
i = 1;
|
||||
while (stat.LoadTheme("//root/" + ThemeName, "Static" + i.ToString(), xmlReader, SkinIndex))
|
||||
while (stat.LoadTheme("//root/" + ThemeName, "Static" + i.ToString(), xmlReader, skinIndex))
|
||||
{
|
||||
AddStatic(stat);
|
||||
stat = new CStatic(_PartyModeID);
|
||||
@@ -2010,7 +2010,7 @@ namespace VocaluxeLib.Menu
|
||||
// Texts
|
||||
CText text = new CText(_PartyModeID);
|
||||
i = 1;
|
||||
while (text.LoadTheme("//root/" + ThemeName, "Text" + i.ToString(), xmlReader, SkinIndex))
|
||||
while (text.LoadTheme("//root/" + ThemeName, "Text" + i.ToString(), xmlReader, skinIndex))
|
||||
{
|
||||
AddText(text);
|
||||
text = new CText(_PartyModeID);
|
||||
@@ -2020,7 +2020,7 @@ namespace VocaluxeLib.Menu
|
||||
// ParticleEffects
|
||||
CParticleEffect partef = new CParticleEffect(_PartyModeID);
|
||||
i = 1;
|
||||
while (partef.LoadTheme("//root/" + ThemeName, "ParticleEffect" + i.ToString(), xmlReader, SkinIndex))
|
||||
while (partef.LoadTheme("//root/" + ThemeName, "ParticleEffect" + i.ToString(), xmlReader, skinIndex))
|
||||
{
|
||||
AddParticleEffect(partef);
|
||||
partef = new CParticleEffect(_PartyModeID);
|
||||
@@ -2028,7 +2028,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private void ReloadThemeEditMode()
|
||||
private void _ReloadThemeEditMode()
|
||||
{
|
||||
CBase.Theme.UnloadSkins();
|
||||
CBase.Theme.ListSkins();
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace VocaluxeLib.Menu
|
||||
_PartyMode = new CPartyModeNone();
|
||||
}
|
||||
|
||||
public void SetPartyModeID(int PartyModeID)
|
||||
public void SetPartyModeID(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
}
|
||||
|
||||
public int GetPartyModeID()
|
||||
@@ -22,12 +22,12 @@ namespace VocaluxeLib.Menu
|
||||
return _PartyModeID;
|
||||
}
|
||||
|
||||
public void AssingPartyMode(IPartyMode PartyMode)
|
||||
public void AssingPartyMode(IPartyMode partyMode)
|
||||
{
|
||||
_PartyMode = PartyMode;
|
||||
_PartyMode = partyMode;
|
||||
}
|
||||
|
||||
public virtual void DataToScreen(Object Data) {}
|
||||
public virtual void DataToScreen(Object data) {}
|
||||
|
||||
/*
|
||||
public sealed override void LoadTheme()
|
||||
|
||||
@@ -66,42 +66,42 @@ namespace VocaluxeLib.Menu
|
||||
private int _TileW;
|
||||
private int _TileH;
|
||||
|
||||
public int _Offset = 0;
|
||||
private int _actualSelection = -1;
|
||||
public int Offset = 0;
|
||||
private int _ActualSelection = -1;
|
||||
public int Selection = -1;
|
||||
|
||||
private int _player = -1;
|
||||
private int _Player = -1;
|
||||
|
||||
private readonly List<int> VisibleProfiles;
|
||||
private readonly List<int> _VisibleProfiles;
|
||||
|
||||
private CStatic PlayerSelector;
|
||||
private CStatic _PlayerSelector;
|
||||
|
||||
public CNameSelection(int PartyModeID)
|
||||
public CNameSelection(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeNameSelection();
|
||||
|
||||
_Tiles = new List<CTile>();
|
||||
VisibleProfiles = new List<int>();
|
||||
_VisibleProfiles = new List<int>();
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
PrepareTiles();
|
||||
_PrepareTiles();
|
||||
|
||||
PlayerSelector = new CStatic(_PartyModeID);
|
||||
PlayerSelector.Texture = _TextureTileSelected;
|
||||
PlayerSelector.Rect = new SRectF(0, 0, _TileW + 6, _TileH + 6, Rect.Z - 0.5f);
|
||||
PlayerSelector.Visible = false;
|
||||
_PlayerSelector = new CStatic(_PartyModeID);
|
||||
_PlayerSelector.Texture = _TextureTileSelected;
|
||||
_PlayerSelector.Rect = new SRectF(0, 0, _TileW + 6, _TileH + 6, Rect.Z - 0.5f);
|
||||
_PlayerSelector.Visible = false;
|
||||
|
||||
UpdateVisibleProfiles();
|
||||
_UpdateVisibleProfiles();
|
||||
|
||||
UpdateList(0);
|
||||
}
|
||||
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string item = XmlPath + "/" + ElementName;
|
||||
string item = xmlPath + "/" + elementName;
|
||||
_ThemeLoaded = true;
|
||||
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/X", ref Rect.X);
|
||||
@@ -113,7 +113,7 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/SkinEmptyTile", ref _Theme.TextureEmptyTileName, String.Empty);
|
||||
|
||||
if (xmlReader.GetValue(item + "/ColorEmptyTile", ref _Theme.ColorEmptyTileName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorEmptyTileName, SkinIndex, out ColorEmptyTile);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorEmptyTileName, skinIndex, out ColorEmptyTile);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/R", ref ColorEmptyTile.R);
|
||||
@@ -135,7 +135,7 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/Tiles/Name/Font", ref _Theme.NameFont, "Normal");
|
||||
_ThemeLoaded &= xmlReader.TryGetEnumValue(item + "/Tiles/Name/Style", ref _Theme.NameStyle);
|
||||
if (xmlReader.GetValue(item + "/Tiles/Name/Color", ref _Theme.NameColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.NameColorName, SkinIndex, out _Theme.NameColor);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.NameColorName, skinIndex, out _Theme.NameColor);
|
||||
else
|
||||
{
|
||||
if (xmlReader.TryGetFloatValue(item + "/Tiles/Name/R", ref _Theme.NameColor.R))
|
||||
@@ -149,7 +149,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = ElementName;
|
||||
_Theme.Name = elementName;
|
||||
LoadTextures();
|
||||
}
|
||||
return _ThemeLoaded;
|
||||
@@ -236,7 +236,7 @@ namespace VocaluxeLib.Menu
|
||||
Draw(true);
|
||||
}
|
||||
|
||||
public void Draw(bool ForceDraw)
|
||||
public void Draw(bool forceDraw)
|
||||
{
|
||||
int i = 0;
|
||||
foreach (CTile tile in _Tiles)
|
||||
@@ -244,84 +244,84 @@ namespace VocaluxeLib.Menu
|
||||
tile.Avatar.Draw();
|
||||
tile.Name.Draw();
|
||||
|
||||
if (PlayerSelector.Visible)
|
||||
if (_PlayerSelector.Visible)
|
||||
{
|
||||
//Update PlayerSelector-Coords
|
||||
if (_player > -1 && _actualSelection == i)
|
||||
if (_Player > -1 && _ActualSelection == i)
|
||||
{
|
||||
PlayerSelector.Rect.X = tile.Avatar.Rect.X - 3;
|
||||
PlayerSelector.Rect.Y = tile.Avatar.Rect.Y - 3;
|
||||
_PlayerSelector.Rect.X = tile.Avatar.Rect.X - 3;
|
||||
_PlayerSelector.Rect.Y = tile.Avatar.Rect.Y - 3;
|
||||
}
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
if (PlayerSelector.Visible)
|
||||
if (_PlayerSelector.Visible)
|
||||
{
|
||||
//Draw PlayerSelector
|
||||
PlayerSelector.Draw();
|
||||
_PlayerSelector.Draw();
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleInput(KeyEvent kevent)
|
||||
public void HandleInput(SKeyEvent kevent)
|
||||
{
|
||||
switch (kevent.Key)
|
||||
{
|
||||
case Keys.Right:
|
||||
if (_actualSelection + 1 < _Tiles.Count)
|
||||
if (_ActualSelection + 1 < _Tiles.Count)
|
||||
{
|
||||
if (_Tiles[_actualSelection + 1].PlayerNr != -1)
|
||||
_actualSelection++;
|
||||
if (_Tiles[_ActualSelection + 1].PlayerNr != -1)
|
||||
_ActualSelection++;
|
||||
}
|
||||
else
|
||||
{
|
||||
int offset = _Offset;
|
||||
UpdateList(_Offset + 1);
|
||||
if (offset != _Offset)
|
||||
_actualSelection = 0;
|
||||
int offset = Offset;
|
||||
UpdateList(Offset + 1);
|
||||
if (offset != Offset)
|
||||
_ActualSelection = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case Keys.Left:
|
||||
if (_actualSelection - 1 > -1)
|
||||
_actualSelection--;
|
||||
else if (_Offset > 0)
|
||||
if (_ActualSelection - 1 > -1)
|
||||
_ActualSelection--;
|
||||
else if (Offset > 0)
|
||||
{
|
||||
UpdateList(_Offset - 1);
|
||||
_actualSelection = _Tiles.Count - 1;
|
||||
UpdateList(Offset - 1);
|
||||
_ActualSelection = _Tiles.Count - 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case Keys.Up:
|
||||
if (_actualSelection - _NumW > -1)
|
||||
_actualSelection -= _NumW;
|
||||
else if (_Offset > 0)
|
||||
if (_ActualSelection - _NumW > -1)
|
||||
_ActualSelection -= _NumW;
|
||||
else if (Offset > 0)
|
||||
{
|
||||
UpdateList(_Offset - 1);
|
||||
_actualSelection += _Tiles.Count - _NumW;
|
||||
UpdateList(Offset - 1);
|
||||
_ActualSelection += _Tiles.Count - _NumW;
|
||||
}
|
||||
break;
|
||||
|
||||
case Keys.Down:
|
||||
if (_actualSelection + _NumW < _Tiles.Count)
|
||||
if (_ActualSelection + _NumW < _Tiles.Count)
|
||||
{
|
||||
if (_Tiles[_actualSelection + _NumW].PlayerNr != -1)
|
||||
_actualSelection += _NumW;
|
||||
if (_Tiles[_ActualSelection + _NumW].PlayerNr != -1)
|
||||
_ActualSelection += _NumW;
|
||||
}
|
||||
else
|
||||
{
|
||||
int offset = _Offset;
|
||||
UpdateList(_Offset + 1);
|
||||
if (offset != _Offset)
|
||||
int offset = Offset;
|
||||
UpdateList(Offset + 1);
|
||||
if (offset != Offset)
|
||||
{
|
||||
_actualSelection = _actualSelection - _Tiles.Count + _NumW;
|
||||
if (_Tiles[_actualSelection].PlayerNr == -1)
|
||||
_ActualSelection = _ActualSelection - _Tiles.Count + _NumW;
|
||||
if (_Tiles[_ActualSelection].PlayerNr == -1)
|
||||
{
|
||||
for (int i = _Tiles.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (_Tiles[i].PlayerNr != -1)
|
||||
{
|
||||
_actualSelection = i;
|
||||
_ActualSelection = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -331,8 +331,8 @@ namespace VocaluxeLib.Menu
|
||||
break;
|
||||
}
|
||||
|
||||
if (_Offset * _Tiles.Count + _actualSelection < VisibleProfiles.Count)
|
||||
Selection = VisibleProfiles[_Offset * _Tiles.Count + _actualSelection];
|
||||
if (Offset * _Tiles.Count + _ActualSelection < _VisibleProfiles.Count)
|
||||
Selection = _VisibleProfiles[Offset * _Tiles.Count + _ActualSelection];
|
||||
else
|
||||
Selection = -1;
|
||||
}
|
||||
@@ -342,35 +342,35 @@ namespace VocaluxeLib.Menu
|
||||
//Overwrite player-selection; Same profile, but other player
|
||||
if (active && Selection != -1)
|
||||
{
|
||||
_player = player;
|
||||
PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
||||
_Player = player;
|
||||
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
||||
}
|
||||
//Normal activation
|
||||
else if (active)
|
||||
{
|
||||
Selection = 0;
|
||||
_actualSelection = 0;
|
||||
_player = player;
|
||||
PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
||||
PlayerSelector.Visible = true;
|
||||
_ActualSelection = 0;
|
||||
_Player = player;
|
||||
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
||||
_PlayerSelector.Visible = true;
|
||||
}
|
||||
//Deactivate
|
||||
else
|
||||
{
|
||||
Selection = -1;
|
||||
_actualSelection = -1;
|
||||
_player = -1;
|
||||
PlayerSelector.Visible = false;
|
||||
_ActualSelection = -1;
|
||||
_Player = -1;
|
||||
_PlayerSelector.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateList()
|
||||
{
|
||||
UpdateVisibleProfiles();
|
||||
if (_Tiles.Count * (_Offset + 1) - VisibleProfiles.Count >= _Tiles.Count * _Offset)
|
||||
UpdateList(_Offset - 1);
|
||||
_UpdateVisibleProfiles();
|
||||
if (_Tiles.Count * (Offset + 1) - _VisibleProfiles.Count >= _Tiles.Count * Offset)
|
||||
UpdateList(Offset - 1);
|
||||
else
|
||||
UpdateList(_Offset);
|
||||
UpdateList(Offset);
|
||||
}
|
||||
|
||||
public void UpdateList(int offset)
|
||||
@@ -380,12 +380,12 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
for (int i = 0; i < _Tiles.Count; i++)
|
||||
{
|
||||
if ((i + offset * _Tiles.Count) < VisibleProfiles.Count)
|
||||
if ((i + offset * _Tiles.Count) < _VisibleProfiles.Count)
|
||||
{
|
||||
_Tiles[i].Avatar.Texture = CBase.Profiles.GetProfiles()[VisibleProfiles[i + offset * _Tiles.Count]].Avatar.Texture;
|
||||
_Tiles[i].Avatar.Texture = CBase.Profiles.GetProfiles()[_VisibleProfiles[i + offset * _Tiles.Count]].Avatar.Texture;
|
||||
_Tiles[i].Avatar.Color = new SColorF(1, 1, 1, 1);
|
||||
_Tiles[i].Name.Text = CBase.Profiles.GetProfiles()[VisibleProfiles[i + offset * _Tiles.Count]].PlayerName;
|
||||
_Tiles[i].PlayerNr = VisibleProfiles[i + offset * _Tiles.Count];
|
||||
_Tiles[i].Name.Text = CBase.Profiles.GetProfiles()[_VisibleProfiles[i + offset * _Tiles.Count]].PlayerName;
|
||||
_Tiles[i].PlayerNr = _VisibleProfiles[i + offset * _Tiles.Count];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -395,10 +395,10 @@ namespace VocaluxeLib.Menu
|
||||
_Tiles[i].PlayerNr = -1;
|
||||
}
|
||||
}
|
||||
_Offset = offset;
|
||||
Offset = offset;
|
||||
}
|
||||
|
||||
public bool isOverTile(MouseEvent mevent)
|
||||
public bool IsOverTile(SMouseEvent mevent)
|
||||
{
|
||||
bool isOver = false;
|
||||
foreach (CTile tile in _Tiles)
|
||||
@@ -409,7 +409,7 @@ namespace VocaluxeLib.Menu
|
||||
return isOver;
|
||||
}
|
||||
|
||||
public int TilePlayerNr(MouseEvent mevent)
|
||||
public int TilePlayerNr(SMouseEvent mevent)
|
||||
{
|
||||
foreach (CTile tile in _Tiles)
|
||||
{
|
||||
@@ -420,7 +420,7 @@ namespace VocaluxeLib.Menu
|
||||
return -1;
|
||||
}
|
||||
|
||||
public CStatic TilePlayerAvatar(MouseEvent mevent)
|
||||
public CStatic TilePlayerAvatar(SMouseEvent mevent)
|
||||
{
|
||||
foreach (CTile tile in _Tiles)
|
||||
{
|
||||
@@ -450,10 +450,10 @@ namespace VocaluxeLib.Menu
|
||||
UnloadTextures();
|
||||
LoadTextures();
|
||||
|
||||
PrepareTiles();
|
||||
_PrepareTiles();
|
||||
}
|
||||
|
||||
private void PrepareTiles()
|
||||
private void _PrepareTiles()
|
||||
{
|
||||
_Tiles.Clear();
|
||||
for (int i = 0; i < _NumH; i++)
|
||||
@@ -469,9 +469,9 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateVisibleProfiles()
|
||||
private void _UpdateVisibleProfiles()
|
||||
{
|
||||
VisibleProfiles.Clear();
|
||||
_VisibleProfiles.Clear();
|
||||
for (int i = 0; i < CBase.Profiles.GetProfiles().Length; i++)
|
||||
{
|
||||
bool visible = false;
|
||||
@@ -485,7 +485,7 @@ namespace VocaluxeLib.Menu
|
||||
visible = false;
|
||||
}
|
||||
if (visible)
|
||||
VisibleProfiles.Add(i);
|
||||
_VisibleProfiles.Add(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public CObjectInteractions()
|
||||
{
|
||||
Init();
|
||||
_Init();
|
||||
}
|
||||
|
||||
protected void Init()
|
||||
protected void _Init()
|
||||
{
|
||||
_Interactions = new List<CInteraction>();
|
||||
_Selection = 0;
|
||||
@@ -103,115 +103,115 @@ namespace VocaluxeLib.Menu
|
||||
#endregion ElementHandler
|
||||
|
||||
#region MenuHandler
|
||||
public bool HandleInput(KeyEvent KeyEvent)
|
||||
public bool HandleInput(SKeyEvent keyEvent)
|
||||
{
|
||||
if (!CBase.Settings.IsTabNavigation())
|
||||
{
|
||||
if (KeyEvent.Key == Keys.Left)
|
||||
if (keyEvent.Key == Keys.Left)
|
||||
{
|
||||
if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.SelectSlide && KeyEvent.Mod != EModifier.Shift)
|
||||
KeyEvent.Handled = PrevElement();
|
||||
if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.SelectSlide && keyEvent.Mod != EModifier.Shift)
|
||||
keyEvent.Handled = PrevElement();
|
||||
else
|
||||
KeyEvent.Handled = _NextInteraction(KeyEvent);
|
||||
keyEvent.Handled = _NextInteraction(keyEvent);
|
||||
}
|
||||
|
||||
if (KeyEvent.Key == Keys.Right)
|
||||
if (keyEvent.Key == Keys.Right)
|
||||
{
|
||||
if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.SelectSlide && KeyEvent.Mod != EModifier.Shift)
|
||||
KeyEvent.Handled = NextElement();
|
||||
if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.SelectSlide && keyEvent.Mod != EModifier.Shift)
|
||||
keyEvent.Handled = NextElement();
|
||||
else
|
||||
KeyEvent.Handled = _NextInteraction(KeyEvent);
|
||||
keyEvent.Handled = _NextInteraction(keyEvent);
|
||||
}
|
||||
|
||||
if (KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down)
|
||||
KeyEvent.Handled = _NextInteraction(KeyEvent);
|
||||
if (keyEvent.Key == Keys.Up || keyEvent.Key == Keys.Down)
|
||||
keyEvent.Handled = _NextInteraction(keyEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (KeyEvent.Key == Keys.Tab)
|
||||
if (keyEvent.Key == Keys.Tab)
|
||||
{
|
||||
if (KeyEvent.Mod == EModifier.Shift)
|
||||
if (keyEvent.Mod == EModifier.Shift)
|
||||
PrevInteraction();
|
||||
else
|
||||
NextInteraction();
|
||||
}
|
||||
|
||||
if (KeyEvent.Key == Keys.Left)
|
||||
if (keyEvent.Key == Keys.Left)
|
||||
PrevElement();
|
||||
|
||||
if (KeyEvent.Key == Keys.Right)
|
||||
if (keyEvent.Key == Keys.Right)
|
||||
NextElement();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool HandleMouse(MouseEvent MouseEvent)
|
||||
public bool HandleMouse(SMouseEvent mouseEvent)
|
||||
{
|
||||
int selection = _Selection;
|
||||
ProcessMouseMove(MouseEvent.X, MouseEvent.Y);
|
||||
ProcessMouseMove(mouseEvent.X, mouseEvent.Y);
|
||||
if (selection != _Selection)
|
||||
{
|
||||
_UnsetHighlighted(selection);
|
||||
_SetHighlighted(_Selection);
|
||||
}
|
||||
|
||||
if (MouseEvent.LB)
|
||||
ProcessMouseClick(MouseEvent.X, MouseEvent.Y);
|
||||
if (mouseEvent.LB)
|
||||
ProcessMouseClick(mouseEvent.X, mouseEvent.Y);
|
||||
|
||||
_PrevMouseX = MouseEvent.X;
|
||||
_PrevMouseY = MouseEvent.Y;
|
||||
_PrevMouseX = mouseEvent.X;
|
||||
_PrevMouseY = mouseEvent.Y;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool HandleInputThemeEditor(KeyEvent KeyEvent)
|
||||
public bool HandleInputThemeEditor(SKeyEvent keyEvent)
|
||||
{
|
||||
_UnsetHighlighted(_Selection);
|
||||
if (KeyEvent.KeyPressed) {}
|
||||
if (keyEvent.KeyPressed) {}
|
||||
else
|
||||
{
|
||||
switch (KeyEvent.Key)
|
||||
switch (keyEvent.Key)
|
||||
{
|
||||
case Keys.S:
|
||||
CBase.Graphics.SaveTheme();
|
||||
break;
|
||||
|
||||
case Keys.Up:
|
||||
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(0, -1);
|
||||
if (keyEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(0, -1);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(0, 1);
|
||||
if (keyEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(0, 1);
|
||||
|
||||
break;
|
||||
case Keys.Down:
|
||||
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(0, 1);
|
||||
if (keyEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(0, 1);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(0, -1);
|
||||
if (keyEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(0, -1);
|
||||
|
||||
break;
|
||||
|
||||
case Keys.Right:
|
||||
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(1, 0);
|
||||
if (keyEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(1, 0);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(1, 0);
|
||||
if (keyEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(1, 0);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.None)
|
||||
if (keyEvent.Mod == EModifier.None)
|
||||
NextInteraction();
|
||||
break;
|
||||
case Keys.Left:
|
||||
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(-1, 0);
|
||||
if (keyEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(-1, 0);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(-1, 0);
|
||||
if (keyEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(-1, 0);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.None)
|
||||
if (keyEvent.Mod == EModifier.None)
|
||||
PrevInteraction();
|
||||
break;
|
||||
}
|
||||
@@ -219,64 +219,64 @@ namespace VocaluxeLib.Menu
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool HandleMouseThemeEditor(MouseEvent MouseEvent)
|
||||
public bool HandleMouseThemeEditor(SMouseEvent mouseEvent)
|
||||
{
|
||||
_UnsetHighlighted(_Selection);
|
||||
_MouseDX = MouseEvent.X - _PrevMouseX;
|
||||
_MouseDY = MouseEvent.Y - _PrevMouseY;
|
||||
_MouseDX = mouseEvent.X - _PrevMouseX;
|
||||
_MouseDY = mouseEvent.Y - _PrevMouseY;
|
||||
|
||||
int stepX = 0;
|
||||
int stepY = 0;
|
||||
|
||||
if ((MouseEvent.Mod & EModifier.Ctrl) == EModifier.Ctrl)
|
||||
if ((mouseEvent.Mod & EModifier.Ctrl) == EModifier.Ctrl)
|
||||
{
|
||||
_PrevMouseX = MouseEvent.X;
|
||||
_PrevMouseY = MouseEvent.Y;
|
||||
_PrevMouseX = mouseEvent.X;
|
||||
_PrevMouseY = mouseEvent.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (Math.Abs(MouseEvent.X - _PrevMouseX) >= 5)
|
||||
while (Math.Abs(mouseEvent.X - _PrevMouseX) >= 5)
|
||||
{
|
||||
if (MouseEvent.X - _PrevMouseX >= 5)
|
||||
if (mouseEvent.X - _PrevMouseX >= 5)
|
||||
stepX += 5;
|
||||
|
||||
if (MouseEvent.X - _PrevMouseX <= -5)
|
||||
if (mouseEvent.X - _PrevMouseX <= -5)
|
||||
stepX -= 5;
|
||||
|
||||
_PrevMouseX = MouseEvent.X - (_MouseDX - stepX);
|
||||
_PrevMouseX = mouseEvent.X - (_MouseDX - stepX);
|
||||
}
|
||||
|
||||
while (Math.Abs(MouseEvent.Y - _PrevMouseY) >= 5)
|
||||
while (Math.Abs(mouseEvent.Y - _PrevMouseY) >= 5)
|
||||
{
|
||||
if (MouseEvent.Y - _PrevMouseY >= 5)
|
||||
if (mouseEvent.Y - _PrevMouseY >= 5)
|
||||
stepY += 5;
|
||||
|
||||
if (MouseEvent.Y - _PrevMouseY <= -5)
|
||||
if (mouseEvent.Y - _PrevMouseY <= -5)
|
||||
stepY -= 5;
|
||||
|
||||
_PrevMouseY = MouseEvent.Y - (_MouseDY - stepY);
|
||||
_PrevMouseY = mouseEvent.Y - (_MouseDY - stepY);
|
||||
}
|
||||
}
|
||||
|
||||
if (MouseEvent.LBH)
|
||||
if (mouseEvent.LBH)
|
||||
{
|
||||
//if (IsMouseOver(MouseEvent.X, _PrevMouseY))
|
||||
//{
|
||||
if (MouseEvent.Mod == EModifier.None)
|
||||
MoveElement(stepX, stepY);
|
||||
if (mouseEvent.Mod == EModifier.None)
|
||||
_MoveElement(stepX, stepY);
|
||||
|
||||
if (MouseEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(_MouseDX, _MouseDY);
|
||||
if (mouseEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(_MouseDX, _MouseDY);
|
||||
|
||||
if (MouseEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(stepX, stepY);
|
||||
if (mouseEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(stepX, stepY);
|
||||
|
||||
if (MouseEvent.Mod == (EModifier.Shift | EModifier.Ctrl))
|
||||
ResizeElement(_MouseDX, _MouseDY);
|
||||
if (mouseEvent.Mod == (EModifier.Shift | EModifier.Ctrl))
|
||||
_ResizeElement(_MouseDX, _MouseDY);
|
||||
//}
|
||||
}
|
||||
else
|
||||
ProcessMouseMove(MouseEvent.X, MouseEvent.Y);
|
||||
ProcessMouseMove(mouseEvent.X, mouseEvent.Y);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -288,7 +288,7 @@ namespace VocaluxeLib.Menu
|
||||
if (_Interactions.Count <= 0)
|
||||
return;
|
||||
|
||||
List<ZSort> items = new List<ZSort>();
|
||||
List<SZSort> items = new List<SZSort>();
|
||||
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
@@ -301,9 +301,9 @@ namespace VocaluxeLib.Menu
|
||||
_Interactions[i].Type == EType.SongMenu ||
|
||||
_Interactions[i].Type == EType.Equalizer))
|
||||
{
|
||||
ZSort zs = new ZSort();
|
||||
SZSort zs = new SZSort();
|
||||
zs.ID = i;
|
||||
zs.z = _GetZValue(i);
|
||||
zs.Z = _GetZValue(i);
|
||||
items.Add(zs);
|
||||
}
|
||||
}
|
||||
@@ -312,7 +312,7 @@ namespace VocaluxeLib.Menu
|
||||
return;
|
||||
|
||||
|
||||
items.Sort(delegate(ZSort s1, ZSort s2) { return s2.z.CompareTo(s1.z); });
|
||||
items.Sort(delegate(SZSort s1, SZSort s2) { return s2.Z.CompareTo(s1.Z); });
|
||||
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
_DrawInteraction(items[i].ID);
|
||||
@@ -471,9 +471,9 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsMouseOver(MouseEvent MouseEvent)
|
||||
public bool IsMouseOver(SMouseEvent mouseEvent)
|
||||
{
|
||||
return IsMouseOver(MouseEvent.X, MouseEvent.Y);
|
||||
return IsMouseOver(mouseEvent.X, mouseEvent.Y);
|
||||
}
|
||||
|
||||
public bool IsMouseOver(int x, int y)
|
||||
@@ -595,25 +595,25 @@ namespace VocaluxeLib.Menu
|
||||
/// <summary>
|
||||
/// Selects the next best interaction in a menu.
|
||||
/// </summary>
|
||||
/// <param name="Key"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
private bool _NextInteraction(KeyEvent Key)
|
||||
private bool _NextInteraction(SKeyEvent key)
|
||||
{
|
||||
KeyEvent[] Directions = new KeyEvent[4];
|
||||
float[] Distances = new float[4];
|
||||
SKeyEvent[] directions = new SKeyEvent[4];
|
||||
float[] distances = new float[4];
|
||||
int[] stages = new int[4];
|
||||
int[] elements = new int[4];
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
Directions[i] = new KeyEvent();
|
||||
directions[i] = new SKeyEvent();
|
||||
|
||||
Directions[0].Key = Keys.Up;
|
||||
Directions[1].Key = Keys.Right;
|
||||
Directions[2].Key = Keys.Down;
|
||||
Directions[3].Key = Keys.Left;
|
||||
directions[0].Key = Keys.Up;
|
||||
directions[1].Key = Keys.Right;
|
||||
directions[2].Key = Keys.Down;
|
||||
directions[3].Key = Keys.Left;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
elements[i] = _GetNextElement(Directions[i], out Distances[i], out stages[i]);
|
||||
elements[i] = _GetNextElement(directions[i], out distances[i], out stages[i]);
|
||||
|
||||
int element = _Selection;
|
||||
int stage = int.MaxValue;
|
||||
@@ -621,7 +621,7 @@ namespace VocaluxeLib.Menu
|
||||
int direction = -1;
|
||||
|
||||
int mute = -1;
|
||||
switch (Key.Key)
|
||||
switch (key.Key)
|
||||
{
|
||||
case Keys.Up:
|
||||
mute = 2;
|
||||
@@ -639,11 +639,11 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (i != mute && elements[i] != _Selection && (stages[i] <= stage && Directions[i].Key == Key.Key))
|
||||
if (i != mute && elements[i] != _Selection && (stages[i] <= stage && directions[i].Key == key.Key))
|
||||
{
|
||||
stage = stages[i];
|
||||
element = elements[i];
|
||||
distance = Distances[i];
|
||||
distance = distances[i];
|
||||
direction = i;
|
||||
}
|
||||
}
|
||||
@@ -651,7 +651,7 @@ namespace VocaluxeLib.Menu
|
||||
if (direction != -1)
|
||||
{
|
||||
// select the new element
|
||||
if (Directions[direction].Key == Key.Key)
|
||||
if (directions[direction].Key == key.Key)
|
||||
{
|
||||
_UnsetHighlighted(_Selection);
|
||||
_UnsetSelected();
|
||||
@@ -666,24 +666,24 @@ namespace VocaluxeLib.Menu
|
||||
return false;
|
||||
}
|
||||
|
||||
private int _GetNextElement(KeyEvent Key, out float Distance, out int Stage)
|
||||
private int _GetNextElement(SKeyEvent key, out float distance, out int stage)
|
||||
{
|
||||
Distance = float.MaxValue;
|
||||
distance = float.MaxValue;
|
||||
int min = _Selection;
|
||||
SRectF actualRect = _GetRect(_Selection);
|
||||
Stage = int.MaxValue;
|
||||
stage = int.MaxValue;
|
||||
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistanceDirect(Key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < Distance)
|
||||
float dist = _GetDistanceDirect(key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < distance)
|
||||
{
|
||||
Distance = dist;
|
||||
distance = dist;
|
||||
min = i;
|
||||
Stage = 10;
|
||||
stage = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -695,12 +695,12 @@ namespace VocaluxeLib.Menu
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistance180(Key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < Distance)
|
||||
float dist = _GetDistance180(key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < distance)
|
||||
{
|
||||
Distance = dist;
|
||||
distance = dist;
|
||||
min = i;
|
||||
Stage = 20;
|
||||
stage = 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -708,7 +708,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (min == _Selection)
|
||||
{
|
||||
switch (Key.Key)
|
||||
switch (key.Key)
|
||||
{
|
||||
case Keys.Up:
|
||||
actualRect = new SRectF(actualRect.X, CBase.Settings.GetRenderH(), 1, 1, actualRect.Z);
|
||||
@@ -729,12 +729,12 @@ namespace VocaluxeLib.Menu
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistance180(Key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < Distance)
|
||||
float dist = _GetDistance180(key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < distance)
|
||||
{
|
||||
Distance = dist;
|
||||
distance = dist;
|
||||
min = i;
|
||||
Stage = 30;
|
||||
stage = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -742,7 +742,7 @@ namespace VocaluxeLib.Menu
|
||||
return min;
|
||||
}
|
||||
|
||||
private float _GetDistanceDirect(KeyEvent Key, SRectF actualRect, SRectF targetRect)
|
||||
private float _GetDistanceDirect(SKeyEvent key, SRectF actualRect, SRectF targetRect)
|
||||
{
|
||||
PointF source = new PointF(actualRect.X + actualRect.W / 2f, actualRect.Y + actualRect.H / 2f);
|
||||
PointF dest = new PointF(targetRect.X + targetRect.W / 2f, targetRect.Y + targetRect.H / 2f);
|
||||
@@ -750,7 +750,7 @@ namespace VocaluxeLib.Menu
|
||||
PointF vector = new PointF(dest.X - source.X, dest.Y - source.Y);
|
||||
float distance = (float)Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y);
|
||||
bool inDirection = false;
|
||||
switch (Key.Key)
|
||||
switch (key.Key)
|
||||
{
|
||||
case Keys.Up:
|
||||
if (vector.Y < 0f && (targetRect.X + targetRect.W > actualRect.X && actualRect.X + actualRect.W > targetRect.X))
|
||||
@@ -778,7 +778,7 @@ namespace VocaluxeLib.Menu
|
||||
return distance;
|
||||
}
|
||||
|
||||
private float _GetDistance180(KeyEvent Key, SRectF actualRect, SRectF targetRect)
|
||||
private float _GetDistance180(SKeyEvent key, SRectF actualRect, SRectF targetRect)
|
||||
{
|
||||
PointF source = new PointF(actualRect.X + actualRect.W / 2f, actualRect.Y + actualRect.H / 2f);
|
||||
PointF dest = new PointF(targetRect.X + targetRect.W / 2f, targetRect.Y + targetRect.H / 2f);
|
||||
@@ -786,7 +786,7 @@ namespace VocaluxeLib.Menu
|
||||
PointF vector = new PointF(dest.X - source.X, dest.Y - source.Y);
|
||||
float distance = (float)Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y);
|
||||
bool inDirection = false;
|
||||
switch (Key.Key)
|
||||
switch (key.Key)
|
||||
{
|
||||
case Keys.Up:
|
||||
if (vector.Y < 0f)
|
||||
@@ -996,7 +996,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private SRectF _GetRect(int interaction)
|
||||
{
|
||||
SRectF Result = new SRectF();
|
||||
SRectF result = new SRectF();
|
||||
switch (_Interactions[interaction].Type)
|
||||
{
|
||||
case EType.Button:
|
||||
@@ -1006,7 +1006,7 @@ namespace VocaluxeLib.Menu
|
||||
return _SelectSlides[_Interactions[interaction].Num].Rect;
|
||||
}
|
||||
|
||||
return Result;
|
||||
return result;
|
||||
}
|
||||
|
||||
private void _AddInteraction(int num, EType type)
|
||||
@@ -1051,7 +1051,7 @@ namespace VocaluxeLib.Menu
|
||||
#endregion InteractionHandling
|
||||
|
||||
#region Theme Handling
|
||||
private void MoveElement(int stepX, int stepY)
|
||||
private void _MoveElement(int stepX, int stepY)
|
||||
{
|
||||
if (_Interactions.Count > 0)
|
||||
{
|
||||
@@ -1068,7 +1068,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private void ResizeElement(int stepW, int stepH)
|
||||
private void _ResizeElement(int stepW, int stepH)
|
||||
{
|
||||
if (_Interactions.Count > 0)
|
||||
{
|
||||
|
||||
@@ -7,21 +7,21 @@ namespace VocaluxeLib.Menu
|
||||
public class COrderedDictionaryLite<T> : IEnumerable<T>
|
||||
{
|
||||
private readonly List<T> _Items;
|
||||
private readonly Dictionary<String, int> _htIndex;
|
||||
private readonly Dictionary<String, int> _HtIndex;
|
||||
private readonly CMenu _Parent;
|
||||
|
||||
public COrderedDictionaryLite(CMenu Parent)
|
||||
public COrderedDictionaryLite(CMenu parent)
|
||||
{
|
||||
_Items = new List<T>();
|
||||
_htIndex = new Dictionary<String, int>();
|
||||
_Parent = Parent;
|
||||
_HtIndex = new Dictionary<String, int>();
|
||||
_Parent = parent;
|
||||
}
|
||||
|
||||
public COrderedDictionaryLite(COrderedDictionaryLite<T> Dict)
|
||||
public COrderedDictionaryLite(COrderedDictionaryLite<T> dict)
|
||||
{
|
||||
_Items = new List<T>(Dict._Items);
|
||||
_htIndex = new Dictionary<String, int>(Dict._htIndex);
|
||||
_Parent = Dict._Parent;
|
||||
_Items = new List<T>(dict._Items);
|
||||
_HtIndex = new Dictionary<String, int>(dict._HtIndex);
|
||||
_Parent = dict._Parent;
|
||||
}
|
||||
|
||||
public T this[int index]
|
||||
@@ -36,7 +36,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
try
|
||||
{
|
||||
return _Items[_htIndex[key]];
|
||||
return _Items[_HtIndex[key]];
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -46,20 +46,20 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!_htIndex.ContainsKey(key))
|
||||
if (!_HtIndex.ContainsKey(key))
|
||||
{
|
||||
_htIndex.Add(key, _Items.Count);
|
||||
_HtIndex.Add(key, _Items.Count);
|
||||
_Items.Add(value);
|
||||
}
|
||||
else
|
||||
_Items[_htIndex[key]] = value;
|
||||
_Items[_HtIndex[key]] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int Add(T item, String key = null)
|
||||
{
|
||||
if (key != null)
|
||||
_htIndex.Add(key, _Items.Count);
|
||||
_HtIndex.Add(key, _Items.Count);
|
||||
_Items.Add(item);
|
||||
return _Items.Count - 1;
|
||||
}
|
||||
|
||||
@@ -91,10 +91,10 @@ namespace VocaluxeLib.Menu
|
||||
#endregion public vars
|
||||
|
||||
#region Constructors
|
||||
public CParticle(int PartyModeID, string textureName, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize,
|
||||
public CParticle(int partyModeID, string textureName, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize,
|
||||
EParticleType type)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_TextureName = textureName;
|
||||
_Texture = new STexture(-1);
|
||||
_Color = color;
|
||||
@@ -115,10 +115,10 @@ namespace VocaluxeLib.Menu
|
||||
_Rotation = (float)(CBase.Game.GetRandomDouble() * 360.0);
|
||||
}
|
||||
|
||||
public CParticle(int PartyModeID, STexture 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, STexture 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;
|
||||
_PartyModeID = partyModeID;
|
||||
_TextureName = String.Empty;
|
||||
_Texture = texture;
|
||||
_Color = color;
|
||||
@@ -148,10 +148,10 @@ namespace VocaluxeLib.Menu
|
||||
if (!_Timer.IsRunning)
|
||||
_Timer.Start();
|
||||
|
||||
float CurrentTime = _Timer.ElapsedMilliseconds / 1000f;
|
||||
float timediff = CurrentTime - _LastTime;
|
||||
float currentTime = _Timer.ElapsedMilliseconds / 1000f;
|
||||
float timediff = currentTime - _LastTime;
|
||||
|
||||
_Age = CurrentTime;
|
||||
_Age = currentTime;
|
||||
|
||||
// update alpha
|
||||
if (_MaxAge > 0f)
|
||||
@@ -200,7 +200,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
float vdx = 0f;
|
||||
if (_Vx != 0)
|
||||
vdx = (float)Math.Sin(CurrentTime / _Vx * Math.PI);
|
||||
vdx = (float)Math.Sin(currentTime / _Vx * Math.PI);
|
||||
|
||||
X += _Vx * timediff * (0.5f + vdx);
|
||||
|
||||
@@ -229,23 +229,23 @@ namespace VocaluxeLib.Menu
|
||||
switch (_Type)
|
||||
{
|
||||
case EParticleType.Twinkle:
|
||||
size = _Size * (1f - CurrentTime / _Vsize);
|
||||
size = _Size * (1f - currentTime / _Vsize);
|
||||
break;
|
||||
|
||||
case EParticleType.Star:
|
||||
size = _Size * (1f - CurrentTime / _Vsize);
|
||||
size = _Size * (1f - currentTime / _Vsize);
|
||||
break;
|
||||
|
||||
case EParticleType.Snow:
|
||||
size = _Size * (float)Math.Sqrt((Math.Sin(CurrentTime / _Vsize * Math.PI * 2 - 0.5 * Math.PI) + 1) / 2);
|
||||
size = _Size * (float)Math.Sqrt((Math.Sin(currentTime / _Vsize * Math.PI * 2 - 0.5 * Math.PI) + 1) / 2);
|
||||
break;
|
||||
|
||||
case EParticleType.Flare:
|
||||
size = _Size * (1f - CurrentTime / _Vsize);
|
||||
size = _Size * (1f - currentTime / _Vsize);
|
||||
break;
|
||||
|
||||
case EParticleType.PerfNoteStar:
|
||||
size = _Size * (1f - CurrentTime / _Vsize);
|
||||
size = _Size * (1f - currentTime / _Vsize);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -258,12 +258,12 @@ namespace VocaluxeLib.Menu
|
||||
// update rotation
|
||||
if (_Vr != 0f)
|
||||
{
|
||||
float r = CurrentTime * _Vr / 60f;
|
||||
float r = currentTime * _Vr / 60f;
|
||||
_Angle = _Rotation + 360f * (r - (float)Math.Floor(r));
|
||||
_Rect.Rotation = _Angle;
|
||||
}
|
||||
|
||||
_LastTime = CurrentTime;
|
||||
_LastTime = currentTime;
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
@@ -317,9 +317,9 @@ namespace VocaluxeLib.Menu
|
||||
get { return _Stars.Count > 0 || !_SpawnTimer.IsRunning; }
|
||||
}
|
||||
|
||||
public CParticleEffect(int PartyModeID)
|
||||
public CParticleEffect(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeParticleEffect();
|
||||
_Stars = new List<CParticle>();
|
||||
_SpawnTimer = new Stopwatch();
|
||||
@@ -327,43 +327,43 @@ namespace VocaluxeLib.Menu
|
||||
Visible = true;
|
||||
}
|
||||
|
||||
public CParticleEffect(int PartyModeID, int MaxNumber, SColorF Color, SRectF Rect, string TextureName, float Size, EParticleType Type)
|
||||
public CParticleEffect(int partyModeID, int maxNumber, SColorF color, SRectF rect, string textureName, float size, EParticleType type)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeParticleEffect();
|
||||
_Stars = new List<CParticle>();
|
||||
this.Rect = Rect;
|
||||
this.Color = Color;
|
||||
_Theme.TextureName = TextureName;
|
||||
this.Rect = rect;
|
||||
this.Color = color;
|
||||
_Theme.TextureName = textureName;
|
||||
Texture = new STexture(-1);
|
||||
_MaxNumber = MaxNumber;
|
||||
_Size = Size;
|
||||
_Type = Type;
|
||||
_MaxNumber = maxNumber;
|
||||
_Size = size;
|
||||
_Type = type;
|
||||
_SpawnTimer = new Stopwatch();
|
||||
_NextSpawnTime = 0f;
|
||||
Visible = true;
|
||||
}
|
||||
|
||||
public CParticleEffect(int PartyModeID, int MaxNumber, SColorF Color, SRectF Rect, STexture Texture, float Size, EParticleType Type)
|
||||
public CParticleEffect(int partyModeID, int maxNumber, SColorF color, SRectF rect, STexture texture, float size, EParticleType type)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeParticleEffect();
|
||||
_Stars = new List<CParticle>();
|
||||
this.Rect = Rect;
|
||||
this.Color = Color;
|
||||
this.Rect = rect;
|
||||
this.Color = color;
|
||||
_Theme.TextureName = String.Empty;
|
||||
this.Texture = Texture;
|
||||
_MaxNumber = MaxNumber;
|
||||
_Size = Size;
|
||||
_Type = Type;
|
||||
this.Texture = texture;
|
||||
_MaxNumber = maxNumber;
|
||||
_Size = size;
|
||||
_Type = type;
|
||||
_SpawnTimer = new Stopwatch();
|
||||
_NextSpawnTime = 0f;
|
||||
Visible = true;
|
||||
}
|
||||
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string item = XmlPath + "/" + ElementName;
|
||||
string item = xmlPath + "/" + elementName;
|
||||
_ThemeLoaded = true;
|
||||
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/Skin", ref _Theme.TextureName, String.Empty);
|
||||
@@ -375,7 +375,7 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/H", ref Rect.H);
|
||||
|
||||
if (xmlReader.GetValue(item + "/Color", ref _Theme.ColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, out Color);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, skinIndex, out Color);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/R", ref Color.R);
|
||||
@@ -390,7 +390,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = ElementName;
|
||||
_Theme.Name = elementName;
|
||||
LoadTextures();
|
||||
}
|
||||
return _ThemeLoaded;
|
||||
@@ -439,22 +439,22 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void Update()
|
||||
{
|
||||
bool DoSpawn = false;
|
||||
bool doSpawn = false;
|
||||
if (!_SpawnTimer.IsRunning)
|
||||
{
|
||||
_SpawnTimer.Start();
|
||||
_NextSpawnTime = 0f;
|
||||
DoSpawn = true;
|
||||
doSpawn = true;
|
||||
}
|
||||
|
||||
if (_SpawnTimer.ElapsedMilliseconds / 1000f > _NextSpawnTime && _NextSpawnTime >= 0f)
|
||||
{
|
||||
DoSpawn = true;
|
||||
doSpawn = true;
|
||||
_SpawnTimer.Reset();
|
||||
_SpawnTimer.Start();
|
||||
}
|
||||
|
||||
while (_Stars.Count < _MaxNumber && DoSpawn)
|
||||
while (_Stars.Count < _MaxNumber && doSpawn)
|
||||
{
|
||||
float size = CBase.Game.GetRandom((int)_Size / 2) + _Size / 2;
|
||||
float lifetime = 0f;
|
||||
@@ -493,7 +493,7 @@ namespace VocaluxeLib.Menu
|
||||
vsize = lifetime * 2f;
|
||||
|
||||
_NextSpawnTime = lifetime / _MaxNumber;
|
||||
DoSpawn = false;
|
||||
doSpawn = false;
|
||||
break;
|
||||
|
||||
case EParticleType.Flare:
|
||||
|
||||
+240
-240
File diff suppressed because it is too large.
Load diff
+35
-35
@@ -8,17 +8,17 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
private readonly SPlayer[,] _Rounds;
|
||||
|
||||
public CPoints(int NumRounds, SPlayer[] Players)
|
||||
public CPoints(int numRounds, SPlayer[] players)
|
||||
{
|
||||
_Rounds = new SPlayer[NumRounds, Players.Length];
|
||||
_Rounds = new SPlayer[numRounds, players.Length];
|
||||
|
||||
for (int round = 0; round < NumRounds; round++)
|
||||
for (int round = 0; round < numRounds; round++)
|
||||
{
|
||||
for (int player = 0; player < Players.Length; player++)
|
||||
for (int player = 0; player < players.Length; player++)
|
||||
{
|
||||
_Rounds[round, player].ProfileID = Players[player].ProfileID;
|
||||
_Rounds[round, player].Name = Players[player].Name;
|
||||
_Rounds[round, player].Difficulty = Players[player].Difficulty;
|
||||
_Rounds[round, player].ProfileID = players[player].ProfileID;
|
||||
_Rounds[round, player].Name = players[player].Name;
|
||||
_Rounds[round, player].Difficulty = players[player].Difficulty;
|
||||
_Rounds[round, player].Points = 0f;
|
||||
_Rounds[round, player].PointsGoldenNotes = 0f;
|
||||
_Rounds[round, player].PointsLineBonus = 0f;
|
||||
@@ -30,21 +30,21 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public void SetPoints(int Round, int SongID, SPlayer[] Players, bool Medley, bool Duet, bool ShortSong)
|
||||
public void SetPoints(int round, int songID, SPlayer[] players, bool medley, bool duet, bool shortSong)
|
||||
{
|
||||
long DateTicks = DateTime.Now.Ticks;
|
||||
for (int player = 0; player < Players.Length; player++)
|
||||
long dateTicks = DateTime.Now.Ticks;
|
||||
for (int player = 0; player < players.Length; player++)
|
||||
{
|
||||
_Rounds[Round, player].SongID = SongID;
|
||||
_Rounds[Round, player].LineNr = Players[player].LineNr;
|
||||
_Rounds[Round, player].Points = Players[player].Points;
|
||||
_Rounds[Round, player].PointsGoldenNotes = Players[player].PointsGoldenNotes;
|
||||
_Rounds[Round, player].PointsLineBonus = Players[player].PointsLineBonus;
|
||||
_Rounds[Round, player].Medley = Medley;
|
||||
_Rounds[Round, player].Duet = Duet;
|
||||
_Rounds[Round, player].ShortSong = ShortSong;
|
||||
_Rounds[Round, player].DateTicks = DateTicks;
|
||||
_Rounds[Round, player].SongFinished = Players[player].SongFinished;
|
||||
_Rounds[round, player].SongID = songID;
|
||||
_Rounds[round, player].LineNr = players[player].LineNr;
|
||||
_Rounds[round, player].Points = players[player].Points;
|
||||
_Rounds[round, player].PointsGoldenNotes = players[player].PointsGoldenNotes;
|
||||
_Rounds[round, player].PointsLineBonus = players[player].PointsLineBonus;
|
||||
_Rounds[round, player].Medley = medley;
|
||||
_Rounds[round, player].Duet = duet;
|
||||
_Rounds[round, player].ShortSong = shortSong;
|
||||
_Rounds[round, player].DateTicks = dateTicks;
|
||||
_Rounds[round, player].SongFinished = players[player].SongFinished;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,30 +58,30 @@ namespace VocaluxeLib.Menu
|
||||
get { return _Rounds.GetLength(1); }
|
||||
}
|
||||
|
||||
public SPlayer[] GetPlayer(int Round, int numPlayer)
|
||||
public SPlayer[] GetPlayer(int round, int numPlayer)
|
||||
{
|
||||
if (NumPlayer == 0)
|
||||
return new SPlayer[1];
|
||||
if (Round >= NumRounds)
|
||||
if (round >= NumRounds)
|
||||
return new SPlayer[1];
|
||||
|
||||
SPlayer[] player = new SPlayer[numPlayer];
|
||||
|
||||
for (int p = 0; p < player.Length; p++)
|
||||
{
|
||||
player[p].Name = _Rounds[Round, p].Name;
|
||||
player[p].Points = _Rounds[Round, p].Points;
|
||||
player[p].PointsGoldenNotes = _Rounds[Round, p].PointsGoldenNotes;
|
||||
player[p].PointsLineBonus = _Rounds[Round, p].PointsLineBonus;
|
||||
player[p].SongID = _Rounds[Round, p].SongID;
|
||||
player[p].LineNr = _Rounds[Round, p].LineNr;
|
||||
player[p].Difficulty = _Rounds[Round, p].Difficulty;
|
||||
player[p].Medley = _Rounds[Round, p].Medley;
|
||||
player[p].Duet = _Rounds[Round, p].Duet;
|
||||
player[p].ShortSong = _Rounds[Round, p].ShortSong;
|
||||
player[p].DateTicks = _Rounds[Round, p].DateTicks;
|
||||
player[p].SongFinished = _Rounds[Round, p].SongFinished;
|
||||
player[p].ProfileID = _Rounds[Round, p].ProfileID;
|
||||
player[p].Name = _Rounds[round, p].Name;
|
||||
player[p].Points = _Rounds[round, p].Points;
|
||||
player[p].PointsGoldenNotes = _Rounds[round, p].PointsGoldenNotes;
|
||||
player[p].PointsLineBonus = _Rounds[round, p].PointsLineBonus;
|
||||
player[p].SongID = _Rounds[round, p].SongID;
|
||||
player[p].LineNr = _Rounds[round, p].LineNr;
|
||||
player[p].Difficulty = _Rounds[round, p].Difficulty;
|
||||
player[p].Medley = _Rounds[round, p].Medley;
|
||||
player[p].Duet = _Rounds[round, p].Duet;
|
||||
player[p].ShortSong = _Rounds[round, p].ShortSong;
|
||||
player[p].DateTicks = _Rounds[round, p].DateTicks;
|
||||
player[p].SongFinished = _Rounds[round, p].SongFinished;
|
||||
player[p].ProfileID = _Rounds[round, p].ProfileID;
|
||||
}
|
||||
return player;
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ namespace VocaluxeLib.Menu
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public CScreenSetting(int PartyModeID)
|
||||
public CScreenSetting(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SScreenSetting();
|
||||
_ThemeLoaded = false;
|
||||
}
|
||||
@@ -44,16 +44,16 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded = ts._ThemeLoaded;
|
||||
}
|
||||
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string item = XmlPath + "/" + ElementName;
|
||||
string item = xmlPath + "/" + elementName;
|
||||
_ThemeLoaded = true;
|
||||
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/Value", ref _Theme.Value, String.Empty);
|
||||
_ThemeLoaded &= xmlReader.TryGetEnumValue(item + "/Type", ref _Theme.Type);
|
||||
|
||||
if (_ThemeLoaded)
|
||||
_Theme.Name = ElementName;
|
||||
_Theme.Name = elementName;
|
||||
return _ThemeLoaded;
|
||||
}
|
||||
|
||||
@@ -78,16 +78,16 @@ namespace VocaluxeLib.Menu
|
||||
switch (_Theme.Type)
|
||||
{
|
||||
case ESettingType.Int:
|
||||
return GetIntValue(_Theme.Value);
|
||||
return _GetIntValue(_Theme.Value);
|
||||
|
||||
case ESettingType.String:
|
||||
return _Theme.Value;
|
||||
|
||||
case ESettingType.Color:
|
||||
return GetColorValue(_Theme.Value);
|
||||
return _GetColorValue(_Theme.Value);
|
||||
|
||||
case ESettingType.Texture:
|
||||
return GetTextureValue(_Theme.Value);
|
||||
return _GetTextureValue(_Theme.Value);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -100,7 +100,7 @@ namespace VocaluxeLib.Menu
|
||||
public void ReloadTextures() {}
|
||||
|
||||
#region Private
|
||||
private int GetIntValue(string value)
|
||||
private int _GetIntValue(string value)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -112,12 +112,12 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private STexture GetTextureValue(string value)
|
||||
private STexture _GetTextureValue(string value)
|
||||
{
|
||||
return CBase.Theme.GetSkinTexture(value, _PartyModeID);
|
||||
}
|
||||
|
||||
private SColorF GetColorValue(string value)
|
||||
private SColorF _GetColorValue(string value)
|
||||
{
|
||||
return CBase.Theme.GetColor(value, _PartyModeID);
|
||||
}
|
||||
|
||||
@@ -138,9 +138,9 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public CSelectSlide(int PartyModeID)
|
||||
public CSelectSlide(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeSelectSlide();
|
||||
_ThemeLoaded = false;
|
||||
|
||||
@@ -225,9 +225,9 @@ namespace VocaluxeLib.Menu
|
||||
Visible = slide.Visible;
|
||||
}
|
||||
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string item = XmlPath + "/" + ElementName;
|
||||
string item = xmlPath + "/" + elementName;
|
||||
_ThemeLoaded = true;
|
||||
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/Skin", ref _Theme.TextureName, String.Empty);
|
||||
@@ -247,7 +247,7 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/H", ref Rect.H);
|
||||
|
||||
if (xmlReader.GetValue(item + "/Color", ref _Theme.ColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, out Color);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, skinIndex, out Color);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/R", ref Color.R);
|
||||
@@ -257,7 +257,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
if (xmlReader.GetValue(item + "/SColor", ref _Theme.SelColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SelColorName, SkinIndex, out SelColor);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SelColorName, skinIndex, out SelColor);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SR", ref SelColor.R);
|
||||
@@ -267,7 +267,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
if (xmlReader.GetValue(item + "/HColor", ref _Theme.HighlightColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.HighlightColorName, SkinIndex, out HighlightColor);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.HighlightColorName, skinIndex, out HighlightColor);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/HR", ref HighlightColor.R);
|
||||
@@ -289,7 +289,7 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/ArrowRightH", ref RectArrowRight.H);
|
||||
|
||||
if (xmlReader.GetValue(item + "/ArrowColor", ref _Theme.ArrowColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ArrowColorName, SkinIndex, out ColorArrow);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ArrowColorName, skinIndex, out ColorArrow);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/ArrowR", ref ColorArrow.R);
|
||||
@@ -299,7 +299,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
if (xmlReader.GetValue(item + "/ArrowSColor", ref _Theme.SelArrowColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SelArrowColorName, SkinIndex, out SelColorArrow);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SelArrowColorName, skinIndex, out SelColorArrow);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/ArrowSR", ref SelColorArrow.R);
|
||||
@@ -309,7 +309,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
if (xmlReader.GetValue(item + "/TextColor", ref _Theme.TextColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.TextColorName, SkinIndex, out TextColor);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.TextColorName, skinIndex, out TextColor);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/TextR", ref TextColor.R);
|
||||
@@ -319,7 +319,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
if (xmlReader.GetValue(item + "/TextSColor", ref _Theme.SelTextColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SelTextColorName, SkinIndex, out SelTextColor);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SelTextColorName, skinIndex, out SelTextColor);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/TextSR", ref SelTextColor.R);
|
||||
@@ -341,7 +341,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = ElementName;
|
||||
_Theme.Name = elementName;
|
||||
LoadTextures();
|
||||
}
|
||||
return _ThemeLoaded;
|
||||
@@ -515,9 +515,9 @@ namespace VocaluxeLib.Menu
|
||||
AddValue(value, _PartyModeID);
|
||||
}
|
||||
|
||||
public void AddValue(string value, int PartyModeID)
|
||||
public void AddValue(string value, int partyModeID)
|
||||
{
|
||||
AddValue(value, new STexture(-1), _ValueIndexes.Count, PartyModeID);
|
||||
AddValue(value, new STexture(-1), _ValueIndexes.Count, partyModeID);
|
||||
}
|
||||
|
||||
public void AddValue(string value, STexture texture)
|
||||
@@ -525,17 +525,17 @@ namespace VocaluxeLib.Menu
|
||||
AddValue(value, texture, _ValueIndexes.Count, _PartyModeID);
|
||||
}
|
||||
|
||||
private void AddValue(string value, STexture texture, int valueIndex)
|
||||
private void _AddValue(string value, STexture texture, int valueIndex)
|
||||
{
|
||||
AddValue(value, texture, valueIndex, _PartyModeID);
|
||||
}
|
||||
|
||||
public void AddValue(string value, STexture texture, int valueIndex, int PartyModeID)
|
||||
public void AddValue(string value, STexture texture, int valueIndex, int partyModeID)
|
||||
{
|
||||
_ValueNames.Add(value);
|
||||
_Textures.Add(texture);
|
||||
_ValueIndexes.Add(valueIndex);
|
||||
_ValuePartyModeIDs.Add(PartyModeID);
|
||||
_ValuePartyModeIDs.Add(partyModeID);
|
||||
|
||||
if (Selection == -1)
|
||||
Selection = 0;
|
||||
@@ -546,7 +546,7 @@ namespace VocaluxeLib.Menu
|
||||
public void AddValues(string[] values)
|
||||
{
|
||||
foreach (string value in values)
|
||||
AddValue(value, new STexture(-1), _PartyModeID);
|
||||
_AddValue(value, new STexture(-1), _PartyModeID);
|
||||
|
||||
_ValueBounds.Clear();
|
||||
}
|
||||
@@ -570,30 +570,30 @@ namespace VocaluxeLib.Menu
|
||||
Selection = selection;
|
||||
}
|
||||
|
||||
public void RenameValue(string NewName)
|
||||
public void RenameValue(string newName)
|
||||
{
|
||||
RenameValue(Selection, NewName);
|
||||
RenameValue(Selection, newName);
|
||||
}
|
||||
|
||||
public void RenameValue(int selection, string NewName)
|
||||
public void RenameValue(int selection, string newName)
|
||||
{
|
||||
RenameValue(selection, NewName, new STexture(-1));
|
||||
RenameValue(selection, newName, new STexture(-1));
|
||||
}
|
||||
|
||||
public void RenameValue(int selection, string NewName, STexture NewTexture)
|
||||
public void RenameValue(int selection, string newName, STexture newTexture)
|
||||
{
|
||||
if (selection < 0 && selection >= _ValueNames.Count)
|
||||
return;
|
||||
|
||||
_ValueNames[selection] = NewName;
|
||||
_Textures[selection] = NewTexture;
|
||||
_ValueNames[selection] = newName;
|
||||
_Textures[selection] = newTexture;
|
||||
}
|
||||
|
||||
public bool SetSelectionByValueIndex(int ValueIndex)
|
||||
public bool SetSelectionByValueIndex(int valueIndex)
|
||||
{
|
||||
for (int i = 0; i < _ValueIndexes.Count; i++)
|
||||
{
|
||||
if (_ValueIndexes[i] == ValueIndex)
|
||||
if (_ValueIndexes[i] == valueIndex)
|
||||
{
|
||||
Selection = i;
|
||||
return true;
|
||||
@@ -683,40 +683,40 @@ namespace VocaluxeLib.Menu
|
||||
if (!Visible && CBase.Settings.GetGameState() != EGameState.EditTheme)
|
||||
return;
|
||||
|
||||
STexture Texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
STexture TextureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.TextureArrowLeftName, _PartyModeID);
|
||||
STexture TextureArrowRight = CBase.Theme.GetSkinTexture(_Theme.TextureArrowRightName, _PartyModeID);
|
||||
STexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
STexture textureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.TextureArrowLeftName, _PartyModeID);
|
||||
STexture textureArrowRight = CBase.Theme.GetSkinTexture(_Theme.TextureArrowRightName, _PartyModeID);
|
||||
|
||||
STexture selTexture = CBase.Theme.GetSkinTexture(_Theme.SelTextureName, _PartyModeID);
|
||||
STexture selTextureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowLeftName, _PartyModeID);
|
||||
STexture SelTextureArrowRight = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowRightName, _PartyModeID);
|
||||
STexture selTextureArrowRight = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowRightName, _PartyModeID);
|
||||
|
||||
STexture HighlightTexture = CBase.Theme.GetSkinTexture(_Theme.HighlightTextureName, _PartyModeID);
|
||||
STexture highlightTexture = CBase.Theme.GetSkinTexture(_Theme.HighlightTextureName, _PartyModeID);
|
||||
|
||||
if (Selected)
|
||||
{
|
||||
if (Highlighted)
|
||||
CBase.Drawing.DrawTexture(HighlightTexture, Rect, HighlightColor);
|
||||
CBase.Drawing.DrawTexture(highlightTexture, Rect, HighlightColor);
|
||||
else
|
||||
CBase.Drawing.DrawTexture(selTexture, Rect, SelColor);
|
||||
}
|
||||
else
|
||||
CBase.Drawing.DrawTexture(Texture, Rect, Color);
|
||||
CBase.Drawing.DrawTexture(texture, Rect, Color);
|
||||
|
||||
if (_Selection > 0 || CBase.Settings.GetGameState() == EGameState.EditTheme)
|
||||
{
|
||||
if (_ArrowLeftSelected)
|
||||
CBase.Drawing.DrawTexture(selTextureArrowLeft, RectArrowLeft, SelColorArrow);
|
||||
else
|
||||
CBase.Drawing.DrawTexture(TextureArrowLeft, RectArrowLeft, ColorArrow);
|
||||
CBase.Drawing.DrawTexture(textureArrowLeft, RectArrowLeft, ColorArrow);
|
||||
}
|
||||
|
||||
if (_Selection < _ValueNames.Count - 1 || CBase.Settings.GetGameState() == EGameState.EditTheme)
|
||||
{
|
||||
if (_ArrowRightSelected)
|
||||
CBase.Drawing.DrawTexture(SelTextureArrowRight, RectArrowRight, SelColorArrow);
|
||||
CBase.Drawing.DrawTexture(selTextureArrowRight, RectArrowRight, SelColorArrow);
|
||||
else
|
||||
CBase.Drawing.DrawTexture(TextureArrowRight, RectArrowRight, ColorArrow);
|
||||
CBase.Drawing.DrawTexture(textureArrowRight, RectArrowRight, ColorArrow);
|
||||
}
|
||||
|
||||
if (_NumVisible < 1 || _ValueNames.Count == 0)
|
||||
@@ -741,36 +741,36 @@ namespace VocaluxeLib.Menu
|
||||
_ValueBounds.Clear();
|
||||
for (int i = 0; i < numvis; i++)
|
||||
{
|
||||
CText Text = new CText(0, 0, 0, TextH, MaxW, EAlignment.Center, _Theme.TextStyle, _Theme.TextFont, TextColor, _ValueNames[i + offset],
|
||||
CText text = new CText(0, 0, 0, TextH, MaxW, EAlignment.Center, _Theme.TextStyle, _Theme.TextFont, TextColor, _ValueNames[i + offset],
|
||||
_ValuePartyModeIDs[i + offset]);
|
||||
|
||||
SColorF Alpha = new SColorF(1f, 1f, 1f, 0.35f);
|
||||
SColorF alpha = new SColorF(1f, 1f, 1f, 0.35f);
|
||||
if (i + offset == _Selection)
|
||||
{
|
||||
Text.Color = SelTextColor;
|
||||
Alpha = new SColorF(1f, 1f, 1f, 1f);
|
||||
text.Color = SelTextColor;
|
||||
alpha = new SColorF(1f, 1f, 1f, 1f);
|
||||
}
|
||||
|
||||
RectangleF bounds = CBase.Drawing.GetTextBounds(Text);
|
||||
Text.X = (x + dx / 2f + dx * i) + TextRelativeX;
|
||||
RectangleF bounds = CBase.Drawing.GetTextBounds(text);
|
||||
text.X = (x + dx / 2f + dx * i) + TextRelativeX;
|
||||
|
||||
if (!WithTextures)
|
||||
Text.Y = (int)((Rect.Y + (Rect.H - bounds.Height) / 2) + TextRelativeY);
|
||||
text.Y = (int)((Rect.Y + (Rect.H - bounds.Height) / 2) + TextRelativeY);
|
||||
else
|
||||
Text.Y = (int)((Rect.Y + (Rect.H - bounds.Height)) + TextRelativeY);
|
||||
text.Y = (int)((Rect.Y + (Rect.H - bounds.Height)) + TextRelativeY);
|
||||
|
||||
Text.Z = Rect.Z;
|
||||
Text.Draw();
|
||||
text.Z = Rect.Z;
|
||||
text.Draw();
|
||||
|
||||
if (WithTextures)
|
||||
{
|
||||
float dh = Text.Y - Rect.Y - Rect.H * 0.1f;
|
||||
SRectF rect = new SRectF(Text.X - dh / 2, Rect.Y + Rect.H * 0.05f, dh, dh, Rect.Z);
|
||||
CBase.Drawing.DrawTexture(_Textures[i + offset], rect, Alpha);
|
||||
float dh = text.Y - Rect.Y - Rect.H * 0.1f;
|
||||
SRectF rect = new SRectF(text.X - dh / 2, Rect.Y + Rect.H * 0.05f, dh, dh, Rect.Z);
|
||||
CBase.Drawing.DrawTexture(_Textures[i + offset], rect, alpha);
|
||||
_ValueBounds.Add(rect);
|
||||
}
|
||||
else
|
||||
_ValueBounds.Add(new SRectF(Text.X - bounds.Width / 2f, Text.Y, bounds.Width, bounds.Height, Rect.Z));
|
||||
_ValueBounds.Add(new SRectF(text.X - bounds.Width / 2f, text.Y, bounds.Width, bounds.Height, Rect.Z));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+17
-17
@@ -28,7 +28,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Texture.index != -1)
|
||||
if (_Texture.Index != -1)
|
||||
return _Texture;
|
||||
else
|
||||
return CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
@@ -51,9 +51,9 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public EAspect Aspect = EAspect.Stretch;
|
||||
|
||||
public CStatic(int PartyModeID)
|
||||
public CStatic(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeStatic();
|
||||
_ThemeLoaded = false;
|
||||
|
||||
@@ -87,9 +87,9 @@ namespace VocaluxeLib.Menu
|
||||
Visible = s.Visible;
|
||||
}
|
||||
|
||||
public CStatic(int PartyModeID, STexture texture, SColorF color, SRectF rect)
|
||||
public CStatic(int partyModeID, STexture texture, SColorF color, SRectF rect)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeStatic();
|
||||
_ThemeLoaded = false;
|
||||
|
||||
@@ -105,11 +105,11 @@ namespace VocaluxeLib.Menu
|
||||
Visible = true;
|
||||
}
|
||||
|
||||
public CStatic(int PartyModeID, string TextureSkinName, SColorF color, SRectF rect)
|
||||
public CStatic(int partyModeID, string textureSkinName, SColorF color, SRectF rect)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeStatic();
|
||||
_Theme.TextureName = TextureSkinName;
|
||||
_Theme.TextureName = textureSkinName;
|
||||
_ThemeLoaded = false;
|
||||
|
||||
_Texture = new STexture(-1);
|
||||
@@ -124,9 +124,9 @@ namespace VocaluxeLib.Menu
|
||||
Visible = true;
|
||||
}
|
||||
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string item = XmlPath + "/" + ElementName;
|
||||
string item = xmlPath + "/" + elementName;
|
||||
_ThemeLoaded = true;
|
||||
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/Skin", ref _Theme.TextureName, String.Empty);
|
||||
@@ -138,7 +138,7 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/H", ref Rect.H);
|
||||
|
||||
if (xmlReader.GetValue(item + "/Color", ref _Theme.ColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, out Color);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, skinIndex, out Color);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/R", ref Color.R);
|
||||
@@ -158,7 +158,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = ElementName;
|
||||
_Theme.Name = elementName;
|
||||
LoadTextures();
|
||||
}
|
||||
return _ThemeLoaded;
|
||||
@@ -229,10 +229,10 @@ namespace VocaluxeLib.Menu
|
||||
Draw(1f, Rect.Z, Aspect, true);
|
||||
}
|
||||
|
||||
public void Draw(float scale, float z, EAspect aspect, bool ForceDraw)
|
||||
public void Draw(float scale, float z, EAspect aspect, bool forceDraw)
|
||||
{
|
||||
STexture texture;
|
||||
if (_Texture.index != -1)
|
||||
if (_Texture.Index != -1)
|
||||
texture = _Texture;
|
||||
else
|
||||
texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
@@ -249,8 +249,8 @@ namespace VocaluxeLib.Menu
|
||||
if (aspect != EAspect.Stretch)
|
||||
{
|
||||
RectangleF bounds2 = new RectangleF(bounds.X, bounds.Y, bounds.W, bounds.H);
|
||||
RectangleF rect2 = new RectangleF(0f, 0f, texture.width, texture.height);
|
||||
CHelper.SetRect(bounds2, ref rect2, texture.width / texture.height, aspect);
|
||||
RectangleF rect2 = new RectangleF(0f, 0f, texture.Width, texture.Height);
|
||||
CHelper.SetRect(bounds2, ref rect2, texture.Width / texture.Height, aspect);
|
||||
|
||||
rect.X = rect2.X;
|
||||
rect.Y = rect2.Y;
|
||||
@@ -259,7 +259,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
SColorF color = new SColorF(Color.R, Color.G, Color.B, Color.A * Alpha);
|
||||
if (Visible || ForceDraw || (CBase.Settings.GetGameState() == EGameState.EditTheme))
|
||||
if (Visible || forceDraw || (CBase.Settings.GetGameState() == EGameState.EditTheme))
|
||||
{
|
||||
CBase.Drawing.DrawTexture(texture, rect, color, bounds);
|
||||
if (Reflection)
|
||||
|
||||
+35
-35
@@ -17,7 +17,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
public float X;
|
||||
public float Y;
|
||||
public float textHeight;
|
||||
public float TextHeight;
|
||||
public float Width;
|
||||
public float Height;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
X = 0f;
|
||||
Y = 0f;
|
||||
textHeight = 0f;
|
||||
TextHeight = 0f;
|
||||
Width = 0f;
|
||||
Height = 0f;
|
||||
}
|
||||
@@ -249,9 +249,9 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public float Alpha = 1f;
|
||||
|
||||
public CText(int PartyModeID)
|
||||
public CText(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_TranslationID = _PartyModeID;
|
||||
_Font = "Normal";
|
||||
}
|
||||
@@ -390,12 +390,12 @@ namespace VocaluxeLib.Menu
|
||||
ReflectionHeight = rheight;
|
||||
}
|
||||
|
||||
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)
|
||||
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)
|
||||
{
|
||||
_Theme = new SThemeText();
|
||||
_ThemeLoaded = false;
|
||||
_ButtonText = false;
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_TranslationID = _PartyModeID;
|
||||
|
||||
X = x;
|
||||
@@ -423,27 +423,27 @@ namespace VocaluxeLib.Menu
|
||||
Reflection = false;
|
||||
}
|
||||
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
return LoadTheme(XmlPath, ElementName, xmlReader, SkinIndex, false);
|
||||
return LoadTheme(xmlPath, elementName, xmlReader, skinIndex, false);
|
||||
}
|
||||
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex, bool ButtonText)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex, bool buttonText)
|
||||
{
|
||||
string item = XmlPath + "/" + ElementName;
|
||||
string item = xmlPath + "/" + elementName;
|
||||
_ThemeLoaded = true;
|
||||
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/X", ref _X);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Y", ref _Y);
|
||||
|
||||
if (!ButtonText)
|
||||
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", ref _Theme.ColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, out Color);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, skinIndex, out Color);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/R", ref Color.R);
|
||||
@@ -453,7 +453,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
if (xmlReader.GetValue(item + "/SColor", ref _Theme.SelColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SelColorName, SkinIndex, out SelColor);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SelColorName, skinIndex, out SelColor);
|
||||
else
|
||||
{
|
||||
if (xmlReader.TryGetFloatValue(item + "/SR", ref SelColor.R))
|
||||
@@ -471,7 +471,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/Text", ref _Theme.Text, String.Empty);
|
||||
|
||||
if (xmlReader.ItemExists(item + "/Reflection") && !ButtonText)
|
||||
if (xmlReader.ItemExists(item + "/Reflection") && !buttonText)
|
||||
{
|
||||
Reflection = true;
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/Reflection/Space", ref ReflectionSpace);
|
||||
@@ -481,8 +481,8 @@ namespace VocaluxeLib.Menu
|
||||
Reflection = false;
|
||||
|
||||
// Set values
|
||||
_Theme.Name = ElementName;
|
||||
_ButtonText = ButtonText;
|
||||
_Theme.Name = elementName;
|
||||
_ButtonText = buttonText;
|
||||
_PositionNeedsUpdate = true;
|
||||
|
||||
if (_ThemeLoaded)
|
||||
@@ -589,27 +589,27 @@ namespace VocaluxeLib.Menu
|
||||
Draw(true);
|
||||
}
|
||||
|
||||
public void Draw(bool ForceDraw = false)
|
||||
public void Draw(bool forceDraw = false)
|
||||
{
|
||||
if (!ForceDraw && !Visible && CBase.Settings.GetGameState() != EGameState.EditTheme)
|
||||
if (!forceDraw && !Visible && CBase.Settings.GetGameState() != EGameState.EditTheme)
|
||||
return;
|
||||
|
||||
// Update Text
|
||||
Text = Text;
|
||||
|
||||
if (_PositionNeedsUpdate)
|
||||
UpdateTextPosition();
|
||||
_UpdateTextPosition();
|
||||
|
||||
CBase.Fonts.SetFont(Font);
|
||||
CBase.Fonts.SetStyle(Style);
|
||||
|
||||
SColorF CurrentColor = new SColorF(Color);
|
||||
SColorF currentColor = new SColorF(Color);
|
||||
if (Selected)
|
||||
CurrentColor = new SColorF(SelColor);
|
||||
currentColor = new SColorF(SelColor);
|
||||
|
||||
SColorF color = new SColorF(CurrentColor.R, CurrentColor.G, CurrentColor.B, CurrentColor.A * Alpha);
|
||||
SColorF color = new SColorF(currentColor.R, currentColor.G, currentColor.B, currentColor.A * Alpha);
|
||||
|
||||
CBase.Fonts.DrawText(_Text, _DrawPosition.textHeight, _DrawPosition.X, _DrawPosition.Y, Z, color);
|
||||
CBase.Fonts.DrawText(_Text, _DrawPosition.TextHeight, _DrawPosition.X, _DrawPosition.Y, Z, color);
|
||||
|
||||
if (Reflection)
|
||||
{
|
||||
@@ -617,16 +617,16 @@ namespace VocaluxeLib.Menu
|
||||
switch (HAlign)
|
||||
{
|
||||
case EHAlignment.Top:
|
||||
factor = (Height - _DrawPosition.textHeight) * 1.5f;
|
||||
factor = (Height - _DrawPosition.TextHeight) * 1.5f;
|
||||
break;
|
||||
case EHAlignment.Center:
|
||||
factor = (Height - _DrawPosition.textHeight) * 1.0f;
|
||||
factor = (Height - _DrawPosition.TextHeight) * 1.0f;
|
||||
break;
|
||||
case EHAlignment.Bottom:
|
||||
factor = (Height - _DrawPosition.textHeight) * 0.5f;
|
||||
factor = (Height - _DrawPosition.TextHeight) * 0.5f;
|
||||
break;
|
||||
}
|
||||
CBase.Fonts.DrawTextReflection(_Text, _DrawPosition.textHeight, _DrawPosition.X, _DrawPosition.Y, Z, color, ReflectionSpace + factor, ReflectionHeight);
|
||||
CBase.Fonts.DrawTextReflection(_Text, _DrawPosition.TextHeight, _DrawPosition.X, _DrawPosition.Y, Z, color, ReflectionSpace + factor, ReflectionHeight);
|
||||
}
|
||||
|
||||
if (Selected && (CBase.Settings.GetGameState() == EGameState.EditTheme))
|
||||
@@ -653,11 +653,11 @@ namespace VocaluxeLib.Menu
|
||||
break;
|
||||
}
|
||||
|
||||
SColorF CurrentColor = new SColorF(Color);
|
||||
SColorF currentColor = new SColorF(Color);
|
||||
if (Selected)
|
||||
CurrentColor = new SColorF(SelColor);
|
||||
currentColor = new SColorF(SelColor);
|
||||
|
||||
SColorF color = new SColorF(CurrentColor.R, CurrentColor.G, CurrentColor.B, CurrentColor.A * Alpha);
|
||||
SColorF color = new SColorF(currentColor.R, currentColor.G, currentColor.B, currentColor.A * Alpha);
|
||||
|
||||
CBase.Fonts.SetFont(Font);
|
||||
CBase.Fonts.SetStyle(Style);
|
||||
@@ -730,11 +730,11 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
|
||||
|
||||
SColorF CurrentColor = new SColorF(Color);
|
||||
SColorF currentColor = new SColorF(Color);
|
||||
if (Selected)
|
||||
CurrentColor = new SColorF(SelColor);
|
||||
currentColor = new SColorF(SelColor);
|
||||
|
||||
SColorF color = new SColorF(CurrentColor.R, CurrentColor.G, CurrentColor.B, CurrentColor.A * Alpha);
|
||||
SColorF color = new SColorF(currentColor.R, currentColor.G, currentColor.B, currentColor.A * Alpha);
|
||||
|
||||
CBase.Fonts.SetFont(Font);
|
||||
CBase.Fonts.SetStyle(Style);
|
||||
@@ -785,7 +785,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
#endregion ThemeEdit
|
||||
|
||||
private void UpdateTextPosition()
|
||||
private void _UpdateTextPosition()
|
||||
{
|
||||
if (_Text.Length == 0)
|
||||
return;
|
||||
@@ -831,7 +831,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
_DrawPosition.X = x;
|
||||
_DrawPosition.Y = y;
|
||||
_DrawPosition.textHeight = h;
|
||||
_DrawPosition.TextHeight = h;
|
||||
_DrawPosition.Width = bounds.Width;
|
||||
_DrawPosition.Height = bounds.Height;
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryGetEnumValue<T>(string Cast, ref T value)
|
||||
public bool TryGetEnumValue<T>(string cast, ref T value)
|
||||
where T : struct
|
||||
{
|
||||
string val = String.Empty;
|
||||
if (GetValue(Cast, ref val, Enum.GetName(typeof(T), value)))
|
||||
if (GetValue(cast, ref val, Enum.GetName(typeof(T), value)))
|
||||
{
|
||||
CHelper.TryParse(val, out value, true);
|
||||
return true;
|
||||
@@ -52,17 +52,17 @@ namespace VocaluxeLib.Menu
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool TryGetIntValue(string Cast, ref int value)
|
||||
public bool TryGetIntValue(string cast, ref int value)
|
||||
{
|
||||
string val = String.Empty;
|
||||
if (GetValue(Cast, ref val, value.ToString()))
|
||||
if (GetValue(cast, ref val, value.ToString()))
|
||||
return int.TryParse(val, out value);
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool TryGetIntValueRange(string Cast, ref int value, int min = 0, int max = 100)
|
||||
public bool TryGetIntValueRange(string cast, ref int value, int min = 0, int max = 100)
|
||||
{
|
||||
bool result = TryGetIntValue(Cast, ref value);
|
||||
bool result = TryGetIntValue(cast, ref value);
|
||||
if (result)
|
||||
{
|
||||
if (value < min)
|
||||
@@ -73,22 +73,22 @@ namespace VocaluxeLib.Menu
|
||||
return result;
|
||||
}
|
||||
|
||||
public bool TryGetFloatValue(string Cast, ref float value)
|
||||
public bool TryGetFloatValue(string cast, ref float value)
|
||||
{
|
||||
string val = String.Empty;
|
||||
if (GetValue(Cast, ref val, value.ToString()))
|
||||
if (GetValue(cast, ref val, value.ToString()))
|
||||
return CHelper.TryParse(val, out value);
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool GetValue(string Cast, ref string Value, string DefaultValue)
|
||||
public bool GetValue(string cast, ref string value, string defaultValue)
|
||||
{
|
||||
XPathNodeIterator iterator;
|
||||
int results = 0;
|
||||
string val = string.Empty;
|
||||
|
||||
_Navigator.MoveToFirstChild();
|
||||
iterator = _Navigator.Select(Cast);
|
||||
iterator = _Navigator.Select(cast);
|
||||
|
||||
while (iterator.MoveNext())
|
||||
{
|
||||
@@ -98,17 +98,17 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if ((results == 0) || (results > 1))
|
||||
{
|
||||
Value = DefaultValue;
|
||||
value = defaultValue;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Value = val;
|
||||
value = val;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> GetValues(string Cast)
|
||||
public List<string> GetValues(string cast)
|
||||
{
|
||||
List<string> values = new List<string>();
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace VocaluxeLib.Menu
|
||||
_Navigator.MoveToFirstChild();
|
||||
_Navigator.MoveToFirstChild();
|
||||
|
||||
while (_Navigator.Name != Cast)
|
||||
while (_Navigator.Name != cast)
|
||||
_Navigator.MoveToNext();
|
||||
|
||||
_Navigator.MoveToFirstChild();
|
||||
@@ -128,14 +128,14 @@ namespace VocaluxeLib.Menu
|
||||
return values;
|
||||
}
|
||||
|
||||
public List<string> GetAttributes(string Cast, string attribute)
|
||||
public List<string> GetAttributes(string cast, string attribute)
|
||||
{
|
||||
List<string> values = new List<string>();
|
||||
|
||||
_Navigator.MoveToRoot();
|
||||
_Navigator.MoveToFirstChild();
|
||||
|
||||
while (_Navigator.Name != Cast)
|
||||
while (_Navigator.Name != cast)
|
||||
_Navigator.MoveToNext();
|
||||
|
||||
_Navigator.MoveToFirstChild();
|
||||
@@ -147,31 +147,31 @@ namespace VocaluxeLib.Menu
|
||||
return values;
|
||||
}
|
||||
|
||||
public bool GetInnerValues(string Cast, ref List<string> Values)
|
||||
public bool GetInnerValues(string cast, ref List<string> values)
|
||||
{
|
||||
_Navigator.MoveToRoot();
|
||||
_Navigator.MoveToFirstChild();
|
||||
_Navigator.MoveToFirstChild();
|
||||
|
||||
while (_Navigator.Name != Cast)
|
||||
while (_Navigator.Name != cast)
|
||||
_Navigator.MoveToNext();
|
||||
|
||||
_Navigator.MoveToFirstChild();
|
||||
|
||||
Values.Add(_Navigator.Value);
|
||||
values.Add(_Navigator.Value);
|
||||
while (_Navigator.MoveToNext())
|
||||
Values.Add(_Navigator.Value);
|
||||
values.Add(_Navigator.Value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool ItemExists(string Cast)
|
||||
public bool ItemExists(string cast)
|
||||
{
|
||||
XPathNodeIterator iterator;
|
||||
int results = 0;
|
||||
|
||||
_Navigator.MoveToFirstChild();
|
||||
iterator = _Navigator.Select(Cast);
|
||||
iterator = _Navigator.Select(cast);
|
||||
|
||||
while (iterator.MoveNext())
|
||||
results++;
|
||||
|
||||
+43
-15
@@ -55,21 +55,23 @@ namespace VocaluxeLib.Menu
|
||||
#region Config
|
||||
public enum ERenderer
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
#if WIN
|
||||
TR_CONFIG_DIRECT3D,
|
||||
#endif
|
||||
TR_CONFIG_OPENGL,
|
||||
TR_CONFIG_SOFTWARE
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum EAntiAliasingModes
|
||||
{
|
||||
x0 = 0,
|
||||
x2 = 2,
|
||||
x4 = 4,
|
||||
x8 = 8,
|
||||
x16 = 16,
|
||||
x32 = 32
|
||||
X0 = 0,
|
||||
X2 = 2,
|
||||
X4 = 4,
|
||||
X8 = 8,
|
||||
X16 = 16,
|
||||
X32 = 32
|
||||
}
|
||||
|
||||
public enum EColorDeep
|
||||
@@ -82,21 +84,26 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public enum ETextureQuality
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
TR_CONFIG_TEXTURE_LOWEST,
|
||||
TR_CONFIG_TEXTURE_LOW,
|
||||
TR_CONFIG_TEXTURE_MEDIUM,
|
||||
TR_CONFIG_TEXTURE_HIGH,
|
||||
TR_CONFIG_TEXTURE_HIGHEST
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum EOffOn
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
TR_CONFIG_OFF,
|
||||
TR_CONFIG_ON
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum EDebugLevel
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
// don't change the order!
|
||||
TR_CONFIG_OFF, //no debug infos
|
||||
TR_CONFIG_ONLY_FPS,
|
||||
@@ -104,19 +111,20 @@ namespace VocaluxeLib.Menu
|
||||
TR_CONFIG_LEVEL2,
|
||||
TR_CONFIG_LEVEL3,
|
||||
TR_CONFIG_LEVEL_MAX //all debug infos
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum EBufferSize
|
||||
{
|
||||
b0 = 0,
|
||||
b512 = 512,
|
||||
b1024 = 1024,
|
||||
b1536 = 1536,
|
||||
b2048 = 2048,
|
||||
b2560 = 2560,
|
||||
b3072 = 3072,
|
||||
b3584 = 3584,
|
||||
b4096 = 4096
|
||||
B0 = 0,
|
||||
B512 = 512,
|
||||
B1024 = 1024,
|
||||
B1536 = 1536,
|
||||
B2048 = 2048,
|
||||
B2560 = 2560,
|
||||
B3072 = 3072,
|
||||
B3584 = 3584,
|
||||
B4096 = 4096
|
||||
}
|
||||
|
||||
public enum EPlaybackLib
|
||||
@@ -148,10 +156,12 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public enum ESongMenu
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
//TR_CONFIG_LIST, //a simple list
|
||||
//TR_CONFIG_DREIDEL, //as in ultrastar deluxe
|
||||
TR_CONFIG_TILE_BOARD, //chessboard like
|
||||
//TR_CONFIG_BOOK //for playlists
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum EDuetOptions
|
||||
@@ -163,6 +173,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public enum ESongSorting
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
TR_CONFIG_NONE,
|
||||
//TR_CONFIG_RANDOM,
|
||||
TR_CONFIG_FOLDER,
|
||||
@@ -174,55 +185,70 @@ namespace VocaluxeLib.Menu
|
||||
TR_CONFIG_LANGUAGE,
|
||||
TR_CONFIG_YEAR,
|
||||
TR_CONFIG_DECADE
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum ECoverLoading
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
TR_CONFIG_COVERLOADING_ONDEMAND,
|
||||
TR_CONFIG_COVERLOADING_ATSTART,
|
||||
TR_CONFIG_COVERLOADING_DYNAMIC
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum EGameDifficulty
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
TR_CONFIG_EASY,
|
||||
TR_CONFIG_NORMAL,
|
||||
TR_CONFIG_HARD
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum ETimerMode
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
TR_CONFIG_TIMERMODE_CURRENT,
|
||||
TR_CONFIG_TIMERMODE_REMAINING,
|
||||
TR_CONFIG_TIMERMODE_TOTAL
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum ETimerLook
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
TR_CONFIG_TIMERLOOK_NORMAL,
|
||||
TR_CONFIG_TIMERLOOK_EXPANDED
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum EBackgroundMusicSource
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
TR_CONFIG_NO_OWN_MUSIC,
|
||||
TR_CONFIG_OWN_MUSIC,
|
||||
TR_CONFIG_ONLY_OWN_MUSIC
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum EPlayerInfo
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
TR_CONFIG_PLAYERINFO_BOTH,
|
||||
TR_CONFIG_PLAYERINFO_NAME,
|
||||
TR_CONFIG_PLAYERINFO_AVATAR,
|
||||
TR_CONFIG_PLAYERINFO_OFF
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum EFadePlayerInfo
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
TR_CONFIG_FADEPLAYERINFO_ALL,
|
||||
TR_CONFIG_FADEPLAYERINFO_INFO,
|
||||
TR_CONFIG_FADEPLAYERINFO_OFF
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum ELyricStyle
|
||||
@@ -243,10 +269,12 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public enum EGameMode
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
TR_GAMEMODE_NORMAL,
|
||||
TR_GAMEMODE_MEDLEY,
|
||||
TR_GAMEMODE_DUET,
|
||||
TR_GAMEMODE_SHORTSONG
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum ENoteType
|
||||
|
||||
+83
-83
@@ -12,16 +12,16 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
void Init();
|
||||
|
||||
void LoadTheme(string XmlPath);
|
||||
void LoadTheme(string xmlPath);
|
||||
void SaveTheme();
|
||||
void ReloadTextures();
|
||||
void UnloadTextures();
|
||||
void ReloadTheme(string XmlPath);
|
||||
void ReloadTheme(string xmlPath);
|
||||
|
||||
bool HandleInput(KeyEvent keyEvent);
|
||||
bool HandleMouse(MouseEvent mouseEvent);
|
||||
bool HandleInputThemeEditor(KeyEvent KeyEvent);
|
||||
bool HandleMouseThemeEditor(MouseEvent MouseEvent);
|
||||
bool HandleInput(SKeyEvent keyEvent);
|
||||
bool HandleMouse(SMouseEvent mouseEvent);
|
||||
bool HandleInputThemeEditor(SKeyEvent keyEvent);
|
||||
bool HandleMouseThemeEditor(SMouseEvent mouseEvent);
|
||||
|
||||
bool UpdateGame();
|
||||
void ApplyVolume();
|
||||
@@ -44,16 +44,16 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public interface IMenuParty
|
||||
{
|
||||
void SetPartyModeID(int PartyModeID);
|
||||
void SetPartyModeID(int partyModeID);
|
||||
int GetPartyModeID();
|
||||
|
||||
void AssingPartyMode(IPartyMode PartyMode);
|
||||
void DataToScreen(Object Data);
|
||||
void AssingPartyMode(IPartyMode partyMode);
|
||||
void DataToScreen(Object data);
|
||||
}
|
||||
|
||||
public interface IConfig
|
||||
{
|
||||
void SetBackgroundMusicVolume(int NewVolume);
|
||||
void SetBackgroundMusicVolume(int newVolume);
|
||||
int GetBackgroundMusicVolume();
|
||||
|
||||
int GetPreviewMusicVolume();
|
||||
@@ -74,7 +74,7 @@ namespace VocaluxeLib.Menu
|
||||
EOffOn GetTabs();
|
||||
EOffOn GetIgnoreArticles();
|
||||
|
||||
bool IsMicConfigured(int PlayerNr);
|
||||
bool IsMicConfigured(int playerNr);
|
||||
int GetMaxNumMics();
|
||||
}
|
||||
|
||||
@@ -103,17 +103,17 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public interface ITheme
|
||||
{
|
||||
string GetThemeScreensPath(int PartyModeID);
|
||||
int GetSkinIndex(int PartyModeID);
|
||||
STexture GetSkinTexture(string TextureName, int PartyModeID);
|
||||
STexture GetSkinVideoTexture(string VideoName, int PartyModeID);
|
||||
string GetThemeScreensPath(int partyModeID);
|
||||
int GetSkinIndex(int partyModeID);
|
||||
STexture GetSkinTexture(string textureName, int partyModeID);
|
||||
STexture GetSkinVideoTexture(string videoName, int partyModeID);
|
||||
|
||||
void SkinVideoResume(string VideoName, int PartyModeID);
|
||||
void SkinVideoPause(string VideoName, int PartyModeID);
|
||||
void SkinVideoResume(string videoName, int partyModeID);
|
||||
void SkinVideoPause(string videoName, int partyModeID);
|
||||
|
||||
SColorF GetColor(string ColorName, int PartyModeID);
|
||||
bool GetColor(string ColorName, int SkinIndex, out SColorF Color);
|
||||
SColorF GetPlayerColor(int PlayerNr);
|
||||
SColorF GetColor(string colorName, int partyModeID);
|
||||
bool GetColor(string colorName, int skinIndex, out SColorF color);
|
||||
SColorF GetPlayerColor(int playerNr);
|
||||
|
||||
void UnloadSkins();
|
||||
void ListSkins();
|
||||
@@ -130,7 +130,7 @@ namespace VocaluxeLib.Menu
|
||||
bool SongHasVideo();
|
||||
bool VideoEnabled();
|
||||
|
||||
void SetStatus(bool Disabled);
|
||||
void SetStatus(bool disabled);
|
||||
void Next();
|
||||
void Previous();
|
||||
void Pause();
|
||||
@@ -145,66 +145,66 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
RectangleF GetTextBounds(CText text);
|
||||
|
||||
void DrawTexture(STexture Texture, SRectF Rect);
|
||||
void DrawTexture(STexture Texture, SRectF Rect, SColorF Color);
|
||||
void DrawTexture(STexture Texture, SRectF Rect, SColorF Color, SRectF Bounds);
|
||||
void DrawTexture(STexture Texture, SRectF Rect, SColorF Color, SRectF Bounds, bool Mirrored);
|
||||
void DrawTextureReflection(STexture Texture, SRectF Rect, SColorF Color, SRectF Bounds, float ReflectionSpace, float ReflectionHeight);
|
||||
void DrawTexture(STexture texture, SRectF rect);
|
||||
void DrawTexture(STexture texture, SRectF rect, SColorF color);
|
||||
void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds);
|
||||
void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored);
|
||||
void DrawTextureReflection(STexture texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight);
|
||||
|
||||
void RemoveTexture(ref STexture Texture);
|
||||
void RemoveTexture(ref STexture texture);
|
||||
|
||||
void DrawColor(SColorF Color, SRectF Rect);
|
||||
void DrawColorReflection(SColorF Color, SRectF Rect, float Space, float Height);
|
||||
void DrawColor(SColorF color, SRectF rect);
|
||||
void DrawColorReflection(SColorF color, SRectF rect, float space, float height);
|
||||
}
|
||||
|
||||
public interface IGraphics
|
||||
{
|
||||
void ReloadTheme();
|
||||
void SaveTheme();
|
||||
void FadeTo(EScreens NextScreen);
|
||||
void FadeTo(EScreens nextScreen);
|
||||
|
||||
float GetGlobalAlpha();
|
||||
}
|
||||
|
||||
public interface ILog
|
||||
{
|
||||
void LogError(string ErrorText);
|
||||
void LogError(string errorText);
|
||||
}
|
||||
|
||||
public interface IFonts
|
||||
{
|
||||
void SetFont(string FontName);
|
||||
void SetStyle(EStyle FontStyle);
|
||||
void SetFont(string fontName);
|
||||
void SetStyle(EStyle fontStyle);
|
||||
|
||||
RectangleF GetTextBounds(CText Text, float TextHeight);
|
||||
RectangleF GetTextBounds(CText text, float textHeight);
|
||||
|
||||
void DrawText(string Text, float TextHeight, float x, float y, float z, SColorF Color);
|
||||
void DrawTextReflection(string Text, float TextHeight, float x, float y, float z, SColorF Color, float ReflectionSpace, float ReflectionHeight);
|
||||
void DrawText(string Text, float TextHeight, float x, float y, float z, SColorF Color, float Begin, float End);
|
||||
void DrawText(string text, float textHeight, float x, float y, float z, SColorF color);
|
||||
void DrawTextReflection(string text, float textHeight, float x, float y, float z, SColorF color, float reflectionSpace, float reflectionHeight);
|
||||
void DrawText(string text, float textHeight, float x, float y, float z, SColorF color, float begin, float end);
|
||||
}
|
||||
|
||||
public interface ILanguage
|
||||
{
|
||||
string Translate(string KeyWord);
|
||||
string Translate(string KeyWord, int PartyModeID);
|
||||
bool TranslationExists(string KeyWord);
|
||||
string Translate(string keyWord);
|
||||
string Translate(string keyWord, int partyModeID);
|
||||
bool TranslationExists(string keyWord);
|
||||
}
|
||||
|
||||
public interface IGame
|
||||
{
|
||||
int GetNumPlayer();
|
||||
void SetNumPlayer(int NumPlayer);
|
||||
void SetNumPlayer(int numPlayer);
|
||||
SPlayer[] GetPlayer();
|
||||
CPoints GetPoints();
|
||||
float GetMidBeatD();
|
||||
int GetCurrentBeatD();
|
||||
|
||||
int GetRandom(int Max);
|
||||
int GetRandom(int max);
|
||||
double GetRandomDouble();
|
||||
|
||||
float GetTimeFromBeats(float Beat, float BPM);
|
||||
float GetTimeFromBeats(float beat, float bpm);
|
||||
|
||||
void AddSong(int SongID, EGameMode GameMode);
|
||||
void AddSong(int songID, EGameMode gameMode);
|
||||
void Reset();
|
||||
void ClearSongs();
|
||||
int GetNumSongs();
|
||||
@@ -212,7 +212,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public interface IRecording
|
||||
{
|
||||
int GetToneAbs(int PlayerNr);
|
||||
int GetToneAbs(int playerNr);
|
||||
}
|
||||
|
||||
public interface IProfiles
|
||||
@@ -225,26 +225,26 @@ namespace VocaluxeLib.Menu
|
||||
int GetNumSongs();
|
||||
int GetNumVisibleSongs();
|
||||
int GetNumCategories();
|
||||
int NumSongsInCategory(int CategoryIndex);
|
||||
int NumSongsInCategory(int categoryIndex);
|
||||
|
||||
int GetCurrentCategoryIndex();
|
||||
EOffOn GetTabs();
|
||||
string GetSearchFilter();
|
||||
|
||||
void SetCategory(int CategoryIndex);
|
||||
void SetCategory(int categoryIndex);
|
||||
void UpdateRandomSongList();
|
||||
|
||||
CSong GetVisibleSong(int VisibleIndex);
|
||||
CSong GetSongByID(int SongID);
|
||||
CSong GetVisibleSong(int visibleIndex);
|
||||
CSong GetSongByID(int songID);
|
||||
CSong[] GetSongs();
|
||||
CSong[] GetSongsNotSung();
|
||||
CCategory GetCategory(int Index);
|
||||
CCategory GetCategory(int index);
|
||||
|
||||
void AddPartySongSung(int SongID);
|
||||
void AddPartySongSung(int songID);
|
||||
void ResetPartySongSung();
|
||||
void ResetPartySongSung(int CatIndex);
|
||||
void ResetPartySongSung(int catIndex);
|
||||
|
||||
void SortSongs(ESongSorting Sorting, EOffOn Tabs, EOffOn IgnoreArticles, String SearchString, EDuetOptions DuetOptions);
|
||||
void SortSongs(ESongSorting sorting, EOffOn tabs, EOffOn ignoreArticles, String searchString, EDuetOptions duetOptions);
|
||||
|
||||
void NextCategory();
|
||||
void PrevCategory();
|
||||
@@ -252,27 +252,27 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public interface IVideo
|
||||
{
|
||||
int Load(string VideoFileName);
|
||||
bool Skip(int VideoStream, float StartPosition, float VideoGap);
|
||||
bool GetFrame(int VideoStream, ref STexture VideoTexture, float Time, ref float VideoTime);
|
||||
bool IsFinished(int VideoStream);
|
||||
bool Close(int VideoStream);
|
||||
int Load(string videoFileName);
|
||||
bool Skip(int videoStream, float startPosition, float videoGap);
|
||||
bool GetFrame(int videoStream, ref STexture videoTexture, float time, ref float videoTime);
|
||||
bool IsFinished(int videoStream);
|
||||
bool Close(int videoStream);
|
||||
}
|
||||
|
||||
public interface ISound
|
||||
{
|
||||
int Load(string SoundFile, bool Prescan);
|
||||
void SetPosition(int SoundStream, float NewPosition);
|
||||
void Play(int SoundStream);
|
||||
void Fade(int SoundStream, float TargetVolume, float Duration);
|
||||
int Load(string soundFile, bool prescan);
|
||||
void SetPosition(int soundStream, float newPosition);
|
||||
void Play(int soundStream);
|
||||
void Fade(int soundStream, float targetVolume, float duration);
|
||||
|
||||
bool IsFinished(int SoundStream);
|
||||
float GetPosition(int SoundStream);
|
||||
float GetLength(int SoundStream);
|
||||
void FadeAndStop(int SoundStream, float TargetVolume, float Duration);
|
||||
bool IsFinished(int soundStream);
|
||||
float GetPosition(int soundStream);
|
||||
float GetLength(int soundStream);
|
||||
void FadeAndStop(int soundStream, float targetVolume, float duration);
|
||||
|
||||
void SetStreamVolume(int SoundStream, float Volume);
|
||||
void SetStreamVolumeMax(int SoundStream, float MaxVolume);
|
||||
void SetStreamVolume(int soundStream, float volume);
|
||||
void SetStreamVolumeMax(int soundStream, float maxVolume);
|
||||
}
|
||||
|
||||
public interface ICover
|
||||
@@ -282,34 +282,34 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public interface IDataBase
|
||||
{
|
||||
bool GetCover(string FileName, ref STexture Texture, int CoverSize);
|
||||
bool GetCover(string fileName, ref STexture texture, int coverSize);
|
||||
}
|
||||
|
||||
public interface IInputs
|
||||
{
|
||||
void SetRumble(float Duration);
|
||||
void SetRumble(float duration);
|
||||
}
|
||||
|
||||
public interface IPlaylist
|
||||
{
|
||||
string GetPlaylistName(int PlaylistID);
|
||||
string GetPlaylistName(int playlistID);
|
||||
string[] GetPlaylistNames();
|
||||
|
||||
void SetPlaylistName(int PlaylistID, string Name);
|
||||
void DeletePlaylist(int PlaylistID);
|
||||
void SavePlaylist(int PlaylistID);
|
||||
void SetPlaylistName(int playlistID, string name);
|
||||
void DeletePlaylist(int playlistID);
|
||||
void SavePlaylist(int playlistID);
|
||||
int GetNumPlaylists();
|
||||
|
||||
void AddPlaylistSong(int PlaylistID, int SongID);
|
||||
void AddPlaylistSong(int PlaylistID, int SongID, EGameMode GameMode);
|
||||
void InsertPlaylistSong(int PlaylistID, int PositionIndex, int SongID, EGameMode GameMode);
|
||||
void AddPlaylistSong(int playlistID, int songID);
|
||||
void AddPlaylistSong(int playlistID, int songID, EGameMode gameMode);
|
||||
void InsertPlaylistSong(int playlistID, int positionIndex, int songID, EGameMode gameMode);
|
||||
|
||||
void MovePlaylistSong(int PlaylistID, int SourceIndex, int DestIndex);
|
||||
void MovePlaylistSongDown(int PlaylistID, int SongIndex);
|
||||
void MovePlaylistSongUp(int PlaylistID, int SongIndex);
|
||||
void DeletePlaylistSong(int PlaylistID, int SongIndex);
|
||||
void MovePlaylistSong(int playlistID, int sourceIndex, int destIndex);
|
||||
void MovePlaylistSongDown(int playlistID, int songIndex);
|
||||
void MovePlaylistSongUp(int playlistID, int songIndex);
|
||||
void DeletePlaylistSong(int playlistID, int songIndex);
|
||||
|
||||
int GetPlaylistSongCount(int PlaylistID);
|
||||
CPlaylistSong GetPlaylistSong(int PlaylistID, int SongIndex);
|
||||
int GetPlaylistSongCount(int playlistID);
|
||||
CPlaylistSong GetPlaylistSong(int playlistID, int songIndex);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
string GetThemeName();
|
||||
|
||||
bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex);
|
||||
bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex);
|
||||
bool SaveTheme(XmlWriter writer);
|
||||
|
||||
void UnloadTextures();
|
||||
|
||||
@@ -25,41 +25,41 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_Lines.Add(new CLines(lines));
|
||||
}
|
||||
|
||||
public CLines GetLines(int Index)
|
||||
public CLines GetLines(int index)
|
||||
{
|
||||
while (Index >= _Lines.Count)
|
||||
while (index >= _Lines.Count)
|
||||
_Lines.Add(new CLines());
|
||||
|
||||
return _Lines[Index];
|
||||
return _Lines[index];
|
||||
}
|
||||
|
||||
public int GetPoints(int Index)
|
||||
public int GetPoints(int index)
|
||||
{
|
||||
if (Index >= _Lines.Count)
|
||||
if (index >= _Lines.Count)
|
||||
return 0;
|
||||
|
||||
return _Lines[Index].Points;
|
||||
return _Lines[index].Points;
|
||||
}
|
||||
|
||||
public int GetNumLinesWithPoints(int Index)
|
||||
public int GetNumLinesWithPoints(int index)
|
||||
{
|
||||
if (Index >= _Lines.Count)
|
||||
if (index >= _Lines.Count)
|
||||
return 0;
|
||||
|
||||
return _Lines[Index].NumLinesWithPoints;
|
||||
return _Lines[index].NumLinesWithPoints;
|
||||
}
|
||||
|
||||
public void AddLines(CLines Lines)
|
||||
public void AddLines(CLines lines)
|
||||
{
|
||||
_Lines.Add(Lines);
|
||||
_Lines.Add(lines);
|
||||
}
|
||||
|
||||
public bool ReplaceLinesAt(int Index, CLines Lines)
|
||||
public bool ReplaceLinesAt(int index, CLines lines)
|
||||
{
|
||||
if (Index >= _Lines.Count)
|
||||
if (index >= _Lines.Count)
|
||||
return false;
|
||||
|
||||
_Lines[Index] = Lines;
|
||||
_Lines[index] = lines;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -68,10 +68,10 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_Lines.Clear();
|
||||
}
|
||||
|
||||
public void SetMedley(int StartBeat, int EndBeat)
|
||||
public void SetMedley(int startBeat, int endBeat)
|
||||
{
|
||||
foreach (CLines lines in _Lines)
|
||||
lines.SetMedley(StartBeat, EndBeat);
|
||||
lines.SetMedley(startBeat, endBeat);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,38 +108,38 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_Perfect = note._Perfect;
|
||||
}
|
||||
|
||||
public CNote(int StartBeat, int Duration, int Tone, string Text)
|
||||
public CNote(int startBeat, int duration, int tone, string text)
|
||||
: this()
|
||||
{
|
||||
this.StartBeat = StartBeat;
|
||||
this.Duration = Duration;
|
||||
this.Tone = Tone;
|
||||
this.StartBeat = startBeat;
|
||||
this.Duration = duration;
|
||||
this.Tone = tone;
|
||||
NoteType = ENoteType.Normal;
|
||||
this.Text = Text;
|
||||
this.Text = text;
|
||||
}
|
||||
|
||||
public CNote(int StartBeat, int Duration, int Tone, string Text, bool Hit)
|
||||
public CNote(int startBeat, int duration, int tone, string text, bool hit)
|
||||
: this()
|
||||
{
|
||||
this.StartBeat = StartBeat;
|
||||
this.Duration = Duration;
|
||||
this.Tone = Tone;
|
||||
this.StartBeat = startBeat;
|
||||
this.Duration = duration;
|
||||
this.Tone = tone;
|
||||
NoteType = ENoteType.Normal;
|
||||
this.Text = Text;
|
||||
this.Hit = Hit;
|
||||
this.Text = text;
|
||||
this.Hit = hit;
|
||||
}
|
||||
|
||||
public CNote(int StartBeat, int Duration, int Tone, string Text, ENoteType NoteType)
|
||||
: this(StartBeat, Duration, Tone, Text)
|
||||
public CNote(int startBeat, int duration, int tone, string text, ENoteType noteType)
|
||||
: this(startBeat, duration, tone, text)
|
||||
{
|
||||
this.NoteType = NoteType;
|
||||
this.NoteType = noteType;
|
||||
}
|
||||
|
||||
public CNote(int StartBeat, int Duration, int Tone, string Text, bool Hit, ENoteType NoteType)
|
||||
: this(StartBeat, Duration, Tone, Text)
|
||||
public CNote(int startBeat, int duration, int tone, string text, bool hit, ENoteType noteType)
|
||||
: this(startBeat, duration, tone, text)
|
||||
{
|
||||
this.NoteType = NoteType;
|
||||
this.Hit = Hit;
|
||||
this.NoteType = noteType;
|
||||
this.Hit = hit;
|
||||
}
|
||||
#endregion Constructors
|
||||
|
||||
@@ -237,24 +237,24 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
public bool IsPerfect(CNote CompareNote)
|
||||
public bool IsPerfect(CNote compareNote)
|
||||
{
|
||||
bool Result = true;
|
||||
bool result = true;
|
||||
|
||||
if (!Hit)
|
||||
Result = false;
|
||||
result = false;
|
||||
|
||||
if (StartBeat != CompareNote.StartBeat)
|
||||
Result = false;
|
||||
if (StartBeat != compareNote.StartBeat)
|
||||
result = false;
|
||||
|
||||
if (EndBeat != CompareNote.EndBeat)
|
||||
Result = false;
|
||||
if (EndBeat != compareNote.EndBeat)
|
||||
result = false;
|
||||
|
||||
if (Tone != CompareNote.Tone)
|
||||
Result = false;
|
||||
if (Tone != compareNote.Tone)
|
||||
result = false;
|
||||
|
||||
Perfect = Result;
|
||||
return Result;
|
||||
Perfect = result;
|
||||
return result;
|
||||
}
|
||||
#endregion Methods
|
||||
}
|
||||
@@ -387,38 +387,38 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
{
|
||||
get
|
||||
{
|
||||
int Min = int.MaxValue;
|
||||
int Max = int.MinValue;
|
||||
int min = int.MaxValue;
|
||||
int max = int.MinValue;
|
||||
foreach (CNote note in _Notes)
|
||||
{
|
||||
if (note.Tone < Min)
|
||||
Min = note.Tone;
|
||||
if (note.Tone > Max)
|
||||
Max = note.Tone;
|
||||
if (note.Tone < min)
|
||||
min = note.Tone;
|
||||
if (note.Tone > max)
|
||||
max = note.Tone;
|
||||
}
|
||||
|
||||
return Min - (Max - Min) / 4;
|
||||
return min - (max - min) / 4;
|
||||
}
|
||||
}
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
public bool IsPerfect(CLine CompareLine)
|
||||
public bool IsPerfect(CLine compareLine)
|
||||
{
|
||||
if (_Notes.Count == 0)
|
||||
return false;
|
||||
|
||||
if (_Notes.Count != CompareLine.NoteCount)
|
||||
if (_Notes.Count != compareLine.NoteCount)
|
||||
return false;
|
||||
|
||||
if (CompareLine.Points == 0)
|
||||
if (compareLine.Points == 0)
|
||||
return false;
|
||||
|
||||
_PerfectLine = Points == CompareLine.Points;
|
||||
_PerfectLine = Points == compareLine.Points;
|
||||
return _PerfectLine;
|
||||
}
|
||||
|
||||
public int FindPreviousNote(int Beat)
|
||||
public int FindPreviousNote(int beat)
|
||||
{
|
||||
//If no notes -> No previous note
|
||||
if (_Notes.Count == 0)
|
||||
@@ -426,15 +426,15 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
int start = 0;
|
||||
int end = _Notes.Count - 1;
|
||||
//Ensure that start.StartBeat<=Beat && end.StartBeat>Beat
|
||||
if (_Notes[0].StartBeat > Beat)
|
||||
if (_Notes[0].StartBeat > beat)
|
||||
return -1;
|
||||
if (_Notes[end].StartBeat <= Beat)
|
||||
if (_Notes[end].StartBeat <= beat)
|
||||
return end;
|
||||
//Binary search
|
||||
while (end - start > 1)
|
||||
{
|
||||
int mid = (start + end) / 2;
|
||||
if (_Notes[mid].StartBeat <= Beat)
|
||||
if (_Notes[mid].StartBeat <= beat)
|
||||
start = mid;
|
||||
else
|
||||
end = mid;
|
||||
@@ -442,13 +442,13 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
return start;
|
||||
}
|
||||
|
||||
public bool AddNote(CNote Note)
|
||||
public bool AddNote(CNote note)
|
||||
{
|
||||
if (_Notes.Count == 0)
|
||||
_Notes.Add(Note);
|
||||
_Notes.Add(note);
|
||||
else
|
||||
{
|
||||
int insPos = FindPreviousNote(Note.StartBeat);
|
||||
int insPos = FindPreviousNote(note.StartBeat);
|
||||
//Flamefire: May be a performance hit as notes are also used for sung notes
|
||||
//But for song loading this might be very helpful!
|
||||
//Check for overlapping notes
|
||||
@@ -457,30 +457,30 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
if (insPos < _Notes.Count - 1 && _Notes[insPos+1].StartBeat > Note.EndBeat)
|
||||
return false;
|
||||
* */
|
||||
_Notes.Insert(insPos + 1, Note);
|
||||
_Notes.Insert(insPos + 1, note);
|
||||
}
|
||||
updateMinMaxBeat(Note);
|
||||
_UpdateMinMaxBeat(note);
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool DeleteNote(int Index)
|
||||
public bool DeleteNote(int index)
|
||||
{
|
||||
if (_Notes.Count > Index)
|
||||
if (_Notes.Count > index)
|
||||
{
|
||||
_Notes.RemoveAt(Index);
|
||||
if (Index == 0 || Index == _Notes.Count - 1)
|
||||
updateMinMaxBeat();
|
||||
_Notes.RemoveAt(index);
|
||||
if (index == 0 || index == _Notes.Count - 1)
|
||||
_UpdateMinMaxBeat();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool ReplaceNote(int Index, CNote Note)
|
||||
public bool ReplaceNote(int index, CNote note)
|
||||
{
|
||||
if (_Notes.Count > Index)
|
||||
if (_Notes.Count > index)
|
||||
{
|
||||
_Notes.RemoveAt(Index);
|
||||
return AddNote(Note);
|
||||
_Notes.RemoveAt(index);
|
||||
return AddNote(note);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -498,30 +498,30 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
public void DeleteAllNotes()
|
||||
{
|
||||
_Notes.Clear();
|
||||
updateMinMaxBeat();
|
||||
_UpdateMinMaxBeat();
|
||||
}
|
||||
|
||||
public void SetMedley(int StartBeat, int EndBeat)
|
||||
public void SetMedley(int startBeat, int endBeat)
|
||||
{
|
||||
foreach (CNote note in _Notes)
|
||||
{
|
||||
if (note.StartBeat < StartBeat || note.EndBeat > EndBeat)
|
||||
if (note.StartBeat < startBeat || note.EndBeat > endBeat)
|
||||
note.NoteType = ENoteType.Freestyle;
|
||||
}
|
||||
|
||||
_VisibleInTimeLine = _MinBeat >= StartBeat && _MaxBeat <= EndBeat;
|
||||
_VisibleInTimeLine = _MinBeat >= startBeat && _MaxBeat <= endBeat;
|
||||
}
|
||||
|
||||
private void updateMinMaxBeat(CNote Note)
|
||||
private void _UpdateMinMaxBeat(CNote note)
|
||||
{
|
||||
if (Note.StartBeat < _MinBeat)
|
||||
_MinBeat = Note.StartBeat;
|
||||
if (note.StartBeat < _MinBeat)
|
||||
_MinBeat = note.StartBeat;
|
||||
|
||||
if (Note.EndBeat > _MaxBeat)
|
||||
_MaxBeat = Note.EndBeat;
|
||||
if (note.EndBeat > _MaxBeat)
|
||||
_MaxBeat = note.EndBeat;
|
||||
}
|
||||
|
||||
private void updateMinMaxBeat()
|
||||
private void _UpdateMinMaxBeat()
|
||||
{
|
||||
if (_Notes.Count > 0)
|
||||
{
|
||||
@@ -617,7 +617,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
#region Methods
|
||||
//Find last line with StartBeat<=Beat
|
||||
public int FindPreviousLine(int Beat)
|
||||
public int FindPreviousLine(int beat)
|
||||
{
|
||||
//If no line -> No previous line
|
||||
if (_Lines.Count == 0)
|
||||
@@ -625,15 +625,15 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
int start = 0;
|
||||
int end = _Lines.Count - 1;
|
||||
//Ensure that start.StartBeat<=Beat && end.StartBeat>Beat
|
||||
if (_Lines[0].StartBeat > Beat)
|
||||
if (_Lines[0].StartBeat > beat)
|
||||
return -1;
|
||||
if (_Lines[end].StartBeat <= Beat)
|
||||
if (_Lines[end].StartBeat <= beat)
|
||||
return end;
|
||||
//Binary search
|
||||
while (end - start > 1)
|
||||
{
|
||||
int mid = (start + end) / 2;
|
||||
if (_Lines[mid].StartBeat <= Beat)
|
||||
if (_Lines[mid].StartBeat <= beat)
|
||||
start = mid;
|
||||
else
|
||||
end = mid;
|
||||
@@ -641,22 +641,22 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
return start;
|
||||
}
|
||||
|
||||
public void AddLine(CLine Line)
|
||||
public void AddLine(CLine line)
|
||||
{
|
||||
if (_Lines.Count == 0)
|
||||
_Lines.Add(Line);
|
||||
_Lines.Add(line);
|
||||
else
|
||||
{
|
||||
int insPos = FindPreviousLine(Line.StartBeat);
|
||||
_Lines.Insert(insPos + 1, Line);
|
||||
int insPos = FindPreviousLine(line.StartBeat);
|
||||
_Lines.Insert(insPos + 1, line);
|
||||
}
|
||||
}
|
||||
|
||||
public bool DeleteLine(int Index)
|
||||
public bool DeleteLine(int index)
|
||||
{
|
||||
if (_Lines.Count > Index)
|
||||
if (_Lines.Count > index)
|
||||
{
|
||||
_Lines.RemoveAt(Index);
|
||||
_Lines.RemoveAt(index);
|
||||
UpdateTimings();
|
||||
return true;
|
||||
}
|
||||
@@ -668,20 +668,20 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_Lines.Clear();
|
||||
}
|
||||
|
||||
public bool AddNote(CNote Note, bool updateTimings = false)
|
||||
public bool AddNote(CNote note, bool updateTimings = false)
|
||||
{
|
||||
int LineIndex = FindPreviousLine(Note.StartBeat);
|
||||
if (LineIndex < 0)
|
||||
int lineIndex = FindPreviousLine(note.StartBeat);
|
||||
if (lineIndex < 0)
|
||||
{
|
||||
//Note is before ALL lines
|
||||
CLine Line = new CLine();
|
||||
Line.StartBeat = Note.StartBeat;
|
||||
Line.AddNote(Note);
|
||||
_Lines.Insert(0, Line);
|
||||
CLine line = new CLine();
|
||||
line.StartBeat = note.StartBeat;
|
||||
line.AddNote(note);
|
||||
_Lines.Insert(0, line);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!_Lines[LineIndex].AddNote(Note))
|
||||
if (!_Lines[lineIndex].AddNote(note))
|
||||
return false;
|
||||
}
|
||||
if (updateTimings)
|
||||
@@ -689,11 +689,11 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool InsertNote(CNote Note, int LineIndex, bool updateTimings = false)
|
||||
public bool InsertNote(CNote note, int lineIndex, bool updateTimings = false)
|
||||
{
|
||||
if (_Lines.Count > LineIndex && _Lines[LineIndex].StartBeat <= Note.StartBeat)
|
||||
if (_Lines.Count > lineIndex && _Lines[lineIndex].StartBeat <= note.StartBeat)
|
||||
{
|
||||
_Lines[LineIndex].AddNote(Note);
|
||||
_Lines[lineIndex].AddNote(note);
|
||||
if (updateTimings)
|
||||
UpdateTimings();
|
||||
return true;
|
||||
@@ -703,7 +703,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
public void UpdateTimings()
|
||||
{
|
||||
CNote LastNote, FirstNote;
|
||||
CNote lastNote;
|
||||
int min, max, s;
|
||||
|
||||
if (_Lines.Count > 0)
|
||||
@@ -711,13 +711,13 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
for (int i = 1; i < _Lines.Count; i++)
|
||||
{
|
||||
LastNote = _Lines[i - 1].LastNote;
|
||||
FirstNote = _Lines[i].FirstNote;
|
||||
lastNote = _Lines[i - 1].LastNote;
|
||||
CNote firstNote = _Lines[i].FirstNote;
|
||||
|
||||
if ((LastNote != null) && (FirstNote != null))
|
||||
if ((lastNote != null) && (firstNote != null))
|
||||
{
|
||||
min = LastNote.EndBeat;
|
||||
max = FirstNote.StartBeat;
|
||||
min = lastNote.EndBeat;
|
||||
max = firstNote.StartBeat;
|
||||
|
||||
switch (max - min)
|
||||
{
|
||||
@@ -743,15 +743,15 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
}
|
||||
}
|
||||
|
||||
LastNote = _Lines[_Lines.Count - 1].LastNote;
|
||||
if (LastNote != null)
|
||||
_Lines[_Lines.Count - 1].EndBeat = LastNote.EndBeat;
|
||||
lastNote = _Lines[_Lines.Count - 1].LastNote;
|
||||
if (lastNote != null)
|
||||
_Lines[_Lines.Count - 1].EndBeat = lastNote.EndBeat;
|
||||
}
|
||||
|
||||
public void SetMedley(int StartBeat, int EndBeat)
|
||||
public void SetMedley(int startBeat, int endBeat)
|
||||
{
|
||||
foreach (CLine line in _Lines)
|
||||
line.SetMedley(StartBeat, EndBeat);
|
||||
line.SetMedley(startBeat, endBeat);
|
||||
}
|
||||
#endregion Methods
|
||||
}
|
||||
|
||||
@@ -61,9 +61,9 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
set { _BarPos = value; }
|
||||
}
|
||||
|
||||
public CSingNotes(int PartyModeID)
|
||||
public CSingNotes(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeSingBar();
|
||||
_ThemeLoaded = false;
|
||||
|
||||
@@ -76,9 +76,9 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string item = XmlPath + "/" + ElementName;
|
||||
string item = xmlPath + "/" + elementName;
|
||||
_ThemeLoaded = true;
|
||||
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/SkinLeft", ref _Theme.SkinLeftName, String.Empty);
|
||||
@@ -113,7 +113,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = ElementName;
|
||||
_Theme.Name = elementName;
|
||||
LoadTextures();
|
||||
}
|
||||
|
||||
@@ -189,17 +189,17 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_ActID = 0;
|
||||
}
|
||||
|
||||
public virtual int AddPlayer(SRectF Rect, SColorF Color, int PlayerNr)
|
||||
public virtual int AddPlayer(SRectF rect, SColorF color, int playerNr)
|
||||
{
|
||||
SPlayerNotes notes = new SPlayerNotes();
|
||||
|
||||
notes.Rect = Rect;
|
||||
notes.Color = Color;
|
||||
notes.Rect = rect;
|
||||
notes.Color = color;
|
||||
notes.Alpha = 1f;
|
||||
notes.ID = ++_ActID;
|
||||
notes.Lines = null;
|
||||
notes.LineNr = -1;
|
||||
notes.PlayerNr = PlayerNr;
|
||||
notes.PlayerNr = playerNr;
|
||||
notes.Timer = new Stopwatch();
|
||||
notes.GoldenStars = new List<CParticleEffect>();
|
||||
notes.Flares = new List<CParticleEffect>();
|
||||
@@ -210,27 +210,27 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
return notes.ID;
|
||||
}
|
||||
|
||||
public virtual void RemovePlayer(int ID) {}
|
||||
public virtual void RemovePlayer(int iD) {}
|
||||
|
||||
public virtual void AddLine(int ID, CLine[] Line, int LineNr, int Player)
|
||||
public virtual void AddLine(int iD, CLine[] line, int lineNr, int player)
|
||||
{
|
||||
if (Line == null)
|
||||
if (line == null)
|
||||
return;
|
||||
|
||||
int n = FindPlayerLine(ID);
|
||||
int n = _FindPlayerLine(iD);
|
||||
if (n == -1)
|
||||
return;
|
||||
|
||||
if (LineNr == _PlayerNotes[n].LineNr)
|
||||
if (lineNr == _PlayerNotes[n].LineNr)
|
||||
return;
|
||||
|
||||
SPlayerNotes notes = _PlayerNotes[n];
|
||||
|
||||
if (Line.Length == 0 || Line.Length <= LineNr)
|
||||
if (line.Length == 0 || line.Length <= lineNr)
|
||||
return;
|
||||
|
||||
notes.Lines = Line;
|
||||
notes.LineNr = LineNr;
|
||||
notes.Lines = line;
|
||||
notes.LineNr = lineNr;
|
||||
notes.GoldenStars.Clear();
|
||||
notes.Flares.Clear();
|
||||
notes.PerfectNoteEffect.Clear();
|
||||
@@ -239,38 +239,38 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_PlayerNotes.Add(notes);
|
||||
}
|
||||
|
||||
public virtual void RemoveLine(int ID) {}
|
||||
public virtual void RemoveLine(int iD) {}
|
||||
|
||||
public virtual void AddNote(int ID, CNote Note) {}
|
||||
public virtual void AddNote(int iD, CNote note) {}
|
||||
|
||||
public virtual void SetAlpha(int ID, float Alpha)
|
||||
public virtual void SetAlpha(int iD, float alpha)
|
||||
{
|
||||
int n = FindPlayerLine(ID);
|
||||
int n = _FindPlayerLine(iD);
|
||||
if (n == -1)
|
||||
return;
|
||||
|
||||
SPlayerNotes pn = _PlayerNotes[n];
|
||||
pn.Alpha = Alpha;
|
||||
pn.Alpha = alpha;
|
||||
_PlayerNotes[n] = pn;
|
||||
}
|
||||
|
||||
public virtual float GetAlpha(int ID)
|
||||
public virtual float GetAlpha(int iD)
|
||||
{
|
||||
int n = FindPlayerLine(ID);
|
||||
int n = _FindPlayerLine(iD);
|
||||
if (n == -1)
|
||||
return 0f;
|
||||
|
||||
return _PlayerNotes[n].Alpha;
|
||||
}
|
||||
|
||||
public virtual void Draw(int ID, int Player)
|
||||
public virtual void Draw(int iD, int player)
|
||||
{
|
||||
Draw(ID, null, Player);
|
||||
Draw(iD, null, player);
|
||||
}
|
||||
|
||||
public virtual void Draw(int ID, List<CLine> SingLine, int Player)
|
||||
public virtual void Draw(int iD, List<CLine> singLine, int player)
|
||||
{
|
||||
int n = FindPlayerLine(ID);
|
||||
int n = _FindPlayerLine(iD);
|
||||
if (n == -1)
|
||||
return;
|
||||
|
||||
@@ -283,19 +283,19 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
if (_PlayerNotes[n].Lines.Length <= _PlayerNotes[n].LineNr)
|
||||
return;
|
||||
|
||||
CLine Line = _PlayerNotes[n].Lines[_PlayerNotes[n].LineNr];
|
||||
CLine line = _PlayerNotes[n].Lines[_PlayerNotes[n].LineNr];
|
||||
|
||||
if (CBase.Config.GetDrawNoteLines() == EOffOn.TR_CONFIG_ON)
|
||||
DrawNoteLines(_PlayerNotes[n].Rect, new SColorF(0.5f, 0.5f, 0.5f, 0.5f * _PlayerNotes[n].Alpha));
|
||||
_DrawNoteLines(_PlayerNotes[n].Rect, new SColorF(0.5f, 0.5f, 0.5f, 0.5f * _PlayerNotes[n].Alpha));
|
||||
|
||||
if (Line.NoteCount == 0)
|
||||
if (line.NoteCount == 0)
|
||||
return;
|
||||
|
||||
float w = _PlayerNotes[n].Rect.W;
|
||||
float h = _PlayerNotes[n].Rect.H;
|
||||
float dh = h / CBase.Settings.GetNumNoteLines() * (2f - (int)CBase.Game.GetPlayer()[_PlayerNotes[n].PlayerNr].Difficulty) / 4f;
|
||||
|
||||
float beats = Line.LastNoteBeat - Line.FirstNoteBeat + 1;
|
||||
float beats = line.LastNoteBeat - line.FirstNoteBeat + 1;
|
||||
|
||||
if (beats == 0)
|
||||
return;
|
||||
@@ -306,35 +306,35 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_PlayerNotes[n].Color.B,
|
||||
_PlayerNotes[n].Color.A * _PlayerNotes[n].Alpha);
|
||||
|
||||
float BaseLine = Line.BaseLine;
|
||||
int Nr = 1;
|
||||
foreach (CNote note in Line.Notes)
|
||||
float baseLine = line.BaseLine;
|
||||
int nr = 1;
|
||||
foreach (CNote note in line.Notes)
|
||||
{
|
||||
if (note.NoteType != ENoteType.Freestyle)
|
||||
{
|
||||
float width = note.Duration / beats * w;
|
||||
|
||||
SRectF rect = new SRectF(
|
||||
_PlayerNotes[n].Rect.X + (note.StartBeat - Line.FirstNoteBeat) / beats * w,
|
||||
_PlayerNotes[n].Rect.Y + (CBase.Settings.GetNumNoteLines() - 1 - (note.Tone - BaseLine) / 2) / CBase.Settings.GetNumNoteLines() * h - dh,
|
||||
_PlayerNotes[n].Rect.X + (note.StartBeat - line.FirstNoteBeat) / beats * w,
|
||||
_PlayerNotes[n].Rect.Y + (CBase.Settings.GetNumNoteLines() - 1 - (note.Tone - baseLine) / 2) / CBase.Settings.GetNumNoteLines() * h - dh,
|
||||
width,
|
||||
h / CBase.Settings.GetNumNoteLines() + 2 * dh,
|
||||
_PlayerNotes[n].Rect.Z
|
||||
);
|
||||
|
||||
DrawNoteBG(rect, color, 1f, _PlayerNotes[n].Timer);
|
||||
DrawNote(rect, new SColorF(5f, 5f, 5f, 0.7f * _PlayerNotes[n].Alpha), 0.7f);
|
||||
_DrawNoteBG(rect, color, 1f, _PlayerNotes[n].Timer);
|
||||
_DrawNote(rect, new SColorF(5f, 5f, 5f, 0.7f * _PlayerNotes[n].Alpha), 0.7f);
|
||||
|
||||
if (note.NoteType == ENoteType.Golden)
|
||||
{
|
||||
AddGoldenNote(rect, n, Nr);
|
||||
Nr++;
|
||||
_AddGoldenNote(rect, n, nr);
|
||||
nr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (CBase.Config.GetDrawToneHelper() == EOffOn.TR_CONFIG_ON)
|
||||
DrawToneHelper(n, (int)BaseLine, (CBase.Game.GetMidBeatD() - Line.FirstNoteBeat) / beats * w);
|
||||
_DrawToneHelper(n, (int)baseLine, (CBase.Game.GetMidBeatD() - line.FirstNoteBeat) / beats * w);
|
||||
|
||||
int i = 0;
|
||||
while (i < _PlayerNotes[n].PerfectLineTwinkle.Count)
|
||||
@@ -348,7 +348,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
foreach (CParticleEffect perfline in _PlayerNotes[n].PerfectLineTwinkle)
|
||||
perfline.Draw();
|
||||
|
||||
if (SingLine == null || SingLine.Count == 0 || CBase.Game.GetPlayer()[Player].CurrentLine == -1 || SingLine.Count <= CBase.Game.GetPlayer()[Player].CurrentLine)
|
||||
if (singLine == null || singLine.Count == 0 || CBase.Game.GetPlayer()[player].CurrentLine == -1 || singLine.Count <= CBase.Game.GetPlayer()[player].CurrentLine)
|
||||
{
|
||||
foreach (CParticleEffect stars in _PlayerNotes[n].GoldenStars)
|
||||
{
|
||||
@@ -358,9 +358,9 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (CNote note in SingLine[CBase.Game.GetPlayer()[Player].CurrentLine].Notes)
|
||||
foreach (CNote note in singLine[CBase.Game.GetPlayer()[player].CurrentLine].Notes)
|
||||
{
|
||||
if (note.StartBeat >= Line.FirstNoteBeat && note.EndBeat <= Line.LastNoteBeat)
|
||||
if (note.StartBeat >= line.FirstNoteBeat && note.EndBeat <= line.LastNoteBeat)
|
||||
{
|
||||
float width = note.Duration / beats * w;
|
||||
|
||||
@@ -368,8 +368,8 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
width -= (1 - (CBase.Game.GetMidBeatD() - CBase.Game.GetCurrentBeatD())) / beats * w;
|
||||
|
||||
SRectF rect = new SRectF(
|
||||
_PlayerNotes[n].Rect.X + (note.StartBeat - Line.FirstNoteBeat) / beats * w,
|
||||
_PlayerNotes[n].Rect.Y + (CBase.Settings.GetNumNoteLines() - 1 - (note.Tone - BaseLine) / 2) / CBase.Settings.GetNumNoteLines() * h - dh,
|
||||
_PlayerNotes[n].Rect.X + (note.StartBeat - line.FirstNoteBeat) / beats * w,
|
||||
_PlayerNotes[n].Rect.Y + (CBase.Settings.GetNumNoteLines() - 1 - (note.Tone - baseLine) / 2) / CBase.Settings.GetNumNoteLines() * h - dh,
|
||||
width,
|
||||
h / CBase.Settings.GetNumNoteLines() + 2 * dh,
|
||||
_PlayerNotes[n].Rect.Z
|
||||
@@ -379,30 +379,30 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
if (!note.Hit)
|
||||
f = 0.4f;
|
||||
|
||||
DrawNote(rect, color, f);
|
||||
_DrawNote(rect, color, f);
|
||||
|
||||
if (note.EndBeat >= CBase.Game.GetCurrentBeatD() && note.Hit && note.NoteType == ENoteType.Golden)
|
||||
{
|
||||
SRectF re = new SRectF(rect);
|
||||
re.W = (CBase.Game.GetMidBeatD() - note.StartBeat) / beats * w;
|
||||
AddFlare(re, n);
|
||||
_AddFlare(re, n);
|
||||
}
|
||||
|
||||
if (note.Perfect && note.EndBeat < CBase.Game.GetCurrentBeatD())
|
||||
{
|
||||
AddPerfectNote(rect, n);
|
||||
_AddPerfectNote(rect, n);
|
||||
note.Perfect = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int currentLine = CBase.Game.GetPlayer()[Player].SingLine.Count - 1;
|
||||
int currentLine = CBase.Game.GetPlayer()[player].SingLine.Count - 1;
|
||||
if (currentLine > 0)
|
||||
{
|
||||
if (CBase.Game.GetPlayer()[Player].SingLine[currentLine - 1].PerfectLine)
|
||||
if (CBase.Game.GetPlayer()[player].SingLine[currentLine - 1].PerfectLine)
|
||||
{
|
||||
AddPerfectLine(n);
|
||||
CBase.Game.GetPlayer()[Player].SingLine[currentLine - 1].PerfectLine = false;
|
||||
_AddPerfectLine(n);
|
||||
CBase.Game.GetPlayer()[player].SingLine[currentLine - 1].PerfectLine = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,15 +448,15 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
LoadTextures();
|
||||
}
|
||||
|
||||
private int FindPlayerLine(int ID)
|
||||
private int _FindPlayerLine(int iD)
|
||||
{
|
||||
if (ID < 0 || ID > _PlayerNotes.Count)
|
||||
if (iD < 0 || iD > _PlayerNotes.Count)
|
||||
return -1;
|
||||
|
||||
int n = -1;
|
||||
for (int i = 0; i < _PlayerNotes.Count; i++)
|
||||
{
|
||||
if (_PlayerNotes[i].ID == ID)
|
||||
if (_PlayerNotes[i].ID == iD)
|
||||
{
|
||||
n = i;
|
||||
break;
|
||||
@@ -466,128 +466,128 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
return n;
|
||||
}
|
||||
|
||||
private void DrawNote(SRectF Rect, SColorF Color)
|
||||
private void _DrawNote(SRectF rect, SColorF color)
|
||||
{
|
||||
DrawNote(Rect, Color, 1f);
|
||||
_DrawNote(rect, color, 1f);
|
||||
}
|
||||
|
||||
private void DrawNote(SRectF Rect, SColorF Color, float factor)
|
||||
private void _DrawNote(SRectF rect, SColorF color, float factor)
|
||||
{
|
||||
const int spacing = 0;
|
||||
|
||||
float d = (1f - factor) / 2 * Rect.H;
|
||||
float d = (1f - factor) / 2 * rect.H;
|
||||
float dw = d;
|
||||
|
||||
if (2 * dw > Rect.W)
|
||||
dw = Rect.W / 2;
|
||||
if (2 * dw > rect.W)
|
||||
dw = rect.W / 2;
|
||||
|
||||
SRectF r = new SRectF(
|
||||
Rect.X + dw + spacing,
|
||||
Rect.Y + d + spacing,
|
||||
Rect.W - 2 * dw - 2 * spacing,
|
||||
Rect.H - 2 * d - 2 * spacing,
|
||||
Rect.Z
|
||||
rect.X + dw + spacing,
|
||||
rect.Y + d + spacing,
|
||||
rect.W - 2 * dw - 2 * spacing,
|
||||
rect.H - 2 * d - 2 * spacing,
|
||||
rect.Z
|
||||
);
|
||||
|
||||
STexture NoteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
|
||||
STexture NoteMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinMiddleName, _PartyModeID);
|
||||
STexture NoteEnd = CBase.Theme.GetSkinTexture(_Theme.SkinRightName, _PartyModeID);
|
||||
STexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
|
||||
STexture noteMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinMiddleName, _PartyModeID);
|
||||
STexture noteEnd = CBase.Theme.GetSkinTexture(_Theme.SkinRightName, _PartyModeID);
|
||||
|
||||
float dx = NoteBegin.width * r.H / NoteBegin.height;
|
||||
float dx = noteBegin.Width * r.H / noteBegin.Height;
|
||||
if (2 * dx > r.W)
|
||||
dx = r.W / 2;
|
||||
|
||||
|
||||
CBase.Drawing.DrawTexture(NoteBegin, new SRectF(r.X, r.Y, dx, r.H, r.Z), Color);
|
||||
CBase.Drawing.DrawTexture(noteBegin, new SRectF(r.X, r.Y, dx, r.H, r.Z), color);
|
||||
|
||||
if (r.W - 2 * dx >= 2 * dx)
|
||||
CBase.Drawing.DrawTexture(NoteMiddle, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z), Color);
|
||||
CBase.Drawing.DrawTexture(noteMiddle, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z), color);
|
||||
else
|
||||
CBase.Drawing.DrawTexture(NoteMiddle, new SRectF(r.X + dx, r.Y, 2 * dx, r.H, r.Z), Color, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z));
|
||||
CBase.Drawing.DrawTexture(noteMiddle, new SRectF(r.X + dx, r.Y, 2 * dx, r.H, r.Z), color, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z));
|
||||
|
||||
CBase.Drawing.DrawTexture(NoteEnd, new SRectF(r.X + r.W - dx, r.Y, dx, r.H, r.Z), Color);
|
||||
CBase.Drawing.DrawTexture(noteEnd, new SRectF(r.X + r.W - dx, r.Y, dx, r.H, r.Z), color);
|
||||
}
|
||||
|
||||
private void DrawNoteBG(SRectF Rect, SColorF Color, float factor, Stopwatch Timer)
|
||||
private void _DrawNoteBG(SRectF rect, SColorF color, float factor, Stopwatch timer)
|
||||
{
|
||||
const int spacing = 0;
|
||||
const float period = 1.5f; //[s]
|
||||
|
||||
if (!Timer.IsRunning)
|
||||
Timer.Start();
|
||||
if (!timer.IsRunning)
|
||||
timer.Start();
|
||||
|
||||
if (Timer.ElapsedMilliseconds / 1000f > period)
|
||||
if (timer.ElapsedMilliseconds / 1000f > period)
|
||||
{
|
||||
Timer.Reset();
|
||||
Timer.Start();
|
||||
timer.Reset();
|
||||
timer.Start();
|
||||
}
|
||||
|
||||
float alpha = (float)((Math.Cos((Timer.ElapsedMilliseconds / 1000f) / period * Math.PI * 2) + 1) / 2.0) / 2f + 0.5f;
|
||||
float d = (1f - factor) / 2 * Rect.H;
|
||||
float alpha = (float)((Math.Cos((timer.ElapsedMilliseconds / 1000f) / period * Math.PI * 2) + 1) / 2.0) / 2f + 0.5f;
|
||||
float d = (1f - factor) / 2 * rect.H;
|
||||
float dw = d;
|
||||
if (2 * dw > Rect.W)
|
||||
dw = Rect.W / 2;
|
||||
if (2 * dw > rect.W)
|
||||
dw = rect.W / 2;
|
||||
|
||||
SRectF r = new SRectF(
|
||||
Rect.X + dw + spacing,
|
||||
Rect.Y + d + spacing,
|
||||
Rect.W - 2 * dw - 2 * spacing,
|
||||
Rect.H - 2 * d - 2 * spacing,
|
||||
Rect.Z
|
||||
rect.X + dw + spacing,
|
||||
rect.Y + d + spacing,
|
||||
rect.W - 2 * dw - 2 * spacing,
|
||||
rect.H - 2 * d - 2 * spacing,
|
||||
rect.Z
|
||||
);
|
||||
|
||||
STexture NoteBackgroundBegin = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundLeftName, _PartyModeID);
|
||||
STexture NoteBackgroundMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundMiddleName, _PartyModeID);
|
||||
STexture NoteBackgroundEnd = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundRightName, _PartyModeID);
|
||||
STexture noteBackgroundBegin = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundLeftName, _PartyModeID);
|
||||
STexture noteBackgroundMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundMiddleName, _PartyModeID);
|
||||
STexture noteBackgroundEnd = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundRightName, _PartyModeID);
|
||||
|
||||
float dx = NoteBackgroundBegin.width * r.H / NoteBackgroundBegin.height;
|
||||
float dx = noteBackgroundBegin.Width * r.H / noteBackgroundBegin.Height;
|
||||
if (2 * dx > r.W)
|
||||
dx = r.W / 2;
|
||||
|
||||
SColorF col = new SColorF(Color.R, Color.G, Color.B, Color.A * alpha);
|
||||
SColorF col = new SColorF(color.R, color.G, color.B, color.A * alpha);
|
||||
|
||||
CBase.Drawing.DrawTexture(NoteBackgroundBegin, new SRectF(r.X, r.Y, dx, r.H, r.Z), col);
|
||||
CBase.Drawing.DrawTexture(noteBackgroundBegin, new SRectF(r.X, r.Y, dx, r.H, r.Z), col);
|
||||
|
||||
if (r.W - 2 * dx >= 2 * dx)
|
||||
CBase.Drawing.DrawTexture(NoteBackgroundMiddle, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z), col);
|
||||
CBase.Drawing.DrawTexture(noteBackgroundMiddle, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z), col);
|
||||
else
|
||||
CBase.Drawing.DrawTexture(NoteBackgroundMiddle, new SRectF(r.X + dx, r.Y, 2 * dx, r.H, r.Z), col, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z));
|
||||
CBase.Drawing.DrawTexture(noteBackgroundMiddle, new SRectF(r.X + dx, r.Y, 2 * dx, r.H, r.Z), col, new SRectF(r.X + dx, r.Y, r.W - 2 * dx, r.H, r.Z));
|
||||
|
||||
CBase.Drawing.DrawTexture(NoteBackgroundEnd, new SRectF(r.X + r.W - dx, r.Y, dx, r.H, r.Z), col);
|
||||
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)
|
||||
protected void _DrawNoteLines(SRectF rect, SColorF color)
|
||||
{
|
||||
for (int i = 0; i < CBase.Settings.GetNumNoteLines() - 1; 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));
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
private void AddGoldenNote(SRectF Rect, int n, int Nr)
|
||||
private void _AddGoldenNote(SRectF rect, int n, int nr)
|
||||
{
|
||||
AddGoldenNote(Rect, n, Nr, 1f);
|
||||
_AddGoldenNote(rect, n, nr, 1f);
|
||||
}
|
||||
|
||||
private void AddGoldenNote(SRectF Rect, int n, int Nr, float factor)
|
||||
private void _AddGoldenNote(SRectF rect, int n, int nr, float factor)
|
||||
{
|
||||
const int spacing = 0;
|
||||
|
||||
if (Nr > _PlayerNotes[n].GoldenStars.Count)
|
||||
if (nr > _PlayerNotes[n].GoldenStars.Count)
|
||||
{
|
||||
float d = (1f - factor) / 2 * Rect.H;
|
||||
float d = (1f - factor) / 2 * rect.H;
|
||||
float dw = d;
|
||||
|
||||
if (2 * dw > Rect.W)
|
||||
dw = Rect.W / 2;
|
||||
if (2 * dw > rect.W)
|
||||
dw = rect.W / 2;
|
||||
|
||||
SRectF r = new SRectF(
|
||||
Rect.X + dw + spacing,
|
||||
Rect.Y + d + spacing,
|
||||
Rect.W - 2 * dw - 2 * spacing,
|
||||
Rect.H - 2 * d - 2 * spacing,
|
||||
Rect.Z
|
||||
rect.X + dw + spacing,
|
||||
rect.Y + d + spacing,
|
||||
rect.W - 2 * dw - 2 * spacing,
|
||||
rect.H - 2 * d - 2 * spacing,
|
||||
rect.Z
|
||||
);
|
||||
|
||||
int numstars = (int)(r.W * 0.25f);
|
||||
@@ -596,58 +596,58 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
}
|
||||
}
|
||||
|
||||
private void AddFlare(SRectF Rect, int n)
|
||||
private void _AddFlare(SRectF rect, int n)
|
||||
{
|
||||
AddFlare(Rect, n, 1f);
|
||||
_AddFlare(rect, n, 1f);
|
||||
}
|
||||
|
||||
private void AddFlare(SRectF Rect, int n, float factor)
|
||||
private void _AddFlare(SRectF rect, int n, float factor)
|
||||
{
|
||||
const int spacing = 0;
|
||||
|
||||
float d = (1f - factor) / 2 * Rect.H;
|
||||
float d = (1f - factor) / 2 * rect.H;
|
||||
float dw = d;
|
||||
|
||||
if (2 * dw > Rect.W)
|
||||
dw = Rect.W / 2;
|
||||
if (2 * dw > rect.W)
|
||||
dw = rect.W / 2;
|
||||
|
||||
SRectF r = new SRectF(
|
||||
Rect.X + dw + spacing + Rect.W - 2 * dw - 2 * spacing,
|
||||
Rect.Y + d + spacing,
|
||||
rect.X + dw + spacing + rect.W - 2 * dw - 2 * spacing,
|
||||
rect.Y + d + spacing,
|
||||
0f,
|
||||
Rect.H - 2 * d - 2 * spacing,
|
||||
Rect.Z
|
||||
rect.H - 2 * d - 2 * spacing,
|
||||
rect.Z
|
||||
);
|
||||
|
||||
CParticleEffect flares = new CParticleEffect(_PartyModeID, 15, new SColorF(1f, 1f, 1f, 1f), r, _Theme.SkinGoldenStarName, 20, EParticleType.Flare);
|
||||
_PlayerNotes[n].Flares.Add(flares);
|
||||
}
|
||||
|
||||
private void AddPerfectNote(SRectF Rect, int n)
|
||||
private void _AddPerfectNote(SRectF rect, int n)
|
||||
{
|
||||
AddPerfectNote(Rect, n, 1f);
|
||||
_AddPerfectNote(rect, n, 1f);
|
||||
}
|
||||
|
||||
private void AddPerfectNote(SRectF Rect, int n, float factor)
|
||||
private void _AddPerfectNote(SRectF rect, int n, float factor)
|
||||
{
|
||||
const int spacing = 0;
|
||||
|
||||
float d = (1f - factor) / 2 * Rect.H;
|
||||
float d = (1f - factor) / 2 * rect.H;
|
||||
float dw = d;
|
||||
|
||||
if (2 * dw > Rect.W)
|
||||
dw = Rect.W / 2;
|
||||
if (2 * dw > rect.W)
|
||||
dw = rect.W / 2;
|
||||
|
||||
SRectF r = new SRectF(
|
||||
Rect.X + dw + spacing,
|
||||
Rect.Y + d + spacing,
|
||||
Rect.W - 2 * dw - 2 * spacing,
|
||||
Rect.H - 2 * d - 2 * spacing,
|
||||
Rect.Z
|
||||
rect.X + dw + spacing,
|
||||
rect.Y + d + spacing,
|
||||
rect.W - 2 * dw - 2 * spacing,
|
||||
rect.H - 2 * d - 2 * spacing,
|
||||
rect.Z
|
||||
);
|
||||
|
||||
STexture NoteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
|
||||
float dx = NoteBegin.width * r.H / NoteBegin.height;
|
||||
STexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
|
||||
float dx = noteBegin.Width * r.H / noteBegin.Height;
|
||||
if (2 * dx > r.W)
|
||||
dx = r.W / 2;
|
||||
|
||||
@@ -656,7 +656,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
r.Y,
|
||||
dx * 0.5f,
|
||||
dx * 0.2f,
|
||||
Rect.Z
|
||||
rect.Z
|
||||
);
|
||||
|
||||
CParticleEffect stars = new CParticleEffect(_PartyModeID, CBase.Game.GetRandom(2) + 1, new SColorF(1f, 1f, 1f, 1f), r, _Theme.SkinPerfectNoteStarName, 35,
|
||||
@@ -664,34 +664,34 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_PlayerNotes[n].PerfectNoteEffect.Add(stars);
|
||||
}
|
||||
|
||||
private void AddPerfectLine(int n)
|
||||
private void _AddPerfectLine(int n)
|
||||
{
|
||||
CParticleEffect twinkle = new CParticleEffect(_PartyModeID, 200, _PlayerNotes[n].Color, _PlayerNotes[n].Rect, _Theme.SkinGoldenStarName, 25, EParticleType.Twinkle);
|
||||
_PlayerNotes[n].PerfectLineTwinkle.Add(twinkle);
|
||||
}
|
||||
|
||||
private void DrawToneHelper(int n, int BaseLine, float OffsetX)
|
||||
private void _DrawToneHelper(int n, int baseLine, float offsetX)
|
||||
{
|
||||
int TonePlayer = CBase.Record.GetToneAbs(_PlayerNotes[n].PlayerNr);
|
||||
int tonePlayer = CBase.Record.GetToneAbs(_PlayerNotes[n].PlayerNr);
|
||||
|
||||
SRectF noteBounds = _PlayerNotes[n].Rect;
|
||||
|
||||
while (TonePlayer - BaseLine < 0)
|
||||
TonePlayer += 12;
|
||||
while (tonePlayer - baseLine < 0)
|
||||
tonePlayer += 12;
|
||||
|
||||
while (TonePlayer - BaseLine > 12)
|
||||
TonePlayer -= 12;
|
||||
while (tonePlayer - baseLine > 12)
|
||||
tonePlayer -= 12;
|
||||
|
||||
if (OffsetX < 0f)
|
||||
OffsetX = 0f;
|
||||
if (offsetX < 0f)
|
||||
offsetX = 0f;
|
||||
|
||||
if (OffsetX > noteBounds.W)
|
||||
OffsetX = noteBounds.W;
|
||||
if (offsetX > noteBounds.W)
|
||||
offsetX = noteBounds.W;
|
||||
|
||||
float dy = noteBounds.H / CBase.Settings.GetNumNoteLines();
|
||||
SRectF drawRect = new SRectF(
|
||||
noteBounds.X - dy + OffsetX,
|
||||
noteBounds.Y + dy * (CBase.Settings.GetNumNoteLines() - 1 - (TonePlayer - BaseLine) / 2f),
|
||||
noteBounds.X - dy + offsetX,
|
||||
noteBounds.Y + dy * (CBase.Settings.GetNumNoteLines() - 1 - (tonePlayer - baseLine) / 2f),
|
||||
dy,
|
||||
dy,
|
||||
noteBounds.Z
|
||||
@@ -703,25 +703,25 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
_PlayerNotes[n].Color.B,
|
||||
_PlayerNotes[n].Color.A * _PlayerNotes[n].Alpha);
|
||||
|
||||
STexture ToneHelper = CBase.Theme.GetSkinTexture(_Theme.SkinToneHelperName, _PartyModeID);
|
||||
CBase.Drawing.DrawTexture(ToneHelper, drawRect, color);
|
||||
STexture toneHelper = CBase.Theme.GetSkinTexture(_Theme.SkinToneHelperName, _PartyModeID);
|
||||
CBase.Drawing.DrawTexture(toneHelper, drawRect, color);
|
||||
|
||||
|
||||
while (TonePlayer - BaseLine < 12)
|
||||
TonePlayer += 12;
|
||||
while (tonePlayer - baseLine < 12)
|
||||
tonePlayer += 12;
|
||||
|
||||
while (TonePlayer - BaseLine > 24)
|
||||
TonePlayer -= 12;
|
||||
while (tonePlayer - baseLine > 24)
|
||||
tonePlayer -= 12;
|
||||
|
||||
drawRect = new SRectF(
|
||||
noteBounds.X - dy + OffsetX,
|
||||
noteBounds.Y + dy * (CBase.Settings.GetNumNoteLines() - 1 - (TonePlayer - BaseLine) / 2f),
|
||||
noteBounds.X - dy + offsetX,
|
||||
noteBounds.Y + dy * (CBase.Settings.GetNumNoteLines() - 1 - (tonePlayer - baseLine) / 2f),
|
||||
dy,
|
||||
dy,
|
||||
noteBounds.Z
|
||||
);
|
||||
|
||||
CBase.Drawing.DrawTexture(ToneHelper, drawRect, color);
|
||||
CBase.Drawing.DrawTexture(toneHelper, drawRect, color);
|
||||
}
|
||||
|
||||
#region ThemeEdit
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
class CSingNotesClassic : CSingNotes
|
||||
{
|
||||
public CSingNotesClassic(int PartyModeID)
|
||||
: base(PartyModeID) {}
|
||||
public CSingNotesClassic(int partyModeID)
|
||||
: base(partyModeID) {}
|
||||
}
|
||||
}
|
||||
@@ -5,18 +5,18 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
public interface ISingNotes
|
||||
{
|
||||
void Reset();
|
||||
int AddPlayer(SRectF Rect, SColorF Color, int PlayerNr);
|
||||
void RemovePlayer(int ID);
|
||||
int AddPlayer(SRectF rect, SColorF color, int playerNr);
|
||||
void RemovePlayer(int iD);
|
||||
|
||||
void AddLine(int ID, CLine[] Line, int LineNr, int Player);
|
||||
void RemoveLine(int ID);
|
||||
void AddLine(int iD, CLine[] line, int lineNr, int player);
|
||||
void RemoveLine(int iD);
|
||||
|
||||
void AddNote(int ID, CNote Note);
|
||||
void AddNote(int iD, CNote note);
|
||||
|
||||
void SetAlpha(int ID, float Alpha);
|
||||
float GetAlpha(int ID);
|
||||
void SetAlpha(int iD, float alpha);
|
||||
float GetAlpha(int iD);
|
||||
|
||||
void Draw(int ID, int Player);
|
||||
void Draw(int ID, List<CLine> SingLine, int Player);
|
||||
void Draw(int iD, int player);
|
||||
void Draw(int iD, List<CLine> singLine, int player);
|
||||
}
|
||||
}
|
||||
+177
-177
@@ -56,7 +56,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.index != -1)
|
||||
if (value.Index != -1)
|
||||
{
|
||||
_CoverTextureBig = value;
|
||||
_CoverBigLoaded = true;
|
||||
@@ -64,11 +64,11 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
}
|
||||
|
||||
public CCategory(string name, STexture CoverSmall, STexture CoverBig)
|
||||
public CCategory(string name, STexture coverSmall, STexture coverBig)
|
||||
{
|
||||
Name = name;
|
||||
CoverTextureSmall = CoverSmall;
|
||||
CoverTextureBig = CoverBig;
|
||||
CoverTextureSmall = coverSmall;
|
||||
CoverTextureBig = coverBig;
|
||||
}
|
||||
|
||||
public CCategory(CCategory cat)
|
||||
@@ -227,11 +227,11 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
//No point creating a song without a text file --> Use factory method LoadSong
|
||||
private CSong() {}
|
||||
|
||||
public static CSong LoadSong(string FilePath)
|
||||
public static CSong LoadSong(string filePath)
|
||||
{
|
||||
CSong Song = new CSong();
|
||||
if (Song.ReadHeader(FilePath))
|
||||
return Song;
|
||||
CSong song = new CSong();
|
||||
if (song.ReadHeader(filePath))
|
||||
return song;
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -316,12 +316,12 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return Path.Combine(Folder, VideoFileName);
|
||||
}
|
||||
|
||||
public bool ReadHeader(string FilePath)
|
||||
public bool ReadHeader(string filePath)
|
||||
{
|
||||
if (!File.Exists(FilePath))
|
||||
if (!File.Exists(filePath))
|
||||
return false;
|
||||
|
||||
Folder = Path.GetDirectoryName(FilePath);
|
||||
Folder = Path.GetDirectoryName(filePath);
|
||||
|
||||
foreach (string folder in CBase.Config.GetSongFolder())
|
||||
{
|
||||
@@ -341,19 +341,19 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
}
|
||||
|
||||
FileName = Path.GetFileName(FilePath);
|
||||
FileName = Path.GetFileName(filePath);
|
||||
|
||||
EHeaderFlags HeaderFlags = new EHeaderFlags();
|
||||
EHeaderFlags headerFlags = new EHeaderFlags();
|
||||
StreamReader sr = null;
|
||||
try
|
||||
{
|
||||
sr = new StreamReader(FilePath, Encoding.Default, true);
|
||||
sr = new StreamReader(filePath, Encoding.Default, true);
|
||||
|
||||
string line;
|
||||
|
||||
int pos = -1;
|
||||
string Identifier = String.Empty;
|
||||
string Value = String.Empty;
|
||||
string identifier = String.Empty;
|
||||
string value = String.Empty;
|
||||
|
||||
while (!sr.EndOfStream)
|
||||
{
|
||||
@@ -367,19 +367,19 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
if (pos > 0)
|
||||
{
|
||||
Identifier = line.Substring(1, pos - 1).Trim().ToUpper();
|
||||
Value = line.Substring(pos + 1, line.Length - pos - 1).Trim();
|
||||
identifier = line.Substring(1, pos - 1).Trim().ToUpper();
|
||||
value = line.Substring(pos + 1, line.Length - pos - 1).Trim();
|
||||
|
||||
if (Value.Length > 0)
|
||||
if (value.Length > 0)
|
||||
{
|
||||
switch (Identifier)
|
||||
switch (identifier)
|
||||
{
|
||||
case "ENCODING":
|
||||
Encoding = CEncoding.GetEncoding(Value);
|
||||
Encoding = CEncoding.GetEncoding(value);
|
||||
sr.Dispose();
|
||||
sr = null;
|
||||
sr = new StreamReader(FilePath, Encoding);
|
||||
Identifier = String.Empty;
|
||||
sr = new StreamReader(filePath, Encoding);
|
||||
identifier = String.Empty;
|
||||
|
||||
//Scip everything till encoding
|
||||
while (!sr.EndOfStream)
|
||||
@@ -394,136 +394,136 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
if (pos > 0)
|
||||
{
|
||||
Identifier = line.Substring(1, pos - 1).Trim().ToUpper();
|
||||
if (Identifier == "ENCODING")
|
||||
identifier = line.Substring(1, pos - 1).Trim().ToUpper();
|
||||
if (identifier == "ENCODING")
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "TITLE":
|
||||
if (Value.Length > 0)
|
||||
if (value.Length > 0)
|
||||
{
|
||||
Title = Value;
|
||||
HeaderFlags |= EHeaderFlags.Title;
|
||||
Title = value;
|
||||
headerFlags |= EHeaderFlags.Title;
|
||||
}
|
||||
break;
|
||||
case "ARTIST":
|
||||
if (Value.Length > 0)
|
||||
if (value.Length > 0)
|
||||
{
|
||||
Artist = Value;
|
||||
HeaderFlags |= EHeaderFlags.Artist;
|
||||
Artist = value;
|
||||
headerFlags |= EHeaderFlags.Artist;
|
||||
}
|
||||
break;
|
||||
case "TITLE-ON-SORTING":
|
||||
if (Value.Length > 0)
|
||||
TitleSorting = Value;
|
||||
if (value.Length > 0)
|
||||
TitleSorting = value;
|
||||
break;
|
||||
case "ARTIST-ON-SORTING":
|
||||
if (Value.Length > 0)
|
||||
ArtistSorting = Value;
|
||||
if (value.Length > 0)
|
||||
ArtistSorting = value;
|
||||
break;
|
||||
case "P1":
|
||||
if (Value.Length > 0)
|
||||
DuetPart1 = Value;
|
||||
if (value.Length > 0)
|
||||
DuetPart1 = value;
|
||||
break;
|
||||
case "P2":
|
||||
if (Value.Length > 0)
|
||||
DuetPart2 = Value;
|
||||
if (value.Length > 0)
|
||||
DuetPart2 = value;
|
||||
break;
|
||||
case "MP3":
|
||||
if (File.Exists(Path.Combine(Folder, Value)))
|
||||
if (File.Exists(Path.Combine(Folder, value)))
|
||||
{
|
||||
MP3FileName = Value;
|
||||
HeaderFlags |= EHeaderFlags.MP3;
|
||||
MP3FileName = value;
|
||||
headerFlags |= EHeaderFlags.MP3;
|
||||
}
|
||||
else
|
||||
{
|
||||
CBase.Log.LogError("Can't find audio file: " + Path.Combine(Folder, Value));
|
||||
CBase.Log.LogError("Can't find audio file: " + Path.Combine(Folder, value));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case "BPM":
|
||||
if (CHelper.TryParse(Value, out BPM))
|
||||
if (CHelper.TryParse(value, out BPM))
|
||||
{
|
||||
BPM *= 4;
|
||||
HeaderFlags |= EHeaderFlags.BPM;
|
||||
headerFlags |= EHeaderFlags.BPM;
|
||||
}
|
||||
break;
|
||||
case "EDITION":
|
||||
if (Value.Length > 1)
|
||||
Edition.Add(Value);
|
||||
if (value.Length > 1)
|
||||
Edition.Add(value);
|
||||
break;
|
||||
case "GENRE":
|
||||
if (Value.Length > 1)
|
||||
Genre.Add(Value);
|
||||
if (value.Length > 1)
|
||||
Genre.Add(value);
|
||||
break;
|
||||
case "YEAR":
|
||||
int num = 0;
|
||||
if (Value.Length == 4 && int.TryParse(Value, out num) && num != 0)
|
||||
Year = Value;
|
||||
if (value.Length == 4 && int.TryParse(value, out num) && num != 0)
|
||||
Year = value;
|
||||
break;
|
||||
case "LANGUAGE":
|
||||
if (Value.Length > 1)
|
||||
Language.Add(Value);
|
||||
if (value.Length > 1)
|
||||
Language.Add(value);
|
||||
break;
|
||||
case "COMMENT":
|
||||
if (Value.Length > 1)
|
||||
Comment.Add(Value);
|
||||
if (value.Length > 1)
|
||||
Comment.Add(value);
|
||||
break;
|
||||
case "GAP":
|
||||
if (CHelper.TryParse(Value, out Gap))
|
||||
if (CHelper.TryParse(value, out Gap))
|
||||
Gap /= 1000f;
|
||||
break;
|
||||
case "COVER":
|
||||
if (File.Exists(Path.Combine(Folder, Value)))
|
||||
CoverFileName = Value;
|
||||
if (File.Exists(Path.Combine(Folder, value)))
|
||||
CoverFileName = value;
|
||||
break;
|
||||
case "BACKGROUND":
|
||||
if (File.Exists(Path.Combine(Folder, Value)))
|
||||
BackgroundFileName = Value;
|
||||
if (File.Exists(Path.Combine(Folder, value)))
|
||||
BackgroundFileName = value;
|
||||
break;
|
||||
case "VIDEO":
|
||||
if (File.Exists(Path.Combine(Folder, Value)))
|
||||
VideoFileName = Value;
|
||||
if (File.Exists(Path.Combine(Folder, value)))
|
||||
VideoFileName = value;
|
||||
else
|
||||
CBase.Log.LogError("Can't find video file: " + Path.Combine(Folder, Value));
|
||||
CBase.Log.LogError("Can't find video file: " + Path.Combine(Folder, value));
|
||||
break;
|
||||
case "VIDEOGAP":
|
||||
CHelper.TryParse(Value, out VideoGap);
|
||||
CHelper.TryParse(value, out VideoGap);
|
||||
break;
|
||||
case "VIDEOASPECT":
|
||||
CHelper.TryParse(Value, out VideoAspect, true);
|
||||
CHelper.TryParse(value, out VideoAspect, true);
|
||||
break;
|
||||
case "START":
|
||||
CHelper.TryParse(Value, out Start);
|
||||
CHelper.TryParse(value, out Start);
|
||||
break;
|
||||
case "END":
|
||||
if (CHelper.TryParse(Value, out Finish))
|
||||
if (CHelper.TryParse(value, out Finish))
|
||||
Finish /= 1000f;
|
||||
break;
|
||||
case "PREVIEWSTART":
|
||||
if (CHelper.TryParse(Value, out PreviewStart))
|
||||
if (CHelper.TryParse(value, out PreviewStart))
|
||||
{
|
||||
if (PreviewStart < 0f)
|
||||
PreviewStart = 0f;
|
||||
else
|
||||
HeaderFlags |= EHeaderFlags.PreviewStart;
|
||||
headerFlags |= EHeaderFlags.PreviewStart;
|
||||
}
|
||||
break;
|
||||
case "MEDLEYSTARTBEAT":
|
||||
if (int.TryParse(Value, out Medley.StartBeat))
|
||||
HeaderFlags |= EHeaderFlags.MedleyStartBeat;
|
||||
if (int.TryParse(value, out Medley.StartBeat))
|
||||
headerFlags |= EHeaderFlags.MedleyStartBeat;
|
||||
break;
|
||||
case "MEDLEYENDBEAT":
|
||||
if (int.TryParse(Value, out Medley.EndBeat))
|
||||
HeaderFlags |= EHeaderFlags.MedleyEndBeat;
|
||||
if (int.TryParse(value, out Medley.EndBeat))
|
||||
headerFlags |= EHeaderFlags.MedleyEndBeat;
|
||||
break;
|
||||
case "CALCMEDLEY":
|
||||
if (Value.ToUpper() == "OFF")
|
||||
if (value.ToUpper() == "OFF")
|
||||
CalculateMedley = false;
|
||||
break;
|
||||
case "RELATIVE":
|
||||
if (Value.ToUpper() == "YES" && Value.ToUpper() != "NO")
|
||||
if (value.ToUpper() == "YES" && value.ToUpper() != "NO")
|
||||
Relative = EOffOn.TR_CONFIG_ON;
|
||||
break;
|
||||
}
|
||||
@@ -534,48 +534,48 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
if (sr.EndOfStream)
|
||||
{
|
||||
//No other data then header
|
||||
CBase.Log.LogError("Lyrics/Notes missing: " + FilePath);
|
||||
CBase.Log.LogError("Lyrics/Notes missing: " + filePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((HeaderFlags & EHeaderFlags.Title) == 0)
|
||||
if ((headerFlags & EHeaderFlags.Title) == 0)
|
||||
{
|
||||
CBase.Log.LogError("Title tag missing: " + FilePath);
|
||||
CBase.Log.LogError("Title tag missing: " + filePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((HeaderFlags & EHeaderFlags.Artist) == 0)
|
||||
if ((headerFlags & EHeaderFlags.Artist) == 0)
|
||||
{
|
||||
CBase.Log.LogError("Artist tag missing: " + FilePath);
|
||||
CBase.Log.LogError("Artist tag missing: " + filePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((HeaderFlags & EHeaderFlags.MP3) == 0)
|
||||
if ((headerFlags & EHeaderFlags.MP3) == 0)
|
||||
{
|
||||
CBase.Log.LogError("MP3 tag missing: " + FilePath);
|
||||
CBase.Log.LogError("MP3 tag missing: " + filePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((HeaderFlags & EHeaderFlags.BPM) == 0)
|
||||
if ((headerFlags & EHeaderFlags.BPM) == 0)
|
||||
{
|
||||
CBase.Log.LogError("BPM tag missing: " + FilePath);
|
||||
CBase.Log.LogError("BPM tag missing: " + filePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
#region check medley tags
|
||||
if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0 && (HeaderFlags & EHeaderFlags.MedleyEndBeat) != 0)
|
||||
if ((headerFlags & EHeaderFlags.MedleyStartBeat) != 0 && (headerFlags & EHeaderFlags.MedleyEndBeat) != 0)
|
||||
{
|
||||
if (Medley.StartBeat > Medley.EndBeat)
|
||||
{
|
||||
CBase.Log.LogError("MedleyStartBeat is bigger than MedleyEndBeat in file: " + FilePath);
|
||||
HeaderFlags = HeaderFlags - EHeaderFlags.MedleyStartBeat - EHeaderFlags.MedleyEndBeat;
|
||||
CBase.Log.LogError("MedleyStartBeat is bigger than MedleyEndBeat in file: " + filePath);
|
||||
headerFlags = headerFlags - EHeaderFlags.MedleyStartBeat - EHeaderFlags.MedleyEndBeat;
|
||||
}
|
||||
}
|
||||
|
||||
if ((HeaderFlags & EHeaderFlags.PreviewStart) == 0 || PreviewStart == 0f)
|
||||
if ((headerFlags & EHeaderFlags.PreviewStart) == 0 || PreviewStart == 0f)
|
||||
{
|
||||
//PreviewStart is not set or <=0
|
||||
if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0)
|
||||
if ((headerFlags & EHeaderFlags.MedleyStartBeat) != 0)
|
||||
//fallback to MedleyStart
|
||||
PreviewStart = CBase.Game.GetTimeFromBeats(Medley.StartBeat, BPM);
|
||||
else
|
||||
@@ -583,7 +583,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
PreviewStart = 0f;
|
||||
}
|
||||
|
||||
if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0 && (HeaderFlags & EHeaderFlags.MedleyEndBeat) != 0)
|
||||
if ((headerFlags & EHeaderFlags.MedleyStartBeat) != 0 && (headerFlags & EHeaderFlags.MedleyEndBeat) != 0)
|
||||
{
|
||||
Medley.Source = EMedleySource.Tag;
|
||||
Medley.FadeInTime = CBase.Settings.GetDefaultMedleyFadeInTime();
|
||||
@@ -597,11 +597,11 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
if (sr != null)
|
||||
sr.Dispose();
|
||||
CBase.Log.LogError("Error reading txt header in file \"" + FilePath + "\": " + e.Message);
|
||||
CBase.Log.LogError("Error reading txt header in file \"" + filePath + "\": " + e.Message);
|
||||
return false;
|
||||
}
|
||||
sr.Dispose();
|
||||
CheckFiles();
|
||||
_CheckFiles();
|
||||
|
||||
//Before saving this tags to .txt: Check, if ArtistSorting and Artist are equal, then don't save this tag.
|
||||
if (ArtistSorting.Length == 0)
|
||||
@@ -618,34 +618,34 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return ReadNotes(Path.Combine(Folder, FileName));
|
||||
}
|
||||
|
||||
public bool ReadNotes(string FilePath, bool forceReload = false)
|
||||
public bool ReadNotes(string filePath, bool forceReload = false)
|
||||
{
|
||||
//Skip loading if already done and no reload is forced
|
||||
if (_NotesLoaded && !forceReload)
|
||||
return true;
|
||||
|
||||
if (!File.Exists(FilePath))
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
CBase.Log.LogError("Error loading song. The file does not exist: " + FilePath);
|
||||
CBase.Log.LogError("Error loading song. The file does not exist: " + filePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
char TempC = char.MinValue;
|
||||
int Param1 = 0;
|
||||
int Param2 = 0;
|
||||
int Param3 = 0;
|
||||
char tempC = char.MinValue;
|
||||
int param1 = 0;
|
||||
int param2 = 0;
|
||||
int param3 = 0;
|
||||
int currentPos = 0;
|
||||
string ParamS = String.Empty;
|
||||
string paramS = String.Empty;
|
||||
bool isNewSentence = false;
|
||||
|
||||
string line = String.Empty;
|
||||
int Player = 0;
|
||||
int FileLineNo = 0;
|
||||
int player = 0;
|
||||
int fileLineNo = 0;
|
||||
|
||||
StreamReader sr = null;
|
||||
try
|
||||
{
|
||||
sr = new StreamReader(FilePath, Encoding, true);
|
||||
sr = new StreamReader(filePath, Encoding, true);
|
||||
|
||||
Notes.Reset();
|
||||
|
||||
@@ -653,42 +653,42 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
while (!sr.EndOfStream)
|
||||
{
|
||||
line = sr.ReadLine();
|
||||
FileLineNo++;
|
||||
fileLineNo++;
|
||||
|
||||
TempC = (char)sr.Peek();
|
||||
if ((TempC == '#') || (TempC == '\r') || (TempC == '\n'))
|
||||
tempC = (char)sr.Peek();
|
||||
if ((tempC == '#') || (tempC == '\r') || (tempC == '\n'))
|
||||
continue;
|
||||
if ((TempC == ':') || (TempC == 'F') || (TempC == '*') || (TempC == 'P'))
|
||||
if ((tempC == ':') || (tempC == 'F') || (tempC == '*') || (tempC == 'P'))
|
||||
{
|
||||
TempC = (char)sr.Read();
|
||||
tempC = (char)sr.Read();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (sr.EndOfStream)
|
||||
{
|
||||
CBase.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". No lyrics/notes found: " + FilePath);
|
||||
CBase.Log.LogError("Error loading song. Line No.: " + fileLineNo.ToString() + ". No lyrics/notes found: " + filePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
char chr;
|
||||
switch (TempC)
|
||||
switch (tempC)
|
||||
{
|
||||
case 'P':
|
||||
while ((chr = (char)sr.Read()) == ' ') {}
|
||||
|
||||
int.TryParse(chr.ToString(), out Param1);
|
||||
if (Param1 == 1)
|
||||
Player = 0;
|
||||
else if (Param1 == 2)
|
||||
Player = 1;
|
||||
else if (Param1 == 3)
|
||||
Player = 2;
|
||||
int.TryParse(chr.ToString(), out param1);
|
||||
if (param1 == 1)
|
||||
player = 0;
|
||||
else if (param1 == 2)
|
||||
player = 1;
|
||||
else if (param1 == 3)
|
||||
player = 2;
|
||||
else
|
||||
{
|
||||
CBase.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Wrong or missing number after \"P\": " + FilePath);
|
||||
CBase.Log.LogError("Error loading song. Line No.: " + fileLineNo.ToString() + ". Wrong or missing number after \"P\": " + filePath);
|
||||
return false;
|
||||
}
|
||||
sr.ReadLine();
|
||||
@@ -697,72 +697,72 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
case '*':
|
||||
case 'F':
|
||||
sr.Read();
|
||||
Param1 = CHelper.TryReadInt(sr);
|
||||
param1 = CHelper.TryReadInt(sr);
|
||||
|
||||
sr.Read();
|
||||
Param2 = CHelper.TryReadInt(sr);
|
||||
param2 = CHelper.TryReadInt(sr);
|
||||
|
||||
sr.Read();
|
||||
Param3 = CHelper.TryReadInt(sr);
|
||||
param3 = CHelper.TryReadInt(sr);
|
||||
|
||||
sr.Read();
|
||||
ParamS = sr.ReadLine();
|
||||
paramS = sr.ReadLine();
|
||||
|
||||
ENoteType NoteType;
|
||||
ENoteType noteType;
|
||||
|
||||
if (TempC.CompareTo('*') == 0)
|
||||
NoteType = ENoteType.Golden;
|
||||
else if (TempC.CompareTo('F') == 0)
|
||||
NoteType = ENoteType.Freestyle;
|
||||
if (tempC.CompareTo('*') == 0)
|
||||
noteType = ENoteType.Golden;
|
||||
else if (tempC.CompareTo('F') == 0)
|
||||
noteType = ENoteType.Freestyle;
|
||||
else
|
||||
NoteType = ENoteType.Normal;
|
||||
noteType = ENoteType.Normal;
|
||||
|
||||
if (Relative == EOffOn.TR_CONFIG_ON)
|
||||
Param1 += currentPos;
|
||||
param1 += currentPos;
|
||||
|
||||
if (Player != 2)
|
||||
if (player != 2)
|
||||
// one singer
|
||||
ParseNote(Player, NoteType, Param1, Param2, Param3, ParamS);
|
||||
_ParseNote(player, noteType, param1, param2, param3, paramS);
|
||||
else
|
||||
{
|
||||
// both singer
|
||||
ParseNote(0, NoteType, Param1, Param2, Param3, ParamS);
|
||||
ParseNote(1, NoteType, Param1, Param2, Param3, ParamS);
|
||||
_ParseNote(0, noteType, param1, param2, param3, paramS);
|
||||
_ParseNote(1, noteType, param1, param2, param3, paramS);
|
||||
}
|
||||
isNewSentence = false;
|
||||
break;
|
||||
case '-':
|
||||
if (isNewSentence)
|
||||
{
|
||||
CBase.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Double sentence break: " + FilePath);
|
||||
CBase.Log.LogError("Error loading song. Line No.: " + fileLineNo.ToString() + ". Double sentence break: " + filePath);
|
||||
return false;
|
||||
}
|
||||
sr.Read();
|
||||
Param1 = CHelper.TryReadInt(sr);
|
||||
param1 = CHelper.TryReadInt(sr);
|
||||
|
||||
if (Relative == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
Param1 += currentPos;
|
||||
param1 += currentPos;
|
||||
sr.Read();
|
||||
Param2 = CHelper.TryReadInt(sr);
|
||||
currentPos += Param2;
|
||||
param2 = CHelper.TryReadInt(sr);
|
||||
currentPos += param2;
|
||||
}
|
||||
|
||||
if (Player != 2)
|
||||
if (player != 2)
|
||||
// one singer
|
||||
NewSentence(Player, Param1);
|
||||
_NewSentence(player, param1);
|
||||
else
|
||||
{
|
||||
// both singer
|
||||
NewSentence(0, Param1);
|
||||
NewSentence(1, Param1);
|
||||
_NewSentence(0, param1);
|
||||
_NewSentence(1, param1);
|
||||
}
|
||||
|
||||
isNewSentence = true;
|
||||
sr.ReadLine();
|
||||
break;
|
||||
default:
|
||||
CBase.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Unexpected or missing character (" + TempC + "): " + FilePath);
|
||||
CBase.Log.LogError("Error loading song. Line No.: " + fileLineNo.ToString() + ". Unexpected or missing character (" + tempC + "): " + filePath);
|
||||
return false;
|
||||
}
|
||||
int c = 0;
|
||||
@@ -770,41 +770,41 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
c = sr.Read();
|
||||
} while (!sr.EndOfStream && (c == 19 || c == 16 || c == 13 || c == 10));
|
||||
TempC = (char)c;
|
||||
FileLineNo++;
|
||||
} while (!sr.EndOfStream && (TempC != 'E'));
|
||||
tempC = (char)c;
|
||||
fileLineNo++;
|
||||
} while (!sr.EndOfStream && (tempC != 'E'));
|
||||
|
||||
foreach (CLines lines in Notes.Lines)
|
||||
lines.UpdateTimings();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CBase.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". An unhandled exception occured (" + e.Message + "): " + FilePath);
|
||||
CBase.Log.LogError("Error loading song. Line No.: " + fileLineNo.ToString() + ". An unhandled exception occured (" + e.Message + "): " + filePath);
|
||||
if (sr != null)
|
||||
sr.Dispose();
|
||||
return false;
|
||||
}
|
||||
sr.Dispose();
|
||||
FindRefrain();
|
||||
FindShortEnd();
|
||||
_FindRefrain();
|
||||
_FindShortEnd();
|
||||
_NotesLoaded = true;
|
||||
if (IsDuet)
|
||||
CheckDuet();
|
||||
_CheckDuet();
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool ParseNote(int Player, ENoteType NoteType, int Start, int Length, int Tone, string Text)
|
||||
private bool _ParseNote(int player, ENoteType noteType, int start, int length, int tone, string text)
|
||||
{
|
||||
CNote note = new CNote(Start, Length, Tone, Text, NoteType);
|
||||
CLines lines = Notes.GetLines(Player);
|
||||
CNote note = new CNote(start, length, tone, text, noteType);
|
||||
CLines lines = Notes.GetLines(player);
|
||||
return lines.AddNote(note);
|
||||
}
|
||||
|
||||
private void NewSentence(int Player, int Start)
|
||||
private void _NewSentence(int player, int start)
|
||||
{
|
||||
CLines lines = Notes.GetLines(Player);
|
||||
CLines lines = Notes.GetLines(player);
|
||||
CLine line = new CLine();
|
||||
line.StartBeat = Start;
|
||||
line.StartBeat = start;
|
||||
lines.AddLine(line);
|
||||
}
|
||||
|
||||
@@ -823,7 +823,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_CoverSmallLoaded = true;
|
||||
}
|
||||
|
||||
private void CheckFiles()
|
||||
private void _CheckFiles()
|
||||
{
|
||||
if (CoverFileName.Length == 0)
|
||||
{
|
||||
@@ -850,7 +850,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckDuet()
|
||||
private void _CheckDuet()
|
||||
{
|
||||
if (DuetPart1.Length == 0)
|
||||
{
|
||||
@@ -864,14 +864,14 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
}
|
||||
|
||||
private struct Series
|
||||
private struct SSeries
|
||||
{
|
||||
public int Start;
|
||||
public int end;
|
||||
public int length;
|
||||
public int End;
|
||||
public int Length;
|
||||
}
|
||||
|
||||
private List<Series> GetSeries()
|
||||
private List<SSeries> _GetSeries()
|
||||
{
|
||||
CLines lines = Notes.GetLines(0);
|
||||
|
||||
@@ -889,16 +889,16 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
|
||||
// find equal sentences series
|
||||
List<Series> series = new List<Series>();
|
||||
List<SSeries> series = new List<SSeries>();
|
||||
for (int i = 0; i < lines.LineCount - 1; i++)
|
||||
{
|
||||
for (int j = i + 1; j < lines.LineCount; j++)
|
||||
{
|
||||
if (sentences[i] == sentences[j] && sentences[i].Length > 0)
|
||||
{
|
||||
Series tempSeries = new Series();
|
||||
SSeries tempSeries = new SSeries();
|
||||
tempSeries.Start = i;
|
||||
tempSeries.end = i;
|
||||
tempSeries.End = i;
|
||||
|
||||
int max = 0;
|
||||
if (j + j - i - 1 > lines.LineCount - 1)
|
||||
@@ -909,12 +909,12 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
for (int k = 1; k <= max; k++)
|
||||
{
|
||||
if (sentences[i + k] == sentences[j + k] && sentences[i + k].Length > 0)
|
||||
tempSeries.end = i + k;
|
||||
tempSeries.End = i + k;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
tempSeries.length = tempSeries.end - tempSeries.Start + 1;
|
||||
tempSeries.Length = tempSeries.End - tempSeries.Start + 1;
|
||||
series.Add(tempSeries);
|
||||
}
|
||||
}
|
||||
@@ -922,7 +922,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return series;
|
||||
}
|
||||
|
||||
private void FindRefrain()
|
||||
private void _FindRefrain()
|
||||
{
|
||||
if (IsDuet)
|
||||
{
|
||||
@@ -936,7 +936,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
if (!CalculateMedley)
|
||||
return;
|
||||
|
||||
List<Series> series = GetSeries();
|
||||
List<SSeries> series = _GetSeries();
|
||||
if (series == null)
|
||||
return;
|
||||
|
||||
@@ -944,17 +944,17 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
int longest = 0;
|
||||
for (int i = 0; i < series.Count; i++)
|
||||
{
|
||||
if (series[i].length > series[longest].length)
|
||||
if (series[i].Length > series[longest].Length)
|
||||
longest = i;
|
||||
}
|
||||
|
||||
CLines lines = Notes.GetLines(0);
|
||||
|
||||
// set medley vars
|
||||
if (series.Count > 0 && series[longest].length > CBase.Settings.GetMedleyMinSeriesLength())
|
||||
if (series.Count > 0 && series[longest].Length > CBase.Settings.GetMedleyMinSeriesLength())
|
||||
{
|
||||
Medley.StartBeat = lines.Line[series[longest].Start].FirstNoteBeat;
|
||||
Medley.EndBeat = lines.Line[series[longest].end].LastNoteBeat;
|
||||
Medley.EndBeat = lines.Line[series[longest].End].LastNoteBeat;
|
||||
|
||||
bool foundEnd = false;
|
||||
|
||||
@@ -991,9 +991,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
}
|
||||
|
||||
private void FindShortEnd()
|
||||
private void _FindShortEnd()
|
||||
{
|
||||
List<Series> series = GetSeries();
|
||||
List<SSeries> series = _GetSeries();
|
||||
if (series == null)
|
||||
return;
|
||||
|
||||
@@ -1005,16 +1005,16 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
//Check if stop is in series
|
||||
for (int i = 0; i < series.Count; i++)
|
||||
{
|
||||
if (lines.Line[series[i].Start].FirstNoteBeat < stop && lines.Line[series[i].end].LastNoteBeat > stop)
|
||||
if (lines.Line[series[i].Start].FirstNoteBeat < stop && lines.Line[series[i].End].LastNoteBeat > stop)
|
||||
{
|
||||
if (stop < (lines.Line[series[i].Start].FirstNoteBeat + ((lines.Line[series[i].end].LastNoteBeat - lines.Line[series[i].Start].FirstNoteBeat) / 2)))
|
||||
if (stop < (lines.Line[series[i].Start].FirstNoteBeat + ((lines.Line[series[i].End].LastNoteBeat - lines.Line[series[i].Start].FirstNoteBeat) / 2)))
|
||||
{
|
||||
ShortEnd = lines.Line[series[i].Start - 1].LastNote.EndBeat;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShortEnd = lines.Line[series[i].end].LastNote.EndBeat;
|
||||
ShortEnd = lines.Line[series[i].End].LastNote.EndBeat;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,16 +10,16 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
private ISongMenu _SongMenu;
|
||||
private ESongMenu _Type;
|
||||
|
||||
public CSongMenu(int PartyModeID)
|
||||
public CSongMenu(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
CreateSongMenu();
|
||||
_PartyModeID = partyModeID;
|
||||
_CreateSongMenu();
|
||||
}
|
||||
|
||||
public void UpdateSongMenuType()
|
||||
{
|
||||
if (_Type != CBase.Config.GetSongMenuType())
|
||||
CreateSongMenu();
|
||||
_CreateSongMenu();
|
||||
}
|
||||
|
||||
public bool Selected
|
||||
@@ -40,9 +40,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
|
||||
#region ISongMenu
|
||||
public void Update(ScreenSongOptions SongOptions)
|
||||
public void Update(SScreenSongOptions songOptions)
|
||||
{
|
||||
_SongMenu.Update(SongOptions);
|
||||
_SongMenu.Update(songOptions);
|
||||
}
|
||||
|
||||
public void OnShow()
|
||||
@@ -55,14 +55,14 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_SongMenu.OnHide();
|
||||
}
|
||||
|
||||
public void HandleInput(ref KeyEvent KeyEvent, ScreenSongOptions SongOptions)
|
||||
public void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions)
|
||||
{
|
||||
_SongMenu.HandleInput(ref KeyEvent, SongOptions);
|
||||
_SongMenu.HandleInput(ref keyEvent, songOptions);
|
||||
}
|
||||
|
||||
public void HandleMouse(ref MouseEvent MouseEvent, ScreenSongOptions SongOptions)
|
||||
public void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions)
|
||||
{
|
||||
_SongMenu.HandleMouse(ref MouseEvent, SongOptions);
|
||||
_SongMenu.HandleMouse(ref mouseEvent, songOptions);
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
@@ -70,9 +70,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_SongMenu.Draw();
|
||||
}
|
||||
|
||||
public void ApplyVolume(float VolumeMax)
|
||||
public void ApplyVolume(float volumeMax)
|
||||
{
|
||||
_SongMenu.ApplyVolume(VolumeMax);
|
||||
_SongMenu.ApplyVolume(volumeMax);
|
||||
}
|
||||
|
||||
public bool IsActive()
|
||||
@@ -80,9 +80,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _SongMenu.IsActive();
|
||||
}
|
||||
|
||||
public void SetActive(bool Active)
|
||||
public void SetActive(bool active)
|
||||
{
|
||||
_SongMenu.SetActive(Active);
|
||||
_SongMenu.SetActive(active);
|
||||
}
|
||||
|
||||
public int GetSelectedSong()
|
||||
@@ -95,9 +95,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _SongMenu.GetSelectedSongCover();
|
||||
}
|
||||
|
||||
public void SetSelectedSong(int VisibleSongNr)
|
||||
public void SetSelectedSong(int visibleSongNr)
|
||||
{
|
||||
_SongMenu.SetSelectedSong(VisibleSongNr);
|
||||
_SongMenu.SetSelectedSong(visibleSongNr);
|
||||
}
|
||||
|
||||
public int GetSelectedCategory()
|
||||
@@ -105,9 +105,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _SongMenu.GetSelectedCategory();
|
||||
}
|
||||
|
||||
public void SetSelectedCategory(int CategoryNr)
|
||||
public void SetSelectedCategory(int categoryNr)
|
||||
{
|
||||
_SongMenu.SetSelectedCategory(CategoryNr);
|
||||
_SongMenu.SetSelectedCategory(categoryNr);
|
||||
}
|
||||
|
||||
public bool EnterCurrentCategory()
|
||||
@@ -125,9 +125,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _SongMenu.IsSelected();
|
||||
}
|
||||
|
||||
public void SetSelected(bool Selected)
|
||||
public void SetSelected(bool selected)
|
||||
{
|
||||
_SongMenu.SetSelected(Selected);
|
||||
_SongMenu.SetSelected(selected);
|
||||
}
|
||||
|
||||
public bool IsVisible()
|
||||
@@ -135,9 +135,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _SongMenu.IsVisible();
|
||||
}
|
||||
|
||||
public void SetVisible(bool Visible)
|
||||
public void SetVisible(bool visible)
|
||||
{
|
||||
_SongMenu.SetVisible(Visible);
|
||||
_SongMenu.SetVisible(visible);
|
||||
}
|
||||
|
||||
public SRectF GetRect()
|
||||
@@ -150,9 +150,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _SongMenu.IsSmallView();
|
||||
}
|
||||
|
||||
public void SetSmallView(bool SmallView)
|
||||
public void SetSmallView(bool smallView)
|
||||
{
|
||||
_SongMenu.SetSmallView(SmallView);
|
||||
_SongMenu.SetSmallView(smallView);
|
||||
}
|
||||
#endregion ISongMenu
|
||||
|
||||
@@ -162,9 +162,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _SongMenu.GetThemeName();
|
||||
}
|
||||
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
return _SongMenu.LoadTheme(XmlPath, ElementName, xmlReader, SkinIndex);
|
||||
return _SongMenu.LoadTheme(xmlPath, elementName, xmlReader, skinIndex);
|
||||
}
|
||||
|
||||
public bool SaveTheme(XmlWriter writer)
|
||||
@@ -198,7 +198,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
#endregion IMenuElement
|
||||
|
||||
private void CreateSongMenu()
|
||||
private void _CreateSongMenu()
|
||||
{
|
||||
if (_SongMenu != null)
|
||||
_SongMenu.OnHide();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
class CSongMenuBook : CSongMenuFramework
|
||||
{
|
||||
public CSongMenuBook(int PartyModeID)
|
||||
: base(PartyModeID) {}
|
||||
public CSongMenuBook(int partyModeID)
|
||||
: base(partyModeID) {}
|
||||
}
|
||||
}
|
||||
@@ -21,8 +21,8 @@
|
||||
return _actualSelection;
|
||||
}
|
||||
*/
|
||||
public CSongMenuDreidel(int PartyModeID)
|
||||
: base(PartyModeID) {}
|
||||
public CSongMenuDreidel(int partyModeID)
|
||||
: base(partyModeID) {}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
//public SThemeSongMenuBook songMenuBook;
|
||||
//public SThemeSongMenuDreidel songMenuDreidel;
|
||||
//public SThemeSongMenuList songMenuList;
|
||||
public SThemeSongMenuTileBoard songMenuTileBoard;
|
||||
public SThemeSongMenuTileBoard SongMenuTileBoard;
|
||||
}
|
||||
|
||||
struct SThemeSongMenuBook {}
|
||||
@@ -38,32 +38,32 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
/// <summary>
|
||||
/// Number of tiles horizontal
|
||||
/// </summary>
|
||||
public int numW;
|
||||
public int NumW;
|
||||
|
||||
/// <summary>
|
||||
/// Number of tiles vertical
|
||||
/// </summary>
|
||||
public int numH;
|
||||
public int NumH;
|
||||
|
||||
/// <summary>
|
||||
/// Number of tiles horizontal in small-modus
|
||||
/// </summary>
|
||||
public int numWsmall;
|
||||
public int NumWsmall;
|
||||
|
||||
/// <summary>
|
||||
/// Number of tiles vertical in small-modus
|
||||
/// </summary>
|
||||
public int numHsmall;
|
||||
public int NumHsmall;
|
||||
|
||||
/// <summary>
|
||||
/// Space between tiles horizontal
|
||||
/// </summary>
|
||||
public float spaceW;
|
||||
public float SpaceW;
|
||||
|
||||
/// <summary>
|
||||
/// Space between tiles vertical
|
||||
/// </summary>
|
||||
public float spaceH;
|
||||
public float SpaceH;
|
||||
|
||||
public SRectF TileRect;
|
||||
public SRectF TileRectSmall;
|
||||
@@ -86,12 +86,12 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
protected SThemeSongMenu _Theme;
|
||||
private bool _ThemeLoaded;
|
||||
|
||||
private readonly Stopwatch _timer = new Stopwatch();
|
||||
private readonly Stopwatch _Timer = new Stopwatch();
|
||||
private readonly Stopwatch _VideoFadeTimer = new Stopwatch();
|
||||
private readonly List<int> _streams = new List<int>();
|
||||
private int _actsong = -1;
|
||||
private int _actsongstream = -1;
|
||||
protected STexture _vidtex = new STexture(-1);
|
||||
private readonly List<int> _Streams = new List<int>();
|
||||
private int _Actsong = -1;
|
||||
private int _Actsongstream = -1;
|
||||
protected STexture _Vidtex = new STexture(-1);
|
||||
|
||||
protected bool _Initialized = false;
|
||||
protected int _LastKnownNumSongs = 0;
|
||||
@@ -114,10 +114,10 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
//for preview only
|
||||
get
|
||||
{
|
||||
if ((_SelectedInternal != _SelectedPending) && (_timer.ElapsedMilliseconds >= _PendingTime))
|
||||
if ((_SelectedInternal != _SelectedPending) && (_Timer.ElapsedMilliseconds >= _PendingTime))
|
||||
{
|
||||
_timer.Stop();
|
||||
_timer.Reset();
|
||||
_Timer.Stop();
|
||||
_Timer.Reset();
|
||||
_SelectedInternal = _SelectedPending;
|
||||
}
|
||||
return _SelectedInternal;
|
||||
@@ -126,8 +126,8 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
if (value == -1)
|
||||
{
|
||||
_timer.Stop();
|
||||
_timer.Reset();
|
||||
_Timer.Stop();
|
||||
_Timer.Reset();
|
||||
|
||||
_SelectedInternal = -1;
|
||||
_SelectedPending = -1;
|
||||
@@ -136,25 +136,25 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
if ((value != _SelectedInternal) && (value != _SelectedPending))
|
||||
{
|
||||
_timer.Reset();
|
||||
_timer.Start();
|
||||
_Timer.Reset();
|
||||
_Timer.Start();
|
||||
|
||||
_SelectedPending = value;
|
||||
}
|
||||
|
||||
if ((value == _SelectedPending) && ((_timer.ElapsedMilliseconds >= _PendingTime) || (_SelectedInternal == -1)))
|
||||
if ((value == _SelectedPending) && ((_Timer.ElapsedMilliseconds >= _PendingTime) || (_SelectedInternal == -1)))
|
||||
{
|
||||
_timer.Stop();
|
||||
_timer.Reset();
|
||||
_Timer.Stop();
|
||||
_Timer.Reset();
|
||||
_SelectedInternal = _SelectedPending;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void SetSelectedNow()
|
||||
protected virtual void _SetSelectedNow()
|
||||
{
|
||||
_timer.Stop();
|
||||
_timer.Reset();
|
||||
_Timer.Stop();
|
||||
_Timer.Reset();
|
||||
_SelectedInternal = _SelectedPending;
|
||||
}
|
||||
|
||||
@@ -167,14 +167,14 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
protected int _SongStream
|
||||
{
|
||||
get { return _actsongstream; }
|
||||
get { return _Actsongstream; }
|
||||
}
|
||||
|
||||
protected int _Video { get; private set; }
|
||||
|
||||
protected int _ActSong
|
||||
{
|
||||
get { return _actsong; }
|
||||
get { return _Actsong; }
|
||||
}
|
||||
|
||||
public SRectF Rect
|
||||
@@ -194,7 +194,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
public virtual int GetActualSelection()
|
||||
{
|
||||
return _actsong;
|
||||
return _Actsong;
|
||||
}
|
||||
|
||||
private bool _Selected;
|
||||
@@ -205,10 +205,10 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _Selected;
|
||||
}
|
||||
|
||||
public void SetSelected(bool Selected)
|
||||
public void SetSelected(bool selected)
|
||||
{
|
||||
_Selected = Selected;
|
||||
SetActive(Selected);
|
||||
_Selected = selected;
|
||||
SetActive(selected);
|
||||
}
|
||||
|
||||
public bool IsVisible()
|
||||
@@ -216,26 +216,26 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _Visible;
|
||||
}
|
||||
|
||||
public void SetVisible(bool Visible)
|
||||
public void SetVisible(bool visible)
|
||||
{
|
||||
_Visible = Visible;
|
||||
_Visible = visible;
|
||||
}
|
||||
|
||||
public CSongMenuFramework(int PartyModeID)
|
||||
public CSongMenuFramework(int partyModeID)
|
||||
{
|
||||
_PartyModeID = PartyModeID;
|
||||
_PartyModeID = partyModeID;
|
||||
_Theme = new SThemeSongMenu();
|
||||
|
||||
_Theme.songMenuTileBoard.TextArtist = new CText(_PartyModeID);
|
||||
_Theme.songMenuTileBoard.TextTitle = new CText(_PartyModeID);
|
||||
_Theme.songMenuTileBoard.TextSongLength = new CText(_PartyModeID);
|
||||
_Theme.SongMenuTileBoard.TextArtist = new CText(_PartyModeID);
|
||||
_Theme.SongMenuTileBoard.TextTitle = new CText(_PartyModeID);
|
||||
_Theme.SongMenuTileBoard.TextSongLength = new CText(_PartyModeID);
|
||||
|
||||
_Theme.songMenuTileBoard.StaticCoverBig = new CStatic(_PartyModeID);
|
||||
_Theme.songMenuTileBoard.StaticTextBG = new CStatic(_PartyModeID);
|
||||
_Theme.songMenuTileBoard.StaticDuetIcon = new CStatic(_PartyModeID);
|
||||
_Theme.songMenuTileBoard.StaticVideoIcon = new CStatic(_PartyModeID);
|
||||
_Theme.songMenuTileBoard.StaticMedleyCalcIcon = new CStatic(_PartyModeID);
|
||||
_Theme.songMenuTileBoard.StaticMedleyTagIcon = new CStatic(_PartyModeID);
|
||||
_Theme.SongMenuTileBoard.StaticCoverBig = new CStatic(_PartyModeID);
|
||||
_Theme.SongMenuTileBoard.StaticTextBG = new CStatic(_PartyModeID);
|
||||
_Theme.SongMenuTileBoard.StaticDuetIcon = new CStatic(_PartyModeID);
|
||||
_Theme.SongMenuTileBoard.StaticVideoIcon = new CStatic(_PartyModeID);
|
||||
_Theme.SongMenuTileBoard.StaticMedleyCalcIcon = new CStatic(_PartyModeID);
|
||||
_Theme.SongMenuTileBoard.StaticMedleyTagIcon = new CStatic(_PartyModeID);
|
||||
|
||||
_ThemeLoaded = false;
|
||||
}
|
||||
@@ -245,9 +245,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _Theme.Name;
|
||||
}
|
||||
|
||||
public bool LoadTheme(string XmlPath, string ElementName, CXMLReader xmlReader, int SkinIndex)
|
||||
public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string item = XmlPath + "/" + ElementName;
|
||||
string item = xmlPath + "/" + elementName;
|
||||
_ThemeLoaded = true;
|
||||
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/CoverBackground", ref _Theme.CoverBackgroundName, String.Empty);
|
||||
@@ -258,7 +258,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_ThemeLoaded &= xmlReader.GetValue(item + "/MedleyTagIcon", ref _Theme.MedleyTagIcon, String.Empty);
|
||||
|
||||
if (xmlReader.GetValue(item + "/Color", ref _Theme.ColorName, String.Empty))
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, out _Color);
|
||||
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, skinIndex, out _Color);
|
||||
else
|
||||
{
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/R", ref _Color.R);
|
||||
@@ -268,41 +268,41 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
|
||||
#region SongMenuTileBoard
|
||||
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumW", ref _Theme.songMenuTileBoard.numW);
|
||||
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumH", ref _Theme.songMenuTileBoard.numH);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/SpaceW", ref _Theme.songMenuTileBoard.spaceW);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/SpaceH", ref _Theme.songMenuTileBoard.spaceH);
|
||||
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumW", ref _Theme.SongMenuTileBoard.NumW);
|
||||
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumH", ref _Theme.SongMenuTileBoard.NumH);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/SpaceW", ref _Theme.SongMenuTileBoard.SpaceW);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/SpaceH", ref _Theme.SongMenuTileBoard.SpaceH);
|
||||
|
||||
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumWsmall", ref _Theme.songMenuTileBoard.numWsmall);
|
||||
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumHsmall", ref _Theme.songMenuTileBoard.numHsmall);
|
||||
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumWsmall", ref _Theme.SongMenuTileBoard.NumWsmall);
|
||||
_ThemeLoaded &= xmlReader.TryGetIntValue(item + "/SongMenuTileBoard/NumHsmall", ref _Theme.SongMenuTileBoard.NumHsmall);
|
||||
|
||||
_ThemeLoaded &= _Theme.songMenuTileBoard.TextArtist.LoadTheme(item + "/SongMenuTileBoard", "TextArtist", xmlReader, SkinIndex);
|
||||
_ThemeLoaded &= _Theme.songMenuTileBoard.TextTitle.LoadTheme(item + "/SongMenuTileBoard", "TextTitle", xmlReader, SkinIndex);
|
||||
_ThemeLoaded &= _Theme.songMenuTileBoard.TextSongLength.LoadTheme(item + "/SongMenuTileBoard", "TextSongLength", xmlReader, SkinIndex);
|
||||
_ThemeLoaded &= _Theme.SongMenuTileBoard.TextArtist.LoadTheme(item + "/SongMenuTileBoard", "TextArtist", xmlReader, skinIndex);
|
||||
_ThemeLoaded &= _Theme.SongMenuTileBoard.TextTitle.LoadTheme(item + "/SongMenuTileBoard", "TextTitle", xmlReader, skinIndex);
|
||||
_ThemeLoaded &= _Theme.SongMenuTileBoard.TextSongLength.LoadTheme(item + "/SongMenuTileBoard", "TextSongLength", xmlReader, skinIndex);
|
||||
|
||||
_ThemeLoaded &= _Theme.songMenuTileBoard.StaticCoverBig.LoadTheme(item + "/SongMenuTileBoard", "StaticCoverBig", xmlReader, SkinIndex);
|
||||
_ThemeLoaded &= _Theme.songMenuTileBoard.StaticTextBG.LoadTheme(item + "/SongMenuTileBoard", "StaticTextBG", xmlReader, SkinIndex);
|
||||
_ThemeLoaded &= _Theme.songMenuTileBoard.StaticDuetIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticDuetIcon", xmlReader, SkinIndex);
|
||||
_ThemeLoaded &= _Theme.songMenuTileBoard.StaticVideoIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticVideoIcon", xmlReader, SkinIndex);
|
||||
_ThemeLoaded &= _Theme.songMenuTileBoard.StaticMedleyCalcIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticMedleyCalcIcon", xmlReader, SkinIndex);
|
||||
_ThemeLoaded &= _Theme.songMenuTileBoard.StaticMedleyTagIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticMedleyTagIcon", xmlReader, SkinIndex);
|
||||
_ThemeLoaded &= _Theme.SongMenuTileBoard.StaticCoverBig.LoadTheme(item + "/SongMenuTileBoard", "StaticCoverBig", xmlReader, skinIndex);
|
||||
_ThemeLoaded &= _Theme.SongMenuTileBoard.StaticTextBG.LoadTheme(item + "/SongMenuTileBoard", "StaticTextBG", xmlReader, skinIndex);
|
||||
_ThemeLoaded &= _Theme.SongMenuTileBoard.StaticDuetIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticDuetIcon", xmlReader, skinIndex);
|
||||
_ThemeLoaded &= _Theme.SongMenuTileBoard.StaticVideoIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticVideoIcon", xmlReader, skinIndex);
|
||||
_ThemeLoaded &= _Theme.SongMenuTileBoard.StaticMedleyCalcIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticMedleyCalcIcon", xmlReader, skinIndex);
|
||||
_ThemeLoaded &= _Theme.SongMenuTileBoard.StaticMedleyTagIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticMedleyTagIcon", xmlReader, skinIndex);
|
||||
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectX", ref _Theme.songMenuTileBoard.TileRect.X);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectY", ref _Theme.songMenuTileBoard.TileRect.Y);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectZ", ref _Theme.songMenuTileBoard.TileRect.Z);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectW", ref _Theme.songMenuTileBoard.TileRect.W);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectH", ref _Theme.songMenuTileBoard.TileRect.H);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectX", ref _Theme.SongMenuTileBoard.TileRect.X);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectY", ref _Theme.SongMenuTileBoard.TileRect.Y);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectZ", ref _Theme.SongMenuTileBoard.TileRect.Z);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectW", ref _Theme.SongMenuTileBoard.TileRect.W);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectH", ref _Theme.SongMenuTileBoard.TileRect.H);
|
||||
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallX", ref _Theme.songMenuTileBoard.TileRectSmall.X);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallY", ref _Theme.songMenuTileBoard.TileRectSmall.Y);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallZ", ref _Theme.songMenuTileBoard.TileRectSmall.Z);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallW", ref _Theme.songMenuTileBoard.TileRectSmall.W);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallH", ref _Theme.songMenuTileBoard.TileRectSmall.H);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallX", ref _Theme.SongMenuTileBoard.TileRectSmall.X);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallY", ref _Theme.SongMenuTileBoard.TileRectSmall.Y);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallZ", ref _Theme.SongMenuTileBoard.TileRectSmall.Z);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallW", ref _Theme.SongMenuTileBoard.TileRectSmall.W);
|
||||
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallH", ref _Theme.SongMenuTileBoard.TileRectSmall.H);
|
||||
#endregion SongMenuTileBoard
|
||||
|
||||
if (_ThemeLoaded)
|
||||
{
|
||||
_Theme.Name = ElementName;
|
||||
_Theme.Name = elementName;
|
||||
LoadTextures();
|
||||
Init();
|
||||
}
|
||||
@@ -351,47 +351,47 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
writer.WriteStartElement("SongMenuTileBoard");
|
||||
|
||||
writer.WriteComment("<NumW>: Number of tiles horizontal");
|
||||
writer.WriteElementString("NumW", _Theme.songMenuTileBoard.numW.ToString());
|
||||
writer.WriteElementString("NumW", _Theme.SongMenuTileBoard.NumW.ToString());
|
||||
|
||||
writer.WriteComment("<NumH>: Number of tiles vertical");
|
||||
writer.WriteElementString("NumH", _Theme.songMenuTileBoard.numH.ToString());
|
||||
writer.WriteElementString("NumH", _Theme.SongMenuTileBoard.NumH.ToString());
|
||||
|
||||
writer.WriteComment("<SpaceW>: Space between tiles horizontal");
|
||||
writer.WriteElementString("SpaceW", _Theme.songMenuTileBoard.spaceW.ToString("#0.00"));
|
||||
writer.WriteElementString("SpaceW", _Theme.SongMenuTileBoard.SpaceW.ToString("#0.00"));
|
||||
|
||||
writer.WriteComment("<SpaceH>: Space between tiles vertical");
|
||||
writer.WriteElementString("SpaceH", _Theme.songMenuTileBoard.spaceH.ToString("#0.00"));
|
||||
writer.WriteElementString("SpaceH", _Theme.SongMenuTileBoard.SpaceH.ToString("#0.00"));
|
||||
|
||||
writer.WriteComment("<NumWsmall>: Number of tiles horizontal in small-mode");
|
||||
writer.WriteElementString("NumWsmall", _Theme.songMenuTileBoard.numWsmall.ToString());
|
||||
writer.WriteElementString("NumWsmall", _Theme.SongMenuTileBoard.NumWsmall.ToString());
|
||||
|
||||
writer.WriteComment("<NumHsmall>: Number of tiles vertical in small-mode");
|
||||
writer.WriteElementString("NumHsmall", _Theme.songMenuTileBoard.numHsmall.ToString());
|
||||
writer.WriteElementString("NumHsmall", _Theme.SongMenuTileBoard.NumHsmall.ToString());
|
||||
|
||||
writer.WriteComment("<TileRectX>, <TileRectY>, <TileRectZ>, <TileRectW>, <TileRectH>: SongMenu position, width and height");
|
||||
writer.WriteElementString("TileRectX", _Theme.songMenuTileBoard.TileRect.X.ToString("#0"));
|
||||
writer.WriteElementString("TileRectY", _Theme.songMenuTileBoard.TileRect.Y.ToString("#0"));
|
||||
writer.WriteElementString("TileRectZ", _Theme.songMenuTileBoard.TileRect.Z.ToString("#0.00"));
|
||||
writer.WriteElementString("TileRectW", _Theme.songMenuTileBoard.TileRect.W.ToString("#0"));
|
||||
writer.WriteElementString("TileRectH", _Theme.songMenuTileBoard.TileRect.H.ToString("#0"));
|
||||
writer.WriteElementString("TileRectX", _Theme.SongMenuTileBoard.TileRect.X.ToString("#0"));
|
||||
writer.WriteElementString("TileRectY", _Theme.SongMenuTileBoard.TileRect.Y.ToString("#0"));
|
||||
writer.WriteElementString("TileRectZ", _Theme.SongMenuTileBoard.TileRect.Z.ToString("#0.00"));
|
||||
writer.WriteElementString("TileRectW", _Theme.SongMenuTileBoard.TileRect.W.ToString("#0"));
|
||||
writer.WriteElementString("TileRectH", _Theme.SongMenuTileBoard.TileRect.H.ToString("#0"));
|
||||
|
||||
writer.WriteComment("<TileRectSmallX>, <TileRectSmallY>, <TileRectSmallZ>, <TileRectSmallW>, <TileRectSmallH>: SongMenu position, width and height in small-mode");
|
||||
writer.WriteElementString("TileRectSmallX", _Theme.songMenuTileBoard.TileRectSmall.X.ToString("#0"));
|
||||
writer.WriteElementString("TileRectSmallY", _Theme.songMenuTileBoard.TileRectSmall.Y.ToString("#0"));
|
||||
writer.WriteElementString("TileRectSmallZ", _Theme.songMenuTileBoard.TileRectSmall.Z.ToString("#0.00"));
|
||||
writer.WriteElementString("TileRectSmallW", _Theme.songMenuTileBoard.TileRectSmall.W.ToString("#0"));
|
||||
writer.WriteElementString("TileRectSmallH", _Theme.songMenuTileBoard.TileRectSmall.H.ToString("#0"));
|
||||
writer.WriteElementString("TileRectSmallX", _Theme.SongMenuTileBoard.TileRectSmall.X.ToString("#0"));
|
||||
writer.WriteElementString("TileRectSmallY", _Theme.SongMenuTileBoard.TileRectSmall.Y.ToString("#0"));
|
||||
writer.WriteElementString("TileRectSmallZ", _Theme.SongMenuTileBoard.TileRectSmall.Z.ToString("#0.00"));
|
||||
writer.WriteElementString("TileRectSmallW", _Theme.SongMenuTileBoard.TileRectSmall.W.ToString("#0"));
|
||||
writer.WriteElementString("TileRectSmallH", _Theme.SongMenuTileBoard.TileRectSmall.H.ToString("#0"));
|
||||
|
||||
_Theme.songMenuTileBoard.TextArtist.SaveTheme(writer);
|
||||
_Theme.songMenuTileBoard.TextTitle.SaveTheme(writer);
|
||||
_Theme.songMenuTileBoard.TextSongLength.SaveTheme(writer);
|
||||
_Theme.SongMenuTileBoard.TextArtist.SaveTheme(writer);
|
||||
_Theme.SongMenuTileBoard.TextTitle.SaveTheme(writer);
|
||||
_Theme.SongMenuTileBoard.TextSongLength.SaveTheme(writer);
|
||||
|
||||
_Theme.songMenuTileBoard.StaticCoverBig.SaveTheme(writer);
|
||||
_Theme.songMenuTileBoard.StaticTextBG.SaveTheme(writer);
|
||||
_Theme.songMenuTileBoard.StaticDuetIcon.SaveTheme(writer);
|
||||
_Theme.songMenuTileBoard.StaticVideoIcon.SaveTheme(writer);
|
||||
_Theme.songMenuTileBoard.StaticMedleyCalcIcon.SaveTheme(writer);
|
||||
_Theme.songMenuTileBoard.StaticMedleyTagIcon.SaveTheme(writer);
|
||||
_Theme.SongMenuTileBoard.StaticCoverBig.SaveTheme(writer);
|
||||
_Theme.SongMenuTileBoard.StaticTextBG.SaveTheme(writer);
|
||||
_Theme.SongMenuTileBoard.StaticDuetIcon.SaveTheme(writer);
|
||||
_Theme.SongMenuTileBoard.StaticVideoIcon.SaveTheme(writer);
|
||||
_Theme.SongMenuTileBoard.StaticMedleyCalcIcon.SaveTheme(writer);
|
||||
_Theme.SongMenuTileBoard.StaticMedleyTagIcon.SaveTheme(writer);
|
||||
|
||||
writer.WriteEndElement();
|
||||
#endregion SongMenuTileBoard
|
||||
@@ -405,7 +405,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
public virtual void Init()
|
||||
{
|
||||
Reset();
|
||||
_Reset();
|
||||
_Initialized = true;
|
||||
}
|
||||
|
||||
@@ -415,32 +415,32 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
Init();
|
||||
}
|
||||
|
||||
public virtual void Update(ScreenSongOptions SongOptions)
|
||||
public virtual void Update(SScreenSongOptions songOptions)
|
||||
{
|
||||
if (!_Initialized)
|
||||
return;
|
||||
|
||||
if (_actsong != _PreviewSelected)
|
||||
SelectSong(_PreviewSelected);
|
||||
if (_Actsong != _PreviewSelected)
|
||||
_SelectSong(_PreviewSelected);
|
||||
|
||||
if (_streams.Count > 0 && _Video != -1)
|
||||
if (_Streams.Count > 0 && _Video != -1)
|
||||
{
|
||||
if (CBase.Video.IsFinished(_Video) || CBase.Sound.IsFinished(_actsongstream))
|
||||
if (CBase.Video.IsFinished(_Video) || CBase.Sound.IsFinished(_Actsongstream))
|
||||
{
|
||||
CBase.Video.Close(_Video);
|
||||
_Video = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
float time = CBase.Sound.GetPosition(_actsongstream);
|
||||
float time = CBase.Sound.GetPosition(_Actsongstream);
|
||||
|
||||
float vtime = 0f;
|
||||
CBase.Video.GetFrame(_Video, ref _vidtex, time, ref vtime);
|
||||
CBase.Video.GetFrame(_Video, ref _Vidtex, time, ref vtime);
|
||||
if (_VideoFadeTimer.ElapsedMilliseconds <= 3000L)
|
||||
_vidtex.color.A = _VideoFadeTimer.ElapsedMilliseconds / 3000f;
|
||||
_Vidtex.Color.A = _VideoFadeTimer.ElapsedMilliseconds / 3000f;
|
||||
else
|
||||
{
|
||||
_vidtex.color.A = 1f;
|
||||
_Vidtex.Color.A = 1f;
|
||||
_VideoFadeTimer.Stop();
|
||||
}
|
||||
}
|
||||
@@ -448,33 +448,33 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
public virtual void OnShow()
|
||||
{
|
||||
_actsongstream = -1;
|
||||
_vidtex = new STexture(-1);
|
||||
_Actsongstream = -1;
|
||||
_Vidtex = new STexture(-1);
|
||||
}
|
||||
|
||||
public virtual void OnHide()
|
||||
{
|
||||
foreach (int stream in _streams)
|
||||
foreach (int stream in _Streams)
|
||||
CBase.Sound.FadeAndStop(stream, 0f, 0.75f);
|
||||
_streams.Clear();
|
||||
_Streams.Clear();
|
||||
|
||||
CBase.Video.Close(_Video);
|
||||
_Video = -1;
|
||||
|
||||
CBase.Drawing.RemoveTexture(ref _vidtex);
|
||||
CBase.Drawing.RemoveTexture(ref _Vidtex);
|
||||
|
||||
_timer.Stop();
|
||||
_timer.Reset();
|
||||
_Timer.Stop();
|
||||
_Timer.Reset();
|
||||
_SelectedInternal = _SelectedPending;
|
||||
}
|
||||
|
||||
public virtual void HandleInput(ref KeyEvent KeyEvent, ScreenSongOptions SongOptions)
|
||||
public virtual void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions)
|
||||
{
|
||||
if (!_Initialized)
|
||||
return;
|
||||
}
|
||||
|
||||
public virtual void HandleMouse(ref MouseEvent MouseEvent, ScreenSongOptions SongOptions)
|
||||
public virtual void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions)
|
||||
{
|
||||
if (!_Initialized)
|
||||
return;
|
||||
@@ -486,14 +486,14 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return;
|
||||
|
||||
if (_Video != -1)
|
||||
CBase.Drawing.DrawTexture(_vidtex, new SRectF(0, 0, 1280, 720, 0));
|
||||
CBase.Drawing.DrawTexture(_Vidtex, new SRectF(0, 0, 1280, 720, 0));
|
||||
}
|
||||
|
||||
public virtual void ApplyVolume(float VolumeMax)
|
||||
public virtual void ApplyVolume(float volumeMax)
|
||||
{
|
||||
_MaxVolume = VolumeMax;
|
||||
_MaxVolume = volumeMax;
|
||||
|
||||
foreach (int stream in _streams)
|
||||
foreach (int stream in _Streams)
|
||||
CBase.Sound.SetStreamVolumeMax(stream, _MaxVolume);
|
||||
}
|
||||
|
||||
@@ -502,9 +502,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _Active;
|
||||
}
|
||||
|
||||
public virtual void SetActive(bool Active)
|
||||
public virtual void SetActive(bool active)
|
||||
{
|
||||
_Active = Active;
|
||||
_Active = active;
|
||||
}
|
||||
|
||||
public virtual int GetSelectedSong()
|
||||
@@ -522,19 +522,19 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return -1;
|
||||
}
|
||||
|
||||
public virtual void SetSelectedSong(int VisibleSongNr)
|
||||
public virtual void SetSelectedSong(int visibleSongNr)
|
||||
{
|
||||
if (!_Initialized)
|
||||
return;
|
||||
}
|
||||
|
||||
public virtual void SetSelectedCategory(int CategoryNr)
|
||||
public virtual void SetSelectedCategory(int categoryNr)
|
||||
{
|
||||
if (!_Initialized)
|
||||
return;
|
||||
}
|
||||
|
||||
public virtual void SetSmallView(bool SmallView)
|
||||
public virtual void SetSmallView(bool smallView)
|
||||
{
|
||||
if (!_Initialized)
|
||||
return;
|
||||
@@ -567,23 +567,23 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return false;
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() >= 0 || _PreviewSelected < 0 || _PreviewSelected >= CBase.Songs.GetNumCategories())
|
||||
return false;
|
||||
EnterCategory(_PreviewSelected);
|
||||
_EnterCategory(_PreviewSelected);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected virtual void EnterCategory(int Category)
|
||||
protected virtual void _EnterCategory(int category)
|
||||
{
|
||||
if (!_Initialized)
|
||||
return;
|
||||
|
||||
if (Category >= CBase.Songs.GetNumCategories())
|
||||
if (category >= CBase.Songs.GetNumCategories())
|
||||
return;
|
||||
|
||||
Reset();
|
||||
CBase.Songs.SetCategory(Category);
|
||||
_Reset();
|
||||
CBase.Songs.SetCategory(category);
|
||||
}
|
||||
|
||||
protected virtual void ShowCategories()
|
||||
protected virtual void _ShowCategories()
|
||||
{
|
||||
if (!_Initialized)
|
||||
return;
|
||||
@@ -591,37 +591,37 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() == -1)
|
||||
return;
|
||||
|
||||
Reset();
|
||||
_Reset();
|
||||
CBase.Songs.SetCategory(-1);
|
||||
}
|
||||
|
||||
public void ApplyVolume()
|
||||
{
|
||||
CBase.Sound.SetStreamVolume(_actsongstream, CBase.Config.GetPreviewMusicVolume());
|
||||
CBase.Sound.SetStreamVolume(_Actsongstream, CBase.Config.GetPreviewMusicVolume());
|
||||
}
|
||||
|
||||
protected void SelectSong(int nr)
|
||||
protected void _SelectSong(int nr)
|
||||
{
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() >= 0 && (CBase.Songs.GetNumVisibleSongs() > 0) && (nr >= 0) && ((_actsong != nr) || (_streams.Count == 0)))
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() >= 0 && (CBase.Songs.GetNumVisibleSongs() > 0) && (nr >= 0) && ((_Actsong != nr) || (_Streams.Count == 0)))
|
||||
{
|
||||
_streams.ForEach(soundStream => CBase.Sound.FadeAndStop(soundStream, 0f, 1f));
|
||||
_streams.Clear();
|
||||
_Streams.ForEach(soundStream => CBase.Sound.FadeAndStop(soundStream, 0f, 1f));
|
||||
_Streams.Clear();
|
||||
|
||||
CBase.Video.Close(_Video);
|
||||
_Video = -1;
|
||||
|
||||
CBase.Drawing.RemoveTexture(ref _vidtex);
|
||||
CBase.Drawing.RemoveTexture(ref _Vidtex);
|
||||
|
||||
_actsong = nr;
|
||||
if (_actsong >= CBase.Songs.GetNumVisibleSongs())
|
||||
_actsong = 0;
|
||||
_Actsong = nr;
|
||||
if (_Actsong >= CBase.Songs.GetNumVisibleSongs())
|
||||
_Actsong = 0;
|
||||
|
||||
|
||||
int stream = CBase.Sound.Load(Path.Combine(CBase.Songs.GetVisibleSong(_actsong).Folder, CBase.Songs.GetVisibleSong(_actsong).MP3FileName), true);
|
||||
int stream = CBase.Sound.Load(Path.Combine(CBase.Songs.GetVisibleSong(_Actsong).Folder, CBase.Songs.GetVisibleSong(_Actsong).MP3FileName), true);
|
||||
CBase.Sound.SetStreamVolumeMax(stream, _MaxVolume);
|
||||
CBase.Sound.SetStreamVolume(stream, 0f);
|
||||
|
||||
float startposition = CBase.Songs.GetVisibleSong(_actsong).PreviewStart;
|
||||
float startposition = CBase.Songs.GetVisibleSong(_Actsong).PreviewStart;
|
||||
|
||||
if (startposition == 0f)
|
||||
startposition = CBase.Sound.GetLength(stream) / 4f;
|
||||
@@ -629,15 +629,15 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
CBase.Sound.SetPosition(stream, startposition);
|
||||
CBase.Sound.Play(stream);
|
||||
CBase.Sound.Fade(stream, 100f, 3f);
|
||||
_streams.Add(stream);
|
||||
_actsongstream = stream;
|
||||
_Streams.Add(stream);
|
||||
_Actsongstream = stream;
|
||||
|
||||
if (CBase.Songs.GetVisibleSong(_actsong).VideoFileName.Length > 0 && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
|
||||
if (CBase.Songs.GetVisibleSong(_Actsong).VideoFileName.Length > 0 && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
_Video = CBase.Video.Load(Path.Combine(CBase.Songs.GetVisibleSong(_actsong).Folder, CBase.Songs.GetVisibleSong(_actsong).VideoFileName));
|
||||
_Video = CBase.Video.Load(Path.Combine(CBase.Songs.GetVisibleSong(_Actsong).Folder, CBase.Songs.GetVisibleSong(_Actsong).VideoFileName));
|
||||
if (_Video == -1)
|
||||
return;
|
||||
CBase.Video.Skip(_Video, startposition, CBase.Songs.GetVisibleSong(_actsong).VideoGap);
|
||||
CBase.Video.Skip(_Video, startposition, CBase.Songs.GetVisibleSong(_Actsong).VideoGap);
|
||||
_VideoFadeTimer.Stop();
|
||||
_VideoFadeTimer.Reset();
|
||||
_VideoFadeTimer.Start();
|
||||
@@ -645,19 +645,19 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
}
|
||||
|
||||
protected void Reset()
|
||||
protected void _Reset()
|
||||
{
|
||||
foreach (int stream in _streams)
|
||||
foreach (int stream in _Streams)
|
||||
CBase.Sound.FadeAndStop(stream, 0f, 0.75f);
|
||||
_streams.Clear();
|
||||
_Streams.Clear();
|
||||
|
||||
CBase.Video.Close(_Video);
|
||||
_Video = -1;
|
||||
|
||||
CBase.Drawing.RemoveTexture(ref _vidtex);
|
||||
CBase.Drawing.RemoveTexture(ref _Vidtex);
|
||||
|
||||
_timer.Stop();
|
||||
_timer.Reset();
|
||||
_Timer.Stop();
|
||||
_Timer.Reset();
|
||||
_SelectedInternal = _SelectedPending;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
class CSongMenuList : CSongMenuFramework
|
||||
{
|
||||
public CSongMenuList(int PartyModeID)
|
||||
: base(PartyModeID) {}
|
||||
public CSongMenuList(int partyModeID)
|
||||
: base(partyModeID) {}
|
||||
}
|
||||
}
|
||||
@@ -34,33 +34,33 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
private int _TileH;
|
||||
|
||||
private int _Offset = -1;
|
||||
private int _actualSelection = -1;
|
||||
private int _ActualSelection = -1;
|
||||
|
||||
private bool _SmallView;
|
||||
|
||||
public CSongMenuTileBoard(int PartyModeID)
|
||||
: base(PartyModeID) {}
|
||||
public CSongMenuTileBoard(int partyModeID)
|
||||
: base(partyModeID) {}
|
||||
|
||||
public override int GetActualSelection()
|
||||
{
|
||||
return _actualSelection;
|
||||
return _ActualSelection;
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
|
||||
_Rect = _Theme.songMenuTileBoard.TileRect;
|
||||
_Rect = _Theme.SongMenuTileBoard.TileRect;
|
||||
|
||||
_NumW = _Theme.songMenuTileBoard.numW;
|
||||
_NumH = _Theme.songMenuTileBoard.numH;
|
||||
_SpaceW = _Theme.songMenuTileBoard.spaceW;
|
||||
_SpaceH = _Theme.songMenuTileBoard.spaceH;
|
||||
_NumW = _Theme.SongMenuTileBoard.NumW;
|
||||
_NumH = _Theme.SongMenuTileBoard.NumH;
|
||||
_SpaceW = _Theme.SongMenuTileBoard.SpaceW;
|
||||
_SpaceH = _Theme.SongMenuTileBoard.SpaceH;
|
||||
|
||||
_PendingTime = 100L;
|
||||
|
||||
_TileW = (int)((_Theme.songMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW);
|
||||
_TileH = (int)((_Theme.songMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH);
|
||||
_TileW = (int)((_Theme.SongMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW);
|
||||
_TileH = (int)((_Theme.SongMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH);
|
||||
|
||||
_CoverTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID);
|
||||
_CoverBigTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID);
|
||||
@@ -70,38 +70,38 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
for (int j = 0; j < _NumW; j++)
|
||||
{
|
||||
SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW),
|
||||
_Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z);
|
||||
SRectF rect = new SRectF(_Theme.SongMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW),
|
||||
_Theme.SongMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z);
|
||||
CStatic tile = new CStatic(_PartyModeID, _CoverTexture, Color, rect);
|
||||
_Tiles.Add(tile);
|
||||
}
|
||||
}
|
||||
|
||||
_ScrollRect = new SRectF(0, 0, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), _Theme.songMenuTileBoard.TileRect.Z);
|
||||
_ScrollRect = new SRectF(0, 0, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), _Theme.SongMenuTileBoard.TileRect.Z);
|
||||
|
||||
_PreviewSelected = -1;
|
||||
_Offset = 0;
|
||||
|
||||
_CoverBig = _Theme.songMenuTileBoard.StaticCoverBig;
|
||||
_TextBG = _Theme.songMenuTileBoard.StaticTextBG;
|
||||
_DuetIcon = _Theme.songMenuTileBoard.StaticDuetIcon;
|
||||
_VideoIcon = _Theme.songMenuTileBoard.StaticVideoIcon;
|
||||
_MedleyCalcIcon = _Theme.songMenuTileBoard.StaticMedleyCalcIcon;
|
||||
_MedleyTagIcon = _Theme.songMenuTileBoard.StaticMedleyTagIcon;
|
||||
_CoverBig = _Theme.SongMenuTileBoard.StaticCoverBig;
|
||||
_TextBG = _Theme.SongMenuTileBoard.StaticTextBG;
|
||||
_DuetIcon = _Theme.SongMenuTileBoard.StaticDuetIcon;
|
||||
_VideoIcon = _Theme.SongMenuTileBoard.StaticVideoIcon;
|
||||
_MedleyCalcIcon = _Theme.SongMenuTileBoard.StaticMedleyCalcIcon;
|
||||
_MedleyTagIcon = _Theme.SongMenuTileBoard.StaticMedleyTagIcon;
|
||||
|
||||
_Artist = _Theme.songMenuTileBoard.TextArtist;
|
||||
_Title = _Theme.songMenuTileBoard.TextTitle;
|
||||
_SongLength = _Theme.songMenuTileBoard.TextSongLength;
|
||||
_Artist = _Theme.SongMenuTileBoard.TextArtist;
|
||||
_Title = _Theme.SongMenuTileBoard.TextTitle;
|
||||
_SongLength = _Theme.SongMenuTileBoard.TextSongLength;
|
||||
}
|
||||
|
||||
public override void Update(ScreenSongOptions SongOptions)
|
||||
public override void Update(SScreenSongOptions songOptions)
|
||||
{
|
||||
base.Update(SongOptions);
|
||||
base.Update(songOptions);
|
||||
|
||||
if (SongOptions.Selection.RandomOnly)
|
||||
if (songOptions.Selection.RandomOnly)
|
||||
{
|
||||
_Locked = _PreviewSelected;
|
||||
_actualSelection = _PreviewSelected;
|
||||
_ActualSelection = _PreviewSelected;
|
||||
for (int i = 0; i < _Tiles.Count; i++)
|
||||
_Tiles[i].Selected = _Locked == i + _Offset;
|
||||
}
|
||||
@@ -110,14 +110,14 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
public override void OnShow()
|
||||
{
|
||||
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && CBase.Songs.GetNumCategories() > 0 && CBase.Songs.GetCurrentCategoryIndex() == -1)
|
||||
EnterCategory(0);
|
||||
_actualSelection = -1;
|
||||
_EnterCategory(0);
|
||||
_ActualSelection = -1;
|
||||
_Locked = -1;
|
||||
_PreviewSelected = -1;
|
||||
UpdateList(0, true);
|
||||
_UpdateList(0, true);
|
||||
//AfterCategoryChange();
|
||||
SetSelectedSong(_ActSong);
|
||||
AfterCategoryChange();
|
||||
_AfterCategoryChange();
|
||||
CBase.Songs.UpdateRandomSongList();
|
||||
|
||||
int actcat = _PreviewSelected;
|
||||
@@ -150,15 +150,15 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
}
|
||||
|
||||
public override void HandleInput(ref KeyEvent KeyEvent, ScreenSongOptions SongOptions)
|
||||
public override void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions)
|
||||
{
|
||||
base.HandleInput(ref KeyEvent, SongOptions);
|
||||
base.HandleInput(ref keyEvent, songOptions);
|
||||
|
||||
if (!KeyEvent.KeyPressed)
|
||||
if (!keyEvent.KeyPressed)
|
||||
{
|
||||
if (!(KeyEvent.Key == Keys.Left || KeyEvent.Key == Keys.Right || KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down ||
|
||||
KeyEvent.Key == Keys.Escape || KeyEvent.Key == Keys.Back || KeyEvent.Key == Keys.Enter ||
|
||||
KeyEvent.Key == Keys.PageDown || KeyEvent.Key == Keys.PageUp))
|
||||
if (!(keyEvent.Key == Keys.Left || keyEvent.Key == Keys.Right || keyEvent.Key == Keys.Up || keyEvent.Key == Keys.Down ||
|
||||
keyEvent.Key == Keys.Escape || keyEvent.Key == Keys.Back || keyEvent.Key == Keys.Enter ||
|
||||
keyEvent.Key == Keys.PageDown || keyEvent.Key == Keys.PageUp))
|
||||
return;
|
||||
|
||||
bool sel = false;
|
||||
@@ -172,39 +172,39 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
|
||||
if ((_Locked == -1 || !sel) &&
|
||||
(KeyEvent.Key != Keys.Escape && KeyEvent.Key != Keys.Back && KeyEvent.Key != Keys.PageUp && KeyEvent.Key != Keys.PageDown))
|
||||
(keyEvent.Key != Keys.Escape && keyEvent.Key != Keys.Back && keyEvent.Key != Keys.PageUp && keyEvent.Key != Keys.PageDown))
|
||||
{
|
||||
if (_PreviewSelected > -1)
|
||||
_Locked = _PreviewSelected;
|
||||
else
|
||||
{
|
||||
_Locked = 0;
|
||||
_actualSelection = 0;
|
||||
_ActualSelection = 0;
|
||||
_PreviewSelected = 0;
|
||||
SetSelectedNow();
|
||||
UpdateList(0, true);
|
||||
_SetSelectedNow();
|
||||
_UpdateList(0, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (KeyEvent.Key)
|
||||
switch (keyEvent.Key)
|
||||
{
|
||||
case Keys.Enter:
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() < 0)
|
||||
{
|
||||
EnterCategory(_PreviewSelected);
|
||||
KeyEvent.Handled = true;
|
||||
_EnterCategory(_PreviewSelected);
|
||||
keyEvent.Handled = true;
|
||||
}
|
||||
else if (_actualSelection > -1 && _PreviewSelected >= 0)
|
||||
_Locked = _actualSelection;
|
||||
else if (_ActualSelection > -1 && _PreviewSelected >= 0)
|
||||
_Locked = _ActualSelection;
|
||||
break;
|
||||
|
||||
case Keys.Escape:
|
||||
case Keys.Back:
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() > -1 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() > -1 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
|
||||
{
|
||||
ShowCategories();
|
||||
KeyEvent.Handled = true;
|
||||
_ShowCategories();
|
||||
keyEvent.Handled = true;
|
||||
}
|
||||
//else if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF)
|
||||
//{
|
||||
@@ -213,85 +213,85 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
break;
|
||||
|
||||
case Keys.PageUp:
|
||||
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
|
||||
PrevCategory();
|
||||
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
|
||||
_PrevCategory();
|
||||
break;
|
||||
|
||||
case Keys.PageDown:
|
||||
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
|
||||
NextCategory();
|
||||
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
|
||||
_NextCategory();
|
||||
break;
|
||||
|
||||
case Keys.Left:
|
||||
if (_Locked > 0 && (!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
|
||||
if (_Locked > 0 && (!songOptions.Selection.RandomOnly || songOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
|
||||
{
|
||||
_Locked--;
|
||||
UpdateList();
|
||||
_UpdateList();
|
||||
}
|
||||
break;
|
||||
|
||||
case Keys.Right:
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed)
|
||||
{
|
||||
if (_Locked < CBase.Songs.GetNumCategories() - 1)
|
||||
{
|
||||
_Locked++;
|
||||
UpdateList();
|
||||
_UpdateList();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() != -1 && _Locked < CBase.Songs.GetNumVisibleSongs() - 1 && !SongOptions.Selection.RandomOnly)
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() != -1 && _Locked < CBase.Songs.GetNumVisibleSongs() - 1 && !songOptions.Selection.RandomOnly)
|
||||
{
|
||||
_Locked++;
|
||||
UpdateList();
|
||||
_UpdateList();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case Keys.Up:
|
||||
if (KeyEvent.ModSHIFT && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
|
||||
if (keyEvent.ModShift && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
|
||||
{
|
||||
PrevCategory();
|
||||
_PrevCategory();
|
||||
break;
|
||||
}
|
||||
|
||||
if (_Locked > _NumW - 1 &&
|
||||
(!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
|
||||
(!songOptions.Selection.RandomOnly || songOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
|
||||
{
|
||||
_Locked -= _NumW;
|
||||
UpdateList();
|
||||
_UpdateList();
|
||||
}
|
||||
break;
|
||||
|
||||
case Keys.Down:
|
||||
if (KeyEvent.ModSHIFT && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed)
|
||||
if (keyEvent.ModShift && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
|
||||
{
|
||||
NextCategory();
|
||||
_NextCategory();
|
||||
break;
|
||||
}
|
||||
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed)
|
||||
{
|
||||
if (_Locked < CBase.Songs.GetNumCategories() - _NumW)
|
||||
{
|
||||
_Locked += _NumW;
|
||||
UpdateList();
|
||||
_UpdateList();
|
||||
}
|
||||
}
|
||||
else if (_Locked < CBase.Songs.GetNumVisibleSongs() - _NumW && !SongOptions.Selection.RandomOnly)
|
||||
else if (_Locked < CBase.Songs.GetNumVisibleSongs() - _NumW && !songOptions.Selection.RandomOnly)
|
||||
{
|
||||
_Locked += _NumW;
|
||||
UpdateList();
|
||||
_UpdateList();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!KeyEvent.Handled)
|
||||
if (!keyEvent.Handled)
|
||||
{
|
||||
_PreviewSelected = _Locked;
|
||||
_actualSelection = _Locked;
|
||||
_ActualSelection = _Locked;
|
||||
|
||||
for (int i = 0; i < _Tiles.Count; i++)
|
||||
_Tiles[i].Selected = _Locked == i + _Offset;
|
||||
@@ -299,21 +299,21 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
}
|
||||
|
||||
public override void HandleMouse(ref MouseEvent MouseEvent, ScreenSongOptions SongOptions)
|
||||
public override void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions)
|
||||
{
|
||||
base.HandleMouse(ref MouseEvent, SongOptions);
|
||||
base.HandleMouse(ref mouseEvent, songOptions);
|
||||
|
||||
int i = 0;
|
||||
bool sel = false;
|
||||
int lastselection = _actualSelection;
|
||||
int lastselection = _ActualSelection;
|
||||
|
||||
if (!SongOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)
|
||||
if (!songOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed)
|
||||
{
|
||||
foreach (CStatic tile in _Tiles)
|
||||
{
|
||||
if ((tile.Texture.index != _CoverTexture.index) && CHelper.IsInBounds(tile.Rect, MouseEvent) && !sel)
|
||||
if ((tile.Texture.Index != _CoverTexture.Index) && CHelper.IsInBounds(tile.Rect, mouseEvent) && !sel)
|
||||
{
|
||||
if (MouseEvent.LB || CBase.Songs.GetCurrentCategoryIndex() == -1)
|
||||
if (mouseEvent.LB || CBase.Songs.GetCurrentCategoryIndex() == -1)
|
||||
{
|
||||
if (_PreviewSelected == i + _Offset)
|
||||
_Locked = _PreviewSelected;
|
||||
@@ -324,7 +324,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
}
|
||||
tile.Selected = true;
|
||||
_actualSelection = i + _Offset;
|
||||
_ActualSelection = i + _Offset;
|
||||
sel = true;
|
||||
}
|
||||
else
|
||||
@@ -335,42 +335,42 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
else
|
||||
sel = true;
|
||||
|
||||
if (MouseEvent.Sender == ESender.WiiMote && _actualSelection != lastselection && _actualSelection != -1)
|
||||
if (mouseEvent.Sender == ESender.WiiMote && _ActualSelection != lastselection && _ActualSelection != -1)
|
||||
CBase.Input.SetRumble(0.050f);
|
||||
|
||||
if (!sel)
|
||||
_actualSelection = -1;
|
||||
_ActualSelection = -1;
|
||||
|
||||
if (MouseEvent.RB && (CBase.Songs.GetNumCategories() > 0) && CBase.Songs.GetCurrentCategoryIndex() >= 0 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON &&
|
||||
SongOptions.Selection.CategoryChangeAllowed)
|
||||
if (mouseEvent.RB && (CBase.Songs.GetNumCategories() > 0) && CBase.Songs.GetCurrentCategoryIndex() >= 0 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON &&
|
||||
songOptions.Selection.CategoryChangeAllowed)
|
||||
{
|
||||
ShowCategories();
|
||||
MouseEvent.Handled = true;
|
||||
_ShowCategories();
|
||||
mouseEvent.Handled = true;
|
||||
return;
|
||||
}
|
||||
else if (MouseEvent.RB && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && !SongOptions.Selection.PartyMode)
|
||||
else if (mouseEvent.RB && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && !songOptions.Selection.PartyMode)
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenMain);
|
||||
else if (_PreviewSelected != -1 && MouseEvent.LB && CBase.Songs.GetCurrentCategoryIndex() != -1 && !SongOptions.Selection.PartyMode)
|
||||
else if (_PreviewSelected != -1 && mouseEvent.LB && CBase.Songs.GetCurrentCategoryIndex() != -1 && !songOptions.Selection.PartyMode)
|
||||
{
|
||||
if (CHelper.IsInBounds(_CoverBig.Rect, MouseEvent) || CHelper.IsInBounds(_TextBG.Rect, MouseEvent))
|
||||
if (CHelper.IsInBounds(_CoverBig.Rect, mouseEvent) || CHelper.IsInBounds(_TextBG.Rect, mouseEvent))
|
||||
_Locked = _PreviewSelected;
|
||||
}
|
||||
else if (MouseEvent.LB && (CBase.Songs.GetCurrentCategoryIndex() == -1))
|
||||
else if (mouseEvent.LB && (CBase.Songs.GetCurrentCategoryIndex() == -1))
|
||||
{
|
||||
foreach (CStatic tile in _Tiles)
|
||||
{
|
||||
if ((tile.Texture.index != _CoverTexture.index) && CHelper.IsInBounds(tile.Rect, MouseEvent))
|
||||
if ((tile.Texture.Index != _CoverTexture.Index) && CHelper.IsInBounds(tile.Rect, mouseEvent))
|
||||
{
|
||||
EnterCategory(_PreviewSelected);
|
||||
MouseEvent.Handled = true;
|
||||
_EnterCategory(_PreviewSelected);
|
||||
mouseEvent.Handled = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (MouseEvent.Wheel != 0 && CHelper.IsInBounds(_ScrollRect, MouseEvent) &&
|
||||
(!SongOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed))
|
||||
UpdateList(_Offset + _NumW * MouseEvent.Wheel);
|
||||
if (mouseEvent.Wheel != 0 && CHelper.IsInBounds(_ScrollRect, mouseEvent) &&
|
||||
(!songOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed))
|
||||
_UpdateList(_Offset + _NumW * mouseEvent.Wheel);
|
||||
}
|
||||
|
||||
public override void Draw()
|
||||
@@ -381,7 +381,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
tile.Draw(1.2f, tile.Rect.Z - 0.1f, EAspect.Crop, false);
|
||||
else
|
||||
{
|
||||
if (tile.Texture.index != _CoverTexture.index)
|
||||
if (tile.Texture.Index != _CoverTexture.Index)
|
||||
tile.Draw(1f, tile.Rect.Z, EAspect.Crop, false);
|
||||
else
|
||||
tile.Draw(1f, tile.Rect.Z, EAspect.Stretch, false);
|
||||
@@ -403,13 +403,13 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_MedleyCalcIcon.Visible = song.Medley.Source == EMedleySource.Calculated;
|
||||
_MedleyTagIcon.Visible = song.Medley.Source == EMedleySource.Tag;
|
||||
|
||||
float Time = CBase.Sound.GetLength(_SongStream);
|
||||
float time = CBase.Sound.GetLength(_SongStream);
|
||||
if (song.Finish != 0)
|
||||
Time = song.Finish;
|
||||
time = song.Finish;
|
||||
|
||||
Time -= song.Start;
|
||||
int min = (int)Math.Floor(Time / 60f);
|
||||
int sec = (int)(Time - min * 60f);
|
||||
time -= song.Start;
|
||||
int min = (int)Math.Floor(time / 60f);
|
||||
int sec = (int)(time - min * 60f);
|
||||
_SongLength.Text = min.ToString("00") + ":" + sec.ToString("00");
|
||||
}
|
||||
}
|
||||
@@ -438,18 +438,18 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_TextBG.Draw();
|
||||
|
||||
|
||||
if (_vidtex.index != -1 && _Video != -1)
|
||||
if (_Vidtex.Index != -1 && _Video != -1)
|
||||
{
|
||||
if (_vidtex.color.A < 1)
|
||||
if (_Vidtex.Color.A < 1)
|
||||
_CoverBig.Draw(1f, EAspect.Crop);
|
||||
RectangleF bounds = new RectangleF(_CoverBig.Rect.X, _CoverBig.Rect.Y, _CoverBig.Rect.W, _CoverBig.Rect.H);
|
||||
RectangleF rect = new RectangleF(0f, 0f, _vidtex.width, _vidtex.height);
|
||||
RectangleF rect = new RectangleF(0f, 0f, _Vidtex.Width, _Vidtex.Height);
|
||||
CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);
|
||||
SRectF vidRect = new SRectF(rect.X, rect.Y, rect.Width, rect.Height, _CoverBig.Rect.Z);
|
||||
SRectF vidRectBounds = new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f);
|
||||
|
||||
CBase.Drawing.DrawTexture(_vidtex, vidRect, _vidtex.color, vidRectBounds, false);
|
||||
CBase.Drawing.DrawTextureReflection(_vidtex, vidRect, _vidtex.color, vidRectBounds, _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight);
|
||||
CBase.Drawing.DrawTexture(_Vidtex, vidRect, _Vidtex.Color, vidRectBounds, false);
|
||||
CBase.Drawing.DrawTextureReflection(_Vidtex, vidRect, _Vidtex.Color, vidRectBounds, _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight);
|
||||
}
|
||||
else
|
||||
_CoverBig.Draw(1f, EAspect.Crop);
|
||||
@@ -479,7 +479,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return new CStatic(_PartyModeID);
|
||||
}
|
||||
|
||||
protected void SetSelectedTile(int itemNr)
|
||||
protected void _SetSelectedTile(int itemNr)
|
||||
{
|
||||
bool sel = false;
|
||||
foreach (CStatic tile in _Tiles)
|
||||
@@ -498,10 +498,10 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
else
|
||||
{
|
||||
_Locked = 0;
|
||||
_actualSelection = 0;
|
||||
_ActualSelection = 0;
|
||||
_PreviewSelected = 0;
|
||||
SetSelectedNow();
|
||||
UpdateList(0, true);
|
||||
_SetSelectedNow();
|
||||
_UpdateList(0, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -509,100 +509,100 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
tile.Selected = false;
|
||||
|
||||
_PreviewSelected = itemNr;
|
||||
SetSelectedNow();
|
||||
_SetSelectedNow();
|
||||
_Locked = itemNr;
|
||||
|
||||
UpdateList(true);
|
||||
_UpdateList(true);
|
||||
|
||||
_PreviewSelected = _Locked;
|
||||
_actualSelection = _Locked;
|
||||
_ActualSelection = _Locked;
|
||||
|
||||
if (_Locked - _Offset >= 0)
|
||||
_Tiles[_Locked - _Offset].Selected = true;
|
||||
}
|
||||
|
||||
public override void SetSelectedSong(int VisibleSongNr)
|
||||
public override void SetSelectedSong(int visibleSongNr)
|
||||
{
|
||||
base.SetSelectedSong(VisibleSongNr);
|
||||
base.SetSelectedSong(visibleSongNr);
|
||||
|
||||
if (VisibleSongNr >= 0 && VisibleSongNr < CBase.Songs.GetNumVisibleSongs())
|
||||
SetSelectedTile(VisibleSongNr);
|
||||
if (visibleSongNr >= 0 && visibleSongNr < CBase.Songs.GetNumVisibleSongs())
|
||||
_SetSelectedTile(visibleSongNr);
|
||||
}
|
||||
|
||||
public override void SetSelectedCategory(int CategoryNr)
|
||||
public override void SetSelectedCategory(int categoryNr)
|
||||
{
|
||||
base.SetSelectedCategory(CategoryNr);
|
||||
base.SetSelectedCategory(categoryNr);
|
||||
|
||||
if (CategoryNr >= 0 && CategoryNr < CBase.Songs.GetNumCategories())
|
||||
SetSelectedTile(CategoryNr);
|
||||
if (categoryNr >= 0 && categoryNr < CBase.Songs.GetNumCategories())
|
||||
_SetSelectedTile(categoryNr);
|
||||
}
|
||||
|
||||
protected override void EnterCategory(int cat)
|
||||
protected override void _EnterCategory(int cat)
|
||||
{
|
||||
base.EnterCategory(cat);
|
||||
base._EnterCategory(cat);
|
||||
|
||||
_PreviewSelected = 0;
|
||||
_Locked = -1;
|
||||
_actualSelection = 0;
|
||||
AfterCategoryChange();
|
||||
_ActualSelection = 0;
|
||||
_AfterCategoryChange();
|
||||
_Locked = 0;
|
||||
}
|
||||
|
||||
protected override void ShowCategories()
|
||||
protected override void _ShowCategories()
|
||||
{
|
||||
base.ShowCategories();
|
||||
base._ShowCategories();
|
||||
|
||||
_PreviewSelected = 0;
|
||||
_Locked = -1;
|
||||
_actualSelection = 0;
|
||||
AfterCategoryChange();
|
||||
_ActualSelection = 0;
|
||||
_AfterCategoryChange();
|
||||
_Locked = 0;
|
||||
}
|
||||
|
||||
private void NextCategory()
|
||||
private void _NextCategory()
|
||||
{
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() > -1)
|
||||
{
|
||||
CBase.Songs.NextCategory();
|
||||
EnterCategory(CBase.Songs.GetCurrentCategoryIndex());
|
||||
_EnterCategory(CBase.Songs.GetCurrentCategoryIndex());
|
||||
}
|
||||
}
|
||||
|
||||
private void PrevCategory()
|
||||
private void _PrevCategory()
|
||||
{
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() > -1)
|
||||
{
|
||||
CBase.Songs.PrevCategory();
|
||||
EnterCategory(CBase.Songs.GetCurrentCategoryIndex());
|
||||
_EnterCategory(CBase.Songs.GetCurrentCategoryIndex());
|
||||
}
|
||||
}
|
||||
|
||||
private void AfterCategoryChange()
|
||||
private void _AfterCategoryChange()
|
||||
{
|
||||
SetSelectedNow();
|
||||
SelectSong(_PreviewSelected);
|
||||
_SetSelectedNow();
|
||||
_SelectSong(_PreviewSelected);
|
||||
|
||||
foreach (CStatic tile in _Tiles)
|
||||
tile.Selected = false;
|
||||
|
||||
if (_actualSelection >= 0 && _actualSelection < _Tiles.Count)
|
||||
_Tiles[_actualSelection].Selected = true;
|
||||
if (_ActualSelection >= 0 && _ActualSelection < _Tiles.Count)
|
||||
_Tiles[_ActualSelection].Selected = true;
|
||||
|
||||
if ((_LastKnownNumSongs == CBase.Songs.GetNumVisibleSongs()) && (_LastKnownCategory == CBase.Songs.GetCurrentCategoryIndex()))
|
||||
return;
|
||||
|
||||
_LastKnownCategory = CBase.Songs.GetCurrentCategoryIndex();
|
||||
_LastKnownNumSongs = CBase.Songs.GetNumVisibleSongs();
|
||||
UpdateList(0, true);
|
||||
_UpdateList(0, true);
|
||||
CBase.Songs.UpdateRandomSongList();
|
||||
}
|
||||
|
||||
private void UpdateList(bool force = false)
|
||||
private void _UpdateList(bool force = false)
|
||||
{
|
||||
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)), force);
|
||||
_UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)), force);
|
||||
}
|
||||
|
||||
private void UpdateList(int offset, bool force = false)
|
||||
private void _UpdateList(int offset, bool force = false)
|
||||
{
|
||||
bool isInCategory = CBase.Songs.GetCurrentCategoryIndex() >= 0;
|
||||
int itemCount = isInCategory ? CBase.Songs.GetNumVisibleSongs() : CBase.Songs.GetNumCategories();
|
||||
@@ -635,23 +635,23 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_Offset = offset;
|
||||
}
|
||||
|
||||
public override void SetSmallView(bool SmallView)
|
||||
public override void SetSmallView(bool smallView)
|
||||
{
|
||||
base.SetSmallView(SmallView);
|
||||
base.SetSmallView(smallView);
|
||||
|
||||
_SmallView = SmallView;
|
||||
_SmallView = smallView;
|
||||
|
||||
if (_SmallView)
|
||||
{
|
||||
_NumH = _Theme.songMenuTileBoard.numHsmall;
|
||||
_NumW = _Theme.songMenuTileBoard.numWsmall;
|
||||
_Rect = _Theme.songMenuTileBoard.TileRectSmall;
|
||||
_NumH = _Theme.SongMenuTileBoard.NumHsmall;
|
||||
_NumW = _Theme.SongMenuTileBoard.NumWsmall;
|
||||
_Rect = _Theme.SongMenuTileBoard.TileRectSmall;
|
||||
}
|
||||
else
|
||||
{
|
||||
_NumH = _Theme.songMenuTileBoard.numH;
|
||||
_NumW = _Theme.songMenuTileBoard.numW;
|
||||
_Rect = _Theme.songMenuTileBoard.TileRect;
|
||||
_NumH = _Theme.SongMenuTileBoard.NumH;
|
||||
_NumW = _Theme.SongMenuTileBoard.NumW;
|
||||
_Rect = _Theme.SongMenuTileBoard.TileRect;
|
||||
}
|
||||
|
||||
_TileW = (int)((_Rect.W - _SpaceW * (_NumW - 1)) / _NumW);
|
||||
@@ -672,7 +672,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
|
||||
_ScrollRect = new SRectF(0, 0, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), _Rect.Z);
|
||||
UpdateList(true);
|
||||
_UpdateList(true);
|
||||
}
|
||||
|
||||
public override bool IsSmallView()
|
||||
@@ -684,16 +684,16 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
base.LoadTextures();
|
||||
|
||||
_Theme.songMenuTileBoard.StaticCoverBig.ReloadTextures();
|
||||
_Theme.songMenuTileBoard.StaticTextBG.ReloadTextures();
|
||||
_Theme.songMenuTileBoard.StaticDuetIcon.ReloadTextures();
|
||||
_Theme.songMenuTileBoard.StaticVideoIcon.ReloadTextures();
|
||||
_Theme.songMenuTileBoard.StaticMedleyCalcIcon.ReloadTextures();
|
||||
_Theme.songMenuTileBoard.StaticMedleyTagIcon.ReloadTextures();
|
||||
_Theme.SongMenuTileBoard.StaticCoverBig.ReloadTextures();
|
||||
_Theme.SongMenuTileBoard.StaticTextBG.ReloadTextures();
|
||||
_Theme.SongMenuTileBoard.StaticDuetIcon.ReloadTextures();
|
||||
_Theme.SongMenuTileBoard.StaticVideoIcon.ReloadTextures();
|
||||
_Theme.SongMenuTileBoard.StaticMedleyCalcIcon.ReloadTextures();
|
||||
_Theme.SongMenuTileBoard.StaticMedleyTagIcon.ReloadTextures();
|
||||
|
||||
_Theme.songMenuTileBoard.TextArtist.ReloadTextures();
|
||||
_Theme.songMenuTileBoard.TextTitle.ReloadTextures();
|
||||
_Theme.songMenuTileBoard.TextSongLength.ReloadTextures();
|
||||
_Theme.SongMenuTileBoard.TextArtist.ReloadTextures();
|
||||
_Theme.SongMenuTileBoard.TextTitle.ReloadTextures();
|
||||
_Theme.SongMenuTileBoard.TextSongLength.ReloadTextures();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,37 +4,37 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
interface ISongMenu : IMenuElement
|
||||
{
|
||||
void Update(ScreenSongOptions SongOptions);
|
||||
void Update(SScreenSongOptions songOptions);
|
||||
void OnShow();
|
||||
void OnHide();
|
||||
|
||||
void HandleInput(ref KeyEvent KeyEvent, ScreenSongOptions SongOptions);
|
||||
void HandleMouse(ref MouseEvent MouseEvent, ScreenSongOptions SongOptions);
|
||||
void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions);
|
||||
void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions);
|
||||
void Draw();
|
||||
|
||||
void ApplyVolume(float VolumeMax);
|
||||
void ApplyVolume(float volumeMax);
|
||||
|
||||
int GetSelectedSong();
|
||||
CStatic GetSelectedSongCover();
|
||||
void SetSelectedSong(int VisibleSongNr);
|
||||
void SetSelectedSong(int visibleSongNr);
|
||||
|
||||
bool IsActive();
|
||||
void SetActive(bool Active);
|
||||
void SetActive(bool active);
|
||||
|
||||
int GetSelectedCategory();
|
||||
void SetSelectedCategory(int CategoryNr);
|
||||
void SetSelectedCategory(int categoryNr);
|
||||
int GetActualSelection();
|
||||
|
||||
bool EnterCurrentCategory();
|
||||
|
||||
bool IsSelected();
|
||||
void SetSelected(bool Selected);
|
||||
void SetSelected(bool selected);
|
||||
|
||||
bool IsVisible();
|
||||
void SetVisible(bool Visible);
|
||||
void SetVisible(bool visible);
|
||||
|
||||
bool IsSmallView();
|
||||
void SetSmallView(bool SmallView);
|
||||
void SetSmallView(bool smallView);
|
||||
|
||||
SRectF GetRect();
|
||||
}
|
||||
|
||||
+48
-48
@@ -22,12 +22,12 @@ namespace VocaluxeLib.Menu
|
||||
A = a;
|
||||
}
|
||||
|
||||
public SColorF(SColorF Color)
|
||||
public SColorF(SColorF color)
|
||||
{
|
||||
R = Color.R;
|
||||
G = Color.G;
|
||||
B = Color.B;
|
||||
A = Color.A;
|
||||
R = color.R;
|
||||
G = color.G;
|
||||
B = color.B;
|
||||
A = color.A;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public struct SPoint3f
|
||||
public struct SPoint3F
|
||||
{
|
||||
public float X;
|
||||
public float Y;
|
||||
@@ -77,63 +77,63 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public struct STexture
|
||||
{
|
||||
public int index;
|
||||
public int Index;
|
||||
public int PBO;
|
||||
public int ID;
|
||||
|
||||
public string TexturePath;
|
||||
|
||||
public float width;
|
||||
public float height;
|
||||
public SRectF rect;
|
||||
public float Width;
|
||||
public float Height;
|
||||
public SRectF Rect;
|
||||
|
||||
public float w2; //power of 2 width
|
||||
public float h2; //power of 2 height
|
||||
public float width_ratio;
|
||||
public float height_ratio;
|
||||
public float W2; //power of 2 width
|
||||
public float H2; //power of 2 height
|
||||
public float WidthRatio;
|
||||
public float HeightRatio;
|
||||
|
||||
public SColorF color;
|
||||
public SColorF Color;
|
||||
|
||||
public STexture(int Index)
|
||||
public STexture(int index)
|
||||
{
|
||||
index = Index;
|
||||
Index = index;
|
||||
PBO = 0;
|
||||
ID = -1;
|
||||
TexturePath = String.Empty;
|
||||
|
||||
width = 1f;
|
||||
height = 1f;
|
||||
rect = new SRectF(0f, 0f, 1f, 1f, 0f);
|
||||
Width = 1f;
|
||||
Height = 1f;
|
||||
Rect = new SRectF(0f, 0f, 1f, 1f, 0f);
|
||||
|
||||
w2 = 2f;
|
||||
h2 = 2f;
|
||||
width_ratio = 0.5f;
|
||||
height_ratio = 0.5f;
|
||||
W2 = 2f;
|
||||
H2 = 2f;
|
||||
WidthRatio = 0.5f;
|
||||
HeightRatio = 0.5f;
|
||||
|
||||
color = new SColorF(1f, 1f, 1f, 1f);
|
||||
Color = new SColorF(1f, 1f, 1f, 1f);
|
||||
}
|
||||
}
|
||||
#endregion Drawing
|
||||
|
||||
#region Inputs
|
||||
public struct KeyEvent
|
||||
public struct SKeyEvent
|
||||
{
|
||||
public ESender Sender;
|
||||
public bool ModALT;
|
||||
public bool ModSHIFT;
|
||||
public bool ModCTRL;
|
||||
public bool ModAlt;
|
||||
public bool ModShift;
|
||||
public bool ModCtrl;
|
||||
public bool KeyPressed;
|
||||
public bool Handled;
|
||||
public Keys Key;
|
||||
public Char Unicode;
|
||||
public EModifier Mod;
|
||||
|
||||
public KeyEvent(ESender sender, bool alt, bool shift, bool ctrl, bool pressed, char unicode, Keys key)
|
||||
public SKeyEvent(ESender sender, bool alt, bool shift, bool ctrl, bool pressed, char unicode, Keys key)
|
||||
{
|
||||
Sender = sender;
|
||||
ModALT = alt;
|
||||
ModSHIFT = shift;
|
||||
ModCTRL = ctrl;
|
||||
ModAlt = alt;
|
||||
ModShift = shift;
|
||||
ModCtrl = ctrl;
|
||||
KeyPressed = pressed;
|
||||
Unicode = unicode;
|
||||
Key = key;
|
||||
@@ -150,7 +150,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public struct MouseEvent
|
||||
public struct SMouseEvent
|
||||
{
|
||||
public ESender Sender;
|
||||
public bool Handled;
|
||||
@@ -165,14 +165,14 @@ namespace VocaluxeLib.Menu
|
||||
public bool RBH; //right button hold (when moving)
|
||||
public bool MBH; //middle button hold (when moving)
|
||||
|
||||
public bool ModALT;
|
||||
public bool ModSHIFT;
|
||||
public bool ModCTRL;
|
||||
public bool ModAlt;
|
||||
public bool ModShift;
|
||||
public bool ModCtrl;
|
||||
|
||||
public EModifier Mod;
|
||||
public int Wheel;
|
||||
|
||||
public MouseEvent(ESender sender, bool alt, bool shift, bool ctrl, int x, int y, bool lb, bool ld, bool rb, int wheel, bool lbh, bool rbh, bool mb, bool mbh)
|
||||
public SMouseEvent(ESender sender, bool alt, bool shift, bool ctrl, int x, int y, bool lb, bool ld, bool rb, int wheel, bool lbh, bool rbh, bool mb, bool mbh)
|
||||
{
|
||||
Sender = sender;
|
||||
Handled = false;
|
||||
@@ -187,27 +187,27 @@ namespace VocaluxeLib.Menu
|
||||
RBH = rbh;
|
||||
MBH = mbh;
|
||||
|
||||
ModALT = alt;
|
||||
ModSHIFT = shift;
|
||||
ModCTRL = ctrl;
|
||||
ModAlt = alt;
|
||||
ModShift = shift;
|
||||
ModCtrl = ctrl;
|
||||
|
||||
EModifier mALT = EModifier.None;
|
||||
EModifier mSHIFT = EModifier.None;
|
||||
EModifier mCTRL = EModifier.None;
|
||||
EModifier mAlt = EModifier.None;
|
||||
EModifier mShift = EModifier.None;
|
||||
EModifier mCtrl = EModifier.None;
|
||||
|
||||
if (alt)
|
||||
mALT = EModifier.Alt;
|
||||
mAlt = EModifier.Alt;
|
||||
|
||||
if (shift)
|
||||
mSHIFT = EModifier.Shift;
|
||||
mShift = EModifier.Shift;
|
||||
|
||||
if (ctrl)
|
||||
mCTRL = EModifier.Ctrl;
|
||||
mCtrl = EModifier.Ctrl;
|
||||
|
||||
if (!alt && !shift && !ctrl)
|
||||
Mod = EModifier.None;
|
||||
else
|
||||
Mod = mALT | mSHIFT | mCTRL;
|
||||
Mod = mAlt | mShift | mCtrl;
|
||||
|
||||
Wheel = wheel;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user