Skip to content

Conversation

@Catizard
Copy link
Collaborator

@Catizard Catizard commented Apr 7, 2025

This pr would be rewritten in the future because the strategy of modifying songdata.db directly is not a very sensible way. On the other hand, using the internal difficult table mechanism can have much more flexibility and do not suffer from data loss due to rebuild songdata.db.

This commit implements the basic functionality of the Favorite folder management.

Mainly changes is adding two menus:

  • FolderMenu: Allows you to manage the folders
  • SongMenu: Prints current selected song and allows you to add song to selected folders

Upstream Code Changes:

This commit only changes one line from upstream, which is only get the reference of the MusicSelector since SongMenu needs to know which song is selected by user.

Drop-in Compatibility:

This pr takes care about the drop-in compatibility but would still be breaking if one user has already defined their own folder the similar way but not followed the pattern favorite & x != 0.

Limitations:

  1. Folders count cannot exceed to 25, because the favorite field is only 31 bits long.

  2. It's very dangerous to keep opening the mod menu while still letting the player have the control of the main game.

  3. favorite field itself seems to be volatile, user may find all their contents are missing after rebuilding the database.

Alternatives:

There's another way to implement the missing Favorite Folder feature in beatoraja: by mocking as a difficult table and be imported. This work has been done in some GUI/Web projects.

TODO:

  1. I haven't found a good solution to freeze user's input when adding a folder, it's very annoying when you typing a folder name while the game is still accepting your inputs. (Beatoraja exposes a field enable in InputProcessor but it doesn't lock every inputs, e.g. up and down)

  2. Should we delete all its content when deleting one folder?For now, it only deletes the folder itself. Then everything would come back if we add a folder with the same bit.

  3. The default behavior of upstream is to add all difficult variants to one folder.For now, this commit only allows you add the selected one.

  4. The default mechanism is very limited and hard to use, however if you delete them would cause upstream conflict.This commit doesn't implement any special treat for the default folders(which means you can easily delete them).I haven't find a better solution for this, maybe give a checkbox for player to judge whether use the legacy folder mechanism or not?

  5. The edit button in folder menu haven't been implemented because of item4 and item2

This commit implements the basic functionality of the `Favorite folder
management`.Adds two menu in modmenu.

FolderMenu: Allows you to manage the folders
SongMenu: Prints current selected song and allows you to add song to
selected folders

Upstream Compatibility:
This mechanism borrows the `favorite` field, which is used in original
`favorite/invisible song/chart` feature.It won't produce any conflict if
you don't touch the default 4 folders(favorite song, invisible song,
etc).
To make the magic happens it also takes over the
`folder/default.json`.And again, if you don't touch the default folders,
there's no conflict.

This commit only changed one line from upstream, which is only get the
reference of the `MusicSelector` since `SongMenu` needs to know current
selected song.

Limitations:

1) Folders count cannot exceed to 25, because the `favorite` field is
   only 31 bits long.

2) It's very dangerous to keep opening the modmenu while still letting
   the player have the control of the main game.

TODO:

1) Should we delete all its content when deleting one folder?For now, it
   only deletes the folder itself.

2) The default behavior of upstream is to add all difficult varaints to
   one folder.For now, this commit only implements the mechanism and
   stricts to only add the selected difficult itself but haven't give
   the ability to do so.

3) The default mechanism is very limited and hard to use, however if you
   delete them would cause upstream conflict.This commit doesn't
   implement any special treat for the default folders(which means you
   can easily delete them).I haven't find a better solution for this,
   maybe give a checkbox for player to judge whether use the legacy
   folder mechanism or not?

4) The edit button in folder menu haven't been implemented because of
   item3 and item1
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