Skip to content

Commit

Permalink
Fixes issue #58 - message for samples
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmo0 committed Jan 5, 2023
1 parent 501239c commit a80c4f8
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 79 deletions.
1 change: 1 addition & 0 deletions ArcadeManager/Data/translations/en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ ROMS_COPY_ROMSET=Full romset
ROMS_COPY_ROMSET_DESC=The folder containing all the files of the romset
ROMS_COPY_ROMSELECT=Rom selection
ROMS_COPY_ROMSELECT_DESC=The folder that will contain the subset of the roms you want
ROMS_COPY_SAMPLES=Some old games, like Space Invaders, need "samples" to have sound. Make sure you copy them manually; the installation path vary depending on the system and emulator.<br>You can <a href="https://www.progettosnaps.net/samples/" class="blank">download them at ProgettoSnaps</a>.
ROMS_COPY_COPY=Copy listed roms

ROMS_DELETE_TITLE=Delete roms
Expand Down
1 change: 1 addition & 0 deletions ArcadeManager/Data/translations/fr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ ROMS_COPY_ROMSET=Romset complet
ROMS_COPY_ROMSET_DESC=Le dossier contenant tous les fichiers du romset
ROMS_COPY_ROMSELECT=Sélection de roms
ROMS_COPY_ROMSELECT_DESC=Le dossier qui contiendra la sélection de roms que vous voulez
ROMS_COPY_SAMPLES=Certains vieux jeux, comme Space Invaders, ont besoin de "samples" pour avoir du son. Copiez-les manuellement ; le dossier change en fonction de votre système et de l'émulateur.<br>Vous pouvez les <a href="https://www.progettosnaps.net/samples/" class="blank">télécharger sur ProgettoSnaps</a>.
ROMS_COPY_COPY=Copier les roms listées

