TranslateMapName()
This commit is contained in:
parent
2f33bc91b0
commit
cde6cd9dbc
3 changed files with 25 additions and 7 deletions
15
docs/app.js
15
docs/app.js
File diff suppressed because one or more lines are too long
|
|
@ -3,6 +3,7 @@
|
|||
// ---------------- Load main Hollow Knight database file ----------------- //
|
||||
|
||||
import HK from "./hk-database.js";
|
||||
import MAP from "./hk-dictionary.js";
|
||||
|
||||
// ---------------- Load image files (necessary for Webpack) ----------------- //
|
||||
|
||||
|
|
@ -741,7 +742,7 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
|
|||
for (let i = 0; i < arrayLength; i++) {
|
||||
if (sceneData.geoRocks[i].hitsLeft > 0) {
|
||||
countTotal++;
|
||||
console.log(`#${countTotal} | ${sceneData.geoRocks[i].id} | ${sceneData.geoRocks[i].sceneName}`);
|
||||
console.log(`#${countTotal} | ${sceneData.geoRocks[i].id} | ${TranslateMapName(sceneData.geoRocks[i].sceneName)}`);
|
||||
}
|
||||
}
|
||||
console.groupEnd();
|
||||
|
|
@ -782,7 +783,7 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
|
|||
if (length) {
|
||||
console.groupCollapsed("%cUnrescued Grubs List:", "color: #16c60c;");
|
||||
for (let i = 0; i < length; i++) {
|
||||
console.log(`#${HK.GRUBS_LIST.indexOf(missingGrubsList[i]) + 1} | ${missingGrubsList[i]}`);
|
||||
console.log(`#${HK.GRUBS_LIST.indexOf(missingGrubsList[i]) + 1} | ${TranslateMapName(missingGrubsList[i])}`);
|
||||
}
|
||||
console.groupEnd();
|
||||
}
|
||||
|
|
@ -1253,6 +1254,14 @@ function FillInnerHTML(elementId, textFill) {
|
|||
element.innerHTML = textFill;
|
||||
}
|
||||
|
||||
function TranslateMapName(mapCode, dictionary = MAP) {
|
||||
|
||||
let translation = mapCode;
|
||||
if (dictionary.hasOwnProperty(mapCode)) translation = dictionary[mapCode];
|
||||
|
||||
return translation;
|
||||
}
|
||||
|
||||
// Populate HTML at load (before img and css)
|
||||
document.addEventListener("DOMContentLoaded", InitialHTMLPopulate(HK.DIV_ID));
|
||||
|
||||
|
|
|
|||
|
|
@ -394,6 +394,4 @@ const MAP = {
|
|||
"GG_Workshop": "Godhome_Hall_Of_Gods"
|
||||
};
|
||||
|
||||
export {
|
||||
MAP
|
||||
};
|
||||
export default MAP;
|
||||
Loading…
Reference in a new issue