コード例 #1
0
 public CSongMenuDetails(SThemeSongMenu theme, int partyModeID) : base(theme, partyModeID)
 {
     _Artist           = new CText(_Theme.SongMenuDetails.TextArtist, _PartyModeID);
     _Title            = new CText(_Theme.SongMenuDetails.TextTitle, _PartyModeID);
     _SongLength       = new CText(_Theme.SongMenuDetails.TextSongLength, _PartyModeID);
     _TileBleedCount   = _Theme.SongMenuDetails.TileBleedCount;
     _TileSpacing      = _Theme.SongMenuDetails.TileSpacing;
     _TileTextIndent   = _Theme.SongMenuDetails.TileTextIndent;
     _Tile             = new CStatic(_Theme.SongMenuDetails.StaticTile, _PartyModeID);
     _TileSelected     = new CStatic(_Theme.SongMenuDetails.StaticTileSelected, _PartyModeID);
     _ScrollBar        = new CStatic(_Theme.SongMenuDetails.StaticScrollBar, _PartyModeID);
     _ScrollBarPointer = new CStatic(_Theme.SongMenuDetails.StaticScrollBarPointer, _PartyModeID);
     _Artist           = new CText(_Theme.SongMenuDetails.TextArtist, _PartyModeID);
     _Title            = new CText(_Theme.SongMenuDetails.TextTitle, _PartyModeID);
     _SongLength       = new CText(_Theme.SongMenuDetails.TextSongLength, _PartyModeID);
     _VideoBG          = new CStatic(_Theme.SongMenuDetails.StaticVideoBG, _PartyModeID);
     _BigCover         = new CStatic(_Theme.SongMenuDetails.StaticBigCover, _PartyModeID);
     _TextBG           = new CStatic(_Theme.SongMenuDetails.StaticTextBG, _PartyModeID);
     _DuetIcon         = new CStatic(_Theme.SongMenuDetails.StaticDuetIcon, _PartyModeID);
     _VideoIcon        = new CStatic(_Theme.SongMenuDetails.StaticVideoIcon, _PartyModeID);
     _MedleyCalcIcon   = new CStatic(_Theme.SongMenuDetails.StaticMedleyCalcIcon, _PartyModeID);
     _MedleyTagIcon    = new CStatic(_Theme.SongMenuDetails.StaticMedleyTagIcon, _PartyModeID);
     _SubElements.AddRange(new IMenuElement[] { _Artist, _Title, _SongLength, _DuetIcon, _VideoIcon, _MedleyCalcIcon, _MedleyTagIcon });
     _DragTimer = new Stopwatch();
 }
コード例 #2
0
        public override void LoadTheme()
        {
            base.LoadTheme();
            SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible         = false;
            SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible  = false;
            SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false;
            Buttons[htButtons(ButtonOptionsClose)].Visible          = false;
            Buttons[htButtons(ButtonOptionsSing)].Visible           = false;
            Buttons[htButtons(ButtonOptionsPlaylist)].Visible       = false;
            Buttons[htButtons(ButtonOptionsRandom)].Visible         = false;
            Buttons[htButtons(ButtonOptionsRandomCategory)].Visible = false;
            Buttons[htButtons(ButtonOptionsSingAll)].Visible        = false;
            Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = false;
            Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible   = false;
            Texts[htTexts(TextOptionsTitle)].Visible    = false;
            Statics[htStatics(StaticOptionsBG)].Visible = false;
            Playlists[htPlaylists(Playlist)].Visible    = false;

            DragAndDropCover = new CStatic();

            Playlists[htPlaylists(Playlist)].Init();

            _AvailableGameModes.Clear();

            ApplyVolume();
        }
コード例 #3
0
ファイル: CScreenSing.cs プロジェクト: zhaozw/Vocaluxe
        private void PrepareTimeLine()
        {
            CStatic stat = Statics[htStatics(StaticTimeLine)];

            switch (CConfig.TimerLook)
            {
            case ETimerLook.TR_CONFIG_TIMERLOOK_NORMAL:
                _TimeLineRect = new SRectF(stat.Rect.X, stat.Rect.Y, 0f, stat.Rect.H, stat.Rect.Z);
                Statics[htStatics(StaticTimePointer)].Visible = false;
                break;

            case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED:
                _TimeRects.Clear();
                Statics[htStatics(StaticTimePointer)].Visible = true;

                CSong song = CGame.GetSong();

                if (song == null)
                {
                    return;
                }

                float TotalTime = CSound.GetLength(_CurrentStream);
                if (song.Finish != 0)
                {
                    TotalTime = song.Finish;
                }

                TotalTime -= song.Start;

                if (TotalTime <= 0f)
                {
                    return;
                }

                CLines[] Lines = new CLines[song.Notes.Lines.Length];
                Lines = song.Notes.Lines;
                for (int i = 0; i < Lines.Length; i++)
                {
                    CLine[] Line = Lines[i].Line;
                    for (int j = 0; j < Line.Length; j++)
                    {
                        TimeRect trect = new TimeRect();
                        trect.startBeat = Line[j].FirstBeat;
                        trect.endBeat   = Line[j].EndBeat;

                        trect.rect = new CStatic(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,
                                                            stat.Rect.W * (CGame.GetTimeFromBeats((trect.endBeat - trect.startBeat), song.BPM) / TotalTime),
                                                            stat.Rect.H,
                                                            stat.Rect.Z));

                        _TimeRects.Add(trect);
                    }
                }
                break;
            }
        }
コード例 #4
0
        /// <summary>
        /// Возвращает строковое представлеине данного кватерниона.
        /// </summary>
        /// <returns>Строковое представлеине данного кватерниона.</returns>
        /// <remarks>
        /// <code>
        /// var q = Quaternion.GetRotation(Math.PI, new Point3D(1, 1, 1));
        /// Console.Write(q); //Результат: √3/3 i + √3/3 j + √3/3 k
        /// </code>
        /// </remarks>
        public override string ToString()
        {
            if (0D.Equals(W) && 0D.Equals(U.X) && 0D.Equals(U.Y) && 0D.Equals(U.Z))
            {
                return("0");
            }

            if (double.IsNaN(W) || double.IsNaN(U.X) || double.IsNaN(U.Y) || double.IsNaN(U.Z))
            {
                return("NaN");
            }

            var result = "";


            var order = Max(0, 13 - (int)GetOrder(Abs));

            CStatic.AddLinearItem(ref result, System.Math.Round(W, order), null);
            CStatic.AddLinearItem(ref result, System.Math.Round(U.X, order), "i");
            CStatic.AddLinearItem(ref result, System.Math.Round(U.Y, order), "j");
            CStatic.AddLinearItem(ref result, System.Math.Round(U.Z, order), "k");

            /*
             * var order = 1E13*Abs;
             * CStatic.AddLinearItem(ref result, Round15(W, order), null);
             * CStatic.AddLinearItem(ref result, Round15(U.X, order), "i");
             * CStatic.AddLinearItem(ref result, Round15(U.Y, order), "j");
             * CStatic.AddLinearItem(ref result, Round15(U.Z, order), "k");
             */


            return(result);
        }
コード例 #5
0
        private void _InitTiles()
        {
            if (SmallView)
            {
                _NumH   = _Theme.SongMenuTileBoard.NumHsmall;
                _NumW   = _Theme.SongMenuTileBoard.NumWsmall;
                MaxRect = _Theme.SongMenuTileBoard.TileRectSmall;
            }
            else
            {
                _NumH   = _Theme.SongMenuTileBoard.NumH;
                _NumW   = _Theme.SongMenuTileBoard.NumW;
                MaxRect = _Theme.SongMenuTileBoard.TileRect;
            }

            _TileW = (int)((Rect.W - _Theme.SongMenuTileBoard.SpaceW * (_NumW - 1)) / _NumW);
            _TileH = (int)((Rect.H - _Theme.SongMenuTileBoard.SpaceH * (_NumH - 1)) / _NumH);

            _CoverBGTexture    = CBase.Themes.GetSkinTexture(_Theme.CoverBackground, _PartyModeID);
            _CoverBigBGTexture = CBase.Themes.GetSkinTexture(_Theme.CoverBigBackground, _PartyModeID);

            _Tiles = new List <CStatic>();
            for (int i = 0; i < _NumH; i++)
            {
                for (int j = 0; j < _NumW; j++)
                {
                    var rect = new SRectF(Rect.X + j * (_TileW + _Theme.SongMenuTileBoard.SpaceW), Rect.Y + i * (_TileH + _Theme.SongMenuTileBoard.SpaceH), _TileW, _TileH, Rect.Z);
                    var tile = new CStatic(_PartyModeID, _CoverBGTexture, _Color, rect);
                    _Tiles.Add(tile);
                }
            }
            _ScrollRect = CBase.Settings.GetRenderRect();
        }
