object interactions converted

This commit is contained in:
Alexander Eckart committed 2012-12-13 22:44:02 +01:00
1 parent cff2865e23
commit 145be624c6
2 files changed
+14 -14

No files matched your search

+13 -13
View File
@@ -8,8 +8,6 @@ using System.Windows.Forms;
using System.Xml;
using System.Xml.XPath;
using Vocaluxe.Base;
using Vocaluxe.Lib.Draw;
using Vocaluxe.Menu;
using Vocaluxe.Menu.SingNotes;
using Vocaluxe.Menu.SongMenu;
@@ -18,6 +16,7 @@ namespace Vocaluxe.Menu
{
class CObjectInteractions
{
private Base _Base;
private List<CInteraction> _Interactions;
private int _Selection = 0;
@@ -41,8 +40,9 @@ namespace Vocaluxe.Menu
get { return _ScreenArea; }
}
public CObjectInteractions()
public CObjectInteractions(Base Base)
{
_Base = Base;
Init();
}
@@ -63,7 +63,7 @@ namespace Vocaluxe.Menu
_MouseDY = 0;
Active = false;
_ScreenArea = new SRectF(0f, 0f, CSettings.iRenderW, CSettings.iRenderH, 0f);
_ScreenArea = new SRectF(0f, 0f, _Base.Settings.GetRenderW(), _Base.Settings.GetRenderH(), 0f);
}
public void Clear()
@@ -119,7 +119,7 @@ namespace Vocaluxe.Menu
#region MenuHandler
public bool HandleInput(KeyEvent KeyEvent)
{
if (!CSettings.TabNavigation)
if (!_Base.Settings.IsTabNavigation())
{
if (KeyEvent.Key == Keys.Left)
{
@@ -478,10 +478,10 @@ namespace Vocaluxe.Menu
public void SelectByMouse(int x, int y)
{
float z = CSettings.zFar;
float z = _Base.Settings.GetZFar();
for (int i = 0; i < _Interactions.Count; i++)
{
if ((CSettings.GameState == EGameState.EditTheme) || (!_Interactions[i].ThemeEditorOnly && _IsVisible(i)))
if ((_Base.Settings.GetGameState() == EGameState.EditTheme) || (!_Interactions[i].ThemeEditorOnly && _IsVisible(i)))
{
if (_IsMouseOver(x, y, _Interactions[i]))
{
@@ -544,7 +544,7 @@ namespace Vocaluxe.Menu
case EType.TSelectSlide:
return _SelectSlides[interact.Num].Rect.Z;
}
return CSettings.zFar;
return _Base.Settings.GetZFar();
}
private float _GetZValue(int interaction)
@@ -561,13 +561,13 @@ namespace Vocaluxe.Menu
return _SelectSlides[_Interactions[interaction].Num].Rect.Z;
}
return CSettings.zFar;
return _Base.Settings.GetZFar();
}
private void _NextInteraction()
{
_UnsetSelected();
if (CSettings.GameState != EGameState.EditTheme)
if (_Base.Settings.GetGameState() != EGameState.EditTheme)
{
bool found = false;
int start = _Selection;
@@ -594,7 +594,7 @@ namespace Vocaluxe.Menu
private void _PrevInteraction()
{
_UnsetSelected();
if (CSettings.GameState != EGameState.EditTheme)
if (_Base.Settings.GetGameState() != EGameState.EditTheme)
{
bool found = false;
int start = _Selection;
@@ -741,13 +741,13 @@ namespace Vocaluxe.Menu
switch (Key.Key)
{
case Keys.Up:
actualRect = new SRectF(actualRect.X, CSettings.iRenderH, 1, 1, actualRect.Z);
actualRect = new SRectF(actualRect.X, _Base.Settings.GetRenderH(), 1, 1, actualRect.Z);
break;
case Keys.Down:
actualRect = new SRectF(actualRect.X, 0, 1, 1, actualRect.Z);
break;
case Keys.Left:
actualRect = new SRectF(CSettings.iRenderW, actualRect.Y, 1, 1, actualRect.Z);
actualRect = new SRectF(_Base.Settings.GetRenderW(), actualRect.Y, 1, 1, actualRect.Z);
break;
case Keys.Right:
actualRect = new SRectF(0, actualRect.Y, 1, 1, actualRect.Z);
+1 -1
View File
@@ -194,7 +194,7 @@ namespace Vocaluxe.Menu
PlaylistElements = new List<PlaylistElement>();
PlaylistElementContents = new List<PlaylistElementContent>();
_Interactions = new CObjectInteractions();
_Interactions = new CObjectInteractions(_Base);
ChangeOrderElement = new PlaylistElement(_Base);
Visible = false;