Skip to content

Commit

Permalink
move cue-enabled to emulation settings
Browse files Browse the repository at this point in the history
  • Loading branch information
n-at committed May 7, 2024
1 parent e6ba8f9 commit f5ce0b6
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion assets/l10n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"game.edit.cover-image-delete.label": "Delete cover image",
"game.edit.cover-image-empty": "No cover image",
"game.edit.override-settings.label": "Override emulation settings",
"game.edit.cue-enabled.label": "Enable creation of .cue file",
"game.edit.netplay-enabled.label": "Netplay enabled",
"game.edit.netplay-require-login.label": "Require login for netplay",
"game.edit.netplay-open.label": "Show in open netplay games",
Expand Down Expand Up @@ -228,6 +227,7 @@
"settings-platform.emulation.threads.label": "Use threads",
"settings-platform.emulation.disable-vsync.label": "Disable VSync",
"settings-platform.emulation.disable-browser-db.label": "Disable browser DB",
"settings-platform.emulation.cue-enabled.label": "Enable creation of .cue file",
"settings-platform.core.title": "Core",
"settings-platform.core.empty": "No options for selected core",
"settings-platform.play.title": "Play",
Expand Down
2 changes: 1 addition & 1 deletion assets/l10n/ru_RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"game.edit.cover-image-delete.label": "Удалить обложку",
"game.edit.cover-image-empty": "Нет обложки",
"game.edit.override-settings.label": "Переопределить настройки эмуляции",
"game.edit.cue-enabled.label": "Включить создание файлов .cue",
"game.edit.netplay-enabled.label": "Включить сетевую игру",
"game.edit.netplay-require-login.label": "Требовать вход для сетевой игры",
"game.edit.netplay-open.label": "Показать в списке открытых сетевых игр",
Expand Down Expand Up @@ -228,6 +227,7 @@
"settings-platform.emulation.threads.label": "Использовать потоки",
"settings-platform.emulation.disable-vsync.label": "Отключить вертикальную синхронизацию",
"settings-platform.emulation.disable-browser-db.label": "Отключить использование БД браузера",
"settings-platform.emulation.cue-enabled.label": "Включить создание файлов .cue",
"settings-platform.core.title": "Ядро",
"settings-platform.core.empty": "Нет настроек для выбранного ядра",
"settings-platform.play.title": "Игра",
Expand Down
1 change: 1 addition & 0 deletions storage/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,7 @@ func DefaultEmulatorSettings(systemType string) EmulatorSettings {
settings.Shader = Shaders[0].Value
settings.Buttons = DefaultButtons
settings.Controls = [4]EmulatorControls{controls}
settings.CueEnabled = true

return settings
}
2 changes: 1 addition & 1 deletion storage/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ type Game struct {
NetplaySessionId string
NetplayRequireLogin bool
NetplayOpen bool
CueEnabled bool
AutoSaveEnabled bool
AutoSaveInterval int
AutoSaveCapacity int
Expand Down Expand Up @@ -90,6 +89,7 @@ type EmulatorSettings struct {
Threads bool
DisableBrowserDB bool
DisableVSync bool
CueEnabled bool
}

type EmulatorControls struct {
Expand Down
7 changes: 0 additions & 7 deletions templates/includes/form_game.twig
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@
</div>
</div>

<div class="mb-3">
<div class="form-check form-switch">
<input type="checkbox" id="cue-enabled" name="cue-enabled" class="form-check-input" value="1" {% if game.CueEnabled %}checked{% endif %}>
<label for="cue-enabled">{{ loc("game.edit.cue-enabled.label") }}</label>
</div>
</div>

{% if netplay_enabled %}
<div class="mb-3">
<div class="form-check form-switch">
Expand Down
6 changes: 6 additions & 0 deletions templates/includes/platform_settings/emulation.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,11 @@
<input type="checkbox" id="disable-browser-db" name="disable-browser-db" class="form-check-input" value="1" {% if settings.DisableBrowserDB %}checked{% endif %}>
<label for="disable-browser-db">{{ loc("settings-platform.emulation.disable-browser-db.label") }}</label>
</div>
<div class="mb-3">
<div class="form-check form-switch">
<input type="checkbox" id="cue-enabled" name="cue-enabled" class="form-check-input" value="1" {% if settings.CueEnabled %}checked{% endif %}>
<label for="cue-enabled">{{ loc("settings-platform.emulation.cue-enabled.label") }}</label>
</div>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion templates/play.twig
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
window.EJS_disableDatabases = true;
{% endif %}
{% if not game.CueEnabled %}
{% if not emulator_settings.CueEnabled %}
window.EJS_disableCue = true;
{% endif %}
Expand Down
2 changes: 0 additions & 2 deletions web/handlers_game.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func (s *Server) gameUpload(c echo.Context) error {
OriginalFileExtension: getFileExtension(file.Filename),
OriginalFileSize: file.Size,
Platform: "",
CueEnabled: true,
AutoSaveEnabled: false,
AutoSaveInterval: 5 * 60,
AutoSaveCapacity: 10,
Expand Down Expand Up @@ -177,7 +176,6 @@ func (s *Server) gameEditSubmit(c echo.Context) error {
game.Name = c.FormValue("name")
game.Description = c.FormValue("description")
game.OverrideEmulatorSettings = c.FormValue("override-settings") == "1"
game.CueEnabled = c.FormValue("cue-enabled") == "1"
game.NetplayEnabled = c.FormValue("netplay-enabled") == "1"
game.NetplayRequireLogin = c.FormValue("netplay-require-login") == "1"
game.NetplayOpen = c.FormValue("netplay-open") == "1"
Expand Down
1 change: 1 addition & 0 deletions web/handlers_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ func settingsCollectFormData(c echo.Context) storage.EmulatorSettings {
Threads: c.FormValue("threads") == "1",
DisableBrowserDB: c.FormValue("disable-browser-db") == "1",
DisableVSync: c.FormValue("disable-vsync") == "1",
CueEnabled: c.FormValue("cue-enabled") == "1",
Buttons: buttons,
Controls: settingsCollectControls(c),
CoreOptions: coreOptionsValues,
Expand Down

0 comments on commit f5ce0b6

Please sign in to comment.