@@ -334,6 +334,19 @@ void MenuMode::add_menu_zone(ENUM_MENU_TYPE menu_type){
334334 text_pos.y = surface->h - MENU_ZONE_HEIGHT/2 - text_surface->h /2 - padding_y_from_center_menu_zone*2 ;
335335 SDL_BlitSurface (text_surface, NULL , surface, &text_pos);
336336 break ;
337+ case MENU_TYPE_LAUNCHER:
338+ MENU_DEBUG_PRINTF (" Init MENU_TYPE_LAUNCHER\n " );
339+ // / ------ Text ------
340+ text_surface = TTF_RenderText_Blended (menu_title_font, " SET LAUNCHER" , text_color);
341+ text_pos.x = (surface->w - MENU_ZONE_WIDTH)/2 + (MENU_ZONE_WIDTH - text_surface->w )/2 ;
342+ text_pos.y = surface->h - MENU_ZONE_HEIGHT/2 - text_surface->h /2 - padding_y_from_center_menu_zone*2 ;
343+ SDL_BlitSurface (text_surface, NULL , surface, &text_pos);
344+ // / ------ Text ------
345+ text_surface = TTF_RenderText_Blended (menu_title_font, " GMENU2X" , text_color);
346+ text_pos.x = (surface->w - MENU_ZONE_WIDTH)/2 + (MENU_ZONE_WIDTH - text_surface->w )/2 ;
347+ text_pos.y = surface->h - MENU_ZONE_HEIGHT/2 - text_surface->h /2 ;
348+ SDL_BlitSurface (text_surface, NULL , surface, &text_pos);
349+ break ;
337350 case MENU_TYPE_POWERDOWN:
338351 MENU_DEBUG_PRINTF (" Init MENU_TYPE_POWERDOWN\n " );
339352 // / ------ Text ------
@@ -368,6 +381,8 @@ void MenuMode::init_menu_zones(){
368381 add_menu_zone (MENU_TYPE_USB);
369382 // / Init Theme Menu
370383 add_menu_zone (MENU_TYPE_THEME);
384+ // / Init Launcher Menu
385+ add_menu_zone (MENU_TYPE_LAUNCHER);
371386 // / Init Powerdown Menu
372387 add_menu_zone (MENU_TYPE_POWERDOWN);
373388}
@@ -622,6 +637,23 @@ void MenuMode::menu_screen_refresh(int menuItem, int prevItem, int scroll, uint8
622637 }
623638 break ;
624639
640+ case MENU_TYPE_LAUNCHER:
641+ if (menu_action){
642+ sprintf (text_tmp, " In progress..." );
643+ text_surface = TTF_RenderText_Blended (menu_info_font, text_tmp, text_color);
644+ text_pos.x = (virtual_hw_screen->w - MENU_ZONE_WIDTH)/2 + (MENU_ZONE_WIDTH - text_surface->w )/2 ;
645+ text_pos.y = virtual_hw_screen->h - MENU_ZONE_HEIGHT/2 - text_surface->h /2 + 2 *padding_y_from_center_menu_zone;
646+ SDL_BlitSurface (text_surface, NULL , virtual_hw_screen, &text_pos);
647+ }
648+ else if (menu_confirmation){
649+ sprintf (text_tmp, " Are you sure ?" );
650+ text_surface = TTF_RenderText_Blended (menu_info_font, text_tmp, text_color);
651+ text_pos.x = (virtual_hw_screen->w - MENU_ZONE_WIDTH)/2 + (MENU_ZONE_WIDTH - text_surface->w )/2 ;
652+ text_pos.y = virtual_hw_screen->h - MENU_ZONE_HEIGHT/2 - text_surface->h /2 + 2 *padding_y_from_center_menu_zone;
653+ SDL_BlitSurface (text_surface, NULL , virtual_hw_screen, &text_pos);
654+ }
655+ break ;
656+
625657 case MENU_TYPE_EXIT:
626658 case MENU_TYPE_POWERDOWN:
627659 if (menu_action){
@@ -1009,6 +1041,27 @@ int MenuMode::launch( )
10091041 screen_refresh = 1 ;
10101042 }
10111043 }
1044+ else if (idx_menus[menuItem] == MENU_TYPE_LAUNCHER){
1045+ if (menu_confirmation){
1046+ MENU_DEBUG_PRINTF (" Lancher change - confirmed\n " );
1047+
1048+ // / ------ Refresh Screen -------
1049+ menu_screen_refresh (menuItem, prevItem, scroll, menu_confirmation, 1 );
1050+
1051+ // / ----- Shell cmd ----
1052+ MENU_DEBUG_PRINTF (" Running command: %s\n " , SHELL_CMD_SET_LAUNCHER_GMENU2X);
1053+ Utils::executeRawPath (SHELL_CMD_SET_LAUNCHER_GMENU2X);
1054+
1055+ stop_menu_loop = 1 ;
1056+ returnCode = MENU_RETURN_EXIT;
1057+ }
1058+ else {
1059+ MENU_DEBUG_PRINTF (" Launcher change - asking confirmation\n " );
1060+ menu_confirmation = 1 ;
1061+ // / ------ Refresh screen ------
1062+ screen_refresh = 1 ;
1063+ }
1064+ }
10121065 else if (idx_menus[menuItem] == MENU_TYPE_EXIT){
10131066 MENU_DEBUG_PRINTF (" Exit game\n " );
10141067 if (menu_confirmation){
0 commit comments