Editor Gen UI (Building Architect UI)
ImGui-based user interface for the Building Architect Tool (BAT). Provides the main editor windows for building shape selection, scope navigation, material/mesh picking, roof type selection, architect
ImGui-based user interface for the Building Architect Tool (BAT). Provides the main editor windows for building shape selection, scope navigation, material/mesh picking, roof type selection, architectural element toggles, and keyboard shortcut help.
Module Overview
| Aspect | Detail |
|---|---|
| File | extensions/editor/gen/ui.lua |
| Returns | M table |
| Requires | editor/gen/mesh, editor/gen/utils, editor/shortcutLegend, editor/gen/decal |
| Windows | BAT (Building Architect), LAT (Landscape Gen), TEST (Performance Test) |
Public Functions
| Function | Signature | Description |
|---|---|---|
M.inject | (olib) | Injects utility and world module references (olib.U, olib.W) |
M.tree2ui | (htree) | Renders a shortcut help tree as ImGui text rows |
UI Windows
| Window ID | Title | Purpose |
|---|---|---|
BAT | Building Architect (WIP) | Main building editor - shape type, scope selector, material list, element toggles, roof controls |
LAT | WIP_Landscape_Gen | Landscape tools - road conforming, junction params, sector grid settings |
TEST | WIP_Performance_Test | Batch building generation benchmarks |
Key UI Sections (BAT Window)
| Section | Controls |
|---|---|
| Shape Type | 6 building shape buttons (rectangle, hexagon, corner_cut, u/t/x_shape), Load/Save/Export |
| Scope Selector | Building → Floor → Wall → Side → Top navigation tabs |
| Material List | Combo or list box of wall/roof materials with UV offset/scale sliders |
| Elements | Toggle buttons: Window, Door, Storefront, Balcony, Corner, Stringcourse, Plinth, Pilaster, Stairs, Gutter |
| Roof Controls | Ridge/Border/Chimney toggles, shape buttons (flat/pyramid/shed/gable) |
| Numeric Inputs | Floor height, wall pull, UV params, window spacing, pillar settings, balcony/door indices |
UI Helper Functions (Internal)
| Function | Description |
|---|---|
combo(lbl, key, list, isel) | Dropdown combo box bound to env.ui[key] |
input(lbl, key, isint, step) | Numeric input (int or float) bound to env.ui[key] |
slider(lbl, key, mm, isint) | Slider control with min/max range |
check(lbl, key) | Checkbox bound to env.ui[key] |
button(lbl, key, icon, c, isactive) | Icon button with tooltip |
buttonT(text, key, ctxt, cbg) | Text overlay button |
buttonC(lbl, key, c, dim) | Custom image button using loaded icon textures |
buttonCC(lbl, key, c, dim) | Custom image button with overlay icon |
Usage Context
-- The UI module is loaded by the world module and called each frame
local UI = require('/lua/ge/extensions/editor/gen/ui')
UI.inject({U = utils, W = world})
-- Main render call (inside onEditorGui)
local handled = UI.control(materialList, world, decal, region)Shortcut Help System
The module builds context-sensitive keyboard shortcut trees (HTree, HTreeR, HTreeTer) based on current scope, selection state, and modifier keys. These are rendered as help text in the BAT window.
Exported Functions
M.inject(olib)
Injects utility and world module references.
olib(table) -{U = utils, W = world}
M.control(list, w, dec, reg)
Main per-frame UI render function. Builds and renders all BAT/LAT/TEST editor windows.
list(table) - Material list (wall or roof depending on scope)w(table) - World module referencedec(table) - Decal module referencereg(table) - Region module reference
Returns: boolean - true if a UI interaction was handled
M.tree2ui(htree)
Renders a shortcut help tree as ImGui text rows.
htree(table) - Nested shortcut tree structure
M.hint(emode)
Sets up editor mode hints.
emode(table) - Editor edit mode object
See Also
- Gen Decal Editor - Related reference
- Gen Experimental Frame Editor - Related reference
- Gen Mesh Explorer - Related reference
- World Editor Guide - Guide
Editor Gen Top (Roof Geometry)
Roof geometry generation module for the Building Architect Tool. Handles polygon decomposition, parallel-pair detection, ridge/gable/flat roof construction, and triangulated paving of arbitrary polygo
Editor Gen Utils
Core utility library for the Building Architect Tool. Provides geometric math (line intersection, polygon operations, splines), array/string helpers, debug drawing, camera control, file I/O, and the s