コード例 #6
0
        private void _InitTiles()
        {
            MaxRect = _Theme.SongMenuDetails.TileAreaRect;

            _ListTextWidth = MaxRect.W - _ListTextWidth;

            _CoverBGTexture    = CBase.Themes.GetSkinTexture(_Theme.CoverBackground, _PartyModeID);
            _VideoBGBGTexture  = CBase.Themes.GetSkinTexture(_Theme.CoverBigBackground, _PartyModeID);
            _BigCoverBGTexture = CBase.Themes.GetSkinTexture(_Theme.CoverBigBackground, _PartyModeID);
            _TileBGTexture     = CBase.Themes.GetSkinTexture(_Theme.TileBackground, _PartyModeID);

            //Create cover tiles
            _Covers  = new List <CStatic>();
            _Tiles   = new List <CStatic>();
            _Artists = new List <CText>();
            _Titles  = new List <CText>();

            _ListLength = (int)(MaxRect.H / (_Tile.H + (_TileSpacing / 2)));
            _TileCoverH = _Tile.H;
            _TileCoverW = _TileCoverH;

            float TileTextWidth        = _Tile.W - _TileCoverW - (_TileTextIndent * 2);
            float TileTextArtistHeight = 22;
            float TileTextTitleHeight  = 24;

            for (int i = 0; i < _ListLength; i++)
            {
                //Create Cover
                var rect  = new SRectF(Rect.X, Rect.Y + (i * (_TileCoverH + _TileSpacing)), _TileCoverW, _TileCoverH, Rect.Z);
                var cover = new CStatic(_PartyModeID, _CoverBGTexture, _Color, rect);
                _Covers.Add(cover);

                //Create Tile
                var BGrect = new SRectF(MaxRect.X, MaxRect.Y + i * (_Tile.H + _TileSpacing), MaxRect.W, _Tile.H, Rect.Z + 0.5f);
                var tilebg = new CStatic(_PartyModeID, _TileBGTexture, new SColorF(0, 0, 0, 0.6f), BGrect);
                _Tiles.Add(tilebg);

                //Create text
                var   artistRect = new SRectF(MaxRect.X + _TileCoverW + _TileTextIndent, Rect.Y + (_TileSpacing / 2) + i * (_Tile.H + _TileSpacing) + (_TileTextIndent / 2) + TileTextTitleHeight, TileTextWidth, TileTextArtistHeight, Rect.Z - 1);
                CText artist     = new CText(artistRect.X, artistRect.Y, artistRect.Z,
                                             artistRect.H, artistRect.W, EAlignment.Left, EStyle.Bold,
                                             "Outline", _Artist.Color, "");
                artist.MaxRect     = new SRectF(artist.MaxRect.X, artist.MaxRect.Y, MaxRect.W + MaxRect.X - artist.Rect.X - 5f, artist.MaxRect.H, artist.MaxRect.Z);
                artist.ResizeAlign = EHAlignment.Center;

                _Artists.Add(artist);

                var   titleRect = new SRectF(MaxRect.X + _TileCoverW + _TileTextIndent, (Rect.Y + (_TileSpacing / 2) + i * (_Tile.H + _TileSpacing)) + (_TileTextIndent / 2), TileTextWidth, TileTextTitleHeight, Rect.Z - 1);
                CText title     = new CText(titleRect.X, titleRect.Y, titleRect.Z,
                                            titleRect.H, titleRect.W, EAlignment.Left, EStyle.Normal,
                                            "Outline", _Artist.Color, "");
                title.MaxRect     = new SRectF(title.MaxRect.X, title.MaxRect.Y, MaxRect.W + MaxRect.X - title.Rect.X - 5f, title.MaxRect.H, title.MaxRect.Z);
                title.ResizeAlign = EHAlignment.Center;

                _Titles.Add(title);
            }

            _ScrollRect = MaxRect;
        }
コード例 #7
0
 public CCreditName(CStatic image, CStatic imgDot, CParticleEffect particle, int particleOffsetX, int particleOffsetY)
 {
     _Image           = image;
     _ImgDot          = imgDot;
     _Particle        = particle;
     _ParticleOffsetX = (int)Math.Round(particleOffsetX * image.Rect.W / image.Texture.OrigSize.Width - particle.Rect.W / 2);
     _ParticleOffsetY = (int)Math.Round(particleOffsetY * image.Rect.H / image.Texture.OrigSize.Height - particle.Rect.H / 2);
     Visible          = true;
 }
コード例 #8
0
        static void Main(string[] args)
        {
            CStatic p = new CStatic();

            Console.WriteLine("{0}", p.y);
            p.y = 75;
            int z = p.y;

            Console.WriteLine("{0}", z);
        }
コード例 #9
0
        /// <summary>
        /// Возвращает строковое представлеине исходного многочлена Лежандра.
        /// </summary>
        /// <returns>Строковое представлеине исходного многочлена Лежандра.</returns>
        /// <remarks>
        /// <code>
        /// var pol = new LegendrePolynomial(6);
        /// Console.Write(pol); //Результат: -5/16 + 105/16 x² - 315/16 x⁴ + 231/16 x⁶, alternative: (231 x⁶ - 315 x⁴ + 105 x² - 5) / 16
        /// </code>
        /// </remarks>
        public override string ToString()
        {
            var result = "";

            int den;

            switch (Deg)
            {
            default:
                den = 1;
                break;

            case 2:
            case 3:
                den = 2;
                break;

            case 4:
            case 5:
                den = 8;
                break;

            case 6:
            case 7:
                den = 16;
                break;

            case 8:
            case 9:
                den = 128;
                break;

            case 10:
                den = 256;
                break;
            }

            for (var i = A.Length - 1; i >= 0; i--)
            {
                var val = i == 0 ? "" : "x";
                if (i > 1)
                {
                    val += CStatic.GetIndex(i, true);
                }

                CStatic.AddLinearItem(ref result, A[i] * den, val);
            }

            if (den > 1)
            {
                result = "(" + result + ") / " + den;
            }

            return(base.ToString() + ", alternative: " + result);
        }
コード例 #10
0
        public override void Init()
        {
            base.Init();

            _BuildElementStrings();

            _ChooseAvatarStatic         = GetNewStatic();
            _ChooseAvatarStatic.Visible = false;
            _ChooseAvatarStatic.Aspect  = EAspect.Crop;

            CProfiles.AddProfileChangedCallback(_OnProfileChanged);
        }
コード例 #11
0
        protected override void Init()
        {
            base.Init();

            _ThemeName     = "ScreenNames";
            _ScreenVersion = ScreenVersion;

            List <string> statics = new List <string>();

            foreach (string text in StaticPlayer)
            {
                statics.Add(text);
            }
            foreach (string text in StaticPlayerAvatar)
            {
                statics.Add(text);
            }
            statics.Add(StaticWarningMics);
            statics.Add(StaticWarningProfiles);
            _ThemeStatics = statics.ToArray();

            List <string> texts = new List <string>();

            texts.Add(SelectSlidePlayerNumber);
            texts.AddRange(SelectSlideDuetPlayer);
            _ThemeSelectSlides = texts.ToArray();

            texts.Clear();
            texts.Add(TextWarningMics);
            texts.Add(TextWarningProfiles);
            foreach (string text in TextPlayer)
            {
                texts.Add(text);
            }
            _ThemeTexts = texts.ToArray();

            texts.Clear();
            texts.Add(ButtonBack);
            texts.Add(ButtonStart);

            _ThemeButtons = texts.ToArray();

            texts.Clear();
            texts.Add(NameSelection);
            _ThemeNameSelections = texts.ToArray();

            texts.Clear();
            texts.AddRange(EqualizerPlayer);
            _ThemeEqualizers = texts.ToArray();

            chooseAvatarStatic         = new CStatic();
            chooseAvatarStatic.Visible = false;
        }
