Version

The Version module contains information and utilities relating to the current version of Starlit. This module should be used to ensure the correct version of Starlit is running if your mod depends on a recent feature.

Require: require("Starlit/Version")

Data

const Starlit.Version.BUILD: integer

The major game build the current version of Starlit is designed for.

const Starlit.Version.MAJOR: integer

The major version of Starlit. Major versions are incremented when non-trivial breaking changes are made to the API.

const Starlit.Version.MINOR: integer

The minor version of Starlit. Minor versions are incremented when new features are added, and old features may be deprecated.

const Starlit.Version.PATCH: integer

The patch version of Starlit. Patch versions are incremented by bug fixes that don’t change (intended) functionality.

const Starlit.Version.VERSION_STRING: string

Mod version as a string.

Function

Starlit.Version.compareVersion(
    build: integer,
    major: integer,
    minor: integer,
    patch: integer
): (compatible: ("toolow" | "toohigh" | "compatible"))

Compares the version specified to the current version.

Parameters:
  • build (integer) – Major game build.

  • major (integer) – Major version of Starlit.

  • minor (integer) – Minor version of Starlit.

  • patch (integer) – Patch version of Starlit.

Returns:

compatible (("toolow" | "toohigh" | "compatible")) – A string indicating if the current version is compatible, or why it isn’t.

Starlit.Version.ensureVersion(major: integer, minor: integer, patch: integer): (compatible: ("toolow" | "toohigh" | "compatible"))

Compares the current version to the requested version, showing a popup to the user if it is not likely to be compatible.

Parameters:
  • major (integer) – Major version.

  • minor (integer) – Minor version.

  • patch (integer) – Patch version.

Returns:

compatible (("toolow" | "toohigh" | "compatible")) – A string indicating if the current version is compatible, or why it isn’t.