fix ServiceMenu: al canviar el idioma recarrega les opcions
This commit is contained in:
@@ -626,6 +626,7 @@ void Director::runInit()
|
|||||||
{
|
{
|
||||||
Resource::get()->reload();
|
Resource::get()->reload();
|
||||||
}
|
}
|
||||||
|
ServiceMenu::get()->reset();
|
||||||
section::name = section::Name::LOGO;
|
section::name = section::Name::LOGO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,16 +30,15 @@ ServiceMenu::ServiceMenu()
|
|||||||
current_settings_group_(SettingsGroup::MAIN),
|
current_settings_group_(SettingsGroup::MAIN),
|
||||||
previous_settings_group_(current_settings_group_)
|
previous_settings_group_(current_settings_group_)
|
||||||
{
|
{
|
||||||
initializeOptions();
|
reset();
|
||||||
setAnchors();
|
|
||||||
updateMenu(current_settings_group_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Alterna la visibilidad del menú de servicio
|
// Alterna la visibilidad del menú de servicio
|
||||||
void ServiceMenu::toggle()
|
void ServiceMenu::toggle()
|
||||||
{
|
{
|
||||||
enabled_ = !enabled_;
|
enabled_ = !enabled_;
|
||||||
reset();
|
if (!enabled_)
|
||||||
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dibuja el menú de servicio en pantalla
|
// Dibuja el menú de servicio en pantalla
|
||||||
@@ -255,6 +254,8 @@ void ServiceMenu::moveBack()
|
|||||||
// Inicializa todas las opciones del menú de servicio
|
// Inicializa todas las opciones del menú de servicio
|
||||||
void ServiceMenu::initializeOptions()
|
void ServiceMenu::initializeOptions()
|
||||||
{
|
{
|
||||||
|
options_.clear();
|
||||||
|
|
||||||
// Video
|
// Video
|
||||||
options_.emplace_back(lang::getText("[SERVICE_MENU] FULLSCREEN"), SettingsGroup::VIDEO, OptionBehavior::ADJUST, &options.video.fullscreen, ValueType::BOOL);
|
options_.emplace_back(lang::getText("[SERVICE_MENU] FULLSCREEN"), SettingsGroup::VIDEO, OptionBehavior::ADJUST, &options.video.fullscreen, ValueType::BOOL);
|
||||||
options_.emplace_back(lang::getText("[SERVICE_MENU] WINDOW_SIZE"), SettingsGroup::VIDEO, OptionBehavior::ADJUST, &options.window.size, ValueType::INT, 1, options.window.max_size, 1);
|
options_.emplace_back(lang::getText("[SERVICE_MENU] WINDOW_SIZE"), SettingsGroup::VIDEO, OptionBehavior::ADJUST, &options.window.size, ValueType::INT, 1, options.window.max_size, 1);
|
||||||
@@ -345,6 +346,8 @@ void ServiceMenu::reset()
|
|||||||
{
|
{
|
||||||
selected_ = 0;
|
selected_ = 0;
|
||||||
previous_settings_group_ = current_settings_group_ = SettingsGroup::MAIN;
|
previous_settings_group_ = current_settings_group_ = SettingsGroup::MAIN;
|
||||||
|
initializeOptions();
|
||||||
|
setAnchors();
|
||||||
updateMenu(current_settings_group_);
|
updateMenu(current_settings_group_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public:
|
|||||||
void toggle(); // Muestra u oculta el menú de servicio
|
void toggle(); // Muestra u oculta el menú de servicio
|
||||||
void render(); // Dibuja el menú de servicio en pantalla
|
void render(); // Dibuja el menú de servicio en pantalla
|
||||||
void update(); // Actualiza el estado del menú de servicio
|
void update(); // Actualiza el estado del menú de servicio
|
||||||
|
void reset(); // Reinicia el menú al estado inicial
|
||||||
|
|
||||||
// --- Métodos de control de navegación ---
|
// --- Métodos de control de navegación ---
|
||||||
void setSelectorUp(); // Mueve el selector hacia arriba
|
void setSelectorUp(); // Mueve el selector hacia arriba
|
||||||
@@ -176,7 +177,6 @@ private:
|
|||||||
// --- Métodos internos: Lógica de menú ---
|
// --- Métodos internos: Lógica de menú ---
|
||||||
void applySettings(SettingsGroup group); // Aplica la configuración de un grupo
|
void applySettings(SettingsGroup group); // Aplica la configuración de un grupo
|
||||||
void updateMenu(SettingsGroup group); // Actualiza las opciones mostradas según el grupo
|
void updateMenu(SettingsGroup group); // Actualiza las opciones mostradas según el grupo
|
||||||
void reset(); // Reinicia el menú al estado inicial
|
|
||||||
|
|
||||||
// --- Métodos internos: Utilidades ---
|
// --- Métodos internos: Utilidades ---
|
||||||
void updateCounter(); // Actualiza el contador interno
|
void updateCounter(); // Actualiza el contador interno
|
||||||
|
|||||||
Reference in New Issue
Block a user