コード例 #12
0
 public CSongMenuTileBoard(SThemeSongMenu theme, int partyModeID) : base(theme, partyModeID)
 {
     _Artist         = new CText(_Theme.SongMenuTileBoard.TextArtist, _PartyModeID);
     _Title          = new CText(_Theme.SongMenuTileBoard.TextTitle, _PartyModeID);
     _SongLength     = new CText(_Theme.SongMenuTileBoard.TextSongLength, _PartyModeID);
     _CoverBig       = new CStatic(_Theme.SongMenuTileBoard.StaticCoverBig, _PartyModeID);
     _TextBG         = new CStatic(_Theme.SongMenuTileBoard.StaticTextBG, _PartyModeID);
     _DuetIcon       = new CStatic(_Theme.SongMenuTileBoard.StaticDuetIcon, _PartyModeID);
     _VideoIcon      = new CStatic(_Theme.SongMenuTileBoard.StaticVideoIcon, _PartyModeID);
     _MedleyCalcIcon = new CStatic(_Theme.SongMenuTileBoard.StaticMedleyCalcIcon, _PartyModeID);
     _MedleyTagIcon  = new CStatic(_Theme.SongMenuTileBoard.StaticMedleyTagIcon, _PartyModeID);
     _SubElements.AddRange(new IMenuElement[] { _Artist, _Title, _SongLength, _DuetIcon, _VideoIcon, _MedleyCalcIcon, _MedleyTagIcon });
 }
コード例 #13
0
        public static void DrawTexture(CStatic StaticBounds, STexture Texture, EAspect Aspect)
        {
            RectangleF bounds = new RectangleF(StaticBounds.Rect.X, StaticBounds.Rect.Y, StaticBounds.Rect.W, StaticBounds.Rect.H);
            RectangleF rect   = new RectangleF(0f, 0f, Texture.width, Texture.height);

            if (rect.Height <= 0f)
            {
                return;
            }

            CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, Aspect);
            DrawTexture(Texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, StaticBounds.Rect.Z),
                        Texture.color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f), false);
        }
