add downoad for GCM option

This commit is contained in:
Matteias Collet 2017-12-05 06:58:00 +01:00
parent 1ae559068c
commit 0ec8146a1d
6 changed files with 191 additions and 226 deletions

View file

@ -14,6 +14,9 @@
<h1 style="text-align: center; width: 100%;">Detailed Changelog</h1> <h1 style="text-align: center; width: 100%;">Detailed Changelog</h1>
<p style="margin: 0; width: 100%; text-align: center;">Main Page: <a href="https://bitpatty.github.io/gctGenerator/">https://bitpatty.github.io/gctGenerator/</a></p> <p style="margin: 0; width: 100%; text-align: center;">Main Page: <a href="https://bitpatty.github.io/gctGenerator/">https://bitpatty.github.io/gctGenerator/</a></p>
<br /> <br />
<h2 id="171129"><a href="#171129">Dec 05, 2017</a> </h2>
<h3 id="1711291"><a href="#1711291">Site Changes</a></h3>
<p>Added option to download codes formatted for the Gecko Cheat Manager.</p>
<h2 id="171129"><a href="#171129">Nov 29, 2017</a> </h2> <h2 id="171129"><a href="#171129">Nov 29, 2017</a> </h2>
<h3 id="1711291"><a href="#1711291">Updated 'Level Select' for PAL</a></h3> <h3 id="1711291"><a href="#1711291">Updated 'Level Select' for PAL</a></h3>
<p>Fixed Pinna not resetting inside the park.</p> <p>Fixed Pinna not resetting inside the park.</p>

View file

@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<updates> <updates>
<update>
<date>Dec 05, 2017</date>
<change>Added 'Download for Gecko Cheat Manager' option.</change>
</update>
<update> <update>
<date>Nov 29, 2017</date> <date>Nov 29, 2017</date>
<change>Made timers stop after the bowser fight and fixed Pinna not resetting inside the park on PAL</change> <change>Made timers stop after the bowser fight and fixed Pinna not resetting inside the park on PAL.</change>
</update> </update>
<update> <update>
<date>Nov 12, 2017</date> <date>Nov 12, 2017</date>

BIN
files/GCMCodes.zip Normal file

Binary file not shown.

View file

