Skip to content

Draw a mini console's or user window's colour with its alpha - #186

Open
vadi2 wants to merge 1 commit into
mainfrom
ccr-14671218-tf96z6-scriptui-consolealpha
Open

vadi2 wants to merge 1 commit into
mainfrom
ccr-14671218-tf96z6-scriptui-consolealpha

Conversation

@vadi2

@vadi2 vadi2 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Brief overview of PR changes/additions

A mini console's or user window's colour is now drawn with its alpha. setBackgroundColor(name, r, g, b, a) with a below 255, or a Geyser MiniConsole colour with one, lets what is under the window show through, as on the desktop: a mini console in the game area shows the labels and windows below it. ScriptWindow.backgroundArgb() (:protocol) gives a window's colour as ARGB, alpha clamped, or null without one; the console and the label both draw from it.

Motivation for adding to Mudlet

A common Geyser layout puts a chat box or HUD over a background label. The engine already sent bgAlpha for every window, but the app drew each console opaque, so the label underneath was hidden.

Other info (issues closed, discussion etc)

Part of Mudlet/Mudlet#9011

  • No protocol change (a new docs/protocol.md paragraph only).
  • docs/divergences.md: a user window, or a mini console the stacked layout makes a switcher page, shows black where the desktop shows its main window colour. docs/phase-f.md: a run's colour stays opaque.
  • Checked locally: :protocol tests (231), ktlint, lint.sh. Two review rounds; the second was clean.
  • CI: the app compile, Android lint and the instrumented ScriptWindowsTest (maroon label under a green mini console at alpha 0, 128 and 255) run here first; there is no Android SDK locally.
  • Bite: https://github.com/Mudlet/android/actions/runs/44226711382 (d1dfe39: the previous head 786bf65, which differs from this one only in docs/protocol.md, plus 3 breaks, each red in its own check: two JVM tests in "libmudlet / desktop-engine", the instrumented test in both emulators).
  • Device-only: nothing beyond the emulators.

🤖 Generated with Claude Code

https://claude.ai/code/session_016ujaeGdi2MHnkoicGsDqhg

On the desktop, TConsole::changeColors() styles a mini console's or
user window's colour as background-color: rgba(...) over a
transparent palette, and its text area fills only the cells whose
colour is not the console's. So setBackgroundColor(name, r, g, b, a)
with an alpha below 255, or a Geyser MiniConsole colour with one,
shows what is under the window: a common Geyser pattern puts a chat
box or HUD over a background label. The engine already sends bgAlpha
for every window with a colour and Protocol.kt reads it, but the app
drew every console opaque, so the label was hidden.

- ScriptWindows.kt: ScriptWindow.backgroundArgb(), the window's
  colour as ARGB with its alpha (clamped, as Protocol.kt reads
  bgAlpha as it comes), or null where it has no colour.
- ScriptWindowsArea.kt: WindowConsole paints that, with the console
  background where there is none. A mini console in the game area
  then shows the windows below it in its parent and the main
  console, as Mudlet's mini consoles, children of the main frame
  above its display, do. A user window, or a mini console that the
  stacked layout makes a page of the switcher, shows black. On the
  desktop a user window shows Mudlet's main window colour (its own
  window's when floating), which the app's user windows, part of the
  game area, do not have; the stacked layout draws no label from the
  side borders: docs/divergences.md records both.
- ScriptLabel.kt: a label's fill takes the same backgroundArgb(), as
  it drew the same colour and alpha in its own way.
- Runs keep their own colours opaque. The desktop fills a cell in a
  colour other than the console's with that colour, alpha and all,
  but a run's colour carries no alpha in the protocol, so a
  see-through setBgColor(name, r, g, b, a) is drawn opaque: noted in
  docs/phase-f.md.
- docs/protocol.md: a console's bg may be transparent too (a new
  paragraph; no protocol change). docs/phase-f.md: how a console
  draws its colour.

Tests: ScriptWindowsTest (instrumented) puts a maroon label under a
green mini console and finds maroon at alpha 0, the two mixed at 128
and green when opaque; on main it finds green at 0. ScriptWindowsTest
(:protocol) covers the alpha, a window without a colour, black, and
an alpha past either end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ujaeGdi2MHnkoicGsDqhg
@vadi2
vadi2 force-pushed the ccr-14671218-tf96z6-scriptui-consolealpha branch from 786bf65 to 57590ce Compare November 18, 2026 03:46

This branch has not been deployed

No deployments
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