Exemplo n.º 1
0
        public override void Draw()
        {
            base.Draw();
            if (Heists.Count == 0)
            {
                return;
            }

            res = UIMenu.GetScreenResolutionMantainRatio();

            var activeWidth = res.Width - SafeSize.X * 2;
            var itemSize    = new Size((int)activeWidth - 515, 40);

            var alpha      = Focused ? 120 : 30;
            var blackAlpha = Focused ? 200 : 100;
            var fullAlpha  = Focused ? 255 : 150;

            var counter = 0;

            for (int i = _minItem; i < Math.Min(Heists.Count, _maxItem); i++)
            {
                ResRectangle.Draw(SafeSize.AddPoints(new Point(0, (itemSize.Height + 3) * counter)), itemSize, (Index == i && Focused) ? Color.FromArgb(fullAlpha, Color.White) : Color.FromArgb(blackAlpha, Color.Black));
                ResText.Draw(Heists[i].Name, SafeSize.AddPoints(new Point(6, 5 + (itemSize.Height + 3) * counter)), 0.35f, Color.FromArgb(fullAlpha, (Index == i && Focused) ? Color.Black : Color.White), Common.EFont.ChaletLondon, false);
                counter++;
            }

            if (Heists[Index].Logo == null || (Heists[Index].Logo.Sprite == null && Heists[Index].Logo.Texture == null))
            {
                drawTexture      = false;
                _noLogo.Position = new Point((int)res.Width - SafeSize.X - 512, SafeSize.Y);
                _noLogo.Color    = Color.FromArgb(blackAlpha, 0, 0, 0);
                _noLogo.Draw();
            }
            else if (Heists[Index].Logo != null && Heists[Index].Logo.Texture != null && !Heists[Index].Logo.IsGameSprite)
            {
                drawTexture = true;
            }
            else if (Heists[Index].Logo != null && Heists[Index].Logo.Sprite != null && Heists[Index].Logo.IsGameSprite)
            {
                drawTexture = false;
                Sprite sprite = Heists[Index].Logo.Sprite;
                sprite.Position = new Point((int)res.Width - SafeSize.X - 512, SafeSize.Y);
                sprite.Color    = Color.FromArgb(blackAlpha, 0, 0, 0);
                sprite.Draw();
            }
            else
            {
                drawTexture = false;
            }

            ResRectangle.Draw(new Point((int)res.Width - SafeSize.X - 512, SafeSize.Y + 256), new Size(512, 40), Color.FromArgb(fullAlpha, Color.Black));
            ResText.Draw(Heists[Index].Name, new Point((int)res.Width - SafeSize.X - 4, SafeSize.Y + 260), 0.5f, Color.FromArgb(fullAlpha, Color.White), Common.EFont.HouseScript, ResText.Alignment.Right, false, false, Size.Empty);

            for (int i = 0; i < Heists[Index].ValueList.Count; i++)
            {
                ResRectangle.Draw(new Point((int)res.Width - SafeSize.X - 512, SafeSize.Y + 256 + 40 + (40 * i)), new Size(512, 40), i % 2 == 0 ? Color.FromArgb(alpha, 0, 0, 0) : Color.FromArgb(blackAlpha, 0, 0, 0));
                var text  = Heists[Index].ValueList[i].Item1;
                var label = Heists[Index].ValueList[i].Item2;


                ResText.Draw(text, new Point((int)res.Width - SafeSize.X - 506, SafeSize.Y + 260 + 42 + (40 * i)), 0.35f, Color.FromArgb(fullAlpha, Color.White), Common.EFont.ChaletLondon, false);
                ResText.Draw(label, new Point((int)res.Width - SafeSize.X - 6, SafeSize.Y + 260 + 42 + (40 * i)), 0.35f, Color.FromArgb(fullAlpha, Color.White), Common.EFont.ChaletLondon, ResText.Alignment.Right, false, false, Size.Empty);
            }

            if (!string.IsNullOrEmpty(Heists[Index].Description))
            {
                var propLen = Heists[Index].ValueList.Count;
                ResRectangle.Draw(new Point((int)res.Width - SafeSize.X - 512, SafeSize.Y + 256 + 42 + 40 * propLen), new Size(512, 2), Color.FromArgb(fullAlpha, Color.White));
                ResText.Draw(Heists[Index].Description, new Point((int)res.Width - SafeSize.X - 508, SafeSize.Y + 256 + 45 + 40 * propLen + 4), 0.35f, Color.FromArgb(fullAlpha, Color.White), Common.EFont.ChaletLondon, ResText.Alignment.Left, false, false, new Size(508, 0));

                int lineCount = TextCommands.GetLineCount(Heists[Index].Description, 0.0f, 0.0f);
                ResRectangle.Draw(new Point((int)res.Width - SafeSize.X - 512, SafeSize.Y + 256 + 44 + 40 * propLen), new Size(512, 45 * lineCount), Color.FromArgb(blackAlpha, 0, 0, 0));
            }
        }