What it does
desktop_state
Initial state defaults for the desktop shell UI. A single factory
function — createInitialState() — returns a fresh state table with
every field set to its default. Stateless, no engine calls.
Exports
M.createInitialState() -> DesktopShellState— build a fresh desktop shell state table; every call returns an independent copy.
Types:
DesktopShellState = { selected_shortcut, start_menu_open, context_menu_kind?, context_target, context_x, context_y, my_computer_open, my_computer_minimized, my_computer_maximized, browser_open, browser_minimized, browser_maximized, text_editor_open, text_editor_minimized, text_editor_maximized, browser_url, browser_input, fs_path, fs_selected, status_text, clock_text, system_tools_open }
Usage
local DesktopState = require("@builtin::modules.desktop_state")
local state = DesktopState.createInitialState()
state.start_menu_open = true
Notes
- The returned table is the authoritative state for one desktop session.
Mutations are direct; pass it to
desktop_router.registerHandlersasdeps.stateto wire callbacks into the same table. createInitialStatealways returns a fresh table — call once at mount time, not every frame.
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.