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

feat: use rosu-mods #9

Merged
merged 4 commits into from
Jul 12, 2024
Merged

feat: use rosu-mods #9

merged 4 commits into from
Jul 12, 2024

Conversation

MaxOhn
Copy link
Owner

@MaxOhn MaxOhn commented Jul 12, 2024

Bump rosu-pp to v1.1.0 which utilizes rosu-mods to pass mods as arguments.

Instead of the binding only allowing the int type for mods, now the type must coincide with the alias definitions

GameMods = Union[int, str, GameMod, List[Union[GameMod, str, int]]]
GameMod = dict[str, Union[str, GameModSettings]]
GameModSettings = dict[str, Union[bool, float, str]]

That means, mods can be given either through their (legacy) bitflags, a string for acronyms, a "GameMod" dict, or a sequence whose items are either a "GameMod" dict, a single acronym string, or bitflags for a single mod.

A "GameMod" dict must have the item 'acronym': str and an optional item 'settings': GameModSettings.

This should make it easy to pass along mods as they're given by the osu!api by simple using json.loads(...) to convert the JSON into a python object.

@MaxOhn MaxOhn merged commit bf6e57a into next Jul 12, 2024
6 checks passed
@MaxOhn MaxOhn deleted the rosu-mods branch July 12, 2024 11:42
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