diff --git a/data/locale/ca.yaml b/data/locale/ca.yaml index 41971e5..3567bc8 100644 --- a/data/locale/ca.yaml +++ b/data/locale/ca.yaml @@ -8,11 +8,15 @@ menu: video: "VIDEO" audio: "AUDIO" controls: "CONTROLS" + game: "JOC" items: video: "VIDEO" audio: "AUDIO" controls: "CONTROLS" + game: "JOC" + use_new_logo: "LOGO NOU" + show_title_credits: "CREDITS DEL PORT" zoom: "ZOOM" screen: "PANTALLA" shader: "SHADER" diff --git a/source/core/rendering/menu.cpp b/source/core/rendering/menu.cpp index 36a8d01..5dcc524 100644 --- a/source/core/rendering/menu.cpp +++ b/source/core/rendering/menu.cpp @@ -101,12 +101,14 @@ namespace Menu { static Page buildVideo(); static Page buildAudio(); static Page buildControls(); + static Page buildGame(); static Page buildRoot() { Page p{Locale::get("menu.titles.root"), {}, 0}; p.items.push_back({Locale::get("menu.items.video"), ItemKind::Submenu, nullptr, nullptr, [] { pushPage(buildVideo()); }, nullptr}); p.items.push_back({Locale::get("menu.items.audio"), ItemKind::Submenu, nullptr, nullptr, [] { pushPage(buildAudio()); }, nullptr}); p.items.push_back({Locale::get("menu.items.controls"), ItemKind::Submenu, nullptr, nullptr, [] { pushPage(buildControls()); }, nullptr}); + p.items.push_back({Locale::get("menu.items.game"), ItemKind::Submenu, nullptr, nullptr, [] { pushPage(buildGame()); }, nullptr}); return p; } @@ -207,6 +209,16 @@ namespace Menu { return p; } + static Page buildGame() { + Page p{Locale::get("menu.titles.game"), {}, 0}; + + p.items.push_back({Locale::get("menu.items.use_new_logo"), ItemKind::Toggle, [] { return yesNo(Options::game.use_new_logo); }, [](int) { Options::game.use_new_logo = !Options::game.use_new_logo; }, nullptr}); + + p.items.push_back({Locale::get("menu.items.show_title_credits"), ItemKind::Toggle, [] { return yesNo(Options::game.show_title_credits); }, [](int) { Options::game.show_title_credits = !Options::game.show_title_credits; }, nullptr}); + + return p; + } + // --- Dibuix --- // Alpha blending per pixel sobre el buffer ARGB (ABGR en memòria) diff --git a/source/core/system/director.cpp b/source/core/system/director.cpp index 1052911..a9c2d7b 100644 --- a/source/core/system/director.cpp +++ b/source/core/system/director.cpp @@ -76,7 +76,9 @@ void Director::run() { // atòmica d'un int global: race benigna, tard d'1 frame en el pitjor cas. static bool credits_triggered = false; if (!credits_triggered && info::num_piramide == 0) { - Overlay::startCredits(); + if (Options::game.show_title_credits) { + Overlay::startCredits(); + } credits_triggered = true; } diff --git a/source/game/defaults.hpp b/source/game/defaults.hpp index 924cd5c..caf7a6b 100644 --- a/source/game/defaults.hpp +++ b/source/game/defaults.hpp @@ -58,4 +58,5 @@ namespace Defaults::Game { constexpr int PIRAMIDE_INICIAL = 255; constexpr int VIDES = 5; constexpr bool USE_NEW_LOGO = true; + constexpr bool SHOW_TITLE_CREDITS = true; } // namespace Defaults::Game diff --git a/source/game/defines.hpp b/source/game/defines.hpp index 94b41d2..d7eb299 100644 --- a/source/game/defines.hpp +++ b/source/game/defines.hpp @@ -3,7 +3,7 @@ // Textos namespace Texts { constexpr const char* WINDOW_TITLE = "© 2000 Aventures en Egipte — JailDesigner"; - constexpr const char* VERSION = "1.1"; + constexpr const char* VERSION = "1.11"; } // namespace Texts // Resolución del juego diff --git a/source/game/options.cpp b/source/game/options.cpp index c478de3..e58e068 100644 --- a/source/game/options.cpp +++ b/source/game/options.cpp @@ -146,6 +146,8 @@ namespace Options { game.vides = node["vides"].get_value(); if (node.contains("use_new_logo")) game.use_new_logo = node["use_new_logo"].get_value(); + if (node.contains("show_title_credits")) + game.show_title_credits = node["show_title_credits"].get_value(); } // Carrega les opcions des del fitxer configurat @@ -277,6 +279,7 @@ namespace Options { file << " piramide_inicial: " << game.piramide_inicial << "\n"; file << " vides: " << game.vides << "\n"; file << " use_new_logo: " << (game.use_new_logo ? "true" : "false") << "\n"; + file << " show_title_credits: " << (game.show_title_credits ? "true" : "false") << "\n"; file << "\n"; // CONTROLS diff --git a/source/game/options.hpp b/source/game/options.hpp index 5491c0e..c17823e 100644 --- a/source/game/options.hpp +++ b/source/game/options.hpp @@ -84,6 +84,7 @@ namespace Options { int piramide_inicial{Defaults::Game::PIRAMIDE_INICIAL}; int vides{Defaults::Game::VIDES}; bool use_new_logo{Defaults::Game::USE_NEW_LOGO}; + bool show_title_credits{Defaults::Game::SHOW_TITLE_CREDITS}; }; // Preset PostFX