Qbox-project / qbx_vehiclekeys

GNU General Public License v3.0
5 stars 36 forks source link

refactor: vehicles config #102

Closed Manason closed 1 month ago

Manason commented 1 month ago

Currently, the config is split up as a bunch of lists of vehicles that apply to each property. This can be confusing and difficult to reason about the properties that apply to each vehicle. Additionally, this structure allows conflicting properties to be applied to the same vehicle such as no lock and spawned locked.

This PR introduces a new config structure, which is an inversion of the current one. Vehicles are now the top level key, and a list of properties and config options pertaining to that vehicle are the value. This makes the config behavior per vehicle. Aside from directly configuring individual models, this structure also allows for configuring vehicle types and specifying a default for all vehicles. This inherits, meaning that for any given property field, the model's property will be used, falling back to the type's property, falling back to the default property value.

Done with the spawnLocked property to start with. Further properties to be added in future PRs.