Struggleton / TitleScreenBGM

A rust plugin for Smash Ultimate to play music on the title screen
0 stars 0 forks source link

Use Hash40 for configuration instead of u64 #1

Closed ThatNintendoNerd closed 7 months ago

ThatNintendoNerd commented 7 months ago

The Hash40 type from the hash40 crate implements the Deserialize trait from serde, given the crate's serde feature is enabled. Requiring the user to specify the hash of their desired ui_bgm_id value is unintuitive.

With the Hash40 type, the user can specify a string (i.e., the label of the given ui_bgm_id value) and the Deserialize trait implementation will automatically hash the string received. If your API calls require a u64 value as an argument, you can easily access the inner u64 value of the Hash40 as the field is public.

Struggleton commented 7 months ago

Thanks for the heads up on that crate! Added the hash40 label functionality in commit 823bdcd1855185630e49bd18b95f91ac4c7750d0!