private void init(int belt, int sz, Coord off, int key) {
        gsz = new Coord(1, sz);
        this.off = off;
        fbtn.show();
        mrgn = new Coord(2, 18);
        layout = new Slot[sz];
        loadOpts();
        cbtn.visible = false;
        lockbtn = new IButton(Coord.z, this, locked ? ilockc : ilocko,
                locked ? ilocko : ilockc, locked ? ilockch : ilockoh) {

            public void click() {
                locked = !locked;
                if (locked) {
                    up = ilockc;
                    down = ilocko;
                    hover = ilockch;
                } else {
                    up = ilocko;
                    down = ilockc;
                    hover = ilockoh;
                }
                Config.setWindowOpt(name + "_locked", locked);
            }
        };
        lockbtn.recthit = true;
        flipbtn = new IButton(Coord.z, this, Resource.loadimg("gfx/hud/flip"),
                Resource.loadimg("gfx/hud/flip"),
                Resource.loadimg("gfx/hud/flipo")) {
            public void click() {
                flip();
            }
        };
        minus = new IButton(Coord.z, this,
                Resource.loadimg("gfx/hud/charsh/minusup"),
                Resource.loadimg("gfx/hud/charsh/minusdown")) {
            public void click() {
                prevBelt();
            }
        };
        plus = new IButton(Coord.z, this,
                Resource.loadimg("gfx/hud/charsh/plusup"),
                Resource.loadimg("gfx/hud/charsh/plusdown")) {
            public void click() {
                nextBelt();
            }
        };
        flipbtn.recthit = true;
        loadBelt(belt);
        this.key = key;
        pack();
        /* Text rendering is slow, so pre-cache the hotbar numbers. */
        nums = new Tex[sz];
        for (int i = 0; i < sz; i++) {
            String slot;
            if (key == KeyEvent.VK_0) {
                slot = Integer.toString(i);
            } else if (key == KeyEvent.VK_F1) {
                slot = "F" + Integer.toString(i + 1);
            } else {
                slot = "N" + Integer.toString(i);
            }
            nums[i] = new TexI(Utils.outline2(Text.render(slot).img,
                    Color.BLACK, true));
        }
    }