changed name selection behavior
This commit is contained in:
1 parent
cae4e441e1
commit
71f24fb38a
5 files changed
+211
-105
No files matched your search
@@ -66,6 +66,7 @@ namespace Vocaluxe.Menu
|
||||
}
|
||||
}
|
||||
public bool Visible;
|
||||
public bool Enabled;
|
||||
|
||||
public string GetThemeName()
|
||||
{
|
||||
@@ -89,6 +90,7 @@ namespace Vocaluxe.Menu
|
||||
Selected = false;
|
||||
Visible = true;
|
||||
EditMode = false;
|
||||
Enabled = true;
|
||||
|
||||
Reflection = false;
|
||||
ReflectionSpace = 0f;
|
||||
@@ -122,6 +124,7 @@ namespace Vocaluxe.Menu
|
||||
Visible = true;
|
||||
EditMode = false;
|
||||
_ThemeLoaded = false;
|
||||
Enabled = button.Enabled;
|
||||
|
||||
Reflection = button.Reflection;
|
||||
ReflectionHeight = button.ReflectionHeight;
|
||||
@@ -304,7 +307,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
STexture texture = new STexture(-1);
|
||||
|
||||
if (!Selected && !Pressed)
|
||||
if (!Selected && !Pressed || !Enabled)
|
||||
{
|
||||
if (Texture.index != -1)
|
||||
texture = Texture;
|
||||
|
||||
@@ -1370,6 +1370,12 @@ namespace Vocaluxe.Menu
|
||||
#endregion Elements
|
||||
|
||||
#region InteractionHandling
|
||||
public void CheckInteraction()
|
||||
{
|
||||
if (!_IsEnabled(_Selection) || !_IsVisible(_Selection))
|
||||
PrevInteraction();
|
||||
}
|
||||
|
||||
public void NextInteraction()
|
||||
{
|
||||
if (_Interactions.Count > 0)
|
||||
@@ -1460,7 +1466,7 @@ namespace Vocaluxe.Menu
|
||||
float z = _Base.Settings.GetZFar();
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
if ((_Base.Settings.GetGameState() == EGameState.EditTheme) || (!_Interactions[i].ThemeEditorOnly && _IsVisible(i)))
|
||||
if ((_Base.Settings.GetGameState() == EGameState.EditTheme) || (!_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i)))
|
||||
{
|
||||
if (_IsMouseOver(x, y, _Interactions[i]))
|
||||
{
|
||||
@@ -1613,7 +1619,7 @@ namespace Vocaluxe.Menu
|
||||
if (start > _Interactions.Count - 1)
|
||||
start = 0;
|
||||
|
||||
if ((start == _Selection) || (!_Interactions[start].ThemeEditorOnly && _IsVisible(start)))
|
||||
if ((start == _Selection) || (!_Interactions[start].ThemeEditorOnly && _IsVisible(start) && _IsEnabled(start)))
|
||||
found = true;
|
||||
} while (!found);
|
||||
_Selection = start;
|
||||
@@ -1640,7 +1646,7 @@ namespace Vocaluxe.Menu
|
||||
if (start < 0)
|
||||
start = _Interactions.Count - 1;
|
||||
|
||||
if ((start == _Selection) || (!_Interactions[start].ThemeEditorOnly && _IsVisible(start)))
|
||||
if ((start == _Selection) || (!_Interactions[start].ThemeEditorOnly && _IsVisible(start) && _IsEnabled(start)))
|
||||
found = true;
|
||||
} while (!found);
|
||||
_Selection = start;
|
||||
@@ -1741,7 +1747,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i))
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistanceDirect(Key, actualRect, targetRect);
|
||||
@@ -1758,7 +1764,7 @@ namespace Vocaluxe.Menu
|
||||
{
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i))
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistance180(Key, actualRect, targetRect);
|
||||
@@ -1794,7 +1800,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i))
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistance180(Key, actualRect, targetRect);
|
||||
@@ -2074,6 +2080,9 @@ namespace Vocaluxe.Menu
|
||||
|
||||
private bool _IsVisible(int interaction)
|
||||
{
|
||||
if (_Selection >= _Interactions.Count || _Selection < 0)
|
||||
return false;
|
||||
|
||||
switch (_Interactions[interaction].Type)
|
||||
{
|
||||
case EType.TButton:
|
||||
@@ -2107,6 +2116,44 @@ namespace Vocaluxe.Menu
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool _IsEnabled(int interaction)
|
||||
{
|
||||
if (_Selection >= _Interactions.Count || _Selection < 0)
|
||||
return false;
|
||||
|
||||
switch (_Interactions[interaction].Type)
|
||||
{
|
||||
case EType.TButton:
|
||||
return _Buttons[_Interactions[interaction].Num].Enabled;
|
||||
|
||||
case EType.TSelectSlide:
|
||||
return _SelectSlides[_Interactions[interaction].Num].Visible;
|
||||
|
||||
case EType.TStatic:
|
||||
return false; //_Statics[_Interactions[interaction].Num].Visible;
|
||||
|
||||
case EType.TText:
|
||||
return false; //_Texts[_Interactions[interaction].Num].Visible;
|
||||
|
||||
case EType.TSongMenu:
|
||||
return _SongMenus[_Interactions[interaction].Num].Visible;
|
||||
|
||||
case EType.TLyric:
|
||||
return false; //_Lyrics[_Interactions[interaction].Num].Visible;
|
||||
|
||||
case EType.TNameSelection:
|
||||
return _NameSelections[_Interactions[interaction].Num].Visible;
|
||||
|
||||
case EType.TEqualizer:
|
||||
return false; //_Equalizers[_Interactions[interaction].Num].Visible;
|
||||
|
||||
case EType.TPlaylist:
|
||||
return _Playlists[_Interactions[interaction].Num].Visible;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private SRectF _GetRect(int interaction)
|
||||
{
|
||||
SRectF Result = new SRectF();
|
||||
|
||||
@@ -481,7 +481,7 @@ namespace Vocaluxe.Menu
|
||||
float z = _Base.Settings.GetZFar();
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
if ((_Base.Settings.GetGameState() == EGameState.EditTheme) || (!_Interactions[i].ThemeEditorOnly && _IsVisible(i)))
|
||||
if ((_Base.Settings.GetGameState() == EGameState.EditTheme) || (!_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i)))
|
||||
{
|
||||
if (_IsMouseOver(x, y, _Interactions[i]))
|
||||
{
|
||||
@@ -577,7 +577,7 @@ namespace Vocaluxe.Menu
|
||||
if (start > _Interactions.Count - 1)
|
||||
start = 0;
|
||||
|
||||
if ((start == _Selection) || (!_Interactions[start].ThemeEditorOnly && _IsVisible(start)))
|
||||
if ((start == _Selection) || (!_Interactions[start].ThemeEditorOnly && _IsVisible(start) && _IsEnabled(start)))
|
||||
found = true;
|
||||
} while (!found);
|
||||
_Selection = start;
|
||||
@@ -604,7 +604,7 @@ namespace Vocaluxe.Menu
|
||||
if (start < 0)
|
||||
start = _Interactions.Count - 1;
|
||||
|
||||
if ((start == _Selection) || (!_Interactions[start].ThemeEditorOnly && _IsVisible(start)))
|
||||
if ((start == _Selection) || (!_Interactions[start].ThemeEditorOnly && _IsVisible(start) && _IsEnabled(start)))
|
||||
found = true;
|
||||
} while (!found);
|
||||
_Selection = start;
|
||||
@@ -705,7 +705,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i))
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistanceDirect(Key, actualRect, targetRect);
|
||||
@@ -722,7 +722,7 @@ namespace Vocaluxe.Menu
|
||||
{
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i))
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistance180(Key, actualRect, targetRect);
|
||||
@@ -758,7 +758,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i))
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistance180(Key, actualRect, targetRect);
|
||||
@@ -1014,6 +1014,26 @@ namespace Vocaluxe.Menu
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool _IsEnabled(int interaction)
|
||||
{
|
||||
switch (_Interactions[interaction].Type)
|
||||
{
|
||||
case EType.TButton:
|
||||
return _Buttons[_Interactions[interaction].Num].Enabled;
|
||||
|
||||
case EType.TSelectSlide:
|
||||
return _SelectSlides[_Interactions[interaction].Num].Visible;
|
||||
|
||||
case EType.TStatic:
|
||||
return false; //_Statics[_Interactions[interaction].Num].Visible;
|
||||
|
||||
case EType.TText:
|
||||
return false; //_Texts[_Interactions[interaction].Num].Visible;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private SRectF _GetRect(int interaction)
|
||||
{
|
||||
SRectF Result = new SRectF();
|
||||
|
||||
Reference in new issue
Block a user