OoliteProject / oolite

The main Oolite repository.
https://www.oolite.space
543 stars 70 forks source link

Added ability to set default activate+mode keys for equipment items #476

Closed phkb closed 3 months ago

phkb commented 4 months ago

With this PR, you can now set "default_activate_key" and "default_mode_key" in your equipment.plist definition. If the chosen key conflicts with another key when loading, the setting will be ignored. The definition is the same as for other key settings, in that it is an array of dictionary items. For example:

    default_activate_key = ({key = "0"; shift = true;});
    default_mode_key = ({key = "9"; mod1 = true;});

If you change the default key for the equipment item, the "Overrides" column will now show that the key setting has changed from the default.

phkb commented 3 months ago

I think this is stable and predictable now. The first version would reset the activate/mode keys back to the default even if you'd specifically unset them. Now, the only time it picks up the default keys is when you purchase the equipment for the first time. If you add default keys to an equipment item later, you would need to go into the keyboard settings and reset the keys back to default.

Anyway, I'll push to master in the next day or so unless there's objections.