Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Add editableVehicles preference #97

Merged
merged 2 commits into from
Apr 7, 2023
Merged

Add editableVehicles preference #97

merged 2 commits into from
Apr 7, 2023

Conversation

carsakiller
Copy link
Owner

@carsakiller carsakiller commented Mar 24, 2023

Adds a new preference editableVehicles that defaults to true, meaning player vehicles are, by default, true. If toggled off in the addon config menu or using ?setPref, any newly spawned player vehicles should be uneditable.

So far, this is completely untested, just opening to show some life. Will need to make sure that when the world is reloaded, previously uneditable vehicles are still uneditable. If they somehow are not, we will need to save a editable state to G_Vehicles for each vehicle so that onCreate we can set the edit states of all the vehicles.

Things to test:

  • Vehicles are editable by default
  • Server vehicles are unaffected
  • When editableVehicles is set to false, new vehicles cannot be edited
  • When editableVehicles is set to false, server vehicles are still unaffected
  • When editableVehicles is set back to true, new vehicles can be edited
  • When editableVehicles is set back to true, old vehicles cannot be edited
  • On reload, vehicles that were spawned as uneditable are still unable to be edited

Closes #95

@carsakiller carsakiller added the request New feature or request label Mar 24, 2023
@carsakiller carsakiller self-assigned this Mar 24, 2023
@Sedrowow
Copy link

I could test this as soon is i got home (about 14:30 UTC+1 (i am in Germany))

So if ok, i try the required test according to your writings as soon as i am online.

@carsakiller carsakiller merged commit 8e9e4c4 into main Apr 7, 2023
@carsakiller carsakiller deleted the issue-95 branch April 7, 2023 02:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

question: how to make all vehicles non editable as default?
2 participants