17,101
edits
(Update for v1.3) |
(Update script) |
||
Line 108: | Line 108: | ||
// All data packages should now be within this.gameData | // All data packages should now be within this.gameData | ||
} | } | ||
getGameFileVersion() { | |||
const fileDOM = document.querySelector('#sidebar ul.nav-main'); | const fileDOM = document.querySelector('#sidebar ul.nav-main'); | ||
let fileVer = 'Unknown'; | let fileVer = 'Unknown'; | ||
if (fileDOM !== null && fileDOM.dataset !== undefined) { | if (fileDOM !== null && fileDOM.dataset !== undefined) { | ||
return fileDOM.dataset.fileVersion; | |||
} | } | ||
return gameVersion + ' (' + | } | ||
getGameVersion() { | |||
return gameVersion; | |||
} | |||
getGameVersionText() { | |||
return this.getGameVersion() + ' (' + this.getGameFileVersion() + ')'; | |||
} | } | ||
getObjectByID(data, objectID, idKey = 'id') { | getObjectByID(data, objectID, idKey = 'id') { | ||
Line 180: | Line 185: | ||
const result = await this.getWikiData(); | const result = await this.getWikiData(); | ||
} | } | ||
console.log('Printing data for game version ' + this. | console.log('Printing data for game version ' + this.getGameVersionText()); | ||
this.printPages.forEach((page) => { | this.printPages.forEach((page) => { | ||
const inclCat = this.getCategoriesForPage(page); | const inclCat = this.getCategoriesForPage(page); | ||
Line 842: | Line 847: | ||
registerNonPackData() { | registerNonPackData() { | ||
// Some data resides outside of packages. Add any such data to this.gameData within this function | // Some data resides outside of packages. Add any such data to this.gameData within this function | ||
// Metadata for data/file version | |||
if (this.gameData._dataVersion === undefined) { | |||
this.gameData._dataVersion = ({ | |||
gameVersion: this.getGameVersion().substring(1), | |||
fileVersion: this.getGameFileVersion().substring(1) | |||
}); | |||
} | |||
// Namespaces | |||
if (this.gameData.namespaces === undefined) { | if (this.gameData.namespaces === undefined) { | ||
const nsData = []; | const nsData = []; |