Repository navigation
Conversation
The engine now tells the UI what scripts draw, from THeadlessSession's script-window API: windows (only what changed, with removed, and every window with full to a UI that attaches), each console's last 300 rows as windowText, the main window's area as mainArea and a console's own command line as windowCommandLine. The UI can give the main window's size, ask for any rows of a console, place or close a user window and send a line on a console's command line. libmudlet keeps the size the UI gave for each profile that loads; the stand-in has no script windows, says so on attach and refuses the requests. Versions 4 to 6 are left for protocol changes still in review. The window of a link (getLink/followLink) waits for version 5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ujaeGdi2MHnkoicGsDqhg
THeadlessSession sends a turn's main console lines as the turn runs, but its script windows, their text and command lines from the event loop after it. script_windows() waited for the chat console's windowText and then for the "main window" line the same runLua echoed, which had already come, and been collected, before the windowText: the wait timed out. Each wait now looks first at what came since its request, and a timeout lists what did come. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ujaeGdi2MHnkoicGsDqhg
The profile's mudlet-base-ui package attaches its container to the right border, so after setBorderLeft(100) the main console's text is narrower than the window less 100 by that border: read it with getBorderRight(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ujaeGdi2MHnkoicGsDqhg
The engine now tells the UI what each label shows, from THeadlessSession's labelContent(): a label message after the windows message, for each label whose text, image, SVG, movie, tool tip, accessible name or button, click-through or stylesheet changed, and for every label to a UI that attaches or drains. windows gives bgAlpha for a background below opaque, as a Geyser.Gauge's text label is transparent; its back and front labels' geometry gives its value. The UI can send what its pointer did on a window (pointer, run by THeadlessSession::pointer(), so a label's click callback runs) and ask for an image file, scaled or one frame of it, as a PNG (getImage, answered by image). The stand-in has no labels and refuses both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ujaeGdi2MHnkoicGsDqhg
The engine sends the profile's button bars (buttonBars) and the commands its packages added with addCommand() (commands), each whole, when it changed, and to a UI that attaches or drains; the UI presses a button or menu entry (pressButton) and clicks a command (activateCommand), both answered only when refused. MudletEngine follows THeadlessSession's buttonBars()/buttonsChanged and addonCommands()/addonCommandsChanged and calls pressButton() and activateAddonCommand(); the stand-in sends both lists empty and refuses both requests. Protocol.kt parses both messages, leaving out a bar in a place it does not know, and builds both requests; the app draws none of it yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ujaeGdi2MHnkoicGsDqhg
The engine sends the profile's 2D map (map) as a PNG drawn with THeadlessSession::renderMap() at the size of the mapper window, so a point of the map is a point of that window: on mapRepaintRequested, on mapViewOnlyChanged and when the mapper shows or changes size, only when it changed, and to a UI that attaches or drains while the mapper shows. The UI presses, double-clicks or turns the wheel on it (mapPointer, through mapPointer()) and switches between viewing and editing it (setMapViewOnly), both answered only when refused. The stand-in has no map and refuses both. Protocol.kt parses map and builds both requests; the app draws none of it yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ujaeGdi2MHnkoicGsDqhg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief overview of PR changes/additions
map {png, w, h, viewOnly}. It is drawn withTHeadlessSession::renderMap()at the mapper window's size, so a point on the map is the same point in that window. It is sent when it changes, and again to a UI that attaches or drains while the mapper shows. The app does not draw it yet.mapPointer {type, x, y, button?, modifiers?, wheelY?}), and switch between viewing and editing it (setMapViewOnly {viewOnly}). Both get a reply only when refused.MudletEngineredraws the map onmapRepaintRequestedandmapViewOnlyChanged, and when the mapper shows or changes size. It stops sending it while the mapper hides. The stand-in has no map and refuses both requests.Protocol.kthas the message, the request builders andMapPointerType. Protocol version 10.protocol.md,architecture.mdandroadmap.mdare updated.Geyser.Mapper, checked by room pixel; a press selects a room, a double-click speedwalks, the wheel zooms, a half notch is refused;mapModeChangeEvent;pointeron themapperwindow; reattach; hide and show.Motivation for adding to Mudlet
Many games depend on the mapper. This lets the Android UI show it and act on it in the same way as the desktop's.
Other info (issues closed, discussion etc)
libmudletand a Qt front-end Mudlet#9011test_engine.py,EngineLinkJvmTest,ProtocolTest,ProtocolSpecTest, ktlint, clang-format, MudletEngine syntax check against upstream headers; CI: this PR's run; bite: https://github.com/Mudlet/android/actions/runs/43678847189; device-only: none (no UI yet)Generated by Claude Code