Renaming for namesheme
This commit is contained in:
1 parent
1336a6fa36
commit
67da90427b
131 files changed
+11905
-11812
No files matched your search
+142
-142
@@ -10,10 +10,10 @@ using VocaluxeLib.Menu.SongMenu;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
struct ZSort
|
||||
struct SZSort
|
||||
{
|
||||
public int ID;
|
||||
public float z;
|
||||
public float Z;
|
||||
}
|
||||
|
||||
public abstract class CMenu : IMenu
|
||||
@@ -124,60 +124,60 @@ namespace VocaluxeLib.Menu
|
||||
_ThemeScreenSettings = null;
|
||||
}
|
||||
|
||||
protected void FadeTo(EScreens NextScreen)
|
||||
protected void _FadeTo(EScreens nextScreen)
|
||||
{
|
||||
CBase.Graphics.FadeTo(NextScreen);
|
||||
CBase.Graphics.FadeTo(nextScreen);
|
||||
}
|
||||
|
||||
#region ThemeHandler
|
||||
protected delegate void AddElementHandler<T>(T Element, String key);
|
||||
protected delegate void AddElementHandler<T>(T element, String key);
|
||||
|
||||
private void LoadThemeElement<T>(string[] Elements, AddElementHandler<T> AddElementHandler, CXMLReader xmlReader, int SkinIndex) where T : IMenuElement
|
||||
private void _LoadThemeElement<T>(string[] elements, AddElementHandler<T> addElementHandler, CXMLReader xmlReader, int skinIndex) where T : IMenuElement
|
||||
{
|
||||
if (Elements != null)
|
||||
if (elements != null)
|
||||
{
|
||||
foreach (string elName in Elements)
|
||||
foreach (string elName in elements)
|
||||
{
|
||||
T Element = (T)Activator.CreateInstance(typeof(T), _PartyModeID);
|
||||
if (Element.LoadTheme("//root/" + ThemeName, elName, xmlReader, SkinIndex))
|
||||
AddElementHandler(Element, elName);
|
||||
T element = (T)Activator.CreateInstance(typeof(T), _PartyModeID);
|
||||
if (element.LoadTheme("//root/" + ThemeName, elName, xmlReader, skinIndex))
|
||||
addElementHandler(element, elName);
|
||||
else
|
||||
CBase.Log.LogError("Can't load " + typeof(T).Name.Substring(1) + " \"" + elName + "\" in screen " + ThemeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void LoadTheme(string XmlPath)
|
||||
public virtual void LoadTheme(string xmlPath)
|
||||
{
|
||||
string file = Path.Combine(XmlPath, ThemeName + ".xml");
|
||||
string file = Path.Combine(xmlPath, ThemeName + ".xml");
|
||||
|
||||
CXMLReader xmlReader = CXMLReader.OpenFile(file);
|
||||
if (xmlReader == null)
|
||||
return;
|
||||
|
||||
bool VersionCheck = false;
|
||||
VersionCheck = CheckVersion(_ScreenVersion, xmlReader);
|
||||
bool versionCheck = false;
|
||||
versionCheck = _CheckVersion(_ScreenVersion, xmlReader);
|
||||
|
||||
int SkinIndex = CBase.Theme.GetSkinIndex(_PartyModeID);
|
||||
int skinIndex = CBase.Theme.GetSkinIndex(_PartyModeID);
|
||||
|
||||
if (VersionCheck && SkinIndex != -1)
|
||||
if (versionCheck && skinIndex != -1)
|
||||
{
|
||||
_ThemePath = XmlPath;
|
||||
LoadThemeBasics(xmlReader, SkinIndex);
|
||||
_ThemePath = xmlPath;
|
||||
_LoadThemeBasics(xmlReader, skinIndex);
|
||||
|
||||
LoadThemeElement<CBackground>(_ThemeBackgrounds, AddBackground, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CStatic>(_ThemeStatics, AddStatic, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CText>(_ThemeTexts, AddText, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CButton>(_ThemeButtons, AddButton, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CSelectSlide>(_ThemeSelectSlides, AddSelectSlide, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CSongMenu>(_ThemeSongMenus, AddSongMenu, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CLyric>(_ThemeLyrics, AddLyric, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CSingNotesClassic>(_ThemeSingNotes, AddSingNote, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CNameSelection>(_ThemeNameSelections, AddNameSelection, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CEqualizer>(_ThemeEqualizers, AddEqualizer, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CPlaylist>(_ThemePlaylists, AddPlaylist, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CParticleEffect>(_ThemeParticleEffects, AddParticleEffect, xmlReader, SkinIndex);
|
||||
LoadThemeElement<CScreenSetting>(_ThemeScreenSettings, AddScreenSetting, xmlReader, SkinIndex);
|
||||
_LoadThemeElement<CBackground>(_ThemeBackgrounds, AddBackground, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CStatic>(_ThemeStatics, AddStatic, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CText>(_ThemeTexts, AddText, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CButton>(_ThemeButtons, AddButton, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CSelectSlide>(_ThemeSelectSlides, AddSelectSlide, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CSongMenu>(_ThemeSongMenus, AddSongMenu, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CLyric>(_ThemeLyrics, AddLyric, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CSingNotesClassic>(_ThemeSingNotes, AddSingNote, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CNameSelection>(_ThemeNameSelections, AddNameSelection, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CEqualizer>(_ThemeEqualizers, AddEqualizer, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CPlaylist>(_ThemePlaylists, AddPlaylist, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CParticleEffect>(_ThemeParticleEffects, AddParticleEffect, xmlReader, skinIndex);
|
||||
_LoadThemeElement<CScreenSetting>(_ThemeScreenSettings, AddScreenSetting, xmlReader, skinIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,14 +347,14 @@ namespace VocaluxeLib.Menu
|
||||
se.UnloadTextures();
|
||||
}
|
||||
|
||||
public virtual void ReloadTheme(string XmlPath)
|
||||
public virtual void ReloadTheme(string xmlPath)
|
||||
{
|
||||
if (_ThemePath.Length == 0)
|
||||
return;
|
||||
|
||||
UnloadTextures();
|
||||
Init();
|
||||
LoadTheme(XmlPath);
|
||||
LoadTheme(xmlPath);
|
||||
}
|
||||
#endregion ThemeHandler
|
||||
|
||||
@@ -468,9 +468,9 @@ namespace VocaluxeLib.Menu
|
||||
return new CStatic(oldStatic);
|
||||
}
|
||||
|
||||
public CStatic GetNewStatic(STexture Texture, SColorF Color, SRectF Rect)
|
||||
public CStatic GetNewStatic(STexture texture, SColorF color, SRectF rect)
|
||||
{
|
||||
return new CStatic(_PartyModeID, Texture, Color, Rect);
|
||||
return new CStatic(_PartyModeID, texture, color, rect);
|
||||
}
|
||||
|
||||
public CSelectSlide GetNewSelectSlide()
|
||||
@@ -513,9 +513,9 @@ namespace VocaluxeLib.Menu
|
||||
return new CPlaylist(_PartyModeID);
|
||||
}
|
||||
|
||||
public CParticleEffect GetNewParticleEffect(int MaxNumber, SColorF Color, SRectF Area, STexture Texture, float Size, EParticleType Type)
|
||||
public CParticleEffect GetNewParticleEffect(int maxNumber, SColorF color, SRectF area, STexture texture, float size, EParticleType type)
|
||||
{
|
||||
return new CParticleEffect(_PartyModeID, MaxNumber, Color, Area, Texture, Size, Type);
|
||||
return new CParticleEffect(_PartyModeID, maxNumber, color, area, texture, size, type);
|
||||
}
|
||||
#endregion Create Elements
|
||||
|
||||
@@ -589,7 +589,7 @@ namespace VocaluxeLib.Menu
|
||||
#endregion ElementHandler
|
||||
|
||||
#region MenuHandler
|
||||
public virtual bool HandleInput(KeyEvent keyEvent)
|
||||
public virtual bool HandleInput(SKeyEvent keyEvent)
|
||||
{
|
||||
if (!CBase.Settings.IsTabNavigation())
|
||||
{
|
||||
@@ -632,7 +632,7 @@ namespace VocaluxeLib.Menu
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool HandleMouse(MouseEvent mouseEvent)
|
||||
public virtual bool HandleMouse(SMouseEvent mouseEvent)
|
||||
{
|
||||
int selection = _Selection;
|
||||
ProcessMouseMove(mouseEvent.X, mouseEvent.Y);
|
||||
@@ -651,56 +651,56 @@ namespace VocaluxeLib.Menu
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool HandleInputThemeEditor(KeyEvent KeyEvent)
|
||||
public virtual bool HandleInputThemeEditor(SKeyEvent keyEvent)
|
||||
{
|
||||
_UnsetHighlighted(_Selection);
|
||||
if (!KeyEvent.KeyPressed)
|
||||
if (!keyEvent.KeyPressed)
|
||||
{
|
||||
switch (KeyEvent.Key)
|
||||
switch (keyEvent.Key)
|
||||
{
|
||||
case Keys.S:
|
||||
CBase.Graphics.SaveTheme();
|
||||
break;
|
||||
|
||||
case Keys.R:
|
||||
ReloadThemeEditMode();
|
||||
_ReloadThemeEditMode();
|
||||
break;
|
||||
|
||||
case Keys.Up:
|
||||
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(0, -1);
|
||||
if (keyEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(0, -1);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(0, 1);
|
||||
if (keyEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(0, 1);
|
||||
|
||||
break;
|
||||
case Keys.Down:
|
||||
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(0, 1);
|
||||
if (keyEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(0, 1);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(0, -1);
|
||||
if (keyEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(0, -1);
|
||||
|
||||
break;
|
||||
|
||||
case Keys.Right:
|
||||
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(1, 0);
|
||||
if (keyEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(1, 0);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(1, 0);
|
||||
if (keyEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(1, 0);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.None)
|
||||
if (keyEvent.Mod == EModifier.None)
|
||||
NextInteraction();
|
||||
break;
|
||||
case Keys.Left:
|
||||
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(-1, 0);
|
||||
if (keyEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(-1, 0);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(-1, 0);
|
||||
if (keyEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(-1, 0);
|
||||
|
||||
if (KeyEvent.Mod == EModifier.None)
|
||||
if (keyEvent.Mod == EModifier.None)
|
||||
PrevInteraction();
|
||||
break;
|
||||
}
|
||||
@@ -708,64 +708,64 @@ namespace VocaluxeLib.Menu
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool HandleMouseThemeEditor(MouseEvent MouseEvent)
|
||||
public virtual bool HandleMouseThemeEditor(SMouseEvent mouseEvent)
|
||||
{
|
||||
_UnsetHighlighted(_Selection);
|
||||
_MouseDX = MouseEvent.X - _PrevMouseX;
|
||||
_MouseDY = MouseEvent.Y - _PrevMouseY;
|
||||
_MouseDX = mouseEvent.X - _PrevMouseX;
|
||||
_MouseDY = mouseEvent.Y - _PrevMouseY;
|
||||
|
||||
int stepX = 0;
|
||||
int stepY = 0;
|
||||
|
||||
if ((MouseEvent.Mod & EModifier.Ctrl) == EModifier.Ctrl)
|
||||
if ((mouseEvent.Mod & EModifier.Ctrl) == EModifier.Ctrl)
|
||||
{
|
||||
_PrevMouseX = MouseEvent.X;
|
||||
_PrevMouseY = MouseEvent.Y;
|
||||
_PrevMouseX = mouseEvent.X;
|
||||
_PrevMouseY = mouseEvent.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (Math.Abs(MouseEvent.X - _PrevMouseX) >= 5)
|
||||
while (Math.Abs(mouseEvent.X - _PrevMouseX) >= 5)
|
||||
{
|
||||
if (MouseEvent.X - _PrevMouseX >= 5)
|
||||
if (mouseEvent.X - _PrevMouseX >= 5)
|
||||
stepX += 5;
|
||||
|
||||
if (MouseEvent.X - _PrevMouseX <= -5)
|
||||
if (mouseEvent.X - _PrevMouseX <= -5)
|
||||
stepX -= 5;
|
||||
|
||||
_PrevMouseX = MouseEvent.X - (_MouseDX - stepX);
|
||||
_PrevMouseX = mouseEvent.X - (_MouseDX - stepX);
|
||||
}
|
||||
|
||||
while (Math.Abs(MouseEvent.Y - _PrevMouseY) >= 5)
|
||||
while (Math.Abs(mouseEvent.Y - _PrevMouseY) >= 5)
|
||||
{
|
||||
if (MouseEvent.Y - _PrevMouseY >= 5)
|
||||
if (mouseEvent.Y - _PrevMouseY >= 5)
|
||||
stepY += 5;
|
||||
|
||||
if (MouseEvent.Y - _PrevMouseY <= -5)
|
||||
if (mouseEvent.Y - _PrevMouseY <= -5)
|
||||
stepY -= 5;
|
||||
|
||||
_PrevMouseY = MouseEvent.Y - (_MouseDY - stepY);
|
||||
_PrevMouseY = mouseEvent.Y - (_MouseDY - stepY);
|
||||
}
|
||||
}
|
||||
|
||||
if (MouseEvent.LBH)
|
||||
if (mouseEvent.LBH)
|
||||
{
|
||||
//if (IsMouseOver(MouseEvent.X, _PrevMouseY))
|
||||
//{
|
||||
if (MouseEvent.Mod == EModifier.None)
|
||||
MoveElement(stepX, stepY);
|
||||
if (mouseEvent.Mod == EModifier.None)
|
||||
_MoveElement(stepX, stepY);
|
||||
|
||||
if (MouseEvent.Mod == EModifier.Ctrl)
|
||||
MoveElement(_MouseDX, _MouseDY);
|
||||
if (mouseEvent.Mod == EModifier.Ctrl)
|
||||
_MoveElement(_MouseDX, _MouseDY);
|
||||
|
||||
if (MouseEvent.Mod == EModifier.Shift)
|
||||
ResizeElement(stepX, stepY);
|
||||
if (mouseEvent.Mod == EModifier.Shift)
|
||||
_ResizeElement(stepX, stepY);
|
||||
|
||||
if (MouseEvent.Mod == (EModifier.Shift | EModifier.Ctrl))
|
||||
ResizeElement(_MouseDX, _MouseDY);
|
||||
if (mouseEvent.Mod == (EModifier.Shift | EModifier.Ctrl))
|
||||
_ResizeElement(_MouseDX, _MouseDY);
|
||||
//}
|
||||
}
|
||||
else
|
||||
ProcessMouseMove(MouseEvent.X, MouseEvent.Y);
|
||||
ProcessMouseMove(mouseEvent.X, mouseEvent.Y);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -776,29 +776,29 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public virtual void OnShow()
|
||||
{
|
||||
ResumeBG();
|
||||
_ResumeBG();
|
||||
}
|
||||
|
||||
public virtual void OnShowFinish()
|
||||
{
|
||||
ResumeBG();
|
||||
_ResumeBG();
|
||||
_Active = true;
|
||||
}
|
||||
|
||||
public virtual void OnClose()
|
||||
{
|
||||
PauseBG();
|
||||
_PauseBG();
|
||||
_Active = false;
|
||||
}
|
||||
#endregion MenuHandler
|
||||
|
||||
protected void ResumeBG()
|
||||
protected void _ResumeBG()
|
||||
{
|
||||
foreach (CBackground bg in _Backgrounds)
|
||||
bg.Resume();
|
||||
}
|
||||
|
||||
protected void PauseBG()
|
||||
protected void _PauseBG()
|
||||
{
|
||||
foreach (CBackground bg in _Backgrounds)
|
||||
bg.Pause();
|
||||
@@ -823,7 +823,7 @@ namespace VocaluxeLib.Menu
|
||||
if (_Interactions.Count <= 0)
|
||||
return;
|
||||
|
||||
List<ZSort> items = new List<ZSort>();
|
||||
List<SZSort> items = new List<SZSort>();
|
||||
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
@@ -838,9 +838,9 @@ namespace VocaluxeLib.Menu
|
||||
_Interactions[i].Type == EType.Playlist ||
|
||||
_Interactions[i].Type == EType.ParticleEffect))
|
||||
{
|
||||
ZSort zs = new ZSort();
|
||||
SZSort zs = new SZSort();
|
||||
zs.ID = i;
|
||||
zs.z = _GetZValue(i);
|
||||
zs.Z = _GetZValue(i);
|
||||
items.Add(zs);
|
||||
}
|
||||
}
|
||||
@@ -849,7 +849,7 @@ namespace VocaluxeLib.Menu
|
||||
return;
|
||||
|
||||
|
||||
items.Sort(delegate(ZSort s1, ZSort s2) { return s2.z.CompareTo(s1.z); });
|
||||
items.Sort(delegate(SZSort s1, SZSort s2) { return s2.Z.CompareTo(s1.Z); });
|
||||
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
_DrawInteraction(items[i].ID);
|
||||
@@ -1116,9 +1116,9 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsMouseOver(MouseEvent MouseEvent)
|
||||
public bool IsMouseOver(SMouseEvent mouseEvent)
|
||||
{
|
||||
return IsMouseOver(MouseEvent.X, MouseEvent.Y);
|
||||
return IsMouseOver(mouseEvent.X, mouseEvent.Y);
|
||||
}
|
||||
|
||||
public bool IsMouseOver(int x, int y)
|
||||
@@ -1273,25 +1273,25 @@ namespace VocaluxeLib.Menu
|
||||
/// <summary>
|
||||
/// Selects the next best interaction in a menu.
|
||||
/// </summary>
|
||||
/// <param name="Key"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
private bool _NextInteraction(KeyEvent Key)
|
||||
private bool _NextInteraction(SKeyEvent key)
|
||||
{
|
||||
KeyEvent[] Directions = new KeyEvent[4];
|
||||
float[] Distances = new float[4];
|
||||
SKeyEvent[] directions = new SKeyEvent[4];
|
||||
float[] distances = new float[4];
|
||||
int[] stages = new int[4];
|
||||
int[] elements = new int[4];
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
Directions[i] = new KeyEvent();
|
||||
directions[i] = new SKeyEvent();
|
||||
|
||||
Directions[0].Key = Keys.Up;
|
||||
Directions[1].Key = Keys.Right;
|
||||
Directions[2].Key = Keys.Down;
|
||||
Directions[3].Key = Keys.Left;
|
||||
directions[0].Key = Keys.Up;
|
||||
directions[1].Key = Keys.Right;
|
||||
directions[2].Key = Keys.Down;
|
||||
directions[3].Key = Keys.Left;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
elements[i] = _GetNextElement(Directions[i], out Distances[i], out stages[i]);
|
||||
elements[i] = _GetNextElement(directions[i], out distances[i], out stages[i]);
|
||||
|
||||
int element = _Selection;
|
||||
int stage = int.MaxValue;
|
||||
@@ -1299,7 +1299,7 @@ namespace VocaluxeLib.Menu
|
||||
int direction = -1;
|
||||
|
||||
int mute = -1;
|
||||
switch (Key.Key)
|
||||
switch (key.Key)
|
||||
{
|
||||
case Keys.Up:
|
||||
mute = 2;
|
||||
@@ -1317,11 +1317,11 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (i != mute && elements[i] != _Selection && (stages[i] <= stage && Directions[i].Key == Key.Key))
|
||||
if (i != mute && elements[i] != _Selection && (stages[i] <= stage && directions[i].Key == key.Key))
|
||||
{
|
||||
stage = stages[i];
|
||||
element = elements[i];
|
||||
distance = Distances[i];
|
||||
distance = distances[i];
|
||||
direction = i;
|
||||
}
|
||||
}
|
||||
@@ -1329,7 +1329,7 @@ namespace VocaluxeLib.Menu
|
||||
if (direction != -1)
|
||||
{
|
||||
// select the new element
|
||||
if (Directions[direction].Key == Key.Key)
|
||||
if (directions[direction].Key == key.Key)
|
||||
{
|
||||
_UnsetHighlighted(_Selection);
|
||||
_UnsetSelected();
|
||||
@@ -1344,24 +1344,24 @@ namespace VocaluxeLib.Menu
|
||||
return false;
|
||||
}
|
||||
|
||||
private int _GetNextElement(KeyEvent Key, out float Distance, out int Stage)
|
||||
private int _GetNextElement(SKeyEvent key, out float distance, out int stage)
|
||||
{
|
||||
Distance = float.MaxValue;
|
||||
distance = float.MaxValue;
|
||||
int min = _Selection;
|
||||
SRectF actualRect = _GetRect(_Selection);
|
||||
Stage = int.MaxValue;
|
||||
stage = int.MaxValue;
|
||||
|
||||
for (int i = 0; i < _Interactions.Count; i++)
|
||||
{
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistanceDirect(Key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < Distance)
|
||||
float dist = _GetDistanceDirect(key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < distance)
|
||||
{
|
||||
Distance = dist;
|
||||
distance = dist;
|
||||
min = i;
|
||||
Stage = 10;
|
||||
stage = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1373,12 +1373,12 @@ namespace VocaluxeLib.Menu
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistance180(Key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < Distance)
|
||||
float dist = _GetDistance180(key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < distance)
|
||||
{
|
||||
Distance = dist;
|
||||
distance = dist;
|
||||
min = i;
|
||||
Stage = 20;
|
||||
stage = 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1386,7 +1386,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (min == _Selection)
|
||||
{
|
||||
switch (Key.Key)
|
||||
switch (key.Key)
|
||||
{
|
||||
case Keys.Up:
|
||||
actualRect = new SRectF(actualRect.X, CBase.Settings.GetRenderH(), 1, 1, actualRect.Z);
|
||||
@@ -1407,12 +1407,12 @@ namespace VocaluxeLib.Menu
|
||||
if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i) && _IsEnabled(i))
|
||||
{
|
||||
SRectF targetRect = _GetRect(i);
|
||||
float dist = _GetDistance180(Key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < Distance)
|
||||
float dist = _GetDistance180(key, actualRect, targetRect);
|
||||
if (dist >= 0f && dist < distance)
|
||||
{
|
||||
Distance = dist;
|
||||
distance = dist;
|
||||
min = i;
|
||||
Stage = 30;
|
||||
stage = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1420,7 +1420,7 @@ namespace VocaluxeLib.Menu
|
||||
return min;
|
||||
}
|
||||
|
||||
private float _GetDistanceDirect(KeyEvent Key, SRectF actualRect, SRectF targetRect)
|
||||
private float _GetDistanceDirect(SKeyEvent key, SRectF actualRect, SRectF targetRect)
|
||||
{
|
||||
PointF source = new PointF(actualRect.X + actualRect.W / 2f, actualRect.Y + actualRect.H / 2f);
|
||||
PointF dest = new PointF(targetRect.X + targetRect.W / 2f, targetRect.Y + targetRect.H / 2f);
|
||||
@@ -1428,7 +1428,7 @@ namespace VocaluxeLib.Menu
|
||||
PointF vector = new PointF(dest.X - source.X, dest.Y - source.Y);
|
||||
float distance = (float)Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y);
|
||||
bool inDirection = false;
|
||||
switch (Key.Key)
|
||||
switch (key.Key)
|
||||
{
|
||||
case Keys.Up:
|
||||
if (vector.Y < 0f && (targetRect.X + targetRect.W > actualRect.X && actualRect.X + actualRect.W > targetRect.X))
|
||||
@@ -1456,7 +1456,7 @@ namespace VocaluxeLib.Menu
|
||||
return distance;
|
||||
}
|
||||
|
||||
private float _GetDistance180(KeyEvent Key, SRectF actualRect, SRectF targetRect)
|
||||
private float _GetDistance180(SKeyEvent key, SRectF actualRect, SRectF targetRect)
|
||||
{
|
||||
PointF source = new PointF(actualRect.X + actualRect.W / 2f, actualRect.Y + actualRect.H / 2f);
|
||||
PointF dest = new PointF(targetRect.X + targetRect.W / 2f, targetRect.Y + targetRect.H / 2f);
|
||||
@@ -1464,7 +1464,7 @@ namespace VocaluxeLib.Menu
|
||||
PointF vector = new PointF(dest.X - source.X, dest.Y - source.Y);
|
||||
float distance = (float)Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y);
|
||||
bool inDirection = false;
|
||||
switch (Key.Key)
|
||||
switch (key.Key)
|
||||
{
|
||||
case Keys.Up:
|
||||
if (vector.Y < 0f)
|
||||
@@ -1764,7 +1764,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private SRectF _GetRect(int interaction)
|
||||
{
|
||||
SRectF Result = new SRectF();
|
||||
SRectF result = new SRectF();
|
||||
switch (_Interactions[interaction].Type)
|
||||
{
|
||||
case EType.Button:
|
||||
@@ -1798,7 +1798,7 @@ namespace VocaluxeLib.Menu
|
||||
return _ParticleEffects[_Interactions[interaction].Num].Rect;
|
||||
}
|
||||
|
||||
return Result;
|
||||
return result;
|
||||
}
|
||||
|
||||
private void _AddInteraction(int num, EType type)
|
||||
@@ -1864,7 +1864,7 @@ namespace VocaluxeLib.Menu
|
||||
#endregion InteractionHandling
|
||||
|
||||
#region Theme Handling
|
||||
private void MoveElement(int stepX, int stepY)
|
||||
private void _MoveElement(int stepX, int stepY)
|
||||
{
|
||||
if (_Interactions.Count > 0)
|
||||
{
|
||||
@@ -1913,7 +1913,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private void ResizeElement(int stepW, int stepH)
|
||||
private void _ResizeElement(int stepW, int stepH)
|
||||
{
|
||||
if (_Interactions.Count > 0)
|
||||
{
|
||||
@@ -1962,7 +1962,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckVersion(int reqVersion, CXMLReader xmlReader)
|
||||
private bool _CheckVersion(int reqVersion, CXMLReader xmlReader)
|
||||
{
|
||||
int actualVersion = 0;
|
||||
xmlReader.TryGetIntValue("//root/" + ThemeName + "/ScreenVersion", ref actualVersion);
|
||||
@@ -1983,14 +1983,14 @@ namespace VocaluxeLib.Menu
|
||||
return false;
|
||||
}
|
||||
|
||||
private void LoadThemeBasics(CXMLReader xmlReader, int SkinIndex)
|
||||
private void _LoadThemeBasics(CXMLReader xmlReader, int skinIndex)
|
||||
{
|
||||
string value = String.Empty;
|
||||
|
||||
// Backgrounds
|
||||
CBackground background = new CBackground(_PartyModeID);
|
||||
int i = 1;
|
||||
while (background.LoadTheme("//root/" + ThemeName, "Background" + i.ToString(), xmlReader, SkinIndex))
|
||||
while (background.LoadTheme("//root/" + ThemeName, "Background" + i.ToString(), xmlReader, skinIndex))
|
||||
{
|
||||
AddBackground(background);
|
||||
background = new CBackground(_PartyModeID);
|
||||
@@ -2000,7 +2000,7 @@ namespace VocaluxeLib.Menu
|
||||
// Statics
|
||||
CStatic stat = new CStatic(_PartyModeID);
|
||||
i = 1;
|
||||
while (stat.LoadTheme("//root/" + ThemeName, "Static" + i.ToString(), xmlReader, SkinIndex))
|
||||
while (stat.LoadTheme("//root/" + ThemeName, "Static" + i.ToString(), xmlReader, skinIndex))
|
||||
{
|
||||
AddStatic(stat);
|
||||
stat = new CStatic(_PartyModeID);
|
||||
@@ -2010,7 +2010,7 @@ namespace VocaluxeLib.Menu
|
||||
// Texts
|
||||
CText text = new CText(_PartyModeID);
|
||||
i = 1;
|
||||
while (text.LoadTheme("//root/" + ThemeName, "Text" + i.ToString(), xmlReader, SkinIndex))
|
||||
while (text.LoadTheme("//root/" + ThemeName, "Text" + i.ToString(), xmlReader, skinIndex))
|
||||
{
|
||||
AddText(text);
|
||||
text = new CText(_PartyModeID);
|
||||
@@ -2020,7 +2020,7 @@ namespace VocaluxeLib.Menu
|
||||
// ParticleEffects
|
||||
CParticleEffect partef = new CParticleEffect(_PartyModeID);
|
||||
i = 1;
|
||||
while (partef.LoadTheme("//root/" + ThemeName, "ParticleEffect" + i.ToString(), xmlReader, SkinIndex))
|
||||
while (partef.LoadTheme("//root/" + ThemeName, "ParticleEffect" + i.ToString(), xmlReader, skinIndex))
|
||||
{
|
||||
AddParticleEffect(partef);
|
||||
partef = new CParticleEffect(_PartyModeID);
|
||||
@@ -2028,7 +2028,7 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
|
||||
private void ReloadThemeEditMode()
|
||||
private void _ReloadThemeEditMode()
|
||||
{
|
||||
CBase.Theme.UnloadSkins();
|
||||
CBase.Theme.ListSkins();
|
||||
|
||||
Reference in new issue
Block a user