Represents all the data gather-able from mod.json
Class ModMetadata
#include <Geode/loader/ModMetadata.hpp>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()
staticstd::stringformatDeveloperDisplayString()
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=()
geode::ModMetadata&operator=(geode::ModMetadata&&other)
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)
geode::ModMetadataLinksconst&getLinks()const
Get the links (related websites / servers / etc.) for this mod
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
boolwasCompletelyUnparseable()const
Check if this ModMetadata was completely unparseable, i.e. created from an invalid ZIP file etc.
voidsetPath()
voidsetBinaryName(std::stringvalue)
voidsetVersion(geode::VersionInfovalue)
voidsetID(std::stringvalue)
voidsetName(std::stringvalue)
voidsetDeveloper(std::stringvalue)
voidsetDevelopers()
voidsetDescription()
voidsetDetails()
voidsetChangelog()
voidsetSupportInfo()
voidsetRepository()
voidsetIssues()
voidsetDependencies()
voidsetIncompatibilities()
voidsetSpritesheets()
voidsetSettings()
voidsetTags()
voidsetGameVersion(std::stringvalue)
voidsetGeodeVersion(geode::VersionInfovalue)
geode::ModMetadataLinks&getLinksMut()
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