Add: Reglas DEMO/LOGO - PNG_SHAPE exclusivo y temas aleatorios
Implementa restricciones para modos DEMO y LOGO garantizando que PNG_SHAPE sea exclusivo del modo LOGO y nunca aparezca en DEMO/DEMO_LITE. ## Cambios en Modo LOGO (enterLogoMode) **Textura:** - Cambiado de "tiny" a "small" como textura obligatoria **Tema aleatorio:** - Antes: Siempre MONOCHROME (tema 5) - Ahora: Selección aleatoria entre 4 temas: - MONOCHROME (5) - LAVENDER (6) - CRIMSON (7) - ESMERALDA (8) **Comportamiento:** - No cambia de tema automáticamente durante ejecución - Mantiene tema seleccionado hasta salir del modo ## Cambios en Transición LOGO → DEMO **exitLogoMode (automático):** - Al volver automáticamente a DEMO desde LOGO - Si figura activa es PNG_SHAPE → cambia a figura aleatoria válida - Excluye PNG_SHAPE de selección (8 figuras disponibles) **randomizeOnDemoStart (manual):** - Al entrar manualmente a DEMO/DEMO_LITE con tecla D/L - Check inicial: si current_shape_type_ == PNG_SHAPE - Fuerza cambio a figura aleatoria antes de randomización - Soluciona bug: D → DEMO → K → LOGO → D dejaba PNG_SHAPE activa ## Garantías Implementadas ✅ PNG_SHAPE nunca aparece en acciones aleatorias de DEMO/DEMO_LITE ✅ PNG_SHAPE se cambia automáticamente al salir de LOGO (manual o auto) ✅ Modo LOGO elige tema aleatorio al entrar (4 opciones monocromáticas) ✅ Modo LOGO usa textura SMALL en lugar de TINY ## Flujos Verificados - Manual: DEMO → LOGO → DEMO (tecla D) ✅ - Manual: DEMO_LITE → LOGO → DEMO_LITE (tecla L) ✅ - Automático: DEMO → LOGO → DEMO (5% probabilidad) ✅ - Dentro DEMO: PNG_SHAPE nunca seleccionada ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1831,6 +1831,15 @@ void Engine::performDemoAction(bool is_lite) {
|
|||||||
|
|
||||||
// Randomizar todo al iniciar modo DEMO
|
// Randomizar todo al iniciar modo DEMO
|
||||||
void Engine::randomizeOnDemoStart(bool is_lite) {
|
void Engine::randomizeOnDemoStart(bool is_lite) {
|
||||||
|
// Si venimos de LOGO con PNG_SHAPE, cambiar figura obligatoriamente
|
||||||
|
// PNG_SHAPE es exclusivo del modo LOGO y no debe aparecer en DEMO/DEMO_LITE
|
||||||
|
if (current_shape_type_ == ShapeType::PNG_SHAPE) {
|
||||||
|
ShapeType shapes[] = {ShapeType::SPHERE, ShapeType::LISSAJOUS, ShapeType::HELIX,
|
||||||
|
ShapeType::TORUS, ShapeType::CUBE, ShapeType::CYLINDER,
|
||||||
|
ShapeType::ICOSAHEDRON, ShapeType::ATOM};
|
||||||
|
activateShape(shapes[rand() % 8]);
|
||||||
|
}
|
||||||
|
|
||||||
if (is_lite) {
|
if (is_lite) {
|
||||||
// DEMO LITE: Solo randomizar física/figura + gravedad
|
// DEMO LITE: Solo randomizar física/figura + gravedad
|
||||||
// Elegir aleatoriamente entre modo física o figura
|
// Elegir aleatoriamente entre modo física o figura
|
||||||
@@ -1932,18 +1941,18 @@ void Engine::enterLogoMode(bool from_demo) {
|
|||||||
logo_previous_texture_index_ = current_texture_index_;
|
logo_previous_texture_index_ = current_texture_index_;
|
||||||
logo_previous_shape_scale_ = shape_scale_factor_;
|
logo_previous_shape_scale_ = shape_scale_factor_;
|
||||||
|
|
||||||
// Buscar índice de textura "tiny"
|
// Buscar índice de textura "small"
|
||||||
size_t tiny_index = current_texture_index_; // Por defecto mantener actual
|
size_t small_index = current_texture_index_; // Por defecto mantener actual
|
||||||
for (size_t i = 0; i < texture_names_.size(); i++) {
|
for (size_t i = 0; i < texture_names_.size(); i++) {
|
||||||
if (texture_names_[i] == "tiny") {
|
if (texture_names_[i] == "small") {
|
||||||
tiny_index = i;
|
small_index = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Aplicar configuración fija del Modo Logo
|
// Aplicar configuración fija del Modo Logo
|
||||||
if (tiny_index != current_texture_index_) {
|
if (small_index != current_texture_index_) {
|
||||||
current_texture_index_ = tiny_index;
|
current_texture_index_ = small_index;
|
||||||
int old_size = current_ball_size_;
|
int old_size = current_ball_size_;
|
||||||
current_ball_size_ = textures_[current_texture_index_]->getWidth();
|
current_ball_size_ = textures_[current_texture_index_]->getWidth();
|
||||||
updateBallSizes(old_size, current_ball_size_);
|
updateBallSizes(old_size, current_ball_size_);
|
||||||
@@ -1955,8 +1964,10 @@ void Engine::enterLogoMode(bool from_demo) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cambiar a tema MONOCHROME
|
// Cambiar a tema aleatorio entre: MONOCHROME, LAVENDER, CRIMSON, ESMERALDA
|
||||||
theme_manager_->switchToTheme(5); // MONOCHROME
|
int logo_themes[] = {5, 6, 7, 8}; // MONOCHROME, LAVENDER, CRIMSON, ESMERALDA
|
||||||
|
int random_theme = logo_themes[rand() % 4];
|
||||||
|
theme_manager_->switchToTheme(random_theme);
|
||||||
|
|
||||||
// Establecer escala a 120%
|
// Establecer escala a 120%
|
||||||
shape_scale_factor_ = LOGO_MODE_SHAPE_SCALE;
|
shape_scale_factor_ = LOGO_MODE_SHAPE_SCALE;
|
||||||
@@ -2023,6 +2034,14 @@ void Engine::exitLogoMode(bool return_to_demo) {
|
|||||||
} else {
|
} else {
|
||||||
// Volver al modo previo (DEMO o DEMO_LITE)
|
// Volver al modo previo (DEMO o DEMO_LITE)
|
||||||
setState(previous_app_mode_);
|
setState(previous_app_mode_);
|
||||||
|
|
||||||
|
// Si la figura activa es PNG_SHAPE, cambiar a otra figura aleatoria
|
||||||
|
if (current_shape_type_ == ShapeType::PNG_SHAPE) {
|
||||||
|
ShapeType shapes[] = {ShapeType::SPHERE, ShapeType::LISSAJOUS, ShapeType::HELIX,
|
||||||
|
ShapeType::TORUS, ShapeType::CUBE, ShapeType::CYLINDER,
|
||||||
|
ShapeType::ICOSAHEDRON, ShapeType::ATOM};
|
||||||
|
activateShape(shapes[rand() % 8]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user