CyberM.webui

Runs inside the game process. Reads and presentation are local; anything that changes shared state has to go through the server.

client runtime2 functionsMarkdown

create

SHARED

CyberM.webui.create(options)

Creates a web surface.

Creation is asynchronous. A show() issued right after create loses the race against the visible flag the request carried, and the surface then never paints at all. So a surface meant to stay up is created with visible = true, and the page shows or hides its own content. Valid layers: hud, menu, modal, system (needs the webui.system permission), debug.

Parameters

  • optionstablerequired

Returns

  • surface, or nil
  • reason

Example

local overlay = WebUI.create({
    entry = "web/index.html",
    layer = "hud",
    transparent = true,
    visible = true          -- never false for a permanent overlay
})

Registered in ResourceHost.cpp as LuaWebUiCreate (line 6581).

default

SHARED

CyberM.webui.default()

The surface declared by web_ui_page in the manifest.

Returns the auto-created WebUI page declared by web_ui_page in the current manifest. It returns nil, reason when the resource has no live default page; the handle is generation-owned and becomes stale after destroy or reload.

Returns

  • surface, or nil

Registered in ResourceHost.cpp as LuaWebUiDefault (line 6582).

For agents and LLMs: this page as Markdown · llms.txt · llms-full.txt