Esempio n. 1
0
        private void _DrawTiles()
        {
            int i = 0;

            foreach (CStatic tilebg in _Tiles)
            {
                if (tilebg.Selected)
                {
                    SRectF selectedrect = new SRectF(_Tile.X, _Tile.Y, _Tile.W, _Tile.H, _Tile.Z);
                    selectedrect.Y = Rect.Y - _ListDragDiffY + i * (_TileCoverH + _TileSpacing);
                    selectedrect   = selectedrect.Scale(SelectedTileZoomFactor);
                    selectedrect.X = (float)Math.Round(selectedrect.X);
                    selectedrect.Y = (float)Math.Round(selectedrect.Y);
                    selectedrect.H = (float)Math.Round(selectedrect.H);
                    selectedrect.W = (float)Math.Round(selectedrect.W);
                    tilebg.MaxRect = selectedrect;
                    tilebg.Color   = _TileSelected.Color;
                    tilebg.Z       = _Tile.Z - 0.1f;
                }
                else
                {
                    tilebg.MaxRect = _Tile.MaxRect;
                    tilebg.Y       = Rect.Y - _ListDragDiffY + i * (_TileCoverH + _TileSpacing);
                    tilebg.Color   = _Tile.Color;
                    tilebg.Z       = _Tile.Z;
                }
                tilebg.Draw();
                i++;
            }
        }
Esempio n. 2
0
        public CNoteBars(int partyModeID, int player, SRectF rect, SThemeSingBar theme)
        {
            _Player      = player;
            _Theme       = theme;
            _PartyModeID = partyModeID;
            Rect         = rect;

            _Color = CBase.Themes.GetPlayerColor(player + 1);

            if (!CBase.Themes.GetColor("NoteLinesColor", _PartyModeID, out _NoteLinesColor))
            {
                _NoteLinesColor = new SColorF(Color.Gray, 0.5f);
            }

            if (!CBase.Themes.GetColor("NoteBaseColor", _PartyModeID, out _NoteBaseColor))
            {
                _NoteBaseColor = new SColorF(Color.White);
            }

            SPlayer playerData = CBase.Game.GetPlayers()[player];

            _Lines = CBase.Game.GetSong().Notes.GetVoice(playerData.VoiceNr).Lines;

            _SemiToneRange = ((CBase.Settings.GetNumNoteLines()) * 2) - 1;

            _SongBaseLine = SetSongBaseLine();

            _NumNoteLines   = (_SemiToneRange + 1) / 2;
            _ToneHeight     = Rect.H / _NumNoteLines;
            _SemiToneHeight = _ToneHeight / 2;
            _NoteWidth      = _ToneHeight * 2f;
            _AddNoteHeight  = _ToneHeight / 2f * (2f - (int)CBase.Profiles.GetDifficulty(playerData.ProfileID));
        }
Esempio n. 3
0
 public CStatic(int partyModeID, string textureSkinName, SColorF color, SRectF rect)
 {
     _PartyModeID = partyModeID;
     _Theme.Skin  = textureSkinName;
     Color        = color;
     MaxRect      = rect;
 }
