From f3b113c95ef4b6b9393f89a13b3368d06d856dc7 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Tue, 7 Apr 2026 21:18:49 +0200 Subject: [PATCH] canvis cosmetics --- source/game/defaults.hpp | 15 ++++++++++++--- source/game/editor/map_editor.cpp | 19 ++++++++++++++----- source/game/ui/notifier.cpp | 13 +++++++------ 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/source/game/defaults.hpp b/source/game/defaults.hpp index 0ee202f..2934369 100644 --- a/source/game/defaults.hpp +++ b/source/game/defaults.hpp @@ -29,7 +29,7 @@ namespace Defaults::Video { constexpr bool SUPERSAMPLING = false; // Supersampling desactivado por defecto constexpr bool INTEGER_SCALE = true; // Escalado entero activado por defecto constexpr bool KEEP_ASPECT = true; // Mantener aspecto activado por defecto - constexpr const char* PALETTE_NAME = "cpc"; // Paleta por defecto + constexpr const char* PALETTE_NAME = "resurrect-64"; // Paleta por defecto constexpr const char* PALETTE_SORT = "original"; // Modo de ordenación de paleta por defecto constexpr bool LINEAR_UPSCALE = false; // Upscale NEAREST por defecto constexpr int DOWNSCALE_ALGO = 1; // Downscale Lanczos2 por defecto @@ -39,7 +39,7 @@ namespace Defaults::Video { namespace Defaults::Border { constexpr bool ENABLED = true; // Borde activado por defecto constexpr int WIDTH = 32; // Ancho del borde por defecto - constexpr int HEIGHT = 24; // Alto del borde por defectoF + constexpr int HEIGHT = 24; // Alto del borde por defecto } // namespace Defaults::Border namespace Defaults::Audio { @@ -70,7 +70,7 @@ namespace Defaults::Stats { namespace Defaults::Controls { constexpr SDL_Scancode KEY_LEFT = SDL_SCANCODE_LEFT; // Tecla izquierda por defecto constexpr SDL_Scancode KEY_RIGHT = SDL_SCANCODE_RIGHT; // Tecla derecha por defecto - constexpr SDL_Scancode KEY_JUMP = SDL_SCANCODE_UP; // Tecla salto por defecto + constexpr SDL_Scancode KEY_JUMP = SDL_SCANCODE_Z; // Tecla salto por defecto constexpr int GAMEPAD_BUTTON_LEFT = SDL_GAMEPAD_BUTTON_DPAD_LEFT; // Botón izquierda por defecto constexpr int GAMEPAD_BUTTON_RIGHT = SDL_GAMEPAD_BUTTON_DPAD_RIGHT; // Botón derecha por defecto @@ -83,6 +83,15 @@ namespace Defaults::Kiosk { constexpr bool INFINITE_LIVES = true; // Vidas infinitas en modo kiosko desactivadas por defecto } // namespace Defaults::Kiosk +namespace Defaults::Notification { + constexpr Uint8 BG_COLOR = 0; // Color de fondo (DEFAULT) — púrpura oscuro + constexpr Uint8 BORDER_COLOR = 7; // Color del borde (DEFAULT) — gris azulado + constexpr Uint8 TEXT_COLOR = 7; // Color del texto (DEFAULT) — gris azulado + constexpr Uint8 CHEEVO_BG_COLOR = 0; // Color de fondo (CHEEVO) — púrpura oscuro + constexpr Uint8 CHEEVO_BORDER_COLOR = 18; // Color del borde (CHEEVO) — amarillo dorado + constexpr Uint8 CHEEVO_TEXT_COLOR = 9; // Color del texto (CHEEVO) — blanco +} // namespace Defaults::Notification + namespace Defaults::Localization { constexpr const char* LANGUAGE = "ca"; // Idioma por defecto (en = inglés, ca = catalán) } // namespace Defaults::Localization diff --git a/source/game/editor/map_editor.cpp b/source/game/editor/map_editor.cpp index e0a50e8..f3d86dd 100644 --- a/source/game/editor/map_editor.cpp +++ b/source/game/editor/map_editor.cpp @@ -465,11 +465,20 @@ void MapEditor::handleEvent(const SDL_Event& event) { // NOLINT(readability-fun if (event.type == SDL_EVENT_KEY_DOWN && static_cast(event.key.repeat) == 0) { std::string direction; switch (event.key.key) { - case SDLK_UP: direction = "UP"; break; - case SDLK_DOWN: direction = "DOWN"; break; - case SDLK_LEFT: direction = "LEFT"; break; - case SDLK_RIGHT: direction = "RIGHT"; break; - default: break; + case SDLK_UP: + direction = "UP"; + break; + case SDLK_DOWN: + direction = "DOWN"; + break; + case SDLK_LEFT: + direction = "LEFT"; + break; + case SDLK_RIGHT: + direction = "RIGHT"; + break; + default: + break; } if (!direction.empty() && GameControl::get_adjacent_room) { std::string adjacent = GameControl::get_adjacent_room(direction); diff --git a/source/game/ui/notifier.cpp b/source/game/ui/notifier.cpp index df36a9d..9232b07 100644 --- a/source/game/ui/notifier.cpp +++ b/source/game/ui/notifier.cpp @@ -14,6 +14,7 @@ #include "core/rendering/surface.hpp" // Para Surface #include "core/rendering/text.hpp" // Para Text, Text::CENTER_FLAG, Text::COLOR_FLAG #include "core/resources/resource_cache.hpp" // Para Resource +#include "game/defaults.hpp" // Para Defaults::Notification #include "game/options.hpp" // Para Options, options, NotificationPosition #include "utils/delta_timer.hpp" // Para DeltaTimer #include "utils/utils.hpp" // Para PaletteColor @@ -23,9 +24,9 @@ Notifier* Notifier::notifier = nullptr; // Definición de estilos predefinidos const Notifier::Style Notifier::Style::DEFAULT = { - .bg_color = 2, - .border_color = 10, - .text_color = 10, + .bg_color = Defaults::Notification::BG_COLOR, + .border_color = Defaults::Notification::BORDER_COLOR, + .text_color = Defaults::Notification::TEXT_COLOR, .shape = Notifier::Shape::SQUARED, .text_align = Notifier::TextAlign::CENTER, .duration = 2.0F, @@ -33,9 +34,9 @@ const Notifier::Style Notifier::Style::DEFAULT = { .play_sound = false}; const Notifier::Style Notifier::Style::CHEEVO = { - .bg_color = 6, - .border_color = 7, - .text_color = 14, + .bg_color = Defaults::Notification::CHEEVO_BG_COLOR, + .border_color = Defaults::Notification::CHEEVO_BORDER_COLOR, + .text_color = Defaults::Notification::CHEEVO_TEXT_COLOR, .shape = Notifier::Shape::SQUARED, .text_align = Notifier::TextAlign::CENTER, .duration = 4.0F,