Zones Manager (zonesManager)

Estimated reading time: 2 minutes

The zones manager handles widget registration and rendering for game interface areas. It is one of the framework's most important tools, allowing Mods to inject content into various areas of the game.

Access via maplebirch.tool.zone or maplebirch.tool.addTo().

Adding Widgets to Zones

const zone = maplebirch.tool.zone;

// Add a simple Twee widget
zone.addTo("sidebar", "<<myWidget>>");

// Add widget with conditions
zone.addTo("sidebar", {
  widget: "<<myWidget>>",
  exclude: ["Combat"],
  match: ["Home", "Shop"],
  passage: "MyPassage",
});

// Add with priority (lower number = earlier)
zone.addTo("sidebar", [5, "<<myWidget>>"]);

Shortcut Methods

maplebirch.tool.addTo("sidebar", "<<myWidget>>");

maplebirch.tool.onInit(() => {
  // Runs on each init
});

Available Zone Keys

Zone names passed to addTo() (e.g. "sidebar") map to specific injection points. The following are internal zone keys for Mods that need precise injection:

Zone KeyDescription
sidebarMain sidebar area
MenuSmallSmall menu
CaptionAfterDescriptionAfter caption description
HintMobileMobile icons (above pain)
MobileStatsMobile stats (pain, etc.)
CharaDescriptionCharacter description
DegreesBonusDisplayAttribute bonus display
DegreesBoxAttribute box

Built-in Initialization

The framework registers during preInit:

  • applyLocation() — Location-related logic
  • applyBodywriting() — Bodywriting-related logic