Skip to content

ui dialog

laurel Lin edited this page Aug 22, 2026 · 2 revisions

src/ui/dialog.ts — Generate configuration dialog

A single-page dialog collecting all inputs:

  • the three parts (left rail / right rail / tie) — import a .bbmodel from disk or "Select a Tab" to extract the selected elements of an open tab; the right rail additionally offers "Mirror from First Model" (mirrorPartYz).
  • gauge (px, with mm/inch conversion: Enter in any field back-fills the other two) / track height / whole-model Y offset (px) / new workspace name.
  • portal textures (each independently optional): portal_track covers the track/ties; portal_track_mip generates the overlay cubes teleport_left / teleport_right.
  • the workspace format follows the parts: any part with mesh groups → free model (generic), otherwise Java block/item.

Parts are collected without texture prefixes; generation applies scopeTextureKeys (L / R / T) so the "source key → imported Texture" mapping stays globally unique.

Types

export interface GenerateOutput {
	config: TrackConfig;
	shapes: ShapeSpec[];
	textureByKey: Map<string, Texture>;  // source texture key → Texture imported into the new workspace
}

Styles

// inject / clean up the generate dialog styles (Blockbench has a document; safely skipped in Node smoke tests)
export function injectDialogStyles(): void;
export function disposeDialogStyles(): void;

Entry point

// the full generation flow entry; returns the result or null on failure/cancel. On confirm, creates the
// workspace and resolves.
export function runGenerateWizard(): Promise<GenerateOutput | null>;

← Back to English API Reference

Clone this wiki locally