-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
There are two ways to change settings, depending on when your code runs (see Getting Started):
From your own script or package (works regardless of script or install order), seed defaults into mdw.gameConfig. They are merged before the UI is built; the player's saved choices still win:
mdw = mdw or {}
mdw.gameConfig = mdw.gameConfig or {}
mdw.gameConfig.leftDockWidth = 300
mdw.gameConfig.theme = "emerald"
mdw.gameConfig.fontFamily = "Fira Code Willowdale"
mdw.gameConfig.contentFontSize = 11At runtime (from an onReady callback, an alias, or any code running while MDW is up), use mdw.configure() - it merges values into mdw.config and re-applies live-changeable settings immediately:
mdw.configure({ usePromptTrigger = false })You can also set mdw.config values directly. If you change colors after startup, call mdw.buildStyles() to rebuild the derived styles and mdw.applyThemeStyles() to restyle the live UI:
mdw.config.colors.sidebar = { 26, 24, 21 }
mdw.config.colors.headerText = { 184, 134, 11 }
mdw.buildStyles()
mdw.applyThemeStyles()Colors are defined as RGB tuples in mdw.config.colors. CSS and decho values are derived automatically by mdw.buildStyles(). When customizing colors, modify the tuples rather than the derived CSS strings.
Themes override specific color keys from mdw.config.colors. The default "gold" theme uses the base colors as-is. Switch themes from a script with mdw.setTheme(name) (it rebuilds and re-applies the styles and saves the choice); mdw.getThemeNames() lists them.
Available themes: gold (default), fantasy, emerald, sapphire, ruby, slate, violet, copper.
| Category | Option | Default | Description |
|---|---|---|---|
| Branding | |||
uiName |
"MDW" | Display name for the whole UI, used verbatim in user-facing chrome (the admin menu's "Uninstall " entry, the ready message). Game packages brand it via mdw.gameConfig.uiName - see Getting Started
|
|
| Dock Dimensions | |||
leftDockWidth |
250 | Initial width of left sidebar | |
rightDockWidth |
250 | Initial width of right sidebar | |
minDockWidth |
150 | Minimum dock width when resizing | |
maxDockWidth |
1000 | Maximum dock width when resizing | |
| Widget Dimensions | |||
widgetHeight |
200 | Default height for new widgets | |
titleHeight |
25 | Height of widget title bars | |
minWidgetHeight |
50 | Minimum widget height when resizing | |
minWidgetWidth |
50 | Minimum width for side-by-side widgets | |
minFloatingWidth |
100 | Minimum width for floating widgets | |
| Splitters and Borders | |||
dockGap |
5 | Gap between sidebars/bottom bar and main window (px); also the extra grab width of the dock and prompt splitters, whose labels extend through it | |
dockSplitterWidth |
4 | Width of dock edge splitters (resize handles) | |
separatorHeight |
2 | Height of horizontal separators (header/prompt) | |
dropIndicatorHeight |
2 | Height of drop target indicators | |
widgetSplitterHeight |
2 | Height of between-widget splitters (vertical resize) | |
widgetSplitterWidth |
2 | Width of between-widget splitters (horizontal resize) | |
resizeBorderWidth |
2 | Visual width of floating widget resize borders | |
resizeHitWidth |
8 | Click target width for resize borders | |
resizeCornerSize |
20 | How far corner grab zones extend along each adjacent edge | |
resizeHandleHitPad |
8 | Extra hit area above bottom resize handle (px) | |
| Header and Prompt Bar | |||
headerHeight |
30 | Height of top header bar | |
promptBarHeight |
30 | Height of bottom prompt bar | |
barHeight |
24 | Default height for chrome bars (mdw.createBar) - see Getting Started
|
|
minPromptBarHeight |
25 | Minimum prompt bar height when resizing | |
minMainHeight |
100 | Minimum main-console height preserved when resizing the prompt bar | |
promptPattern |
nil | Lua pattern matching the upper line(s) of a multi-line prompt (see Prompt Bar) | |
promptLineCount |
1 | Blind fallback line count captured when promptPattern is nil |
|
usePromptTrigger |
true | Enable MDW's built-in prompt-capture trigger; set false to drive the prompt bar yourself | |
promptGaugeHeight |
16 | Height of each prompt-bar gauge (px) - see Prompt Bar | |
promptGaugeGap |
6 | Horizontal gap between prompt-bar gauges (px) | |
promptGaugeRowGap |
2 | Gap between the gauge row and the prompt text (px) | |
promptGaugeMaxWidth |
300 | Cap on a single prompt-bar gauge's width (px) | |
| Widget Rows (see Widget Rows) | |||
rowGaugeHeight |
16 | Default height of a gauge or slider row (px) | |
rowTextHeight |
18 | Default height of a text row (px) | |
rowGap |
3 | Vertical gap between rows (px) | |
rowRightWidth |
64 | Slice a gauge or slider row's rightText carves off (px) |
|
rowSliderStep |
5 | Units one wheel notch moves a slider row (the row's step overrides) |
|
menuButtonSize |
20 | Size of the settings (vertical-ellipsis) buttons (px) | |
menuButtonFontSize |
14 | Glyph size of those buttons (pt) | |
| Tabs | |||
tabBarHeight |
22 | Height of tab button bar | |
tabPadding |
5 | Horizontal padding inside tab buttons | |
tabGap |
4 | Gap between group tabs so they read as separate tabs | |
tabCloseWidth |
16 | Reserved width for the close (x) on the active group tab | |
| Menus | |||
menuItemHeight |
28 | Height of dropdown menu items | |
menuPadding |
8 | Vertical padding inside dropdown menus | |
menuPaddingLeft |
10 | Left padding for menu items (px) | |
headerButtonPadding |
12 | Right-side padding for header menu buttons | |
menuWidth |
150 | Width of the Sidebars and Widgets dropdown menus | |
menuOverlap |
4 | Overlap between menu and header button border | |
contextMenuTitleMax |
40 | Longest context-menu title before "..." truncation (chars) - see Context Menus | |
contextMenuItemHeight |
22 | Height of context-menu rows | |
contextMenuPadding |
5 | Vertical padding inside the context menu (also the divider advance) | |
contextMenuPaddingLeft |
8 | Left padding for context-menu rows (px) | |
contextMenuMinWidth |
90 | Narrowest the context menu shrinks to (px) | |
layoutMenuWidth |
250 | Width of the Font Size dropdown menu | |
themeMenuWidth |
120 | Width of the Theme dropdown menu | |
layoutMenuLabelWidth |
128 | Width of row labels in the Font Size menu | |
layoutMenuGap |
10 | Gap between label and controls in the Font Size menu | |
layoutMenuBtnWidth |
30 | Width of +/- buttons in the Font Size menu | |
layoutMenuValueWidth |
36 | Width of the value display in the Font Size menu | |
layoutMenuBtnFontSize |
16 | Font size of the +/- buttons in the Font Size menu | |
uninstallConfirmWindow |
4 | Seconds the "click again to confirm" uninstall stays armed | |
| Margins | |||
widgetMargin |
2 | Margin around widgets in docks | |
dockEdgePadding |
3 | Extra padding on each dock's window-facing edge (px), so widgets don't sit flush against the window edge | |
contentPaddingLeft |
5 | Left padding inside widget content area | |
contentPaddingTop |
5 | Top padding inside widget content area | |
promptBarTopPadding |
5 | Top padding inside prompt bar | |
floatingStartX |
100 | Default X position for new floating widgets | |
floatingStartY |
100 | Default Y position for new floating widgets | |
| Drag Behavior | |||
dragThreshold |
5 | Pixels of movement before a click becomes a drag | |
dockDropBuffer |
200 | Detection area beyond dock bounds | |
snapThreshold |
15 | Distance for height snap between widgets | |
sideBySideOffset |
20 | Bottom-margin clamp used during height resize | |
dropEndBandHeight |
48 | Height of the "dock at end of side" preview band (px) | |
| Theme | |||
theme |
"gold" | Active color theme name | |
Colors (RGB tuples in mdw.config.colors) |
|||
colors.sidebar |
{26, 24, 21} | Sidebar background | |
colors.widgetBackground |
{30, 30, 30} | Widget content background | |
colors.widgetForeground |
{200, 200, 200} | Widget text color | |
colors.headerBackground |
{38, 38, 38} | Header/title bar background | |
colors.mainBackground |
{17, 16, 16} | Mudlet main console background (theme-overridable) | |
colors.menuBackground |
{51, 51, 51} | Dropdown menu background | |
colors.menuBorder |
{85, 85, 85} | Menu border color | |
colors.controlBackground |
{40, 38, 35} | Font Size menu +/- button background | |
colors.controlBorder |
{70, 65, 58} | Font Size menu +/- button border | |
colors.controlHover |
{60, 56, 50} | Font Size menu +/- button hover | |
colors.splitter |
{57, 53, 49} | Splitter/border color | |
colors.splitterHover |
{184, 134, 11} | Splitter hover color | |
colors.accent |
{184, 134, 11} | Accent color (drop indicators, highlights) | |
colors.accentDim |
{218, 165, 32} | Dimmed accent color | |
colors.tabActive |
{58, 52, 38} | Active tab background | |
colors.tabInactive |
{38, 38, 38} | Inactive tab background | |
colors.headerText |
{184, 134, 11} | Title/header text color | |
colors.menuText |
{250, 235, 215} | Menu item text color | |
colors.menuHighlight |
{189, 183, 107} | Menu item hover text color | |
colors.tabActiveText |
{189, 183, 107} | Active tab text color | |
colors.tabInactiveText |
{184, 134, 11} | Inactive tab text color | |
colors.dockHighlight |
{184, 134, 11} | Dock highlight when dragging (0.4 alpha) | |
| Typography | |||
fontFamily |
Bitstream Vera Sans Mono | Default font family (Mudlet's bundled monospace); a game package seeds its own and ships the file | |
applyMainFont |
false | Opt-in: also render the MAIN Mudlet console in fontFamily. The player's own family is captured the first time MDW applies one and restored on a full uninstall |
|
contentFontSize |
11 | Base font size for widget content | |
mainFontSize |
11 | Main Mudlet console font size | |
promptFontAdjust |
0 | Prompt bar offset from contentFontSize | |
headerMenuFontSize |
12 | Font size for header buttons and dropdown menus | |
tabFontSize |
11 | Font size for tab buttons | |
widgetHeaderFontSize |
12 | Font size for widget title bars | |
minFontSize |
8 | Smallest selectable font size | |
maxFontSize |
20 | Largest selectable base font size | |
maxEffectiveFontSize |
30 | Upper clamp for derived sizes (base + per-widget adjust) | |
monoCharRatio |
0.65 | Fallback glyph-width ratio, used only when calcFontSize cannot measure the font (the measured advance is preferred) |
|
lineHeightRatio |
1.4 | Fallback line-box height as a multiple of the point size (same rule) | |
| Title Bar Buttons | |||
titleButtonSize |
12 | Width/height of icon buttons | |
titleButtonPadding |
5 | Padding from left edge for title buttons | |
titleButtonGap |
4 | Gap between title buttons | |
closeButtonPadding |
4 | Padding from right edge for close button | |
| Buffering | |||
maxEchoBuffer |
200 | Echo calls remembered per console so a resize can replay them at the new wrap width; caps how much history survives a resize | |
| Sidebars Menu | |||
sidebarsMenuItems |
(table) | Items in the Sidebars dropdown menu |
The default fontFamily is Mudlet's bundled monospace, so a plain install
always has it. MDW ships no font of its own: a package seeding its own face
must also ship the .ttf/.otf, under a family name of its own - see
the note on bundling a font. If the named font is not
loaded (or unloads while the package shipping it updates itself), MDW renders
in Bitstream Vera Sans Mono for that session without overwriting the saved
preference, and picks the font back up once it is available again.
mdw.setFontFamily(name) changes it at runtime - see
Scripted Control.
A package that bundles a font should give it a family name of its own rather
than the upstream one - Fira Code Willowdale, not Fira Code. Mudlet
registers a package's fonts with QFontDatabase::addApplicationFont and
tracks them BY FILE, not by family, so a player who already has the upstream
font installed ends up with two families of the same name in Qt's database.
Which one renders is undocumented and platform-dependent, and it goes wrong
only on the machines that happen to have the font, so it survives testing.
Renaming the bundled copy also leaves the player's own font untouched. Check
the licence first: renaming is required for a font whose licence declares a
Reserved Font Name, and permitted for one that does not.
MDW ships example widgets to demonstrate its features. Disable them from your own script with mdw.loadExamples = false (checked at setup time, so load order does not matter). See Getting Started.