Version
local Version = require("Starlit/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.
Functions
-
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.
Warning
This function currently does not correctly delay the pop-up until the game is ready to display it. To be safe, wait until
OnGameStart
to call this function.
-
compareVersion(build:
integer
, major:integer
, minor:integer
, patch:integer
) Compares the version specified to the current version.
- Parameters:
build (
integer
) – Major game build (41, 42…).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.
Fields
-
BUILD:
integer
The major game build the current version of Starlit is designed for.
-
MAJOR:
integer
The major version of Starlit. Major versions are incremented when non-trivial breaking changes are made to the API.
-
MINOR:
integer
The minor version of Starlit. Minor versions are incremented when new features are added, and old features may be deprecated.
-
PATCH:
integer
The patch version of Starlit. Patch versions are incremented by bug fixes that don’t change (intended) functionality.