citra-emu
/
citra-web
Archived
1
0
Fork 0

Merge remote-tracking branch 'refs/remotes/citra-emu/master'

This commit is contained in:
saphiresurf 2017-06-04 14:33:09 -07:00
commit 71b0599c32
4 changed files with 246 additions and 18 deletions

View File

@ -16,6 +16,8 @@ const inputDirectoryWiki = './citra-games-wiki.wiki';
const outputDirectoryMd = '../../site/content/game'; const outputDirectoryMd = '../../site/content/game';
const outputDirectoryBoxart = '../../site/static/images/game/boxart'; const outputDirectoryBoxart = '../../site/static/images/game/boxart';
const outputDirectoryIcons = '../../site/static/images/game/icons'; const outputDirectoryIcons = '../../site/static/images/game/icons';
const outputDirectoryScreenshots = '../../site/static/images/screenshots0';
const outputDirectorySavefiles = '../../site/static/savefiles/';
// The URL // The URL
function url(title) { function url(title) {
@ -25,9 +27,11 @@ function url(title) {
function gitPull(directory, repository) { function gitPull(directory, repository) {
if (fs.existsSync(directory)) { if (fs.existsSync(directory)) {
logger.info(`Fetching latest from Github : ${directory}`); logger.info(`Fetching latest from Github : ${directory}`);
logger.info(`git --git-dir=${directory} pull`);
exec(`git --git-dir=${directory} pull`); exec(`git --git-dir=${directory} pull`);
} else { } else {
logger.info(`Cloning repository from Github : ${directory}`); logger.info(`Cloning repository from Github : ${directory}`);
logger.info(`git clone ${repository}`);
exec(`git clone ${repository}`); exec(`git clone ${repository}`);
} }
} }
@ -59,6 +63,16 @@ if (fs.existsSync(outputDirectoryIcons) == false) {
fs.mkdirSync(outputDirectoryIcons); fs.mkdirSync(outputDirectoryIcons);
} }
if (fs.existsSync(outputDirectorySavefiles) == false) {
logger.info(`Creating missing output directory: ${outputDirectorySavefiles}`);
fs.mkdirSync(outputDirectorySavefiles);
}
if (fs.existsSync(outputDirectoryScreenshots) == false) {
logger.info(`Creating missing output directory: ${outputDirectoryScreenshots}`);
fs.mkdirSync(outputDirectoryScreenshots);
}
try { try {
// Loop through each game folder. // Loop through each game folder.
getDirectories(inputDirectoryGame).forEach(function(game) { getDirectories(inputDirectoryGame).forEach(function(game) {
@ -77,10 +91,52 @@ try {
if (fs.existsSync(iconPath)) { if (fs.existsSync(iconPath)) {
fsextra.copySync(iconPath, `${outputDirectoryIcons}/${game}.png`); fsextra.copySync(iconPath, `${outputDirectoryIcons}/${game}.png`);
} }
// Copy the savefiles for the game.
let inputDirectorySavefilesGame = `${inputDirectoryGame}/${game}/savefiles/`;
let outputDirectorySavefilesGame = `${outputDirectorySavefiles}/${game}/`;
let savefileMetadataContents = [];
if (fs.existsSync(inputDirectorySavefilesGame)) {
// Create the savefile directory for each game.
if (fs.existsSync(outputDirectorySavefilesGame) == false) {
fs.mkdirSync(outputDirectorySavefilesGame);
}
// Copy all savefiles into the output folder and store their contents.
fs.readdirSync(inputDirectorySavefilesGame).forEach(file => {
if (file.slice(-5) == '.csav') {
fsextra.copySync(`${inputDirectorySavefilesGame}/${file}`, `${outputDirectorySavefilesGame}/${file}`);
} else if (file.slice(-4) == '.dat') {
// Store the contents of the file in memory for adding it into the markdown later.
savefileMetadataContents.push({ filename: file.replace('.dat', '.csav'), contents: fs.readFileSync(`${inputDirectorySavefilesGame}/${file}`, 'utf8') });
}
});
}
// Copy the screenshots for the game.
let inputDirectoryScreenshotsGame = `${inputDirectoryGame}/${game}/screenshots/`;
let outputDirectoryScreenshotsGame = `${outputDirectoryScreenshots}/${game}/`;
if (fs.existsSync(inputDirectoryScreenshotsGame)) {
// Create the savefile directory for each game.
if (fs.existsSync(outputDirectoryScreenshotsGame) == false) {
fs.mkdirSync(outputDirectoryScreenshotsGame);
}
// Copy all screenshots into the output folder.
fs.readdirSync(inputDirectoryScreenshotsGame).forEach(file => {
if (file.slice(-4) == '.png') {
fsextra.copySync(`${inputDirectoryScreenshotsGame}/${file}`, `${outputDirectoryScreenshotsGame}/${file}`);
}
});
}
// Create the markdown file to be displayed in Hugo. // Create the markdown file to be displayed in Hugo.
let title = game.replace(/-/g, ' ').slice(0, -3); let title = game.replace(/-/g, ' ').slice(0, -3);
var stats = fs.statSync(`${inputDirectoryGame}/${game}/game.dat`); var stats = fs.statSync(`${inputDirectoryGame}/${game}/game.dat`);
var modified = new Date(util.inspect(stats.mtime)); let modified = new Date(util.inspect(stats.mtime));
let datContents = fs.readFileSync(`${inputDirectoryGame}/${game}/game.dat`, 'utf8'); let datContents = fs.readFileSync(`${inputDirectoryGame}/${game}/game.dat`, 'utf8');
let wikiContents = fs.readFileSync(`${inputDirectoryWiki}/${game}.md`, 'utf8'); let wikiContents = fs.readFileSync(`${inputDirectoryWiki}/${game}.md`, 'utf8');
@ -89,7 +145,13 @@ try {
wikiContents = blackfriday.fixLists(wikiContents); wikiContents = blackfriday.fixLists(wikiContents);
wikiContents = blackfriday.fixLinks(wikiContents); wikiContents = blackfriday.fixLinks(wikiContents);
let output = `+++\r\ndate = "${modified.toISOString()}"\r\n${datContents}+++\r\n\r\n${wikiContents}\r\n`; // Read all savefiles from array and copy them into the markdown.
savefileMetadataContents.forEach(function(savefile) {
let modified = new Date(util.inspect(stats.mtime));
datContents += `\r\n\r\n[[ savefiles ]]\r\n${savefile.contents}\r\nfilename = "${savefile.filename}"\r\ndate = "${modified.toISOString()}"\r\n`;
});
let output = `+++\r\ndate = "${modified.toISOString()}"\r\n${datContents}\r\n+++\r\n\r\n${wikiContents}\r\n`;
fs.writeFileSync(`${outputDirectoryMd}/${game}.md`, output); fs.writeFileSync(`${outputDirectoryMd}/${game}.md`, output);
}); });
} catch (ex) { } catch (ex) {

View File

@ -1,8 +1,9 @@
{ {
"0": { "name": "Won't Boot", "description": "The game crashes when attempting to startup." }, "0": { "name": "Won't Boot", "description": "The game crashes when attempting to startup." },
"1": { "name": "Garbage", "description": "Game is completely unplayable due to major graphical or audio glitches. Unable to progress past the Start Screen." }, "1": { "name": "Intro/Menu", "description": "Game is completely unplayable due to major graphical or audio glitches. Unable to progress past the Start Screen." },
"2": { "name": "Bronze", "description": "Game functions, but with major graphical or audio glitches. Unable to progress in specific areas due to glitches even with workarounds." }, "2": { "name": "Bad", "description": "Game functions, but with major graphical or audio glitches. Unable to progress in specific areas due to glitches even with workarounds." },
"3": { "name": "Silver", "description": "Game functions with minor graphical or audio glitches, but game is playable from start to finish with workarounds." }, "3": { "name": "Okay", "description": "Game functions with major graphical or audio glitches, but game is playable from start to finish with workarounds." },
"4": { "name": "Gold", "description": "Game functions with minor graphical or audio glitches, game is playable from start to finish without any workarounds needed." }, "4": { "name": "Great", "description": "Game functions with minor graphical or audio glitches, but game is playable from start to finish with workarounds." },
"5": { "name": "Platinum", "description": "Game functions flawless with no audio or graphical glitches, all tested functionality works as intended without any workarounds needed." } "5": { "name": "Excellent", "description": "Game functions with minor graphical or audio glitches, game is playable from start to finish without any workarounds needed." },
"6": { "name": "Perfect", "description": "Game functions flawless with no audio or graphical glitches, all tested functionality works as intended without any workarounds needed." }
} }

View File

@ -0,0 +1,69 @@
{{ define "main" }}
{{ $paginator := .Paginate .Data.Pages }}
<h1>Game Compatibility List</h1>
<p>The Citra Emulator compatibility list contains all the games we tested, sorted by how well they work on the emulator.</p>
<table class="table table-striped">
<thead>
<tr>
<th>Rating</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Perfect</td>
<td>Game functions flawless with no audio or graphical glitches, all tested functionality works as intended without any workarounds needed.</td>
</tr>
<tr>
<td>Excellent</td>
<td>Game functions with minor graphical or audio glitches, game is playable from start to finish without any workarounds needed.</td>
</tr>
<tr>
<td>Great</td>
<td>Game functions with minor graphical or audio glitches, but game is playable from start to finish with workarounds.</td>
</tr>
<tr>
<td>Okay</td>
<td>Game functions with major graphical or audio glitches, but game is playable from start to finish with workarounds.</td>
</tr>
<tr>
<td>Bad</td>
<td>Game functions, but with major graphical or audio glitches. Unable to progress in specific areas due to glitches even with workarounds.</td>
</tr>
<tr>
<td>Intro/Menu</td>
<td>Game is completely unplayable due to major graphical or audio glitches. Unable to progress past the Start Screen.</td>
</tr>
<tr>
<td>Won't Boot</td>
<td>The game crashes when attempting to startup.</td>
</tr>
</tbody>
</table>
<h2>Games</h2>
<table class="table">
<thead>
<tr>
<th></th>
<th>Title</th>
<th>Compatibility</th>
<th>Date Tested</th>
</tr>
</thead>
<tbody>
{{ range $paginator.Pages }}
{{ $rating := index .Site.Data.compatibility ( string .Params.compatibility | default "0" ) }}
<tr>
<td><img class="img-responsive" src="{{ .Site.BaseURL }}images/game/icons/{{ default (print .File.BaseFileName ".png") }}" /></td>
<td><a href="{{ .Permalink }}">{{ .Params.title }}</a></td>
<td>{{ $rating.name }}</td>
<td>{{ dateFormat "January 2, 2006" .Params.tested_date }}</td>
</tr>
{{ end }}
</tbody>
</table>
{{ partial "pagination" . }}
{{ end }}

View File

@ -1,5 +1,7 @@
{{ define "main" }} {{ define "main" }}
{{ $gameName := .File.BaseFileName }}
{{ $rating := index .Site.Data.compatibility ( string .Params.compatibility | default "0" ) }} {{ $rating := index .Site.Data.compatibility ( string .Params.compatibility | default "0" ) }}
<div class="alert alert-info"> <div class="alert alert-info">
<div class="row"> <div class="row">
<div class="col-md-2"> <div class="col-md-2">
@ -30,19 +32,15 @@
</div> </div>
<div class="col-md-7"> <div class="col-md-7">
<!-- Metadata information --> <!-- Metadata information -->
<table class="table table-striped"> <table class="table table-striped table-bordered">
<tbody> <tbody>
<tr> <tr>
<td>Status</td> <td style="width: 100px;">Status</td>
<td><b>{{ $rating.name }}</b><br />{{ $rating.description }}</td> <td><b>{{ $rating.name }}</b><br />{{ $rating.description }}</td>
</tr> </tr>
<tr> <tr>
<td>Tested Date</td> <td>Game Icon</td>
<td>{{ dateFormat "January 2, 2006" .Params.tested_date }}</td> <td><img class="img-responsive" src="{{ .Site.BaseURL }}images/game/icons/{{ default (print .File.BaseFileName ".png") }}" /></td>
</tr>
<tr>
<td>Tested Version</td>
<td>{{ .Params.tested_version }}</td>
</tr> </tr>
<tr> <tr>
<td>Title IDs</td> <td>Title IDs</td>
@ -54,16 +52,114 @@
</tr> </tr>
<tr> <tr>
<td>System Files Required?</td> <td>System Files Required?</td>
<td>{{ if eq .Params.needs_system_files true }}Yes{{ else }}No{{ end }}</td> <td>{{ if eq .Params.needs_system_files true }}Yes{{ else if eq .Params.needs_system_files false }}No{{ else }}N/A{{ end }}</td>
</tr> </tr>
<tr> <tr>
<td>Shared Font Required?</td> <td>Shared Font Required?</td>
<td>{{ if eq .Params.needs_shared_font true }}Yes{{ else }}No{{ end }}</td> <td>{{ if eq .Params.needs_shared_font true }}Yes{{ else if eq .Params.needs_shared_font false }}No{{ else }}N/A{{ end }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<p>{{ .Params.Description }}</p> <p>{{ .Params.Description }}</p>
{{ .Content }} {{ .Content }}
<!-- Compatibility -->
<div class="row">
<div class="col-md-12">
<h2>Compatibility</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Date</th>
<th>Tested By</th>
<th>Citra Version</th>
<th>Rating</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ dateFormat "January 2, 2006" .Params.tested_date }}</td>
<td><a href="https://community.citra-emu.org/u/{{ .Params.tested_by }}/summary">{{ .Params.tested_by }}</a></td>
<td>{{ .Params.tested_version }}</td>
<td><b>{{ $rating.name }}</b></td>
</tr>
</tbody>
</table>
</div>
</div>
{{ if (where (readDir "/static/savefiles") "Name" .File.BaseFileName) }}
<div class="row">
<div class="col-md-12">
<h2>Savefiles</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Uploaded By</th>
<th>Date</th>
</tr>
</thead>
<tbody>
{{ range .Params.savefiles }}
<tr>
<td><a href="/savefiles/{{ $gameName }}/{{ .filename }}">{{ .title }}</a></td>
<td>{{ .description }}</td>
<td><a href="https://community.citra-emu.org/u/{{ .author }}/summary">{{ .author }}</a></td>
<td>{{ dateFormat "January 2, 2006" .date }}</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>
{{ end }}
{{ if (where (readDir "/static/images/screenshots0") "Name" .File.BaseFileName) }}
<div class="row">
<div class="col-md-12">
<h2>Screenshots</h2>
{{ $files := readDir (printf "/static/images/screenshots0/%s/" .File.BaseFileName) }}
{{ range $index, $element := $files }}
<div class="popup-gallery col-lg-3 col-md-4 col-xs-6 thumb">
<a class="thumbnail" href="/images/screenshots0/{{ $gameName }}/{{ .Name }}">
<img class="img-responsive nearest-neighbor" src="/images/screenshots0/{{ $gameName }}/{{ .Name }}">
</a>
</div>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}
{{ define "scripts" }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js" integrity="sha256-P93G0oq6PBPWTP1IR8Mz/0jHHUpaWL0aBJTKauisG7Q=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.min.css" integrity="sha256-PZLhE6wwMbg4AB3d35ZdBF9HD/dI/y4RazA3iRDurss=" crossorigin="anonymous" />
<script type="text/javascript">
$(document).ready(function() {
$('.popup-gallery').magnificPopup({
delegate: 'a',
type: 'image',
tLoading: 'Loading image #%curr%...',
mainClass: 'mfp-img-mobile',
gallery: {
enabled: true,
navigateByImgClick: true,
preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
},
image: {
tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
titleSrc: function(item) {
return item.el.attr('title');
}
}
});
});
</script>
{{ end }} {{ end }}