Esempio n. 4
0
        private void _DrawNote(SRectF rect, SColorF color, CTextureRef noteBegin, CTextureRef noteMiddle, CTextureRef noteEnd, float factor)
        {
            if (factor <= 0 || rect.X > Rect.X + Rect.W || rect.X + rect.W < Rect.X)
            {
                return;
            }

            //Width-related variables rounded and then floored to prevent 1px gaps in notes
            rect.X = (float)Math.Round(rect.X);
            rect.W = (float)Math.Round(rect.W);

            int dh = (int)((1f - factor) * rect.H / 2);
            int dw = (int)Math.Min(dh, rect.W / 2);

            var noteRect     = new SRectF(rect.X + dw, rect.Y + dh, rect.W - 2 * dw, rect.H - 2 * dh, rect.Z);
            var noteBoundary = noteRect;

            if (noteBoundary.X < Rect.X)
            {
                noteBoundary.X  = Rect.X;
                noteBoundary.W -= Rect.X - noteBoundary.X;
            }
            if (noteBoundary.X + noteBoundary.W > Rect.X + Rect.W)
            {
                noteBoundary.W -= (noteBoundary.X + noteBoundary.W) - (Rect.X + Rect.W);
            }

            //Width of each of the ends (round parts)
            //Need 2 of them so use minimum
            int endsW = (int)Math.Min(noteRect.H * noteBegin.OrigAspect, noteRect.W / 2);

            CBase.Drawing.DrawTexture(noteBegin, new SRectF(noteRect.X, noteRect.Y, endsW, noteRect.H, noteRect.Z), color, noteBoundary, false, false);

            SRectF middleRect = new SRectF(noteRect.X + endsW, noteRect.Y, noteRect.W - 2 * endsW, noteRect.H, noteRect.Z);

            int midW = (int)Math.Round(noteRect.H * noteMiddle.OrigAspect);

            int midCount = (int)middleRect.W / midW;

            for (int i = 0; i < midCount; ++i)
            {
                CBase.Drawing.DrawTexture(noteMiddle, new SRectF(middleRect.X + (i * midW), noteRect.Y, midW, noteRect.H, noteRect.Z), color, noteBoundary, false, false);
            }

            SRectF lastMidRect = new SRectF(middleRect.X + midCount * midW, noteRect.Y, middleRect.W - (midCount * midW), noteRect.H, noteRect.Z);

            if (lastMidRect.X + lastMidRect.W > Rect.X + Rect.W)
            {
                lastMidRect.W -= (lastMidRect.X + lastMidRect.W) - (Rect.X + Rect.W);
            }
            else if (lastMidRect.X < Rect.X)
            {
                lastMidRect.X  = Rect.X;
                lastMidRect.W -= Rect.X - lastMidRect.X;
            }

            CBase.Drawing.DrawTexture(noteMiddle, new SRectF(middleRect.X + (midCount * midW), middleRect.Y, midW, middleRect.H, middleRect.Z), color, lastMidRect, false, false);

            CBase.Drawing.DrawTexture(noteEnd, new SRectF(noteRect.X + noteRect.W - endsW, noteRect.Y, endsW, noteRect.H, noteRect.Z), color, noteBoundary, false, false);
        }
Esempio n. 5
0
        private void _DrawNormalNote(CSongNote note, SColorF color)
        {
            SRectF rect = _GetNoteRect(note);

            _DrawNoteBG(rect, color);
            _DrawNoteBase(rect, new SColorF(_NoteBaseColor, _NoteBaseColor.A * Alpha), 1f);
        }
Esempio n. 6
0
        public override bool Draw()
        {
            DrawBG();

            if (!CheckMicConfig())
            {
                Statics[htStatics(StaticWarning)].Visible = true;
                Texts[htTexts(TextWarning)].Visible       = true;
            }
            else
            {
                Statics[htStatics(StaticWarning)].Visible = false;
                Texts[htTexts(TextWarning)].Visible       = false;
            }

            for (int i = 0; i < StaticEnergyChannel.Length; i++)
            {
                if (ChannelEnergy[i] > 0f)
                {
                    SRectF rect = new SRectF(Statics[htStatics(StaticEnergyChannel[i])].Rect.X,
                                             Statics[htStatics(StaticEnergyChannel[i])].Rect.Y,
                                             Statics[htStatics(StaticEnergyChannel[i])].Rect.W * ChannelEnergy[i],
                                             Statics[htStatics(StaticEnergyChannel[i])].Rect.H,
                                             Statics[htStatics(StaticEnergyChannel[i])].Rect.Z);

                    CDraw.DrawTexture(Statics[htStatics(StaticEnergyChannel[i])].Texture, Statics[htStatics(StaticEnergyChannel[i])].Rect,
                                      new SColorF(1f, 1f, 1f, 1f), rect);
                }
            }

            DrawFG();

            return(true);
        }
