Skip to content

Commit

Permalink
treads switch visibility depends on selected core
Browse files Browse the repository at this point in the history
  • Loading branch information
n-at committed Sep 1, 2023
1 parent c5f26ef commit e99eab3
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
Binary file modified assets/img/controller/pce.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions assets/platform-settings-core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
(() => {

const coresWithThreads = [
'mednafen_psx_hw',
'mupen64plus_next',
'opera',
'parallel_n64',
'pcsx_rearmed',
'yabause',
];

function setupThreadsControl() {
const fieldThreads = document.getElementById('threads');
const fieldCores = document.getElementById('core');

if (coresWithThreads.includes(fieldCores.value)) {
fieldThreads.parentElement.classList.remove('d-none');
} else {
fieldThreads.parentElement.classList.add('d-none');
fieldThreads.checked = null;
}
}

window.addEventListener('load', () => {
document.getElementById('core').addEventListener('change', setupThreadsControl);
setupThreadsControl();
});

})();
2 changes: 1 addition & 1 deletion storage/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ var (
},
"gb": {
Id: "gb",
Name: "Nintendo Game Boy",
Name: "Nintendo Game Boy (Color)",
Extensions: []string{"gb", "gbc"},
},
"gba": {
Expand Down
5 changes: 5 additions & 0 deletions templates/game_emulation_settings.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
Emulation settings - playtime
{% endblock %}

{% block assets %}
<script src="/assets/platform-settings-controls.js"></script>
<script src="/assets/platform-settings-core.js"></script>
{% endblock %}

{% block content %}

<h1>Emulation settings</h1>
Expand Down
1 change: 1 addition & 0 deletions templates/settings_platform.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

{% block assets %}
<script src="/assets/platform-settings-controls.js"></script>
<script src="/assets/platform-settings-core.js"></script>
{% endblock %}

{% block content %}
Expand Down

0 comments on commit e99eab3

Please sign in to comment.