1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Merge pull request #3593 from vcmi/random_template_description

Add random map description and display it in RMG menu
This commit is contained in:
Ivan Savenko 2024-02-11 17:54:27 +02:00 committed by GitHub
commit dc8d48a3b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 45 additions and 11 deletions

View File

@ -1,9 +1,9 @@
{
"Blockbuster M" :
//(ban fly/DD, 2 player, 15-Jun-03, midnight design)
{
"minSize" : "m", "maxSize" : "m",
"players" : "2",
"description" : "Ban fly/DD, 2 player, 15-Jun-03, Midnight design",
"zones" :
{
"1" :
@ -119,6 +119,7 @@
{
"minSize" : "l", "maxSize" : "l",
"players" : "2",
"description" : "Ban fly/DD, 2 player, 15-Jun-03, Midnight design",
"zones" :
{
"1" :
@ -246,6 +247,7 @@
{
"minSize" : "xl", "maxSize" : "xl",
"players" : "2",
"description" : "Ban fly/DD, 2 player, 15-Jun-03, Midnight design",
"zones" :
{
"1" :

View File

@ -1,9 +1,9 @@
{
"Extreme L" :
//(ban fly/DD/orb inhibition/Castle-Necro-Conflux towns, 2 player, 3-Aug-03, midnight design)
{
"minSize" : "l", "maxSize" : "l",
"players" : "2",
"description" : "Ban fly/DD/Orb of Inhibition/Castle-Necro-Conflux towns, 2 player, 3-Aug-03, Midnight design",
"zones" :
{
"1" :
@ -180,10 +180,10 @@
]
},
"Extreme XL" :
//(ban fly/DD/orb inhibition/Castle-Necro-Conflux towns, 2 player, 3-Aug-03, midnight design)
{
"minSize" : "xl", "maxSize" : "xh",
"players" : "2",
"description" : "Ban fly/DD/Orb of Inhibition/Castle-Necro-Conflux towns, 2 player, 3-Aug-03, Midnight design",
"zones" :
{
"1" :

View File

@ -1,9 +1,9 @@
{
"Extreme II L":
//(ban fly/DD/orb inhibition/Castle-Necro-Conflux towns, 2 player, 3-Aug-03, midnight design)"
{
"minSize" : "l", "maxSize" : "l",
"players" : "2",
"description": "Ban fly/DD/orb inhibition/Castle-Necro-Conflux towns, 2 player, 3-Aug-03, Midnight design",
"zones" :
{
"1" :
@ -154,10 +154,10 @@
]
},
"Extreme II XL":
//(ban fly/DD/orb inhibition/Castle-Necro-Conflux towns, 2 player, 3-Aug-03, midnight design)
{
"minSize" : "xl", "maxSize" : "xh",
"players" : "2",
"description": "Ban fly/DD/orb inhibition/Castle-Necro-Conflux towns, 2 player, 3-Aug-03, Midnight design",
"zones" :
{
"1" :

View File

@ -3,6 +3,7 @@
{
"minSize" : "xl", "maxSize" : "xl",
"players" : "2",
"description" : "Ban Fly/DD, 2 player, 31-May-03, Midnight design",
"zones" :
{
"1" :
@ -322,6 +323,7 @@
{
"minSize" : "xl+u", "maxSize" : "g+u",
"players" : "2",
"description" : "Ban Fly/DD, 2 player, 31-May-03, Midnight design",
"zones" :
{
"1" :

View File

@ -3,6 +3,7 @@
{
"minSize" : "m+u", "maxSize" : "l+u",
"players" : "2",
"description" : "Ban Fly/DD, 2 player, 3-Aug-03, Midnight design",
"zones" :
{
"1" :

View File

@ -1,9 +1,9 @@
{
"Poor Jebus" :
//(made by Bjorn190, modified by Maretti and Angelito)
{
"minSize" : "m", "maxSize" : "xl+u",
"players" : "2-4",
"description" : "Made by Bjorn190, modified by Maretti and Angelito",
"zones" :
{
"1" :

View File

@ -1,9 +1,9 @@
{
"Reckless" :
//(2 player, 6-Jan-03, midnight design)
{
"minSize" : "l", "maxSize" : "xl+u",
"players" : "2",
"description" : "2 players, 6-Jan-03, Midnight design",
"zones" :
{
"1" :

View File

@ -1,9 +1,9 @@
{
"Roadrunner" :
//(ban fly/DD, 2 player, 31-May-03, midnight design)
{
"minSize" : "xl", "maxSize" : "xl",
"players" : "2",
"description" : "Ban fly/DD, 2 players, 31-May-03, Midnight design",
"zones" :
{
"1" :

View File

@ -3,6 +3,7 @@
{
"minSize" : "m", "maxSize" : "m",
"players" : "2",
"description" : "Ban fly/DD, 2 players, 3-Aug-03, Midnight design",
"zones" :
{
"1" :
@ -119,6 +120,7 @@
{
"minSize" : "m+u", "maxSize" : "l",
"players" : "2",
"description" : "Ban fly/DD, 2 players, 3-Aug-03, Midnight design",
"zones" :
{
"1" :

View File

@ -1,9 +1,9 @@
{
"SuperSlam" :
//(2 player, Large or XL no under) For powermonger players, meet by SLAMMING thru super zones. Your chances are not over until the fat lady sings! Should ban spec log along with normal random rules
{
"minSize" : "l", "maxSize" : "xl",
"players" : "2",
"description" : "2 players, Large or XL, no under) For powermonger players, meet by SLAMMING thru super zones. Your chances are not over until the fat lady sings! Should ban spec log along with normal random rules",
"zones" :
{
"1" :

View File

@ -1,9 +1,9 @@
{
"Triad L" :
//(ban fly/DD, 3 players, 9-Jan-03, midnight design)
{
"minSize" : "l", "maxSize" : "l",
"players" : "2-3",
"description" : "Ban fly/DD, 3 players, 9-Jan-03, Midnight design",
"zones" :
{
"1" :
@ -182,6 +182,7 @@
{
"minSize" : "xl", "maxSize" : "xl",
"players" : "3",
"description" : "Ban fly/DD, 3 players, 9-Jan-03, Midnight design",
"zones" :
{
"1" :

View File

@ -1,9 +1,9 @@
{
"Vortex" :
//(ban fly/DD, 3-4 player, 31-May-03, midnight design)
{
"minSize" : "xl", "maxSize" : "xl",
"players" : "2-4",
"description" : "Ban fly/DD, 3-4 players, 31-May-03, Midnight design",
"zones" :
{
"1" :

View File

@ -177,6 +177,18 @@ void RandomMapTab::updateMapInfoByHost()
mapInfo->mapHeader->version = EMapFormat::VCMI;
mapInfo->mapHeader->name.appendLocalString(EMetaText::GENERAL_TXT, 740);
mapInfo->mapHeader->description.appendLocalString(EMetaText::GENERAL_TXT, 741);
const auto * temp = mapGenOptions->getMapTemplate();
if (temp)
{
auto randomTemplateDescription = temp->getDescription();
if (!randomTemplateDescription.empty())
{
auto description = std::string("\n\n") + randomTemplateDescription;
mapInfo->mapHeader->description.appendRawString(description);
}
}
mapInfo->mapHeader->difficulty = EMapDifficulty::NORMAL;
mapInfo->mapHeader->height = mapGenOptions->getHeight();
mapInfo->mapHeader->width = mapGenOptions->getWidth();

View File

@ -135,6 +135,10 @@
"description" : "Optional name - useful to have several template variations with same name",
"type": "string"
},
"description" : {
"description" : "Optional info about template, author or special rules",
"type": "string"
},
"zones" : {
"description" : "List of named zones",
"type" : "object",

View File

@ -8,6 +8,8 @@
{
//Optional name - useful to have several template variations with same name
"name" : "Custom template name",
//Any info you want to be displayed in random map menu
"description" : "Detailed info and recommended rules",
/// Minimal and maximal size of the map. Possible formats:
/// Size code: s, m, l or xl for size with optional suffix "+u" for underground

View File

@ -541,6 +541,11 @@ const std::string & CRmgTemplate::getName() const
return name;
}
const std::string & CRmgTemplate::getDescription() const
{
return description;
}
const std::string & CRmgTemplate::getId() const
{
return id;
@ -682,6 +687,7 @@ int CRmgTemplate::CPlayerCountRange::minValue() const
void CRmgTemplate::serializeJson(JsonSerializeFormat & handler)
{
handler.serializeString("name", name);
handler.serializeString("description", description);
serializeSize(handler, minSize, "minSize");
serializeSize(handler, maxSize, "maxSize");
serializePlayers(handler, players, "players");

View File

@ -248,6 +248,7 @@ public:
void setName(const std::string & value);
const std::string & getId() const;
const std::string & getName() const;
const std::string & getDescription() const;
const CPlayerCountRange & getPlayers() const;
const CPlayerCountRange & getHumanPlayers() const;
@ -263,6 +264,7 @@ public:
private:
std::string id;
std::string name;
std::string description;
int3 minSize;
int3 maxSize;
CPlayerCountRange players;