some code reorganization

This commit is contained in:
Alexander Eckart committed 2013-02-22 21:27:34 +01:00
1 parent a29f4fb0d6
commit 521033ed97
41 files changed
+836 -842

No files matched your search

+53 -53
View File
@@ -116,9 +116,9 @@ namespace Vocaluxe.Menu
{
_MaxWidth = value;
if (_MaxWidth > 0)
Bounds = new SRectF(-CBase.Base.Settings.GetRenderW(), -CBase.Base.Settings.GetRenderH(), _MaxWidth, 3f * CBase.Base.Settings.GetRenderH(), 0f);
Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), _MaxWidth, 3f * CBase.Settings.GetRenderH(), 0f);
else
Bounds = new SRectF(-CBase.Base.Settings.GetRenderW(), -CBase.Base.Settings.GetRenderH(), 3f * CBase.Base.Settings.GetRenderW(), 3f * CBase.Base.Settings.GetRenderH(), 0f);
Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), 3f * CBase.Settings.GetRenderW(), 3f * CBase.Settings.GetRenderH(), 0f);
_PositionNeedsUpdate = true;
}
@@ -208,7 +208,7 @@ namespace Vocaluxe.Menu
get { return _Theme.Text; }
set
{
string translation = CBase.Base.Language.Translate(value, _TranslationID);
string translation = CBase.Language.Translate(value, _TranslationID);
if (_Theme.Text != value || translation != _Text)
{
_Theme.Text = value;
@@ -223,7 +223,7 @@ namespace Vocaluxe.Menu
get { return _PartyModeID; }
set
{
_Text = CBase.Base.Language.Translate(_Text, value);
_Text = CBase.Language.Translate(_Text, value);
_PositionNeedsUpdate = true;
_PartyModeID = value;
_TranslationID = value;
@@ -235,7 +235,7 @@ namespace Vocaluxe.Menu
get { return _TranslationID; }
set
{
_Text = CBase.Base.Language.Translate(_Text, value);
_Text = CBase.Language.Translate(_Text, value);
_PositionNeedsUpdate = true;
_TranslationID = value;
}
@@ -338,11 +338,11 @@ namespace Vocaluxe.Menu
if (MaxWidth > 0)
{
Bounds = new SRectF(-CBase.Base.Settings.GetRenderW(), -CBase.Base.Settings.GetRenderH(), MaxWidth, 3f * CBase.Base.Settings.GetRenderH(), 0f);
Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), MaxWidth, 3f * CBase.Settings.GetRenderH(), 0f);
}
else
{
Bounds = new SRectF(-CBase.Base.Settings.GetRenderW(), -CBase.Base.Settings.GetRenderH(), 3f * CBase.Base.Settings.GetRenderW(), 3f * CBase.Base.Settings.GetRenderH(), 0f);
Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), 3f * CBase.Settings.GetRenderW(), 3f * CBase.Settings.GetRenderH(), 0f);
}
Reflection = true;
@@ -377,11 +377,11 @@ namespace Vocaluxe.Menu
if (MaxWidth > 0)
{
Bounds = new SRectF(-CBase.Base.Settings.GetRenderW(), -CBase.Base.Settings.GetRenderH(), MaxWidth, 3f * CBase.Base.Settings.GetRenderH(), 0f);
Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), MaxWidth, 3f * CBase.Settings.GetRenderH(), 0f);
}
else
{
Bounds = new SRectF(-CBase.Base.Settings.GetRenderW(), -CBase.Base.Settings.GetRenderH(), 3f * CBase.Base.Settings.GetRenderW(), 3f * CBase.Base.Settings.GetRenderH(), 0f);
Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), 3f * CBase.Settings.GetRenderW(), 3f * CBase.Settings.GetRenderH(), 0f);
}
Reflection = false;
@@ -414,11 +414,11 @@ namespace Vocaluxe.Menu
if (MaxWidth > 0)
{
Bounds = new SRectF(-CBase.Base.Settings.GetRenderW(), -CBase.Base.Settings.GetRenderH(), MaxWidth, 3f * CBase.Base.Settings.GetRenderH(), 0f);
Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), MaxWidth, 3f * CBase.Settings.GetRenderH(), 0f);
}
else
{
Bounds = new SRectF(-CBase.Base.Settings.GetRenderW(), -CBase.Base.Settings.GetRenderH(), 3f * CBase.Base.Settings.GetRenderW(), 3f * CBase.Base.Settings.GetRenderH(), 0f);
Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), 3f * CBase.Settings.GetRenderW(), 3f * CBase.Settings.GetRenderH(), 0f);
}
Reflection = true;
@@ -453,11 +453,11 @@ namespace Vocaluxe.Menu
if (MaxWidth > 0)
{
Bounds = new SRectF(-CBase.Base.Settings.GetRenderW(), -CBase.Base.Settings.GetRenderH(), MaxWidth, 3f * CBase.Base.Settings.GetRenderH(), 0f);
Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), MaxWidth, 3f * CBase.Settings.GetRenderH(), 0f);
}
else
{
Bounds = new SRectF(-CBase.Base.Settings.GetRenderW(), -CBase.Base.Settings.GetRenderH(), 3f * CBase.Base.Settings.GetRenderW(), 3f * CBase.Base.Settings.GetRenderH(), 0f);
Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), 3f * CBase.Settings.GetRenderW(), 3f * CBase.Settings.GetRenderH(), 0f);
}
Reflection = false;
@@ -484,7 +484,7 @@ namespace Vocaluxe.Menu
if (xmlReader.GetValue(item + "/Color", ref _Theme.ColorName, String.Empty))
{
_ThemeLoaded &= CBase.Base.Theme.GetColor(_Theme.ColorName, SkinIndex, ref Color);
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, ref Color);
}
else
{
@@ -496,7 +496,7 @@ namespace Vocaluxe.Menu
if (xmlReader.GetValue(item + "/SColor", ref _Theme.SColorName, String.Empty))
{
_ThemeLoaded &= CBase.Base.Theme.GetColor(_Theme.SColorName, SkinIndex, ref SColor);
_ThemeLoaded &= CBase.Theme.GetColor(_Theme.SColorName, SkinIndex, ref SColor);
}
else
{
@@ -542,9 +542,9 @@ namespace Vocaluxe.Menu
LoadTextures();
if (MaxWidth > 0)
Bounds = new SRectF(-CBase.Base.Settings.GetRenderW(), -CBase.Base.Settings.GetRenderH(), MaxWidth, 3f * CBase.Base.Settings.GetRenderH(), 0f);
Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), MaxWidth, 3f * CBase.Settings.GetRenderH(), 0f);
else
Bounds = new SRectF(-CBase.Base.Settings.GetRenderW(), -CBase.Base.Settings.GetRenderH(), 3f * CBase.Base.Settings.GetRenderW(), 3f * CBase.Base.Settings.GetRenderH(), 0f);
Bounds = new SRectF(-CBase.Settings.GetRenderW(), -CBase.Settings.GetRenderH(), 3f * CBase.Settings.GetRenderW(), 3f * CBase.Settings.GetRenderH(), 0f);
_ButtonText = ButtonText;
}
@@ -615,7 +615,7 @@ namespace Vocaluxe.Menu
writer.WriteElementString("Font", Fon);
writer.WriteComment("<Text>: Nothing or translation tag");
if (CBase.Base.Language.TranslationExists(_Theme.Text))
if (CBase.Language.TranslationExists(_Theme.Text))
writer.WriteElementString("Text", _Theme.Text);
else
writer.WriteElementString("Text", string.Empty);
@@ -654,7 +654,7 @@ namespace Vocaluxe.Menu
public void Draw(bool ForceDraw)
{
if (!ForceDraw && !Visible && CBase.Base.Settings.GetGameState() != EGameState.EditTheme)
if (!ForceDraw && !Visible && CBase.Settings.GetGameState() != EGameState.EditTheme)
return;
// Update Text
@@ -663,8 +663,8 @@ namespace Vocaluxe.Menu
if (_PositionNeedsUpdate)
UpdateTextPosition();
CBase.Base.Fonts.SetFont(Fon);
CBase.Base.Fonts.SetStyle(Style);
CBase.Fonts.SetFont(Fon);
CBase.Fonts.SetStyle(Style);
SColorF CurrentColor = new SColorF(Color);
if (Selected)
@@ -673,9 +673,9 @@ namespace Vocaluxe.Menu
SColorF color = new SColorF(CurrentColor.R, CurrentColor.G, CurrentColor.B, CurrentColor.A * Alpha);
if (!EditMode)
CBase.Base.Fonts.DrawText(_Text, _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color);
CBase.Fonts.DrawText(_Text, _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color);
else
CBase.Base.Fonts.DrawText(_Text + "|", _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color);
CBase.Fonts.DrawText(_Text + "|", _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color);
if (Reflection)
{
@@ -695,15 +695,15 @@ namespace Vocaluxe.Menu
break;
}
if (!EditMode)
CBase.Base.Fonts.DrawTextReflection(_Text, _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color, ReflectionSpace + sFactor, ReflectionHeight);
CBase.Fonts.DrawTextReflection(_Text, _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color, ReflectionSpace + sFactor, ReflectionHeight);
else
CBase.Base.Fonts.DrawTextReflection(_Text + "|", _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color, ReflectionSpace + sFactor, ReflectionHeight);
CBase.Fonts.DrawTextReflection(_Text + "|", _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color, ReflectionSpace + sFactor, ReflectionHeight);
}
if (Selected && (CBase.Base.Settings.GetGameState() == EGameState.EditTheme))
if (Selected && (CBase.Settings.GetGameState() == EGameState.EditTheme))
{
CBase.Base.Drawing.DrawColor(
new SColorF(0.5f, 1f, 0.5f, 0.5f * CBase.Base.Graphics.GetGlobalAlpha()),
CBase.Drawing.DrawColor(
new SColorF(0.5f, 1f, 0.5f, 0.5f * CBase.Graphics.GetGlobalAlpha()),
new SRectF(_DrawPosition.X, _DrawPosition.Y, _DrawPosition.Width, _DrawPosition.Height, Z)
);
}
@@ -711,7 +711,7 @@ namespace Vocaluxe.Menu
public void Draw(float begin, float end)
{
RectangleF bounds = CBase.Base.Fonts.GetTextBounds(this, this.Height);
RectangleF bounds = CBase.Fonts.GetTextBounds(this, this.Height);
float x = X;
switch (Align)
@@ -732,22 +732,22 @@ namespace Vocaluxe.Menu
SColorF color = new SColorF(CurrentColor.R, CurrentColor.G, CurrentColor.B, CurrentColor.A * Alpha);
CBase.Base.Fonts.SetFont(Fon);
CBase.Base.Fonts.SetStyle(Style);
CBase.Fonts.SetFont(Fon);
CBase.Fonts.SetStyle(Style);
if (!EditMode)
CBase.Base.Fonts.DrawText(Text, Height, x, Y, Z, color, begin, end);
CBase.Fonts.DrawText(Text, Height, x, Y, Z, color, begin, end);
else
CBase.Base.Fonts.DrawText(Text + "|", Height, x, Y, Z, color, begin, end);
CBase.Fonts.DrawText(Text + "|", Height, x, Y, Z, color, begin, end);
if (Reflection)
{
// TODO
}
if (Selected && (CBase.Base.Settings.GetGameState() == EGameState.EditTheme))
if (Selected && (CBase.Settings.GetGameState() == EGameState.EditTheme))
{
CBase.Base.Drawing.DrawColor(new SColorF(0.5f, 1f, 0.5f, 0.5f), new SRectF(x, Y, bounds.Width, bounds.Height, Z));
CBase.Drawing.DrawColor(new SColorF(0.5f, 1f, 0.5f, 0.5f), new SRectF(x, Y, bounds.Width, bounds.Height, Z));
}
}
@@ -771,10 +771,10 @@ namespace Vocaluxe.Menu
float x = X + rx;
float y = Y + ry;
CBase.Base.Fonts.SetFont(Fon);
CBase.Base.Fonts.SetStyle(Style);
CBase.Fonts.SetFont(Fon);
CBase.Fonts.SetStyle(Style);
RectangleF bounds = CBase.Base.Fonts.GetTextBounds(this, this.Height);
RectangleF bounds = CBase.Fonts.GetTextBounds(this, this.Height);
if (bounds.Width > Bounds.W && Bounds.W > 0f && bounds.Width > 0f)
{
@@ -796,7 +796,7 @@ namespace Vocaluxe.Menu
break;
}
bounds = CBase.Base.Fonts.GetTextBounds(this, h);
bounds = CBase.Fonts.GetTextBounds(this, h);
}
switch (Align)
@@ -818,13 +818,13 @@ namespace Vocaluxe.Menu
SColorF color = new SColorF(CurrentColor.R, CurrentColor.G, CurrentColor.B, CurrentColor.A * Alpha);
CBase.Base.Fonts.SetFont(Fon);
CBase.Base.Fonts.SetStyle(Style);
CBase.Fonts.SetFont(Fon);
CBase.Fonts.SetStyle(Style);
if (!EditMode)
CBase.Base.Fonts.DrawText(_Text, h, x, y, Z, color);
CBase.Fonts.DrawText(_Text, h, x, y, Z, color);
else
CBase.Base.Fonts.DrawText(_Text + "|", h, x, y, Z, color);
CBase.Fonts.DrawText(_Text + "|", h, x, y, Z, color);
if (reflection)
{
@@ -832,14 +832,14 @@ namespace Vocaluxe.Menu
float height = reflectionHeight - (rectHeight - Y) + bounds.Height;
if (!EditMode)
CBase.Base.Fonts.DrawTextReflection(_Text, h, x, y, Z, color, space, height);
CBase.Fonts.DrawTextReflection(_Text, h, x, y, Z, color, space, height);
else
CBase.Base.Fonts.DrawTextReflection(_Text + "|", h, x, y, Z, color, space, height);
CBase.Fonts.DrawTextReflection(_Text + "|", h, x, y, Z, color, space, height);
}
if (Selected && (CBase.Base.Settings.GetGameState() == EGameState.EditTheme))
if (Selected && (CBase.Settings.GetGameState() == EGameState.EditTheme))
{
CBase.Base.Drawing.DrawColor(new SColorF(0.5f, 1f, 0.5f, 0.5f * CBase.Base.Graphics.GetGlobalAlpha()), new SRectF(x, y, bounds.Width, bounds.Height, Z));
CBase.Drawing.DrawColor(new SColorF(0.5f, 1f, 0.5f, 0.5f * CBase.Graphics.GetGlobalAlpha()), new SRectF(x, y, bounds.Width, bounds.Height, Z));
}
}
@@ -850,10 +850,10 @@ namespace Vocaluxe.Menu
public void LoadTextures()
{
if (_Theme.ColorName != String.Empty)
Color = CBase.Base.Theme.GetColor(_Theme.ColorName, _PartyModeID);
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
if (_Theme.SColorName != String.Empty)
SColor = CBase.Base.Theme.GetColor(_Theme.SColorName, _PartyModeID);
SColor = CBase.Theme.GetColor(_Theme.SColorName, _PartyModeID);
}
public void ReloadTextures()
@@ -882,12 +882,12 @@ namespace Vocaluxe.Menu
if (_Text == String.Empty)
return;
CBase.Base.Fonts.SetFont(Fon);
CBase.Base.Fonts.SetStyle(Style);
CBase.Fonts.SetFont(Fon);
CBase.Fonts.SetStyle(Style);
float h = Height;
float y = Y;
RectangleF bounds = CBase.Base.Fonts.GetTextBounds(this, this.Height);
RectangleF bounds = CBase.Fonts.GetTextBounds(this, this.Height);
if (bounds.Width > Bounds.W && Bounds.W > 0f && bounds.Width > 0f)
{
@@ -909,7 +909,7 @@ namespace Vocaluxe.Menu
break;
}
bounds = CBase.Base.Fonts.GetTextBounds(this, h);
bounds = CBase.Fonts.GetTextBounds(this, h);
}
float x = X;