From 99c956965e0760e0f957b0f0d2749fcaaef70251 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Thu, 13 Dec 2012 20:44:59 +0100 Subject: [PATCH] just another small step --- Vocaluxe/Base/CConfig.cs | 174 ------------- Vocaluxe/Base/CFont.cs | 24 +- Vocaluxe/Base/CGame.cs | 1 + Vocaluxe/Base/CSound.cs | 1 + Vocaluxe/Menu/CBackground.cs | 4 +- Vocaluxe/Menu/CButton.cs | 8 +- Vocaluxe/Menu/CEqualizer.cs | 4 +- Vocaluxe/Menu/CLyric.cs | 8 +- Vocaluxe/Menu/CMenu.cs | 250 ++++++++++++------- Vocaluxe/Menu/CNameSelection.cs | 17 +- Vocaluxe/Menu/CPlaylist.cs | 36 +-- Vocaluxe/Menu/CSelectSlide.cs | 7 +- Vocaluxe/Menu/CStatic.cs | 33 +-- Vocaluxe/Menu/CText.cs | 19 +- Vocaluxe/Menu/IMenu.cs | 223 ++++++++++++++++- Vocaluxe/Menu/IMenuElement.cs | 1 + Vocaluxe/Menu/SingNotes/CSingNotes.cs | 4 +- Vocaluxe/Menu/SingNotes/CSingNotesClassic.cs | 7 + Vocaluxe/Menu/SongMenu/CSongMenu.cs | 16 +- Vocaluxe/Menu/SongMenu/CSongMenuBook.cs | 7 + Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs | 8 + Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs | 24 +- Vocaluxe/Menu/SongMenu/CSongMenuList.cs | 7 + Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs | 15 +- Vocaluxe/Menu/SongMenu/ISongMenu.cs | 2 - Vocaluxe/Screens/CScreenCredits.cs | 20 +- Vocaluxe/Screens/CScreenNames.cs | 2 +- Vocaluxe/Screens/CScreenSing.cs | 2 +- Vocaluxe/Screens/CScreenSong.cs | 2 +- 29 files changed, 543 insertions(+), 383 deletions(-) diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs index 4e3d96d6..03d1e7d8 100644 --- a/Vocaluxe/Base/CConfig.cs +++ b/Vocaluxe/Base/CConfig.cs @@ -16,180 +16,6 @@ using Vocaluxe.Menu; 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 { private static XmlWriterSettings _settings = new XmlWriterSettings(); diff --git a/Vocaluxe/Base/CFont.cs b/Vocaluxe/Base/CFont.cs index 4e558b9e..20b46154 100644 --- a/Vocaluxe/Base/CFont.cs +++ b/Vocaluxe/Base/CFont.cs @@ -15,29 +15,7 @@ using Vocaluxe.Lib.Draw; using Vocaluxe.Menu; namespace Vocaluxe.Base -{ - public enum EAlignment - { - Left, - Center, - Right - } - - public enum EHAlignment - { - Top, - Center, - Bottom - } - - public enum EStyle - { - Normal, - Italic, - Bold, - BoldItalic - } - +{ class CGlyph { private float _SIZEh = 50f; diff --git a/Vocaluxe/Base/CGame.cs b/Vocaluxe/Base/CGame.cs index a6323536..0f6ffcc3 100644 --- a/Vocaluxe/Base/CGame.cs +++ b/Vocaluxe/Base/CGame.cs @@ -7,6 +7,7 @@ using System.Text; using Vocaluxe.GameModes; using Vocaluxe.Lib.Draw; using Vocaluxe.Lib.Song; +using Vocaluxe.Menu; namespace Vocaluxe.Base { diff --git a/Vocaluxe/Base/CSound.cs b/Vocaluxe/Base/CSound.cs index 7f6414d4..d77c10ad 100644 --- a/Vocaluxe/Base/CSound.cs +++ b/Vocaluxe/Base/CSound.cs @@ -5,6 +5,7 @@ using System.IO; using System.Text; using Vocaluxe.Lib.Sound; +using Vocaluxe.Menu; namespace Vocaluxe.Base { diff --git a/Vocaluxe/Menu/CBackground.cs b/Vocaluxe/Menu/CBackground.cs index 1b6b0b83..1c5a6738 100644 --- a/Vocaluxe/Menu/CBackground.cs +++ b/Vocaluxe/Menu/CBackground.cs @@ -33,6 +33,7 @@ namespace Vocaluxe.Menu public class CBackground : IMenuElement { + private Base _Base; private SThemeBackground _Theme; private bool _ThemeLoaded; @@ -44,8 +45,9 @@ namespace Vocaluxe.Menu } #region Constructors - public CBackground() + public CBackground(Base Base) { + _Base = Base; _ThemeLoaded = false; _Theme = new SThemeBackground(); diff --git a/Vocaluxe/Menu/CButton.cs b/Vocaluxe/Menu/CButton.cs index 2e018ffa..81882c8b 100644 --- a/Vocaluxe/Menu/CButton.cs +++ b/Vocaluxe/Menu/CButton.cs @@ -23,6 +23,7 @@ namespace Vocaluxe.Menu class CButton : IMenuElement { + private Base _Base; private SThemeButton _Theme; private bool _ThemeLoaded; @@ -71,16 +72,17 @@ namespace Vocaluxe.Menu return _Theme.Name; } - public CButton() + public CButton(Base Base) { + _Base = Base; _Theme = new SThemeButton(); Rect = new SRectF(); Color = new SColorF(); SColor = new SColorF(); SelText = false; - Text = new CText(); - SText = new CText(); + Text = new CText(_Base); + SText = new CText(_Base); Selected = false; Visible = true; EditMode = false; diff --git a/Vocaluxe/Menu/CEqualizer.cs b/Vocaluxe/Menu/CEqualizer.cs index 4b8c3997..55f54377 100644 --- a/Vocaluxe/Menu/CEqualizer.cs +++ b/Vocaluxe/Menu/CEqualizer.cs @@ -31,6 +31,7 @@ namespace Vocaluxe.Menu class CEqualizer : IMenuElement { + private Base _Base; private SThemeEqualizer _Theme; private bool _ThemeLoaded; @@ -54,8 +55,9 @@ namespace Vocaluxe.Menu private float[] _Bars; - public CEqualizer() + public CEqualizer(Base Base) { + _Base = Base; _Theme = new SThemeEqualizer(); _ThemeLoaded = false; diff --git a/Vocaluxe/Menu/CLyric.cs b/Vocaluxe/Menu/CLyric.cs index 21929681..59ecd87c 100644 --- a/Vocaluxe/Menu/CLyric.cs +++ b/Vocaluxe/Menu/CLyric.cs @@ -30,6 +30,7 @@ namespace Vocaluxe.Menu class CLyric : IMenuElement { + private Base _Base; private SThemeLyrics _Theme; private bool _ThemeLoaded; @@ -87,8 +88,9 @@ namespace Vocaluxe.Menu set { _Style = value; } } - public CLyric() + public CLyric(Base Base) { + _Base = Base; _Theme = new SThemeLyrics(); _ThemeLoaded = false; Color = new SColorF(); @@ -101,7 +103,7 @@ namespace Vocaluxe.Menu _H = 1f; _width = 1f; _Notes = new List(); - _Text = new CText(); + _Text = new CText(_Base); _Style = ELyricStyle.Fill; } @@ -145,7 +147,7 @@ namespace Vocaluxe.Menu { _Theme.Name = ElementName; 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; } diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index eaa8a4b3..2ff56816 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -75,15 +75,7 @@ namespace Vocaluxe.Menu protected string[] _ThemePlaylists; protected SRectF _ScreenArea; - - private IConfig _Config; - private ISettings _Settings; - private ITheme _Theme; - private IHelper _Helper; - private ILog _Log; - private IBackgroundMusic _BackgroundMusic; - private IDrawing _Draw; - private IGraphics _Graphics; + private Base _Base; 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) { - _Config = Config; - _Settings = Settings; - _Theme = Theme; - _Helper = Helper; - _Log = Log; - _BackgroundMusic = BackgroundMusic; - _Draw = Draw; - _Graphics = Graphics; - + _Base = new Base(Config, Settings, Theme, Helper, Log, BackgroundMusic, Draw, Graphics); Init(); } @@ -154,7 +138,7 @@ namespace Vocaluxe.Menu _MouseDY = 0; _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; _ThemeBackgrounds = null; @@ -172,7 +156,7 @@ namespace Vocaluxe.Menu #region ThemeHandler public virtual void LoadTheme() { - string file = Path.Combine(_Theme.GetThemeScreensPath(), _ThemeName + ".xml"); + string file = Path.Combine(_Base.Theme.GetThemeScreensPath(), _ThemeName + ".xml"); XPathDocument xPathDoc = null; XPathNavigator navigator = null; @@ -193,14 +177,14 @@ namespace Vocaluxe.Menu if (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; if (loaded) VersionCheck = CheckVersion(_ScreenVersion, navigator); - int SkinIndex = _Theme.GetSkinIndex(); + int SkinIndex = _Base.Theme.GetSkinIndex(); if (loaded && VersionCheck && SkinIndex != -1) { @@ -210,14 +194,14 @@ namespace Vocaluxe.Menu { 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)) { _htBackgrounds.Add(_ThemeBackgrounds[i], AddBackground(background)); } 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++) { - CStatic stat = new CStatic(); + CStatic stat = new CStatic(_Base); if (stat.LoadTheme("//root/" + _ThemeName, _ThemeStatics[i], navigator, SkinIndex)) { _htStatics.Add(_ThemeStatics[i], AddStatic(stat)); } 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++) { - CText text = new CText(); + CText text = new CText(_Base); if (text.LoadTheme("//root/" + _ThemeName, _ThemeTexts[i], navigator, SkinIndex)) { _htTexts.Add(_ThemeTexts[i], AddText(text)); } 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++) { - CButton button = new CButton(); + CButton button = new CButton(_Base); if (button.LoadTheme("//root/" + _ThemeName, _ThemeButtons[i], navigator, SkinIndex)) { _htButtons.Add(_ThemeButtons[i], AddButton(button)); } 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++) { - CSelectSlide slide = new CSelectSlide(); + CSelectSlide slide = new CSelectSlide(_Base); if (slide.LoadTheme("//root/" + _ThemeName, _ThemeSelectSlides[i], navigator, SkinIndex)) { _htSelectSlides.Add(_ThemeSelectSlides[i], AddSelectSlide(slide)); } 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++) { - CSongMenu sm = new CSongMenu(); + CSongMenu sm = new CSongMenu(_Base); if (sm.LoadTheme("//root/" + _ThemeName, _ThemeSongMenus[i], navigator, SkinIndex)) { _htSongMenus.Add(_ThemeSongMenus[i], AddSongMenu(sm)); } 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++) { - CLyric lyric = new CLyric(); + CLyric lyric = new CLyric(_Base); if (lyric.LoadTheme("//root/" + _ThemeName, _ThemeLyrics[i], navigator, SkinIndex)) { _htLyrics.Add(_ThemeLyrics[i], AddLyric(lyric)); } 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++) { - CSingNotes notes = new CSingNotesClassic(); + CSingNotes notes = new CSingNotesClassic(_Base); if (notes.LoadTheme("//root/" + _ThemeName, _ThemeSingNotes[i], navigator, SkinIndex)) { _htSingNotes.Add(_ThemeSingNotes[i], AddSingNote(notes)); } 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++) { - CNameSelection nsel = new CNameSelection(); + CNameSelection nsel = new CNameSelection(_Base); if (nsel.LoadTheme("//root/" + _ThemeName, _ThemeNameSelections[i], navigator, SkinIndex)) { _htNameSelections.Add(_ThemeNameSelections[i], AddNameSelection(nsel)); } 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++) { - CEqualizer eq = new CEqualizer(); + CEqualizer eq = new CEqualizer(_Base); if (eq.LoadTheme("//root/" + _ThemeName, _ThemeEqualizers[i], navigator, SkinIndex)) { _htEqualizers.Add(_ThemeEqualizers[i], AddEqualizer(eq)); } 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++) { - CPlaylist pls = new CPlaylist(); + CPlaylist pls = new CPlaylist(_Base); if (pls.LoadTheme("//root/" + _ThemeName, _ThemePlaylists[i], navigator, SkinIndex)) { _htPlaylists.Add(_ThemePlaylists[i], AddPlaylist(pls)); } 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.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); writer.WriteStartDocument(); @@ -660,6 +644,74 @@ namespace Vocaluxe.Menu #endregion GetLists #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 public CButton[] Buttons { @@ -759,7 +811,7 @@ namespace Vocaluxe.Menu } 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; } } @@ -772,7 +824,7 @@ namespace Vocaluxe.Menu } 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; } } @@ -785,7 +837,7 @@ namespace Vocaluxe.Menu } 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; } } @@ -798,7 +850,7 @@ namespace Vocaluxe.Menu } 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; } } @@ -811,7 +863,7 @@ namespace Vocaluxe.Menu } 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; } } @@ -824,7 +876,7 @@ namespace Vocaluxe.Menu } 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; } } @@ -837,7 +889,7 @@ namespace Vocaluxe.Menu } 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; } } @@ -850,7 +902,7 @@ namespace Vocaluxe.Menu } 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; } } @@ -863,7 +915,7 @@ namespace Vocaluxe.Menu } 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; } } @@ -876,7 +928,7 @@ namespace Vocaluxe.Menu } 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; } } @@ -889,7 +941,7 @@ namespace Vocaluxe.Menu } 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; } } @@ -899,7 +951,7 @@ namespace Vocaluxe.Menu #region MenuHandler public virtual bool HandleInput(KeyEvent KeyEvent) { - if (!_Settings.IsTabNavigation()) + if (!_Base.Settings.IsTabNavigation()) { if (KeyEvent.Key == Keys.Left) { @@ -938,25 +990,25 @@ namespace Vocaluxe.Menu if (KeyEvent.Key == Keys.Right) NextElement(); } - if (_BackgroundMusic.IsDisabled()) + if (_Base.BackgroundMusic.IsDisabled()) { 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)) - _Config.SetBackgroundMusicVolume(_Config.GetBackgroundMusicVolume() - 5); + _Base.Config.SetBackgroundMusicVolume(_Base.Config.GetBackgroundMusicVolume() - 5); else if (KeyEvent.Key == Keys.MediaNextTrack) - _BackgroundMusic.Next(); + _Base.BackgroundMusic.Next(); else if (KeyEvent.Key == Keys.MediaPreviousTrack) - _BackgroundMusic.Previous(); + _Base.BackgroundMusic.Previous(); else if (KeyEvent.Key == Keys.MediaPlayPause) { - if (_BackgroundMusic.IsPlaying()) - _BackgroundMusic.Pause(); + if (_Base.BackgroundMusic.IsPlaying()) + _Base.BackgroundMusic.Pause(); else - _BackgroundMusic.Play(); + _Base.BackgroundMusic.Play(); } - _BackgroundMusic.ApplyVolume(); + _Base.BackgroundMusic.ApplyVolume(); } return true; @@ -1367,10 +1419,10 @@ namespace Vocaluxe.Menu public void SelectByMouse(int x, int y) { - float z = _Settings.GetZFar(); + float z = _Base.Settings.GetZFar(); 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])) { @@ -1421,7 +1473,7 @@ namespace Vocaluxe.Menu return true; break; 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)) return true; break; @@ -1472,7 +1524,7 @@ namespace Vocaluxe.Menu case EType.TPlaylist: return _Playlists[interact.Num].Rect.Z; } - return _Settings.GetZFar(); + return _Base.Settings.GetZFar(); } private float _GetZValue(int interaction) @@ -1507,13 +1559,13 @@ namespace Vocaluxe.Menu return _Playlists[_Interactions[interaction].Num].Rect.Z; } - return _Settings.GetZFar(); + return _Base.Settings.GetZFar(); } private void _NextInteraction() { _UnsetSelected(); - if (_Settings.GetGameState() != EGameState.EditTheme) + if (_Base.Settings.GetGameState() != EGameState.EditTheme) { bool found = false; int start = _Selection; @@ -1540,7 +1592,7 @@ namespace Vocaluxe.Menu private void _PrevInteraction() { _UnsetSelected(); - if (_Settings.GetGameState() != EGameState.EditTheme) + if (_Base.Settings.GetGameState() != EGameState.EditTheme) { bool found = false; int start = _Selection; @@ -1687,13 +1739,13 @@ namespace Vocaluxe.Menu switch (Key.Key) { 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; case Keys.Down: actualRect = new SRectF(actualRect.X, 0, 1, 1, actualRect.Z); break; 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; case Keys.Right: 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 += "Current screen version is " + Version.ToString(); - _Log.LogError(msg); + _Base.Log.LogError(msg); } return false; } @@ -2221,47 +2273,71 @@ namespace Vocaluxe.Menu string value = String.Empty; // Backgrounds - CBackground background = new CBackground(); + CBackground background = new CBackground(_Base); int i = 1; while (background.LoadTheme("//root/" + _ThemeName, "Background" + i.ToString(), navigator, SkinIndex)) { AddBackground(background); - background = new CBackground(); + background = new CBackground(_Base); i++; } // Statics - CStatic stat = new CStatic(); + CStatic stat = new CStatic(_Base); i = 1; while (stat.LoadTheme("//root/" + _ThemeName, "Static" + i.ToString(), navigator, SkinIndex)) { AddStatic(stat); - stat = new CStatic(); + stat = new CStatic(_Base); i++; } // Texts - CText text = new CText(); + CText text = new CText(_Base); i = 1; while (text.LoadTheme("//root/" + _ThemeName, "Text" + i.ToString(), navigator, SkinIndex)) { AddText(text); - text = new CText(); + text = new CText(_Base); i++; } } private void ReloadThemeEditMode() { - _Theme.UnloadSkins(); - _Theme.ListSkins(); - _Theme.LoadSkins(); - _Theme.LoadTheme(); - _Graphics.ReloadTheme(); + _Base.Theme.UnloadSkins(); + _Base.Theme.ListSkins(); + _Base.Theme.LoadSkins(); + _Base.Theme.LoadTheme(); + _Base.Graphics.ReloadTheme(); OnShow(); OnShowFinish(); } #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; + } + } } diff --git a/Vocaluxe/Menu/CNameSelection.cs b/Vocaluxe/Menu/CNameSelection.cs index 5d426a89..51ae095f 100644 --- a/Vocaluxe/Menu/CNameSelection.cs +++ b/Vocaluxe/Menu/CNameSelection.cs @@ -27,15 +27,16 @@ namespace Vocaluxe.Menu class CNameSelection : IMenuElement { - class CTile { + private Base _Base; public int PlayerNr; public CStatic Avatar; public CText Name; - public CTile() + public CTile(Base Base) { + _Base = Base; } public CTile(CStatic av, CText tex, int pl) @@ -46,6 +47,7 @@ namespace Vocaluxe.Menu } } + private Base _Base; private SThemeNameSelection _Theme; private bool _ThemeLoaded; @@ -85,8 +87,9 @@ namespace Vocaluxe.Menu private CStatic PlayerSelector; - public CNameSelection() + public CNameSelection(Base Base) { + _Base = Base; _Theme = new SThemeNameSelection(); _Tiles = new List(); @@ -97,7 +100,7 @@ namespace Vocaluxe.Menu { PrepareTiles(); - PlayerSelector = new CStatic(); + PlayerSelector = new CStatic(_Base); PlayerSelector.Texture = _TextureTileSelected; PlayerSelector.Rect = new SRectF(0, 0, (_TileW + 6), (_TileH + 6), (Rect.Z - 0.5f)); PlayerSelector.Visible = false; @@ -466,7 +469,7 @@ namespace Vocaluxe.Menu } } - return new CStatic(); + return new CStatic(_Base); } public void UnloadTextures() @@ -501,8 +504,8 @@ namespace Vocaluxe.Menu 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); - CStatic tileStatic = new CStatic(_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, ""); + CStatic tileStatic = new CStatic(_Base, _TextureEmptyTile, ColorEmptyTile, rect); + 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)); } } diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 629ededb..0cad525c 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -58,18 +58,21 @@ namespace Vocaluxe.Menu class PlaylistElement { + Base _Base; public CStatic Cover; public CStatic Background; public CText Text1; public CSelectSlide SelectSlide; public int Content; - public PlaylistElement() + public PlaylistElement(Base Base) { + _Base = Base; } public PlaylistElement(PlaylistElement pe) { + _Base = pe._Base; Cover = new CStatic(pe.Cover); Background = new CStatic(pe.Background); Text1 = new CText(pe.Text1); @@ -110,6 +113,7 @@ namespace Vocaluxe.Menu } } + private Base _Base; private SThemePlaylist _Theme; private bool _ThemeLoaded; @@ -158,7 +162,7 @@ namespace Vocaluxe.Menu public int Offset = 0; public int CurrentPlaylistElement = -1; - private PlaylistElement ChangeOrderElement = new PlaylistElement(); + private PlaylistElement ChangeOrderElement; private int ChangeOrderSource = -1; private int OldMousePosX = 0; private int OldMousePosY = 0; @@ -167,19 +171,20 @@ namespace Vocaluxe.Menu //private static - public CPlaylist() + public CPlaylist(Base Base) { + _Base = Base; _Theme = new SThemePlaylist(); - _Theme.Text1 = new CText(); - _Theme.StaticCover = new CStatic(); - _Theme.StaticPlaylistFooter = new CStatic(); - _Theme.StaticPlaylistHeader = new CStatic(); - _Theme.ButtonPlaylistName = new CButton(); - _Theme.ButtonPlaylistClose = new CButton(); - _Theme.ButtonPlaylistDelete = new CButton(); - _Theme.ButtonPlaylistSave = new CButton(); - _Theme.ButtonPlaylistSing = new CButton(); - _Theme.SelectSlideGameMode = new CSelectSlide(); + _Theme.Text1 = new CText(_Base); + _Theme.StaticCover = new CStatic(_Base); + _Theme.StaticPlaylistFooter = new CStatic(_Base); + _Theme.StaticPlaylistHeader = new CStatic(_Base); + _Theme.ButtonPlaylistName = new CButton(_Base); + _Theme.ButtonPlaylistClose = new CButton(_Base); + _Theme.ButtonPlaylistDelete = new CButton(_Base); + _Theme.ButtonPlaylistSave = new CButton(_Base); + _Theme.ButtonPlaylistSing = new CButton(_Base); + _Theme.SelectSlideGameMode = new CSelectSlide(_Base); CompleteRect = new SRectF(); Rect = new SRectF(); @@ -190,6 +195,7 @@ namespace Vocaluxe.Menu PlaylistElementContents = new List(); _Interactions = new CObjectInteractions(); + ChangeOrderElement = new PlaylistElement(_Base); Visible = false; Selected = false; @@ -1093,9 +1099,9 @@ namespace Vocaluxe.Menu 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.Rect.Y += Rect.Y + (i * _Theme.EntryHeight); diff --git a/Vocaluxe/Menu/CSelectSlide.cs b/Vocaluxe/Menu/CSelectSlide.cs index 0d51f358..b67aa31e 100644 --- a/Vocaluxe/Menu/CSelectSlide.cs +++ b/Vocaluxe/Menu/CSelectSlide.cs @@ -40,6 +40,7 @@ namespace Vocaluxe.Menu class CSelectSlide : IMenuElement, ICloneable { + private Base _Base; private SThemeSelectSlide _Theme; private bool _ThemeLoaded; @@ -141,8 +142,9 @@ namespace Vocaluxe.Menu } } - public CSelectSlide() + public CSelectSlide(Base Base) { + _Base = Base; _Theme = new SThemeSelectSlide(); _ThemeLoaded = false; @@ -169,6 +171,7 @@ namespace Vocaluxe.Menu public CSelectSlide(CSelectSlide slide) { + _Base = slide._Base; _Theme = new SThemeSelectSlide(); _Theme.TextureArrowLeftName = slide._Theme.TextureArrowLeftName; @@ -763,7 +766,7 @@ namespace Vocaluxe.Menu _ValueBounds.Clear(); 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); if (i + offset == _Selection) { diff --git a/Vocaluxe/Menu/CStatic.cs b/Vocaluxe/Menu/CStatic.cs index 02c695d4..ef23ed45 100644 --- a/Vocaluxe/Menu/CStatic.cs +++ b/Vocaluxe/Menu/CStatic.cs @@ -5,9 +5,6 @@ using System.Text; using System.Xml; using System.Xml.XPath; -using Vocaluxe.Base; -using Vocaluxe.Lib.Draw; - namespace Vocaluxe.Menu { struct SThemeStatic @@ -19,6 +16,8 @@ namespace Vocaluxe.Menu class CStatic : IMenuElement { + private Base _Base; + private SThemeStatic _Theme; private bool _ThemeLoaded; @@ -35,7 +34,7 @@ namespace Vocaluxe.Menu if (_Texture.index != -1) return _Texture; else - return CTheme.GetSkinTexture(_Theme.TextureName); + return _Base.Theme.GetSkinTexture(_Theme.TextureName); } set { _Texture = value; } @@ -55,8 +54,9 @@ namespace Vocaluxe.Menu public EAspect Aspect = EAspect.Stretch; - public CStatic() + public CStatic(Base Base) { + _Base = Base; _Theme = new SThemeStatic(); _ThemeLoaded = false; @@ -74,6 +74,7 @@ namespace Vocaluxe.Menu public CStatic(CStatic s) { + _Base = s._Base; _Theme = new SThemeStatic(); _ThemeLoaded = false; @@ -89,8 +90,9 @@ namespace Vocaluxe.Menu 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(); _ThemeLoaded = false; @@ -106,8 +108,9 @@ namespace Vocaluxe.Menu 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.TextureName = TextureSkinName; _ThemeLoaded = false; @@ -139,7 +142,7 @@ namespace Vocaluxe.Menu 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 { @@ -239,7 +242,7 @@ namespace Vocaluxe.Menu if (_Texture.index != -1) texture = _Texture; else - texture = CTheme.GetSkinTexture(_Theme.TextureName); + texture = _Base.Theme.GetSkinTexture(_Theme.TextureName); SRectF bounds = new SRectF( 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); - 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) { - 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() { if (_Theme.ColorName != String.Empty) - Color = CTheme.GetColor(_Theme.ColorName); + Color = _Base.Theme.GetColor(_Theme.ColorName); } public void ReloadTextures() diff --git a/Vocaluxe/Menu/CText.cs b/Vocaluxe/Menu/CText.cs index 478dd0c2..ea203c38 100644 --- a/Vocaluxe/Menu/CText.cs +++ b/Vocaluxe/Menu/CText.cs @@ -37,8 +37,9 @@ namespace Vocaluxe.Menu } } - class CText : IMenuElement + public class CText : IMenuElement { + private Base _Base; private SThemeText _Theme; private bool _ThemeLoaded; @@ -221,8 +222,9 @@ namespace Vocaluxe.Menu public float Alpha = 1f; - public CText() + public CText(Base Base) { + _Base = Base; _Theme = new SThemeText(); _ThemeLoaded = false; _ButtonText = false; @@ -252,6 +254,7 @@ namespace Vocaluxe.Menu public CText(CText text) { + _Base = text._Base; _Theme = new SThemeText(); _ThemeLoaded = false; _ButtonText = false; @@ -281,8 +284,9 @@ namespace Vocaluxe.Menu 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(); _ThemeLoaded = false; _ButtonText = false; @@ -318,8 +322,9 @@ namespace Vocaluxe.Menu 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(); _ThemeLoaded = false; _ButtonText = false; @@ -353,8 +358,9 @@ namespace Vocaluxe.Menu 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(); _ThemeLoaded = false; _ButtonText = false; @@ -390,8 +396,9 @@ namespace Vocaluxe.Menu 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(); _ThemeLoaded = false; _ButtonText = false; diff --git a/Vocaluxe/Menu/IMenu.cs b/Vocaluxe/Menu/IMenu.cs index 192a12b5..6538f979 100644 --- a/Vocaluxe/Menu/IMenu.cs +++ b/Vocaluxe/Menu/IMenu.cs @@ -43,13 +43,15 @@ namespace Vocaluxe.Menu void ProcessMouseMove(int x, int y); } - interface IConfig + public interface IConfig { void SetBackgroundMusicVolume(int NewVolume); int GetBackgroundMusicVolume(); + + ESongMenu GetSongMenuType(); } - interface ISettings + public interface ISettings { int GetRenderW(); int GetRenderH(); @@ -61,10 +63,14 @@ namespace Vocaluxe.Menu EGameState GetGameState(); } - interface ITheme + public interface ITheme { string GetThemeScreensPath(); int GetSkinIndex(); + STexture GetSkinTexture(string TextureName); + + SColorF GetColor(string ColorName); + bool GetColor(string ColorName, int SkinIndex, ref SColorF Color); void UnloadSkins(); void ListSkins(); @@ -72,11 +78,11 @@ namespace Vocaluxe.Menu void LoadTheme(); } - interface IHelper + public interface IHelper { } - interface IBackgroundMusic + public interface IBackgroundMusic { bool IsDisabled(); bool IsPlaying(); @@ -89,17 +95,22 @@ namespace Vocaluxe.Menu void ApplyVolume(); } - interface IDrawing + public interface IDrawing { 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(); } - interface ILog + public interface ILog { void LogError(string ErrorText); } @@ -347,4 +358,200 @@ namespace Vocaluxe.Menu } } #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 + } } diff --git a/Vocaluxe/Menu/IMenuElement.cs b/Vocaluxe/Menu/IMenuElement.cs index 152e4ec1..f93a5acd 100644 --- a/Vocaluxe/Menu/IMenuElement.cs +++ b/Vocaluxe/Menu/IMenuElement.cs @@ -9,6 +9,7 @@ namespace Vocaluxe.Menu interface IMenuElement { string GetThemeName(); + bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex); bool SaveTheme(XmlWriter writer); diff --git a/Vocaluxe/Menu/SingNotes/CSingNotes.cs b/Vocaluxe/Menu/SingNotes/CSingNotes.cs index 244d380b..dc442671 100644 --- a/Vocaluxe/Menu/SingNotes/CSingNotes.cs +++ b/Vocaluxe/Menu/SingNotes/CSingNotes.cs @@ -46,6 +46,7 @@ namespace Vocaluxe.Menu.SingNotes abstract class CSingNotes : ISingNotes, IMenuElement { + private Base _Base; private SThemeSingBar _Theme; private bool _ThemeLoaded; @@ -66,8 +67,9 @@ namespace Vocaluxe.Menu.SingNotes set { _BarPos = value; } } - public CSingNotes() + public CSingNotes(Base Base) { + _Base = Base; _Theme = new SThemeSingBar(); _ThemeLoaded = false; diff --git a/Vocaluxe/Menu/SingNotes/CSingNotesClassic.cs b/Vocaluxe/Menu/SingNotes/CSingNotesClassic.cs index 93698740..37827b96 100644 --- a/Vocaluxe/Menu/SingNotes/CSingNotesClassic.cs +++ b/Vocaluxe/Menu/SingNotes/CSingNotesClassic.cs @@ -6,5 +6,12 @@ namespace Vocaluxe.Menu.SingNotes { class CSingNotesClassic : CSingNotes { + private Base _Base; + + public CSingNotesClassic(Base Base) + : base(Base) + { + _Base = Base; + } } } diff --git a/Vocaluxe/Menu/SongMenu/CSongMenu.cs b/Vocaluxe/Menu/SongMenu/CSongMenu.cs index dbb09697..3c24d2f1 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenu.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenu.cs @@ -4,25 +4,27 @@ using System.Text; using System.Xml; using System.Xml.XPath; -using Vocaluxe.Base; -using Vocaluxe.Lib.Draw; +using Vocaluxe.Menu; using Vocaluxe.PartyModes; namespace Vocaluxe.Menu.SongMenu { class CSongMenu : ISongMenu { + private Base _Base; + private ISongMenu _SongMenu; private ESongMenu _Type; - public CSongMenu() + public CSongMenu(Base Base) { + _Base = Base; CreateSongMenu(); } public void UpdateSongMenuType() { - if (_Type != CConfig.SongMenu) + if (_Type != _Base.Config.GetSongMenuType()) CreateSongMenu(); } @@ -205,7 +207,7 @@ namespace Vocaluxe.Menu.SongMenu _SongMenu.OnHide(); } - switch (CConfig.SongMenu) + switch (_Base.Config.GetSongMenuType()) { //case ESongMenu.TR_CONFIG_LIST: // _SongMenu = new CSongMenuList(); @@ -216,7 +218,7 @@ namespace Vocaluxe.Menu.SongMenu // break; case ESongMenu.TR_CONFIG_TILE_BOARD: - _SongMenu = new CSongMenuTileBoard(); + _SongMenu = new CSongMenuTileBoard(_Base); break; //case ESongMenu.TR_CONFIG_BOOK: @@ -224,7 +226,7 @@ namespace Vocaluxe.Menu.SongMenu // break; } - _Type = CConfig.SongMenu; + _Type = _Base.Config.GetSongMenuType(); } } } diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuBook.cs b/Vocaluxe/Menu/SongMenu/CSongMenuBook.cs index ed6e433b..ddf6d30d 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuBook.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuBook.cs @@ -6,5 +6,12 @@ namespace Vocaluxe.Menu.SongMenu { class CSongMenuBook : CSongMenuFramework { + new private Base _Base; + + public CSongMenuBook(Base Base) + : base(Base) + { + _Base = Base; + } } } diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs b/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs index b417d791..cb54d99e 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs @@ -12,6 +12,7 @@ namespace Vocaluxe.Menu.SongMenu { class CSongMenuDreidel : CSongMenuFramework { + new private Base _Base; /* private SRectF _ScrollRect; private CStatic _CoverBig; @@ -31,6 +32,13 @@ namespace Vocaluxe.Menu.SongMenu return _actualSelection; } */ + + public CSongMenuDreidel(Base Base) + : base(Base) + { + _Base = Base; + } + public override void Init() { base.Init(); diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs index deaa6f5c..10de52b5 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs @@ -93,6 +93,7 @@ namespace Vocaluxe.Menu.SongMenu abstract class CSongMenuFramework : ISongMenu { + protected Base _Base; protected SThemeSongMenu _Theme; private bool _ThemeLoaded; @@ -234,20 +235,21 @@ namespace Vocaluxe.Menu.SongMenu _Visible = Visible; } - public CSongMenuFramework() + public CSongMenuFramework(Base Base) { + _Base = Base; _Theme = new SThemeSongMenu(); - _Theme.songMenuTileBoard.TextArtist = new CText(); - _Theme.songMenuTileBoard.TextTitle = new CText(); - _Theme.songMenuTileBoard.TextSongLength = new CText(); + _Theme.songMenuTileBoard.TextArtist = new CText(_Base); + _Theme.songMenuTileBoard.TextTitle = new CText(_Base); + _Theme.songMenuTileBoard.TextSongLength = new CText(_Base); - _Theme.songMenuTileBoard.StaticCoverBig = new CStatic(); - _Theme.songMenuTileBoard.StaticTextBG = new CStatic(); - _Theme.songMenuTileBoard.StaticDuetIcon = new CStatic(); - _Theme.songMenuTileBoard.StaticVideoIcon = new CStatic(); - _Theme.songMenuTileBoard.StaticMedleyCalcIcon = new CStatic(); - _Theme.songMenuTileBoard.StaticMedleyTagIcon = new CStatic(); + _Theme.songMenuTileBoard.StaticCoverBig = new CStatic(_Base); + _Theme.songMenuTileBoard.StaticTextBG = new CStatic(_Base); + _Theme.songMenuTileBoard.StaticDuetIcon = new CStatic(_Base); + _Theme.songMenuTileBoard.StaticVideoIcon = new CStatic(_Base); + _Theme.songMenuTileBoard.StaticMedleyCalcIcon = new CStatic(_Base); + _Theme.songMenuTileBoard.StaticMedleyTagIcon = new CStatic(_Base); _ThemeLoaded = false; } @@ -540,7 +542,7 @@ namespace Vocaluxe.Menu.SongMenu public virtual CStatic GetSelectedSongCover() { - return new CStatic(); + return new CStatic(_Base); } public virtual int GetSelectedCategory() diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuList.cs b/Vocaluxe/Menu/SongMenu/CSongMenuList.cs index c7dc8a0f..b6b2ab49 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuList.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuList.cs @@ -6,5 +6,12 @@ namespace Vocaluxe.Menu.SongMenu { class CSongMenuList : CSongMenuFramework { + new private Base _Base; + + public CSongMenuList(Base Base) + : base(Base) + { + _Base = Base; + } } } diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs index ad0c44b6..0b0880d8 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs @@ -13,6 +13,7 @@ namespace Vocaluxe.Menu.SongMenu { class CSongMenuTileBoard : CSongMenuFramework { + new private Base _Base; private SRectF _ScrollRect; private List _Tiles; private CStatic _CoverBig; @@ -43,6 +44,12 @@ namespace Vocaluxe.Menu.SongMenu private bool _SmallView = false; + public CSongMenuTileBoard(Base Base) + : base(Base) + { + _Base = Base; + } + public override int GetActualSelection() { return _actualSelection; @@ -74,7 +81,7 @@ namespace Vocaluxe.Menu.SongMenu { SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW), _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); } } @@ -518,7 +525,7 @@ namespace Vocaluxe.Menu.SongMenu if (tile.Selected) return new CStatic(tile); } - return new CStatic(); + return new CStatic(_Base); } 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), _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); } } @@ -797,7 +804,7 @@ namespace Vocaluxe.Menu.SongMenu { SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW), _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); } } diff --git a/Vocaluxe/Menu/SongMenu/ISongMenu.cs b/Vocaluxe/Menu/SongMenu/ISongMenu.cs index 8a63a8cb..4017ec3a 100644 --- a/Vocaluxe/Menu/SongMenu/ISongMenu.cs +++ b/Vocaluxe/Menu/SongMenu/ISongMenu.cs @@ -2,8 +2,6 @@ using System.Collections.Generic; using System.Text; -using Vocaluxe.Base; -using Vocaluxe.Lib.Draw; using Vocaluxe.PartyModes; namespace Vocaluxe.Menu.SongMenu diff --git a/Vocaluxe/Screens/CScreenCredits.cs b/Vocaluxe/Screens/CScreenCredits.cs index 582a26bc..e8a07386 100644 --- a/Vocaluxe/Screens/CScreenCredits.cs +++ b/Vocaluxe/Screens/CScreenCredits.cs @@ -148,7 +148,7 @@ namespace Vocaluxe.Screens if (paragraphs[i][e] != null) { 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)) { line = line + " " + paragraphs[i][e]; @@ -239,7 +239,7 @@ namespace Vocaluxe.Screens base.OnShow(); //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 int numstars = (int)(logo.Rect.W * 0.25f / 2f); @@ -252,7 +252,7 @@ namespace Vocaluxe.Screens //brunzel 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.particle = new CParticleEffect(8, new SColorF(1, 0, 0, 1), CreditEntryBrunzel.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star); CreditEntryBrunzel.active = true; @@ -261,7 +261,7 @@ namespace Vocaluxe.Screens //Darkice 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.particle = new CParticleEffect(8, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryDarkice.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star); CreditEntryDarkice.active = true; @@ -270,7 +270,7 @@ namespace Vocaluxe.Screens //flokuep 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.particle = new CParticleEffect(8, new SColorF(1, 0, 0, 1), CreditEntryFlokuep.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star); CreditEntryFlokuep.active = true; @@ -279,7 +279,7 @@ namespace Vocaluxe.Screens //bohning 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.particle = new CParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryBohning.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star); CreditEntryBohning.active = true; @@ -288,7 +288,7 @@ namespace Vocaluxe.Screens //mesand 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.particle = new CParticleEffect(4, new SColorF(1, 0, 0, 1), CreditEntryMesand.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star); CreditEntryMesand.active = true; @@ -297,7 +297,7 @@ namespace Vocaluxe.Screens //babene03 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.particle = new CParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryBabene03.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star); CreditEntryBabene03.active = true; @@ -306,7 +306,7 @@ namespace Vocaluxe.Screens //pantero 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.particle = new CParticleEffect(4, new SColorF(1, 0, 0, 1), CreditEntrypantero.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star); CreditEntrypantero.active = true; @@ -315,7 +315,7 @@ namespace Vocaluxe.Screens //Pinky007 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.particle = new CParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryPinky007.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star); CreditEntryPinky007.active = true; diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 5099dc36..2057049c 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -91,7 +91,7 @@ namespace Vocaluxe.Screens texts.AddRange(EqualizerPlayer); _ThemeEqualizers = texts.ToArray(); - chooseAvatarStatic = new CStatic(); + chooseAvatarStatic = GetNewStatic(); chooseAvatarStatic.Visible = false; } diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 2e001911..7599d515 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -1354,7 +1354,7 @@ namespace Vocaluxe.Screens TimeRect trect = new TimeRect(); trect.startBeat = Line[j].FirstNoteBeat; 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 SRectF(stat.Rect.X + stat.Rect.W * ((CGame.GetTimeFromBeats(trect.startBeat, song.BPM) + song.Gap - song.Start) / TotalTime), stat.Rect.Y, diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 2cee62d6..b6fab24a 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -103,7 +103,7 @@ namespace Vocaluxe.Screens Statics[htStatics(StaticOptionsBG)].Visible = false; Playlists[htPlaylists(Playlist)].Visible = false; - DragAndDropCover = new CStatic(); + DragAndDropCover = GetNewStatic(); Playlists[htPlaylists(Playlist)].Init();