Skip to content

naxane/nax-ccuilib

Repository files navigation

nax-ccuilib

Aims to provide cross compatibility with multiple mods wanting to use the same UI space.

Quick menu extension

showcase.mp4

The action button is right click or press X on gamepad.
To enter edit mode, press the action button.
To switch rings on gamepad, use L1 and R1.

Mods that add more widgets

For developers

Building

git clone https://github.com/naxane/nax-ccuilib
cd nax-ccuilib
pnpm run build

This should compiled into dist and zip the contents into a .ccmod in build.

Adding your own widget

import type * as _ from 'nax-ccuilib/src/headers/nax/quick-menu-public-api.d.ts'

/* check if the mod is installed */
if (window.nax?.ccuilib?.QuickRingMenuWidgets) {
    nax.ccuilib.QuickRingMenuWidgets.addWidget({
        name: 'freesp',
        title: 'Give SP',
        description: 'Gives the player SP',
        pressEvent: () => {
            ig.game.playerEntity.params.currentSp += 4
        },
        image: () => ({
            gfx: new ig.Image('media/gui/menu.png'),
            srcPos: { x: 593, y: 18 },
            pos: { x: 11, y: 10 },
            size: { x: 12, y: 12 },
        }),
    })
}

As an example of a toggleable widget, see cc-jetpack-widget