ServiceMenu: afegida memoria per al menu principal
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Options
|
|||||||
{
|
{
|
||||||
// --- Variables globales ---
|
// --- Variables globales ---
|
||||||
WindowOptions window; // Opciones de la ventana
|
WindowOptions window; // Opciones de la ventana
|
||||||
SettingsOptions settings; // Opciones del juego
|
SettingsOptions settings; // Opciones del juego
|
||||||
VideoOptions video; // Opciones de vídeo
|
VideoOptions video; // Opciones de vídeo
|
||||||
AudioOptions audio; // Opciones de audio
|
AudioOptions audio; // Opciones de audio
|
||||||
std::vector<GamepadOptions> controllers; // Opciones de mando para cada jugador
|
std::vector<GamepadOptions> controllers; // Opciones de mando para cada jugador
|
||||||
@@ -109,8 +109,7 @@ namespace Options
|
|||||||
// El fichero no existe
|
// El fichero no existe
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Crea el fichero con los valores por defecto
|
saveToFile(); // Crea el fichero con los valores por defecto
|
||||||
saveToFile();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Normaliza los valores
|
// Normaliza los valores
|
||||||
|
|||||||
@@ -286,9 +286,11 @@ void ServiceMenu::adjustOption(bool adjust_up)
|
|||||||
void ServiceMenu::selectOption()
|
void ServiceMenu::selectOption()
|
||||||
{
|
{
|
||||||
if (display_options_.empty() || selected_ >= display_options_.size())
|
if (display_options_.empty() || selected_ >= display_options_.size())
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
// Si estamos en el menú principal, guarda la selección actual
|
||||||
|
if (current_settings_group_ == SettingsGroup::MAIN)
|
||||||
|
main_menu_selected_ = selected_;
|
||||||
|
|
||||||
// Carpeta
|
// Carpeta
|
||||||
if (display_options_.at(selected_)->type == ValueType::FOLDER)
|
if (display_options_.at(selected_)->type == ValueType::FOLDER)
|
||||||
@@ -338,7 +340,12 @@ void ServiceMenu::moveBack()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
selected_ = 0;
|
// Si vamos a volver al menú principal, restaura la selección guardada
|
||||||
|
if (previous_settings_group_ == SettingsGroup::MAIN)
|
||||||
|
selected_ = main_menu_selected_;
|
||||||
|
else
|
||||||
|
selected_ = 0;
|
||||||
|
|
||||||
current_settings_group_ = previous_settings_group_;
|
current_settings_group_ = previous_settings_group_;
|
||||||
updateMenu(current_settings_group_);
|
updateMenu(current_settings_group_);
|
||||||
setOptionsPosition();
|
setOptionsPosition();
|
||||||
@@ -587,16 +594,16 @@ std::string ServiceMenu::settingsGroupToString(SettingsGroup group) const
|
|||||||
switch (group)
|
switch (group)
|
||||||
{
|
{
|
||||||
case SettingsGroup::MAIN:
|
case SettingsGroup::MAIN:
|
||||||
return Lang::getText("[SERVICE_MENU] TITLE");
|
return Lang::getText("[SERVICE_MENU] TITLE");
|
||||||
case SettingsGroup::VIDEO:
|
case SettingsGroup::VIDEO:
|
||||||
return Lang::getText("[SERVICE_MENU] VIDEO");
|
return Lang::getText("[SERVICE_MENU] VIDEO");
|
||||||
case SettingsGroup::AUDIO:
|
case SettingsGroup::AUDIO:
|
||||||
return Lang::getText("[SERVICE_MENU] AUDIO");
|
return Lang::getText("[SERVICE_MENU] AUDIO");
|
||||||
case SettingsGroup::SETTINGS:
|
case SettingsGroup::SETTINGS:
|
||||||
return Lang::getText("[SERVICE_MENU] SETTINGS");
|
return Lang::getText("[SERVICE_MENU] SETTINGS");
|
||||||
case SettingsGroup::SYSTEM:
|
case SettingsGroup::SYSTEM:
|
||||||
return Lang::getText("[SERVICE_MENU] SYSTEM");
|
return Lang::getText("[SERVICE_MENU] SYSTEM");
|
||||||
default:
|
default:
|
||||||
return Lang::getText("[SERVICE_MENU] TITLE");
|
return Lang::getText("[SERVICE_MENU] TITLE");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -191,6 +191,7 @@ private:
|
|||||||
SettingsGroup previous_settings_group_; // Grupo de opciones anterior
|
SettingsGroup previous_settings_group_; // Grupo de opciones anterior
|
||||||
Aspect aspect_ = Aspect::ASPECT1; // Estilo visual del menú
|
Aspect aspect_ = Aspect::ASPECT1; // Estilo visual del menú
|
||||||
std::string title_; // Titulo a mostrar en el menu
|
std::string title_; // Titulo a mostrar en el menu
|
||||||
|
size_t main_menu_selected_ = 0; // Recuerda la selección del menú principal
|
||||||
|
|
||||||
// --- Variables de aspecto ---
|
// --- Variables de aspecto ---
|
||||||
Color bg_color_ = SERV_MENU_BG_COLOR; // Color de fondo
|
Color bg_color_ = SERV_MENU_BG_COLOR; // Color de fondo
|
||||||
|
|||||||
Reference in New Issue
Block a user