Auto cleanup of VocaluxeLib

This commit is contained in:
Flamefire committed 2013-03-22 21:12:45 +01:00
1 parent b497b58740
commit efab579188
37 files changed
+642 -1155

No files matched your search

+20 -33
View File
@@ -25,11 +25,11 @@ namespace VocaluxeLib.Menu
public class CLyric : IMenuElement
{
private int _PartyModeID;
private readonly int _PartyModeID;
private SThemeLyrics _Theme;
private bool _ThemeLoaded;
private List<SNote> _Notes;
private readonly List<SNote> _Notes;
private CText _Text;
private float _X;
@@ -115,9 +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);
}
else
{
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/R", ref Color.R);
@@ -127,9 +125,7 @@ namespace VocaluxeLib.Menu
}
if (xmlReader.GetValue(item + "/SColor", ref _Theme.SColorName, String.Empty))
{
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SColorName, SkinIndex, out ColorProcessed);
}
else
{
_ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SR", ref ColorProcessed.R);
@@ -163,9 +159,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<Color>: Lyric text color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName.Length > 0)
{
writer.WriteElementString("Color", _Theme.ColorName);
}
else
{
writer.WriteElementString("R", Color.R.ToString("#0.00"));
@@ -177,9 +171,7 @@ namespace VocaluxeLib.Menu
writer.WriteComment("<SColor>: Highlighted lyric color from ColorScheme (high priority)");
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
if (_Theme.SColorName.Length > 0)
{
writer.WriteElementString("SColor", _Theme.SColorName);
}
else
{
writer.WriteElementString("SR", ColorProcessed.R.ToString("#0.00"));
@@ -215,7 +207,7 @@ namespace VocaluxeLib.Menu
if (n.Type == ENoteType.Freestyle)
_Text.Style = EStyle.BoldItalic;
RectangleF rect = CBase.Drawing.GetTextBounds(_Text);
_width += rect.Width;
_Notes.Add(n);
@@ -229,7 +221,7 @@ namespace VocaluxeLib.Menu
public float GetCurrentLyricPosX()
{
return _X - _width / 2;
return _X - _width / 2;
}
#region draw
@@ -254,14 +246,14 @@ namespace VocaluxeLib.Menu
default:
DrawSlide(ActualBeat);
break;
}
}
}
}
private void DrawSlide(float CurrentBeat)
{
float x = _X - _width / 2;
foreach (SNote note in _Notes)
{
_Text.X = x;
@@ -277,7 +269,7 @@ namespace VocaluxeLib.Menu
if (CurrentBeat <= note.EndBeat)
{
_Text.Color = ColorProcessed;
float diff = note.EndBeat - note.StartBeat;
if (diff == 0)
@@ -291,17 +283,16 @@ namespace VocaluxeLib.Menu
}
else
{
_Text.Color = ColorProcessed;
_Text.Color = ColorProcessed;
_Text.Draw();
}
}
else
{
_Text.Color = Color;
_Text.Color = Color;
_Text.Draw();
}
x += rect.Width;
}
}
@@ -334,9 +325,9 @@ namespace VocaluxeLib.Menu
if (CurrentBeat >= _Notes[note].StartBeat)
{
bool last = note == _Notes.Count -1;
bool last = note == _Notes.Count - 1;
int endbeat = _Notes[note].EndBeat;
if (note < _Notes.Count -1)
if (note < _Notes.Count - 1)
endbeat = _Notes[note + 1].StartBeat - 1;
if (CurrentBeat <= endbeat)
@@ -355,7 +346,6 @@ namespace VocaluxeLib.Menu
_Text.Draw();
}
}
else
{
@@ -363,7 +353,7 @@ namespace VocaluxeLib.Menu
_Text.Color = Color;
_Text.Draw();
}
x += rect.Width;
}
@@ -428,16 +418,16 @@ namespace VocaluxeLib.Menu
if (CurrentBeat >= note.StartBeat)
{
_Text.Color = ColorProcessed;
_Text.Color = ColorProcessed;
_Text.Draw();
}
else
{
// not passed
_Text.Color = Color;
_Text.Color = Color;
_Text.Draw();
}
x += rect.Width;
}
}
@@ -491,15 +481,14 @@ namespace VocaluxeLib.Menu
_Text.Draw();
}
}
else
{
// not passed
_Text.Color = Color;
_Text.Color = Color;
_Text.Draw();
}
x += rect.Width;
}
@@ -539,9 +528,7 @@ namespace VocaluxeLib.Menu
}
#endregion draw
public void UnloadTextures()
{
}
public void UnloadTextures() {}
public void LoadTextures()
{
@@ -582,4 +569,4 @@ namespace VocaluxeLib.Menu
}
#endregion ThemeEdit
}
}
}