Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
mods.h File Reference
#include "irrlichttypes.h"
#include <list>
#include <set>
#include <vector>
#include <string>
#include <map>
#include "json-forwards.h"
#include <unordered_set>
#include "util/basic_macros.h"
#include "config.h"
#include "metadata.h"
#include "subgames.h"
+ Include dependency graph for mods.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ModSpec
 
class  ModStorage
 

Macros

#define MODNAME_ALLOWED_CHARS   "abcdefghijklmnopqrstuvwxyz0123456789_"
 

Functions

bool parseModContents (ModSpec &mod)
 Retrieves depends, optdepends, is_modpack and modpack_content.
 
std::map< std::string, ModSpecgetModsInPath (const std::string &path, const std::string &virtual_path, bool part_of_modpack=false)
 Gets a list of all mods and modpacks in path.
 
std::vector< ModSpecflattenMods (const std::map< std::string, ModSpec > &mods)
 

Macro Definition Documentation

◆ MODNAME_ALLOWED_CHARS

#define MODNAME_ALLOWED_CHARS   "abcdefghijklmnopqrstuvwxyz0123456789_"

Function Documentation

◆ flattenMods()

std::vector< ModSpec > flattenMods ( const std::map< std::string, ModSpec > & mods)

References flattenMods(), ModSpec::is_modpack, and ModSpec::modpack_content.

Referenced by ModConfiguration::addModsFromConfig(), ModConfiguration::addModsInPath(), findLocaleFileInMods(), and flattenMods().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getModsInPath()

std::map< std::string, ModSpec > getModsInPath ( const std::string & path,
const std::string & virtual_path,
bool part_of_modpack = false )

Gets a list of all mods and modpacks in path.

Parameters
Pathto search, should be absolute
part_of_modpackIs this searching within a modpack?
virtual_pathVirtual path for this directory, see comment in ModSpec
Returns
map of mods

References DIR_DELIM, fs::GetDirListing(), and parseModContents().

Referenced by ModConfiguration::addModsFromConfig(), ModConfiguration::addModsInPath(), findLocaleFileInMods(), and parseModContents().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseModContents()

bool parseModContents ( ModSpec & mod)

Retrieves depends, optdepends, is_modpack and modpack_content.

Returns
false if not a mod

References ModSpec::author, ModSpec::depends, ModSpec::deprecation_msgs, ModSpec::desc, DIR_DELIM, Settings::exists(), Settings::get(), getModsInPath(), Settings::getS32(), ModSpec::is_modpack, fs::IsFile(), ModSpec::modpack_content, ModSpec::name, ModSpec::optdepends, parseDependsString(), ModSpec::path, Settings::readConfigFile(), fs::ReadFile(), ModSpec::release, str_split(), and ModSpec::virtual_path.

Referenced by getModsInPath(), ModApiMainMenu::l_check_mod_configuration(), and ModApiMainMenu::l_get_content_info().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: