Exemple #1
0
        public override void DrawPopup()
        {
            //PopUp-Menü zeichnen
            base.DrawPopup();


            //Überprüfen ob Waffe/Rüstung vorhanden, ansonsten leeres-Objekt erzeugen
            Item tempWeap;

            if (P.Weapon != null)
            {
                tempWeap = P.Weapon;
            }
            else
            {
                tempWeap = new EmptyItem();
            }

            Item tempArmor;

            if (P.Armor != null)
            {
                tempArmor = P.Armor;
            }
            else
            {
                tempArmor = new EmptyItem();
            }

            //Festlegen der Größe
            SetBitmapAndTileSize(tempWeap.ItemBitmap);

            //Zeichnen der Markierung
            DrawCurrentSelectedItemHighlight();
            //Daten für Position/Größe
            yPos = 1;

            xPadding = TileSize;

            //Überschrift des Pop-Ups zeichnen
            DrawHeader("Inventar");


            //Ausgerüstete Waffe inklusive Equip-Zeichen zeichnen
            DrawItem(tempWeap);
            Context.DrawString("E", SystemFonts.DefaultFont, Brushes.Yellow, xPosItemBitmap + ItemBitmapSize * 0.65f, yPosItemBitmap + ItemBitmapSize - (ItemBitmapSize / 2));

            yPos++;

            DrawHorizontalSeperatorLine(new Pen(IconBackgroundBrush, ItemBitmapSize / 16), GetMenuRectangle().Top + GetMenuRectangle().Height *0.10f);

            //Ausgerüstete Armor inklusive Equip-Zeichen zeichnen
            DrawItem(tempArmor);
            Context.DrawString("E", SystemFonts.DefaultFont, Brushes.Yellow, xPosItemBitmap + ItemBitmapSize * 0.65f, yPosItemBitmap + ItemBitmapSize - (ItemBitmapSize / 2));

            yPos++;

            DrawHorizontalSeperatorLine(new Pen(IconBackgroundBrush, ItemBitmapSize / 16), yPosItemBitmap + ItemBitmapSize * 1.5f);

            yPos++;
            for (int i = 0; i < P.InventorySpace; i++)
            {
                Item tempItem;

                if (P.Items.Count > 0 && i < P.Items.Count)
                {
                    if (P.Items[i] != null)
                    {
                        tempItem = P.Items[i];
                    }
                    else
                    {
                        tempItem = new EmptyItem();
                    }
                }
                else
                {
                    tempItem = new EmptyItem();
                }

                DrawItem(tempItem);
                yPos++;
            }


            //Zeichnen der Detail-Box
            if (itemSelected)
            {
                DrawItemDetailBox();
                DrawVerticalSeperatorLine(new Pen(IconBackgroundBrush, ItemBitmapSize / 16), GetMenuRectangleF().Right - 1);
                DrawCurrentItemName();
            }
        }
        public override void DrawPopup()
        {
            //PopUp-Menü zeichnen
            base.DrawPopup();

            itemBitmapSize = (float)(tileSize + PopupSizeX * 0.06);

            //Überprüfen ob Waffe/Rüstung vorhanden, ansonsten leeres-Objekt erzeugen
            Item tempWeap;

            if (p.Weapon != null)
            {
                tempWeap = p.Weapon;
            }
            else
            {
                tempWeap = new EmptyItem();
            }

            Item tempArmor;

            if (p.Armor != null)
            {
                tempArmor = p.Armor;
            }
            else
            {
                tempArmor = new EmptyItem();
            }

            //Daten für Position/Größe
            yPos     = 1;
            tileSize = tempWeap.ItemBitmap.Width;
            xPadding = tileSize;

            //Iconposition Ausgerüstete Waffe
            DrawHeader("Inventar");

            DrawItem(tempWeap);


            yPos++;

            DrawSeperatorLine(new Pen(iconBackgroundBrush, itemBitmapSize / 16), yPosItemBitmap - itemBitmapSize * 0.75f);

            //Iconposition ausgerüstete Rüstung
            DrawItem(tempArmor);
            //Context.DrawImage(tempArmor.ItemBitmap, xPosItemBitmap, yPosItemBitmap, itemBitmapSize, itemBitmapSize);

            yPos++;

            //Context.DrawLine(new Pen(Color.DarkGray,itemBitmapSize/16),GetMenuRectangle().X, yPosItemBitmap+itemBitmapSize*1.5f, GetMenuRectangleF().Right, yPosItemBitmap+itemBitmapSize*1.5f);
            DrawSeperatorLine(new Pen(iconBackgroundBrush, itemBitmapSize / 16), yPosItemBitmap + itemBitmapSize * 1.5f);

            yPos++;
            for (int i = 0; i < p.InventorySpace; i++)
            {
                Item tempItem;

                if (p.Items.Count > 0 && i < p.Items.Count)
                {
                    if (p.Items[i] != null)
                    {
                        tempItem = p.Items[i];
                    }
                    else
                    {
                        tempItem = new EmptyItem();
                    }
                }
                else
                {
                    tempItem = new EmptyItem();
                }

                DrawItem(tempItem);
                yPos++;
            }
        }