Implement a common Interface for all MenuElements

Also remove CSongMenu and replace it with a factory class
This commit is contained in:
Flamefire committed 2014-10-19 17:17:39 +02:00
1 parent 9479f3b3ff
commit ae7a7fd390
52 files changed
+1043 -1855

No files matched your search

+15 -20
View File
@@ -45,13 +45,12 @@ namespace VocaluxeLib.Menu
public SReflection Reflection;
}
public class CEqualizer : IMenuElement
public class CEqualizer : CMenuElementBase, IMenuElement, IThemeable
{
private readonly int _PartyModeID;
private SThemeEqualizer _Theme;
private bool _ThemeLoaded;
public SRectF Rect;
public SColorF Color;
public SColorF MaxColor;
public float Space;
@@ -60,9 +59,6 @@ namespace VocaluxeLib.Menu
public float ReflectionSpace;
public float ReflectionHeight;
public bool Selected;
public bool Visible;
public string GetThemeName()
{
return _Theme.Name;
@@ -77,19 +73,20 @@ namespace VocaluxeLib.Menu
private int _MaxBar;
private float _MaxVolume;
public bool Selectable
{
get { return false; }
}
public CEqualizer(int partyModeID)
{
_PartyModeID = partyModeID;
_Theme = new SThemeEqualizer();
_ThemeLoaded = false;
Rect = new SRectF();
Color = new SColorF();
MaxColor = new SColorF();
Selected = false;
Visible = true;
Reflection = false;
ReflectionSpace = 0f;
ReflectionHeight = 0f;
@@ -100,8 +97,6 @@ namespace VocaluxeLib.Menu
_PartyModeID = partyModeID;
_Theme = theme;
Visible = true;
LoadSkin();
}
@@ -247,7 +242,7 @@ namespace VocaluxeLib.Menu
_Theme.Color.Get(_PartyModeID, out Color);
_Theme.MaxColor.Get(_PartyModeID, out MaxColor);
Rect = _Theme.Rect;
MaxRect = _Theme.Rect;
Space = _Theme.Space;
Reflection = _Theme.Reflection.Enabled;
if (Reflection)
@@ -275,8 +270,8 @@ namespace VocaluxeLib.Menu
#region ThemeEdit
public void MoveElement(int stepX, int stepY)
{
Rect.X += stepX;
Rect.Y += stepY;
X += stepX;
Y += stepY;
_Theme.Rect.X += stepX;
_Theme.Rect.Y += stepY;
@@ -284,15 +279,15 @@ namespace VocaluxeLib.Menu
public void ResizeElement(int stepW, int stepH)
{
Rect.W += stepW;
if (Rect.W <= 0)
Rect.W = 1;
W += stepW;
if (W <= 0)
W = 1;
_Theme.Rect.W = Rect.W;
Rect.H += stepH;
if (Rect.H <= 0)
Rect.H = 1;
H += stepH;
if (H <= 0)
H = 1;
_Theme.Rect.H = Rect.H;
}