Esempio n. 7
0
        private CParticleEffect _GetStarParticles(int numStars, bool isRed, SRectF rect, bool bigParticles)
        {
            SColorF partColor = isRed ? new SColorF(1, 0, 0, 1) : new SColorF(0.149f, 0.415f, 0.819f, 1);
            int     partSize  = bigParticles ? 35 : 25;

            return(GetNewParticleEffect(numStars, partColor, rect, _TexPerfectNoteStar, partSize, EParticleType.Star));
        }
Esempio n. 8
0
        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;
            }
        }
Esempio n. 9
0
        public CSelectSlide()
        {
            _Theme       = new SThemeSelectSlide();
            _ThemeLoaded = false;

            Rect           = new SRectF();
            RectArrowLeft  = new SRectF();
            RectArrowRight = new SRectF();

            Color  = new SColorF();
            SColor = new SColorF();

            ColorArrow  = new SColorF();
            SColorArrow = new SColorF();

            TextColor  = new SColorF();
            STextColor = new SColorF();
            TextH      = 1f;
            MaxW       = 0f;

            _Selected     = false;
            _Textures     = new List <STexture>();
            _ValueIndexes = new List <int>();
            _ValueNames   = new List <string>();
        }
Esempio n. 10
0
        public CText(float x, float y, float z, float h, float mw, EAlignment align, EStyle style, string fontFamily, SColorF col, string text, int partyModeID = -1,
                     float rheight = 0,
                     float rspace  = 0) : this(partyModeID)
        {
            _Theme = new SThemeText {
                FontFamily = fontFamily, FontStyle = style, FontHeight = h, Text = text, Color = { A = col.A, B = col.B, G = col.G, R = col.R }
            };
            ThemeLoaded = false;
            _ButtonText = false;

            MaxRect      = new SRectF(x, y, mw, h, z);
            Align        = align;
            ResizeAlign  = EHAlignment.Center;
            _Font.Name   = fontFamily;
            _Font.Style  = style;
            _Font.Height = h;

            Color    = col;
            SelColor = col;

            Text = text;

            Selected = false;

            _ReflectionSpace  = rspace;
            _ReflectionHeight = rheight;
        }
Esempio n. 11
0
 public SRectF(SRectF Obj_)
 {
     Left   = Obj_.Left;
     Right  = Obj_.Right;
     Bottom = Obj_.Bottom;
     Top    = Obj_.Top;
 }
Esempio n. 12
0
        private void _AddGoldenNote(SRectF noteRect)
        {
            var numstars = (int)(noteRect.W * 0.25f);
            var stars    = new CParticleEffect(_PartyModeID, numstars, new SColorF(Color.Yellow), noteRect, _Theme.SkinGoldenStar, 20, EParticleType.Star);

            _GoldenStars.Add(stars);
        }
Esempio n. 13
0
        private void _DrawNote(SRectF rect, SColorF color, float factor)
        {
            if (factor <= 0)
            {
                return;
            }

            float dh = (1f - factor) * rect.H / 2;
            float dw = Math.Min(dh, rect.W / 2);

            var noteRect = new SRectF(rect.X + dw, rect.Y + dh, rect.W - 2 * dw, rect.H - 2 * dh, rect.Z);

            CTextureRef noteBegin  = CBase.Themes.GetSkinTexture(_Theme.SkinLeft, _PartyModeID);
            CTextureRef noteMiddle = CBase.Themes.GetSkinTexture(_Theme.SkinMiddle, _PartyModeID);
            CTextureRef noteEnd    = CBase.Themes.GetSkinTexture(_Theme.SkinRight, _PartyModeID);

            //Width of each of the ends (round parts)
            //Need 2 of them so use minimum
            float endsW = Math.Min(noteRect.H * noteBegin.OrigAspect, noteRect.W / 2);

            CBase.Drawing.DrawTexture(noteBegin, new SRectF(noteRect.X, noteRect.Y, endsW, noteRect.H, noteRect.Z), color);

            var middleRect = new SRectF(noteRect.X + endsW, noteRect.Y, noteRect.W - 2 * endsW, noteRect.H, noteRect.Z);

            if (noteRect.W >= 4 * endsW)
            {
                CBase.Drawing.DrawTexture(noteMiddle, middleRect, color);
            }
            else
            {
                CBase.Drawing.DrawTexture(noteMiddle, new SRectF(middleRect.X, middleRect.Y, 2 * endsW, middleRect.H, middleRect.Z), color, middleRect);
            }

            CBase.Drawing.DrawTexture(noteEnd, new SRectF(noteRect.X + noteRect.W - endsW, noteRect.Y, endsW, noteRect.H, noteRect.Z), color);
        }
