Example #1
0
        public mnuInventory(string name, Enums.InvMenuType menuType, int itemSelected)
            : base(name)
        {
            base.Size          = new Size(315, 360);
            base.MenuDirection = Enums.MenuDirection.Vertical;
            base.Location      = new Point(10, 40);

            itemPicker          = new Widgets.MenuItemPicker("itemPicker");
            itemPicker.Location = new Point(18, 63);

            lblInventory           = new Label("lblInventory");
            lblInventory.AutoSize  = true;
            lblInventory.Font      = FontManager.LoadFont("PMDCP", 48);
            lblInventory.Text      = "Inventory";
            lblInventory.ForeColor = Color.WhiteSmoke;
            lblInventory.Location  = new Point(20, 0);

            picPreview           = new PictureBox("picPreview");
            picPreview.Size      = new Size(32, 32);
            picPreview.BackColor = Color.Transparent;
            picPreview.Location  = new Point(255, 20);

            lblItemNum = new Label("lblItemNum");
            //lblItemNum.Size = new Size(100, 30);
            lblItemNum.AutoSize  = true;
            lblItemNum.Location  = new Point(182, 15);
            lblItemNum.Font      = FontManager.LoadFont("PMDCP", 32);
            lblItemNum.BackColor = Color.Transparent;
            lblItemNum.ForeColor = Color.WhiteSmoke;
            lblItemNum.Text      = "0/" + ((MaxInfo.MaxInv - 1) / 10 + 1);

            lblVisibleItems = new Label[10];
            for (int i = 0; i < lblVisibleItems.Length; i++)
            {
                lblVisibleItems[i] = new Label("lblVisibleItems" + i);
                //lblVisibleItems[i].AutoSize = true;
                lblVisibleItems[i].Size     = new Size(200, 32);
                lblVisibleItems[i].Font     = FontManager.LoadFont("PMDCP", 32);
                lblVisibleItems[i].Location = new Point(35, (i * 30) + 48);
                //lblVisibleItems[i].HoverColor = Color.Red;
                lblVisibleItems[i].ForeColor  = Color.WhiteSmoke;
                lblVisibleItems[i].AllowDrop  = true;
                lblVisibleItems[i].DragDrop  += new EventHandler <DragEventArgs>(lblVisibleItems_DragDrop);
                lblVisibleItems[i].MouseDown += new EventHandler <MouseButtonEventArgs>(lblVisibleItems_MouseDown);
                lblVisibleItems[i].Click     += new EventHandler <SdlDotNet.Widgets.MouseButtonEventArgs>(inventoryItem_Click);
                this.AddWidget(lblVisibleItems[i]);
            }

            this.AddWidget(picPreview);
            this.AddWidget(itemPicker);
            this.AddWidget(lblInventory);
            this.AddWidget(lblItemNum);

            mode       = menuType;
            currentTen = (itemSelected - 1) / 10;
            DisplayItems(currentTen * 10 + 1);
            ChangeSelected((itemSelected - 1) % 10);
            UpdateSelectedItemInfo();
        }
        public mnuShopItemSelected(string name, int itemNum, int itemSlot, Enums.InvMenuType transactionType)
            : base(name)
        {
            transaction = transactionType;


            base.Size = new Size(185, 125);

            base.MenuDirection = Enums.MenuDirection.Horizontal;
            if (transaction == Enums.InvMenuType.Buy)
            {
                base.Location = new Point(435, 40);
            }
            else
            {
                base.Location = new Point(335, 40);
            }

            itemPicker          = new Widgets.MenuItemPicker("itemPicker");
            itemPicker.Location = new Point(18, 23);

            lblMove            = new Label("lblMove");
            lblMove.Font       = FontManager.LoadFont("PMU", 32);
            lblMove.AutoSize   = true;
            lblMove.Text       = "Store";
            lblMove.Location   = new Point(30, 8);
            lblMove.HoverColor = Color.Red;
            lblMove.ForeColor  = Color.WhiteSmoke;
            lblMove.Click     += new EventHandler <SdlDotNet.Widgets.MouseButtonEventArgs>(lblMove_Click);

            nudAmount          = new NumericUpDown("nudAmount");
            nudAmount.Size     = new Size(120, 24);
            nudAmount.Location = new Point(32, 42);
            nudAmount.Font     = FontManager.LoadFont("PMU", 16);
            nudAmount.Minimum  = 1;
            nudAmount.Maximum  = Int32.MaxValue;

            lblSummary            = new Label("lblSummary");
            lblSummary.Font       = FontManager.LoadFont("PMU", 32);
            lblSummary.AutoSize   = true;
            lblSummary.Text       = "Summary";
            lblSummary.Location   = new Point(30, 58);
            lblSummary.HoverColor = Color.Red;
            lblSummary.ForeColor  = Color.WhiteSmoke;
            lblSummary.Click     += new EventHandler <SdlDotNet.Widgets.MouseButtonEventArgs>(lblSummary_Click);

            this.AddWidget(itemPicker);
            this.AddWidget(lblMove);
            this.AddWidget(nudAmount);
            this.AddWidget(lblSummary);

            this.ItemSlot = itemSlot;
            this.ItemNum  = itemNum;
        }
