diff --git a/modules/gui.py b/modules/gui.py index 10e63e5f..81cc2403 100644 --- a/modules/gui.py +++ b/modules/gui.py @@ -2731,11 +2731,17 @@ def select_callback(selected): if idx == -1: idx = len(carousel_ids) - 1 change_id = carousel_ids[idx] + # remove highlight from previous game and highlight the current game + game.selected = False + globals.games[change_id].selected = True if imgui.is_key_pressed(glfw.KEY_RIGHT, repeat=True) or clicked_right: idx += 1 if idx == len(carousel_ids): idx = 0 change_id = carousel_ids[idx] + # remove highlight from previous game and highlight the current game + game.selected = False + globals.games[change_id].selected = True if change_id is not None: utils.push_popup(self.draw_game_info_popup, globals.games[change_id], carousel_ids).uuid = popup_uuid return True @@ -3206,10 +3212,17 @@ def handle_game_hitbox_events(self, game: Game, drag_drop: bool = False): # Ctrl + Left click = single select game.selected = not game.selected else: - if any(game.selected for game in globals.games.values()): +# FC: Use selected_games_count to check for selected games + if self.selected_games_count > 1: for game in globals.games.values(): game.selected = False else: +# FC: If there's a single game selected then first deselect it + if self.last_selected_game != None: + self.last_selected_game.selected = False +# FC: Mark the game clicked on as selected + game.selected = True + self.last_selected_game = game # Left click = open game info popup utils.push_popup(self.draw_game_info_popup, game, self.show_games_ids[self.current_tab].copy()) # Left click drag = swap if in manual sort mode