diff --git a/generate.js b/generate.js index 589094e..511abbe 100644 --- a/generate.js +++ b/generate.js @@ -75,6 +75,14 @@ C.EXTRA_HEROES_GAMEDATA_FOLDERS.forEach(function(EXTRA_HERO) NEEDED_FILE_PATHS.push("mods\\heroesdata.stormmod\\base.stormdata\\GameData\\Heroes\\" + EXTRA_HERO + "Data\\" + EXTRA_HERO + "Data.xml"); }); +Object.forEach(C.EXTRA_MOUNT_DATA_FILES, function(EXTRA_MOUNT_DIR, EXTRA_MOUNT_FILES) +{ + EXTRA_MOUNT_FILES.forEach(function(EXTRA_MOUNT_FILE) + { + NEEDED_FILE_PATHS.push("mods\\heroesdata.stormmod\\base.stormdata\\GameData\\Mounts\\" + EXTRA_MOUNT_DIR + "Data\\Mount_" + EXTRA_MOUNT_FILE + "Data.xml"); + }); +}); + Object.forEach(C.EXTRA_HEROES_HEROMODS_NAMED, function(heroName, gameDataName) { NEEDED_FILE_PATHS.push("mods\\heromods\\" + heroName + ".stormmod\\base.stormdata\\GameData\\" + gameDataName + "Data.xml"); @@ -161,6 +169,7 @@ tiptoe( base.info("\nValidating %d mounts...", mounts.length); mounts.forEach(validateMount); + mounts.sort(function(a, b) { return (a.name.startsWith("The ") ? a.name.substring(4) : a.name).localeCompare((b.name.startsWith("The ") ? b.name.substring(4) : b.name)); }); base.info("\nSaving JSON..."); @@ -187,16 +196,17 @@ function processMountNode(mountNode) mount.id = attributeValue(mountNode, "id"); mount.name = S["Mount/Name/" + mount.id]; - if(!mount.name) + if(!mount.name || !!(+getValue(mountNode, "Flags[@index='IsVariation']", 0))) return undefined; - + mount.description = S["Mount/Info/" + mount.id]; mount.franchise = getValue(mountNode, "Universe", "Starcraft"); - - if(!!(+getValue(mountNode, "Flags[@index='IsVariation']", 0))) - return undefined; - mount.releaseDate = processReleaseDate(mountNode.get("ReleaseDate")); + mount.productid = getValue(mountNode, "ProductId"); + if(mount.productid) + mount.productid = +mount.productid; + else + delete mount.productid; /* diff --git a/shared/C.js b/shared/C.js index 089f3e4..3b50f45 100644 --- a/shared/C.js +++ b/shared/C.js @@ -20,6 +20,28 @@ exports.HERO_ID_TEXTURE_RENAMES = {"Dryad" : "lunara", "Greymane" : "genngreyman exports.EXTRA_XML_FILE_PATHS = []; +// Extra mount data files in GameData/Mounts/Data/Mount_Data.xml +exports.EXTRA_MOUNT_DATA_FILES = { + "Cloud9Nexagon" : ["Ridesurf_Cloud9Nexagon"], + "Felstalker" : ["Ride_Felstalker"], + "Horse" : ["Horse_ArmoredWarSteed", + "Horse_Common", + "Horse_HeadlessHorseman", + "Horse_IllidansNightmare", + "Horse_JudgementCharger", + "Horse_MalthaelsPhantom", + "Horse_MarshalsOutrider", + "Horse_Nazeebra", + "Horse_NexusCharger", + "Horse_RainbowUnicorn", + "Horse_TyraelsCharger" ], + "LionGreymane" : ["Ride_LionGreymane"], + "LunarDragon" : ["Ride_LunarDragon"], + "StarChariot" : ["Ridesurf_StarChariot"], + "Starbreaker" : ["Ridebike_Starbreaker"], + "TreasureGoblinWinter" : ["Ride_TreasureGoblinWinter"] +}; + // Extra hero data files GameData/Heroes/Data.xml exports.EXTRA_HEROES_GAMEDATA_FILES = ["Chen", "Zagara"]; @@ -297,11 +319,13 @@ exports.MOUNT_JSON_SCHEMA = name : { type : "string", minLength : 1 }, description : { type : "string", minLength : 1 }, franchise : { type : "string", minLength : 1 }, - releaseDate : { type : "string", pattern : "2[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" } + releaseDate : { type : "string", pattern : "2[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" }, + productid : { type : "integer" } } }; exports.MOUNT_JSON_SCHEMA.required = Object.keys(exports.MOUNT_JSON_SCHEMA.properties); +exports.MOUNT_JSON_SCHEMA.required.remove("productid"); exports.HERO_JSON_SCHEMA = { diff --git a/web/changelog.json b/web/changelog.json index 383f098..4443051 100644 --- a/web/changelog.json +++ b/web/changelog.json @@ -1,4 +1,13 @@ [ + { + "version" : "2.7.1", + "when" : "2016-02-04", + "patchVersion" : "40431", + "changes" : [ + "Added documentation for mounts.json file.", + "Added some missing mounts." + ] + }, { "version" : "2.7.0", "when" : "2016-02-02", diff --git a/web/generate.js b/web/generate.js index 5a692e2..b87f266 100644 --- a/web/generate.js +++ b/web/generate.js @@ -89,6 +89,7 @@ tiptoe( base.info("Rendering index..."); dustData.heroesSize = printUtil.toSize(fs.statSync(path.join(WEB_OUT_PATH, "heroes.json")).size, 1); + dustData.mountsSize = printUtil.toSize(fs.statSync(path.join(WEB_OUT_PATH, "mounts.json")).size, 1); dustData.changeLog = JSON.parse(fs.readFileSync(path.join(__dirname, "changelog.json"), {encoding : "utf8"})).map(function(o) { o.when = moment(o.when, "YYYY-MM-DD").format("MMM D, YYYY"); return o; }); dustData.lastUpdated = dustData.changeLog[0].when; dustData.version = dustData.changeLog[0].version; diff --git a/web/index.dust b/web/index.dust index 1224d66..1d88ba8 100644 --- a/web/index.dust +++ b/web/index.dust @@ -50,6 +50,14 @@ {heroesSize} + + + mounts.json + + + {mountsSize} + +
@@ -60,7 +68,7 @@
The 'heroes.json' file is an array where each entry is a hero object with key/value pairs.

Below you will find a table detailing each key.

- The heros are sorted by 'name'.
+ The heroes are sorted by 'name'.

All data is extracted directly from the Heros of the Storm game files.

@@ -90,7 +98,7 @@ The name of this hero. - title + title7 "Dominion Ghost" The title of this hero. @@ -356,6 +364,59 @@

+

mounts.json Documentation(back to top)

+

All JSON files are UTF8 encoded and may contain UTF8 characters.
+
The 'mounts.json' file is an array where each entry is a mount object with key/value pairs.
+
Below you will find a table detailing each key.
+
+ The mounts are sorted by 'name'.
+
+ All data is extracted directly from the Heros of the Storm game files.
+
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyExampleDescription
id"MoneyPig"The internal ID of this mount.
name"Piggy Bank"The name of this mount.
description"This little piggy went, "Whee whee whee!" all the way to the bank!"The description of this mount.
franchise"Heroes"Which universe/franchise this mount comes from.
releaseDate"2014-10-14"The release date for this mount. Date format: YYYY-MM-DD
productid10072The internal product id for this mount. Not present for all mounts.
+
+

Example Hero(back to top)