public override void Draw(Graphics g, double deltaTime)
        {
            var l = GetLocation(Size.X, Size.Y, Alignment);
            var x = l.X + WorldLocation.X;
            var y = l.Y + WorldLocation.Y;

            Color4 color = new Color4(0.5f, 0.5f, 0.5f, 0.65f);

            if (userData.Items[ItemIndex] != null && !resources.Objects.ContainsKey(userData.Items[ItemIndex].Info.Hash))
            {
                if (IsMouseOn)
                {
                    color = new Color4(0.75f, 0.5f, 0.5f, 0.65f);
                }
                else
                {
                    color = new Color4(0.6f, 0.4f, 0.4f, 0.65f);
                }
            }
            else if (ItemIndex >= userData.MaxItemCount)
            {
                color = new Color4(0.5f, 0.5f, 0.75f, 0.65f);
            }
            else if (IsMouseOn)
            {
                color = new Color4(0.75f, 0.75f, 0.75f, 0.65f);
            }

            Drawer.FillRect(new Vector2(x, y), Size, color);
            Drawer.DrawRect(new Vector2(x, y), Size, Color4.Gray);

            if (userData.Items[ItemIndex] != null)
            {
                var item = userData.Items[ItemIndex];

                Drawer.ScriptDrawer.Texture = userData.Items[ItemIndex].Info.bitmap;
                Drawer.ScriptDrawer.Color   = Color4.White;
                Drawer.ScriptDrawer.DrawTexture(new RectangleF(x + 24.0f, y + 24.0f, Size.X, Size.Y));

                if (IsMouseOn)
                {
                    var ns = g.MeasureString(item.Info.Name, ControlDrawer.fontSmallB);
                    ControlDrawer.DrawFrame(x + 48.0f, y - ns.Height - 8.0f, ns.Width + 8.0f, ns.Height + 8.0f);
                    g.DrawString(item.Info.Name, ControlDrawer.fontSmallB, Brushes.White, x + 48.0f + 4.0f, y - ns.Height - 8.0f + 4.0f);
                }

                if (item.Number > 1)
                {
                    var s = g.MeasureString(item.Number.ToString(), ControlDrawer.fontSmallB);
                    g.DrawString(item.Number.ToString(), ControlDrawer.fontSmallB, Brushes.White, x + 48.0f - s.Width, y + 48.0f - s.Height);
                }
            }
        }
示例#2
0
        protected override void Draw(double deltaTime, Camera camera)
        {
            var g     = Drawer.BindGraphicsDraw();
            var white = new Color4(1.0f, 1.0f, 1.0f, rate);
            var black = new Color4(0.0f, 0.0f, 0.0f, rate);

            if (rate > 0.0f)
            {
                g.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(black.ToArgb())), new System.Drawing.Rectangle(0, 0, MMW.ClientSize.Width, MMW.ClientSize.Height));

                ControlDrawer.DrawString(g, "Now Loading...", MMW.ClientSize.Width - 200, MMW.ClientSize.Height - 48, white);
                if (!string.IsNullOrWhiteSpace(mes.mes))
                {
                    ControlDrawer.DrawString(g, mes.mes, 20, MMW.ClientSize.Height - 48, white);
                }

                Drawer.IsGraphicsUsed = true;
            }
        }