ROMS_DELETE_TITLE=Supprimer des roms
Expand Down
158 changes: 79 additions & 79 deletions ArcadeManager/Views/Csv/Add.cshtml
Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
@{
@{
ViewData["title"] = Localizer["CSV_ADD_TITLE"];
}

<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a asp-controller="Home" asp-action="Index" class="navmenu">@Localizer["HOME"]</a></li>
<li class="breadcrumb-item"><a asp-controller="Csv" asp-action="Index" class="navmenu">@Localizer["BREADCRUMB_CSV"]</a></li>
<li class="breadcrumb-item active" aria-current="page">@Localizer["BREADCRUMB_CSV_ADD"]</li>
</ol>
</nav>

<h2>@Localizer["CSV_ADD_TITLE"]</h2>

@Html.Raw(Localizer["CSV_ADD_INTRO"])

<div class="input-group mb-0">
<div class="input-group-prepend">
<span class="input-group-text">@Localizer["CSV_ADD_MAINFILE"]</span>
</div>
<input type="text" class="form-control" id="fileMainCsv">
<div class="input-group-append">
<button class="btn btn-outline-primary browse" type="button" data-input="fileMainCsv">@Localizer["BROWSE"]</button>
</div>
</div>
<p class="mt-0 mb-3">
<small class="form-text text-muted">@Localizer["CSV_ADD_MAINFILE_DESC"]</small>
</p>

<!-- secondary CSV file -->
<div class="input-group mb-0">
<div class="input-group-prepend">
<span class="input-group-text">@Localizer["CSV_ADD_SECONDARY"]</span>
</div>
<input type="text" class="form-control" id="fileSecondaryCsv">
<div class="input-group-append">
<button class="btn btn-outline-secondary browse" type="button" data-input="fileSecondaryCsv">@Localizer["BROWSE"]</button>
</div>
</div>
<p class="mt-0 mb-3">
<small class="form-text text-muted">@Localizer["CSV_ADD_SECONDARY_DESC"]</small>
</p>

<!-- target output file -->
<div class="input-group mb-0">
<div class="input-group-prepend">
<span class="input-group-text">@Localizer["CSV_ADD_TARGET"]</span>
</div>
<input type="text" class="form-control" id="fileTarget">
<div class="input-group-append">
<button class="btn btn-outline-secondary browse new" type="button" data-input="fileTarget">@Localizer["BROWSE"]</button>
</div>
</div>
<p class="mt-0 mb-3">
<small class="form-text text-muted">@Localizer["CSV_ADD_TARGET_DESC"]</small>
</p>

<p class="mt-3">
<button type="button" id="buttonOk" class="btn btn-primary btn-lg btn-block">@Localizer["CSV_ADD_ADD"]</button>
</p>

@section Scripts {

<script>
$('#buttonOk').on('click', () => {
// get paths from file inputs
const main = $('#fileMainCsv').val(),
secondary = $('#fileSecondaryCsv').val(),
target = $('#fileTarget').val();
// check every path is filled
if (main === '') { window.alert('@Localizer.Js("ERROR_NOCSV")'); return; }
if (secondary === '') { window.alert('@Localizer.Js("ERROR_NOSECONDARYCSV")'); return; }
if (target === '') { window.alert('@Localizer.Js("ERROR_NOTARGETCSV")'); return; }
// execute action
ipc('csv-merge', { main, secondary, target });
});
</script>

}

<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a asp-controller="Home" asp-action="Index" class="navmenu">@Localizer["HOME"]</a></li>
<li class="breadcrumb-item"><a asp-controller="Csv" asp-action="Index" class="navmenu">@Localizer["BREADCRUMB_CSV"]</a></li>
<li class="breadcrumb-item active" aria-current="page">@Localizer["BREADCRUMB_CSV_ADD"]</li>
</ol>
</nav>

<h2>@Localizer["CSV_ADD_TITLE"]</h2>

@Html.Raw(Localizer["CSV_ADD_INTRO"])

<div class="input-group mb-0">
<div class="input-group-prepend">
<span class="input-group-text">@Localizer["CSV_ADD_MAINFILE"]</span>
</div>
<input type="text" class="form-control" id="fileMainCsv">
<div class="input-group-append">
<button class="btn btn-outline-primary browse" type="button" data-input="fileMainCsv">@Localizer["BROWSE"]</button>
</div>
</div>
<p class="mt-0 mb-3">
<small class="form-text text-muted">@Localizer["CSV_ADD_MAINFILE_DESC"]</small>
</p>

<!-- secondary CSV file -->
<div class="input-group mb-0">
<div class="input-group-prepend">
<span class="input-group-text">@Localizer["CSV_ADD_SECONDARY"]</span>
</div>
<input type="text" class="form-control" id="fileSecondaryCsv">
<div class="input-group-append">
<button class="btn btn-outline-secondary browse" type="button" data-input="fileSecondaryCsv">@Localizer["BROWSE"]</button>
</div>
</div>
<p class="mt-0 mb-3">
<small class="form-text text-muted">@Localizer["CSV_ADD_SECONDARY_DESC"]</small>
</p>

<!-- target output file -->
<div class="input-group mb-0">
<div class="input-group-prepend">
<span class="input-group-text">@Localizer["CSV_ADD_TARGET"]</span>
</div>
<input type="text" class="form-control" id="fileTarget">
<div class="input-group-append">
<button class="btn btn-outline-secondary browse new" type="button" data-input="fileTarget">@Localizer["BROWSE"]</button>
</div>
</div>
<p class="mt-0 mb-3">
<small class="form-text text-muted">@Localizer["CSV_ADD_TARGET_DESC"]</small>
</p>

<p class="mt-3">
<button type="button" id="buttonOk" class="btn btn-primary btn-lg btn-block">@Localizer["CSV_ADD_ADD"]</button>
</p>

@section Scripts {

<script>
$('#buttonOk').on('click', () => {
// get paths from file inputs
const main = $('#fileMainCsv').val(),
secondary = $('#fileSecondaryCsv').val(),
target = $('#fileTarget').val();
// check every path is filled
if (main === '') { window.alert('@Localizer.Js("ERROR_NOCSV")'); return; }
if (secondary === '') { window.alert('@Localizer.Js("ERROR_NOSECONDARYCSV")'); return; }
if (target === '') { window.alert('@Localizer.Js("ERROR_NOTARGETCSV")'); return; }
// execute action
ipc('csv-merge', { main, secondary, target });
});
</script>

}
4 changes: 4 additions & 0 deletions ArcadeManager/Views/Roms/Add.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
@Html.Raw(Localizer["ROMS_COPY_INTRO"])
</p>

<div class="alert alert-info">
@Html.Raw(Localizer["ROMS_COPY_SAMPLES"])
</div>

<div class="input-group mb-0">
<div class="input-group-prepend">
<span class="input-group-text">@Localizer["ROMS_COPY_CSVFILE"]</span>
Expand Down
4 changes: 4 additions & 0 deletions ArcadeManager/Views/Wizard/Paths.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
@Localizer["WIZARD_PATHS_INTRO"]
</p>

<div class="alert alert-info">
@Html.Raw(Localizer["ROMS_COPY_SAMPLES"])
</div>

<!-- Full romset location -->
<div class="input-group mb-0">
<div class="input-group-prepend">
Expand Down

0 comments on commit a80c4f8

Please sign in to comment.