Esempio n. 14
0
        private void _DrawCovers()
        {
            int i = 0;

            foreach (CStatic cover in _Covers)
            {
                EAspect aspect = (cover.Texture != _CoverBGTexture) ? EAspect.Crop : EAspect.Stretch;
                if (cover.Selected)
                {
                    SRectF selectedrect = new SRectF(_Tile.X, _Tile.Y, _Tile.H, _Tile.H, _Tile.Z);
                    selectedrect.Y = Rect.Y - _ListDragDiffY + i * (_TileCoverH + _TileSpacing);
                    selectedrect   = selectedrect.Scale(SelectedTileZoomFactor);
                    selectedrect.X = MaxRect.X - (MaxRect.W * (SelectedTileZoomFactor - 1) / 2);
                    selectedrect.Y = (float)Math.Round(selectedrect.Y);
                    selectedrect.H = (float)Math.Round(selectedrect.H);
                    selectedrect.W = (float)Math.Round(selectedrect.W);
                    selectedrect.X = MaxRect.X - (MaxRect.W * (SelectedTileZoomFactor - 1) / 2);
                    cover.MaxRect  = selectedrect;
                    cover.Color.A  = 1f;
                    cover.Z        = Rect.Z - 0.1f;
                    cover.Draw();
                }
                else
                {
                    cover.MaxRect = new SRectF(_Tile.X, _Tile.Y, _Tile.H, _Tile.H, _Tile.Z);
                    cover.Y       = Rect.Y - _ListDragDiffY + i * (_TileCoverH + _TileSpacing);
                    cover.Color.A = 0.5f;
                    cover.Draw(aspect);
                }
                i++;
            }
        }
Esempio n. 15
0
        private void _DrawZoomedNote(CBaseNote zoomNote, int endBeat)
        {
            float diff = endBeat - zoomNote.StartBeat;

            if (diff <= 0f)
            {
                diff = 1f;
            }

            float p = 1f - (_CurrentBeat - zoomNote.StartBeat) / diff;

            if (p < 0)
            {
                p = 0;
            }

            float ty = _Text.Y;
            float th = _Text.Font.Height;
            float tz = _Text.Z;

            SRectF normalRect = _Text.Rect;

            _Text.Font.Height *= 1f + p * 0.4f;
            _Text.X           -= (_Text.Rect.W - normalRect.W) / 2f;
            _Text.Y           -= (_Text.Rect.H - normalRect.H) / 2f;
            _Text.Z           -= 0.1f;
            _Text.Color        = _ColorProcessed;


            _Text.Draw();

            _Text.Y           = ty;
            _Text.Font.Height = th;
            _Text.Z           = tz;
        }
