Esempio n. 1
0
        public InventoryWindow(Module App, InventorySide Side)
            : base(App)
        {
            side = (Side == InventorySide.Right);

            back = side ? "inv.raw?2" : "gfx/inventory_left.png";

            basePos = new Vector2(15, 15);
            Size    = new Vector2(back.Width, back.Height) + basePos;

            face             = new FaceWindow(App);
            face.Position    = side ? (basePos + new Vector2(67, 0)) : basePos;
            face.DisplayOnly = true;
            Windows         += face;

            grid = new ItemGridWindow(App);
            grid.LockPositions        = true;
            grid.Position             = new Vector2(side ? 9 : 19, side ? 72 : 83) + basePos;
            grid.Spacing              = new Vector2(4, side ? 16 : 5);
            grid.Grid                 = new Vector2(3, 2);
            grid.LeftClickItemEvent  += OnLeftClickItem;
            grid.RightClickItemEvent += OnRightClickItem;
            Windows += grid;

            font             = new GuiFont(BurntimeClassic.FontName, new PixelColor(128, 136, 192));
            font.Borders     = TextBorders.Screen;
            nameFont         = new GuiFont(BurntimeClassic.FontName, new PixelColor(240, 64, 56));
            nameFont.Borders = TextBorders.Screen;

            pageName = "";

            for (int i = 0; i < 5; i++)
            {
                pageButtons[i]       = new Button(App);
                pageButtons[i].Image = "munt.raw?" + (5 + i);
                if (side)
                {
                    pageButtons[i].Position = basePos + new Vector2(120 + 3 * i, 142 - 18 * i);
                }
                else
                {
                    pageButtons[i].Position = basePos + new Vector2(-3 * i, 142 - 18 * i);
                }
                pageButtons[i].Hide();
                pageButtons[i].Command += new CommandHandler(OnPage, i);
                pageIndices[i]          = i;
                Windows += pageButtons[i];
            }

            pages           = new List <InventoryPage>();
            activePageIndex = 0;
            activePage      = null;
        }
Esempio n. 2
0
        public ExchangeWindow(Module App)
            : base(App)
        {
            Background = "inv.raw?1";

            grid                      = new ItemGridWindow(App);
            grid.Position             = new Vector2(8, 19);
            grid.Spacing              = new Vector2(4, 7);
            grid.Grid                 = new Vector2(3, 2);
            grid.LeftClickItemEvent  += OnLeftClickItem;
            grid.RightClickItemEvent += OnRightClickItem;
            Windows                  += grid;

            font         = new GuiFont(BurntimeClassic.FontName, new PixelColor(128, 136, 192));
            font.Borders = TextBorders.Screen;
        }