Example #3
0
        public static void ShowItemSummary(int itemNum, int itemSlot, Enums.InvMenuType originalMenu)
        {
            if (CanShowMenu())
            {
                EnableMenuManager();
                Windows.WindowSwitcher.GameWindow.MenuManager.CloseOpenMenus();

                Windows.WindowSwitcher.GameWindow.MenuManager.AddMenu(new Menus.mnuItemSummary("mnuItemSummary", itemNum, itemSlot, originalMenu));

                Windows.WindowSwitcher.GameWindow.MenuManager.SetActiveMenu("mnuItemSummary");
            }
        }
        public mnuShopItemSelected(string name, int itemNum, int itemSlot, Enums.InvMenuType transactionType)
            : base(name)
        {
            transaction = transactionType;

            base.Size = new Size(185, 125);

            base.MenuDirection = Enums.MenuDirection.Horizontal;
            if (transaction == Enums.InvMenuType.Buy) {
            base.Location = new Point(435, 40);
            } else {

                base.Location = new Point(335, 40);
            }

            itemPicker = new Widgets.MenuItemPicker("itemPicker");
            itemPicker.Location = new Point(18, 23);

            lblMove = new Label("lblMove");
            lblMove.Font = FontManager.LoadFont("PMU", 32);
            lblMove.AutoSize = true;
            lblMove.Text = "Store";
            lblMove.Location = new Point(30, 8);
            lblMove.HoverColor = Color.Red;
            lblMove.ForeColor = Color.WhiteSmoke;
            lblMove.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(lblMove_Click);

            nudAmount = new NumericUpDown("nudAmount");
            nudAmount.Size = new Size(120, 24);
            nudAmount.Location = new Point(32, 42);
            nudAmount.Font = FontManager.LoadFont("PMU", 16);
            nudAmount.Minimum = 1;
            nudAmount.Maximum = Int32.MaxValue;

            lblSummary = new Label("lblSummary");
            lblSummary.Font = FontManager.LoadFont("PMU", 32);
            lblSummary.AutoSize = true;
            lblSummary.Text = "Summary";
            lblSummary.Location = new Point(30, 58);
            lblSummary.HoverColor = Color.Red;
            lblSummary.ForeColor = Color.WhiteSmoke;
            lblSummary.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(lblSummary_Click);

            this.AddWidget(itemPicker);
            this.AddWidget(lblMove);
            this.AddWidget(nudAmount);
            this.AddWidget(lblSummary);

            this.ItemSlot = itemSlot;
            this.ItemNum = itemNum;
        }