Esempio n. 16
0
        public void Draw(EAspect aspect, float scale = 1f, float zModify = 0f, bool forceDraw = false)
        {
            CTextureRef texture = Texture;
            SRectF      bounds  = Rect.Scale(scale);

            bounds.Z += zModify;
            SRectF rect  = texture == null ? bounds : CHelper.FitInBounds(bounds, texture.OrigAspect, aspect);
            var    color = new SColorF(Color.R, Color.G, Color.B, Color.A * Alpha);

            if (Visible || forceDraw || (CBase.Settings.GetProgramState() == EProgramState.EditTheme))
            {
                if (texture != null)
                {
                    CBase.Drawing.DrawTexture(texture, rect, color, bounds);
                    if (Reflection)
                    {
                        CBase.Drawing.DrawTextureReflection(texture, rect, color, bounds, ReflectionSpace, ReflectionHeight);
                    }
                }
                else
                {
                    CBase.Drawing.DrawRect(color, rect);
                }
            }

            if (Selected && (CBase.Settings.GetProgramState() == EProgramState.EditTheme))
            {
                CBase.Drawing.DrawRect(new SColorF(1f, 1f, 1f, 0.5f), rect);
            }
        }
Esempio n. 17
0
        private void AddGoldenNote(SRectF Rect, int n, int Nr, float factor)
        {
            const int spacing = 0;

            if (Nr > _PlayerNotes[n].GoldenStars.Count)
            {
                float d  = (1f - factor) / 2 * Rect.H;
                float dw = d;

                if (2 * dw > Rect.W)
                {
                    dw = Rect.W / 2;
                }

                SRectF r = new SRectF(
                    Rect.X + dw + spacing,
                    Rect.Y + d + spacing,
                    Rect.W - 2 * dw - 2 * spacing,
                    Rect.H - 2 * d - 2 * spacing,
                    Rect.Z
                    );

                int             numstars = (int)(r.W * 0.25f);
                CParticleEffect stars    = new CParticleEffect(numstars, new SColorF(1f, 1f, 0f, 1f), r, _Theme.SkinGoldenStarName, 20, EParticeType.Star);
                _PlayerNotes[n].GoldenStars.Add(stars);
            }
        }
Esempio n. 18
0
        /// <summary>
        ///     Creates a new texture reference
        /// </summary>
        /// <param name="id">ID of the texture</param>
        /// <param name="origSize">Original size (Bitmap size)</param>
        public CTextureRef(int id, Size origSize)
        {
            ID       = id;
            OrigSize = origSize;

            Rect = new SRectF(0f, 0f, origSize.Width, origSize.Height, 0f);
        }
Esempio n. 19
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();
        }
Esempio n. 20
0
        public void LoadSkin()
        {
            _Theme.Color.Get(_PartyModeID, out _Color);
            _Theme.SelColor.Get(_PartyModeID, out _SelColor);
            _Theme.ArrowColor.Get(_PartyModeID, out _ColorArrow);
            _Theme.ArrowSelColor.Get(_PartyModeID, out _SelColorArrow);
            _Theme.TextColor.Get(_PartyModeID, out _TextColor);
            _Theme.TextSelColor.Get(_PartyModeID, out _SelTextColor);

            MaxRect        = _Theme.Rect;
            RectArrowLeft  = _Theme.RectArrowLeft;
            RectArrowRight = _Theme.RectArrowRight;

            NumVisible = _Theme.NumVisible;

            _TextH         = _Theme.TextH;
            _TextRelativeX = _Theme.TextRelativeX;
            _TextRelativeY = _Theme.TextRelativeY;
            _MaxW          = _Theme.TextMaxW;

            _Texture           = CBase.Themes.GetSkinTexture(_Theme.Skin, _PartyModeID);
            _TextureArrowLeft  = CBase.Themes.GetSkinTexture(_Theme.SkinArrowLeft, _PartyModeID);
            _TextureArrowRight = CBase.Themes.GetSkinTexture(_Theme.SkinArrowRight, _PartyModeID);

            _SelTexture           = CBase.Themes.GetSkinTexture(_Theme.SkinSelected, _PartyModeID);
            _SelTextureArrowLeft  = CBase.Themes.GetSkinTexture(_Theme.SkinArrowLeftSelected, _PartyModeID);
            _SelTextureArrowRight = CBase.Themes.GetSkinTexture(_Theme.SkinArrowRightSelected, _PartyModeID);
            _Invalidate();
        }
