public static void setbelt(int slot, Indir<Resource> res) {
        synchronized (defbelt) {
            defbelt[slot] = res;
        }
        if (res == null) {
            for (ToolbarWnd tb : UI.instance.menugrid.toolbars)
                tb.removedef(slot);

            MenuGrid mnu = UI.instance.menugrid;
            if (mnu.digitbar != null) mnu.digitbar.removedef(slot);
            if (mnu.functionbar != null) mnu.functionbar.removedef(slot);
            if (mnu.numpadbar != null) mnu.numpadbar.removedef(slot);
        }
    }