rednode API - v0.80.1
    Preparing search index...

    Interface UiWindow

    A window opened with ui.window.

    interface UiWindow {
        closed: boolean;
        id: string;
        close(): void;
        set(changes: WindowChanges): void;
    }
    Index
    closed: boolean

    True after UiWindow.close, or after the player closed it.

    id: string

    The window's id within the mod.

    • 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.

      Parameters

      Returns void

      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 });
      }