From 7ce1d680316f9f9e757933ca7d852580284081a5 Mon Sep 17 00:00:00 2001 From: skymike03 Date: Sun, 27 Jul 2025 12:38:13 +0200 Subject: [PATCH] v1.9.7.6 --- .vscode/settings.json | 3 +++ config.py | 16 +++++++++------- controls.py | 27 ++++++++++++++++++++++++--- display.py | 1 + languages/en.json | 2 +- languages/fr.json | 2 +- utils.py | 2 +- 7 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3ebdbc0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "CodeGPT.apiKey": "CodeGPT Plus Beta" +} \ No newline at end of file diff --git a/config.py b/config.py index 0433b0d..e6a2d07 100644 --- a/config.py +++ b/config.py @@ -3,7 +3,7 @@ import os import logging # Version actuelle de l'application -app_version = "1.9.7.4" +app_version = "1.9.7.6" @@ -42,6 +42,7 @@ REPEAT_ACTION_DEBOUNCE = 150 # Délai anti-rebond pour répétitions (ms) - aug # Variables d'état platforms = [] current_platform = 0 +accessibility_mode = False # Mode accessibilité pour les polices agrandies platform_names = {} # {platform_id: platform_name} games = [] current_game = 0 @@ -130,13 +131,14 @@ def init_font(): logger.debug("--------------------------------------------------------------------") global FONT, progress_font, title_font, search_font, small_font + multiplier = 1.5 if accessibility_mode else 1.0 try: - FONT = pygame.font.Font(None, 36) - progress_font = pygame.font.Font(None, 28) - title_font = pygame.font.Font(None, 48) - search_font = pygame.font.Font(None, 36) - small_font = pygame.font.Font(None, 24) - logger.debug("Polices initialisées avec succès") + FONT = pygame.font.Font(None, int(36 * multiplier)) + progress_font = pygame.font.Font(None, int(28 * multiplier)) + title_font = pygame.font.Font(None, int(48 * multiplier)) + search_font = pygame.font.Font(None, int(36 * multiplier)) + small_font = pygame.font.Font(None, int(24 * multiplier)) + logger.debug(f"Polices initialisées avec succès (mode accessibilité: {accessibility_mode})") # amazonq-ignore-next-line except pygame.error as e: logger.error(f"Erreur lors de l'initialisation des polices : {e}") diff --git a/controls.py b/controls.py index 9c45980..14d3993 100644 --- a/controls.py +++ b/controls.py @@ -827,7 +827,7 @@ def handle_controls(event, sources, joystick, screen): config.needs_redraw = True #logger.debug(f"Navigation vers le haut: selected_option={config.selected_option}") elif is_input_matched(event, "down"): - config.selected_option = min(5, config.selected_option + 1) + config.selected_option = min(6, config.selected_option + 1) # La répétition est gérée par update_key_state config.needs_redraw = True #logger.debug(f"Navigation vers le bas: selected_option={config.selected_option}") @@ -865,13 +865,34 @@ def handle_controls(event, sources, joystick, screen): config.selected_language_index = 0 config.needs_redraw = True logger.debug(f"Passage à language_select depuis pause_menu") - elif config.selected_option == 4: # Redownload game cache + elif config.selected_option == 4: # Accessibility + config.accessibility_mode = not config.accessibility_mode + config.init_font() + # Reinitialiser les polices dans le main + font_path = os.path.join(config.APP_FOLDER, "assets", "Pixel-UniCode.ttf") + multiplier = 1.5 if config.accessibility_mode else 1.0 + try: + config.font = pygame.font.Font(font_path, int(36 * multiplier)) + config.title_font = pygame.font.Font(font_path, int(48 * multiplier)) + config.search_font = pygame.font.Font(font_path, int(48 * multiplier)) + config.progress_font = pygame.font.Font(font_path, int(36 * multiplier)) + config.small_font = pygame.font.Font(font_path, int(28 * multiplier)) + except: + config.font = pygame.font.SysFont("arial", int(48 * multiplier)) + config.title_font = pygame.font.SysFont("arial", int(60 * multiplier)) + config.search_font = pygame.font.SysFont("arial", int(60 * multiplier)) + config.progress_font = pygame.font.SysFont("arial", int(36 * multiplier)) + config.small_font = pygame.font.SysFont("arial", int(28 * multiplier)) + config.menu_state = config.previous_menu_state + config.needs_redraw = True + logger.debug(f"Mode accessibilité {'activé' if config.accessibility_mode else 'désactivé'}") + elif config.selected_option == 5: # Redownload game cache config.previous_menu_state = validate_menu_state(config.previous_menu_state) config.menu_state = "redownload_game_cache" config.redownload_confirm_selection = 0 config.needs_redraw = True logger.debug(f"Passage à redownload_game_cache depuis pause_menu") - elif config.selected_option == 5: # Quit + elif config.selected_option == 6: # Quit config.previous_menu_state = validate_menu_state(config.previous_menu_state) config.menu_state = "confirm_exit" config.confirm_selection = 0 diff --git a/display.py b/display.py index eba519f..f5acbe6 100644 --- a/display.py +++ b/display.py @@ -1042,6 +1042,7 @@ def draw_pause_menu(screen, selected_option): _("menu_remap_controls"), _("menu_history"), _("menu_language"), + _("menu_accessibility"), _("menu_redownload_cache"), _("menu_quit") ] diff --git a/languages/en.json b/languages/en.json index 59acd2f..5fb8cd0 100644 --- a/languages/en.json +++ b/languages/en.json @@ -19,7 +19,7 @@ "error_controls_mapping": "Failed to map controls", "error_download_data": "Failed to download/extract Data Folder: {0}", "error_api_key": "Please enter your API key (premium only) in the file {0}", - "error_api_key_extended": "Please enter your API key (premium only) in the file /saves/ports/rgsx/1fichierAPI.txt by opening it in a text editor and pasting your API key", + "error_api_key_extended": "Please enter your API key (premium only) in the file /userdata/saves/ports/rgsx/1fichierAPI.txt by opening it in a text editor and pasting your API key", "error_invalid_download_data": "Invalid download data", "error_delete_sources": "Error deleting sources.json file or folders", "error_extension": "Unsupported extension or download error", diff --git a/languages/fr.json b/languages/fr.json index e6ec00a..9d98258 100644 --- a/languages/fr.json +++ b/languages/fr.json @@ -19,7 +19,7 @@ "error_controls_mapping": "Échec du mappage des contrôles", "error_download_data": "Échec du téléchargement/extraction du Dossier Data : {0}", "error_api_key": "Attention il faut renseigner sa clé API (premium only) dans le fichier {0}", - "error_api_key_extended": "Attention il faut renseigner sa clé API (premium only) dans le fichier /saves/ports/rgsx/1fichierAPI.txt à ouvrir dans un éditeur de texte et coller la clé API", + "error_api_key_extended": "Attention il faut renseigner sa clé API (premium only) dans le fichier /userdata/saves/ports/rgsx/1fichierAPI.txt à ouvrir dans un éditeur de texte et coller la clé API", "error_invalid_download_data": "Données de téléchargement invalides", "error_delete_sources": "Erreur lors de la suppression du fichier sources.json ou dossiers", "error_extension": "Extension non supportée ou erreur de téléchargement", diff --git a/utils.py b/utils.py index 10ac514..229bb55 100644 --- a/utils.py +++ b/utils.py @@ -595,7 +595,7 @@ def play_random_music(music_files, music_folder, current_music=None): def set_music_popup(music_name): """Définit le nom de la musique à afficher dans la popup.""" - config.current_music_name = f"♬ {os.path(music_name)[0]}" # Utilise l'emoji ♬ directement + config.current_music_name = f"♬ {os.path.splitext(music_name)[0]}" # Utilise l'emoji ♬ directement config.music_popup_start_time = pygame.time.get_ticks() / 1000 # Temps actuel en secondes config.needs_redraw = True # Forcer le redraw pour afficher le nom de la musique