Skip to content

Add mod-defined interactive GUI widgets - #91

Merged
dshadowwolf merged 4 commits into
master-2.0-1.21.1-neofrom
codex/custom-gui-widgets
Nov 4, 2026
Merged

dshadowwolf merged 4 commits into
master-2.0-1.21.1-neofrom
codex/custom-gui-widgets

Conversation

@faceofcat

Copy link
Copy Markdown
Collaborator

Mods can now register custom XML widget types without changing MMDLib's built-in screen implementation. Each screen gets independent widget state with keyboard focus, text input, drag capture, scrolling, and typed server actions.

  • Add common widget/action registration, XML property validation, fixed-size layout, client factories, and lifecycle/input routing.
  • Validate typed actions against menu ownership, distance, visibility, session, allowed actions, payload bounds, request sequence, and rate limits. Return authoritative values with accept/reject acknowledgments and recover from response timeouts.
  • Demonstrate a progress dial and companion Settings view with name editing, energy reserve controls, and structured lane Run/Pause actions.
  • Document the extension API and cover registration, input handling, server validation, and graphical behavior with regression tests.

Compatibility: the screen network protocol advances to version 2; clients and servers must use matching MMDLib builds.

Validation completed locally:

  • 109 JUnit tests and 83 server game tests (67 library + 16 companion).
  • Full Gradle check, library and companion builds, and Javadoc generation.
  • Companion client smoke tests with and without JEI, covering editing, cancellation, acknowledgments, dragging, scrolling, resize/hide cleanup, and returning to the same screen instance.
  • git diff --check.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dshadowwolf

Copy link
Copy Markdown
Collaborator

Overall a great design. client[action] -> server[validate] -> {accept|reject] -- perfectly sane, basically optimal setup, with unclaimed actions timing out, rate-limiting and relay protection. I really like it.

Should fix:

  1. The client can get stuck showing a wrong value (I think, at least)
  2. Dropped actions lock the control for about 5 seconds
  3. A mod's widget codec can crash the client (buffer overruns, etc...)
  4. Releasing the mouse over the reserve slider can break item drags

Nits (don't need fixing, could be a follow-up)

  • Middle and side mouse buttons are swallowed when a drawer is open
  • Pending actions don't time out while another screen covers this one,
  • A validator exception other than IllegalArgumentException loses the file and line
  • Binder error messages are wrong for custom widget kinds
  • Widget visibility is recalculated several times for each input event and every frame

@dshadowwolf
dshadowwolf merged commit 2544f26 into master-2.0-1.21.1-neo Nov 4, 2026
4 of 5 checks passed
@faceofcat
faceofcat deleted the codex/custom-gui-widgets branch November 6, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants