Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion modules/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down