mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
Fixed UI settings not reloading on resource restart
This commit is contained in:
@@ -144,10 +144,12 @@ end )
|
|||||||
-- default settings applied
|
-- default settings applied
|
||||||
AddEventHandler( "onResourceStart", function( resourceName )
|
AddEventHandler( "onResourceStart", function( resourceName )
|
||||||
if ( GetCurrentResourceName() == resourceName ) then
|
if ( GetCurrentResourceName() == resourceName ) then
|
||||||
Citizen.Wait( 2000 )
|
Citizen.CreateThread( function()
|
||||||
|
Citizen.Wait( 1000 )
|
||||||
|
|
||||||
RegisterKeyBinds()
|
RegisterKeyBinds()
|
||||||
LoadUISettings()
|
LoadUISettings()
|
||||||
|
end )
|
||||||
end
|
end
|
||||||
end )
|
end )
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
---------------------------------------------------------------------------------------]]--
|
---------------------------------------------------------------------------------------]]--
|
||||||
|
|
||||||
UTIL = {}
|
UTIL = {}
|
||||||
UTIL.resourceName = ""
|
|
||||||
|
|
||||||
-- Returns a number to a set number of decimal places
|
-- Returns a number to a set number of decimal places
|
||||||
function UTIL:Round( num, numDecimalPlaces )
|
function UTIL:Round( num, numDecimalPlaces )
|
||||||
@@ -150,9 +149,8 @@ function UTIL:DrawDebugText( x, y, scale, centre, text )
|
|||||||
DrawText( x, y )
|
DrawText( x, y )
|
||||||
end
|
end
|
||||||
|
|
||||||
Citizen.CreateThread( function() UTIL.resourceName = GetCurrentResourceName() end )
|
|
||||||
function UTIL:IsResourceNameValid()
|
function UTIL:IsResourceNameValid()
|
||||||
return self.resourceName == "wk_wars2x"
|
return GetCurrentResourceName() == "wk_wars2x"
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[The MIT License (MIT)
|
--[[The MIT License (MIT)
|
||||||
|
|||||||
Reference in New Issue
Block a user