eslint es2015 fixes
This commit is contained in:
parent
a1a662782d
commit
245d48b7db
6 changed files with 19 additions and 9 deletions
1
.eslintignore
Normal file
1
.eslintignore
Normal file
|
|
@ -0,0 +1 @@
|
|||
files/
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -7,4 +7,5 @@ js/LoadJson.js
|
|||
config.json
|
||||
package.json
|
||||
package-lock.json
|
||||
workspace.code-workspace
|
||||
workspace.code-workspace
|
||||
.eslintrc.js
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
/* eslint-disable no-unused-vars */
|
||||
/* global bench */
|
||||
/* eslint-disable no-prototype-builtins */
|
||||
// ---------------- Constants ----------------- //
|
||||
|
||||
const DATA_UNKNOWN = "Data unknown";
|
||||
|
|
@ -1008,7 +1011,7 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData) {
|
|||
*/
|
||||
function CountMaps(mapArray) {
|
||||
let totalMaps = 0;
|
||||
for (i = 0, len = mapArray.length; i < len; i++) {
|
||||
for (let i = 0, len = mapArray.length; i < len; i++) {
|
||||
if (playerData[mapArray[i]] === true) totalMaps++
|
||||
}
|
||||
return totalMaps;
|
||||
|
|
@ -1018,6 +1021,10 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData) {
|
|||
textPrefix = dataObject[i][0];
|
||||
(dataObject[i][1]) ? textSuffix = dataObject[i][1]: textSuffix = "";
|
||||
|
||||
let amount = 0;
|
||||
let countTotal = 0;
|
||||
let total = 0;
|
||||
|
||||
switch (i) {
|
||||
case "areaMaps":
|
||||
case "grubsCollected":
|
||||
|
|
@ -1031,7 +1038,6 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData) {
|
|||
case "journalNotesCompleted":
|
||||
case "whiteDefenderDefeats":
|
||||
case "greyPrinceDefeats":
|
||||
let amount = 0;
|
||||
if (i === "areaMaps") {
|
||||
amount = CountMaps(dataObject[i][3]);
|
||||
} else if (i === "whisperingRoots") {
|
||||
|
|
@ -1042,7 +1048,7 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData) {
|
|||
if (i === "stationsOpened") {
|
||||
if (playerData.openedHiddenStation === true) amount++;
|
||||
}
|
||||
let countTotal = amount;
|
||||
countTotal = amount;
|
||||
if (i === "journalEntriesCompleted" || i === "journalNotesCompleted") {
|
||||
countTotal = amount + " / " + playerData.journalEntriesTotal;
|
||||
}
|
||||
|
|
@ -1091,7 +1097,7 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData) {
|
|||
case "relicsHallownestSeal":
|
||||
case "relicsKingsIdol":
|
||||
case "relicsArcaneEgg":
|
||||
let total = playerData[dataObject[i][3]] + playerData[dataObject[i][4]];
|
||||
total = playerData[dataObject[i][3]] + playerData[dataObject[i][4]];
|
||||
(total >= dataObject[i][2]) ? CurrentDataTrue(): CurrentDataBlank();
|
||||
textPrefix += ": " + total;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
var jsonObj = "";
|
||||
|
||||
// save file names list in the save/ folder
|
||||
|
||||
var fileName = [
|
||||
"reznor0", // 0
|
||||
"reznor1beforegruz", // 1
|
||||
|
|
@ -24,7 +23,7 @@ var fileName = [
|
|||
* @param {string} filename Path and .json file name to be loaded
|
||||
* @param callback Function to be called when the request completes
|
||||
*/
|
||||
function LoadJSON(filename, callback) {
|
||||
function LoadJSON(filename) {
|
||||
// new Http request object (asynchronous), both the web page and the XML file it tries to load, must be located on the same server.
|
||||
var xobj = new XMLHttpRequest();
|
||||
|
||||
|
|
@ -70,4 +69,4 @@ function LoadJSON(filename, callback) {
|
|||
} */
|
||||
|
||||
// jsonObj = LoadJSON("../save/" + fileName[5], JSONparse(response));
|
||||
jsonObj = LoadJSON("save/" + fileName[5] + ".json");
|
||||
LoadJSON("save/" + fileName[5] + ".json");
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
/* global aesjs, HKReadTextArea */
|
||||
/*
|
||||
Parts of the code thanks to bloodorca https://github.com/bloodorca/hollow (base64.js, functions.js) with slight modifications.
|
||||
The steps used there for decryption were taken from KayDeeTee https://github.com/KayDeeTee/Hollow-Knight-SaveManager
|
||||
|
|
@ -35,6 +36,7 @@ let bench = {
|
|||
* Starts benchmarking.
|
||||
* @param {FileList} input FileList object containing a list of File objects. The FileList behaves like an array, so you can check its length property to get the number of selected files.
|
||||
*/
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function LoadSaveFile(input, startTime = new Date()) {
|
||||
|
||||
// console.info("Input length: " + input.files.length)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
"use strict";
|
||||
|
||||
(function (root) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue