Move non-drawing stuff out of Draw methods
This commit is contained in:
1 parent
432ff4f4f3
commit
4c7013836b
7 files changed
+21
-39
No files matched your search
@@ -306,17 +306,19 @@ namespace VocaluxeLib.Menu
|
||||
#region Drawing
|
||||
public virtual void Draw()
|
||||
{
|
||||
if (!_Active)
|
||||
return;
|
||||
_DrawBG();
|
||||
_DrawFG();
|
||||
}
|
||||
|
||||
protected void _DrawBG()
|
||||
private void _DrawBG()
|
||||
{
|
||||
foreach (CBackground bg in _Backgrounds)
|
||||
bg.Draw();
|
||||
}
|
||||
|
||||
protected void _DrawFG()
|
||||
private void _DrawFG()
|
||||
{
|
||||
if (_Interactions.Count <= 0)
|
||||
return;
|
||||
|
||||
@@ -331,14 +331,10 @@ namespace VocaluxeLib.Menu
|
||||
return _ThemeLoaded;
|
||||
}
|
||||
|
||||
public override void Draw()
|
||||
public void UpdateGame()
|
||||
{
|
||||
if (_PlaylistElements.Count <= 0)
|
||||
LoadPlaylist(0);
|
||||
if (!Visible && CBase.Settings.GetProgramState() != EProgramState.EditTheme)
|
||||
return;
|
||||
|
||||
base.Draw();
|
||||
for (int i = 0; i < _PlaylistElements.Count; i++)
|
||||
{
|
||||
if (i == _CurrentPlaylistElement && _Selected)
|
||||
@@ -352,6 +348,11 @@ namespace VocaluxeLib.Menu
|
||||
_PlaylistElements[i].Background.Color = _BackgroundColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Draw()
|
||||
{
|
||||
base.Draw();
|
||||
|
||||
if (_ChangeOrderElement != null)
|
||||
_ChangeOrderElement.Draw();
|
||||
|
||||
Reference in new issue
Block a user