@ -7,22 +7,22 @@ if (navigator.userAgent.toLowerCase().indexOf("firefox") > -1) {
} }
document.getElementById("checkList").addEventListener("click", function(ev) { document.getElementById("checkList").addEventListener("click", function(ev) {
if (ev.target && ev.target.nodeName == "LI") { if (ev.target && ev.target.nodeName == "LI") {
ev.target.classList.toggle("checked"); ev.target.classList.toggle("checked");
} }
}); });
function parseXML(name) { function parseXML(name) {
var xml = new XMLHttpRequest(); var xml = new XMLHttpRequest();
var file = "codes/" + name + ".xml"; var file = "codes/" + name + ".xml";
xml.onload = function() { xml.onreadystatechange = function() {
if (this.status == 200 && this.responseXML != null) { if (this.status == 200 && this.readyState == 4) {
var xmlData = xml.responseXML; var xmlData = xml.responseXML;
xmlData = (new DOMParser()).parseFromString(xml.responseText, "text/xml"); xmlData = (new DOMParser()).parseFromString(xml.responseText, "text/xml");
xmlData = xmlData.getElementsByTagName("code"); xmlData = xmlData.getElementsByTagName("code");
var i = 0; var i = 0;
for(;i < xmlData.length; i++) { for (; i < xmlData.length; i++) {
var li = document.createElement("li"); var li = document.createElement("li");
var desc = xmlData[i].getElementsByTagName("title")[0].textContent; var desc = xmlData[i].getElementsByTagName("title")[0].textContent;
var t = document.createTextNode(desc); var t = document.createTextNode(desc);
@ -34,17 +34,17 @@ function parseXML(name) {
li.setAttribute("data-codeDate", xmlData[i].getElementsByTagName("date")[0].textContent); li.setAttribute("data-codeDate", xmlData[i].getElementsByTagName("date")[0].textContent);
li.setAttribute("data-codeSrc", xmlData[i].getElementsByTagName("source")[0].textContent.replace(/[\s\n\r\t]+/gm, "")); li.setAttribute("data-codeSrc", xmlData[i].getElementsByTagName("source")[0].textContent.replace(/[\s\n\r\t]+/gm, ""));
li.setAttribute("onmouseover", "updateDescription(this)"); li.setAttribute("onmouseover", "updateDescription(this)");
li.style.animationDuration = 0.4 + i*0.05 + "s";
document.getElementById("checkList").appendChild(li); document.getElementById("checkList").appendChild(li);
} }
button = document.getElementById("downloadButton"); button = document.getElementById("downloadButton");
button.style.transitionDuration = 0.6 + i*0.05 + "s"; button.style.visibility = "visible";
button.style.opacity = "1";
button.disabled = false; button.disabled = false;
button = document.getElementById("dolphinDownloadButton"); button = document.getElementById("dolphinDownloadButton");
button.style.transitionDuration = 0.6 + i*0.05 + "s"; button.style.visibility = "visible";
button.style.opacity = "1"; button.disabled = false;
button = document.getElementById("gcmDownloadButton");
button.style.visibility = "visible";
button.disabled = false; button.disabled = false;
document.getElementById("gameID").disabled = false; document.getElementById("gameID").disabled = false;
} }
@ -104,7 +104,7 @@ function generateGCT() {
} }
} }
function downloadINI(data, filename) { function downloadTXT(data, filename) {
var file = new Blob([data], { var file = new Blob([data], {
type: "application/octet-stream" type: "application/octet-stream"
}); });
@ -123,26 +123,28 @@ function downloadINI(data, filename) {
} }
} }
function generateINI() { function generateTXT(s) {
if (document.getElementById("gameID").value === "Choose Version") { if (document.getElementById("gameID").value === "Choose Version") {
alert("Select the game version!"); alert("Select the game version!");
return; return;
} }
var data = "Paste the following on top of your games .ini file:\r\n[Gecko]\r\n"; if (s.id === "dolphinDownloadButton") var data = "Paste the following on top of your games .ini file:\r\n[Gecko]";
else var data = document.getElementById("gameID").value + "\r\nSuper Mario Sunshine";
var codeList = document.getElementById("checkList").getElementsByTagName("li"); var codeList = document.getElementById("checkList").getElementsByTagName("li");
var valueSelected = false; var valueSelected = false;
for (var i = 0; i < codeList.length; i++) { for (var i = 0; i < codeList.length; i++) {
if (codeList[i].className === "checked") { if (codeList[i].className === "checked") {
data += "$" + codeList[i].getAttribute("data-codeName") + " (" + codeList[i].getAttribute("data-codeDate") + ") [" + codeList[i].getAttribute("data-codeAuthor") + "]\r\n";
data += (codeList[i].getAttribute("data-codeSrc").match(/.{8}/g).join(" ")).replace(/(.{17})./g,"$1\r\n");
data += "\r\n"; data += "\r\n";
if (s.id === "gcmDownloadButton") data += "\r\n";
else data += "$";
data += codeList[i].getAttribute("data-codeName") + " (" + codeList[i].getAttribute("data-codeDate") + ") [" + codeList[i].getAttribute("data-codeAuthor") + "]\r\n";
data += (codeList[i].getAttribute("data-codeSrc").match(/.{8}/g).join(" ")).replace(/(.{17})./g, "$1\r\n");
valueSelected = true; valueSelected = true;
} }
} }
if (valueSelected) { if (valueSelected) {
downloadINI(data, document.getElementById("gameID").value + ".txt"); downloadTXT(data, document.getElementById("gameID").value + ".txt");
} else { } else {
alert("No cheat(s) selected!"); alert("No cheat(s) selected!");
} }
@ -152,27 +154,35 @@ function updateCodelist() {
resetDescription(); resetDescription();
document.getElementById("gameID").disabled = true; document.getElementById("gameID").disabled = true;
button = document.getElementById("downloadButton"); button = document.getElementById("downloadButton");
button.style.visibility = "visible"; button.style.visibility = "hidden";
button.style.transitionDuration = "0s";
button.style.opacity = "0";
button.disabled = true; button.disabled = true;
button = document.getElementById("dolphinDownloadButton"); button = document.getElementById("dolphinDownloadButton");
button.style.visibility = "visible"; button.style.visibility = "hidden";
button.style.transitionDuration = "0s"; button.disabled = true;
button.style.opacity = "0"; button = document.getElementById("gcmDownloadButton");
button.style.visibility = "hidden";
button.disabled = true; button.disabled = true;
document.getElementById("checkList").innerHTML = ""; document.getElementById("checkList").innerHTML = "";
var gameVersion = document.getElementById("gameID").value; var gameVersion = document.getElementById("gameID").value;
parseXML(gameVersion); parseXML(gameVersion);
} }
function updateDescription($this) { function updateDescription(s) {
document.getElementById("descriptionBox").innerHTML = "<p><h2>" + document.getElementById("descriptionBox").innerHTML = "<p><h2>" +
$this.getAttribute("data-codeName") + "</h2></p><p><i>Author(s): " + s.getAttribute("data-codeName") + "</h2></p><p><i>Author(s): " +
$this.getAttribute("data-codeAuthor") + "<br />Version: " + s.getAttribute("data-codeAuthor") + "<br />Version: " +
$this.getAttribute("data-codeVersion") + " (" + s.getAttribute("data-codeVersion") + " (" +
$this.getAttribute("data-codeDate") + ")</i></p>" + "<p>Description:<br />" + s.getAttribute("data-codeDate") + ")</i></p>" + "<p>Description:<br />" +
$this.getAttribute("data-codeDesc") + "</p>"; s.getAttribute("data-codeDesc") + "</p>";
}
function setButtonDescription(s) {
if (s.id === "downloadButton")
document.getElementById("descriptionBox").innerHTML = "<p><h2>Download GCT</h2></p><p>Download the cheats in the GCT format for use with Nintendont.</p>";
else if (s.id === "dolphinDownloadButton")
document.getElementById("descriptionBox").innerHTML = "<p><h2>Download for Dolphin</h2></p><p>Download a textfile containing the formatted codes for use with Dolphin. Copy the contents of the file on top of your games .ini file.</p>";
else
document.getElementById("descriptionBox").innerHTML = "<p><h2>Download for Gecko Cheat Manager</h2></p><p>Download the cheats in a textfile formatted for use with the <a href=\"http://wiibrew.org/wiki/CheatManager\">Gecko Cheat Manager</a>. Place the txt file in SD:/txtcodes/.</p><p>A zip archive containing pregenerated txt files with all available codes on this site can be downloaded <a href=\"files/GCMCodes.zip\">here</a>.";
} }
function resetDescription() { function resetDescription() {
@ -197,4 +207,4 @@ function updateChangelog() {
} }
xml.open("GET", file); xml.open("GET", file);
xml.send(); xml.send();
} }

View file

@ -19,8 +19,9 @@
</select> </select>
<ul id="checkList"> <ul id="checkList">
</ul> </ul>
<button id="downloadButton" onclick="generateGCT()" style="visibility:hidden;">Download GCT</button> <button id="downloadButton" onclick="generateGCT()" onmouseover="setButtonDescription(this)" style="visibility:hidden;">Download .GCT</button>
<button id="dolphinDownloadButton" onclick="generateINI()" style="visibility:hidden; background-color:#5c90aa; margin-bottom: 20px;">Download for Dolphin</button> <button id="dolphinDownloadButton" onclick="generateTXT(this)" onmouseover="setButtonDescription(this)" style="visibility:hidden;">Dolphin INI</button>
<button id="gcmDownloadButton" onclick="generateTXT(this)" onmouseover="setButtonDescription(this)" style="visibility:hidden;">GCM TXT</button>
</center> </center>
</div> </div>
<div style="margin-left: 420px;"> <div style="margin-left: 420px;">
@ -35,7 +36,7 @@
<p> <p>
<h2>Mario Sunshine Cheatfile Generator</h2> <h2>Mario Sunshine Cheatfile Generator</h2>
</p> </p>
<p><i>Authors: <a href="https://twitter.com/psychonauter">Psy</a> & <a href="https://twitter.com/srlmilk">Milk</a><br />Last Updated: Nov 29, 2017</i></p> <p><i>Authors: <a href="https://twitter.com/psychonauter">Psy</a> & <a href="https://twitter.com/srlmilk">Milk</a><br />Last Updated: Dec 05, 2017</i></p>
<p>Description:<br />This is a cheatfile generator for SMS Speedrun practice. A guide on how to use the generator and practice codes on your Wii can be found here: <a target="_blank" href="guide.html">Guide</a></p> <p>Description:<br />This is a cheatfile generator for SMS Speedrun practice. A guide on how to use the generator and practice codes on your Wii can be found here: <a target="_blank" href="guide.html">Guide</a></p>
<h4>Changelog:</h4> <h4>Changelog:</h4>
<p id="changelog"></p> <p id="changelog"></p>

View file

@ -1,233 +1,180 @@
body { body {
margin: 50px 50px 50px 50px; margin:50px;
width: 980px; width:980px;
min-height: 450px; min-height:450px;
display: inline-block; display:inline-block;
text-align:left; text-align:left
} }
html { html {
/*background-color: #262626;*/ background-color:#0D0D0D;
background-color: #0D0D0D; color:#f1f1f1;
color: #f1f1f1; font-family:Calibri;
font-family: Calibri; text-align:center
text-align: center;
} }
#gameID { #gameID {
margin: 10px 0 5px 0; margin:10px 0 5px
} }
body button { body button {
width: 390px; padding:10px;
padding: 10px 10px 10px 10px; margin:auto;
display: block; font-size:18px;
margin: auto; color:#f1f1f1;
font-size: 18px; background-color:#f44336;
color: #f1f1f1; border-style:none;
background-color: #f44336; border-radius:4px;
border-style: none; cursor:pointer;
border-radius: 4px; margin-top:5px;
cursor: pointer; outline:none
margin-top: 5px; }
outline: none; #downloadButton {
-webkit-transition: all 0s ease-out 0s; width:390px;
-moz-transition: all 0s ease-out 0s; display:block
-ms-transition: all 0s ease-out 0s; }
-o-transition: all 0s ease-out 0s; #downloadButton:hover {
transition: all 0s ease-out 0s; background-color:#ea7d75
}
#dolphinDownloadButton {
width:193px;
display:inline-block;
background-color:#5c90aa
}
#dolphinDownloadButton:hover {
background-color:#9cb6c3
}
#gcmDownloadButton {
width:193px;
display:inline-block;
background-color:#629045
}
#gcmDownloadButton:hover {
background-color:#8eb575
} }
img { img {
border-radius: 4px; border-radius:4px
} }
ul { ul {
margin: 0; margin:0;
padding: 0; padding:0;
width: 390px; width:390px;
list-style-type: none; list-style-type:none
} }
ul li { ul li {
cursor: pointer; cursor:pointer;
position: relative; position:relative;
padding: 8px 8px 8px 40px; padding:8px 8px 8px 40px;
border-radius: 4px; border-radius:4px;
border-style: solid; border-style:solid;
border-width: 1px; border-width:1px;
background: #ffefef; background:#ffefef;
color: #262626; color:#262626;
font-size: 18px; font-size:18px;
text-align: left; text-align:left;
transition: 0.2s; transition:.2s;
-webkit-user-select: none; -webkit-user-select:none;
-moz-user-select: none; -moz-user-select:none;
-ms-user-select: none; -ms-user-select:none;
user-select: none; user-select:none;
outline: none; outline:none
-webkit-animation: fadein .8s;
-moz-animation: fadein .8s;
-ms-animation: fadein .8s;
-o-animation: fadein .8s;
animation: fadein .8s;
} }
ul li::before { ul li::before {
content: ''; content:'';
position: absolute; position:absolute;
border-color: #a6a6a6; border-color:#a6a6a6;
border-style: solid; border-style:solid;
border-width: 1.5px 1.5px 1.5px 1.5px; border-width:1.5px;
border-radius: 50%; border-radius:50%;
top: 11px; top:11px;
left: 12px; left:12px;
height: 14px; height:14px;
width: 14px; width:14px
} }
ul li:nth-child(odd) { ul li:nth-child(odd) {
background: #fdfdfd; background:#fdfdfd
} }
ul li:hover { ul li:hover {
background: #d84035; background:#d84035;
color: #ffffff; color:#fff;
border-color: #000000; border-color:#000
} }
ul li:hover::before { ul li:hover::before {
border-color: #fff; border-color:#fff;
background-color: pink; background-color:#ffc0cb
} }
ul li.checked:hover { ul li.checked:hover {
background: #d84035; background:#d84035;
color: #ffffff; color:#fff
} }
ul li.checked { ul li.checked {
background: #434343; background:#434343;
color: #fff; color:#fff;
border-color: #262626; border-color:#262626
} }
ul li.checked::before { ul li.checked::before {
content: ''; content:'';
position: absolute; position:absolute;
border-color: #fff; border-color:#fff;
border-style: solid; border-style:solid;
border-width: 1.5px 1.5px 1.5px 1.5px; border-width:1.5px;
border-radius: 50%; border-radius:50%;
top: 11px; top:11px;
left: 12px; left:12px;
height: 14px; height:14px;
width: 14px; width:14px;
background-color: #d85e55; background-color:#d85e55
} }
th { th {
font-weight: normal; font-weight:400
} }
.selectionHeader { .selectionHeader {
background-color: #f44336; background-color:#f44336;
padding: 10px 10px 10px 10px; padding:10px;
color: white; color:#fff;
width: 390px; width:390px;
font-size: 16px; font-size:16px;
border-style: none; border-style:none;
border-radius: 4px; border-radius:4px;
-webkit-user-select: none; -webkit-user-select:none;
-moz-user-select: none; -moz-user-select:none;
-ms-user-select: none; -ms-user-select:none;
user-select: none; user-select:none;
outline: none; outline:none
} }
.framed { .framed {
position: relative; position:relative;
margin: 11px 0px 10px 0; margin:11px 0 10px;
padding: 0px 12px 12px 12px; padding:0 12px 12px;
/*background-color: #111;*/ background:#232323;
background: #232323; font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size:14px;
font-size: 14px; line-height:18px;
line-height: 18px; border-color:#fff;
border-color: #fff; border-style:solid;
border-style: solid; border-width:1px;
border-width: 1px; border-radius:4px;
border-radius: 4px; width:500px;
width: 500px; min-height:150px;
min-height: 150px; overflow-y:auto;
overflow-y: auto; overflow-x:hidden;
overflow-x: hidden; -ms-overflow-style:none
-ms-overflow-style: none;
} }
.framed::-webkit-scrollbar { .framed::-webkit-scrollbar {
display:none; display:none
} }
#warningMessage { #warningMessage {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 14px; font-size:14px;
border-color: #fff; border-color:#fff;
border-style: solid; border-style:solid;
border-width: 1px; border-width:1px;
border-radius: 4px; border-radius:4px;
/*background-color: #111;*/ background:#232323;
background: #232323; width:526px;
width: 526px; padding:5px 12px;
padding: 5px 12px 5px 12px; margin:11px 0 0
margin: 11px 0px 0px 0px;
}
#guide_content {
clear: both;
background-color: #111;
width: 100%;
max-width: 960px;
overflow: hidden;
border: 1px solid #333;
margin: 30px 0 10px 0;
padding: 0px 12px 12px 12px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 22px;
} }
.hidden { .hidden {
opacity: 0; opacity:0
} }
a { a {
color: #ff8297; color:#ff8297
}
@keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* Firefox < 16 */
@-moz-keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* Internet Explorer */
@-ms-keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* Opera < 12.1 */
@-o-keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
} }