Represents all the data gather-able from mod.json
Class ModMetadata
#include <Geode/loader/ModMetadata.hpp>
Examples0
Public static methods6
staticgeode::Result<geode::ModMetadata>createFromGeodeZip()
Create ModInfo from an unzipped .geode package
staticgeode::Result<geode::ModMetadata>createFromGeodeFile()
Create ModInfo from a .geode package
staticgeode::Result<geode::ModMetadata>createFromFile()
Create ModInfo from a mod.json file
staticgeode::Result<geode::ModMetadata>create()
Create ModInfo from a parsed json document
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 functions53
geode::ModMetadata&operator=()
geode::ModMetadata&operator=(geode::ModMetadata&&other)
std::filesystem::pathgetPath()const
Path to the mod file
std::stringgetBinaryName()const
Name of the platform binary within the mod zip
geode::VersionInfogetVersion()const
Mod Version. Should follow semantic versioning.
std::stringgetID()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
boolusesDeprecatedIDForm()const
True if the mod has a mod ID that will be rejected in the future, such as using uppercase letters or having multiple dots. Mods like this should release new versions that supersede the old ones
std::stringgetName()const
Name of the mod. May contain spaces & punctuation, but should be restricted to the ASCII character set.
std::vector<std::string>getDevelopers()const
The developers of this mod
std::optional<std::string>getDescription()const
Short & concise description of the mod.
std::optional<std::string>getDetails()const
Detailed description of the mod, written in Markdown (see <Geode/ui/MDTextArea.hpp>) for more info
std::optional<std::string>getChangelog()const
Changelog for the mod, written in Markdown (see <Geode/ui/MDTextArea.hpp>) for more info
std::optional<std::string>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::ModMetadataLinksgetLinks()const
Get the links (related websites / servers / etc.) for this mod
std::optional<geode::ModMetadata::IssuesInfo>getIssues()const
Info about where users should report issues and request help
std::vector<geode::ModMetadata::Dependency>getDependencies()const
Dependencies
std::vector<geode::ModMetadata::Incompatibility>getIncompatibilities()const
Incompatibilities
std::vector<std::string>getSpritesheets()const
Mod spritesheet names
std::vector<std::pair<std::string,matjson::Value>>getSettings()const
Mod settings
ℹ Not a map because insertion order must be preserved
std::unordered_set<std::string>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.
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.
voidsetPath()
voidsetBinaryName(std::stringconst&value)
voidsetVersion()
voidsetID(std::stringconst&value)
voidsetName(std::stringconst&value)
voidsetDeveloper(std::stringconst&value)
voidsetDevelopers()
voidsetDescription()
voidsetDetails()
voidsetChangelog()
voidsetSupportInfo()
voidsetRepository()
voidsetIssues()
voidsetDependencies()
voidsetIncompatibilities()
voidsetSpritesheets()
voidsetSettings()
voidsetTags()
voidsetNeedsEarlyLoad(boolconst&value)
voidsetIsAPI(boolconst&value)
voidsetGameVersion(std::stringconst&value)
voidsetGeodeVersion()
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