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>
<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 />
<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>
<h3 id="1711291"><a href="#1711291">Updated 'Level Select' for PAL</a></h3>
<p>Fixed Pinna not resetting inside the park.</p>

View file

@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<updates>
<update>
<date>Dec 05, 2017</date>
<change>Added 'Download for Gecko Cheat Manager' option.</change>
</update>
<update>
<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>
<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) {
if (ev.target && ev.target.nodeName == "LI") {
ev.target.classList.toggle("checked");
}
if (ev.target && ev.target.nodeName == "LI") {
ev.target.classList.toggle("checked");
}
});
function parseXML(name) {
var xml = new XMLHttpRequest();
var file = "codes/" + name + ".xml";
xml.onload = function() {
if (this.status == 200 && this.responseXML != null) {
xml.onreadystatechange = function() {
if (this.status == 200 && this.readyState == 4) {
var xmlData = xml.responseXML;
xmlData = (new DOMParser()).parseFromString(xml.responseText, "text/xml");
xmlData = xmlData.getElementsByTagName("code");
var i = 0;
for(;i < xmlData.length; i++) {
for (; i < xmlData.length; i++) {
var li = document.createElement("li");
var desc = xmlData[i].getElementsByTagName("title")[0].textContent;
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-codeSrc", xmlData[i].getElementsByTagName("source")[0].textContent.replace(/[\s\n\r\t]+/gm, ""));
li.setAttribute("onmouseover", "updateDescription(this)");
li.style.animationDuration = 0.4 + i*0.05 + "s";
document.getElementById("checkList").appendChild(li);
}
button = document.getElementById("downloadButton");
button.style.transitionDuration = 0.6 + i*0.05 + "s";
button.style.opacity = "1";
button.style.visibility = "visible";
button.disabled = false;
button = document.getElementById("dolphinDownloadButton");
button.style.transitionDuration = 0.6 + i*0.05 + "s";
button.style.opacity = "1";
button.style.visibility = "visible";
button.disabled = false;
button = document.getElementById("gcmDownloadButton");
button.style.visibility = "visible";
button.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], {
type: "application/octet-stream"
});
@ -123,26 +123,28 @@ function downloadINI(data, filename) {
}
}
function generateINI() {
function generateTXT(s) {
if (document.getElementById("gameID").value === "Choose Version") {
alert("Select the game version!");
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 valueSelected = false;
for (var i = 0; i < codeList.length; i++) {
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";
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;
}
}
if (valueSelected) {
downloadINI(data, document.getElementById("gameID").value + ".txt");
downloadTXT(data, document.getElementById("gameID").value + ".txt");
} else {
alert("No cheat(s) selected!");
}
@ -152,27 +154,35 @@ function updateCodelist() {
resetDescription();
document.getElementById("gameID").disabled = true;
button = document.getElementById("downloadButton");
button.style.visibility = "visible";
button.style.transitionDuration = "0s";
button.style.opacity = "0";
button.style.visibility = "hidden";
button.disabled = true;
button = document.getElementById("dolphinDownloadButton");
button.style.visibility = "visible";
button.style.transitionDuration = "0s";
button.style.opacity = "0";
button.style.visibility = "hidden";
button.disabled = true;
button = document.getElementById("gcmDownloadButton");
button.style.visibility = "hidden";
button.disabled = true;
document.getElementById("checkList").innerHTML = "";
var gameVersion = document.getElementById("gameID").value;
parseXML(gameVersion);
}
function updateDescription($this) {
function updateDescription(s) {
document.getElementById("descriptionBox").innerHTML = "<p><h2>" +
$this.getAttribute("data-codeName") + "</h2></p><p><i>Author(s): " +
$this.getAttribute("data-codeAuthor") + "<br />Version: " +
$this.getAttribute("data-codeVersion") + " (" +
$this.getAttribute("data-codeDate") + ")</i></p>" + "<p>Description:<br />" +
$this.getAttribute("data-codeDesc") + "</p>";
s.getAttribute("data-codeName") + "</h2></p><p><i>Author(s): " +
s.getAttribute("data-codeAuthor") + "<br />Version: " +
s.getAttribute("data-codeVersion") + " (" +
s.getAttribute("data-codeDate") + ")</i></p>" + "<p>Description:<br />" +
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() {
@ -197,4 +207,4 @@ function updateChangelog() {
}
xml.open("GET", file);
xml.send();
}
}

View file

@ -19,8 +19,9 @@
</select>
<ul id="checkList">
</ul>
<button id="downloadButton" onclick="generateGCT()" 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="downloadButton" onclick="generateGCT()" onmouseover="setButtonDescription(this)" style="visibility:hidden;">Download .GCT</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>
</div>
<div style="margin-left: 420px;">
@ -35,7 +36,7 @@
<p>
<h2>Mario Sunshine Cheatfile Generator</h2>
</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>
<h4>Changelog:</h4>
<p id="changelog"></p>

View file

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