ReadonlyclosedTrue after UiWindow.close, or after the player closed it.
ReadonlyidThe window's id within the mod.
Closes the window.
Changes the open window in place: its title, its title-bar buttons, its content. The window keeps its place and size, with no flicker, so one window can show several views. The new content's nodes work as in a new window; nodes taken out keep their state and can be shown again later. A closed window takes the changes too, and shows them when the player opens it again. Needs REDnode 0.57.0 or later.
import { ui } from "rednode";
const main = [ui.text("The main view")];
const keys = [ui.text("Your keys"), ui.button("Done", () => showMain())];
const win = ui.window({
title: "Designer",
titleButtons: [{ id: "keys", label: "Keys", icon: "key", onClick: () => showKeys() }],
children: main,
});
function showKeys() {
win.set({ title: "Designer: your keys", titleButtons: [], children: keys });
}
function showMain() {
win.set({ title: "Designer", titleButtons: [{ id: "keys", label: "Keys", icon: "key", onClick: showKeys }], children: main });
}
A window opened with ui.window.