Liquid 2.19 Documentation

This documentation is super not-finished but it does have every function available in Liquid listed at the very least.

Table of Contents

    modInfo.json

    Liquid reads some extra keys in modInfo.json to make the mod menu work.

    All of these keys are optional, but it is recommended to fill out a name and description at the very least so liquid can reliably display the correct information in the mod menu.

    Mod Settings

    Mod settings are defined through a series of functions that register callbacks for when the settings are changed. Currently there are 3 different types of settings: checkbox settings, slider settings, and menu settings.

    Liquid.addCheckboxSetting(name, defaultValue, onChange, id=name)

    Liquid.addSliderSetting(name, defaultValue, min, max, step, onChange, id=name, isPercent=false)

    Liquid.addSliderSetting(name, defaultValue, min, max, step, onChange, id=name, displayValues=[])

    Liquid.addMenuSetting(name, defaultValue, options, onChange, id=name)

    I'll add descriptions to what each of these functions do later, the parameters themselves should be explanation enough right now. If you need a better explanation on something, just ask me in the official discord @DTmg

    Game UI

    These functions add a button somewhere to the ingame UI.

    Liquid.addMainMenuButton(text, onClick(game), showOnRight?, font?, onHover(game)?)

    Liquid.addGeneralStatsButton(onClick(city), text(city), spriteName, position, isActive(city)?, onHover(city)?, keybind?)

    Liquid.addQuickActionButton(onClick(city), spriteName, position, isActive(city)?, onHover(city)?, keybind?)

    I'll add descriptions to what each of these functions do later, the parameters themselves should be explanation enough right now. If you need a better explanation on something, just ask me in the official discord @DTmg

    Mod Files

    These functions add a way to access files stored in mods.

    Liquid.getModResource(filepath)

    Gets a resource loaded in your mod by the relative file path to the mod's base folder

    Liquid.onInfoFilesLoaded(file, callback(info))

    Gets an array of entries from info files in all mods matching that name, similar to how buildinginfo.json works. This can be used to define custom data files for your mod.

    Miscellaneous

    Miscellaneous functions and properties that don't really fit into any other category.

    Liquid.openModsMenu(gui, options)

    Open the Liquid mods menu.

    Liquid.getModID()

    Returns the mod ID (folder when local, workshop id when published) of your mod.

    Liquid.getModVersion()

    Returns the mod version of your mod specified in modInfo.json.

    Liquid.version

    Has the current Liquid version as shown in the mods menu.

    Mod Icon

    The mod menu will now try to automatically use an icon.png file if it shows up in your mod folder as the mod icon.

    Text Colors

    Liquid allows for almost all text in-game to have a custom color attached to it by prefixing it with a hex code in the format of [i#123456].