|
|
@ -24,6 +24,7 @@ var packsURL = "http://cdn.0x40hu.es/getRespacks.php"; |
|
|
|
|
|
|
|
|
|
|
|
function Resources(core) { |
|
|
|
function Resources(core) { |
|
|
|
this.core = core; |
|
|
|
this.core = core; |
|
|
|
|
|
|
|
this.hasUI = false; |
|
|
|
|
|
|
|
|
|
|
|
this.resourcePacks = []; |
|
|
|
this.resourcePacks = []; |
|
|
|
|
|
|
|
|
|
|
@ -71,8 +72,10 @@ function Resources(core) { |
|
|
|
this.fileInput = null; |
|
|
|
this.fileInput = null; |
|
|
|
this.fileParseQueue = []; |
|
|
|
this.fileParseQueue = []; |
|
|
|
this.currentlyParsing = false; |
|
|
|
this.currentlyParsing = false; |
|
|
|
|
|
|
|
if(!core.settings.defaults.noUI) { |
|
|
|
this.initUI(); |
|
|
|
this.initUI(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Array of URLs to load, and a callback for when we're done
|
|
|
|
// Array of URLs to load, and a callback for when we're done
|
|
|
|
// Preserves order of URLs being loaded
|
|
|
|
// Preserves order of URLs being loaded
|
|
|
@ -179,7 +182,7 @@ Resources.prototype.rebuildEnabled = function() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(this.hasUI) { |
|
|
|
var songList = this.enabledSongList; |
|
|
|
var songList = this.enabledSongList; |
|
|
|
while(songList.firstElementChild) { |
|
|
|
while(songList.firstElementChild) { |
|
|
|
songList.removeChild(songList.firstElementChild); |
|
|
|
songList.removeChild(songList.firstElementChild); |
|
|
@ -196,6 +199,7 @@ Resources.prototype.rebuildEnabled = function() { |
|
|
|
var image = this.enabledImages[i]; |
|
|
|
var image = this.enabledImages[i]; |
|
|
|
this.appendSimpleListItem(image.name, imageList, this.selectImageCallback(i)); |
|
|
|
this.appendSimpleListItem(image.name, imageList, this.selectImageCallback(i)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
this.updateTotals(); |
|
|
|
this.updateTotals(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -268,6 +272,7 @@ Resources.prototype.parseLocalQueue = function(recursing) { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Resources.prototype.localProgress = function(progress, respack) { |
|
|
|
Resources.prototype.localProgress = function(progress, respack) { |
|
|
|
|
|
|
|
if(!this.hasUI) {return;} |
|
|
|
this.packsView.progressStatus.textContent = "Processing..."; |
|
|
|
this.packsView.progressStatus.textContent = "Processing..."; |
|
|
|
|
|
|
|
|
|
|
|
this.packsView.progressBar.style.width = (progress * 100) + "%"; |
|
|
|
this.packsView.progressBar.style.width = (progress * 100) + "%"; |
|
|
@ -510,14 +515,18 @@ Resources.prototype.initUI = function() { |
|
|
|
|
|
|
|
|
|
|
|
this.listView.appendChild(this.enabledSongList); |
|
|
|
this.listView.appendChild(this.enabledSongList); |
|
|
|
this.listView.appendChild(this.enabledImageList); |
|
|
|
this.listView.appendChild(this.enabledImageList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.hasUI = true; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Resources.prototype.hideLists = function() { |
|
|
|
Resources.prototype.hideLists = function() { |
|
|
|
|
|
|
|
if(!this.hasUI) {return;} |
|
|
|
this.enabledSongList.className = "hidden"; |
|
|
|
this.enabledSongList.className = "hidden"; |
|
|
|
this.enabledImageList.className = "hidden"; |
|
|
|
this.enabledImageList.className = "hidden"; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Resources.prototype.toggleSongList = function() { |
|
|
|
Resources.prototype.toggleSongList = function() { |
|
|
|
|
|
|
|
if(!this.hasUI) {return;} |
|
|
|
if(this.enabledSongList.className == "hidden") { |
|
|
|
if(this.enabledSongList.className == "hidden") { |
|
|
|
this.enabledSongList.className = "res-list"; |
|
|
|
this.enabledSongList.className = "res-list"; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -527,6 +536,7 @@ Resources.prototype.toggleSongList = function() { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Resources.prototype.toggleImageList = function() { |
|
|
|
Resources.prototype.toggleImageList = function() { |
|
|
|
|
|
|
|
if(!this.hasUI) {return;} |
|
|
|
if(this.enabledImageList.className == "hidden") { |
|
|
|
if(this.enabledImageList.className == "hidden") { |
|
|
|
this.enabledImageList.className = "res-list"; |
|
|
|
this.enabledImageList.className = "res-list"; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -536,6 +546,7 @@ Resources.prototype.toggleImageList = function() { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Resources.prototype.updateTotals = function() { |
|
|
|
Resources.prototype.updateTotals = function() { |
|
|
|
|
|
|
|
if(!this.hasUI) {return;} |
|
|
|
this.packView.totalSongs.textContent = |
|
|
|
this.packView.totalSongs.textContent = |
|
|
|
this.enabledSongs.length + "/" + this.allSongs.length; |
|
|
|
this.enabledSongs.length + "/" + this.allSongs.length; |
|
|
|
this.packView.totalImages.textContent = |
|
|
|
this.packView.totalImages.textContent = |
|
|
@ -671,6 +682,7 @@ Resources.prototype.invert = function() { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Resources.prototype.appendListItem = function(name, value, id, root, oncheck, onclick, checked) { |
|
|
|
Resources.prototype.appendListItem = function(name, value, id, root, oncheck, onclick, checked) { |
|
|
|
|
|
|
|
if(!this.hasUI) {return;} |
|
|
|
if(checked === undefined) { |
|
|
|
if(checked === undefined) { |
|
|
|
checked = true; |
|
|
|
checked = true; |
|
|
|
} |
|
|
|
} |
|
|
|