Skip to content

Engine train 9: scripts see the real window size from their first line - #234

Merged
vadi2 merged 2 commits into
mainfrom
ccr-14671218-tf96z6-engine-train-9
Nov 21, 2026
Merged

vadi2 merged 2 commits into
mainfrom
ccr-14671218-tf96z6-engine-train-9

Conversation

@vadi2

@vadi2 vadi2 commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Brief overview of PR changes/additions

Car 1: scripts read the game screen's window size from their first line

  • Scripts see the real main-window size from their first line, not 90x25 until the profile has loaded, so lines a package prints as it loads wrap at full width.
  • Carries Mudlet patch 0043: the headless session applies a start size before the scripts load.
  • Protocol 48: the control socket takes setScreenSize and setMainWindowSize as the next profile's start sizes.
  • The app keeps the last sizes the game screen gave (startSizes in the engine prefs) and sends them before each open and on attach.

Car 2: the starter UI's chat welcome refits after the window widens

  • Carries patch 0044: while the chat window holds only the welcome, it rewraps after a tablet turns or a phone unfolds.
  • On top of Mudlet #12843: mudlet-base-ui 1.9.6, .mpackage rebuilt.

Motivation for adding to Mudlet

Packages that size or wrap text when they load (Geyser autoWrap consoles, the starter UI) were laid out for 90 columns and stayed that way on a wider screen.

Other info (issues closed, discussion etc)

🤖 Generated with Claude Code

https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J

@vadi2
vadi2 force-pushed the ccr-14671218-tf96z6-engine-train-9 branch 5 times, most recently from 2479a1c to ed89550 Compare November 21, 2026 19:41
A profile's scripts now read the main window's size the game screen
gives from their first line, not 90 by 25 until the profile has
loaded. A Geyser window that wraps to its width and prints as the
profile loads, as the starter UI's chat window does, wraps at the
width the player sees rather than at about 13 columns.

- The engine gives a profile the sizes it was given before it opened
  as part of its start (Mudlet patch 0043, THeadlessSession's
  Options::mainWindowSize and screenSize), so they are in place before
  its first script runs and raise no sysWindowResizeEvent for it.
- Protocol 48: the control socket takes setScreenSize and
  setMainWindowSize, which the engine keeps for each profile opened
  after them and gives to none open now, as a profile's own socket
  exists only once it has opened.
- The app sends them before openProfile and on each attach. It keeps
  the last sizes the game screen gave a profile with no windows yet
  (StartSizes, "startSizes" in the engine preferences) with the
  window, text size and layout they were measured in, so the first
  profile opened after the app starts gets them too.

Tests: StartSizesTest (JVM); start_sizes in test_mudlet_engine.py;
GameSwitcherTest on the emulators.

Part of Mudlet/Mudlet#9011

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
The starter UI's chat window opens on its welcome, "Tells, says and
channel chat from the game will be collected here." A console keeps
the wrap a line had when it was printed, so after the game area
widened (a tablet turned, a phone unfolded) the welcome stayed wrapped
at the old, narrower width. Now, when the starter UI fits its dock to
a new window size and the chat window still holds only the welcome, it
prints the welcome again at the new width. Chat the game sent is never
touched, and a dock the player dragged to a width of their own is left
as it is. The desktop gets the same fix upstream.

Carried as Mudlet patch 0044 until Mudlet/Mudlet has it; no protocol
change.

Tests: starter_ui_welcome in test_mudlet_engine.py; upstream,
StarterUiChatWelcome_spec.lua.

Part of Mudlet/Mudlet#9011

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
@vadi2
vadi2 force-pushed the ccr-14671218-tf96z6-engine-train-9 branch from ed89550 to d391cdc Compare November 21, 2026 21:28
@vadi2
vadi2 merged commit ee1f577 into main Nov 21, 2026
23 checks passed
@vadi2
vadi2 deleted the ccr-14671218-tf96z6-engine-train-9 branch November 21, 2026 22:56
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.

2 participants