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

Fixes issue with keybinds not working after loading the game #202

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

joshuaskelly
Copy link
Collaborator

@joshuaskelly joshuaskelly commented Feb 5, 2021

Summary

Fixes issue with custom keybinds not working after relaunching the game. The issue was keybinds are set by the GamepadManager called in Game.init() which is called before Options.loadOptions() in SplashScreen.java. This results in using a temp instance of Options which are all the default keybinds.

Fix

I decoupled setting gamepad bindings and key bindings. We set the keybindings whenever we load the options file and load the gamepad bindings once the GamepadManager has been initialized.

Fixes #201

Options.SetInputOptions(controllerMapping.get(controller));
String controllerName = controller.getName().toLowerCase();

if (controllerName.contains("microsoft corporatio controller")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

corporation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the actual name. 🙃

Copy link

Choose a reason for hiding this comment

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

Thanks for the fix Joshua!

corporation?

Microsoft probably trying to recreate the Roman empire or something :)

@joshuaskelly joshuaskelly merged commit da6aceb into master Feb 5, 2021
@joshuaskelly joshuaskelly deleted the fixes/keybinds-not-working-after-loading branch February 5, 2021 21:23
Copy link
Owner

@Interrupt Interrupt left a comment

Choose a reason for hiding this comment

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

Looks good to me!

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.

Some Players Cannot Save Keybinds
4 participants