arreglos en namespaces de defaults

This commit is contained in:
2026-03-23 21:15:01 +01:00
parent 270cd1d487
commit 3c2a5c9b37
3 changed files with 302 additions and 334 deletions

View File

@@ -4,240 +4,209 @@
#include <array>
#include "color.hpp"
#include "ui/notifier.hpp" // Para Notifier::Position
#include "version.h" // Para Version::APP_NAME
// --- Namespace GameDefaults: configuración centralizada con valores por defecto del juego ---
namespace GameDefaults {
namespace Defaults::Game {
constexpr float WIDTH = 320.0F;
constexpr float HEIGHT = 256.0F;
constexpr int NAME_ENTRY_IDLE_TIME = 10;
constexpr int NAME_ENTRY_TOTAL_TIME = 60;
constexpr bool HIT_STOP = false;
constexpr int HIT_STOP_MS = 500;
constexpr const char* ITEM_TEXT_OUTLINE_COLOR = "FFFFFF00";
// --- GAME ---
namespace Game {
constexpr float WIDTH = 320.0F;
constexpr float HEIGHT = 256.0F;
constexpr int NAME_ENTRY_IDLE_TIME = 10;
constexpr int NAME_ENTRY_TOTAL_TIME = 60;
constexpr bool HIT_STOP = false;
constexpr int HIT_STOP_MS = 500;
constexpr const char* ITEM_TEXT_OUTLINE_COLOR = "FFFFFF00"; // 255, 255, 255, 0
constexpr float PLAY_AREA_X = 0.0F;
constexpr float PLAY_AREA_Y = 0.0F;
constexpr float PLAY_AREA_W = 320.0F;
constexpr float PLAY_AREA_H = 216.0F;
} // namespace Defaults::Game
// Play area por defecto
constexpr float PLAY_AREA_X = 0.0F;
constexpr float PLAY_AREA_Y = 0.0F;
constexpr float PLAY_AREA_W = 320.0F;
constexpr float PLAY_AREA_H = 216.0F;
} // namespace Game
namespace Defaults::Fade {
constexpr const char* COLOR = "1F2B30";
constexpr float NUM_SQUARES_WIDTH = 160.0F;
constexpr float NUM_SQUARES_HEIGHT = 128.0F;
constexpr int RANDOM_SQUARES_DURATION_MS = 1;
constexpr int POST_DURATION_MS = 80;
constexpr float VENETIAN_SIZE = 12.0F;
} // namespace Defaults::Fade
// --- FADE ---
namespace Fade {
constexpr const char* COLOR = "1F2B30";
constexpr float NUM_SQUARES_WIDTH = 160.0F;
constexpr float NUM_SQUARES_HEIGHT = 128.0F;
constexpr int RANDOM_SQUARES_DURATION_MS = 1;
constexpr int POST_DURATION_MS = 80;
constexpr float VENETIAN_SIZE = 12.0F;
} // namespace Fade
namespace Defaults::Scoreboard {
constexpr float RECT_X = 0.0F;
constexpr float RECT_Y = 216.0F;
constexpr float RECT_W = 320.0F;
constexpr float RECT_H = 40.0F;
constexpr bool SEPARATOR_AUTOCOLOR = true;
constexpr const char* SEPARATOR_COLOR = "0D1A2B";
constexpr const char* EASY_COLOR = "4B692F";
constexpr const char* NORMAL_COLOR = "2E3F47";
constexpr const char* HARD_COLOR = "76428A";
constexpr bool TEXT_AUTOCOLOR = true;
constexpr const char* TEXT_COLOR1 = "FFFFFF";
constexpr const char* TEXT_COLOR2 = "FFFFFF";
constexpr int SKIP_COUNTDOWN_VALUE = 8;
} // namespace Defaults::Scoreboard
// --- SCOREBOARD ---
namespace Scoreboard {
constexpr float RECT_X = 0.0F;
constexpr float RECT_Y = 216.0F;
constexpr float RECT_W = 320.0F;
constexpr float RECT_H = 40.0F;
constexpr bool SEPARATOR_AUTOCOLOR = true;
constexpr const char* SEPARATOR_COLOR = "0D1A2B";
constexpr const char* EASY_COLOR = "4B692F";
constexpr const char* NORMAL_COLOR = "2E3F47";
constexpr const char* HARD_COLOR = "76428A";
constexpr bool TEXT_AUTOCOLOR = true;
constexpr const char* TEXT_COLOR1 = "FFFFFF";
constexpr const char* TEXT_COLOR2 = "FFFFFF";
constexpr int SKIP_COUNTDOWN_VALUE = 8;
} // namespace Scoreboard
namespace Defaults::Title {
constexpr int PRESS_START_POSITION = 180;
constexpr float DURATION_S = 14.0F;
constexpr int ARCADE_EDITION_POSITION = 123;
constexpr int TITLE_C_C_POSITION = 80;
constexpr const char* BG_COLOR = "41526F";
} // namespace Defaults::Title
// --- TITLE ---
namespace Title {
constexpr int PRESS_START_POSITION = 180;
constexpr float DURATION_S = 14.0F;
constexpr int ARCADE_EDITION_POSITION = 123;
constexpr int TITLE_C_C_POSITION = 80;
constexpr const char* BG_COLOR = "41526F";
} // namespace Title
namespace Defaults::Background {
constexpr const char* ATTENUATE_COLOR = "FFFFFF00";
} // namespace Defaults::Background
// --- BACKGROUND ---
namespace Background {
constexpr const char* ATTENUATE_COLOR = "FFFFFF00";
}
namespace Defaults::Balloon {
struct BalloonSettings {
float vel;
float grav;
constexpr BalloonSettings(float v, float g)
: vel(v),
grav(g) {}
};
// --- BALLOONS ---
namespace Balloon {
// Configuración de física para cada nivel de globo
struct BalloonSettings {
float vel;
float grav;
constexpr BalloonSettings(float v, float g)
: vel(v),
grav(g) {}
};
constexpr std::array<BalloonSettings, 4> SETTINGS = {{
BalloonSettings(165.0F, 320.0F),
BalloonSettings(222.0F, 360.0F),
BalloonSettings(282.0F, 360.0F),
BalloonSettings(327.0F, 360.0F),
}};
// Valores para deltaTime en segundos: vel en pixels/s, grav en pixels/s² (aceleración)
constexpr std::array<BalloonSettings, 4> SETTINGS = {{
BalloonSettings(165.0F, 320.0F), // Globo 0: vel=165 pixels/s, grav=320 pixels/s²
BalloonSettings(222.0F, 360.0F), // Globo 1: vel=222 pixels/s, grav=360 pixels/s²
BalloonSettings(282.0F, 360.0F), // Globo 2: vel=282 pixels/s, grav=360 pixels/s²
BalloonSettings(327.0F, 360.0F) // Globo 3: vel=327 pixels/s, grav=360 pixels/s²
}};
constexpr std::array<const char*, 4> COLORS = {
"blue",
"orange",
"red",
"green"};
constexpr std::array<const char*, 4> COLORS = {
"blue",
"orange",
"red",
"green"};
constexpr bool BOUNCING_SOUND = false;
} // namespace Defaults::Balloon
constexpr bool BOUNCING_SOUND = false;
} // namespace Balloon
namespace Defaults::Notification {
constexpr Notifier::Position POS_V = Notifier::Position::TOP;
constexpr Notifier::Position POS_H = Notifier::Position::LEFT;
constexpr bool SOUND = false;
constexpr const char* COLOR = "303030";
} // namespace Defaults::Notification
// --- NOTIFICATION ---
namespace Notification {
constexpr Notifier::Position POS_V = Notifier::Position::TOP;
constexpr Notifier::Position POS_H = Notifier::Position::LEFT;
constexpr bool SOUND = false;
constexpr const char* COLOR = "303030";
} // namespace Notification
namespace Defaults::ServiceMenu {
constexpr const char* TITLE_COLOR = "99FF62";
constexpr const char* TEXT_COLOR = "FFFFFF";
constexpr const char* SELECTED_COLOR = "FFDC44";
constexpr const char* BG_COLOR = "000F00F5";
constexpr bool DROP_SHADOW = false;
} // namespace Defaults::ServiceMenu
// --- SERVICE MENU ---
namespace ServiceMenu {
constexpr const char* TITLE_COLOR = "99FF62";
constexpr const char* TEXT_COLOR = "FFFFFF";
constexpr const char* SELECTED_COLOR = "FFDC44";
constexpr const char* BG_COLOR = "000F00F5";
constexpr bool DROP_SHADOW = false;
namespace Defaults::ServiceMenu::WindowMessage {
constexpr const char* BG_COLOR = "141E32F0";
constexpr const char* BORDER_COLOR = "6496C8FF";
constexpr const char* TITLE_COLOR = "6496C8FF";
constexpr const char* TEXT_COLOR = "DCDCDCFF";
constexpr float PADDING = 15.0F;
constexpr float LINE_SPACING = 5.0F;
constexpr float TITLE_SEPARATOR_SPACING = 10.0F;
constexpr float MIN_WIDTH = 250.0F;
constexpr float MIN_HEIGHT = 32.0F;
constexpr float MAX_WIDTH_RATIO = 0.8F;
constexpr float MAX_HEIGHT_RATIO = 0.8F;
constexpr float TEXT_SAFETY_MARGIN = 15.0F;
constexpr float ANIMATION_DURATION = 0.3F;
} // namespace Defaults::ServiceMenu::WindowMessage
// WindowMessage defaults
namespace WindowMessage {
constexpr const char* BG_COLOR = "141E32F0"; // Color(20, 30, 50, 240)
constexpr const char* BORDER_COLOR = "6496C8FF"; // Color(100, 150, 200, 255)
constexpr const char* TITLE_COLOR = "6496C8FF"; // Color(100, 150, 200, 255)
constexpr const char* TEXT_COLOR = "DCDCDCFF"; // Color(220, 220, 220, 255)
constexpr float PADDING = 15.0F;
constexpr float LINE_SPACING = 5.0F;
constexpr float TITLE_SEPARATOR_SPACING = 10.0F; // Cambiado a float
constexpr float MIN_WIDTH = 250.0F;
constexpr float MIN_HEIGHT = 32.0F; // Cambiado a float
constexpr float MAX_WIDTH_RATIO = 0.8F; // Nuevo
constexpr float MAX_HEIGHT_RATIO = 0.8F; // Nuevo
constexpr float TEXT_SAFETY_MARGIN = 15.0F;
constexpr float ANIMATION_DURATION = 0.3F;
} // namespace WindowMessage
} // namespace ServiceMenu
namespace Defaults::Intro {
constexpr const char* BG_COLOR = "4664BD";
constexpr const char* CARD_COLOR = "CBDBFC";
constexpr const char* SHADOW_COLOR = "00000080";
constexpr int TEXT_DISTANCE_FROM_BOTTOM = 48;
} // namespace Defaults::Intro
// --- INTRO ---
namespace Intro {
constexpr const char* BG_COLOR = "4664BD";
constexpr const char* CARD_COLOR = "CBDBFC";
constexpr const char* SHADOW_COLOR = "00000080";
constexpr int TEXT_DISTANCE_FROM_BOTTOM = 48;
} // namespace Intro
namespace Defaults::Debug {
constexpr const char* COLOR = "00FFFF";
} // namespace Defaults::Debug
// --- DEBUG ---
namespace Debug {
constexpr const char* COLOR = "00FFFF";
}
namespace Defaults::Resource {
constexpr const char* COLOR = "FFFFFF";
} // namespace Defaults::Resource
// --- RESOURCE ---
namespace Resource {
constexpr const char* COLOR = "FFFFFF";
}
namespace Defaults::Tabe {
constexpr float MIN_SPAWN_TIME = 2.0F;
constexpr float MAX_SPAWN_TIME = 3.0F;
} // namespace Defaults::Tabe
// --- TABE ---
namespace Tabe {
constexpr float MIN_SPAWN_TIME = 2.0F;
constexpr float MAX_SPAWN_TIME = 3.0F;
} // namespace Tabe
namespace Defaults::Player::DefaultShirt {
constexpr const char* PLAYER0_DARKEST = "028ECFFF";
constexpr const char* PLAYER0_DARK = "0297DBFF";
constexpr const char* PLAYER0_BASE = "029FE8FF";
constexpr const char* PLAYER0_LIGHT = "03A9F4FF";
// --- PLAYER ---
namespace Player {
namespace DefaultShirt {
// Player 0 (Jugador 1)
constexpr const char* PLAYER0_DARKEST = "028ECFFF"; // 2, 142, 207, 255
constexpr const char* PLAYER0_DARK = "0297DBFF"; // 2, 151, 219, 255
constexpr const char* PLAYER0_BASE = "029FE8FF"; // 2, 159, 232, 255
constexpr const char* PLAYER0_LIGHT = "03A9F4FF"; // 3, 169, 244, 255
constexpr const char* PLAYER1_DARKEST = "8E8E8EFF";
constexpr const char* PLAYER1_DARK = "AEADADFF";
constexpr const char* PLAYER1_BASE = "E4E4E4FF";
constexpr const char* PLAYER1_LIGHT = "F7F1F1FF";
} // namespace Defaults::Player::DefaultShirt
// Player 1 (Jugador 2)
constexpr const char* PLAYER1_DARKEST = "8E8E8EFF"; // 142, 142, 142, 255
constexpr const char* PLAYER1_DARK = "AEADADFF"; // 174, 173, 173, 255
constexpr const char* PLAYER1_BASE = "E4E4E4FF"; // 228, 228, 228, 255
constexpr const char* PLAYER1_LIGHT = "F7F1F1FF"; // 247, 241, 241, 255
} // namespace DefaultShirt
namespace Defaults::Player::OneCoffeeShirt {
constexpr const char* PLAYER0_DARKEST = "3D9C70FF";
constexpr const char* PLAYER0_DARK = "4FA370FF";
constexpr const char* PLAYER0_BASE = "5DDE70FF";
constexpr const char* PLAYER0_LIGHT = "7DF25CFF";
namespace OneCoffeeShirt {
// Player 0 (Jugador 1)
constexpr const char* PLAYER0_DARKEST = "3D9C70FF"; // 61, 156, 112, 255
constexpr const char* PLAYER0_DARK = "4FA370FF"; // 79, 163, 112, 255
constexpr const char* PLAYER0_BASE = "5DDE70FF"; // 93, 222, 112, 255
constexpr const char* PLAYER0_LIGHT = "7DF25CFF"; // 125, 242, 92, 255
constexpr const char* PLAYER1_DARKEST = "2E8B57FF";
constexpr const char* PLAYER1_DARK = "3CB371FF";
constexpr const char* PLAYER1_BASE = "48D181FF";
constexpr const char* PLAYER1_LIGHT = "55EF8DFF";
} // namespace Defaults::Player::OneCoffeeShirt
// Player 1 (Jugador 2)
constexpr const char* PLAYER1_DARKEST = "2E8B57FF"; // 46, 139, 87, 255
constexpr const char* PLAYER1_DARK = "3CB371FF"; // 60, 179, 113, 255
constexpr const char* PLAYER1_BASE = "48D181FF"; // 72, 209, 129, 255
constexpr const char* PLAYER1_LIGHT = "55EF8DFF"; // 85, 239, 141, 255
} // namespace OneCoffeeShirt
namespace Defaults::Player::TwoCoffeeShirt {
constexpr const char* PLAYER0_DARKEST = "D6A41AFF";
constexpr const char* PLAYER0_DARK = "E3AE1BFF";
constexpr const char* PLAYER0_BASE = "EFB71DFF";
constexpr const char* PLAYER0_LIGHT = "FCC11EFF";
namespace TwoCoffeeShirt {
// Player 0 (Jugador 1)
constexpr const char* PLAYER0_DARKEST = "D6A41AFF"; // 214, 164, 26, 255
constexpr const char* PLAYER0_DARK = "E3AE1BFF"; // 227, 174, 27, 255
constexpr const char* PLAYER0_BASE = "EFB71DFF"; // 239, 183, 29, 255
constexpr const char* PLAYER0_LIGHT = "FCC11EFF"; // 252, 193, 30, 255
constexpr const char* PLAYER1_DARKEST = "E08500FF";
constexpr const char* PLAYER1_DARK = "FA7D00FF";
constexpr const char* PLAYER1_BASE = "FAA200FF";
constexpr const char* PLAYER1_LIGHT = "FA8500FF";
} // namespace Defaults::Player::TwoCoffeeShirt
// Player 1 (Jugador 2)
constexpr const char* PLAYER1_DARKEST = "E08500FF"; // 224, 133, 0, 255
constexpr const char* PLAYER1_DARK = "FA7D00FF"; // 250, 125, 0, 255
constexpr const char* PLAYER1_BASE = "FAA200FF"; // 250, 162, 0, 255
constexpr const char* PLAYER1_LIGHT = "FA8500FF"; // 250, 133, 0, 255
} // namespace TwoCoffeeShirt
namespace Defaults::Player::OutlineColor {
constexpr const char* PLAYER0 = "66323FFF";
constexpr const char* PLAYER1 = "422028FF";
} // namespace Defaults::Player::OutlineColor
namespace OutlineColor {
// Player 0 (Jugador 1)
constexpr const char* PLAYER0 = "66323FFF";
namespace Defaults::Window {
constexpr const char* CAPTION = "© 2025 Coffee Crisis Arcade Edition — JailDesigner";
constexpr int ZOOM = 2;
constexpr int MAX_ZOOM = 2;
} // namespace Defaults::Window
// Player 1 (Jugador 2)
constexpr const char* PLAYER1 = "422028FF";
} // namespace OutlineColor
} // namespace Player
namespace Defaults::Video {
constexpr SDL_ScaleMode SCALE_MODE = SDL_ScaleMode::SDL_SCALEMODE_NEAREST;
constexpr bool FULLSCREEN = false;
constexpr bool VSYNC = true;
constexpr bool INTEGER_SCALE = true;
constexpr bool POSTFX = false;
constexpr int SUPERSAMPLING = 1;
} // namespace Defaults::Video
// --- OPTIONS ---
namespace Options {
// Window
constexpr const char* WINDOW_CAPTION = "© 2025 Coffee Crisis Arcade Edition — JailDesigner";
constexpr int WINDOW_ZOOM = 2;
constexpr int WINDOW_MAX_ZOOM = 2;
namespace Defaults::Music {
constexpr bool ENABLED = true;
constexpr int VOLUME = 100;
} // namespace Defaults::Music
// Video
constexpr SDL_ScaleMode VIDEO_SCALE_MODE = SDL_ScaleMode::SDL_SCALEMODE_NEAREST;
constexpr bool VIDEO_FULLSCREEN = false;
constexpr bool VIDEO_VSYNC = true;
constexpr bool VIDEO_INTEGER_SCALE = true;
constexpr bool VIDEO_POSTFX = false;
constexpr int VIDEO_SUPERSAMPLING = 1; // 1 = off, 2 = 2×, 3 = 3× SS
namespace Defaults::Sound {
constexpr bool ENABLED = true;
constexpr int VOLUME = 100;
} // namespace Defaults::Sound
// Music
constexpr bool MUSIC_ENABLED = true;
constexpr int MUSIC_VOLUME = 100;
namespace Defaults::Audio {
constexpr bool ENABLED = true;
constexpr int VOLUME = 100;
} // namespace Defaults::Audio
// Sound
constexpr bool SOUND_ENABLED = true;
constexpr int SOUND_VOLUME = 100;
// Audio
constexpr bool AUDIO_ENABLED = true;
constexpr int AUDIO_VOLUME = 100;
// Settings
constexpr bool SETTINGS_AUTOFIRE = true;
constexpr bool SETTINGS_SHUTDOWN_ENABLED = false;
constexpr const char* PARAMS_FILE = "param_320x256.txt";
} // namespace Options
} // namespace GameDefaults
namespace Defaults::Settings {
constexpr bool AUTOFIRE = true;
constexpr bool SHUTDOWN_ENABLED = false;
constexpr const char* PARAMS_FILE = "param_320x256.txt";
} // namespace Defaults::Settings