249 lines
12 KiB
HTML
249 lines
12 KiB
HTML
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Kitsune Configurator</title>
|
|
</head>
|
|
|
|
<body>
|
|
<center>
|
|
<h1>Kitsune Configurator</h1>
|
|
<hr>
|
|
<b>VERSION:</b><br>
|
|
<select id="version">
|
|
</select><br>
|
|
<button onclick="downloadNewVersion()">Download a new version</button>
|
|
<div id="downloadInfo">
|
|
</div>
|
|
<hr>
|
|
<b>LANGUAGE:</b><br>
|
|
<select id="language">
|
|
<option value="af">Afrikaans</option>
|
|
<option value="am">Amharic</option>
|
|
<option value="ar">Arabic</option>
|
|
<option value="az">Azerbaijani</option>
|
|
<option value="be">Belarusian</option>
|
|
<option value="bg">Bulgarian</option>
|
|
<option value="bn">Bengali</option>
|
|
<option value="bs">Bosnian</option>
|
|
<option value="ca">Catalan; Valencian</option>
|
|
<option value="cs">Czech</option>
|
|
<option value="da">Danish</option>
|
|
<option value="de">German</option>
|
|
<option value="el">Greek, Modern</option>
|
|
<option value="en-GB">English (UK)</option>
|
|
<option value="en" selected>English (US)</option>
|
|
<option value="es">Spanish; Castilian</option>
|
|
<option value="et">Estonian</option>
|
|
<option value="eu">Basque</option>
|
|
<option value="fa">Persian</option>
|
|
<option value="fi">Finnish</option>
|
|
<option value="fr">French</option>
|
|
<option value="gl">Galician</option>
|
|
<option value="gu">Gujarati</option>
|
|
<option value="hi">Hindi</option>
|
|
<option value="hr">Croatian</option>
|
|
<option value="hu">Hungarian</option>
|
|
<option value="hy">Armenian</option>
|
|
<option value="id">Indonesian</option>
|
|
<option value="is">Icelandic</option>
|
|
<option value="it">Italian</option>
|
|
<option value="iw">Hebrew</option>
|
|
<option value="ja">Japanese</option>
|
|
<option value="ka">Georgian</option>
|
|
<option value="kk">Kazakh</option>
|
|
<option value="km">Khmer</option>
|
|
<option value="kn">Kannada</option>
|
|
<option value="ko">Korean</option>
|
|
<option value="ky">Kirghiz, Kyrgyz</option>
|
|
<option value="lo">Lao</option>
|
|
<option value="lt">Lithuanian</option>
|
|
<option value="lv">Latvian</option>
|
|
<option value="mk">Macedonian</option>
|
|
<option value="ml">Malayalam</option>
|
|
<option value="mn">Mongolian</option>
|
|
<option value="mr">Marathi (Marāṭhī)</option>
|
|
<option value="ms">Malay</option>
|
|
<option value="my">Burmese</option>
|
|
<option value="ne">Nepali</option>
|
|
<option value="nl">Dutch</option>
|
|
<option value="no">Norwegian</option>
|
|
<option value="pa">Panjabi, Punjabi</option>
|
|
<option value="pl">Polish</option>
|
|
<option value="pt-BR">Portuguese (Brazil)</option>
|
|
<option value="pt-PT">Portuguese (Europe)</option>
|
|
<option value="ro">Romanian, Moldavan</option>
|
|
<option value="ru">Russian</option>
|
|
<option value="si">Sinhala, Sinhalese</option>
|
|
<option value="sk">Slovak</option>
|
|
<option value="sl">Slovene</option>
|
|
<option value="sq">Albanian</option>
|
|
<option value="sr">Serbian</option>
|
|
<option value="sv">Swedish</option>
|
|
<option value="sw">Swahili</option>
|
|
<option value="ta">Tamil</option>
|
|
<option value="te">Telugu</option>
|
|
<option value="th">Thai</option>
|
|
<option value="tr">Turkish</option>
|
|
<option value="uk">Ukrainian</option>
|
|
<option value="ur">Urdu</option>
|
|
<option value="uz">Uzbek</option>
|
|
<option value="vi">Vietnamese</option>
|
|
<option value="zh-CN">Chinese (Simplified)</option>
|
|
<option value="zh-HK">Chinese (Traditional, Hong Kong)</option>
|
|
<option value="zh-TW">Chinese (Traditional)</option>
|
|
<option value="zu">Zulu</option>
|
|
</select>
|
|
<br>
|
|
<hr>
|
|
<b>SAVEDATA:</b><br>
|
|
<button onclick="exportSave()">Export Savefile</button>
|
|
<button onclick="importSave()">Import Savefile</button>
|
|
<hr>
|
|
<br>
|
|
<button onclick="save()" id="startButton">Start Game</button>
|
|
<br>
|
|
<h2>Press F10 to return to this config menu</h2>
|
|
</center>
|
|
|
|
<script>
|
|
const allGameFiles = ["kitsune20.html", "messages.kn.nocache.json" ,"rugby-sprite.png" ,"overworld.ogg" ,"messages.iw.nocache.json" ,"cta.png" ,"cta_play.png" ,"rock.mp3" ,"messages.it.nocache.json" ,"CTA-Archery-174787996-174787824.png" ,"messages.th.nocache.json" ,"CTA-Opening-144867217-174787752-174787825-192413481.png" ,"messages.da.nocache.json" ,"messages.tr.nocache.json" ,"messages.ca.nocache.json" ,"pingpongintro.mp4" ,"messages.fi.nocache.json" ,"messages.ar.nocache.json" ,"messages.pl.nocache.json" ,"climbingoutro.mp4" ,"swim-sprite.png" ,"messages.pt-BR.nocache.json" ,"messages.sq.nocache.json" ,"messages.mn.nocache.json" ,"messages.sv.nocache.json" ,"skate.ogg" ,"messages.gl.nocache.json" ,"ballad.ogg" ,"ballad.mp3" ,"messages.ne.nocache.json" ,"swimoutro.mp4" ,"messages.ms.nocache.json" ,"messages.af.nocache.json" ,"climbing-sprite.png" ,"preload-sprite.png" ,"messages.ja.nocache.json" ,"messages.ml.nocache.json" ,"kitsune20.js" ,"messages.lo.nocache.json" ,"shared.ogg" , "swimintro.mp4" ,"messages.zh-CN.nocache.json" ,"messages.mr.nocache.json" ,"messages.en.nocache.json" ,"messages.no.nocache.json" ,"messages.km.nocache.json" ,"messages.de.nocache.json" ,"pingpongoutro.mp4" ,"messages.es-419.nocache.json" ,"CTA-Closing-174787829-192414335.png" ,"messages.am.nocache.json" ,"CTA-CenteredPlayButtonFrame2.png" ,"climbing.ogg" ,"CTA-Marathon-174788017-174787794.png" ,"ddr.ogg" ,"disco.mp3" ,"archeryoutro.mp4" ,"messages.hy.nocache.json" ,"messages.eu.nocache.json" ,"pingpong.ogg" ,"archeryintro.mp4" ,"cutscene-sprite.png" ,"video-sprite.png" ,"messages.is.nocache.json" ,"archery.mp3" ,"messages.be.nocache.json" ,"messages.bs.nocache.json" ,"disco.ogg" ,"ddr.mp3" ,"skateoutro.mp4" ,"pingpong.mp3" ,"messages.el.nocache.json" ,"marathon-sprite.png" ,"messages.zu.nocache.json" ,"rugbyoutro.mp4" ,"outro.mp4" ,"messages.pa.nocache.json" ,"climbing.mp3" ,"messages.hr.nocache.json" ,"messages.bn.nocache.json" ,"messages.sw.nocache.json" ,"archery.ogg" ,"overworld-sprite.png" ,"messages.ur.nocache.json" ,"messages.mk.nocache.json" ,"marathonintro.mp4" ,"messages.sk.nocache.json" ,"rock.ogg" ,"marathonoutro.mp4" ,"messages.et.nocache.json" ,"messages.pt-PT.nocache.json" ,"messages.zh-TW.nocache.json" ,"messages.uk.nocache.json" ,"messages.fa.nocache.json" ,"messages.si.nocache.json" ,"messages.es.nocache.json" ,"pingpong-sprite.png" ,"messages.ky.nocache.json" ,"CTA-OffsetPlayButtonFrame1.png" ,"messages.cs.nocache.json" ,"CTA-OffsetPlayButtonFrame2.png" ,"shared.mp3" ,"marathon.mp3" ,"intro.mp4" ,"messages.uz.nocache.json" ,"messages.hi.nocache.json" ,"messages.nl.nocache.json" ,"CTA-Skateboarding-174787927.png" ,"marathon.ogg" ,"overworld.mp3" ,"archery-sprite.png" ,"messages.lt.nocache.json" ,"messages.kk.nocache.json" ,"kitsune_compiled_deferred_module.js" ,"skate.mp3" ,"messages.en-GB.nocache.json" ,"messages.bg.nocache.json" ,"CTA-Swimming-174787828-174787766.png" ,"messages.my.nocache.json" ,"messages.hu.nocache.json" ,"messages.ru.nocache.json" ,"skate-sprite.png" ,"CTA-CenteredPlayButtonFrame1.png" ,"messages.te.nocache.json" ,"messages.zh-HK.nocache.json" ,"messages.lv.nocache.json" ,"rugbyintro.mp4" ,"messages.ko.nocache.json" ,"rugby.mp3" ,"CTA_Climbing-174787997.png" ,"messages.ro.nocache.json" ,"shared-sprite.png" ,"messages.ta.nocache.json" ,"messages.vi.nocache.json" ,"messages.sl.nocache.json" ,"messages.ka.nocache.json" ,"messages.fr.nocache.json" ,"climbingintro.mp4" ,"CTA-Rugby-174787947-174787773.png" ,"skateintro.mp4" ,"messages.gu.nocache.json" ,"messages.id.nocache.json" ,"rugby.ogg" ,"CTA-TableTennis-174787827-174787820.png" ,"messages.az.nocache.json" ,"messages.sr.nocache.json"];
|
|
const fs = require('fs');
|
|
const http = require('https');
|
|
var totalDownloaded = 0;
|
|
|
|
exportSave = function(){
|
|
var element = document.createElement('a');
|
|
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(btoa(JSON.stringify(localStorage))));
|
|
element.setAttribute('download', "kitsune.ksav");
|
|
element.style.display = 'none';
|
|
document.body.appendChild(element);
|
|
element.click();
|
|
document.body.removeChild(element);
|
|
}
|
|
importSave = function(){
|
|
|
|
var element = document.createElement('input');
|
|
element.setAttribute('type', "file");
|
|
element.setAttribute('accept', ".ksav");
|
|
element.setAttribute('id', "saveImportFile");
|
|
element.style.display = 'none';
|
|
document.body.appendChild(element);
|
|
element.addEventListener('change', function() {
|
|
var fr=new FileReader();
|
|
fr.onload=function(){
|
|
try {
|
|
storage = JSON.parse(atob(fr.result))
|
|
localStorage.clear();
|
|
Object.keys(storage).forEach(function (k) {
|
|
localStorage.setItem(k, storage[k]);
|
|
});
|
|
alert("Savedata was imported successfully!");
|
|
} catch (e) {
|
|
alert("Savedata was invalid!");
|
|
}
|
|
}
|
|
fr.readAsText(this.files[0]);
|
|
})
|
|
element.click();
|
|
document.body.removeChild(element);
|
|
}
|
|
|
|
redirect = function(){
|
|
location = "/silica/run.html";
|
|
}
|
|
|
|
populate = function(){
|
|
files = fs.readdirSync("logos/2020/kitsune");
|
|
files.forEach(file => {
|
|
opt = document.createElement("option");
|
|
opt.value = file;
|
|
opt.innerText = file;
|
|
if(file == localStorage["CONFIG_VERSION"])
|
|
opt.selected = true;
|
|
|
|
document.getElementById("version").add(opt);
|
|
|
|
});
|
|
}
|
|
|
|
save = function(){
|
|
localStorage["CONFIG_LANGUAGE"] = document.getElementById("language").value;
|
|
localStorage["CONFIG_VERSION"] = document.getElementById("version").value;
|
|
redirect();
|
|
}
|
|
|
|
downloadFile = function(url, dest, cb){
|
|
|
|
const file = fs.createWriteStream(dest);
|
|
|
|
const request = http.get(url, (response) => {
|
|
if (response.statusCode !== 200) {
|
|
fs.unlink(dest, function() { cb(url+' status was ' + response.statusCode) });
|
|
}
|
|
|
|
|
|
response.pipe(file);
|
|
});
|
|
|
|
file.on('finish', function() { file.close(cb) });
|
|
|
|
request.on('error', (err) => {
|
|
fs.unlink(dest, function() { downloadFile(url, dest, cb) });
|
|
});
|
|
|
|
file.on('error', (err) => {
|
|
fs.unlink(dest, function() { downloadFile(url, dest, cb) });
|
|
});
|
|
};
|
|
|
|
downloadNewVersion = function(){
|
|
var downloadVersion = prompt("What version to DL? (known versions are: rc1-rc7, dev1-dev9", "rc7");
|
|
|
|
|
|
var outputDirectory = "logos/2020/kitsune/"+downloadVersion+"/";
|
|
var fromSite = "https://www.google.com/logos/2020/kitsune/"+downloadVersion+"/";
|
|
|
|
const request = http.get(fromSite+allGameFiles[0], (response) => {
|
|
if (response.statusCode !== 200) {
|
|
alert("Version does not exist on google's servers: got status "+response.statusCode);
|
|
return;
|
|
}
|
|
else{
|
|
document.getElementById("startButton").disabled = true;
|
|
|
|
if (!fs.existsSync(outputDirectory)){
|
|
fs.mkdirSync(outputDirectory);
|
|
}
|
|
|
|
totalDownloaded = 0;
|
|
allGameFiles.forEach(fileToDownload => {
|
|
|
|
downloadFile(fromSite+fileToDownload, outputDirectory+fileToDownload, function(cb){
|
|
totalDownloaded++;
|
|
document.getElementById("downloadInfo").innerText = "Downloading: "+totalDownloaded+"/"+allGameFiles.length + " ("+Math.round((totalDownloaded/allGameFiles.length)*100)+"%)";
|
|
|
|
if(totalDownloaded == allGameFiles.length){
|
|
location.reload();
|
|
}
|
|
})
|
|
});
|
|
}
|
|
});
|
|
|
|
request.on('error', (err) => {
|
|
alert("Failed to connect: "+err.message);
|
|
});
|
|
|
|
}
|
|
|
|
loadSettings = function(){
|
|
if(localStorage["CONFIG_LANGUAGE"] != undefined)
|
|
document.getElementById("language").value = localStorage["CONFIG_LANGUAGE"];
|
|
}
|
|
|
|
populate();
|
|
loadSettings();
|
|
|
|
</script>
|
|
</body>
|
|
</html> |