readme.md
This commit is contained in:
parent
22cff630ee
commit
3493f0bcc3
4 changed files with 9 additions and 12 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -2,8 +2,4 @@ fontello-7bf7a0b6/
|
|||
css/
|
||||
font/
|
||||
images/
|
||||
plain.json
|
||||
reznor88banish.json
|
||||
reznor112grimm.json
|
||||
reznor100.json
|
||||
reznor0.json
|
||||
save/
|
||||
|
|
@ -239,6 +239,8 @@ function HKCheckCompletion(jsonObject) {
|
|||
fillHTML(DIV_ID.intro, "Hollow Knight Completion: ", " %");
|
||||
}
|
||||
|
||||
// ---------------- Time Played ----------------- //
|
||||
|
||||
if (i === "playTime") {
|
||||
let seconds = Math.floor(HKPlayerData.playTime);
|
||||
let minutes = Math.floor((seconds / 60) % 60);
|
||||
|
|
|
|||
|
|
@ -1,24 +1,23 @@
|
|||
var jsonObj = "";
|
||||
var fileName = ["save/reznor88banish.json", "save/reznor112grimm.json", "save/reznor100.json", "save/reznor0.json"];
|
||||
|
||||
/**
|
||||
* Reads the .json file and parses it to a JS object (jsonObj).
|
||||
* @param callback Asynchronous function.
|
||||
*/
|
||||
function loadJSON(callback) {
|
||||
function loadJSON(filename, callback) {
|
||||
// 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();
|
||||
|
||||
xobj.overrideMimeType("application/json");
|
||||
|
||||
let fileName = ["reznor88banish.json", "reznor112grimm.json", "reznor100.json", "reznor0.json"];
|
||||
|
||||
// Specifies the request
|
||||
/* method: the request type GET or POST
|
||||
url: the file location
|
||||
async: true (asynchronous) or false (synchronous)
|
||||
user: optional user name
|
||||
psw: optional password */
|
||||
xobj.open('GET', fileName[1], true); // Path to the file
|
||||
xobj.open('GET', filename, true); // Path to the file
|
||||
|
||||
// Defines a function to be called when the readyState property changes
|
||||
xobj.onreadystatechange = function GetResponseText() {
|
||||
|
|
@ -32,7 +31,7 @@ function loadJSON(callback) {
|
|||
xobj.send(null);
|
||||
}
|
||||
|
||||
loadJSON(
|
||||
loadJSON(fileName[3],
|
||||
function JSONparse(response) {
|
||||
// Parse JSON string into object
|
||||
jsonObj = JSON.parse(response);
|
||||
|
|
|
|||
Loading…
Reference in a new issue