Skip to content

Commit 0dae00d

Browse files
committed
Multi-wcfull + multi-boss support
1 parent 4010654 commit 0dae00d

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

Diff for: bundle.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ exports.parseWCBuffer = (buf, options) => {
2020
document.getElementById("itembox").style.display = "none";
2121
document.getElementById("anotherbox").style.display = "none";
2222
document.getElementById("outputbox").style.display = "none";
23+
document.getElementById("wcslot").style.display = "none";
2324
document.querySelector("footer").style.display = "none";
2425
var gen7exclusive = document.getElementsByClassName("extragen7");
2526
for (var i=0;i<gen7exclusive.length;i+=1){
@@ -36,10 +37,12 @@ exports.parseWCBuffer = (buf, options) => {
3637

3738
if (buf.length == 1446) { // BOSS
3839
return parseWCFullData(buf.slice(662), options);
40+
} else if (((buf.slice(662).length % 784 == 0)) & (buf.length > 1446)) { // multi-BOSS
41+
return parseMultiWCFullData(buf.slice(662), options);
3942
} else if (buf.length == 784) { // wcfull
4043
return parseWCFullData(buf, options);
4144
} else if ((buf.length % 784 == 0) & (buf.length > 784)) { // multi-wcfull
42-
return parseWCFullData(buf, options);
45+
return parseMultiWCFullData(buf, options);
4346
} else if (buf.length == 264) { // wc67
4447
return parseWC67Data(buf, options);
4548
} else if (buf.length == 204) { // wc5

Diff for: index.html

+4
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ <h1 class="title"><span id="wcTitle">Choose a wondercard file</span></h1>
7777
<div id="filecheckbox">
7878
<input type="checkbox" id="filetoggle">Display filename at the top?
7979
</div>
80+
<div id="wcslot">
81+
WC slot:
82+
<select id="wcslottoggle"></select>
83+
</div>
8084
<p>Choose another wondercard file:
8185
<input type="file" id="input" accept=".wc6,.wc7,.wc6full,.wc7full,.wc5,.pgf,.wc4,.pcd,.pgt" onchange="parseFile(this.files)" />
8286
</p>

Diff for: styles.css

+4
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ pre {
168168
bottom: 1px;
169169
}
170170

171+
#wcslottoggle {
172+
margin-top: 5px;
173+
}
174+
171175
footer {
172176
position: absolute;
173177
bottom: 20px;

Diff for: wc67.js

+29-1
Original file line numberDiff line numberDiff line change
@@ -706,4 +706,32 @@ function parseWCFullData (buf, options) {
706706

707707
return data;
708708

709-
}
709+
}
710+
711+
function parseMultiWCFullData (buf, options) {
712+
713+
const data = parseWCFullData(buf, options);
714+
715+
document.getElementById("wcslot").style.display = "block";
716+
717+
var wcCount = buf.length/784;
718+
719+
var options = "";
720+
var i = 0;
721+
for (i = 0; i < wcCount; i++) {
722+
options += '<option value="' + i + '">' + (i+1) + '</option>';
723+
}
724+
document.getElementById("wcslottoggle").innerHTML = options;
725+
726+
var wcNo = 0;
727+
var wcfullSwitch = 0;
728+
729+
document.getElementById('wcslottoggle').onchange = function thing2() {
730+
wcNo = document.getElementById('wcslottoggle').value;
731+
wcfullSwitch = wcNo*784;
732+
const data = parseWCFullData(buf.slice(wcfullSwitch), options);
733+
};
734+
735+
return data;
736+
737+
}

0 commit comments

Comments
 (0)