Removed code redundancies

This commit is contained in:
Flamefire committed 2013-04-23 16:55:57 +02:00
1 parent 5cd47f0537
commit ec766aa7b5
25 files changed
+145 -243

No files matched your search

+1 -1
View File
@@ -503,7 +503,7 @@ namespace VocaluxeLib.Menu
if (diff <= 0)
diff = 1;
float p = 1f-(currentBeat - _Notes[jumpNote].StartBeat) / diff;
float p = 1f - (currentBeat - _Notes[jumpNote].StartBeat) / diff;
if (Math.Abs(p) < float.Epsilon)
_Text.Draw();
+3 -12
View File
@@ -500,10 +500,7 @@ namespace VocaluxeLib.Menu
if (_Selection >= _Interactions.Count || _Selection < 0)
return false;
if (_Interactions.Count > 0)
return _IsMouseOver(x, y, _Interactions[_Selection]);
else
return false;
return _Interactions.Count > 0 && _IsMouseOver(x, y, _Interactions[_Selection]);
}
private bool _IsMouseOver(int x, int y, CInteraction interact)
@@ -789,10 +786,7 @@ namespace VocaluxeLib.Menu
inDirection = true;
break;
}
if (!inDirection)
return float.MaxValue;
else
return distance;
return !inDirection ? float.MaxValue : distance;
}
private float _GetDistance180(SKeyEvent key, SRectF actualRect, SRectF targetRect)
@@ -825,10 +819,7 @@ namespace VocaluxeLib.Menu
inDirection = true;
break;
}
if (!inDirection)
return float.MaxValue;
else
return distance;
return !inDirection ? float.MaxValue : distance;
}
/// <summary>
+6 -7
View File
@@ -873,7 +873,7 @@ namespace VocaluxeLib.Menu
}
return true;
}
else if (mouseEvent.Wheel < 0)
if (mouseEvent.Wheel < 0)
{
if (Offset + mouseEvent.Wheel >= 0)
{
@@ -925,23 +925,23 @@ namespace VocaluxeLib.Menu
ClosePlaylist();
return true;
}
else if (_Theme.ButtonPlaylistSing.Selected)
if (_Theme.ButtonPlaylistSing.Selected)
{
_StartPlaylistSongs();
return true;
}
else if (_Theme.ButtonPlaylistSave.Selected)
if (_Theme.ButtonPlaylistSave.Selected)
{
CBase.Playlist.SavePlaylist(ActivePlaylistID);
return true;
}
else if (_Theme.ButtonPlaylistDelete.Selected)
if (_Theme.ButtonPlaylistDelete.Selected)
{
CBase.Playlist.DeletePlaylist(ActivePlaylistID);
ClosePlaylist();
return true;
}
else if (_Theme.ButtonPlaylistName.Selected)
if (_Theme.ButtonPlaylistName.Selected)
{
EditMode = EEditMode.PlaylistName;
_Theme.ButtonPlaylistName.EditMode = true;
@@ -1159,8 +1159,7 @@ namespace VocaluxeLib.Menu
Update();
return true;
}
else
return false;
return false;
}
public void UpdatePlaylist()
+1 -2
View File
@@ -134,8 +134,7 @@ namespace VocaluxeLib.Menu
{
if (_Selection >= 0 && _ValueIndexes.Count > _Selection)
return _ValueIndexes[_Selection];
else
return -1;
return -1;
}
}
+1 -7
View File
@@ -45,13 +45,7 @@ namespace VocaluxeLib.Menu
private STexture _Texture;
public STexture Texture
{
get
{
if (_Texture.Index != -1)
return _Texture;
else
return CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
}
get { return _Texture.Index != -1 ? _Texture : CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); }
set { _Texture = value; }
}
+2 -1
View File
@@ -143,7 +143,8 @@ namespace VocaluxeLib.Menu
get { return _Bounds; }
set
{
if (Math.Abs(_Bounds.X - value.X) > 0.01 || Math.Abs(_Bounds.Y - value.Y) > 0.01 || Math.Abs(_Bounds.W - value.W) > 0.01 || Math.Abs(_Bounds.H - value.H) > 0.01 || Math.Abs(_Bounds.Z - value.Z) > 0.01)
if (Math.Abs(_Bounds.X - value.X) > 0.01 || Math.Abs(_Bounds.Y - value.Y) > 0.01 || Math.Abs(_Bounds.W - value.W) > 0.01 || Math.Abs(_Bounds.H - value.H) > 0.01 ||
Math.Abs(_Bounds.Z - value.Z) > 0.01)
{
_Bounds = value;
_PositionNeedsUpdate = true;
+2 -14
View File
@@ -379,24 +379,12 @@ namespace VocaluxeLib.Menu.SingNotes
public CNote FirstNote
{
get
{
if (_Notes.Count > 0)
return _Notes[0];
else
return null;
}
get { return _Notes.Count > 0 ? _Notes[0] : null; }
}
public CNote LastNote
{
get
{
if (_Notes.Count > 0)
return _Notes[_Notes.Count - 1];
else
return null;
}
get { return _Notes.Count > 0 ? _Notes[_Notes.Count - 1] : null; }
}
public int BaseLine
+3 -12
View File
@@ -66,13 +66,7 @@ namespace VocaluxeLib.Menu.SongMenu
public STexture CoverTextureBig
{
get
{
if (_CoverBigLoaded)
return _CoverTextureBig;
else
return _CoverTextureSmall;
}
get { return _CoverBigLoaded ? _CoverTextureBig : _CoverTextureSmall; }
set
{
if (value.Index != -1)
@@ -1016,11 +1010,8 @@ namespace VocaluxeLib.Menu.SongMenu
ShortEnd = lines.Line[series[i].Start - 1].LastNote.EndBeat;
return;
}
else
{
ShortEnd = lines.Line[series[i].End].LastNote.EndBeat;
return;
}
ShortEnd = lines.Line[series[i].End].LastNote.EndBeat;
return;
}
}
@@ -367,7 +367,7 @@ namespace VocaluxeLib.Menu.SongMenu
mouseEvent.Handled = true;
return;
}
else if (mouseEvent.RB && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && !songOptions.Selection.PartyMode)
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)
{