コード例 #14
0
        public override void Init()
        {
            base.Init();

            _Rect = _Theme.songMenuTileBoard.TileRect;
 
            _NumW = _Theme.songMenuTileBoard.numW;
            _NumH = _Theme.songMenuTileBoard.numH;
            _SpaceW = _Theme.songMenuTileBoard.spaceW;
            _SpaceH = _Theme.songMenuTileBoard.spaceH;

            _PendingTime = 100L;

            _TileW = (int)((_Theme.songMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW);
            _TileH = (int)((_Theme.songMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH);

            _CoverTexture = CTheme.GetSkinTexture(_Theme.CoverBackgroundName);
            _CoverBigTexture = CTheme.GetSkinTexture(_Theme.CoverBigBackgroundName);

            _Tiles = new List<CStatic>();
            for (int i = 0; i < _NumH; i++)
            {
                for (int j = 0; j < _NumW; j++)
                {
                    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);
                    _Tiles.Add(tile);
                }
            }

            _ScrollRect = new SRectF(0, 0, CSettings.iRenderW, CSettings.iRenderH, _Theme.songMenuTileBoard.TileRect.Z);

            _PreviewSelected = -1;
            _Offset = 0;

            _CoverBig = _Theme.songMenuTileBoard.StaticCoverBig;
            _TextBG = _Theme.songMenuTileBoard.StaticTextBG;
            _DuetIcon = _Theme.songMenuTileBoard.StaticDuetIcon;
            _VideoIcon = _Theme.songMenuTileBoard.StaticVideoIcon;
            _MedleyCalcIcon = _Theme.songMenuTileBoard.StaticMedleyCalcIcon;
            _MedleyTagIcon = _Theme.songMenuTileBoard.StaticMedleyTagIcon;

            _Artist = _Theme.songMenuTileBoard.TextArtist;
            _Title = _Theme.songMenuTileBoard.TextTitle;
            _SongLength = _Theme.songMenuTileBoard.TextSongLength;
        }
コード例 #15
0
        public override void Init()
        {
            base.Init();

            _Rect = _Theme.songMenuTileBoard.TileRect;

            _NumW   = _Theme.songMenuTileBoard.numW;
            _NumH   = _Theme.songMenuTileBoard.numH;
            _SpaceW = _Theme.songMenuTileBoard.spaceW;
            _SpaceH = _Theme.songMenuTileBoard.spaceH;

            _PendingTime = 100L;

            _TileW = (int)((_Theme.songMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW);
            _TileH = (int)((_Theme.songMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH);

            _CoverTexture    = CTheme.GetSkinTexture(_Theme.CoverBackgroundName);
            _CoverBigTexture = CTheme.GetSkinTexture(_Theme.CoverBigBackgroundName);

            _Tiles = new List <CStatic>();
            for (int i = 0; i < _NumH; i++)
            {
                for (int j = 0; j < _NumW; j++)
                {
                    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);
                    _Tiles.Add(tile);
                }
            }

            _ScrollRect = new SRectF(0, 0, CSettings.iRenderW, CSettings.iRenderH, _Theme.songMenuTileBoard.TileRect.Z);

            _PreviewSelected = -1;
            _Offset          = 0;

            _CoverBig       = _Theme.songMenuTileBoard.StaticCoverBig;
            _TextBG         = _Theme.songMenuTileBoard.StaticTextBG;
            _DuetIcon       = _Theme.songMenuTileBoard.StaticDuetIcon;
            _VideoIcon      = _Theme.songMenuTileBoard.StaticVideoIcon;
            _MedleyCalcIcon = _Theme.songMenuTileBoard.StaticMedleyCalcIcon;
            _MedleyTagIcon  = _Theme.songMenuTileBoard.StaticMedleyTagIcon;

            _Artist     = _Theme.songMenuTileBoard.TextArtist;
            _Title      = _Theme.songMenuTileBoard.TextTitle;
            _SongLength = _Theme.songMenuTileBoard.TextSongLength;
        }
コード例 #16
0
 public CSongMenuList(SThemeSongMenu theme, int partyModeID) : base(theme, partyModeID)
 {
     _ListLength     = _Theme.SongMenuList.ListLength;
     _SpaceW         = _Theme.SongMenuList.SpaceW;
     _SpaceH         = _Theme.SongMenuList.SpaceH;
     _Artist         = new CText(_Theme.SongMenuList.TextArtist, _PartyModeID);
     _Title          = new CText(_Theme.SongMenuList.TextTitle, _PartyModeID);
     _SongLength     = new CText(_Theme.SongMenuList.TextSongLength, _PartyModeID);
     _SongYear       = new CText(_Theme.SongMenuList.TextSongYear, _PartyModeID);
     _CoverBig       = new CStatic(_Theme.SongMenuList.StaticCoverBig, _PartyModeID);
     _TextBG         = new CStatic(_Theme.SongMenuList.StaticTextBG, _PartyModeID);
     _DuetIcon       = new CStatic(_Theme.SongMenuList.StaticDuetIcon, _PartyModeID);
     _VideoIcon      = new CStatic(_Theme.SongMenuList.StaticVideoIcon, _PartyModeID);
     _MedleyCalcIcon = new CStatic(_Theme.SongMenuList.StaticMedleyCalcIcon, _PartyModeID);
     _MedleyTagIcon  = new CStatic(_Theme.SongMenuList.StaticMedleyTagIcon, _PartyModeID);
     _SubElements.AddRange(new IMenuElement[] { _Artist, _Title, _SongLength, _SongYear, _DuetIcon, _VideoIcon, _MedleyCalcIcon, _MedleyTagIcon });
 }
コード例 #17
0
        public override void Init()
        {
            base.Init();

            var statics = new List <string>();

            statics.AddRange(_StaticPlayerAvatar);
            statics.AddRange(_StaticPlayer);
            statics.Add(_StaticWarningMics);
            statics.Add(_StaticWarningProfiles);
            _ThemeStatics = statics.ToArray();

            var texts = new List <string> {
                _SelectSlidePlayerNumber
            };

            texts.AddRange(_SelectSlideDuetPlayer);
            _ThemeSelectSlides = texts.ToArray();

            texts.Clear();
            texts.Add(_TextWarningMics);
            texts.Add(_TextWarningProfiles);
            texts.AddRange(_TextPlayer);
            _ThemeTexts = texts.ToArray();

            texts.Clear();
            texts.Add(_ButtonBack);
            texts.Add(_ButtonStart);

            _ThemeButtons = texts.ToArray();

            texts.Clear();
            texts.Add(_NameSelection);
            _ThemeNameSelections = texts.ToArray();

            texts.Clear();
            texts.AddRange(_EqualizerPlayer);
            _ThemeEqualizers = texts.ToArray();

            _ChooseAvatarStatic         = GetNewStatic();
            _ChooseAvatarStatic.Visible = false;
            _ChooseAvatarStatic.Aspect  = EAspect.Crop;

            CProfiles.AddProfileChangedCallback(_OnProfileChanged);
        }
コード例 #18
0
ファイル: Complex.cs プロジェクト: bastrakov-sergei/Ruzil3D
        /// <summary>
        /// Возвращает строковое представлеине данного комплексного числа.
        /// </summary>
        /// <returns>Строковое представление данного комплексного числа.</returns>
        /// <remarks>
        /// <code>
        /// var num = new Complex(2, -1);
        /// Console.Write(num); //Результат: 2 - i
        /// Console.Write(-2*num); //Результат: -4 + 2i
        /// </code>
        /// </remarks>
        public override string ToString()
        {
            if (0D.Equals(R) && 0D.Equals(I))
            {
                return("0");
            }

            if (double.IsNaN(R) || double.IsNaN(I))
            {
                return("NaN");
            }

            var result = "";

            CStatic.AddLinearItem(ref result, R, null);
            CStatic.AddLinearItem(ref result, I, "i");
            return(result);
        }
コード例 #19
0
ファイル: Matrix3D.cs プロジェクト: bastrakov-sergei/Ruzil3D
        /// <summary>
        /// Возвращает строковое представлеине данной матрицы.
        /// </summary>
        /// <returns>Строковое представлеине данной матрицы.</returns>
        /// <remarks>
        /// <code>
        /// var matrix = Matrix3D.GetRotation(Math.PI, new Point3D(1, 1, 1));
        /// Console.Write(matrix); //Результат: -1/3 2/3 2/3 | 2/3 -1/3 2/3 | 2/3 2/3 -1/3
        /// </code>
        /// </remarks>
        public override string ToString()
        {
            if (IsNaN)
            {
                return("NaN");
            }

            return
                (CStatic.DoubleToString(Line1.X) + CStatic.EmSp +
                 CStatic.DoubleToString(Line1.Y) + CStatic.EmSp +
                 CStatic.DoubleToString(Line1.Z) + CStatic.EmSp +
                 "|" + CStatic.EmSp +
                 CStatic.DoubleToString(Line2.X) + CStatic.EmSp +
                 CStatic.DoubleToString(Line2.Y) + CStatic.EmSp +
                 CStatic.DoubleToString(Line2.Z) + CStatic.EmSp +
                 "|" + CStatic.EmSp +
                 CStatic.DoubleToString(Line3.X) + CStatic.EmSp +
                 CStatic.DoubleToString(Line3.Y) + CStatic.EmSp +
                 CStatic.DoubleToString(Line3.Z));
        }
コード例 #20
0
        /// <summary>
        /// Возвращает строковое представлеине данного линейного уравнения.
        /// </summary>
        /// <returns>Строковое представление данного линейного уравнения.</returns>
        /// <remarks>
        /// <code>
        /// var linear = new Linear(new double[] {3, 1, -1}, -4);
        /// Console.Write(linear); //Результат: 3 x₁ + x₂ - x₃ = -4
        /// Console.Write(-linear/3); //Результат: -x₁ - 1/3 x₂ + 1/3 x₃ = 4/3
        /// </code>
        /// </remarks>
        public override string ToString()
        {
            var result = CStatic.GetToStringHashValue(this);

            if (result != null)
            {
                return(result);
            }
            result = "";


            for (var i = 0; i < A.Length; i++)
            {
                var sym = "x" + CStatic.GetIndex(i + 1);
                CStatic.AddLinearItem(ref result, A[i], sym);
            }
            result  = result == "" ? "0" : result;
            result += " = " + CStatic.DoubleToString(Y);


            CStatic.AddToStringHashValue(this, result);
            return(result);
        }
コード例 #21
0
        private void _AddNewCreditName(CTextureRef texture, int particleOffsetX, int particleOffsetY, bool bigParticles)
        {
            bool        isRed        = _CreditNames.Count % 2 == 0;
            int         partRectSize = bigParticles ? 25 : 20;
            int         partCount    = bigParticles ? 8 : 6;
            CTextureRef texDot       = isRed ? _TexRedDot : _TexBlueDot;

            CStatic image = GetNewStatic(texture, new SColorF(1, 1, 1, 1), new SRectF(-1, -1, 400, 120, -4));

            var    particleRect = new SRectF(-1, -1, partRectSize, partRectSize, -6);
            SRectF imgDotRect   = particleRect;

            imgDotRect.Z = -5;
            CStatic         imgDot   = GetNewStatic(texDot, new SColorF(1, 1, 1, 1), imgDotRect);
            CParticleEffect particle = _GetStarParticles(partCount, isRed, particleRect, bigParticles);

            var credit = new CCreditName(image, imgDot, particle, particleOffsetX, particleOffsetY);

            _CreditNames.Add(credit);
            _AddStatic(image);
            _AddStatic(imgDot);
            _AddParticleEffect(particle);
        }
コード例 #22
0
ファイル: Matrix.cs プロジェクト: bastrakov-sergei/Ruzil3D
        /// <summary>
        /// Возвращает строковое представлеине данной матрицы.
        /// </summary>
        /// <returns>Строковое представлеине данной матрицы.</returns>
        /// <remarks>
        /// <code>
        /// var matrix = new Matrix(new[] {new Vector(1, 2, 3), new Vector(3, 4)});
        /// Console.Write(matrix); //Результат: l̄₁ = x̄₁ + 2 x̄₂ + 3 x̄₃ l̄₂ = 3 x̄₁ + 4 x̄₂
        /// </code>
        /// </remarks>
        public override string ToString()
        {
            var result = "";

            var isEmpty = true;

            //Знак вектора
            var line = "l" + CStatic.Macron;

            for (var i = 0; i < Length; i++)
            {
                if (i > 0)
                {
                    result += CStatic.EmSp;
                }

                var vector = this[i];
                isEmpty &= vector == Vector.Empty;
                result  += line + CStatic.GetIndex(i + 1) + " = " + vector;
            }

            return(isEmpty ? "Ø" : result);
        }
コード例 #23
0
ファイル: CSongMenuList.cs プロジェクト: da-ka/Vocaluxe
        private void _InitTiles()
        {
            MaxRect = SmallView ? _Theme.SongMenuList.TileRectSmall : _Theme.SongMenuList.TileRect;

            _ListTextWidth = MaxRect.W - _ListTextWidth;

            _TileW = (int)((MaxRect.H - _SpaceH * (_ListLength - 1)) / _ListLength);
            _TileH = _TileW;

            _CoverBGTexture    = CBase.Themes.GetSkinTexture(_Theme.CoverBackground, _PartyModeID);
            _CoverBigBGTexture = CBase.Themes.GetSkinTexture(_Theme.CoverBigBackground, _PartyModeID);

            //Create cover tiles
            _Tiles = new List <CStatic>();
            _Texts = new List <CText>();

            for (int i = 0; i < _ListLength; i++)
            {
                //Create Cover
                var rect = new SRectF(Rect.X + (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z);
                var tile = new CStatic(_PartyModeID, _CoverBGTexture, _Color, rect);
                _Tiles.Add(tile);

                //Create text
                var   textRect = new SRectF(MaxRect.X + 2 * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _ListTextWidth, _TileH, Rect.Z);
                CText text     = new CText(textRect.X, textRect.Y, textRect.Z,
                                           textRect.H, textRect.W, EAlignment.Left, EStyle.Normal,
                                           "Normal", _Artist.Color, "");
                text.MaxRect     = new SRectF(text.MaxRect.X, text.MaxRect.Y, MaxRect.W + MaxRect.X - text.Rect.X - 5f, text.MaxRect.H, text.MaxRect.Z);
                text.ResizeAlign = EHAlignment.Center;

                _Texts.Add(text);
            }

            _ScrollRect = CBase.Settings.GetRenderRect();
        }
コード例 #24
0
ファイル: CScreenSing.cs プロジェクト: zhaozw/Vocaluxe
        private void UpdateTimeLine()
        {
            CSong song = CGame.GetSong();

            if (song == null)
            {
                return;
            }

            float TotalTime = CSound.GetLength(_CurrentStream);

            if (song.Finish != 0)
            {
                TotalTime = song.Finish;
            }

            float RemainingTime = TotalTime - _CurrentTime;

            TotalTime -= song.Start;
            float CurrentTime = _CurrentTime - song.Start;

            if (TotalTime <= 0f)
            {
                return;
            }

            switch (CConfig.TimerMode)
            {
            case ETimerMode.TR_CONFIG_TIMERMODE_CURRENT:
                int min = (int)Math.Floor(CurrentTime / 60f);
                int sec = (int)(CurrentTime - min * 60f);
                Texts[htTexts(TextTime)].Text = min.ToString("00") + ":" + sec.ToString("00");
                break;

            case ETimerMode.TR_CONFIG_TIMERMODE_REMAINING:
                min = (int)Math.Floor(RemainingTime / 60f);
                sec = (int)(RemainingTime - min * 60f);
                Texts[htTexts(TextTime)].Text = "-" + min.ToString("00") + ":" + sec.ToString("00");
                break;

            case ETimerMode.TR_CONFIG_TIMERMODE_TOTAL:
                min = (int)Math.Floor(TotalTime / 60f);
                sec = (int)(TotalTime - min * 60f);
                Texts[htTexts(TextTime)].Text = "#" + min.ToString("00") + ":" + sec.ToString("00");
                break;
            }


            switch (CConfig.TimerLook)
            {
            case ETimerLook.TR_CONFIG_TIMERLOOK_NORMAL:
                _TimeLineRect.W = Statics[htStatics(StaticTimeLine)].Rect.W * (CurrentTime / TotalTime);
                break;

            case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED:
                CStatic stat        = Statics[htStatics(StaticTimeLine)];
                int     CurrentBeat = CGame.CurrentBeat;
                for (int i = 0; i < _TimeRects.Count; i++)
                {
                    if (CurrentBeat >= _TimeRects[i].startBeat && CurrentBeat <= _TimeRects[i].endBeat)
                    {
                        _TimeRects[i].rect.Texture = Statics[htStatics(StaticTimeLineExpandedHighlighted)].Texture;
                        _TimeRects[i].rect.Color   = Statics[htStatics(StaticTimeLineExpandedHighlighted)].Color;
                    }
                    else
                    {
                        _TimeRects[i].rect.Texture = Statics[htStatics(StaticTimeLineExpandedNormal)].Texture;
                        _TimeRects[i].rect.Color   = Statics[htStatics(StaticTimeLineExpandedNormal)].Color;
                    }
                }
                Statics[htStatics(StaticTimePointer)].Rect.X = stat.Rect.X + stat.Rect.W * (CurrentTime / TotalTime);
                break;
            }
        }
コード例 #25
0
        public override bool HandleMouse(MouseEvent MouseEvent)
        {
            base.HandleMouse(MouseEvent);

            //Check if LeftButton is hold and Select-Mode inactive
            if (MouseEvent.LBH && !selectingMouseActive)
            {
                //Save mouse-coords
                OldMouseX = MouseEvent.X;
                OldMouseY = MouseEvent.Y;
                //Check if mouse if over tile
                if (NameSelections[htNameSelections(NameSelection)].isOverTile(MouseEvent))
                {
                    //Get player-number of tile
                    SelectedPlayerNr = NameSelections[htNameSelections(NameSelection)].TilePlayerNr(MouseEvent);
                    if (SelectedPlayerNr != -1)
                    {
                        //Activate mouse-selecting
                        selectingMouseActive = true;

                        //Update of Drag/Drop-Texture
                        CStatic SelectedPlayer = NameSelections[htNameSelections(NameSelection)].TilePlayerAvatar(MouseEvent);
                        chooseAvatarStatic.Visible = true;
                        chooseAvatarStatic.Rect    = SelectedPlayer.Rect;
                        chooseAvatarStatic.Rect.Z  = CSettings.zNear;
                        chooseAvatarStatic.Color   = new SColorF(1, 1, 1, 1);
                        chooseAvatarStatic.Texture = SelectedPlayer.Texture;
                    }
                }
            }

            //Check if LeftButton is hold and Select-Mode active
            if (MouseEvent.LBH && selectingMouseActive)
            {
                //Update coords for Drag/Drop-Texture
                chooseAvatarStatic.Rect.X += (MouseEvent.X - OldMouseX);
                chooseAvatarStatic.Rect.Y += (MouseEvent.Y - OldMouseY);
                OldMouseX = MouseEvent.X;
                OldMouseY = MouseEvent.Y;
            }
            // LeftButton isn't hold anymore, but Selec-Mode is still active -> "Drop" of Avatar
            else if (selectingMouseActive)
            {
                //Check if really a player was selected
                if (SelectedPlayerNr != -1)
                {
                    //Foreach Drop-Area
                    for (int i = 0; i < StaticPlayer.Length; i++)
                    {
                        //Check first, if area is "active"
                        if (Statics[htStatics(StaticPlayer[i])].Visible == true)
                        {
                            //Check if Mouse is in area
                            if (CHelper.IsInBounds(Statics[htStatics(StaticPlayer[i])].Rect, MouseEvent))
                            {
                                //Update Game-infos with new player
                                CGame.Player[i].Name       = CProfiles.Profiles[SelectedPlayerNr].PlayerName;
                                CGame.Player[i].Difficulty = CProfiles.Profiles[SelectedPlayerNr].Difficulty;
                                CGame.Player[i].ProfileID  = SelectedPlayerNr;
                                //Update config for default players.
                                CConfig.Players[i] = CProfiles.Profiles[SelectedPlayerNr].ProfileFile;
                                CConfig.SaveConfig();
                                //Update texture and name
                                Statics[htStatics(StaticPlayerAvatar[i])].Texture = chooseAvatarStatic.Texture;
                                Texts[htTexts(TextPlayer[i])].Text = CProfiles.Profiles[SelectedPlayerNr].PlayerName;
                                //Update profile-warning
                                CheckPlayers();
                                //Update Tiles-List
                                NameSelections[htNameSelections(NameSelection)].UpdateList();
                            }
                        }
                    }
                    SelectedPlayerNr = -1;
                }
                //Reset variables
                selectingMouseActive       = false;
                chooseAvatarStatic.Visible = false;
            }

            if (MouseEvent.LB && IsMouseOver(MouseEvent))
            {
            }

            if (MouseEvent.LB && IsMouseOver(MouseEvent))
            {
                bool processed = false;

                if (!processed && Buttons[htButtons(ButtonBack)].Selected)
                {
                    processed = true;
                    CGraphics.FadeTo(EScreens.ScreenSong);
                }

                if (!processed && Buttons[htButtons(ButtonStart)].Selected)
                {
                    processed = true;
                    StartSong();
                }

                if (!processed)
                {
                    UpdatePlayerNumber();
                }
                //Update Tiles-List
                NameSelections[htNameSelections(NameSelection)].UpdateList();
            }

            if (MouseEvent.RB)
            {
                bool exit = true;
                //Remove profile-selection
                for (int i = 0; i < CConfig.NumPlayer; i++)
                {
                    if (CHelper.IsInBounds(Statics[htStatics(StaticPlayer[i])].Rect, MouseEvent))
                    {
                        CGame.Player[i].ProfileID  = -1;
                        CGame.Player[i].Name       = String.Empty;
                        CGame.Player[i].Difficulty = EGameDifficulty.TR_CONFIG_EASY;
                        //Update config for default players.
                        CConfig.Players[i] = String.Empty;
                        CConfig.SaveConfig();
                        //Update texture and name
                        Statics[htStatics(StaticPlayerAvatar[i])].Texture = OriginalPlayerAvatarTextures[i];
                        Texts[htTexts(TextPlayer[i])].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + (i + 1).ToString();
                        //Update profile-warning
                        CheckPlayers();
                        //Update Tiles-List
                        NameSelections[htNameSelections(NameSelection)].UpdateList();
                        exit = false;
                    }
                }
                if (exit)
                {
                    CGraphics.FadeTo(EScreens.ScreenSong);
                }
            }

            //Check mouse-wheel for scrolling
            if (MouseEvent.Wheel != 0)
            {
                if (CHelper.IsInBounds(NameSelections[htNameSelections(NameSelection)].Rect, MouseEvent))
                {
                    int offset = NameSelections[htNameSelections(NameSelection)]._Offset + MouseEvent.Wheel;
                    NameSelections[htNameSelections(NameSelection)].UpdateList(offset);
                }
            }
            return(true);
        }
コード例 #26
0
        public override bool HandleMouse(SMouseEvent mouseEvent)
        {
            bool stopSelectingFast = false;

            if (_SelectingFast)
            {
                _NameSelections[_NameSelection].HandleMouse(mouseEvent);
            }
            else
            {
                base.HandleMouse(mouseEvent);
            }

            //Check if LeftButton is hold and Select-Mode inactive
            if (mouseEvent.LBH && _SelectedProfileID == Guid.Empty && !_SelectingFast)
            {
                //Save mouse-coords
                _OldMouseX = mouseEvent.X;
                _OldMouseY = mouseEvent.Y;
                //Check if mouse if over tile
                if (_NameSelections[_NameSelection].IsOverTile(mouseEvent))
                {
                    //Get player-number of tile
                    _SelectedProfileID = _NameSelections[_NameSelection].TilePlayerID(mouseEvent);
                    if (_SelectedProfileID != Guid.Empty)
                    {
                        //Update of Drag/Drop-Texture
                        CStatic selectedPlayer = _NameSelections[_NameSelection].TilePlayerAvatar(mouseEvent);
                        _ChooseAvatarStatic.Visible = true;
                        _ChooseAvatarStatic.MaxRect = selectedPlayer.Rect;
                        _ChooseAvatarStatic.Z       = CSettings.ZNear;
                        _ChooseAvatarStatic.Color   = new SColorF(1, 1, 1, 1);
                        _ChooseAvatarStatic.Texture = selectedPlayer.Texture;
                    }
                }
                else
                {
                    for (int i = 0; i < CGame.NumPlayers; i++)
                    {
                        if (CHelper.IsInBounds(_Statics[_PlayerStatic[i]].Rect, mouseEvent))
                        {
                            _SelectingSwitchNr = i;
                            _SelectedProfileID = CGame.Players[i].ProfileID;
                            //Update of Drag/Drop-Texture
                            CStatic selectedPlayer = _Statics[_PlayerStaticAvatar[i]];
                            _ChooseAvatarStatic.Visible = true;
                            _ChooseAvatarStatic.MaxRect = selectedPlayer.Rect;
                            _ChooseAvatarStatic.Z       = CSettings.ZNear;
                            _ChooseAvatarStatic.Color   = new SColorF(1, 1, 1, 1);
                            _ChooseAvatarStatic.Texture = selectedPlayer.Texture;
                            break;
                        }
                    }
                }
            }

            //Check if LeftButton is hold and Select-Mode active
            if (mouseEvent.LBH && _SelectedProfileID != Guid.Empty && !_SelectingFast)
            {
                //Update coords for Drag/Drop-Texture
                _ChooseAvatarStatic.X += mouseEvent.X - _OldMouseX;
                _ChooseAvatarStatic.Y += mouseEvent.Y - _OldMouseY;
                _OldMouseX             = mouseEvent.X;
                _OldMouseY             = mouseEvent.Y;
            }
            // LeftButton isn't hold anymore, but Select-Mode is still active -> "Drop" of Avatar
            else if (_SelectedProfileID != Guid.Empty && !_SelectingFast)
            {
                //Foreach Drop-Area
                for (int i = 0; i < _PlayerStatic.Length; i++)
                {
                    //Check first, if area is "Active"
                    if (!_Statics[_PlayerStatic[i]].Visible)
                    {
                        continue;
                    }
                    //Check if Mouse is in area
                    if (CHelper.IsInBounds(_Statics[_PlayerStatic[i]].Rect, mouseEvent))
                    {
                        if (_SelectingSwitchNr > -1 && CGame.Players[i].ProfileID != Guid.Empty)
                        {
                            _UpdateSelectedProfile(_SelectingSwitchNr, CGame.Players[i].ProfileID);
                        }
                        else if (_SelectingSwitchNr > -1)
                        {
                            _ResetPlayerSelection(_SelectingSwitchNr);
                        }

                        if (!CProfiles.IsProfileIDValid(_SelectedProfileID))
                        {
                            return(true);
                        }

                        _UpdateSelectedProfile(i, _SelectedProfileID);
                        break;
                    }
                    //Selected player is dropped out of area
                    if (_SelectingSwitchNr > -1)
                    {
                        _ResetPlayerSelection(_SelectingSwitchNr);
                    }
                }
                _SelectingSwitchNr = -1;
                _SelectedProfileID = Guid.Empty;
                //Reset variables
                _ChooseAvatarStatic.Visible = false;
            }

            if (mouseEvent.LB && _SelectingFast)
            {
                if (_NameSelections[_NameSelection].IsOverTile(mouseEvent))
                {
                    //Get player-number of tile
                    _SelectedProfileID = _NameSelections[_NameSelection].TilePlayerID(mouseEvent);
                    if (_SelectedProfileID != Guid.Empty)
                    {
                        if (!CProfiles.IsProfileIDValid(_SelectedProfileID))
                        {
                            return(true);
                        }

                        _UpdateSelectedProfile(_SelectingFastPlayerNr - 1, _SelectedProfileID);

                        _SelectingFastPlayerNr++;
                        if (_SelectingFastPlayerNr <= CGame.NumPlayers)
                        {
                            _NameSelections[_NameSelection].FastSelection(true, _SelectingFastPlayerNr);
                        }
                        else
                        {
                            stopSelectingFast = true;
                        }
                    }
                    else
                    {
                        stopSelectingFast = true;
                    }
                }
            }
            else if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
            {
                if (_Buttons[_ButtonBack].Selected)
                {
                    CGraphics.FadeTo(EScreen.Song);
                }
                else if (_Buttons[_ButtonStart].Selected)
                {
                    _StartSong();
                }
                else if (_Buttons[_ButtonNewProfile].Selected)
                {
                    CGraphics.ShowPopup(EPopupScreens.PopupNewPlayer);
                }
                else if (_Buttons["ButtonScrollUp"].Selected)
                {
                    _NameSelections[_NameSelection].UpdateList(_NameSelections[_NameSelection].Offset - 1);
                }
                else if (_Buttons["ButtonScrollDown"].Selected)
                {
                    _NameSelections[_NameSelection].UpdateList(_NameSelections[_NameSelection].Offset + 1);
                }
                else
                {
                    _UpdatePlayerNumber();
                }
                //Update Tiles-List
                _NameSelections[_NameSelection].UpdateList();
            }

            if (mouseEvent.LD && _NameSelections[_NameSelection].IsOverTile(mouseEvent) && !_SelectingFast)
            {
                _SelectedProfileID = _NameSelections[_NameSelection].TilePlayerID(mouseEvent);
                if (_SelectedProfileID != Guid.Empty)
                {
                    for (int i = 0; i < CGame.NumPlayers; i++)
                    {
                        if (CGame.Players[i].ProfileID == Guid.Empty)
                        {
                            if (!CProfiles.IsProfileIDValid(_SelectedProfileID))
                            {
                                return(true);
                            }

                            _UpdateSelectedProfile(i, _SelectedProfileID);
                            break;
                        }
                    }
                }
            }

            if (mouseEvent.RB && _SelectingFast)
            {
                stopSelectingFast = true;
            }
            else if (mouseEvent.RB)
            {
                bool exit = true;
                //Remove profile-selection
                for (int i = 0; i < CConfig.Config.Game.NumPlayers; i++)
                {
                    if (CHelper.IsInBounds(_Statics[_PlayerStatic[i]].Rect, mouseEvent))
                    {
                        _ResetPlayerSelection(i);
                        exit = false;
                    }
                }
                if (exit)
                {
                    CGraphics.FadeTo(EScreen.Song);
                }
            }

            if (mouseEvent.MB && _SelectingFast)
            {
                _SelectingFastPlayerNr++;
                if (_SelectingFastPlayerNr <= CGame.NumPlayers)
                {
                    _NameSelections[_NameSelection].FastSelection(true, _SelectingFastPlayerNr);
                }
                else
                {
                    stopSelectingFast = true;
                }
            }
            else if (mouseEvent.MB)
            {
                _ResetPlayerSelections();
                _SelectingFast           = true;
                _SelectingFastPlayerNr   = 1;
                _SelectingKeyboardActive = true;
                _NameSelections[_NameSelection].FastSelection(true, _SelectingFastPlayerNr);
            }

            //Check mouse-wheel for scrolling
            if (mouseEvent.Wheel != 0)
            {
                if (CHelper.IsInBounds(_NameSelections[_NameSelection].Rect, mouseEvent))
                {
                    int offset = _NameSelections[_NameSelection].Offset + mouseEvent.Wheel;
                    _NameSelections[_NameSelection].UpdateList(offset);
                }
            }

            if (stopSelectingFast)
            {
                _SelectingFast           = false;
                _SelectingFastPlayerNr   = 0;
                _SelectingKeyboardActive = false;
                _NameSelections[_NameSelection].FastSelection(false, -1);
            }
            return(true);
        }
コード例 #27
0
        public override void LoadTheme(string xmlPath)
        {
            bool ressourceOK = true;

            //Vocaluxe-Logo
            ressourceOK &= CDataBase.GetCreditsRessource("Logo_voc.png", ref _TexLogo);

            //Little stars for logo
            ressourceOK &= CDataBase.GetCreditsRessource("PerfectNoteStar.png", ref _TexPerfectNoteStar);

            ressourceOK &= CDataBase.GetCreditsRessource("redDot.png", ref _TexRedDot);
            ressourceOK &= CDataBase.GetCreditsRessource("blueDot.png", ref _TexBlueDot);

            ressourceOK &= CDataBase.GetCreditsRessource("brunzel.png", ref _TexNameBrunzel);
            ressourceOK &= CDataBase.GetCreditsRessource("Darkice.png", ref _TexNameDarkice);
            ressourceOK &= CDataBase.GetCreditsRessource("flokuep.png", ref _TexNameFlokuep);
            ressourceOK &= CDataBase.GetCreditsRessource("flamefire.png", ref _TexNameFlamefire);
            ressourceOK &= CDataBase.GetCreditsRessource("lukeIam.png", ref _TexNameLukeIam);
            ressourceOK &= CDataBase.GetCreditsRessource("bohning.png", ref _TexNameBohning);
            ressourceOK &= CDataBase.GetCreditsRessource("mesand.png", ref _TexNameMesand);
            ressourceOK &= CDataBase.GetCreditsRessource("babene03.png", ref _TexNameBabene03);

            if (!ressourceOK)
            {
                CLog.Fatal("Could not load all ressources!");
            }

            //Prepare Text
            int lastY = 280;

            foreach (string[] paragraph in _Paragraphs)
            {
                string line = "";
                for (int e = 0; e < paragraph.Length; e++)
                {
                    if (paragraph[e] == null)
                    {
                        continue;
                    }
                    string newLine = " " + paragraph[e];
                    CText  text    = GetNewText(75, lastY, -2, 25, -1, EAlignment.Left, EStyle.Bold, "Outline", new SColorF(1, 1, 1, 1), line);
                    text.Visible = false;
                    if (CFonts.GetTextBounds(text).Width < (CSettings.RenderW - 220))
                    {
                        line += newLine;

                        //Check if all words are used
                        if ((e + 1) == paragraph.Length)
                        {
                            text.Text = line;
                            _ParagraphTexts.Add(text);
                            line   = "";
                            lastY += 40;
                        }
                    }
                    else
                    {
                        _ParagraphTexts.Add(text);
                        line   = newLine;
                        lastY += 27;
                    }
                    _AddText(text);
                }
            }

            CBackground bg = new CBackground(_BGTheme, -1);

            bg.LoadSkin();
            _AddBackground(bg);

            //Vocaluxe-Logo
            _Logo = GetNewStatic(_TexLogo, new SColorF(1, 1, 1, 1),
                                 new SRectF((float)(CSettings.RenderW - _TexLogo.OrigSize.Width) / 2, -270, _TexLogo.OrigSize.Width, _TexLogo.OrigSize.Height, -2));
            _AddStatic(_Logo);

            //Little stars for logo
            var numstars = (int)(_Logo.Rect.W * 0.25f / 2f);
            var partRect = new SRectF(_Logo.Rect.X, _Logo.Rect.Y, _Logo.Rect.W, _Logo.Rect.H, -1);

            _StarsRed  = _GetStarParticles(numstars, true, partRect, true);
            _StarsBlue = _GetStarParticles(numstars, false, partRect, true);
            _AddParticleEffect(_StarsRed);
            _AddParticleEffect(_StarsBlue);

            //Credit names
            _CreditNames = new List <CCreditName>();

            _AddNewCreditName(_TexNameBrunzel, 502, 29, true);
            _AddNewCreditName(_TexNameDarkice, 360, 55, true);
            _AddNewCreditName(_TexNameFlokuep, 214, 14, true);
            _AddNewCreditName(_TexNameFlamefire, 496, 46, true);
            _AddNewCreditName(_TexNameLukeIam, 411, 26, true);
            _AddNewCreditName(_TexNameBohning, 383, 54, false);
            _AddNewCreditName(_TexNameMesand, 525, 13, false);
            _AddNewCreditName(_TexNameBabene03, 33, 26, false);

            _AddTranslations();
        }
コード例 #28
0
        public override void SetSmallView(bool SmallView)
        {
            base.SetSmallView(SmallView);

            _SmallView = SmallView;

            if (_SmallView)
            {
                _NumH = _Theme.songMenuTileBoard.numHsmall;
                _NumW = _Theme.songMenuTileBoard.numWsmall;

                _TileW = (int)((_Theme.songMenuTileBoard.TileRectSmall.W - _SpaceW * (_NumW - 1)) / _NumW);
                _TileH = (int)((_Theme.songMenuTileBoard.TileRectSmall.H - _SpaceH * (_NumH - 1)) / _NumH);

                _CoverTexture    = CTheme.GetSkinTexture(_Theme.CoverBackgroundName);
                _CoverBigTexture = CTheme.GetSkinTexture(_Theme.CoverBigBackgroundName);

                _Tiles = new List <CStatic>();
                for (int i = 0; i < _NumH; i++)
                {
                    for (int j = 0; j < _NumW; j++)
                    {
                        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);
                        _Tiles.Add(tile);
                    }
                }

                _Rect       = _Theme.songMenuTileBoard.TileRectSmall;
                _ScrollRect = new SRectF(0, 0, CSettings.iRenderW, CSettings.iRenderH, _Theme.songMenuTileBoard.TileRectSmall.Z);
            }
            else
            {
                _NumH = _Theme.songMenuTileBoard.numH;
                _NumW = _Theme.songMenuTileBoard.numW;

                _TileW = (int)((_Theme.songMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW);
                _TileH = (int)((_Theme.songMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH);

                _CoverTexture    = CTheme.GetSkinTexture(_Theme.CoverBackgroundName);
                _CoverBigTexture = CTheme.GetSkinTexture(_Theme.CoverBigBackgroundName);

                _Tiles = new List <CStatic>();
                for (int i = 0; i < _NumH; i++)
                {
                    for (int j = 0; j < _NumW; j++)
                    {
                        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);
                        _Tiles.Add(tile);
                    }
                }

                _Rect       = _Theme.songMenuTileBoard.TileRect;
                _ScrollRect = new SRectF(0, 0, CSettings.iRenderW, CSettings.iRenderH, _Theme.songMenuTileBoard.TileRect.Z);
            }

            UpdateList(_Offset);
        }
コード例 #29
0
ファイル: CScreenCredits.cs プロジェクト: zhaozw/Vocaluxe
        public override void OnShow()
        {
            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));

            //Little stars for logo
            int numstars = (int)(logo.Rect.W * 0.25f / 2f);

            starsRed  = new CParticleEffect(numstars, new SColorF(1, 0, 0, 1), new SRectF(logo.Rect.X, logo.Rect.Y, logo.Rect.W, logo.Rect.H, -1), _TexPerfectNoteStar, 35, EParticeType.Star);
            starsBlue = new CParticleEffect(numstars, new SColorF(0.149f, 0.415f, 0.819f, 1), new SRectF(logo.Rect.X, logo.Rect.Y, logo.Rect.W, logo.Rect.H, -1), _TexPerfectNoteStar, 35, EParticeType.Star);

            //Credit names
            _CreditNames = new List <CCreditName>();
            CCreditName CreditEntry = new CCreditName();

            //brunzel
            CCreditName CreditEntryBrunzel = new CCreditName();

            CreditEntryBrunzel.image        = new CStatic(_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;
            CreditEntryBrunzel.direction    = EDirection.Left;
            _CreditNames.Add(CreditEntryBrunzel);

            //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.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;
            CreditEntryDarkice.direction    = EDirection.Right;
            _CreditNames.Add(CreditEntryDarkice);

            //flokuep
            CCreditName CreditEntryFlokuep = new CCreditName();

            CreditEntryFlokuep.image        = new CStatic(_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;
            CreditEntryFlokuep.direction    = EDirection.Left;
            _CreditNames.Add(CreditEntryFlokuep);

            //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.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;
            CreditEntryBohning.direction    = EDirection.Right;
            _CreditNames.Add(CreditEntryBohning);

            //mesand
            CCreditName CreditEntryMesand = new CCreditName();

            CreditEntryMesand.image        = new CStatic(_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;
            CreditEntryMesand.direction    = EDirection.Left;
            _CreditNames.Add(CreditEntryMesand);

            //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.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;
            CreditEntryBabene03.direction    = EDirection.Right;
            _CreditNames.Add(CreditEntryBabene03);

            //pantero
            CCreditName CreditEntrypantero = new CCreditName();

            CreditEntrypantero.image        = new CStatic(_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;
            CreditEntrypantero.direction    = EDirection.Left;
            _CreditNames.Add(CreditEntrypantero);

            //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.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;
            CreditEntryPinky007.direction    = EDirection.Right;
            _CreditNames.Add(CreditEntryPinky007);

            TextTimer.Reset();
            LogoTimer.Reset();
            CreditsTimer.Reset();
        }
コード例 #30
0
        public override void SetSmallView(bool SmallView)
        {
            base.SetSmallView(SmallView);

            _SmallView = SmallView;

            if (_SmallView)
            {
                _NumH = _Theme.songMenuTileBoard.numHsmall;
                _NumW = _Theme.songMenuTileBoard.numWsmall;

                _TileW = (int)((_Theme.songMenuTileBoard.TileRectSmall.W - _SpaceW * (_NumW - 1)) / _NumW);
                _TileH = (int)((_Theme.songMenuTileBoard.TileRectSmall.H - _SpaceH * (_NumH - 1)) / _NumH);

                _CoverTexture = CTheme.GetSkinTexture(_Theme.CoverBackgroundName);
                _CoverBigTexture = CTheme.GetSkinTexture(_Theme.CoverBigBackgroundName);

                _Tiles = new List<CStatic>();
                for (int i = 0; i < _NumH; i++)
                {
                    for (int j = 0; j < _NumW; j++)
                    {
                        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);
                        _Tiles.Add(tile);
                    }
                }

                _Rect = _Theme.songMenuTileBoard.TileRectSmall;
                _ScrollRect = new SRectF(0, 0, CSettings.iRenderW, CSettings.iRenderH, _Theme.songMenuTileBoard.TileRectSmall.Z);
            }
            else
            {
                _NumH = _Theme.songMenuTileBoard.numH;
                _NumW = _Theme.songMenuTileBoard.numW;

                _TileW = (int)((_Theme.songMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW);
                _TileH = (int)((_Theme.songMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH);

                _CoverTexture = CTheme.GetSkinTexture(_Theme.CoverBackgroundName);
                _CoverBigTexture = CTheme.GetSkinTexture(_Theme.CoverBigBackgroundName);

                _Tiles = new List<CStatic>();
                for (int i = 0; i < _NumH; i++)
                {
                    for (int j = 0; j < _NumW; j++)
                    {
                        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);
                        _Tiles.Add(tile);
                    }
                }

                _Rect = _Theme.songMenuTileBoard.TileRect;
                _ScrollRect = new SRectF(0, 0, CSettings.iRenderW, CSettings.iRenderH, _Theme.songMenuTileBoard.TileRect.Z);
            }

            UpdateList(_Offset);

        }
コード例 #31
0
ファイル: CSongMenuFramework.cs プロジェクト: da-ka/Vocaluxe
        public virtual bool IsMouseOverSelectedSong(SMouseEvent mEvent)
        {
            CStatic selCov = GetSelectedSongCover();

            return(selCov != null && CHelper.IsInBounds(selCov.Rect.Scale(SelectedTileZoomFactor), mEvent));
        }
コード例 #32
0
        public override bool HandleMouse(MouseEvent MouseEvent)
        {
            base.HandleMouse(MouseEvent);

            if (DragAndDropActive)
            {
                DragAndDropCover.Rect.X += MouseEvent.X - OldMousePosX;
                DragAndDropCover.Rect.Y += MouseEvent.Y - OldMousePosY;
            }
            OldMousePosX = MouseEvent.X;
            OldMousePosY = MouseEvent.Y;

            if (Playlists[htPlaylists(Playlist)].Visible && Playlists[htPlaylists(Playlist)].IsMouseOver(MouseEvent))
            {
                _PlaylistActive = true;
                Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive;
                SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive);
                ToggleSongOptions(ESongOptionsView.None);
            }
            else if (CHelper.IsInBounds(SongMenus[htSongMenus(SongMenu)].Rect, MouseEvent.X, MouseEvent.Y))
            {
                _PlaylistActive = false;
                Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive;
                SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive);
            }


            if (Playlists[htPlaylists(Playlist)].Visible && _PlaylistActive)
            {
                if (Playlists[htPlaylists(Playlist)].HandleMouse(MouseEvent))
                {
                    if (CPlaylists.NumPlaylists != SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].NumValues)
                    {
                        UpdatePlaylistNames();
                    }
                    return(true);
                }
            }


            if (MouseEvent.RB)
            {
                if (_SongOptionsActive)
                {
                    ToggleSongOptions(ESongOptionsView.None);
                    return(true);
                }

                if (CSongs.Category < 0)
                {
                    CGraphics.FadeTo(EScreens.ScreenMain);
                    return(true);
                }
            }

            if (MouseEvent.MB)
            {
                if (CSongs.Category != -1)
                {
                    ToggleSongOptions(ESongOptionsView.None);
                    SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong());
                    return(true);
                }

                if (CSongs.Category == -1)
                {
                    ToggleSongOptions(ESongOptionsView.None);
                    SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory());
                    return(true);
                }
            }

            if (MouseEvent.LD)
            {
                if (CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1)
                {
                    ToggleSongOptions(ESongOptionsView.None);
                    StartVisibleSong(SongMenus[htSongMenus(SongMenu)].GetActualSelection());
                    return(true);
                }
            }

            SongMenus[htSongMenus(SongMenu)].HandleMouse(ref MouseEvent);

            if (MouseEvent.LB)
            {
                if (IsMouseOver(MouseEvent))
                {
                    if (Buttons[htButtons(ButtonOpenOptions)].Selected)
                    {
                        ToggleSongOptions(ESongOptionsView.General);
                        return(true);
                    }

                    if (Buttons[htButtons(ButtonOptionsClose)].Selected)
                    {
                        ToggleSongOptions(ESongOptionsView.None);
                        return(true);
                    }

                    if (Buttons[htButtons(ButtonOptionsSing)].Selected)
                    {
                        ToggleSongOptions(ESongOptionsView.None);
                        StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong());
                        return(true);
                    }

                    if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected)
                    {
                        ToggleSongOptions(ESongOptionsView.None);
                        OpenAndAddPlaylistAction();
                        return(true);
                    }

                    if (Buttons[htButtons(ButtonOptionsRandom)].Selected)
                    {
                        if (CSongs.Category != -1)
                        {
                            SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong());
                            return(true);
                        }
                    }

                    if (Buttons[htButtons(ButtonOptionsRandomCategory)].Selected)
                    {
                        if (CSongs.Category == -1)
                        {
                            SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory());
                            return(true);
                        }
                    }

                    if (Buttons[htButtons(ButtonOptionsSingAll)].Selected)
                    {
                        ToggleSongOptions(ESongOptionsView.None);
                        StartRandomAllSongs();
                        return(true);
                    }

                    if (Buttons[htButtons(ButtonOptionsSingAllVisible)].Selected)
                    {
                        ToggleSongOptions(ESongOptionsView.None);
                        StartRandomVisibleSongs();
                        return(true);
                    }

                    if (Buttons[htButtons(ButtonOptionsOpenPlaylist)].Selected)
                    {
                        ToggleSongOptions(ESongOptionsView.None);
                        OpenPlaylistAction();
                        return(true);
                    }
                }

                if (CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1)
                {
                    if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive)
                    {
                        ToggleSongOptions(ESongOptionsView.Song);
                        return(true);
                    }
                    else
                    {
                        ToggleSongOptions(ESongOptionsView.None);
                        return(true);
                    }
                }
            }

            if (MouseEvent.LBH)
            {
                if (!DragAndDropActive && Playlists[htPlaylists(Playlist)].Visible && CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1)
                {
                    DragAndDropCover        = SongMenus[htSongMenus(SongMenu)].GetSelectedSongCover();
                    DragAndDropCover.Rect.Z = CSettings.zNear;
                    Playlists[htPlaylists(Playlist)].DragAndDropSongID = CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetActualSelection()].ID;
                    DragAndDropActive = true;
                    return(true);
                }
            }


            if (!MouseEvent.LBH && DragAndDropActive)
            {
                DragAndDropActive = false;
                Playlists[htPlaylists(Playlist)].DragAndDropSongID = -1;
                return(true);
            }

            return(true);
        }