1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-05 18:41:05 +00:00

Add mapgen descriptions

This commit is contained in:
Xeno333 2025-06-07 13:41:55 -05:00
parent aba2b6638e
commit 5e018c4f5f
5 changed files with 45 additions and 10 deletions

View file

@ -62,6 +62,7 @@ const FlagDesc flagdesc_gennotify[] = {
struct MapgenDesc {
const char *name;
bool is_user_visible;
const char *description;
};
////
@ -75,14 +76,14 @@ struct MapgenDesc {
// Of the remaining, v5 last due to age, v7 first due to being the default.
// The order of 'enum MapgenType' in mapgen.h must match this order.
static MapgenDesc g_reg_mapgens[] = {
{"v7", true},
{"valleys", true},
{"carpathian", true},
{"v5", true},
{"flat", true},
{"fractal", true},
{"singlenode", true},
{"v6", true},
{"v7", true, "Default mapgen with large complex mountins and plains."},
{"valleys", true, "Large valleys with complex terrain and rivers."},
{"carpathian", true, "Realistic looking world with vast plains."},
{"v5", true, "Old mapgen."},
{"flat", true, "World Flat terrain."},
{"fractal", true, "Wold with fractal structure."},
{"singlenode", true, "Empty world, use for lua defined mapgens."},
{"v6", true, "Simple mapgen with few features, not recommended."},
};
static_assert(
@ -207,6 +208,14 @@ void Mapgen::getMapgenNames(std::vector<const char *> *mgnames, bool include_hid
}
}
void Mapgen::getMapgenDescriptions(std::vector<const char *> *mgdescriptions, bool include_hidden)
{
for (u32 i = 0; i != ARRLEN(g_reg_mapgens); i++) {
if (include_hidden || g_reg_mapgens[i].is_user_visible)
mgdescriptions->push_back(g_reg_mapgens[i].description);
}
}
void Mapgen::setDefaultSettings(Settings *settings)
{
settings->setDefault("mg_flags", flagdesc_mapgen,