Esempio n. 21
0
        public void Draw()
        {
            if (_Bars == null || _Theme.Style != EEqualizerStyle.Columns)
            {
                return;
            }

            float dx       = Rect.W / _Bars.Length;
            float scaleVal = (_Bars[_MaxBar] < 0.00001f) ? 0f : 1 / _Bars[_MaxBar];

            for (int i = 0; i < _Bars.Length; i++)
            {
                float   value = _Bars[i] * scaleVal;
                var     bar   = new SRectF(Rect.X + dx * i, Rect.Y + Rect.H - value * Rect.H, dx - Space, value * Rect.H, Rect.Z);
                SColorF color = Color;
                if (i == _MaxBar)
                {
                    color = MaxColor;
                }

                CBase.Drawing.DrawRect(color, bar);

                if (Reflection)
                {
                    CBase.Drawing.DrawRectReflection(color, bar, ReflectionSpace, ReflectionHeight);
                }
            }
        }
Esempio n. 22
0
        public CText(float x, float y, float z, float h, float mw, EAlignment align, EStyle style, string font, SColorF col, string text)
        {
            _Theme       = new SThemeText();
            _ThemeLoaded = false;
            _ButtonText  = false;

            X        = x;
            Y        = y;
            Z        = z;
            Height   = h;
            MaxWidth = mw;
            Align    = align;
            Style    = style;
            Fon      = font;

            Color  = col;
            SColor = new SColorF(col);

            Text = text;

            Selected = false;

            if (MaxWidth > 0)
            {
                Bounds = new SRectF(-CSettings.iRenderW, -CSettings.iRenderH, MaxWidth, 3f * CSettings.iRenderH, 0f);
            }
            else
            {
                Bounds = new SRectF(-CSettings.iRenderW, -CSettings.iRenderH, 3f * CSettings.iRenderW, 3f * CSettings.iRenderH, 0f);
            }

            Reflection = false;
        }
Esempio n. 23
0
        public CSelectSlide(CSelectSlide slide)
        {
            _PartyModeID = slide._PartyModeID;
            _Theme       = slide._Theme;

            ThemeLoaded = false;

            MaxRect        = slide.MaxRect;
            RectArrowLeft  = slide.RectArrowLeft;
            RectArrowRight = slide.RectArrowRight;

            _Color    = slide._Color;
            _SelColor = slide._SelColor;

            _ColorArrow    = slide._ColorArrow;
            _SelColorArrow = slide._SelColorArrow;

            _TextColor     = slide._TextColor;
            _SelTextColor  = slide._SelTextColor;
            _TextH         = slide._TextH;
            _TextRelativeX = slide._TextRelativeX;
            _TextRelativeY = slide._TextRelativeY;
            _MaxW          = slide._MaxW;

            _Values.AddRange(slide._Values);
            _Selection  = slide._Selection;
            _NumVisible = slide._NumVisible;

            DrawTextures = slide.DrawTextures;
            Visible      = slide.Visible;
        }
Esempio n. 24
0
        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)
        {
            _Theme       = new SThemeText();
            _ThemeLoaded = false;
            _ButtonText  = false;

            X        = x;
            Y        = y;
            Z        = z;
            Height   = h;
            MaxWidth = mw;
            Align    = align;
            Style    = style;
            Fon      = font;

            Color  = new SColorF(r, g, b, a);
            SColor = new SColorF(r, g, b, a);

            Text = text;

            Selected = false;

            if (MaxWidth > 0)
            {
                Bounds = new SRectF(-CSettings.iRenderW, -CSettings.iRenderH, MaxWidth, 3f * CSettings.iRenderH, 0f);
            }
            else
            {
                Bounds = new SRectF(-CSettings.iRenderW, -CSettings.iRenderH, 3f * CSettings.iRenderW, 3f * CSettings.iRenderH, 0f);
            }

            Reflection       = true;
            ReflectionSpace  = rspace;
            ReflectionHeight = rheight;
        }
