afagit a param el color de la camiseta per defecte
This commit is contained in:
@@ -110,6 +110,18 @@ tabe.min_spawn_time 2.0f # Tiempo mínimo en minutos para que aparezca el Tabe
|
||||
tabe.max_spawn_time 3.0f # Tiempo máximo en minutos para que aparezca el Tabe
|
||||
|
||||
# --- PLAYER ---
|
||||
# Jugador 1 - Camiseta por defecto
|
||||
player.default_shirt[0].darkest 028ECFFF # Tono más oscuro - bordes y contornos (Jugador 1, por defecto)
|
||||
player.default_shirt[0].dark 0297DBFF # Tono oscuro - sombras (Jugador 1, por defecto)
|
||||
player.default_shirt[0].base 029FE8FF # Tono principal - color base (Jugador 1, por defecto)
|
||||
player.default_shirt[0].light 03A9F4FF # Tono claro - zonas iluminadas (Jugador 1, por defecto)
|
||||
|
||||
# Jugador 2 - Camiseta por defecto
|
||||
player.default_shirt[1].darkest 8E8E8EFF # Tono más oscuro - bordes y contornos (Jugador 2, por defecto)
|
||||
player.default_shirt[1].dark AEADADFF # Tono oscuro - sombras (Jugador 2, por defecto)
|
||||
player.default_shirt[1].base E4E4E4FF # Tono principal - color base (Jugador 2, por defecto)
|
||||
player.default_shirt[1].light F7F1F1FF # Tono claro - zonas iluminadas (Jugador 2, por defecto)
|
||||
|
||||
# Jugador 1 - Camiseta con 1 café
|
||||
player.one_coffee_shirt[0].darkest 3D9C70FF # Tono más oscuro - bordes y contornos (Jugador 1, 1 café)
|
||||
player.one_coffee_shirt[0].dark 4FA370FF # Tono oscuro - sombras (Jugador 1, 1 café)
|
||||
|
||||
@@ -109,6 +109,18 @@ tabe.min_spawn_time 2.0f # Tiempo mínimo en segundos para que aparezca el Ta
|
||||
tabe.max_spawn_time 3.0f # Tiempo máximo en segundos para que aparezca el Tabe
|
||||
|
||||
# --- PLAYER ---
|
||||
# Jugador 1 - Camiseta por defecto
|
||||
player.default_shirt[0].darkest 028ECFFF # Tono más oscuro - bordes y contornos (Jugador 1, por defecto)
|
||||
player.default_shirt[0].dark 0297DBFF # Tono oscuro - sombras (Jugador 1, por defecto)
|
||||
player.default_shirt[0].base 000000FF # Tono principal - color base (Jugador 1, por defecto)
|
||||
player.default_shirt[0].light 03A9F4FF # Tono claro - zonas iluminadas (Jugador 1, por defecto)
|
||||
|
||||
# Jugador 2 - Camiseta por defecto
|
||||
player.default_shirt[1].darkest 8E8E8EFF # Tono más oscuro - bordes y contornos (Jugador 2, por defecto)
|
||||
player.default_shirt[1].dark AEADADFF # Tono oscuro - sombras (Jugador 2, por defecto)
|
||||
player.default_shirt[1].base E4E4E4FF # Tono principal - color base (Jugador 2, por defecto)
|
||||
player.default_shirt[1].light F7F1F1FF # Tono claro - zonas iluminadas (Jugador 2, por defecto)
|
||||
|
||||
# Jugador 1 - Camiseta con 1 café
|
||||
player.one_coffee_shirt[0].darkest 3D9C70FF # Tono más oscuro - bordes y contornos (Jugador 1, 1 café)
|
||||
player.one_coffee_shirt[0].dark 4FA370FF # Tono oscuro - sombras (Jugador 1, 1 café)
|
||||
|
||||
@@ -149,6 +149,20 @@ constexpr float MAX_SPAWN_TIME = 3.0F;
|
||||
|
||||
// --- 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
|
||||
|
||||
// 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 OneCoffeeShirt {
|
||||
// Player 0 (Jugador 1)
|
||||
constexpr const char* PLAYER0_DARKEST = "3D9C70FF"; // 61, 156, 112, 255
|
||||
|
||||
@@ -136,6 +136,14 @@ auto setParams(const std::string& var, const std::string& value) -> bool {
|
||||
{"intro.shadow_color", [](const std::string& v) { param.intro.shadow_color = Color::fromHex(v); }},
|
||||
{"debug.color", [](const std::string& v) { param.debug.color = Color::fromHex(v); }},
|
||||
{"resource.color", [](const std::string& v) { param.resource.color = Color::fromHex(v); }},
|
||||
{"player.default_shirt[0].darkest", [](const std::string& v) { param.player.default_shirt[0].darkest = Color::fromHex(v); }},
|
||||
{"player.default_shirt[0].dark", [](const std::string& v) { param.player.default_shirt[0].dark = Color::fromHex(v); }},
|
||||
{"player.default_shirt[0].base", [](const std::string& v) { param.player.default_shirt[0].base = Color::fromHex(v); }},
|
||||
{"player.default_shirt[0].light", [](const std::string& v) { param.player.default_shirt[0].light = Color::fromHex(v); }},
|
||||
{"player.default_shirt[1].darkest", [](const std::string& v) { param.player.default_shirt[1].darkest = Color::fromHex(v); }},
|
||||
{"player.default_shirt[1].dark", [](const std::string& v) { param.player.default_shirt[1].dark = Color::fromHex(v); }},
|
||||
{"player.default_shirt[1].base", [](const std::string& v) { param.player.default_shirt[1].base = Color::fromHex(v); }},
|
||||
{"player.default_shirt[1].light", [](const std::string& v) { param.player.default_shirt[1].light = Color::fromHex(v); }},
|
||||
{"player.one_coffee_shirt[0].darkest", [](const std::string& v) { param.player.one_coffee_shirt[0].darkest = Color::fromHex(v); }},
|
||||
{"player.one_coffee_shirt[0].dark", [](const std::string& v) { param.player.one_coffee_shirt[0].dark = Color::fromHex(v); }},
|
||||
{"player.one_coffee_shirt[0].base", [](const std::string& v) { param.player.one_coffee_shirt[0].base = Color::fromHex(v); }},
|
||||
|
||||
@@ -168,6 +168,20 @@ struct ParamPlayer {
|
||||
};
|
||||
|
||||
// Inicialización con valores por defecto
|
||||
const Shirt default_player0_shirt = Shirt(
|
||||
Color::fromHex(GameDefaults::Player::DefaultShirt::PLAYER0_DARKEST),
|
||||
Color::fromHex(GameDefaults::Player::DefaultShirt::PLAYER0_DARK),
|
||||
Color::fromHex(GameDefaults::Player::DefaultShirt::PLAYER0_BASE),
|
||||
Color::fromHex(GameDefaults::Player::DefaultShirt::PLAYER0_LIGHT));
|
||||
|
||||
const Shirt default_player1_shirt = Shirt(
|
||||
Color::fromHex(GameDefaults::Player::DefaultShirt::PLAYER1_DARKEST),
|
||||
Color::fromHex(GameDefaults::Player::DefaultShirt::PLAYER1_DARK),
|
||||
Color::fromHex(GameDefaults::Player::DefaultShirt::PLAYER1_BASE),
|
||||
Color::fromHex(GameDefaults::Player::DefaultShirt::PLAYER1_LIGHT));
|
||||
|
||||
std::array<Shirt, 2> default_shirt = {default_player0_shirt, default_player1_shirt};
|
||||
|
||||
const Shirt one_coffee_player0_shirt = Shirt(
|
||||
Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER0_DARKEST),
|
||||
Color::fromHex(GameDefaults::Player::OneCoffeeShirt::PLAYER0_DARK),
|
||||
|
||||
@@ -554,49 +554,52 @@ void Resource::createPlayerTextures() {
|
||||
}
|
||||
}
|
||||
|
||||
// Crear variante con paleta original (pal0) - usar la textura ya cargada
|
||||
auto base_texture = getTexture(player.base_texture);
|
||||
// Crear las 4 texturas con sus respectivas paletas
|
||||
for (int palette_idx = 0; palette_idx < 4; ++palette_idx) {
|
||||
std::shared_ptr<Texture> texture;
|
||||
|
||||
base_texture->setPaletteColor(0, 56, param.player.outline_color[player_idx].TO_UINT32());
|
||||
base_texture->setPalette(0);
|
||||
|
||||
|
||||
std::string pal0_name = player.name_prefix + "_pal0";
|
||||
textures_.emplace_back(pal0_name, base_texture);
|
||||
printWithDots("Player Texture : ", pal0_name, "[ DONE ]");
|
||||
|
||||
// Crear variantes con paletas adicionales - CADA UNA DESDE EL ARCHIVO
|
||||
for (size_t i = 0; i < player.palette_files.size(); ++i) {
|
||||
// Crear textura completamente nueva desde el archivo
|
||||
auto texture_copy = std::make_shared<Texture>(Screen::get()->getRenderer(), texture_file_path);
|
||||
if (palette_idx == 0) {
|
||||
// Textura 0 - usar la ya cargada y modificar solo paleta 0 (default_shirt)
|
||||
texture = getTexture(player.base_texture);
|
||||
texture->setPaletteColor(0, 16, param.player.default_shirt[player_idx].darkest.TO_UINT32());
|
||||
texture->setPaletteColor(0, 17, param.player.default_shirt[player_idx].dark.TO_UINT32());
|
||||
texture->setPaletteColor(0, 18, param.player.default_shirt[player_idx].base.TO_UINT32());
|
||||
texture->setPaletteColor(0, 19, param.player.default_shirt[player_idx].light.TO_UINT32());
|
||||
texture->setPaletteColor(0, 56, param.player.outline_color[player_idx].TO_UINT32());
|
||||
} else {
|
||||
// Crear textura nueva desde archivo
|
||||
texture = std::make_shared<Texture>(Screen::get()->getRenderer(), texture_file_path);
|
||||
|
||||
// Añadir todas las paletas
|
||||
texture_copy->addPaletteFromPalFile(Asset::get()->get(player.palette_files[0]));
|
||||
texture_copy->addPaletteFromPalFile(Asset::get()->get(player.palette_files[1]));
|
||||
texture_copy->addPaletteFromPalFile(Asset::get()->get(player.palette_files[2]));
|
||||
texture->addPaletteFromPalFile(Asset::get()->get(player.palette_files[0]));
|
||||
texture->addPaletteFromPalFile(Asset::get()->get(player.palette_files[1]));
|
||||
texture->addPaletteFromPalFile(Asset::get()->get(player.palette_files[2]));
|
||||
|
||||
// Modifica los colores de las camisetas
|
||||
texture_copy->setPaletteColor(1, 16, param.player.one_coffee_shirt[player_idx].darkest.TO_UINT32());
|
||||
texture_copy->setPaletteColor(1, 17, param.player.one_coffee_shirt[player_idx].dark.TO_UINT32());
|
||||
texture_copy->setPaletteColor(1, 18, param.player.one_coffee_shirt[player_idx].base.TO_UINT32());
|
||||
texture_copy->setPaletteColor(1, 19, param.player.one_coffee_shirt[player_idx].light.TO_UINT32());
|
||||
if (palette_idx == 1) {
|
||||
// Textura 1 - modificar solo paleta 1 (one_coffee_shirt)
|
||||
texture->setPaletteColor(1, 16, param.player.one_coffee_shirt[player_idx].darkest.TO_UINT32());
|
||||
texture->setPaletteColor(1, 17, param.player.one_coffee_shirt[player_idx].dark.TO_UINT32());
|
||||
texture->setPaletteColor(1, 18, param.player.one_coffee_shirt[player_idx].base.TO_UINT32());
|
||||
texture->setPaletteColor(1, 19, param.player.one_coffee_shirt[player_idx].light.TO_UINT32());
|
||||
texture->setPaletteColor(1, 56, param.player.outline_color[player_idx].TO_UINT32());
|
||||
} else if (palette_idx == 2) {
|
||||
// Textura 2 - modificar solo paleta 2 (two_coffee_shirt)
|
||||
texture->setPaletteColor(2, 16, param.player.two_coffee_shirt[player_idx].darkest.TO_UINT32());
|
||||
texture->setPaletteColor(2, 17, param.player.two_coffee_shirt[player_idx].dark.TO_UINT32());
|
||||
texture->setPaletteColor(2, 18, param.player.two_coffee_shirt[player_idx].base.TO_UINT32());
|
||||
texture->setPaletteColor(2, 19, param.player.two_coffee_shirt[player_idx].light.TO_UINT32());
|
||||
texture->setPaletteColor(2, 56, param.player.outline_color[player_idx].TO_UINT32());
|
||||
}
|
||||
// Textura 3 (palette_idx == 3) - no modificar nada, usar colores originales
|
||||
}
|
||||
|
||||
texture_copy->setPaletteColor(2, 16, param.player.two_coffee_shirt[player_idx].darkest.TO_UINT32());
|
||||
texture_copy->setPaletteColor(2, 17, param.player.two_coffee_shirt[player_idx].dark.TO_UINT32());
|
||||
texture_copy->setPaletteColor(2, 18, param.player.two_coffee_shirt[player_idx].base.TO_UINT32());
|
||||
texture_copy->setPaletteColor(2, 19, param.player.two_coffee_shirt[player_idx].light.TO_UINT32());
|
||||
|
||||
// Modifica el color del outline
|
||||
texture_copy->setPaletteColor(1, 56, param.player.outline_color[player_idx].TO_UINT32());
|
||||
texture_copy->setPaletteColor(2, 56, param.player.outline_color[player_idx].TO_UINT32());
|
||||
|
||||
// Cambiar a la paleta específica (índice i+1 porque 0 es la original)
|
||||
texture_copy->setPalette(i + 1);
|
||||
// Asignar la paleta correspondiente
|
||||
texture->setPalette(palette_idx);
|
||||
|
||||
// Guardar con nombre específico
|
||||
std::string variant_name = player.name_prefix + "_pal" + std::to_string(i + 1);
|
||||
textures_.emplace_back(variant_name, texture_copy);
|
||||
printWithDots("Player Texture : ", variant_name, "[ DONE ]");
|
||||
std::string texture_name = player.name_prefix + "_pal" + std::to_string(palette_idx);
|
||||
textures_.emplace_back(texture_name, texture);
|
||||
printWithDots("Player Texture : ", texture_name, "[ DONE ]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user