Pickers

Turn any collection into a searchable, virtualized picker - the tool for "set the current X out of N" cheats: inventory items, maps, live-ops events, saved loadouts.

The smallest picker

Hand a picker a list, a label for each item, and a getter/setter pair for the selection:

MapCheats.cs
private static readonly string[] _maps = { "Harbor", "Foundry", "Canyon", "Rooftops" };
private string _map = "Harbor";

DMD.Options.AddPicker("Map", _maps,
    map => map,
    () => _map, map => _map = map);

The panel row shows the current selection. Tapping it opens a full-screen overlay with a search bar and the full list; picking an item writes it through your setter and closes the overlay. The chosen value lives in your code - Debug MD never stores the selection, it only reads and writes it through the delegates.

Screenshot pending - the full-screen picker overlay with the search bar filtering a long list, current item checked
The picker overlay: search on top, virtualized list below, current selection marked.

Providers

For collections that change, pass a provider instead of a list. The provider is re-queried every time the picker opens, so live-ops events, unlocked content or a growing save list stay current without re-registering:

DMD.Options.AddPicker("Event", () => LiveOps.ActiveEvents,
    e => e.Name,
    () => _event, e => _event = e);

While the overlay is on screen the item list is cached, so the provider is not hammered as you scroll or type.

Richer rows

Four adapters upgrade the plain list; all of them are optional and chain before placement modifiers:

  • WithDetail - a secondary line under the selected item's name in the panel row: rarity, price, a short description.
  • WithKeywords - extra text the search matches besides the label: category names, aliases, tags.
  • WithIcon - a Sprite or Texture2D per item, shown next to each list entry and in the panel row.
  • WithGridView - open as a grid of icon tiles instead of a list. Takes effect only when an icon adapter is set; icon pickers always offer a list/grid toggle in the overlay, this just chooses the starting layout.
ItemCheats.cs
// ItemDatabase.All is an IReadOnlyList<Item> - 10,000 items is fine.
DMD.Options.AddPicker("Item", () => ItemDatabase.All,
        item => item.DisplayName,
        () => _selected, item => _selected = item)
    .WithIcon(item => item.Icon)
    .WithDetail(item => item.Rarity.ToString())
    .WithKeywords(item => item.Rarity + " " + item.Category)
    .WithGridView()
    .InTab("Items");
Screenshot pending - the picker overlay in grid mode: icon tiles with names along the bottom edge, list/grid toggle visible
Grid mode, for collections where the icon is what you recognize.

Reacting to a pick

The standard pattern needs no callback at all: the picker stores the selection, and a separate button acts on it. That keeps browsing free of side effects - testers can scroll and compare without granting anything:

DMD.Options.AddPicker("Item", () => ItemDatabase.All,
    item => item.DisplayName,
    () => _selected, item => _selected = item);

DMD.Options.AddButton("Grant Item", () => Inventory.Grant(_selected));

For flows that must apply the pick immediately - teleport on select, preview a skin - add OnPicked. It runs right after the setter:

DMD.Options.AddPicker("Checkpoint", () => Checkpoints.All,
        c => c.Name,
        () => _checkpoint, c => _checkpoint = c)
    .OnPicked(c => Player.TeleportTo(c.Position));

Browse-only

Omit the setter and the picker becomes an inspector: the overlay opens, search works, nothing can be changed. Useful for letting testers look up game data on device without a cheat attached.

Live preview

A picker row is the one option that shows an item's icon, name and detail together, which makes it the natural way to show what is currently selected in the game. Add AsDisplay() and the row stops being a button: it never opens the picker, has no hover or press state, and stays blank (no Select..., no ? tile) while the getter returns nothing. Icon, name and detail still follow the getter live. Typically there is no setter and no list to browse, and a button beside it acts on the value:

SpawnCheats.cs
DMD.Options.AddPicker("Selected", Array.Empty<Prop>(),
        p => p.Name, () => Selection.Current)
    .WithIcon(p => p.Icon)
    .WithDetail(p => "id " + p.Id)
    .AsDisplay()
    .InRow("spawn").WithWidth(70f);

DMD.Options.AddButton("Spawn", () => Spawner.Duplicate(Selection.Current))
    .InRow("spawn").WithWidth(30f);

AsDisplay() works on multi-pickers too, and on a picker that has a setter: the row then only shows the value, and the setter is simply never reached from the panel.

Selecting many

MultiPicker toggles any number of items on and off. Selection state lives entirely in your code behind two adapters - typically backed by a set. The overlay stays open while toggling; the panel row summarizes the selection (a single item shows its label, more show a count):

LevelCheats.cs
private readonly HashSet<string> _unlocked = new HashSet<string>();

DMD.Options.AddMultiPicker("Unlocked Levels", () => LevelDatabase.Names,
    name => name,
    name => _unlocked.Contains(name),
    (name, on) => { if (on) _unlocked.Add(name); else _unlocked.Remove(name); });

The same adapters exist for fixed lists, and omitting setSelected makes the multi-picker browse-only. The icon, detail, keyword and grid adapters from Richer rows all apply.

Enums

For an enum you don't need a picker at all - AddChoice is the zero-ceremony version: no list, no label adapter, same searchable overlay.

Performance

The overlay list is virtualized: only the visible rows exist, so 10,000+ items scroll and search smoothly on device. Two habits keep it that way:

  • Adapters (label, WithDetail, WithKeywords, icons) are called on demand while scrolling and searching - keep them cheap and allocation-light. Precompute strings on the item if you can.
  • Search fuzzy-matches the label plus whatever WithKeywords returns. Put the terms testers will actually type into the keywords rather than inflating labels.