private void Display()  // last_he and current_mcl can be null
        {
            int sel = extComboBoxTraderType.SelectedIndex;

            mcl = new List <Tuple <MaterialCommodityData.MaterialGroupType, MaterialCommodityData[]> >();

            foreach (var t in Enum.GetValues(typeof(MaterialCommodityData.MaterialGroupType)))
            {
                var  e  = (MaterialCommodityData.MaterialGroupType)t;
                bool ok = (sel == 0 && e >= MaterialCommodityData.MaterialGroupType.RawCategory1 && e <= MaterialCommodityData.MaterialGroupType.RawCategory7);
                ok |= (sel == 1 && e >= MaterialCommodityData.MaterialGroupType.EncodedEmissionData && e <= MaterialCommodityData.MaterialGroupType.EncodedFirmware);
                ok |= (sel == 2 && e >= MaterialCommodityData.MaterialGroupType.ManufacturedChemical);
                if (ok)
                {
                    var list = MaterialCommodityData.GetMaterialGroup(x => x.MaterialGroup == e);
                    mcl.Add(new Tuple <MaterialCommodityData.MaterialGroupType, MaterialCommodityData[]>(e, list));
                }
            }

            const int badgemargin = 20;

            extPictureTrades.ClearImageList();

            int vpos = 0;

            foreach (var t in mcl)
            {
                int hpos     = 0;
                int nextvpos = vpos;
                int lvl      = 1;

                foreach (var b in t.Item2)
                {
                    Bitmap background = EDDiscovery.Icons.IconSet.GetIcon("Controls.MaterialTrader.encodedbackground") as Bitmap;

                    int    offer = 0, receive = 0, mattotal = 0;
                    string name = b.Name;

                    var mc = current_mcl?.FindFDName(b.FDName) ?? (last_he?.MaterialCommodity.FindFDName(b.FDName));    // if locked to mcl, use that, else use last he mcl

                    mattotal = mc?.Count ?? -1;

                    Color wash = Color.Transparent;

                    if (selected != null)
                    {
                        bool difflevel = selected.type != t.Item1;

                        if (lvl < selected.level)
                        {
                            offer   = (int)Math.Pow(6, (selected.level - lvl) + (difflevel ? 1 : 0));
                            receive = 1;
                        }
                        else if (lvl > selected.level)
                        {
                            offer   = difflevel ? 6 : 1;
                            receive = (int)Math.Pow(3, (lvl - selected.level));
                            while (offer % 3 == 0)
                            {
                                offer   /= 3;
                                receive /= 3;
                            }
                        }
                        else if (selected.type == t.Item1)
                        {
                            name = "Cancel";
                            wash = Color.FromArgb(80, 0, 32, 0);
                        }
                        else
                        {
                            offer   = 6;
                            receive = 1;
                        }

                        if (offer > mattotal)
                        {
                            wash = Color.FromArgb(80, 128, 0, 0);
                        }
                    }

                    Bitmap bmp = DrawBadge(background, offer, receive, lvl, name, mattotal, wash);

                    var ie = extPictureTrades.AddImage(new Rectangle(hpos, vpos, background.Width, background.Height), bmp, imgowned: true);
                    ie.tag = new ElementTag {
                        type = t.Item1, element = b, level = lvl, offer = offer, receive = receive
                    };

                    hpos    += bmp.Width + badgemargin;
                    nextvpos = Math.Max(nextvpos, vpos + bmp.Height + badgemargin);
                    lvl++;
                }

                vpos = nextvpos;
            }

            extPictureTrades.Render();
        }