Mes colorets
This commit is contained in:
@@ -64,3 +64,14 @@ service_menu.text_color FFFFFF
|
||||
service_menu.selected_color FFDC44
|
||||
service_menu.bg_color 000000F0
|
||||
service_menu.drop_shadow false
|
||||
|
||||
## --- INTRO ---
|
||||
intro.bg_color 000000
|
||||
intro.card_color FFFFFF
|
||||
|
||||
## --- DEBUG ---
|
||||
debug.color 00FFFF
|
||||
|
||||
## --- RESOURCE ---
|
||||
resource.color CDD1CD
|
||||
resource.color 17E97A
|
||||
@@ -64,3 +64,14 @@ service_menu.text_color FFFFFF
|
||||
service_menu.selected_color FFDC44
|
||||
service_menu.bg_color 000000F0
|
||||
service_menu.drop_shadow false
|
||||
|
||||
## --- INTRO ---
|
||||
intro.bg_color 000000
|
||||
intro.card_color 543149
|
||||
|
||||
## --- DEBUG ---
|
||||
debug.color 00FFFF
|
||||
|
||||
## --- RESOURCE ---
|
||||
resource.color CDD1CD
|
||||
resource.color 17E97A
|
||||
@@ -348,7 +348,8 @@ void Intro::initSprites()
|
||||
auto temp = SDL_GetRenderTarget(Screen::get()->getRenderer());
|
||||
shadow_texture->setAsRenderTarget(Screen::get()->getRenderer());
|
||||
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0xFF, 0x00, 0x00, 0xFF);
|
||||
auto color = param.intro.card_color;
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), color.r, color.g, color.b, color.a);
|
||||
SDL_RenderClear(Screen::get()->getRenderer());
|
||||
|
||||
SDL_FRect rect = {BORDER / 2, BORDER / 2, SPRITE_WIDTH, SPRITE_HEIGHT};
|
||||
|
||||
@@ -388,6 +388,29 @@ bool setParams(const std::string &var, const std::string &value)
|
||||
param.service_menu.drop_shadow = stringToBool(value);
|
||||
}
|
||||
|
||||
// INTRO
|
||||
else if (var == "intro.bg_color")
|
||||
{
|
||||
param.intro.bg_color = Color::fromHex(value);
|
||||
}
|
||||
|
||||
else if (var == "intro.card_color")
|
||||
{
|
||||
param.intro.card_color = Color::fromHex(value);
|
||||
}
|
||||
|
||||
// DEBUG
|
||||
else if (var == "debug.color")
|
||||
{
|
||||
param.debug.color = Color::fromHex(value);
|
||||
}
|
||||
|
||||
// RESOURCE
|
||||
else if (var == "resource.color")
|
||||
{
|
||||
param.resource.color = Color::fromHex(value);
|
||||
}
|
||||
|
||||
// RESTO
|
||||
else
|
||||
{
|
||||
|
||||
@@ -91,6 +91,25 @@ struct ParamServiceMenu
|
||||
bool drop_shadow;
|
||||
};
|
||||
|
||||
// --- Parámetros de la intro ---
|
||||
struct ParamIntro
|
||||
{
|
||||
Color bg_color;
|
||||
Color card_color;
|
||||
};
|
||||
|
||||
// --- Parámetros para Debug ---
|
||||
struct ParamDebug
|
||||
{
|
||||
Color color;
|
||||
};
|
||||
|
||||
// --- Parámetros para Resource ---
|
||||
struct ParamResource
|
||||
{
|
||||
Color color;
|
||||
};
|
||||
|
||||
// --- Estructura principal para almacenar todos los parámetros del juego ---
|
||||
struct Param
|
||||
{
|
||||
@@ -102,6 +121,9 @@ struct Param
|
||||
std::vector<ParamBalloon> balloon; // Parámetros de los globos
|
||||
ParamNotification notification; // Parámetros de las notificaciones
|
||||
ParamServiceMenu service_menu; // Parámetros del menú de servicio
|
||||
ParamIntro intro; // Parámetros de la intro
|
||||
ParamDebug debug; // Parámetros para Debug
|
||||
ParamResource resource; // Parámetros para Resource
|
||||
|
||||
// Constructor
|
||||
Param() : game(), fade(), scoreboard(), title(), background(), notification()
|
||||
|
||||
@@ -3,14 +3,15 @@
|
||||
#include <SDL3/SDL.h>
|
||||
#include <algorithm> // Para find_if
|
||||
#include <array>
|
||||
#include <stdexcept> // Para runtime_error
|
||||
#include "asset.h" // Para Asset, AssetType
|
||||
#include <stdexcept> // Para runtime_error
|
||||
#include "asset.h" // Para Asset, AssetType
|
||||
#include "external/jail_audio.h" // Para JA_DeleteMusic, JA_DeleteSound, JA_LoadMusic
|
||||
#include "lang.h" // Para getText
|
||||
#include "screen.h" // Para Screen
|
||||
#include "text.h" // Para Text, loadTextFile
|
||||
struct JA_Music_t; // lines 11-11
|
||||
struct JA_Sound_t; // lines 12-12
|
||||
#include "lang.h" // Para getText
|
||||
#include "screen.h" // Para Screen
|
||||
#include "text.h" // Para Text, loadTextFile
|
||||
#include "param.h"
|
||||
struct JA_Music_t; // lines 11-11
|
||||
struct JA_Sound_t; // lines 12-12
|
||||
|
||||
// Singleton
|
||||
Resource *Resource::instance_ = nullptr;
|
||||
@@ -435,19 +436,22 @@ void Resource::renderProgress()
|
||||
screen->start();
|
||||
screen->clean();
|
||||
|
||||
// Establece el color de dibujo a blanco
|
||||
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
|
||||
auto color = param.resource.color.darken();
|
||||
|
||||
// Dibuja la barra de progreso (marco y barra llena)
|
||||
SDL_RenderRect(renderer, &loading_wired_rect_);
|
||||
// Dibuja el interior de la barra de progreso
|
||||
SDL_SetRenderDrawColor(renderer, param.resource.color.r, param.resource.color.g, param.resource.color.b, param.resource.color.a);
|
||||
SDL_RenderFillRect(renderer, &loading_full_rect_);
|
||||
|
||||
// Dibuja el marco de la barra de progreso
|
||||
SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a);
|
||||
SDL_RenderRect(renderer, &loading_wired_rect_);
|
||||
|
||||
// Escribe el texto de carga encima de la barra
|
||||
loading_text_->write(
|
||||
loading_text_->writeColored(
|
||||
loading_wired_rect_.x,
|
||||
loading_wired_rect_.y - 9,
|
||||
Lang::getText("[RESOURCE] LOADING") + " : " + loading_resource_name_
|
||||
);
|
||||
Lang::getText("[RESOURCE] LOADING") + " : " + loading_resource_name_,
|
||||
param.resource.color);
|
||||
|
||||
// Renderiza el frame en pantalla
|
||||
screen->coreRender();
|
||||
|
||||
@@ -248,11 +248,11 @@ void Screen::renderInfo()
|
||||
if (debug_info_.show)
|
||||
{
|
||||
// Resolution
|
||||
debug_info_.text->writeDX(TEXT_COLOR | TEXT_SHADOW, param.game.width - debug_info_.text->lenght(Options::video.info) - 2, 1, Options::video.info, 1, DEBUG_COLOR, 1, DEBUG_COLOR.darken(150));
|
||||
debug_info_.text->writeDX(TEXT_COLOR | TEXT_STROKE, param.game.width - debug_info_.text->lenght(Options::video.info) - 2, 1, Options::video.info, 1, param.debug.color, 1, param.debug.color.darken(150));
|
||||
|
||||
// FPS
|
||||
const std::string FPS_TEXT = std::to_string(fps_.lastValue) + " FPS";
|
||||
debug_info_.text->writeDX(TEXT_COLOR | TEXT_SHADOW, param.game.width - debug_info_.text->lenght(FPS_TEXT) - 2, 1 + debug_info_.text->getCharacterSize(), FPS_TEXT, 1, DEBUG_COLOR, 1, DEBUG_COLOR.darken(150));
|
||||
debug_info_.text->writeDX(TEXT_COLOR | TEXT_STROKE, param.game.width - debug_info_.text->lenght(FPS_TEXT) - 2, 1 + debug_info_.text->getCharacterSize(), FPS_TEXT, 1, param.debug.color, 1, param.debug.color.darken(150));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -180,8 +180,6 @@ constexpr Color BLUE_SKY_COLOR = Color(0X02, 0X88, 0XD1);
|
||||
constexpr Color PINK_SKY_COLOR = Color(0XFF, 0X6B, 0X97);
|
||||
constexpr Color GREEN_SKY_COLOR = Color(0X00, 0X79, 0X6B);
|
||||
|
||||
constexpr Color DEBUG_COLOR = Color(0xFF, 0xFF, 0x00);
|
||||
|
||||
// Colores y gráficos
|
||||
Color getColorLikeKnightRider(const std::vector<Color> &colors, int counter_);
|
||||
constexpr HSV rgbToHsv(Color color);
|
||||
|
||||
Reference in New Issue
Block a user