Example #5
0
        public mnuItemSummary(string name, int itemNum, int itemSlot, Enums.InvMenuType originalMenu)
            : base(name)
        {
            base.Size          = new Size(380, 288);
            base.MenuDirection = Enums.MenuDirection.Vertical;
            base.Location      = new Point(10, 40);

            this.originalMenu = originalMenu;
            this.itemSlot     = itemSlot;

            picPreview           = new PictureBox("picPreview");
            picPreview.Size      = new Size(32, 32);
            picPreview.BackColor = Color.Transparent;
            picPreview.Location  = new Point(10, 10);
            picPreview.Image     = Tools.CropImage(GraphicsManager.Items, new Rectangle((Items.ItemHelper.Items[itemNum].Pic - (int)(Items.ItemHelper.Items[itemNum].Pic / 6) * 6) * Constants.TILE_WIDTH, (int)(Items.ItemHelper.Items[itemNum].Pic / 6) * Constants.TILE_WIDTH, Constants.TILE_WIDTH, Constants.TILE_HEIGHT));

            lblItem           = new Label("lblItem");
            lblItem.Location  = new Point(46, 10);
            lblItem.AutoSize  = true;
            lblItem.Font      = FontManager.LoadFont("PMDCP", 32);
            lblItem.Text      = Items.ItemHelper.Items[itemNum].Name;
            lblItem.ForeColor = Color.WhiteSmoke;

            lblRarity           = new Label("lblRarity");
            lblRarity.Location  = new Point(20, 42);
            lblRarity.AutoSize  = true;
            lblRarity.Font      = FontManager.LoadFont("PMDCP", 16);
            lblRarity.Text      = "Rarity: " + Items.ItemHelper.Items[itemNum].Rarity;
            lblRarity.ForeColor = Color.WhiteSmoke;

            int y = 42;

            y                += 20;
            lblPrice          = new Label("lblPrice");
            lblPrice.Location = new Point(20, y);
            lblPrice.AutoSize = true;
            lblPrice.Font     = FontManager.LoadFont("PMDCP", 16);
            if (Items.ItemHelper.Items[itemNum].Price > 0)
            {
                lblPrice.Text = "Sell Price: " + Items.ItemHelper.Items[itemNum].Price;
            }
            else
            {
                lblPrice.Text = "Cannot be sold.";
            }
            lblPrice.ForeColor = Color.WhiteSmoke;

            if (Items.ItemHelper.Items[itemNum].Bound)
            {
                y                     += 20;
                lblDroppable           = new Label("lblDroppable");
                lblDroppable.Location  = new Point(20, y);
                lblDroppable.AutoSize  = true;
                lblDroppable.Font      = FontManager.LoadFont("PMDCP", 16);
                lblDroppable.Text      = "Cannot be dropped.";
                lblDroppable.ForeColor = Color.WhiteSmoke;
            }

            if (Items.ItemHelper.Items[itemNum].Bound)
            {
                y                    += 20;
                lblLoseable           = new Label("lblLoseable");
                lblLoseable.Location  = new Point(20, y);
                lblLoseable.AutoSize  = true;
                lblLoseable.Font      = FontManager.LoadFont("PMDCP", 16);
                lblLoseable.Text      = "Cannot be lost.";
                lblLoseable.ForeColor = Color.WhiteSmoke;
            }

            y += 30;
            lblDescription          = new Label("lblDescription");
            lblDescription.Location = new Point(20, y);
            //lblDescription.AutoSize = true;
            lblDescription.Size      = new Size(300, 220);
            lblDescription.Font      = FontManager.LoadFont("PMDCP", 16);
            lblDescription.Text      = Items.ItemHelper.Items[itemNum].Desc;
            lblDescription.ForeColor = Color.WhiteSmoke;

            this.AddWidget(picPreview);
            this.AddWidget(lblItem);
            this.AddWidget(lblRarity);
            this.AddWidget(lblPrice);
            this.AddWidget(lblDroppable);
            this.AddWidget(lblLoseable);
            this.AddWidget(lblDescription);
        }