Esempio n. 25
0
        public CText()
        {
            _Theme       = new SThemeText();
            _ThemeLoaded = false;
            _ButtonText  = false;

            X        = 0f;
            Y        = 0f;
            Z        = 0f;
            Height   = 1f;
            MaxWidth = 0f;
            Bounds   = new SRectF();
            Align    = EAlignment.Left;
            Style    = EStyle.Normal;
            Fon      = "Normal";

            Color            = new SColorF();
            SColor           = new SColorF();
            Reflection       = false;
            ReflectionSpace  = 0f;
            ReflectionHeight = 0f;

            Text     = String.Empty;
            Selected = false;
            Visible  = true;
            Alpha    = 1f;
        }
Esempio n. 26
0
        public CText(CText text)
        {
            _Theme       = new SThemeText();
            _ThemeLoaded = false;
            _ButtonText  = false;

            X        = text._X;
            Y        = text._Y;
            Z        = text._Z;
            Height   = text._Height;
            MaxWidth = text._MaxWidth;
            Bounds   = new SRectF(text._Bounds);
            Align    = text._Align;
            HAlign   = text._HAlign;
            Style    = text._Style;
            Fon      = text._Fon;

            Color            = new SColorF(text.Color);
            SColor           = new SColorF(text.SColor);
            Reflection       = text.Reflection;
            ReflectionSpace  = text.ReflectionSpace;
            ReflectionHeight = text.ReflectionHeight;

            Text     = text._Text;
            Selected = text.Selected;
            Visible  = text.Visible;
            Alpha    = text.Alpha;

            EditMode = text.EditMode;
        }
Esempio n. 27
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;
        }
Esempio n. 28
0
        public override void Draw()
        {
            foreach (CStatic tile in _Tiles)
            {
                if (tile.Selected)
                {
                    tile.Draw(EAspect.Crop, SelectedTileZoomFactor, -0.1f);
                }
                else
                {
                    EAspect aspect = (tile.Texture != _CoverBGTexture) ? EAspect.Crop : EAspect.Stretch;
                    tile.Draw(aspect);
                }
            }

            //highlight the text of the selected song
            int i = 0;

            foreach (CText text in _Texts)
            {
                if (i < _Tiles.Count && _Tiles[i].Selected)
                {
                    text.Font.Style = EStyle.BoldItalic;
                }
                else if (i < _Tiles.Count)
                {
                    text.Font.Style = EStyle.Normal;
                }
                else
                {
                    text.Text = "";
                }
                text.Draw();
                i++;
            }
            _TextBG.Draw();

            CTextureRef vidtex = CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null;

            if (vidtex != null)
            {
                if (vidtex.Color.A < 1)
                {
                    _CoverBig.Draw(EAspect.Crop);
                }
                SRectF rect = CHelper.FitInBounds(_CoverBig.Rect, vidtex.OrigAspect, EAspect.Crop);
                CBase.Drawing.DrawTexture(vidtex, rect, vidtex.Color, _CoverBig.Rect);
                CBase.Drawing.DrawTextureReflection(vidtex, rect, vidtex.Color, _CoverBig.Rect, _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight);
            }
            else
            {
                _CoverBig.Draw(EAspect.Crop);
            }

            foreach (IMenuElement element in _SubElements)
            {
                element.Draw();
            }
        }
Esempio n. 29
0
 protected void DrawNoteLines(SRectF Rect, SColorF Color)
 {
     for (int i = 0; i < CSettings.NumNoteLines - 1; i++)
     {
         float y = Rect.Y + Rect.H / CSettings.NumNoteLines * (i + 1);
         CDraw.DrawColor(Color, new SRectF(Rect.X, y, Rect.W, 1, -0.5f));
     }
 }
Esempio n. 30
0
        public void MoveElement(int stepX, int stepY)
        {
            SRectF rect = Rect;

            rect.X += stepX;
            rect.Y += stepY;
            UpdateRect(rect);
        }