fix: fast limit settings not saving

This commit is contained in:
Dan
2021-03-17 16:59:50 +00:00
parent 040141f4c8
commit 7e63c37e45
2 changed files with 19 additions and 9 deletions

View File

@@ -207,7 +207,13 @@ RADAR.vars =
["plateAudio"] = CONFIG.menuDefaults["plateAudio"],
-- The speed unit used in conversions
["speedType"] = CONFIG.menuDefaults["speedType"]
["speedType"] = CONFIG.menuDefaults["speedType"],
-- The state of automatic speed locking
["fastLock"] = CONFIG.menuDefaults["fastLock"],
-- The speed limit for automatic speed locking
["fastLimit"] = CONFIG.menuDefaults["fastLimit"]
},
-- These 3 variables are for the in-radar menu that can be accessed through the remote control, the menuOptions table
@@ -540,10 +546,6 @@ if ( RADAR:IsFastLimitAllowed() ) then
table.insert( fastOptions[2].options, i )
end
-- Create the settings with the default options
self:SetSettingValue( "fastLock", false )
self:SetSettingValue( "fastLimit", 60 )
-- Add the fast options to the main menu options table
table.insert( self.vars.menuOptions, fastOptions[1] )
table.insert( self.vars.menuOptions, fastOptions[2] )
@@ -1874,14 +1876,14 @@ Citizen.CreateThread( function()
-- Update the end coordinates for the ray traces based on the config, again, reduced hard coding
RADAR:UpdateRayEndCoords()
-- Update the operator menu positions
RADAR:UpdateOptionIndexes( true )
-- If the fast limit feature is allowed, create the config in the radar variables
if ( RADAR:IsFastLimitAllowed() ) then
RADAR:CreateFastLimitConfig()
end
-- Update the operator menu positions
RADAR:UpdateOptionIndexes( true )
-- Run the main radar function
while ( true ) do
RADAR:Main()