Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Top Games feature #56

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Top Games feature #56

wants to merge 2 commits into from

Conversation

Dteyn
Copy link

@Dteyn Dteyn commented Oct 11, 2023

I've implemented a Top Games feature for tadpole where the user can supply a list of games via TopGames.txt and have those games sorted and placed at the top of the games listing.

Here are the details on the changes made:

  • tadpoleConfig.py changes:

    • Config setting _static_topGamesEnabled with default to False
    • Methods getTopGamesEnabled and setTopGamesEnabled to read and set the new config option
  • SettingsDialog.py changes:

    • Section "Sorting Options" with a checkbox to enable/disable the "Top Games" sorting feature.
    • Method topGamesToggled which calls tpConf.setTopGamesEnabled in tadpole_config
  • tadpole_functions.py changes:

    • Function read_top_games which reads the TopGames.txt file and returns it as a dictionary, with a list of games for each system
    • Systems are defined by a trailing colon, for example FC: or GBA:
  • tadpole.py changes:

    • Imported read_top_games from tadpole_functions.py
    • top_games_list initialized as an empty list
    • Function RunFrogTool modified to get the top_games_list and pass it to frogtool.process_sys if Top Games feature is enabled
    • Function loadROMsToTable modified to display top games if Top Games feature is enabled
  • frogtool.py changes:

    • Function process_sys takes an additional parameter: top_games which defaults to an empty list, which is passed to write_index_file
    • Function write_index_file will re-sort the games with top games if feature is enabled, before metadata pointers are generated
  • Added error handling to gracefully handle cases where the TopGames.txt file is missing or improperly formatted.

  • Conducted thorough testing to ensure the new feature functions as intended without disrupting existing functionality.

Dteyn added 2 commits October 9, 2023 12:22
…list of games at the top of the display. This enhancement provides users with the flexibility to highlight their favorite games, making them easily accessible at the top of the list.

- `tadpoleConfig.py` changes:
  - Config setting `_static_topGamesEnabled` with default to False
  - Methods `getTopGamesEnabled` and `setTopGamesEnabled` to read and set the new config option

- `SettingsDialog.py` changes:
  - Section "Sorting Options" with a checkbox to enable/disable the "Top Games" sorting feature.
  - Method `topGamesToggled` which calls `tpConf.setTopGamesEnabled` in tadpole_config

- `tadpole_functions.py` changes:
  - Function `read_top_games` which reads the TopGames.txt file and returns it as a dictionary, with a list of games for each system
  - Systems are defined by a trailing colon, for example FC: or GBA:

- `tadpole.py` changes:
  - Imported `read_top_games` from `tadpole_functions.py`
  - top_games_list initialized as an empty list
  - Function `RunFrogTool` modified to get the `top_games_list` and pass it to `frogtool.process_sys` if Top Games feature is enabled
  - Function `loadROMsToTable` modified to display top games if Top Games feature is enabled

- `frogtool.py` changes:
  - Function `process_sys` takes an additional parameter: top_games which defaults to an empty list, which is passed to `write_index_file`
  - Function `write_index_file` will re-sort the games with top games if feature is enabled, before metadata pointers are generated
- Added error handling to gracefully handle cases where the `TopGames.txt` file is missing or improperly formatted.
- Conducted thorough testing to ensure the new feature functions as intended without disrupting existing functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant