collinsmith / riiablo

Diablo II remade using Java and LibGDX
http://riiablo.com
Apache License 2.0
869 stars 99 forks source link

Add function to reset key bindings #137

Open collinsmith opened 3 years ago

collinsmith commented 3 years ago

Add console command to reset key bindings to their default values. Default values passed via key creation are not actually preserved -- perhaps it makes sense to preserve them and provide an API to reset them to their default value via some console command.

Preface: LibGDX decided to change constants around for the keys causing an issue with saved keys. This was fixed by temporarily having com.riiablo.GdxKeyMapper#load(MappedKey) return null, i.e., the initial value is never changed to a loaded one from the preferences, and when the program terminated, the default values were saved instead. I don't expect anyone to know how to do this themselves, so this issue should be solved to protect me from any further LibGDX key const changes.