Пример #1
0
    internal bool InitializeGrid()
    {
        var count  = SAV.BoxSlotCount;
        var width  = count / 5;
        var height = count / width;

        if (!BoxPokeGrid.InitializeGrid(width, height, SpriteUtil.Spriter))
        {
            return(false);
        }
        RecenterControls();
        InitializeSlots();
        return(true);
    }
Пример #2
0
        public void RecenterControls()
        {
            BoxPokeGrid.HorizontallyCenter(this);
            int p1 = CB_BoxSelect.Location.X;

            CB_BoxSelect.HorizontallyCenter(this);
            int p2 = CB_BoxSelect.Location.X;

            if (p1 == p2)
            {
                return;
            }

            B_BoxLeft.Location  = new Point(B_BoxLeft.Location.X + p2 - p1, B_BoxLeft.Location.Y);
            B_BoxRight.Location = new Point(B_BoxRight.Location.X + p2 - p1, B_BoxRight.Location.Y);
        }
Пример #3
0
    public void RecenterControls()
    {
        if (Width < BoxPokeGrid.Width)
        {
            Width = BoxPokeGrid.Width;
        }
        BoxPokeGrid.HorizontallyCenter(this);
        int p1 = CB_BoxSelect.Location.X;

        CB_BoxSelect.HorizontallyCenter(this);
        int p2 = CB_BoxSelect.Location.X;

        var delta = p2 - p1;

        if (delta == 0)
        {
            return;
        }

        B_BoxLeft.SetBounds(B_BoxLeft.Location.X + delta, 0, 0, 0, BoundsSpecified.X);
        B_BoxRight.SetBounds(B_BoxRight.Location.X + delta, 0, 0, 0, BoundsSpecified.X);
    }