mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
- VCMI will now read templates from mods
- Added partial schema for RMG template
This commit is contained in:
parent
4e25d74e74
commit
2e70d8a084
12
Mods/vcmi/Mods/defaultTemplates/mod.json
Normal file
12
Mods/vcmi/Mods/defaultTemplates/mod.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"name" : "Default templates",
|
||||
"description" : "A set of random map templates for VCMI",
|
||||
|
||||
"version" : "0.99",
|
||||
"author" : "VCMI Team",
|
||||
"contact" : "http://forum.vcmi.eu/index.php",
|
||||
"modType" : "Templates",
|
||||
"templates" : [
|
||||
"config/defaultTemplates/rmg"
|
||||
],
|
||||
}
|
63
config/schemas/template.json
Normal file
63
config/schemas/template.json
Normal file
@ -0,0 +1,63 @@
|
||||
{
|
||||
|
||||
"type":"object",
|
||||
"$schema": "",
|
||||
|
||||
"title" : "VCMI random map template format",
|
||||
"description" : "Format used to define random map templates in VCMI",
|
||||
|
||||
|
||||
"definitions" :
|
||||
{
|
||||
"zone":{
|
||||
"type": "object",
|
||||
"required" : ["type", "monsters", "size", "level"],
|
||||
"properties":{
|
||||
"type":{"$ref" : "#/definitions/type"},
|
||||
"size":{"$ref" : "#/definitions/size"},
|
||||
"playerTowns":{"$ref" : "#/definitions/playerTowns"},
|
||||
"neuralTowns":{"$ref" : "#/definitions/neuralTowns"},
|
||||
"townsAreSameType":{"$ref" : "#/definitions/townsAreSameType"},
|
||||
"monsters":{"$ref" : "#/definitions/monsters"},
|
||||
"mines":{"$ref" : "#/definitions/mines"},
|
||||
"treasure":{
|
||||
"type":"array",
|
||||
"items":{
|
||||
"type": "object",
|
||||
"properties":{
|
||||
"min": {"type":"number", "minimum" : 0},
|
||||
"max": {"type":"number", "minimum" : 0},
|
||||
"density": {"type":"number", "minimum" : 1}
|
||||
},
|
||||
"additionalProperties" : false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"type" :{
|
||||
"type" : "object",
|
||||
"enum": ["playerStart", "treasure", "junction"]
|
||||
"additionalProperties" : false
|
||||
"type":"string"
|
||||
},
|
||||
"size":{
|
||||
"type": "number",
|
||||
"minimum": 1,
|
||||
"additionalProperties" : false,
|
||||
}
|
||||
},
|
||||
|
||||
"properties":
|
||||
{
|
||||
"zones":{
|
||||
"type": "array",
|
||||
"items":{"$ref" : "#/definitions/zone" }
|
||||
},
|
||||
"connections":{
|
||||
"type": "array",
|
||||
"items":{"$ref" : "#/definitions/connection"}
|
||||
}
|
||||
"required" : ["zones", "connections"],
|
||||
"additionalProperties" : false
|
||||
}
|
||||
}
|
@ -385,6 +385,7 @@ CContentHandler::CContentHandler()
|
||||
handlers.insert(std::make_pair("objects", ContentTypeHandler(VLC->objtypeh, "object")));
|
||||
handlers.insert(std::make_pair("heroes", ContentTypeHandler(VLC->heroh, "hero")));
|
||||
handlers.insert(std::make_pair("spells", ContentTypeHandler(VLC->spellh, "spell")));
|
||||
handlers.insert(std::make_pair("templates", ContentTypeHandler((IHandlerBase *)VLC->tplh, "template")));
|
||||
|
||||
//TODO: any other types of moddables?
|
||||
}
|
||||
|
@ -942,6 +942,8 @@ enum class ESpellSchool: ui8
|
||||
EARTH = 3
|
||||
};
|
||||
|
||||
ID_LIKE_OPERATORS_DECLS(SpellID, SpellID::ESpellID)
|
||||
|
||||
// Typedef declarations
|
||||
typedef ui8 TFaction;
|
||||
typedef si64 TExpType;
|
||||
|
@ -115,12 +115,12 @@ void LibClasses::init()
|
||||
|
||||
createHandler(terviewh, "Terrain view pattern", pomtime);
|
||||
|
||||
createHandler(tplh, "Template", pomtime); //templates need already resolved identifiers (refactor?)
|
||||
|
||||
logGlobal->infoStream()<<"\tInitializing handlers: "<< totalTime.getDiff();
|
||||
|
||||
modh->load();
|
||||
|
||||
createHandler(tplh, "Template", pomtime); //templates need already resolved identifiers (refactor?)
|
||||
|
||||
modh->afterLoad();
|
||||
|
||||
//FIXME: make sure that everything is ok after game restart
|
||||
|
Loading…
Reference in New Issue
Block a user