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

Feature: add constants to add more meaning to magic numbers #3022

Open
1 task done
CrosRoad95 opened this issue May 21, 2023 · 0 comments · May be fixed by #3039
Open
1 task done

Feature: add constants to add more meaning to magic numbers #3022

CrosRoad95 opened this issue May 21, 2023 · 0 comments · May be fixed by #3039
Labels
enhancement New feature or request

Comments

@CrosRoad95
Copy link
Contributor

Is your feature request related to a problem? Please describe.

for example: setVehicleLightState( car, 0, 1 ) do you know what it does? assume that without taking look at wiki you wont know.

Describe the solution you'd like

add meaning to this numbers, it would be more readable if it would be written in form: setVehicleLightState( car, VehicleLight.FrontLeft, VehicleLightState.Broken)

Describe alternatives you've considered

/

Additional context

it could be added simillar to how inspect function is created, create file "constants.lua" and put there code:

VehicleLight = {
  FrontLeft = 0,
  FrontRight = 1,
  RearRight = 2,
  RearLeft = 3,
}

this solution if fully backwards compatible, people over time can migrate their code to use constants

Security Policy

  • I have read and understood the Security Policy and this issue is not about a cheat or security vulnerability.
@CrosRoad95 CrosRoad95 added the enhancement New feature or request label May 21, 2023
@TracerDS TracerDS linked a pull request May 24, 2023 that will close this issue
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
None yet
Development

Successfully merging a pull request may close this issue.

1 participant