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

Make vehicle door/panel/light/wheel states functions usage more unified #934

Open
Yamsha75 opened this issue May 12, 2019 · 0 comments
Open
Labels
enhancement New feature or request
Projects

Comments

@Yamsha75
Copy link

Is your feature request related to a problem? Please describe.
For now, there are four get/set functions regarding vehicle damage indicators, which arguments/returns are inconsistent with each other. Light, door and panel functions require passing an ID of the thing in question, while wheels functions take four states as arguments and return four states.

  • Getters:
int getVehicleLightState ( vehicle theVehicle, int light )
int getVehicleDoorState ( vehicle theVehicle, int door )
int getVehiclePanelState ( vehicle theVehicle, int panel )
int, int, int, int getVehicleWheelStates ( vehicle theVehicle )
  • Setters:
bool setVehicleLightState ( vehicle theVehicle, int light, int state )
bool setVehicleDoorState ( vehicle theVehicle, int door, int state )
bool setVehiclePanelState ( vehicle theVehicle, int panelID, int state )
bool setVehicleWheelStates ( vehicle theVehicle, int frontLeft, [ int rearLeft = -1, int frontRight = -1, int rearRight = -1 ])

Describe the solution you'd like
Consider making all of them in two flavors, which would be :

  • Getters:
int getVehicleThingState ( vehicle theVehicle, int thingID ) -- return state of thing by its ID
int, int, (...), int getVehicleThingStates ( vehicle theVehicle ) -- return states of all things
  • Setters:
bool setVehicleThingState ( vehicle theVehicle, int thingID, int state) -- change state of one thing
bool setVehicleThingStates ( vehicle theVehicle, int state, int state, ... ) -- change states of all things

Another option would be making both types under one function name and returning values according to number of arguments passed. For backwards-compatibility with setVehicleWheelStates those would have to end with singular state.

Describe alternatives you've considered
Other option would be to implement new functions for wheel state:

int getVehicleWheelState ( vehicle theVehicle, int wheelID )
bool setVehicleWheelState ( vehicle theVehicle, int wheelID, int state )

This would also be backwards-compatible, as the current functions' names end with plural states.

Of course this whole issue is a minor thing.

Additional context
Links to said functions in MTA wiki:
https://wiki.multitheftauto.com/wiki/GetVehicleLightState
https://wiki.multitheftauto.com/wiki/GetVehicleDoorState
https://wiki.multitheftauto.com/wiki/GetVehiclePanelState
https://wiki.multitheftauto.com/wiki/GetVehicleWheelStates

https://wiki.multitheftauto.com/wiki/SetVehicleLightState
https://wiki.multitheftauto.com/wiki/SetVehicleDoorState
https://wiki.multitheftauto.com/wiki/SetVehiclePanelState
https://wiki.multitheftauto.com/wiki/SetVehicleWheelStates

@Yamsha75 Yamsha75 added the enhancement New feature or request label May 12, 2019
@qaisjp qaisjp added this to Incoming in Proposals via automation Mar 15, 2020
@qaisjp qaisjp moved this from Incoming to Active in Proposals Mar 15, 2020
@qaisjp qaisjp moved this from Active to Incoming in Proposals Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Proposals
  
Incoming
Development

No branches or pull requests

1 participant