just another small step

This commit is contained in:
Alexander Eckart committed 2012-12-13 20:44:59 +01:00
1 parent 79946a17c5
commit 99c956965e
29 files changed
+542 -382

No files matched your search

-174
View File
@@ -16,180 +16,6 @@ using Vocaluxe.Menu;
namespace Vocaluxe.Base namespace Vocaluxe.Base
{ {
#region Enums
public enum ERenderer
{
#if WIN
TR_CONFIG_DIRECT3D,
#endif
TR_CONFIG_OPENGL,
TR_CONFIG_SOFTWARE
}
public enum EAntiAliasingModes
{
x0 = 0,
x2 = 2,
x4 = 4,
x8 = 8,
x16 = 16,
x32 = 32
}
public enum EColorDeep
{
Bit8 = 8,
Bit16 = 16,
Bit24 = 24,
Bit32 = 32
}
public enum ETextureQuality
{
TR_CONFIG_TEXTURE_LOWEST,
TR_CONFIG_TEXTURE_LOW,
TR_CONFIG_TEXTURE_MEDIUM,
TR_CONFIG_TEXTURE_HIGH,
TR_CONFIG_TEXTURE_HIGHEST
}
public enum EOffOn
{
TR_CONFIG_OFF,
TR_CONFIG_ON
}
public enum EDebugLevel
{
// don't change the order!
TR_CONFIG_OFF, //no debug infos
TR_CONFIG_ONLY_FPS,
TR_CONFIG_LEVEL1,
TR_CONFIG_LEVEL2,
TR_CONFIG_LEVEL3,
TR_CONFIG_LEVEL_MAX //all debug infos
}
public enum EBufferSize
{
b0 = 0,
b512 = 512,
b1024 = 1024,
b1536 = 1536,
b2048 = 2048,
b2560 = 2560,
b3072 = 3072,
b3584 = 3584,
b4096 = 4096
}
public enum EPlaybackLib
{
PortAudio,
OpenAL
}
public enum EWebcamLib
{
OpenCV,
AForgeNet
}
public enum ERecordLib
{
#if WIN
DirectSound,
#endif
PortAudio
}
public enum EVideoDecoder
{
FFmpeg
}
public enum ESongMenu
{
//TR_CONFIG_LIST, //a simple list
//TR_CONFIG_DREIDEL, //as in ultrastar deluxe
TR_CONFIG_TILE_BOARD, //chessboard like
//TR_CONFIG_BOOK //for playlists
}
public enum ESongSorting
{
TR_CONFIG_NONE,
//TR_CONFIG_RANDOM,
TR_CONFIG_FOLDER,
TR_CONFIG_ARTIST,
TR_CONFIG_ARTIST_LETTER,
TR_CONFIG_TITLE_LETTER,
TR_CONFIG_EDITION,
TR_CONFIG_GENRE,
TR_CONFIG_LANGUAGE,
TR_CONFIG_YEAR,
TR_CONFIG_DECADE
}
public enum ECoverLoading
{
TR_CONFIG_COVERLOADING_ONDEMAND,
TR_CONFIG_COVERLOADING_ATSTART,
TR_CONFIG_COVERLOADING_DYNAMIC
}
public enum EGameDifficulty
{
TR_CONFIG_EASY,
TR_CONFIG_NORMAL,
TR_CONFIG_HARD
}
public enum ETimerMode
{
TR_CONFIG_TIMERMODE_CURRENT,
TR_CONFIG_TIMERMODE_REMAINING,
TR_CONFIG_TIMERMODE_TOTAL
}
public enum ETimerLook
{
TR_CONFIG_TIMERLOOK_NORMAL,
TR_CONFIG_TIMERLOOK_EXPANDED
}
public enum EBackgroundMusicSource
{
TR_CONFIG_NO_OWN_MUSIC,
TR_CONFIG_OWN_MUSIC,
TR_CONFIG_ONLY_OWN_MUSIC
}
public enum EPlayerInfo
{
TR_CONFIG_PLAYERINFO_BOTH,
TR_CONFIG_PLAYERINFO_NAME,
TR_CONFIG_PLAYERINFO_AVATAR,
TR_CONFIG_PLAYERINFO_OFF
}
public enum EFadePlayerInfo
{
TR_CONFIG_FADEPLAYERINFO_ALL,
TR_CONFIG_FADEPLAYERINFO_INFO,
TR_CONFIG_FADEPLAYERINFO_OFF
}
public enum ELyricStyle
{
Fill,
Jump,
Slide,
Zoom
}
#endregion Enums
static class CConfig static class CConfig
{ {
private static XmlWriterSettings _settings = new XmlWriterSettings(); private static XmlWriterSettings _settings = new XmlWriterSettings();
-22
View File
@@ -16,28 +16,6 @@ using Vocaluxe.Menu;
namespace Vocaluxe.Base namespace Vocaluxe.Base
{ {
public enum EAlignment
{
Left,
Center,
Right
}
public enum EHAlignment
{
Top,
Center,
Bottom
}
public enum EStyle
{
Normal,
Italic,
Bold,
BoldItalic
}
class CGlyph class CGlyph
{ {
private float _SIZEh = 50f; private float _SIZEh = 50f;
+1
View File
@@ -7,6 +7,7 @@ using System.Text;
using Vocaluxe.GameModes; using Vocaluxe.GameModes;
using Vocaluxe.Lib.Draw; using Vocaluxe.Lib.Draw;
using Vocaluxe.Lib.Song; using Vocaluxe.Lib.Song;
using Vocaluxe.Menu;
namespace Vocaluxe.Base namespace Vocaluxe.Base
{ {
+1
View File
@@ -5,6 +5,7 @@ using System.IO;
using System.Text; using System.Text;
using Vocaluxe.Lib.Sound; using Vocaluxe.Lib.Sound;
using Vocaluxe.Menu;
namespace Vocaluxe.Base namespace Vocaluxe.Base
{ {
+3 -1
View File
@@ -33,6 +33,7 @@ namespace Vocaluxe.Menu
public class CBackground : IMenuElement public class CBackground : IMenuElement
{ {
private Base _Base;
private SThemeBackground _Theme; private SThemeBackground _Theme;
private bool _ThemeLoaded; private bool _ThemeLoaded;
@@ -44,8 +45,9 @@ namespace Vocaluxe.Menu
} }
#region Constructors #region Constructors
public CBackground() public CBackground(Base Base)
{ {
_Base = Base;
_ThemeLoaded = false; _ThemeLoaded = false;
_Theme = new SThemeBackground(); _Theme = new SThemeBackground();
+5 -3
View File
@@ -23,6 +23,7 @@ namespace Vocaluxe.Menu
class CButton : IMenuElement class CButton : IMenuElement
{ {
private Base _Base;
private SThemeButton _Theme; private SThemeButton _Theme;
private bool _ThemeLoaded; private bool _ThemeLoaded;
@@ -71,16 +72,17 @@ namespace Vocaluxe.Menu
return _Theme.Name; return _Theme.Name;
} }
public CButton() public CButton(Base Base)
{ {
_Base = Base;
_Theme = new SThemeButton(); _Theme = new SThemeButton();
Rect = new SRectF(); Rect = new SRectF();
Color = new SColorF(); Color = new SColorF();
SColor = new SColorF(); SColor = new SColorF();
SelText = false; SelText = false;
Text = new CText(); Text = new CText(_Base);
SText = new CText(); SText = new CText(_Base);
Selected = false; Selected = false;
Visible = true; Visible = true;
EditMode = false; EditMode = false;
+3 -1
View File
@@ -31,6 +31,7 @@ namespace Vocaluxe.Menu
class CEqualizer : IMenuElement class CEqualizer : IMenuElement
{ {
private Base _Base;
private SThemeEqualizer _Theme; private SThemeEqualizer _Theme;
private bool _ThemeLoaded; private bool _ThemeLoaded;
@@ -54,8 +55,9 @@ namespace Vocaluxe.Menu
private float[] _Bars; private float[] _Bars;
public CEqualizer() public CEqualizer(Base Base)
{ {
_Base = Base;
_Theme = new SThemeEqualizer(); _Theme = new SThemeEqualizer();
_ThemeLoaded = false; _ThemeLoaded = false;
+5 -3
View File
@@ -30,6 +30,7 @@ namespace Vocaluxe.Menu
class CLyric : IMenuElement class CLyric : IMenuElement
{ {
private Base _Base;
private SThemeLyrics _Theme; private SThemeLyrics _Theme;
private bool _ThemeLoaded; private bool _ThemeLoaded;
@@ -87,8 +88,9 @@ namespace Vocaluxe.Menu
set { _Style = value; } set { _Style = value; }
} }
public CLyric() public CLyric(Base Base)
{ {
_Base = Base;
_Theme = new SThemeLyrics(); _Theme = new SThemeLyrics();
_ThemeLoaded = false; _ThemeLoaded = false;
Color = new SColorF(); Color = new SColorF();
@@ -101,7 +103,7 @@ namespace Vocaluxe.Menu
_H = 1f; _H = 1f;
_width = 1f; _width = 1f;
_Notes = new List<SNote>(); _Notes = new List<SNote>();
_Text = new CText(); _Text = new CText(_Base);
_Style = ELyricStyle.Fill; _Style = ELyricStyle.Fill;
} }
@@ -145,7 +147,7 @@ namespace Vocaluxe.Menu
{ {
_Theme.Name = ElementName; _Theme.Name = ElementName;
LoadTextures(); LoadTextures();
_Text = new CText(_X, _Y, _Z, _H, _MaxW, EAlignment.Left, EStyle.Bold, "Normal", Color, String.Empty); _Text = new CText(_Base, _X, _Y, _Z, _H, _MaxW, EAlignment.Left, EStyle.Bold, "Normal", Color, String.Empty);
} }
return _ThemeLoaded; return _ThemeLoaded;
} }
+163 -87
View File
@@ -75,15 +75,7 @@ namespace Vocaluxe.Menu
protected string[] _ThemePlaylists; protected string[] _ThemePlaylists;
protected SRectF _ScreenArea; protected SRectF _ScreenArea;
private Base _Base;
private IConfig _Config;
private ISettings _Settings;
private ITheme _Theme;
private IHelper _Helper;
private ILog _Log;
private IBackgroundMusic _BackgroundMusic;
private IDrawing _Draw;
private IGraphics _Graphics;
public SRectF ScreenArea public SRectF ScreenArea
{ {
@@ -106,15 +98,7 @@ namespace Vocaluxe.Menu
public void Initialize(IConfig Config, ISettings Settings, ITheme Theme, IHelper Helper, ILog Log, IBackgroundMusic BackgroundMusic, IDrawing Draw, IGraphics Graphics) public void Initialize(IConfig Config, ISettings Settings, ITheme Theme, IHelper Helper, ILog Log, IBackgroundMusic BackgroundMusic, IDrawing Draw, IGraphics Graphics)
{ {
_Config = Config; _Base = new Base(Config, Settings, Theme, Helper, Log, BackgroundMusic, Draw, Graphics);
_Settings = Settings;
_Theme = Theme;
_Helper = Helper;
_Log = Log;
_BackgroundMusic = BackgroundMusic;
_Draw = Draw;
_Graphics = Graphics;
Init(); Init();
} }
@@ -154,7 +138,7 @@ namespace Vocaluxe.Menu
_MouseDY = 0; _MouseDY = 0;
_Active = false; _Active = false;
_ScreenArea = new SRectF(0f, 0f, _Settings.GetRenderW(), _Settings.GetRenderH(), 0f); _ScreenArea = new SRectF(0f, 0f, _Base.Settings.GetRenderW(), _Base.Settings.GetRenderH(), 0f);
_ThemeName = String.Empty; _ThemeName = String.Empty;
_ThemeBackgrounds = null; _ThemeBackgrounds = null;
@@ -172,7 +156,7 @@ namespace Vocaluxe.Menu
#region ThemeHandler #region ThemeHandler
public virtual void LoadTheme() public virtual void LoadTheme()
{ {
string file = Path.Combine(_Theme.GetThemeScreensPath(), _ThemeName + ".xml"); string file = Path.Combine(_Base.Theme.GetThemeScreensPath(), _ThemeName + ".xml");
XPathDocument xPathDoc = null; XPathDocument xPathDoc = null;
XPathNavigator navigator = null; XPathNavigator navigator = null;
@@ -193,14 +177,14 @@ namespace Vocaluxe.Menu
if (xPathDoc != null) if (xPathDoc != null)
xPathDoc = null; xPathDoc = null;
_Log.LogError("Error loading theme file " + file + ": " + e.Message); _Base.Log.LogError("Error loading theme file " + file + ": " + e.Message);
} }
bool VersionCheck = false; bool VersionCheck = false;
if (loaded) if (loaded)
VersionCheck = CheckVersion(_ScreenVersion, navigator); VersionCheck = CheckVersion(_ScreenVersion, navigator);
int SkinIndex = _Theme.GetSkinIndex(); int SkinIndex = _Base.Theme.GetSkinIndex();
if (loaded && VersionCheck && SkinIndex != -1) if (loaded && VersionCheck && SkinIndex != -1)
{ {
@@ -210,14 +194,14 @@ namespace Vocaluxe.Menu
{ {
for (int i = 0; i < _ThemeBackgrounds.Length; i++) for (int i = 0; i < _ThemeBackgrounds.Length; i++)
{ {
CBackground background = new CBackground(); CBackground background = new CBackground(_Base);
if (background.LoadTheme("//root/" + _ThemeName, _ThemeBackgrounds[i], navigator, SkinIndex)) if (background.LoadTheme("//root/" + _ThemeName, _ThemeBackgrounds[i], navigator, SkinIndex))
{ {
_htBackgrounds.Add(_ThemeBackgrounds[i], AddBackground(background)); _htBackgrounds.Add(_ThemeBackgrounds[i], AddBackground(background));
} }
else else
{ {
_Log.LogError("Can't load Background \"" + _ThemeBackgrounds[i] + "\" in screen " + _ThemeName); _Base.Log.LogError("Can't load Background \"" + _ThemeBackgrounds[i] + "\" in screen " + _ThemeName);
} }
} }
} }
@@ -226,14 +210,14 @@ namespace Vocaluxe.Menu
{ {
for (int i = 0; i < _ThemeStatics.Length; i++) for (int i = 0; i < _ThemeStatics.Length; i++)
{ {
CStatic stat = new CStatic(); CStatic stat = new CStatic(_Base);
if (stat.LoadTheme("//root/" + _ThemeName, _ThemeStatics[i], navigator, SkinIndex)) if (stat.LoadTheme("//root/" + _ThemeName, _ThemeStatics[i], navigator, SkinIndex))
{ {
_htStatics.Add(_ThemeStatics[i], AddStatic(stat)); _htStatics.Add(_ThemeStatics[i], AddStatic(stat));
} }
else else
{ {
_Log.LogError("Can't load Static \"" + _ThemeStatics[i] + "\" in screen " + _ThemeName); _Base.Log.LogError("Can't load Static \"" + _ThemeStatics[i] + "\" in screen " + _ThemeName);
} }
} }
} }
@@ -242,14 +226,14 @@ namespace Vocaluxe.Menu
{ {
for (int i = 0; i < _ThemeTexts.Length; i++) for (int i = 0; i < _ThemeTexts.Length; i++)
{ {
CText text = new CText(); CText text = new CText(_Base);
if (text.LoadTheme("//root/" + _ThemeName, _ThemeTexts[i], navigator, SkinIndex)) if (text.LoadTheme("//root/" + _ThemeName, _ThemeTexts[i], navigator, SkinIndex))
{ {
_htTexts.Add(_ThemeTexts[i], AddText(text)); _htTexts.Add(_ThemeTexts[i], AddText(text));
} }
else else
{ {
_Log.LogError("Can't load Text \"" + _ThemeTexts[i] + "\" in screen " + _ThemeName); _Base.Log.LogError("Can't load Text \"" + _ThemeTexts[i] + "\" in screen " + _ThemeName);
} }
} }
} }
@@ -258,14 +242,14 @@ namespace Vocaluxe.Menu
{ {
for (int i = 0; i < _ThemeButtons.Length; i++) for (int i = 0; i < _ThemeButtons.Length; i++)
{ {
CButton button = new CButton(); CButton button = new CButton(_Base);
if (button.LoadTheme("//root/" + _ThemeName, _ThemeButtons[i], navigator, SkinIndex)) if (button.LoadTheme("//root/" + _ThemeName, _ThemeButtons[i], navigator, SkinIndex))
{ {
_htButtons.Add(_ThemeButtons[i], AddButton(button)); _htButtons.Add(_ThemeButtons[i], AddButton(button));
} }
else else
{ {
_Log.LogError("Can't load Button \"" + _ThemeButtons[i] + "\" in screen " + _ThemeName); _Base.Log.LogError("Can't load Button \"" + _ThemeButtons[i] + "\" in screen " + _ThemeName);
} }
} }
} }
@@ -274,14 +258,14 @@ namespace Vocaluxe.Menu
{ {
for (int i = 0; i < _ThemeSelectSlides.Length; i++) for (int i = 0; i < _ThemeSelectSlides.Length; i++)
{ {
CSelectSlide slide = new CSelectSlide(); CSelectSlide slide = new CSelectSlide(_Base);
if (slide.LoadTheme("//root/" + _ThemeName, _ThemeSelectSlides[i], navigator, SkinIndex)) if (slide.LoadTheme("//root/" + _ThemeName, _ThemeSelectSlides[i], navigator, SkinIndex))
{ {
_htSelectSlides.Add(_ThemeSelectSlides[i], AddSelectSlide(slide)); _htSelectSlides.Add(_ThemeSelectSlides[i], AddSelectSlide(slide));
} }
else else
{ {
_Log.LogError("Can't load SelectSlide \"" + _ThemeSelectSlides[i] + "\" in screen " + _ThemeName); _Base.Log.LogError("Can't load SelectSlide \"" + _ThemeSelectSlides[i] + "\" in screen " + _ThemeName);
} }
} }
} }
@@ -290,14 +274,14 @@ namespace Vocaluxe.Menu
{ {
for (int i = 0; i < _ThemeSongMenus.Length; i++) for (int i = 0; i < _ThemeSongMenus.Length; i++)
{ {
CSongMenu sm = new CSongMenu(); CSongMenu sm = new CSongMenu(_Base);
if (sm.LoadTheme("//root/" + _ThemeName, _ThemeSongMenus[i], navigator, SkinIndex)) if (sm.LoadTheme("//root/" + _ThemeName, _ThemeSongMenus[i], navigator, SkinIndex))
{ {
_htSongMenus.Add(_ThemeSongMenus[i], AddSongMenu(sm)); _htSongMenus.Add(_ThemeSongMenus[i], AddSongMenu(sm));
} }
else else
{ {
_Log.LogError("Can't load SongMenu \"" + _ThemeSongMenus[i] + "\" in screen " + _ThemeName); _Base.Log.LogError("Can't load SongMenu \"" + _ThemeSongMenus[i] + "\" in screen " + _ThemeName);
} }
} }
} }
@@ -306,14 +290,14 @@ namespace Vocaluxe.Menu
{ {
for (int i = 0; i < _ThemeLyrics.Length; i++) for (int i = 0; i < _ThemeLyrics.Length; i++)
{ {
CLyric lyric = new CLyric(); CLyric lyric = new CLyric(_Base);
if (lyric.LoadTheme("//root/" + _ThemeName, _ThemeLyrics[i], navigator, SkinIndex)) if (lyric.LoadTheme("//root/" + _ThemeName, _ThemeLyrics[i], navigator, SkinIndex))
{ {
_htLyrics.Add(_ThemeLyrics[i], AddLyric(lyric)); _htLyrics.Add(_ThemeLyrics[i], AddLyric(lyric));
} }
else else
{ {
_Log.LogError("Can't load Lyric \"" + _ThemeLyrics[i] + "\" in screen " + _ThemeName); _Base.Log.LogError("Can't load Lyric \"" + _ThemeLyrics[i] + "\" in screen " + _ThemeName);
} }
} }
} }
@@ -322,14 +306,14 @@ namespace Vocaluxe.Menu
{ {
for (int i = 0; i < _ThemeSingNotes.Length; i++) for (int i = 0; i < _ThemeSingNotes.Length; i++)
{ {
CSingNotes notes = new CSingNotesClassic(); CSingNotes notes = new CSingNotesClassic(_Base);
if (notes.LoadTheme("//root/" + _ThemeName, _ThemeSingNotes[i], navigator, SkinIndex)) if (notes.LoadTheme("//root/" + _ThemeName, _ThemeSingNotes[i], navigator, SkinIndex))
{ {
_htSingNotes.Add(_ThemeSingNotes[i], AddSingNote(notes)); _htSingNotes.Add(_ThemeSingNotes[i], AddSingNote(notes));
} }
else else
{ {
_Log.LogError("Can't load SingBar \"" + _ThemeSingNotes[i] + "\" in screen " + _ThemeName); _Base.Log.LogError("Can't load SingBar \"" + _ThemeSingNotes[i] + "\" in screen " + _ThemeName);
} }
} }
} }
@@ -338,14 +322,14 @@ namespace Vocaluxe.Menu
{ {
for (int i = 0; i < _ThemeNameSelections.Length; i++) for (int i = 0; i < _ThemeNameSelections.Length; i++)
{ {
CNameSelection nsel = new CNameSelection(); CNameSelection nsel = new CNameSelection(_Base);
if (nsel.LoadTheme("//root/" + _ThemeName, _ThemeNameSelections[i], navigator, SkinIndex)) if (nsel.LoadTheme("//root/" + _ThemeName, _ThemeNameSelections[i], navigator, SkinIndex))
{ {
_htNameSelections.Add(_ThemeNameSelections[i], AddNameSelection(nsel)); _htNameSelections.Add(_ThemeNameSelections[i], AddNameSelection(nsel));
} }
else else
{ {
_Log.LogError("Can't load NameSelection \"" + _ThemeNameSelections[i] + "\" in screen " + _ThemeName); _Base.Log.LogError("Can't load NameSelection \"" + _ThemeNameSelections[i] + "\" in screen " + _ThemeName);
} }
} }
} }
@@ -354,14 +338,14 @@ namespace Vocaluxe.Menu
{ {
for (int i = 0; i < _ThemeEqualizers.Length; i++) for (int i = 0; i < _ThemeEqualizers.Length; i++)
{ {
CEqualizer eq = new CEqualizer(); CEqualizer eq = new CEqualizer(_Base);
if (eq.LoadTheme("//root/" + _ThemeName, _ThemeEqualizers[i], navigator, SkinIndex)) if (eq.LoadTheme("//root/" + _ThemeName, _ThemeEqualizers[i], navigator, SkinIndex))
{ {
_htEqualizers.Add(_ThemeEqualizers[i], AddEqualizer(eq)); _htEqualizers.Add(_ThemeEqualizers[i], AddEqualizer(eq));
} }
else else
{ {
_Log.LogError("Can't load equalizer \"" + _ThemeEqualizers[i] + "\" in screen " + _ThemeName); _Base.Log.LogError("Can't load equalizer \"" + _ThemeEqualizers[i] + "\" in screen " + _ThemeName);
} }
} }
} }
@@ -370,14 +354,14 @@ namespace Vocaluxe.Menu
{ {
for (int i = 0; i < _ThemePlaylists.Length; i++) for (int i = 0; i < _ThemePlaylists.Length; i++)
{ {
CPlaylist pls = new CPlaylist(); CPlaylist pls = new CPlaylist(_Base);
if (pls.LoadTheme("//root/" + _ThemeName, _ThemePlaylists[i], navigator, SkinIndex)) if (pls.LoadTheme("//root/" + _ThemeName, _ThemePlaylists[i], navigator, SkinIndex))
{ {
_htPlaylists.Add(_ThemePlaylists[i], AddPlaylist(pls)); _htPlaylists.Add(_ThemePlaylists[i], AddPlaylist(pls));
} }
else else
{ {
_Log.LogError("Can't load Playlist \"" + _ThemePlaylists[i] + "\" in screen " + _ThemeName); _Base.Log.LogError("Can't load Playlist \"" + _ThemePlaylists[i] + "\" in screen " + _ThemeName);
} }
} }
} }
@@ -395,7 +379,7 @@ namespace Vocaluxe.Menu
settings.Encoding = Encoding.UTF8; settings.Encoding = Encoding.UTF8;
settings.ConformanceLevel = ConformanceLevel.Document; settings.ConformanceLevel = ConformanceLevel.Document;
string file = Path.Combine(_Theme.GetThemeScreensPath(), _ThemeName + ".xml"); string file = Path.Combine(_Base.Theme.GetThemeScreensPath(), _ThemeName + ".xml");
XmlWriter writer = XmlWriter.Create(file, settings); XmlWriter writer = XmlWriter.Create(file, settings);
writer.WriteStartDocument(); writer.WriteStartDocument();
@@ -660,6 +644,74 @@ namespace Vocaluxe.Menu
#endregion GetLists #endregion GetLists
#region ElementHandler #region ElementHandler
#region Create Elements
public CButton GetNewButton()
{
return new CButton(_Base);
}
public CText GetNewText()
{
return new CText(_Base);
}
public CText GetNewText(float x, float y, float z, float h, float mw, EAlignment align, EStyle style, string font, SColorF col, string text)
{
return new CText(_Base, x, y, z, h, mw, align, style, font, col, text);
}
public CBackground GetNewBackground()
{
return new CBackground(_Base);
}
public CStatic GetNewStatic()
{
return new CStatic(_Base);
}
public CStatic GetNewStatic(STexture Texture, SColorF Color, SRectF Rect)
{
return new CStatic(_Base, Texture, Color, Rect);
}
public CSelectSlide GetNewSelectSlide()
{
return new CSelectSlide(_Base);
}
public CSongMenu GetNewSongMenu()
{
return new CSongMenu(_Base);
}
public CLyric GetNewLyric()
{
return new CLyric(_Base);
}
public CSingNotes GetNewSingNotes()
{
return new CSingNotesClassic(_Base);
}
public CNameSelection GetNewNameSelection()
{
return new CNameSelection(_Base);
}
public CEqualizer GetNewEqualizer()
{
return new CEqualizer(_Base);
}
public CPlaylist GetNewPlaylist()
{
return new CPlaylist(_Base);
}
#endregion Create Elements
#region Get Arrays #region Get Arrays
public CButton[] Buttons public CButton[] Buttons
{ {
@@ -759,7 +811,7 @@ namespace Vocaluxe.Menu
} }
catch (Exception) catch (Exception)
{ {
_Log.LogError("Can't find Background Element \"" + key + "\" in Screen " + _ThemeName); _Base.Log.LogError("Can't find Background Element \"" + key + "\" in Screen " + _ThemeName);
throw; throw;
} }
} }
@@ -772,7 +824,7 @@ namespace Vocaluxe.Menu
} }
catch (Exception) catch (Exception)
{ {
_Log.LogError("Can't find Statics Element \"" + key + "\" in Screen " + _ThemeName); _Base.Log.LogError("Can't find Statics Element \"" + key + "\" in Screen " + _ThemeName);
throw; throw;
} }
} }
@@ -785,7 +837,7 @@ namespace Vocaluxe.Menu
} }
catch (Exception) catch (Exception)
{ {
_Log.LogError("Can't find Text Element \"" + key + "\" in Screen " + _ThemeName); _Base.Log.LogError("Can't find Text Element \"" + key + "\" in Screen " + _ThemeName);
throw; throw;
} }
} }
@@ -798,7 +850,7 @@ namespace Vocaluxe.Menu
} }
catch (Exception) catch (Exception)
{ {
_Log.LogError("Can't find Button Element \"" + key + "\" in Screen " + _ThemeName); _Base.Log.LogError("Can't find Button Element \"" + key + "\" in Screen " + _ThemeName);
throw; throw;
} }
} }
@@ -811,7 +863,7 @@ namespace Vocaluxe.Menu
} }
catch (Exception) catch (Exception)
{ {
_Log.LogError("Can't find SongMenu Element \"" + key + "\" in Screen " + _ThemeName); _Base.Log.LogError("Can't find SongMenu Element \"" + key + "\" in Screen " + _ThemeName);
throw; throw;
} }
} }
@@ -824,7 +876,7 @@ namespace Vocaluxe.Menu
} }
catch (Exception) catch (Exception)
{ {
_Log.LogError("Can't find Lyric Element \"" + key + "\" in Screen " + _ThemeName); _Base.Log.LogError("Can't find Lyric Element \"" + key + "\" in Screen " + _ThemeName);
throw; throw;
} }
} }
@@ -837,7 +889,7 @@ namespace Vocaluxe.Menu
} }
catch (Exception) catch (Exception)
{ {
_Log.LogError("Can't find SelectSlide Element \"" + key + "\" in Screen " + _ThemeName); _Base.Log.LogError("Can't find SelectSlide Element \"" + key + "\" in Screen " + _ThemeName);
throw; throw;
} }
} }
@@ -850,7 +902,7 @@ namespace Vocaluxe.Menu
} }
catch (Exception) catch (Exception)
{ {
_Log.LogError("Can't find SingBar Element \"" + key + "\" in Screen " + _ThemeName); _Base.Log.LogError("Can't find SingBar Element \"" + key + "\" in Screen " + _ThemeName);
throw; throw;
} }
} }
@@ -863,7 +915,7 @@ namespace Vocaluxe.Menu
} }
catch (Exception) catch (Exception)
{ {
_Log.LogError("Can't find NameSelection Element \"" + key + "\" in Screen " + _ThemeName); _Base.Log.LogError("Can't find NameSelection Element \"" + key + "\" in Screen " + _ThemeName);
throw; throw;
} }
} }
@@ -876,7 +928,7 @@ namespace Vocaluxe.Menu
} }
catch (Exception) catch (Exception)
{ {
_Log.LogError("Can't find Equalizer Element \"" + key + "\" in Screen " + _ThemeName); _Base.Log.LogError("Can't find Equalizer Element \"" + key + "\" in Screen " + _ThemeName);
throw; throw;
} }
} }
@@ -889,7 +941,7 @@ namespace Vocaluxe.Menu
} }
catch (Exception) catch (Exception)
{ {
_Log.LogError("Can't find Playlist Element \"" + key + "\" in Screen " + _ThemeName); _Base.Log.LogError("Can't find Playlist Element \"" + key + "\" in Screen " + _ThemeName);
throw; throw;
} }
} }
@@ -899,7 +951,7 @@ namespace Vocaluxe.Menu
#region MenuHandler #region MenuHandler
public virtual bool HandleInput(KeyEvent KeyEvent) public virtual bool HandleInput(KeyEvent KeyEvent)
{ {
if (!_Settings.IsTabNavigation()) if (!_Base.Settings.IsTabNavigation())
{ {
if (KeyEvent.Key == Keys.Left) if (KeyEvent.Key == Keys.Left)
{ {
@@ -938,25 +990,25 @@ namespace Vocaluxe.Menu
if (KeyEvent.Key == Keys.Right) if (KeyEvent.Key == Keys.Right)
NextElement(); NextElement();
} }
if (_BackgroundMusic.IsDisabled()) if (_Base.BackgroundMusic.IsDisabled())
{ {
if (KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Add || KeyEvent.Key == Keys.PageUp)) if (KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Add || KeyEvent.Key == Keys.PageUp))
_Config.SetBackgroundMusicVolume(_Config.GetBackgroundMusicVolume() + 5); _Base.Config.SetBackgroundMusicVolume(_Base.Config.GetBackgroundMusicVolume() + 5);
else if (KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Subtract || KeyEvent.Key == Keys.PageDown)) else if (KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Subtract || KeyEvent.Key == Keys.PageDown))
_Config.SetBackgroundMusicVolume(_Config.GetBackgroundMusicVolume() - 5); _Base.Config.SetBackgroundMusicVolume(_Base.Config.GetBackgroundMusicVolume() - 5);
else if (KeyEvent.Key == Keys.MediaNextTrack) else if (KeyEvent.Key == Keys.MediaNextTrack)
_BackgroundMusic.Next(); _Base.BackgroundMusic.Next();
else if (KeyEvent.Key == Keys.MediaPreviousTrack) else if (KeyEvent.Key == Keys.MediaPreviousTrack)
_BackgroundMusic.Previous(); _Base.BackgroundMusic.Previous();
else if (KeyEvent.Key == Keys.MediaPlayPause) else if (KeyEvent.Key == Keys.MediaPlayPause)
{ {
if (_BackgroundMusic.IsPlaying()) if (_Base.BackgroundMusic.IsPlaying())
_BackgroundMusic.Pause(); _Base.BackgroundMusic.Pause();
else else
_BackgroundMusic.Play(); _Base.BackgroundMusic.Play();
} }
_BackgroundMusic.ApplyVolume(); _Base.BackgroundMusic.ApplyVolume();
} }
return true; return true;
@@ -1367,10 +1419,10 @@ namespace Vocaluxe.Menu
public void SelectByMouse(int x, int y) public void SelectByMouse(int x, int y)
{ {
float z = _Settings.GetZFar(); float z = _Base.Settings.GetZFar();
for (int i = 0; i < _Interactions.Count; i++) for (int i = 0; i < _Interactions.Count; i++)
{ {
if ((_Settings.GetGameState() == EGameState.EditTheme) || (!_Interactions[i].ThemeEditorOnly && _IsVisible(i))) if ((_Base.Settings.GetGameState() == EGameState.EditTheme) || (!_Interactions[i].ThemeEditorOnly && _IsVisible(i)))
{ {
if (_IsMouseOver(x, y, _Interactions[i])) if (_IsMouseOver(x, y, _Interactions[i]))
{ {
@@ -1421,7 +1473,7 @@ namespace Vocaluxe.Menu
return true; return true;
break; break;
case EType.TText: case EType.TText:
RectangleF bounds = _Draw.GetTextBounds(_Texts[interact.Num]); RectangleF bounds = _Base.Drawing.GetTextBounds(_Texts[interact.Num]);
if (CHelper.IsInBounds(new SRectF(_Texts[interact.Num].X, _Texts[interact.Num].Y, bounds.Width, bounds.Height, _Texts[interact.Num].Z), x, y)) if (CHelper.IsInBounds(new SRectF(_Texts[interact.Num].X, _Texts[interact.Num].Y, bounds.Width, bounds.Height, _Texts[interact.Num].Z), x, y))
return true; return true;
break; break;
@@ -1472,7 +1524,7 @@ namespace Vocaluxe.Menu
case EType.TPlaylist: case EType.TPlaylist:
return _Playlists[interact.Num].Rect.Z; return _Playlists[interact.Num].Rect.Z;
} }
return _Settings.GetZFar(); return _Base.Settings.GetZFar();
} }
private float _GetZValue(int interaction) private float _GetZValue(int interaction)
@@ -1507,13 +1559,13 @@ namespace Vocaluxe.Menu
return _Playlists[_Interactions[interaction].Num].Rect.Z; return _Playlists[_Interactions[interaction].Num].Rect.Z;
} }
return _Settings.GetZFar(); return _Base.Settings.GetZFar();
} }
private void _NextInteraction() private void _NextInteraction()
{ {
_UnsetSelected(); _UnsetSelected();
if (_Settings.GetGameState() != EGameState.EditTheme) if (_Base.Settings.GetGameState() != EGameState.EditTheme)
{ {
bool found = false; bool found = false;
int start = _Selection; int start = _Selection;
@@ -1540,7 +1592,7 @@ namespace Vocaluxe.Menu
private void _PrevInteraction() private void _PrevInteraction()
{ {
_UnsetSelected(); _UnsetSelected();
if (_Settings.GetGameState() != EGameState.EditTheme) if (_Base.Settings.GetGameState() != EGameState.EditTheme)
{ {
bool found = false; bool found = false;
int start = _Selection; int start = _Selection;
@@ -1687,13 +1739,13 @@ namespace Vocaluxe.Menu
switch (Key.Key) switch (Key.Key)
{ {
case Keys.Up: case Keys.Up:
actualRect = new SRectF(actualRect.X, _Settings.GetRenderH(), 1, 1, actualRect.Z); actualRect = new SRectF(actualRect.X, _Base.Settings.GetRenderH(), 1, 1, actualRect.Z);
break; break;
case Keys.Down: case Keys.Down:
actualRect = new SRectF(actualRect.X, 0, 1, 1, actualRect.Z); actualRect = new SRectF(actualRect.X, 0, 1, 1, actualRect.Z);
break; break;
case Keys.Left: case Keys.Left:
actualRect = new SRectF(_Settings.GetRenderW(), actualRect.Y, 1, 1, actualRect.Z); actualRect = new SRectF(_Base.Settings.GetRenderW(), actualRect.Y, 1, 1, actualRect.Z);
break; break;
case Keys.Right: case Keys.Right:
actualRect = new SRectF(0, actualRect.Y, 1, 1, actualRect.Z); actualRect = new SRectF(0, actualRect.Y, 1, 1, actualRect.Z);
@@ -2211,7 +2263,7 @@ namespace Vocaluxe.Menu
msg += "the file is for newer program versions! "; msg += "the file is for newer program versions! ";
msg += "Current screen version is " + Version.ToString(); msg += "Current screen version is " + Version.ToString();
_Log.LogError(msg); _Base.Log.LogError(msg);
} }
return false; return false;
} }
@@ -2221,47 +2273,71 @@ namespace Vocaluxe.Menu
string value = String.Empty; string value = String.Empty;
// Backgrounds // Backgrounds
CBackground background = new CBackground(); CBackground background = new CBackground(_Base);
int i = 1; int i = 1;
while (background.LoadTheme("//root/" + _ThemeName, "Background" + i.ToString(), navigator, SkinIndex)) while (background.LoadTheme("//root/" + _ThemeName, "Background" + i.ToString(), navigator, SkinIndex))
{ {
AddBackground(background); AddBackground(background);
background = new CBackground(); background = new CBackground(_Base);
i++; i++;
} }
// Statics // Statics
CStatic stat = new CStatic(); CStatic stat = new CStatic(_Base);
i = 1; i = 1;
while (stat.LoadTheme("//root/" + _ThemeName, "Static" + i.ToString(), navigator, SkinIndex)) while (stat.LoadTheme("//root/" + _ThemeName, "Static" + i.ToString(), navigator, SkinIndex))
{ {
AddStatic(stat); AddStatic(stat);
stat = new CStatic(); stat = new CStatic(_Base);
i++; i++;
} }
// Texts // Texts
CText text = new CText(); CText text = new CText(_Base);
i = 1; i = 1;
while (text.LoadTheme("//root/" + _ThemeName, "Text" + i.ToString(), navigator, SkinIndex)) while (text.LoadTheme("//root/" + _ThemeName, "Text" + i.ToString(), navigator, SkinIndex))
{ {
AddText(text); AddText(text);
text = new CText(); text = new CText(_Base);
i++; i++;
} }
} }
private void ReloadThemeEditMode() private void ReloadThemeEditMode()
{ {
_Theme.UnloadSkins(); _Base.Theme.UnloadSkins();
_Theme.ListSkins(); _Base.Theme.ListSkins();
_Theme.LoadSkins(); _Base.Theme.LoadSkins();
_Theme.LoadTheme(); _Base.Theme.LoadTheme();
_Graphics.ReloadTheme(); _Base.Graphics.ReloadTheme();
OnShow(); OnShow();
OnShowFinish(); OnShowFinish();
} }
#endregion Theme Handling #endregion Theme Handling
} }
public class Base
{
public IConfig Config;
public ISettings Settings;
public ITheme Theme;
public IHelper Helper;
public ILog Log;
public IBackgroundMusic BackgroundMusic;
public IDrawing Drawing;
public IGraphics Graphics;
public Base(IConfig Config, ISettings Settings, ITheme Theme, IHelper Helper, ILog Log, IBackgroundMusic BackgroundMusic, IDrawing Draw, IGraphics Graphics)
{
this.Config = Config;
this.Settings = Settings;
this.Theme = Theme;
this.Helper = Helper;
this.Log = Log;
this.BackgroundMusic = BackgroundMusic;
this.Drawing = Draw;
this.Graphics = Graphics;
}
}
} }
+10 -7
View File
@@ -27,15 +27,16 @@ namespace Vocaluxe.Menu
class CNameSelection : IMenuElement class CNameSelection : IMenuElement
{ {
class CTile class CTile
{ {
private Base _Base;
public int PlayerNr; public int PlayerNr;
public CStatic Avatar; public CStatic Avatar;
public CText Name; public CText Name;
public CTile() public CTile(Base Base)
{ {
_Base = Base;
} }
public CTile(CStatic av, CText tex, int pl) public CTile(CStatic av, CText tex, int pl)
@@ -46,6 +47,7 @@ namespace Vocaluxe.Menu
} }
} }
private Base _Base;
private SThemeNameSelection _Theme; private SThemeNameSelection _Theme;
private bool _ThemeLoaded; private bool _ThemeLoaded;
@@ -85,8 +87,9 @@ namespace Vocaluxe.Menu
private CStatic PlayerSelector; private CStatic PlayerSelector;
public CNameSelection() public CNameSelection(Base Base)
{ {
_Base = Base;
_Theme = new SThemeNameSelection(); _Theme = new SThemeNameSelection();
_Tiles = new List<CTile>(); _Tiles = new List<CTile>();
@@ -97,7 +100,7 @@ namespace Vocaluxe.Menu
{ {
PrepareTiles(); PrepareTiles();
PlayerSelector = new CStatic(); PlayerSelector = new CStatic(_Base);
PlayerSelector.Texture = _TextureTileSelected; PlayerSelector.Texture = _TextureTileSelected;
PlayerSelector.Rect = new SRectF(0, 0, (_TileW + 6), (_TileH + 6), (Rect.Z - 0.5f)); PlayerSelector.Rect = new SRectF(0, 0, (_TileW + 6), (_TileH + 6), (Rect.Z - 0.5f));
PlayerSelector.Visible = false; PlayerSelector.Visible = false;
@@ -466,7 +469,7 @@ namespace Vocaluxe.Menu
} }
} }
return new CStatic(); return new CStatic(_Base);
} }
public void UnloadTextures() public void UnloadTextures()
@@ -501,8 +504,8 @@ namespace Vocaluxe.Menu
for (int j = 0; j < _NumW; j++) for (int j = 0; j < _NumW; j++)
{ {
SRectF rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z); SRectF rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z);
CStatic tileStatic = new CStatic(_TextureEmptyTile, ColorEmptyTile, rect); CStatic tileStatic = new CStatic(_Base, _TextureEmptyTile, ColorEmptyTile, rect);
CText tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.NameSpace, rect.Z, _Theme.NameHeight, rect.W, EAlignment.Center, _Theme.NameStyle, _Theme.NameFont, _Theme.NameColor, ""); CText tileText = new CText(_Base, rect.X + rect.W / 2, rect.Y + rect.H + _Theme.NameSpace, rect.Z, _Theme.NameHeight, rect.W, EAlignment.Center, _Theme.NameStyle, _Theme.NameFont, _Theme.NameColor, "");
_Tiles.Add(new CTile(tileStatic, tileText, -1)); _Tiles.Add(new CTile(tileStatic, tileText, -1));
} }
} }
+21 -15
View File
@@ -58,18 +58,21 @@ namespace Vocaluxe.Menu
class PlaylistElement class PlaylistElement
{ {
Base _Base;
public CStatic Cover; public CStatic Cover;
public CStatic Background; public CStatic Background;
public CText Text1; public CText Text1;
public CSelectSlide SelectSlide; public CSelectSlide SelectSlide;
public int Content; public int Content;
public PlaylistElement() public PlaylistElement(Base Base)
{ {
_Base = Base;
} }
public PlaylistElement(PlaylistElement pe) public PlaylistElement(PlaylistElement pe)
{ {
_Base = pe._Base;
Cover = new CStatic(pe.Cover); Cover = new CStatic(pe.Cover);
Background = new CStatic(pe.Background); Background = new CStatic(pe.Background);
Text1 = new CText(pe.Text1); Text1 = new CText(pe.Text1);
@@ -110,6 +113,7 @@ namespace Vocaluxe.Menu
} }
} }
private Base _Base;
private SThemePlaylist _Theme; private SThemePlaylist _Theme;
private bool _ThemeLoaded; private bool _ThemeLoaded;
@@ -158,7 +162,7 @@ namespace Vocaluxe.Menu
public int Offset = 0; public int Offset = 0;
public int CurrentPlaylistElement = -1; public int CurrentPlaylistElement = -1;
private PlaylistElement ChangeOrderElement = new PlaylistElement(); private PlaylistElement ChangeOrderElement;
private int ChangeOrderSource = -1; private int ChangeOrderSource = -1;
private int OldMousePosX = 0; private int OldMousePosX = 0;
private int OldMousePosY = 0; private int OldMousePosY = 0;
@@ -167,19 +171,20 @@ namespace Vocaluxe.Menu
//private static //private static
public CPlaylist() public CPlaylist(Base Base)
{ {
_Base = Base;
_Theme = new SThemePlaylist(); _Theme = new SThemePlaylist();
_Theme.Text1 = new CText(); _Theme.Text1 = new CText(_Base);
_Theme.StaticCover = new CStatic(); _Theme.StaticCover = new CStatic(_Base);
_Theme.StaticPlaylistFooter = new CStatic(); _Theme.StaticPlaylistFooter = new CStatic(_Base);
_Theme.StaticPlaylistHeader = new CStatic(); _Theme.StaticPlaylistHeader = new CStatic(_Base);
_Theme.ButtonPlaylistName = new CButton(); _Theme.ButtonPlaylistName = new CButton(_Base);
_Theme.ButtonPlaylistClose = new CButton(); _Theme.ButtonPlaylistClose = new CButton(_Base);
_Theme.ButtonPlaylistDelete = new CButton(); _Theme.ButtonPlaylistDelete = new CButton(_Base);
_Theme.ButtonPlaylistSave = new CButton(); _Theme.ButtonPlaylistSave = new CButton(_Base);
_Theme.ButtonPlaylistSing = new CButton(); _Theme.ButtonPlaylistSing = new CButton(_Base);
_Theme.SelectSlideGameMode = new CSelectSlide(); _Theme.SelectSlideGameMode = new CSelectSlide(_Base);
CompleteRect = new SRectF(); CompleteRect = new SRectF();
Rect = new SRectF(); Rect = new SRectF();
@@ -190,6 +195,7 @@ namespace Vocaluxe.Menu
PlaylistElementContents = new List<PlaylistElementContent>(); PlaylistElementContents = new List<PlaylistElementContent>();
_Interactions = new CObjectInteractions(); _Interactions = new CObjectInteractions();
ChangeOrderElement = new PlaylistElement(_Base);
Visible = false; Visible = false;
Selected = false; Selected = false;
@@ -1093,9 +1099,9 @@ namespace Vocaluxe.Menu
for (int i = 0; i < Math.Floor(Rect.H / _Theme.EntryHeight); i++) for (int i = 0; i < Math.Floor(Rect.H / _Theme.EntryHeight); i++)
{ {
PlaylistElement en = new PlaylistElement(); PlaylistElement en = new PlaylistElement(_Base);
en.Background = new CStatic(_Theme.TextureBackgroundName, BackgroundColor, new SRectF(Rect.X, Rect.Y + (i * _Theme.EntryHeight), Rect.W, _Theme.EntryHeight, Rect.Z)); en.Background = new CStatic(_Base, _Theme.TextureBackgroundName, BackgroundColor, new SRectF(Rect.X, Rect.Y + (i * _Theme.EntryHeight), Rect.W, _Theme.EntryHeight, Rect.Z));
en.Cover = new CStatic(_Theme.StaticCover); en.Cover = new CStatic(_Theme.StaticCover);
en.Cover.Rect.Y += Rect.Y + (i * _Theme.EntryHeight); en.Cover.Rect.Y += Rect.Y + (i * _Theme.EntryHeight);
+5 -2
View File
@@ -40,6 +40,7 @@ namespace Vocaluxe.Menu
class CSelectSlide : IMenuElement, ICloneable class CSelectSlide : IMenuElement, ICloneable
{ {
private Base _Base;
private SThemeSelectSlide _Theme; private SThemeSelectSlide _Theme;
private bool _ThemeLoaded; private bool _ThemeLoaded;
@@ -141,8 +142,9 @@ namespace Vocaluxe.Menu
} }
} }
public CSelectSlide() public CSelectSlide(Base Base)
{ {
_Base = Base;
_Theme = new SThemeSelectSlide(); _Theme = new SThemeSelectSlide();
_ThemeLoaded = false; _ThemeLoaded = false;
@@ -169,6 +171,7 @@ namespace Vocaluxe.Menu
public CSelectSlide(CSelectSlide slide) public CSelectSlide(CSelectSlide slide)
{ {
_Base = slide._Base;
_Theme = new SThemeSelectSlide(); _Theme = new SThemeSelectSlide();
_Theme.TextureArrowLeftName = slide._Theme.TextureArrowLeftName; _Theme.TextureArrowLeftName = slide._Theme.TextureArrowLeftName;
@@ -763,7 +766,7 @@ namespace Vocaluxe.Menu
_ValueBounds.Clear(); _ValueBounds.Clear();
for (int i = 0; i < numvis; i++) for (int i = 0; i < numvis; i++)
{ {
CText Text = new CText(0, 0, 0, TextH, MaxW, EAlignment.Center, _Theme.TextStyle, _Theme.TextFont, TextColor, _ValueNames[i + offset]); CText Text = new CText(_Base, 0, 0, 0, TextH, MaxW, EAlignment.Center, _Theme.TextStyle, _Theme.TextFont, TextColor, _ValueNames[i + offset]);
SColorF Alpha = new SColorF(1f, 1f, 1f, 0.35f); SColorF Alpha = new SColorF(1f, 1f, 1f, 0.35f);
if (i + offset == _Selection) if (i + offset == _Selection)
{ {
+18 -15
View File
@@ -5,9 +5,6 @@ using System.Text;
using System.Xml; using System.Xml;
using System.Xml.XPath; using System.Xml.XPath;
using Vocaluxe.Base;
using Vocaluxe.Lib.Draw;
namespace Vocaluxe.Menu namespace Vocaluxe.Menu
{ {
struct SThemeStatic struct SThemeStatic
@@ -19,6 +16,8 @@ namespace Vocaluxe.Menu
class CStatic : IMenuElement class CStatic : IMenuElement
{ {
private Base _Base;
private SThemeStatic _Theme; private SThemeStatic _Theme;
private bool _ThemeLoaded; private bool _ThemeLoaded;
@@ -35,7 +34,7 @@ namespace Vocaluxe.Menu
if (_Texture.index != -1) if (_Texture.index != -1)
return _Texture; return _Texture;
else else
return CTheme.GetSkinTexture(_Theme.TextureName); return _Base.Theme.GetSkinTexture(_Theme.TextureName);
} }
set { _Texture = value; } set { _Texture = value; }
@@ -55,8 +54,9 @@ namespace Vocaluxe.Menu
public EAspect Aspect = EAspect.Stretch; public EAspect Aspect = EAspect.Stretch;
public CStatic() public CStatic(Base Base)
{ {
_Base = Base;
_Theme = new SThemeStatic(); _Theme = new SThemeStatic();
_ThemeLoaded = false; _ThemeLoaded = false;
@@ -74,6 +74,7 @@ namespace Vocaluxe.Menu
public CStatic(CStatic s) public CStatic(CStatic s)
{ {
_Base = s._Base;
_Theme = new SThemeStatic(); _Theme = new SThemeStatic();
_ThemeLoaded = false; _ThemeLoaded = false;
@@ -89,8 +90,9 @@ namespace Vocaluxe.Menu
Visible = s.Visible; Visible = s.Visible;
} }
public CStatic(STexture texture, SColorF color, SRectF rect) public CStatic(Base Base, STexture texture, SColorF color, SRectF rect)
{ {
_Base = Base;
_Theme = new SThemeStatic(); _Theme = new SThemeStatic();
_ThemeLoaded = false; _ThemeLoaded = false;
@@ -106,8 +108,9 @@ namespace Vocaluxe.Menu
Visible = true; Visible = true;
} }
public CStatic(string TextureSkinName, SColorF color, SRectF rect) public CStatic(Base Base, string TextureSkinName, SColorF color, SRectF rect)
{ {
_Base = Base;
_Theme = new SThemeStatic(); _Theme = new SThemeStatic();
_Theme.TextureName = TextureSkinName; _Theme.TextureName = TextureSkinName;
_ThemeLoaded = false; _ThemeLoaded = false;
@@ -139,7 +142,7 @@ namespace Vocaluxe.Menu
if (CHelper.GetValueFromXML(item + "/Color", navigator, ref _Theme.ColorName, String.Empty)) if (CHelper.GetValueFromXML(item + "/Color", navigator, ref _Theme.ColorName, String.Empty))
{ {
_ThemeLoaded &= CTheme.GetColor(_Theme.ColorName, SkinIndex, ref Color); _ThemeLoaded &= _Base.Theme.GetColor(_Theme.ColorName, SkinIndex, ref Color);
} }
else else
{ {
@@ -239,7 +242,7 @@ namespace Vocaluxe.Menu
if (_Texture.index != -1) if (_Texture.index != -1)
texture = _Texture; texture = _Texture;
else else
texture = CTheme.GetSkinTexture(_Theme.TextureName); texture = _Base.Theme.GetSkinTexture(_Theme.TextureName);
SRectF bounds = new SRectF( SRectF bounds = new SRectF(
Rect.X - Rect.W * (scale - 1f), Rect.X - Rect.W * (scale - 1f),
@@ -263,18 +266,18 @@ namespace Vocaluxe.Menu
} }
SColorF color = new SColorF(Color.R, Color.G, Color.B, Color.A * Alpha); SColorF color = new SColorF(Color.R, Color.G, Color.B, Color.A * Alpha);
if (Visible || ForceDraw || (CSettings.GameState == EGameState.EditTheme)) if (Visible || ForceDraw || (_Base.Settings.GetGameState() == EGameState.EditTheme))
{ {
CDraw.DrawTexture(texture, rect, color, bounds); _Base.Drawing.DrawTexture(texture, rect, color, bounds);
if (Reflection) if (Reflection)
{ {
CDraw.DrawTextureReflection(texture, rect, color, bounds, ReflectionSpace, ReflectionHeight); _Base.Drawing.DrawTextureReflection(texture, rect, color, bounds, ReflectionSpace, ReflectionHeight);
} }
} }
if (Selected && (CSettings.GameState == EGameState.EditTheme)) if (Selected && (_Base.Settings.GetGameState() == EGameState.EditTheme))
{ {
CDraw.DrawColor(new SColorF(1f, 1f, 1f, 0.5f), rect); _Base.Drawing.DrawColor(new SColorF(1f, 1f, 1f, 0.5f), rect);
} }
} }
@@ -285,7 +288,7 @@ namespace Vocaluxe.Menu
public void LoadTextures() public void LoadTextures()
{ {
if (_Theme.ColorName != String.Empty) if (_Theme.ColorName != String.Empty)
Color = CTheme.GetColor(_Theme.ColorName); Color = _Base.Theme.GetColor(_Theme.ColorName);
} }
public void ReloadTextures() public void ReloadTextures()
+13 -6
View File
@@ -37,8 +37,9 @@ namespace Vocaluxe.Menu
} }
} }
class CText : IMenuElement public class CText : IMenuElement
{ {
private Base _Base;
private SThemeText _Theme; private SThemeText _Theme;
private bool _ThemeLoaded; private bool _ThemeLoaded;
@@ -221,8 +222,9 @@ namespace Vocaluxe.Menu
public float Alpha = 1f; public float Alpha = 1f;
public CText() public CText(Base Base)
{ {
_Base = Base;
_Theme = new SThemeText(); _Theme = new SThemeText();
_ThemeLoaded = false; _ThemeLoaded = false;
_ButtonText = false; _ButtonText = false;
@@ -252,6 +254,7 @@ namespace Vocaluxe.Menu
public CText(CText text) public CText(CText text)
{ {
_Base = text._Base;
_Theme = new SThemeText(); _Theme = new SThemeText();
_ThemeLoaded = false; _ThemeLoaded = false;
_ButtonText = false; _ButtonText = false;
@@ -281,8 +284,9 @@ namespace Vocaluxe.Menu
EditMode = text.EditMode; EditMode = text.EditMode;
} }
public CText(float x, float y, float z, EAlignment align, float h, float mw, float r, float g, float b, float a, EStyle style, string font, string text, float rspace, float rheight) public CText(Base Base, float x, float y, float z, EAlignment align, float h, float mw, float r, float g, float b, float a, EStyle style, string font, string text, float rspace, float rheight)
{ {
_Base = Base;
_Theme = new SThemeText(); _Theme = new SThemeText();
_ThemeLoaded = false; _ThemeLoaded = false;
_ButtonText = false; _ButtonText = false;
@@ -318,8 +322,9 @@ namespace Vocaluxe.Menu
ReflectionHeight = rheight; ReflectionHeight = rheight;
} }
public CText(float x, float y, float z, EAlignment align, float h, float mw, float r, float g, float b, float a, EStyle style, string font, string text) public CText(Base Base, float x, float y, float z, EAlignment align, float h, float mw, float r, float g, float b, float a, EStyle style, string font, string text)
{ {
_Base = Base;
_Theme = new SThemeText(); _Theme = new SThemeText();
_ThemeLoaded = false; _ThemeLoaded = false;
_ButtonText = false; _ButtonText = false;
@@ -353,8 +358,9 @@ namespace Vocaluxe.Menu
Reflection = false; Reflection = false;
} }
public CText(float x, float y, float z, float h, float mw, EAlignment align, EStyle style, string font, SColorF col, string text, float rspace, float rheight) public CText(Base Base, float x, float y, float z, float h, float mw, EAlignment align, EStyle style, string font, SColorF col, string text, float rspace, float rheight)
{ {
_Base = Base;
_Theme = new SThemeText(); _Theme = new SThemeText();
_ThemeLoaded = false; _ThemeLoaded = false;
_ButtonText = false; _ButtonText = false;
@@ -390,8 +396,9 @@ namespace Vocaluxe.Menu
ReflectionHeight = rheight; ReflectionHeight = rheight;
} }
public CText(float x, float y, float z, float h, float mw, EAlignment align, EStyle style, string font, SColorF col, string text) public CText(Base Base, float x, float y, float z, float h, float mw, EAlignment align, EStyle style, string font, SColorF col, string text)
{ {
_Base = Base;
_Theme = new SThemeText(); _Theme = new SThemeText();
_ThemeLoaded = false; _ThemeLoaded = false;
_ButtonText = false; _ButtonText = false;
+215 -8
View File
@@ -43,13 +43,15 @@ namespace Vocaluxe.Menu
void ProcessMouseMove(int x, int y); void ProcessMouseMove(int x, int y);
} }
interface IConfig public interface IConfig
{ {
void SetBackgroundMusicVolume(int NewVolume); void SetBackgroundMusicVolume(int NewVolume);
int GetBackgroundMusicVolume(); int GetBackgroundMusicVolume();
ESongMenu GetSongMenuType();
} }
interface ISettings public interface ISettings
{ {
int GetRenderW(); int GetRenderW();
int GetRenderH(); int GetRenderH();
@@ -61,10 +63,14 @@ namespace Vocaluxe.Menu
EGameState GetGameState(); EGameState GetGameState();
} }
interface ITheme public interface ITheme
{ {
string GetThemeScreensPath(); string GetThemeScreensPath();
int GetSkinIndex(); int GetSkinIndex();
STexture GetSkinTexture(string TextureName);
SColorF GetColor(string ColorName);
bool GetColor(string ColorName, int SkinIndex, ref SColorF Color);
void UnloadSkins(); void UnloadSkins();
void ListSkins(); void ListSkins();
@@ -72,11 +78,11 @@ namespace Vocaluxe.Menu
void LoadTheme(); void LoadTheme();
} }
interface IHelper public interface IHelper
{ {
} }
interface IBackgroundMusic public interface IBackgroundMusic
{ {
bool IsDisabled(); bool IsDisabled();
bool IsPlaying(); bool IsPlaying();
@@ -89,17 +95,22 @@ namespace Vocaluxe.Menu
void ApplyVolume(); void ApplyVolume();
} }
interface IDrawing public interface IDrawing
{ {
RectangleF GetTextBounds(CText text); RectangleF GetTextBounds(CText text);
void DrawTexture(STexture Texture, SRectF Rect, SColorF Color, SRectF Bounds);
void DrawTextureReflection(STexture Texture, SRectF Rect, SColorF Color, SRectF Bounds, float ReflectionSpace, float ReflectionHeight);
void DrawColor(SColorF Color, SRectF Rect);
} }
interface IGraphics public interface IGraphics
{ {
void ReloadTheme(); void ReloadTheme();
} }
interface ILog public interface ILog
{ {
void LogError(string ErrorText); void LogError(string ErrorText);
} }
@@ -347,4 +358,200 @@ namespace Vocaluxe.Menu
} }
} }
#endregion Structs #endregion Structs
#region EnumsConfig
public enum ERenderer
{
#if WIN
TR_CONFIG_DIRECT3D,
#endif
TR_CONFIG_OPENGL,
TR_CONFIG_SOFTWARE
}
public enum EAntiAliasingModes
{
x0 = 0,
x2 = 2,
x4 = 4,
x8 = 8,
x16 = 16,
x32 = 32
}
public enum EColorDeep
{
Bit8 = 8,
Bit16 = 16,
Bit24 = 24,
Bit32 = 32
}
public enum ETextureQuality
{
TR_CONFIG_TEXTURE_LOWEST,
TR_CONFIG_TEXTURE_LOW,
TR_CONFIG_TEXTURE_MEDIUM,
TR_CONFIG_TEXTURE_HIGH,
TR_CONFIG_TEXTURE_HIGHEST
}
public enum EOffOn
{
TR_CONFIG_OFF,
TR_CONFIG_ON
}
public enum EDebugLevel
{
// don't change the order!
TR_CONFIG_OFF, //no debug infos
TR_CONFIG_ONLY_FPS,
TR_CONFIG_LEVEL1,
TR_CONFIG_LEVEL2,
TR_CONFIG_LEVEL3,
TR_CONFIG_LEVEL_MAX //all debug infos
}
public enum EBufferSize
{
b0 = 0,
b512 = 512,
b1024 = 1024,
b1536 = 1536,
b2048 = 2048,
b2560 = 2560,
b3072 = 3072,
b3584 = 3584,
b4096 = 4096
}
public enum EPlaybackLib
{
PortAudio,
OpenAL
}
public enum EWebcamLib
{
OpenCV,
AForgeNet
}
public enum ERecordLib
{
#if WIN
DirectSound,
#endif
PortAudio
}
public enum EVideoDecoder
{
FFmpeg
}
public enum ESongMenu
{
//TR_CONFIG_LIST, //a simple list
//TR_CONFIG_DREIDEL, //as in ultrastar deluxe
TR_CONFIG_TILE_BOARD, //chessboard like
//TR_CONFIG_BOOK //for playlists
}
public enum ESongSorting
{
TR_CONFIG_NONE,
//TR_CONFIG_RANDOM,
TR_CONFIG_FOLDER,
TR_CONFIG_ARTIST,
TR_CONFIG_ARTIST_LETTER,
TR_CONFIG_TITLE_LETTER,
TR_CONFIG_EDITION,
TR_CONFIG_GENRE,
TR_CONFIG_LANGUAGE,
TR_CONFIG_YEAR,
TR_CONFIG_DECADE
}
public enum ECoverLoading
{
TR_CONFIG_COVERLOADING_ONDEMAND,
TR_CONFIG_COVERLOADING_ATSTART,
TR_CONFIG_COVERLOADING_DYNAMIC
}
public enum EGameDifficulty
{
TR_CONFIG_EASY,
TR_CONFIG_NORMAL,
TR_CONFIG_HARD
}
public enum ETimerMode
{
TR_CONFIG_TIMERMODE_CURRENT,
TR_CONFIG_TIMERMODE_REMAINING,
TR_CONFIG_TIMERMODE_TOTAL
}
public enum ETimerLook
{
TR_CONFIG_TIMERLOOK_NORMAL,
TR_CONFIG_TIMERLOOK_EXPANDED
}
public enum EBackgroundMusicSource
{
TR_CONFIG_NO_OWN_MUSIC,
TR_CONFIG_OWN_MUSIC,
TR_CONFIG_ONLY_OWN_MUSIC
}
public enum EPlayerInfo
{
TR_CONFIG_PLAYERINFO_BOTH,
TR_CONFIG_PLAYERINFO_NAME,
TR_CONFIG_PLAYERINFO_AVATAR,
TR_CONFIG_PLAYERINFO_OFF
}
public enum EFadePlayerInfo
{
TR_CONFIG_FADEPLAYERINFO_ALL,
TR_CONFIG_FADEPLAYERINFO_INFO,
TR_CONFIG_FADEPLAYERINFO_OFF
}
public enum ELyricStyle
{
Fill,
Jump,
Slide,
Zoom
}
#endregion EnumsConfig
public enum EAlignment
{
Left,
Center,
Right
}
public enum EHAlignment
{
Top,
Center,
Bottom
}
public enum EStyle
{
Normal,
Italic,
Bold,
BoldItalic
}
} }
+1
View File
@@ -9,6 +9,7 @@ namespace Vocaluxe.Menu
interface IMenuElement interface IMenuElement
{ {
string GetThemeName(); string GetThemeName();
bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex); bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex);
bool SaveTheme(XmlWriter writer); bool SaveTheme(XmlWriter writer);
+3 -1
View File
@@ -46,6 +46,7 @@ namespace Vocaluxe.Menu.SingNotes
abstract class CSingNotes : ISingNotes, IMenuElement abstract class CSingNotes : ISingNotes, IMenuElement
{ {
private Base _Base;
private SThemeSingBar _Theme; private SThemeSingBar _Theme;
private bool _ThemeLoaded; private bool _ThemeLoaded;
@@ -66,8 +67,9 @@ namespace Vocaluxe.Menu.SingNotes
set { _BarPos = value; } set { _BarPos = value; }
} }
public CSingNotes() public CSingNotes(Base Base)
{ {
_Base = Base;
_Theme = new SThemeSingBar(); _Theme = new SThemeSingBar();
_ThemeLoaded = false; _ThemeLoaded = false;
@@ -6,5 +6,12 @@ namespace Vocaluxe.Menu.SingNotes
{ {
class CSingNotesClassic : CSingNotes class CSingNotesClassic : CSingNotes
{ {
private Base _Base;
public CSingNotesClassic(Base Base)
: base(Base)
{
_Base = Base;
}
} }
} }
+9 -7
View File
@@ -4,25 +4,27 @@ using System.Text;
using System.Xml; using System.Xml;
using System.Xml.XPath; using System.Xml.XPath;
using Vocaluxe.Base; using Vocaluxe.Menu;
using Vocaluxe.Lib.Draw;
using Vocaluxe.PartyModes; using Vocaluxe.PartyModes;
namespace Vocaluxe.Menu.SongMenu namespace Vocaluxe.Menu.SongMenu
{ {
class CSongMenu : ISongMenu class CSongMenu : ISongMenu
{ {
private Base _Base;
private ISongMenu _SongMenu; private ISongMenu _SongMenu;
private ESongMenu _Type; private ESongMenu _Type;
public CSongMenu() public CSongMenu(Base Base)
{ {
_Base = Base;
CreateSongMenu(); CreateSongMenu();
} }
public void UpdateSongMenuType() public void UpdateSongMenuType()
{ {
if (_Type != CConfig.SongMenu) if (_Type != _Base.Config.GetSongMenuType())
CreateSongMenu(); CreateSongMenu();
} }
@@ -205,7 +207,7 @@ namespace Vocaluxe.Menu.SongMenu
_SongMenu.OnHide(); _SongMenu.OnHide();
} }
switch (CConfig.SongMenu) switch (_Base.Config.GetSongMenuType())
{ {
//case ESongMenu.TR_CONFIG_LIST: //case ESongMenu.TR_CONFIG_LIST:
// _SongMenu = new CSongMenuList(); // _SongMenu = new CSongMenuList();
@@ -216,7 +218,7 @@ namespace Vocaluxe.Menu.SongMenu
// break; // break;
case ESongMenu.TR_CONFIG_TILE_BOARD: case ESongMenu.TR_CONFIG_TILE_BOARD:
_SongMenu = new CSongMenuTileBoard(); _SongMenu = new CSongMenuTileBoard(_Base);
break; break;
//case ESongMenu.TR_CONFIG_BOOK: //case ESongMenu.TR_CONFIG_BOOK:
@@ -224,7 +226,7 @@ namespace Vocaluxe.Menu.SongMenu
// break; // break;
} }
_Type = CConfig.SongMenu; _Type = _Base.Config.GetSongMenuType();
} }
} }
} }
+7
View File
@@ -6,5 +6,12 @@ namespace Vocaluxe.Menu.SongMenu
{ {
class CSongMenuBook : CSongMenuFramework class CSongMenuBook : CSongMenuFramework
{ {
new private Base _Base;
public CSongMenuBook(Base Base)
: base(Base)
{
_Base = Base;
}
} }
} }
@@ -12,6 +12,7 @@ namespace Vocaluxe.Menu.SongMenu
{ {
class CSongMenuDreidel : CSongMenuFramework class CSongMenuDreidel : CSongMenuFramework
{ {
new private Base _Base;
/* /*
private SRectF _ScrollRect; private SRectF _ScrollRect;
private CStatic _CoverBig; private CStatic _CoverBig;
@@ -31,6 +32,13 @@ namespace Vocaluxe.Menu.SongMenu
return _actualSelection; return _actualSelection;
} }
*/ */
public CSongMenuDreidel(Base Base)
: base(Base)
{
_Base = Base;
}
public override void Init() public override void Init()
{ {
base.Init(); base.Init();
+13 -11
View File
@@ -93,6 +93,7 @@ namespace Vocaluxe.Menu.SongMenu
abstract class CSongMenuFramework : ISongMenu abstract class CSongMenuFramework : ISongMenu
{ {
protected Base _Base;
protected SThemeSongMenu _Theme; protected SThemeSongMenu _Theme;
private bool _ThemeLoaded; private bool _ThemeLoaded;
@@ -234,20 +235,21 @@ namespace Vocaluxe.Menu.SongMenu
_Visible = Visible; _Visible = Visible;
} }
public CSongMenuFramework() public CSongMenuFramework(Base Base)
{ {
_Base = Base;
_Theme = new SThemeSongMenu(); _Theme = new SThemeSongMenu();
_Theme.songMenuTileBoard.TextArtist = new CText(); _Theme.songMenuTileBoard.TextArtist = new CText(_Base);
_Theme.songMenuTileBoard.TextTitle = new CText(); _Theme.songMenuTileBoard.TextTitle = new CText(_Base);
_Theme.songMenuTileBoard.TextSongLength = new CText(); _Theme.songMenuTileBoard.TextSongLength = new CText(_Base);
_Theme.songMenuTileBoard.StaticCoverBig = new CStatic(); _Theme.songMenuTileBoard.StaticCoverBig = new CStatic(_Base);
_Theme.songMenuTileBoard.StaticTextBG = new CStatic(); _Theme.songMenuTileBoard.StaticTextBG = new CStatic(_Base);
_Theme.songMenuTileBoard.StaticDuetIcon = new CStatic(); _Theme.songMenuTileBoard.StaticDuetIcon = new CStatic(_Base);
_Theme.songMenuTileBoard.StaticVideoIcon = new CStatic(); _Theme.songMenuTileBoard.StaticVideoIcon = new CStatic(_Base);
_Theme.songMenuTileBoard.StaticMedleyCalcIcon = new CStatic(); _Theme.songMenuTileBoard.StaticMedleyCalcIcon = new CStatic(_Base);
_Theme.songMenuTileBoard.StaticMedleyTagIcon = new CStatic(); _Theme.songMenuTileBoard.StaticMedleyTagIcon = new CStatic(_Base);
_ThemeLoaded = false; _ThemeLoaded = false;
} }
@@ -540,7 +542,7 @@ namespace Vocaluxe.Menu.SongMenu
public virtual CStatic GetSelectedSongCover() public virtual CStatic GetSelectedSongCover()
{ {
return new CStatic(); return new CStatic(_Base);
} }
public virtual int GetSelectedCategory() public virtual int GetSelectedCategory()
+7
View File
@@ -6,5 +6,12 @@ namespace Vocaluxe.Menu.SongMenu
{ {
class CSongMenuList : CSongMenuFramework class CSongMenuList : CSongMenuFramework
{ {
new private Base _Base;
public CSongMenuList(Base Base)
: base(Base)
{
_Base = Base;
}
} }
} }
+11 -4
View File
@@ -13,6 +13,7 @@ namespace Vocaluxe.Menu.SongMenu
{ {
class CSongMenuTileBoard : CSongMenuFramework class CSongMenuTileBoard : CSongMenuFramework
{ {
new private Base _Base;
private SRectF _ScrollRect; private SRectF _ScrollRect;
private List<CStatic> _Tiles; private List<CStatic> _Tiles;
private CStatic _CoverBig; private CStatic _CoverBig;
@@ -43,6 +44,12 @@ namespace Vocaluxe.Menu.SongMenu
private bool _SmallView = false; private bool _SmallView = false;
public CSongMenuTileBoard(Base Base)
: base(Base)
{
_Base = Base;
}
public override int GetActualSelection() public override int GetActualSelection()
{ {
return _actualSelection; return _actualSelection;
@@ -74,7 +81,7 @@ namespace Vocaluxe.Menu.SongMenu
{ {
SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW), SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW),
_Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z); _Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z);
CStatic tile = new CStatic(_CoverTexture, Color, rect); CStatic tile = new CStatic(_Base, _CoverTexture, Color, rect);
_Tiles.Add(tile); _Tiles.Add(tile);
} }
} }
@@ -518,7 +525,7 @@ namespace Vocaluxe.Menu.SongMenu
if (tile.Selected) if (tile.Selected)
return new CStatic(tile); return new CStatic(tile);
} }
return new CStatic(); return new CStatic(_Base);
} }
public override void SetSelectedSong(int VisibleSongNr) public override void SetSelectedSong(int VisibleSongNr)
@@ -771,7 +778,7 @@ namespace Vocaluxe.Menu.SongMenu
{ {
SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRectSmall.X + j * (_TileW + _SpaceW), SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRectSmall.X + j * (_TileW + _SpaceW),
_Theme.songMenuTileBoard.TileRectSmall.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z); _Theme.songMenuTileBoard.TileRectSmall.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z);
CStatic tile = new CStatic(_CoverTexture, Color, rect); CStatic tile = new CStatic(_Base, _CoverTexture, Color, rect);
_Tiles.Add(tile); _Tiles.Add(tile);
} }
} }
@@ -797,7 +804,7 @@ namespace Vocaluxe.Menu.SongMenu
{ {
SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW), SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW),
_Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z); _Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z);
CStatic tile = new CStatic(_CoverTexture, Color, rect); CStatic tile = new CStatic(_Base, _CoverTexture, Color, rect);
_Tiles.Add(tile); _Tiles.Add(tile);
} }
} }
-2
View File
@@ -2,8 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using Vocaluxe.Base;
using Vocaluxe.Lib.Draw;
using Vocaluxe.PartyModes; using Vocaluxe.PartyModes;
namespace Vocaluxe.Menu.SongMenu namespace Vocaluxe.Menu.SongMenu
+10 -10
View File
@@ -148,7 +148,7 @@ namespace Vocaluxe.Screens
if (paragraphs[i][e] != null) if (paragraphs[i][e] != null)
{ {
string newline = line + " " + paragraphs[i][e]; string newline = line + " " + paragraphs[i][e];
CText text = new CText(75, lastY, -2, 30, -1, EAlignment.Left, EStyle.Bold, "Outline", new SColorF(1, 1, 1, 1), line); CText text = GetNewText(75, lastY, -2, 30, -1, EAlignment.Left, EStyle.Bold, "Outline", new SColorF(1, 1, 1, 1), line);
if (CDraw.GetTextBounds(text).Width < (CSettings.iRenderW - 220)) if (CDraw.GetTextBounds(text).Width < (CSettings.iRenderW - 220))
{ {
line = line + " " + paragraphs[i][e]; line = line + " " + paragraphs[i][e];
@@ -239,7 +239,7 @@ namespace Vocaluxe.Screens
base.OnShow(); base.OnShow();
//Vocaluxe-Logo //Vocaluxe-Logo
logo = new CStatic(_TexLogo, new SColorF(1, 1, 1, 1), new SRectF((CSettings.iRenderW - _TexLogo.width) / 2, -270, _TexLogo.width, _TexLogo.height, -2)); logo = GetNewStatic(_TexLogo, new SColorF(1, 1, 1, 1), new SRectF((CSettings.iRenderW - _TexLogo.width) / 2, -270, _TexLogo.width, _TexLogo.height, -2));
//Little stars for logo //Little stars for logo
int numstars = (int)(logo.Rect.W * 0.25f / 2f); int numstars = (int)(logo.Rect.W * 0.25f / 2f);
@@ -252,7 +252,7 @@ namespace Vocaluxe.Screens
//brunzel //brunzel
CCreditName CreditEntryBrunzel = new CCreditName(); CCreditName CreditEntryBrunzel = new CCreditName();
CreditEntryBrunzel.image = new CStatic(_TexNameBrunzel, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 400, 120, -4)); CreditEntryBrunzel.image = GetNewStatic(_TexNameBrunzel, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 400, 120, -4));
CreditEntryBrunzel.particleRect = new SRectF(CreditEntryBrunzel.image.Rect.X + 342, CreditEntryBrunzel.image.Rect.Y + 4, 30, 30, -5); CreditEntryBrunzel.particleRect = new SRectF(CreditEntryBrunzel.image.Rect.X + 342, CreditEntryBrunzel.image.Rect.Y + 4, 30, 30, -5);
CreditEntryBrunzel.particle = new CParticleEffect(8, new SColorF(1, 0, 0, 1), CreditEntryBrunzel.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star); CreditEntryBrunzel.particle = new CParticleEffect(8, new SColorF(1, 0, 0, 1), CreditEntryBrunzel.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star);
CreditEntryBrunzel.active = true; CreditEntryBrunzel.active = true;
@@ -261,7 +261,7 @@ namespace Vocaluxe.Screens
//Darkice //Darkice
CCreditName CreditEntryDarkice = new CCreditName(); CCreditName CreditEntryDarkice = new CCreditName();
CreditEntryDarkice.image = new CStatic(_TexNameDarkice, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 400, 120, -4)); CreditEntryDarkice.image = GetNewStatic(_TexNameDarkice, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 400, 120, -4));
CreditEntryDarkice.particleRect = new SRectF(CreditEntryDarkice.image.Rect.X + 242, CreditEntryDarkice.image.Rect.Y + 23, 30, 30, -5); CreditEntryDarkice.particleRect = new SRectF(CreditEntryDarkice.image.Rect.X + 242, CreditEntryDarkice.image.Rect.Y + 23, 30, 30, -5);
CreditEntryDarkice.particle = new CParticleEffect(8, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryDarkice.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star); CreditEntryDarkice.particle = new CParticleEffect(8, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryDarkice.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star);
CreditEntryDarkice.active = true; CreditEntryDarkice.active = true;
@@ -270,7 +270,7 @@ namespace Vocaluxe.Screens
//flokuep //flokuep
CCreditName CreditEntryFlokuep = new CCreditName(); CCreditName CreditEntryFlokuep = new CCreditName();
CreditEntryFlokuep.image = new CStatic(_TexNameFlokuep, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 400, 120, -4)); CreditEntryFlokuep.image = GetNewStatic(_TexNameFlokuep, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 400, 120, -4));
CreditEntryFlokuep.particleRect = new SRectF(CreditEntryFlokuep.image.Rect.X + 141, CreditEntryFlokuep.image.Rect.Y - 2, 30, 30, -5); CreditEntryFlokuep.particleRect = new SRectF(CreditEntryFlokuep.image.Rect.X + 141, CreditEntryFlokuep.image.Rect.Y - 2, 30, 30, -5);
CreditEntryFlokuep.particle = new CParticleEffect(8, new SColorF(1, 0, 0, 1), CreditEntryFlokuep.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star); CreditEntryFlokuep.particle = new CParticleEffect(8, new SColorF(1, 0, 0, 1), CreditEntryFlokuep.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star);
CreditEntryFlokuep.active = true; CreditEntryFlokuep.active = true;
@@ -279,7 +279,7 @@ namespace Vocaluxe.Screens
//bohning //bohning
CCreditName CreditEntryBohning = new CCreditName(); CCreditName CreditEntryBohning = new CCreditName();
CreditEntryBohning.image = new CStatic(_TexNameBohning, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 350, 110, -4)); CreditEntryBohning.image = GetNewStatic(_TexNameBohning, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 350, 110, -4));
CreditEntryBohning.particleRect = new SRectF(CreditEntryBohning.image.Rect.X + 172, CreditEntryBohning.image.Rect.Y + 16, 10, 10, -5); CreditEntryBohning.particleRect = new SRectF(CreditEntryBohning.image.Rect.X + 172, CreditEntryBohning.image.Rect.Y + 16, 10, 10, -5);
CreditEntryBohning.particle = new CParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryBohning.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star); CreditEntryBohning.particle = new CParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryBohning.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
CreditEntryBohning.active = true; CreditEntryBohning.active = true;
@@ -288,7 +288,7 @@ namespace Vocaluxe.Screens
//mesand //mesand
CCreditName CreditEntryMesand = new CCreditName(); CCreditName CreditEntryMesand = new CCreditName();
CreditEntryMesand.image = new CStatic(_TexNameMesand, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 350, 110, -4)); CreditEntryMesand.image = GetNewStatic(_TexNameMesand, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 350, 110, -4));
CreditEntryMesand.particleRect = new SRectF(CreditEntryMesand.image.Rect.X + 240, CreditEntryMesand.image.Rect.Y - 2, 10, 10, -5); CreditEntryMesand.particleRect = new SRectF(CreditEntryMesand.image.Rect.X + 240, CreditEntryMesand.image.Rect.Y - 2, 10, 10, -5);
CreditEntryMesand.particle = new CParticleEffect(4, new SColorF(1, 0, 0, 1), CreditEntryMesand.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star); CreditEntryMesand.particle = new CParticleEffect(4, new SColorF(1, 0, 0, 1), CreditEntryMesand.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
CreditEntryMesand.active = true; CreditEntryMesand.active = true;
@@ -297,7 +297,7 @@ namespace Vocaluxe.Screens
//babene03 //babene03
CCreditName CreditEntryBabene03 = new CCreditName(); CCreditName CreditEntryBabene03 = new CCreditName();
CreditEntryBabene03.image = new CStatic(_TexNameBabene03, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 350, 110, -4)); CreditEntryBabene03.image = GetNewStatic(_TexNameBabene03, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 350, 110, -4));
CreditEntryBabene03.particleRect = new SRectF(CreditEntryBabene03.image.Rect.X + 7, CreditEntryBabene03.image.Rect.Y + 4, 10, 10, -5); CreditEntryBabene03.particleRect = new SRectF(CreditEntryBabene03.image.Rect.X + 7, CreditEntryBabene03.image.Rect.Y + 4, 10, 10, -5);
CreditEntryBabene03.particle = new CParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryBabene03.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star); CreditEntryBabene03.particle = new CParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryBabene03.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
CreditEntryBabene03.active = true; CreditEntryBabene03.active = true;
@@ -306,7 +306,7 @@ namespace Vocaluxe.Screens
//pantero //pantero
CCreditName CreditEntrypantero = new CCreditName(); CCreditName CreditEntrypantero = new CCreditName();
CreditEntrypantero.image = new CStatic(_TexNamePantero, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 350, 110, -4)); CreditEntrypantero.image = GetNewStatic(_TexNamePantero, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 350, 110, -4));
CreditEntrypantero.particleRect = new SRectF(CreditEntrypantero.image.Rect.X + 140, CreditEntrypantero.image.Rect.Y + 15, 10, 10, -5); CreditEntrypantero.particleRect = new SRectF(CreditEntrypantero.image.Rect.X + 140, CreditEntrypantero.image.Rect.Y + 15, 10, 10, -5);
CreditEntrypantero.particle = new CParticleEffect(4, new SColorF(1, 0, 0, 1), CreditEntrypantero.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star); CreditEntrypantero.particle = new CParticleEffect(4, new SColorF(1, 0, 0, 1), CreditEntrypantero.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
CreditEntrypantero.active = true; CreditEntrypantero.active = true;
@@ -315,7 +315,7 @@ namespace Vocaluxe.Screens
//Pinky007 //Pinky007
CCreditName CreditEntryPinky007 = new CCreditName(); CCreditName CreditEntryPinky007 = new CCreditName();
CreditEntryPinky007.image = new CStatic(_TexNamePinky007, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 350, 110, -4)); CreditEntryPinky007.image = GetNewStatic(_TexNamePinky007, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 350, 110, -4));
CreditEntryPinky007.particleRect = new SRectF(CreditEntryPinky007.image.Rect.X + 42, CreditEntryPinky007.image.Rect.Y + 15, 10, 10, -5); CreditEntryPinky007.particleRect = new SRectF(CreditEntryPinky007.image.Rect.X + 42, CreditEntryPinky007.image.Rect.Y + 15, 10, 10, -5);
CreditEntryPinky007.particle = new CParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryPinky007.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star); CreditEntryPinky007.particle = new CParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryPinky007.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
CreditEntryPinky007.active = true; CreditEntryPinky007.active = true;
+1 -1
View File
@@ -91,7 +91,7 @@ namespace Vocaluxe.Screens
texts.AddRange(EqualizerPlayer); texts.AddRange(EqualizerPlayer);
_ThemeEqualizers = texts.ToArray(); _ThemeEqualizers = texts.ToArray();
chooseAvatarStatic = new CStatic(); chooseAvatarStatic = GetNewStatic();
chooseAvatarStatic.Visible = false; chooseAvatarStatic.Visible = false;
} }
+1 -1
View File
@@ -1354,7 +1354,7 @@ namespace Vocaluxe.Screens
TimeRect trect = new TimeRect(); TimeRect trect = new TimeRect();
trect.startBeat = Line[j].FirstNoteBeat; trect.startBeat = Line[j].FirstNoteBeat;
trect.endBeat = Line[j].EndBeat; trect.endBeat = Line[j].EndBeat;
trect.rect = new CStatic(new STexture(-1), trect.rect = GetNewStatic(new STexture(-1),
new SColorF(1f, 1f, 1f, 1f), new SColorF(1f, 1f, 1f, 1f),
new SRectF(stat.Rect.X + stat.Rect.W * ((CGame.GetTimeFromBeats(trect.startBeat, song.BPM) + song.Gap - song.Start) / TotalTime), new SRectF(stat.Rect.X + stat.Rect.W * ((CGame.GetTimeFromBeats(trect.startBeat, song.BPM) + song.Gap - song.Start) / TotalTime),
stat.Rect.Y, stat.Rect.Y,
+1 -1
View File
@@ -103,7 +103,7 @@ namespace Vocaluxe.Screens
Statics[htStatics(StaticOptionsBG)].Visible = false; Statics[htStatics(StaticOptionsBG)].Visible = false;
Playlists[htPlaylists(Playlist)].Visible = false; Playlists[htPlaylists(Playlist)].Visible = false;
DragAndDropCover = new CStatic(); DragAndDropCover = GetNewStatic();
Playlists[htPlaylists(Playlist)].Init(); Playlists[htPlaylists(Playlist)].Init();