Skip to content

Conversation

@kblaschke
Copy link
Member

@kblaschke kblaschke commented Dec 27, 2025

Implementing a Dear ImGui based preset editor within the application, with the following features:

  • Edit the currently running preset, open a preset file from disk for editing or create a new preset with default settings.
  • Accordeon-style editor grouped by effects, with all configurable parameters.
  • Parameter edit control is based on the type, e.g. boolean, int, float or color, using the proper ImGui controls with sensible ranges.
  • Code editor with syntax highlighting for both Milkdrop expressions and HLSL shaders.
  • Mouse-over hints in the code editor for known keywords, functions and variables in both expressions and shaders.
  • Automatic syntax checking for Milkdrop expressions while typing.
  • Semi-live preview, as the preset runs in the editor background, can be manually updated at any time (shortcut or button).

The PR is still a draft, as the save functionality is still WIP as the save to file dialog needs to be implemented. I've opened the Pr to make the feature more visible, as the editor itself already works and thus can be tested by interested devs.

Binary test builds can be found in my fork for Linux x64, macOS (Universal) and Windows x64. Note that the artifacts can only be downloaded when logged in to GitHub.

Includes live compilation of expression code.preset-editor

Also fixed some issues in the editor control and made Milkdrop expressions case-insensitive.
In a multi-line change, the last line wasn't colorized when applying a redo operation.
Users can now indent and unindent lines using the tab key:
- If no selection is active, pressing tab only inserts a tab or n spaces at the cursor position
- With no selection, pressing shift+tab unindents the current line one step
- If a selection is active, tab indents and shift+tab unindents all lines touched by the selection (with at least one character selected at the last line)
- Unindented lines with less than the tab size characters of whitespace will be fully unindented
- Lines with mixed indentation will be unindented using the proper number of spaces per tab if a tab char needs to be broken down (e.g. unindenting SSTSS with 4 characters will become SSSS)

The editor can be configured to insert tab (\t, 0x09) characters or mTabSize number of spaces.
Toggles drawing of the whole child as interfering with the user-resizable window makes ImGui forget the previously set height when expanding it again.
@kblaschke kblaschke self-assigned this Dec 27, 2025
@kblaschke kblaschke added the enhancement New feature or request label Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant