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

History develop #168

Draft
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

thegouldfish
Copy link

Contains the code required for logging the last game and the start of a favourites system

Description

When you launch a game, either rom or disk.
the file path for those will be written out to an ini file.
so the user can hit the "last game" button (current C-Left) while browsing and it will take them to either the rom or disk info screen.
with the game already selected.

Also there is a favorite system where the user can press the favorite button (C-Right) on the rom / disk info screen.
and it will be saved to a favorite list.
the user can hit the favorite button while on the browser and be taken to a screen to select their favorites.

Motivation and Context

Issue request for last game and favorites.

How Has This Been Tested?

Run on Supercart 64,
Tested last loading just a rom, just a disk and a disk and rom
Tested History, loading rom, disk and rom and disk.

Screenshots

Types of changes

  • Improvement (non-breaking change that adds a new feature)
  • Bug fix (fixes an issue)
  • Breaking change (breaking change)
  • Documentation Improvement
  • Config and build (change in the configuration and build system, has no impact on code or features)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Signed-off-by: GITHUB_USER <GITHUB_USER_EMAIL>

Moved the Load last game and favorites with menu into the branch
Both history and last game works for roms and 64dd games
Giving a bit more space between the lines of history
Copy link

coderabbitai bot commented Dec 4, 2024

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Removing the empty entry that snuck in
Fixing up ordering
@networkfusion
Copy link
Collaborator

networkfusion commented Dec 4, 2024

linked to #164 and #81

networkfusion and others added 6 commits December 4, 2024 14:09
Moved add to favorite to the options context menu
refactored most of the history / favorite code to now be "bookkeeping".
this now uses a common struct to hold the required paths and the record type (to open up future work for emus).
Users can remove favorites via the menu
Updated the tabs so they fill the top of the screen.
renamed files and variables to better match the new naming
@@ -199,6 +205,7 @@ static component_context_menu_t options_context_menu = { .list = {
{ .text = "Set Save Type", .submenu = &set_save_type_context_menu },
{ .text = "Set TV Type", .submenu = &set_tv_type_context_menu },
{ .text = "Set ROM to autoload", .action = set_autoload_type },
{ .text = "Add To Favorite", .action = add_favorite },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ .text = "Add To Favorite", .action = add_favorite },
{ .text = "Add to favorites", .action = add_favorite },

@@ -23,6 +23,7 @@
#define MENU_DIRECTORY "/menu"
#define MENU_SETTINGS_FILE "config.ini"
#define MENU_CUSTOM_FONT_FILE "custom.font64"
#define MENU_HISTORY_FILE "history.ini"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given this is menu related, and particular reason why you should not just use the current config.ini with a seperate header?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first I felt it was better to have them in their own file out of the way of the config.ini
that way I could load and save as needed.
also makes it easier to wipe in a single go.


static const char* tabs[3] =
{
"Browser",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Browser",
"Files",

Or something like "File Explorer"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps also consider which should be the default Tab... since favorite might be perefereable (also consider as a config option).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a config option for what tab it brings up first could be an idea.
but I'd leave it with the file browser as the default, it feels what people would expect.

static void draw (menu_t *menu, surface_t *d) {
rdpq_attach(d, NULL);

ui_components_background_draw();

ui_components_layout_draw();
ui_components_layout_draw();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ui_components_layout_draw();
ui_components_layout_draw();

@@ -272,7 +279,7 @@ static void draw (menu_t *menu, surface_t *d) {
ALIGN_RIGHT, VALIGN_TOP,
"L|Z: Extra Info\n"
"R: Options"
);
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
);
);

@@ -22,6 +22,8 @@ static void actions_clear (menu_t *menu) {
menu->actions.options = false;
menu->actions.settings = false;
menu->actions.lz_context = false;
menu->actions.previous_tab = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use the dpad / joystick e.g.

    menu->actions.go_left = false;
    menu->actions.go_right = false;

as already defined?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left, Right on the D-Pad feels more accident prone, I'd personally want something more specific for the user to press like the C buttons.
I still think that left and right on the dpad should be the fast movement.

name = path_last_get(menu->load.rom_path);
}

menu->load.load_favorite = -1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something here in my loins says for readability/maintainability it should be something like menu->bookkeeping.get_favorite = -1;

and probably the whole function above...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did have these in the bookkeeping struct before, but figured it might be better in the load with the other variables.
but fine with where ever.

@networkfusion
Copy link
Collaborator

All comments are for discussion... not a review...

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.

2 participants