Tool Collection

Estimated reading time: 2 minutes

The ToolCollection module aggregates 8 sub-tool modules in a facade pattern, accessible via maplebirch.tool.

Submodule Overview

Access PathSubmoduleDescription
maplebirch.tool.consoleConsoleConsole cheat tools
maplebirch.tool.migrationmigrationData migration tools
maplebirch.tool.randrandSystemRandom number system
maplebirch.tool.macrodefineMacrosSugarCube2 macro definitions
maplebirch.tool.texthtmlToolsHTML text tools
maplebirch.tool.zonezonesManagerZones manager
maplebirch.tool.linkapplyLinkZoneLink zone handling
maplebirch.tool.otherotherToolsOther tools

Additionally, there are convenience properties:

PropertyDescription
maplebirch.tool.createlogCreate log functions with prefix
maplebirch.tool.utilsFramework internal utility function set

Global Utilities

The framework mounts a set of utility functions on window for direct use: clone, merge, equal, contains, random, either, SelectCase, convert, number, loadImage, etc. See Utilities for details.

Console

Console tools provide developers with quick testing and debugging capabilities.

const console = maplebirch.tool.console;

defineMacros (Macro Definitions)

Used to define and manage SugarCube2 macros:

const macro = maplebirch.tool.macro;

// Define a custom macro
macro.define("myMacro", function () {
  this.output.textContent = "Hello from macro";
});

The framework registers combat-related macros such as generateCombatAction and combatButtonAdjustments through this module.

Handles the application logic for link zones in the game:

const link = maplebirch.tool.link;