diff --git a/fxmanifest.lua b/fxmanifest.lua index 3eb8e0f..df020af 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -1,21 +1,24 @@ ---[[ FX Information ]]-- -fx_version 'cerulean' +--[[ FX Information ]] +-- +fx_version 'cerulean' use_experimental_fxv2_oal 'yes' -lua54 'yes' -games { 'rdr3', 'gta5' } +lua54 'yes' +games { 'rdr3', 'gta5' } rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.' ---[[ Resource Information ]]-- -name 'ox_lib' -author 'Overextended' -version '3.18.0' -license 'LGPL-3.0-or-later' -repository 'https://github.com/overextended/ox_lib' -description 'A library of shared functions to utilise in other resources.' +--[[ Resource Information ]] +-- +name 'ox_lib' +author 'Overextended' +version '3.18.0' +license 'LGPL-3.0-or-later' +repository 'https://github.com/overextended/ox_lib' +description 'A library of shared functions to utilise in other resources.' ---[[ Manifest ]]-- +--[[ Manifest ]] +-- dependencies { - '/server:7290', + '/server:7290', '/onesync', } @@ -23,17 +26,19 @@ ui_page 'web/build/index.html' files { 'init.lua', + 'resource/settings.lua', 'imports/**/client.lua', 'imports/**/shared.lua', 'web/build/index.html', 'web/build/**/*', - 'locales/*.json', + 'locales/*.json', } shared_script 'resource/init.lua' shared_scripts { 'resource/**/shared.lua', + 'imports/require/shared.lua', -- 'resource/**/shared/*.lua' } @@ -43,8 +48,8 @@ client_scripts { } server_scripts { - 'imports/callback/server.lua', + 'imports/callback/server.lua', + 'imports/getFilesInDirectory/server.lua', 'resource/**/server.lua', 'resource/**/server/*.lua', } - diff --git a/imports/require/shared.lua b/imports/require/shared.lua index c8bcd8c..2af6d2d 100644 --- a/imports/require/shared.lua +++ b/imports/require/shared.lua @@ -108,7 +108,7 @@ end ---Loads the given module inside the current resource, returning any values returned by the file or `true` when `nil`. ---@param modname string ----@return unknown? +---@return unknown function lib.require(modname) if type(modname) ~= 'string' then return end diff --git a/resource/init.lua b/resource/init.lua index 9eb7ba8..0e21a1b 100644 --- a/resource/init.lua +++ b/resource/init.lua @@ -43,7 +43,8 @@ cache = { } if not LoadResourceFile(lib.name, 'web/build/index.html') then - local err = '^1Unable to load UI. Build ox_lib or download the latest release.\n ^3https://github.com/overextended/ox_lib/releases/latest/download/ox_lib.zip^0' + local err = + '^1Unable to load UI. Build ox_lib or download the latest release.\n ^3https://github.com/overextended/ox_lib/releases/latest/download/ox_lib.zip^0' function lib.hasLoaded() return err end error(err) @@ -51,4 +52,4 @@ end function lib.hasLoaded() return true end -lib.locale() +require = lib.require