Skip to content

MalifaciousGames/Mali-s-Macros

Repository files navigation

Macros

The 'a' macro

Create highly customizable links and buttons that take any HTML attributes, have built-in key bindings support and multiple output options.

The 'a' macro


The 'arrowbox' macro

A hybrid input element similar to SugarCube's <<cycle>> but which can be cycled in either directions by clicking, scrolling or using the arrow keys.

The 'arrowbox' macro


The 'checkvars' macro

This macro prints the active variables (State variables and temporary, settings and setup) to a dialog. The new version also lets you edit their values for testing.

The 'checkvars' macro


The 'cooldown' macro

Disable clickable elements for a given time after click.

The 'cooldown' macro


The 'drag' and 'drop' macro set

The drag and drop macros let you create and manage draggable elements in Sugarcube.

The 'drag' and 'drop' macro set


The 'hover' macro

Displays a tooltip, run code and/or replace content on hover.

The 'hover' macro


The 'image-map' macro set

This macro set lets users create scalable, Sugarcube-compatible image maps.

The 'image-map' macro set


The 'input' macro set

Highly customizable input elements which can run code when a given value is entered, among other things.

The 'input' macro set


The 'KeyControl' API and macro set

The KeyControl API lets you create and handle custom shortcuts. The API itself is format-agnostic, a set of SugarCube macros is included to interact with it.

KeyControl API and macro set


The 'listen' macro

A configurable event listener in macro form. Mainly used to run code when an input element is modified.

The 'listen' macro


The 'log' macro

Lets you easily log data to the console, set up time trackers to monitor code execution and measure byte sizes.

'Log' macro


The 'on' and 'trigger' macros

This pair of macros make up an event-based refresh system. They are useful as a way to update displays but also for running asynchronous code.

The 'on' and 'trigger' macro set


JS-free settings API

This macro set lets you :

  • create settings without JavaScript knowledge
  • easily modify settings outside of the settings dialog

The settings macros


Template macro

Create Sugarcube templates with a macro rather than in JS.

Syntax

<<template 'templateName' ['alternativeName' ...]>>
   ...contents to display when the template is called...
<</template>>

Code

Macro.add('template', {
   tags : null,
   handler() {Template.add(this.args, this.payload[0].contents)}
});

The 'toggle' macro

Deprecated, use <<cycle>> + <<listen 'click'>> instead!

Releases

No releases published

Sponsor this project

Packages

No packages published