Class ModMetadata

#include <Geode/loader/ModMetadata.hpp>
classModMetadata{ ... }

Represents all the data gather-able from mod.json

Examples0
Public static methods4
staticgeode::ModMetadatacreateFromGeodeFile()

Create ModMetadata from a .geode package. Note that this function may fail if the JSON data is wrong; make sure to check hasErrors() afterwards on the ModMetadata!

staticgeode::ModMetadatacreate()

Create ModMetadata from a parsed json document. Note that this function may fail if the JSON data is wrong; make sure to check hasErrors() afterwards on the ModMetadata!

staticboolvalidateID()
No description provided
staticstd::stringformatDeveloperDisplayString(
std::vector<std::string>const&developers
)

Format a list of mod developers, truncated if there are multiple developers in the same way as in the mods list

ℹ Static because this is used by InstallListCell

Public member functions56
geode::ModMetadata&operator=()
No description provided
geode::ModMetadata&operator=()
No description provided
std::filesystem::pathconst&getPath()const

Path to the mod file

geode::ZStringViewgetBinaryName()const

Name of the platform binary within the mod zip

geode::VersionInfogetVersion()const

Mod Version. Should follow semantic versioning.

geode::ZStringViewgetID()const

Human-readable ID of the Mod. Should be in the format “developer.mod”. May only contain lowercase ASCII characters, numbers, dashes, underscores, and a single separating dot

geode::ZStringViewgetName()const

Name of the mod. May contain spaces & punctuation, but should be restricted to the ASCII character set.

std::vector<std::string>const&getDevelopers()const

The developers of this mod

std::optional<std::string>const&getDescription()const

Short & concise description of the mod.

std::optional<std::string>const&getDetails()const

Detailed description of the mod, written in Markdown (see <Geode/ui/MDTextArea.hpp>) for more info

std::optional<std::string>const&getChangelog()const

Changelog for the mod, written in Markdown (see <Geode/ui/MDTextArea.hpp>) for more info

std::optional<std::string>const&getSupportInfo()const

Support info for the mod; this means anything to show ways to support the mod’s development, like donations. Written in Markdown (see MDTextArea for more info)

std::optional<geode::ModMetadata::IssuesInfo>const&getIssues()const

Info about where users should report issues and request help

std::vector<geode::ModMetadata::Dependency>const&getDependencies()const

Dependencies

std::vector<geode::ModMetadata::Incompatibility>const&getIncompatibilities()const

Incompatibilities

std::vector<std::string>const&getSpritesheets()const

Mod spritesheet names

std::vector<std::pair<std::string,matjson::Value>>const&getSettings()const

Mod settings

ℹ Not a map because insertion order must be preserved

std::unordered_set<std::string>const&getTags()const

Get the tags for this mod

boolneedsEarlyLoad()const

Whether this mod has to be loaded before the loading screen or not

boolisAPI()const

Whether this mod is an API or not

std::optional<std::string>getGameVersion()const

Gets the target GD version for the current platform. Returns nullopt if mod targets any GD version.

geode::VersionInfogetGeodeVersion()const

Gets the target Geode version for the current platform.

intgetLoadPriority()const

Gets the load priority of this mod.

geode::Result<>checkGameVersion()const

Checks if mod can be installed on the current GD version. Returns Ok() if it can, Err explaining why not otherwise.

geode::Result<>checkGeodeVersion()const

Checks if mod can be installed on the current Geode version. Returns Ok() if it can, Err explaining why not otherwise.

geode::Result<>checkTargetVersions()const

Checks if mod can be installed on the current GD & Geode version. Returns Ok() if it can, Err explaining why not otherwise.

boolhasErrors()const

Check if this ModMetadata had parsing errors (or was completely unparseable)

std::vector<std::string>const&getErrors()const
No description provided
boolwasCompletelyUnparseable()const

Check if this ModMetadata was completely unparseable, i.e. created from an invalid ZIP file etc.

voidsetPath()
No description provided
voidsetBinaryName()
No description provided
voidsetVersion()
No description provided
voidsetID()
No description provided
voidsetName()
No description provided
voidsetDeveloper()
No description provided
voidsetDevelopers()
No description provided
voidsetDescription()
No description provided
voidsetDetails()
No description provided
voidsetChangelog()
No description provided
voidsetSupportInfo()
No description provided
voidsetRepository()
No description provided
voidsetIssues()
No description provided
voidsetDependencies()
No description provided
voidsetIncompatibilities()
No description provided
voidsetSpritesheets()
No description provided
voidsetSettings()
No description provided
voidsetTags()
No description provided
voidsetNeedsEarlyLoad(
boolvalue
)
No description provided
voidsetIsAPI(
boolvalue
)
No description provided
voidsetGameVersion()
No description provided
voidsetGeodeVersion()
No description provided
geode::ModMetadataLinks&getLinksMut()
No description provided
geode::ModJsontoJSON()const

Convert to JSON. Essentially same as getRawJSON except dynamically adds runtime fields like path

geode::ModJsongetRawJSON()const

Get the raw JSON file

booloperator==()const
No description provided
Fields0
Protected member functions0
Protected fields0
Derived classes0