scaffold_menu_screen
Build a styled Widget Blueprint menu screen with a centred panel, optional title, and buttons wired to OnClicked handlers, then compile and save.
Instructions
Build a styled menu screen: create or reuse the Widget Blueprint at package_path/name with a centred panel, optional title and one button per entry bound to an event-graph OnClicked handler, then compile and save. Re-runs reuse widgets and bindings. Returns contrast_ratio_normal_text; the default colors pass audit_widget_accessibility. Layout is not measured (long labels can clip) and text is inline, not String Table.
Returns: { widget_bp_path, asset_path, created, already_existed, root_widget, panel_widget, box_widget, title_widget, entries: [{label, button_widget, text_widget, handler_name, bound, already_bound, error}], entry_count, buttons_bound, colors: {panel, button, text}, contrast_ratio_normal_text, contrast_required, contrast_passes, contrast_note, theme_source, compiled, saved, save_error }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Asset name, e.g. WBP_OptionsMenu. | |
| save | No | Compile + save when done (default true). | |
| force | No | Optional. This command is REFUSED while a Play-in-Editor session is running: it either compiles a Blueprint (the reinstancer can retain a world, and CheckForWorldGCLeaks is Fatal -- it KILLS the editor) or writes to disk (Editor.AllowSavingAssetsDuringPIE=0 makes the engine refuse the write, so it would report success without writing a byte). Stop PIE and retry instead; force=true runs it anyway, at your own risk. | |
| title | No | Optional heading text above the buttons. Omitted or empty = no title widget at all (not an empty one). | |
| entries | Yes | REQUIRED, the buttons top to bottom. Each item is either a plain string (the label) or an object {label, handler_name?}. handler_name names the generated event-graph function; omitted, it becomes On<Label>Clicked. Order is preserved. | |
| background | No | Draw the background panel (default true). false leaves the buttons floating on nothing -- which is what makes contrast unjudgeable, so it also drops contrast_ratio_normal_text from the payload. | |
| text_color | No | Label colour for title and buttons, same formats. Default white. | |
| bind_events | No | Wire each button's OnClicked to a handler in the event graph (default true). false builds the visuals only. | |
| panel_color | No | Background panel colour. "#RRGGBBAA", [r,g,b,a] (LINEAR 0..1) or {R,G,B,A}. Default is a near-black panel. | |
| panel_width | No | Panel width in pixels (default 480). | |
| button_color | No | Button resting colour, same formats. If you override this, you own the contrast: the returned ratio tells you what you got. | |
| package_path | Yes | /Game folder for the new Widget Blueprint (e.g. /Game/MyGame/UI). | |
| panel_height | No | Panel height in pixels (default 560). | |
| parent_class | No | Parent UUserWidget subclass (default "UUserWidget"). Pass a CommonUI activatable class here to scaffold a screen for a CommonUI stack. | |
| theme_source_bp | No | Optional /Game path of a Widget Blueprint holding a reference Button whose style is copied onto every generated button INSTEAD of the built-in defaults (same idea as apply_widget_style_preset's theme mode: one widget is the single source of truth). | |
| title_font_size | No | Title text size in Slate font points, truncated to a whole number; default 36. Unused when title is empty. | |
| button_font_size | No | Button label size in Slate font points, truncated to a whole number; default 20. It also sets the contrast floor checked (3:1 at 18 or more, else 4.5:1); under 12 is what audit_widget_accessibility flags as small_text. | |
| theme_source_widget | No | Name of the reference Button inside theme_source_bp. Required with it. |