Skip to main content

1.2.7 — Multi-adapter UI system

What changed

ui_library layout option — switch UI adapters without a separate build

layout.rblua now accepts a ui_library field that controls which UI library the compiled script uses:

layout {
title = "My Hub",
toggle_key = "V",
size = { 950, 600 },
ui_library = "windui", -- "linoria" (default) | "windui"
}

py rb/rb.py build reads this automatically — no extra flag needed. The --ui CLI flag still works as an explicit override when you want to build a specific adapter without editing the file.

Both adapters produce build/script.lua (same filename). Change ui_library, rebuild, inject.

Wind UI adapter (rb/adapters/windui.lua)

A complete _UIAdapter implementation for Wind UI (pinned to v1.6.64-fix):

  • Pulse theme — custom theme matching the Pulse brand: deep indigo background, violet accent, lavender text. Applied automatically on startup.
  • Tab icons — Lucide icons on every tab (house, swords, user, mountain, eye, wrench, settings).
  • Window icon — Pulse logo (pulse-rb.vercel.app/img/logo.svg) in the window header and notifications.
  • 2-column layout — attempts HStack/VStack for side-by-side groupboxes; falls back to single-column if those elements are unavailable in the loaded version.
  • Config persistence — all toggled/slider/dropdown widgets carry a Flag so Wind UI's ConfigManager can save and restore their values. Settings page includes Save/Load buttons and auto-loads the saved config 1.5 s after startup (after the defaults runner).
  • Mobile open button — floating draggable button; set OnlyMobile = false to show it on desktop for testing.

_PulseNotify(msg, duration) — adapter-agnostic notifications

Both adapters now define _PulseNotify as a local function. Code that needs to show a notification (AdminDetection, the defaults runner "ready" toast) calls _PulseNotify instead of _Library:Notify. This means notification calls work correctly with both UI libraries without any component changes.

Inline comment fix in layout.rblua parser

The layout.rblua option parser previously only stripped full-line -- comments. Inline comments like:

ui_library = "windui", -- "linoria" | "windui"

would corrupt the parsed value. The parser now strips everything from -- onward before reading values.

Impact on existing projects

  • No .rblua source changes required.
  • Projects using Linoria are unaffected — ui_library defaults to "linoria" when the field is absent.
  • _Library:Notify calls in component code should be replaced with _PulseNotify if you intend to support both adapters. The Pulse helpers (AdminDetection etc.) have been updated.

No ui {} DSL changes

The toggle, slider, dropdown, button, keybind, separator, and label keywords work identically with both adapters. A component written for Linoria mounts correctly under Wind UI without modification.

Settings pages that call Linoria APIs directly (_ThemeManager, _SaveManager, gb:AddToggle(...)) remain Linoria-only. Use the _UIAdapter interface in page files if you want adapter portability.