exch-bms2 / beatoraja

Cross-platform rhythm game based on Java and libGDX.
GNU General Public License v3.0
642 stars 148 forks source link

Use input method depending on chart keymode #705

Open Chazoshtare opened 2 years ago

Chazoshtare commented 2 years ago

Fixes issue: https://github.com/exch-bms2/beatoraja/issues/678

Previously, it was only possible to play charts using the input method picked as music select input option. This PR introduces a change that will select appropriate input method depending on the type of chart being played.

Additionally, previous logic of using an incrementing int with modulo operation, to determine which song select input option was chosen was refactored into using an already existing enum with all possible options, what possibly makes adding another options in the future much easier.

I discovered that song select option also determines which keys can be bound in key binding screen, and that state only changed when user got back to song select screen and again to key configuration. I moved the part of code that was setting this input method to class responsible for key binding screen, and it changes instantly when user chooses a different song select input option. So overall, it didn't solve the underlying issue, (bindings are still limited by option chosen), but at least it's somewhat better as it changes in the binding screen. Once this PR is merged, I'll create a separate issue that explains this problem in detail and maybe try to work on it too.

Part of this PR just removes unneeded whitespace, but it's split in separate commits. Main commit that represents the main logic change can be viewed here: https://github.com/exch-bms2/beatoraja/pull/705/commits/dc8d23e1ff101080ce6f03ab9406bb90d203fb3d