Example #6
0
        public mnuInventory(string name, Enums.InvMenuType menuType, int itemSelected)
            : base(name)
        {
            base.Size = new Size(315, 360);
            base.MenuDirection = Enums.MenuDirection.Vertical;
            base.Location = new Point(10, 40);

            itemPicker = new Widgets.MenuItemPicker("itemPicker");
            itemPicker.Location = new Point(18, 63);

            lblInventory = new Label("lblInventory");
            lblInventory.AutoSize = true;
            lblInventory.Font = FontManager.LoadFont("PMDCP", 48);
            lblInventory.Text = "Inventory";
            lblInventory.ForeColor = Color.WhiteSmoke;
            lblInventory.Location = new Point(20, 0);

            picPreview = new PictureBox("picPreview");
            picPreview.Size = new Size(32, 32);
            picPreview.BackColor = Color.Transparent;
            picPreview.Location = new Point(255, 20);

            lblItemNum = new Label("lblItemNum");
            //lblItemNum.Size = new Size(100, 30);
            lblItemNum.AutoSize = true;
            lblItemNum.Location = new Point(182, 15);
            lblItemNum.Font = FontManager.LoadFont("PMDCP", 32);
            lblItemNum.BackColor = Color.Transparent;
            lblItemNum.ForeColor = Color.WhiteSmoke;
            lblItemNum.Text = "0/" + ((MaxInfo.MaxInv - 1) / 10 + 1);

            lblVisibleItems = new Label[10];
            for (int i = 0; i < lblVisibleItems.Length; i++) {
                lblVisibleItems[i] = new Label("lblVisibleItems" + i);
                //lblVisibleItems[i].AutoSize = true;
                lblVisibleItems[i].Size = new Size(200, 32);
                lblVisibleItems[i].Font = FontManager.LoadFont("PMDCP", 32);
                lblVisibleItems[i].Location = new Point(35, (i * 30) + 48);
                //lblVisibleItems[i].HoverColor = Color.Red;
                lblVisibleItems[i].ForeColor = Color.WhiteSmoke;
                lblVisibleItems[i].AllowDrop = true;
                lblVisibleItems[i].DragDrop += new EventHandler<DragEventArgs>(lblVisibleItems_DragDrop);
                lblVisibleItems[i].MouseDown += new EventHandler<MouseButtonEventArgs>(lblVisibleItems_MouseDown);
                lblVisibleItems[i].Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(inventoryItem_Click);
                this.AddWidget(lblVisibleItems[i]);
            }

            this.AddWidget(picPreview);
            this.AddWidget(itemPicker);
            this.AddWidget(lblInventory);
            this.AddWidget(lblItemNum);

            mode = menuType;
            currentTen = (itemSelected - 1) / 10;
            DisplayItems(currentTen * 10 + 1);
            ChangeSelected((itemSelected - 1) % 10);
            UpdateSelectedItemInfo();
        }
        public mnuItemSummary(string name, int itemNum, int itemSlot, Enums.InvMenuType originalMenu)
            : base(name)
        {
            base.Size = new Size(380, 288);
            base.MenuDirection = Enums.MenuDirection.Vertical;
            base.Location = new Point(10, 40);

            this.originalMenu = originalMenu;
            this.itemSlot = itemSlot;

            picPreview = new PictureBox("picPreview");
            picPreview.Size = new Size(32, 32);
            picPreview.BackColor = Color.Transparent;
            picPreview.Location = new Point(10, 10);
            picPreview.Image = Tools.CropImage(GraphicsManager.Items, new Rectangle((Items.ItemHelper.Items[itemNum].Pic - (int)(Items.ItemHelper.Items[itemNum].Pic / 6) * 6) * Constants.TILE_WIDTH, (int)(Items.ItemHelper.Items[itemNum].Pic / 6) * Constants.TILE_WIDTH, Constants.TILE_WIDTH, Constants.TILE_HEIGHT));

            lblItem = new Label("lblItem");
            lblItem.Location = new Point(46, 10);
            lblItem.AutoSize = true;
            lblItem.Font = FontManager.LoadFont("PMU", 32);
            lblItem.Text = Items.ItemHelper.Items[itemNum].Name;
            lblItem.ForeColor = Color.WhiteSmoke;

            lblRarity = new Label("lblRarity");
            lblRarity.Location = new Point(20, 42);
            lblRarity.AutoSize = true;
            lblRarity.Font = FontManager.LoadFont("PMU", 16);
            lblRarity.Text = "Rarity: " + Items.ItemHelper.Items[itemNum].Rarity;
            lblRarity.ForeColor = Color.WhiteSmoke;

            int y = 42;
            y += 20;
            lblPrice = new Label("lblPrice");
            lblPrice.Location = new Point(20, y);
            lblPrice.AutoSize = true;
            lblPrice.Font = FontManager.LoadFont("PMU", 16);
            if (Items.ItemHelper.Items[itemNum].Price > 0) {
                lblPrice.Text = "Sell Price: " + Items.ItemHelper.Items[itemNum].Price;
            } else {
                lblPrice.Text = "Cannot be sold.";
            }
            lblPrice.ForeColor = Color.WhiteSmoke;

            if (Items.ItemHelper.Items[itemNum].Bound) {
                y += 20;
                lblDroppable = new Label("lblDroppable");
                lblDroppable.Location = new Point(20, y);
                lblDroppable.AutoSize = true;
                lblDroppable.Font = FontManager.LoadFont("PMU", 16);
                lblDroppable.Text = "Cannot be dropped.";
                lblDroppable.ForeColor = Color.WhiteSmoke;
            }

            if (Items.ItemHelper.Items[itemNum].Bound) {
                y += 20;
                lblLoseable = new Label("lblLoseable");
                lblLoseable.Location = new Point(20, y);
                lblLoseable.AutoSize = true;
                lblLoseable.Font = FontManager.LoadFont("PMU", 16);
                lblLoseable.Text = "Cannot be lost.";
                lblLoseable.ForeColor = Color.WhiteSmoke;
            }

            y += 30;
            lblDescription = new Label("lblDescription");
            lblDescription.Location = new Point(20, y);
            //lblDescription.AutoSize = true;
            lblDescription.Size = new Size(300, 220);
            lblDescription.Font = FontManager.LoadFont("PMU", 16);
            lblDescription.Text = Items.ItemHelper.Items[itemNum].Desc;
            lblDescription.ForeColor = Color.WhiteSmoke;

            this.AddWidget(picPreview);
            this.AddWidget(lblItem);
            this.AddWidget(lblRarity);
            this.AddWidget(lblPrice);
            this.AddWidget(lblDroppable);
            this.AddWidget(lblLoseable);
            this.AddWidget(lblDescription);
        }