From 287582408aa6164b0140eccc0ea9e9727d3d4f42 Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Thu, 2 Jan 2025 12:26:22 +0100 Subject: [PATCH 01/28] fix(es_extended/imports): remove lua 5.4 dependency for importing resources --- [core]/es_extended/imports.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/imports.lua b/[core]/es_extended/imports.lua index 6d6a862e1..5e40a2d08 100644 --- a/[core]/es_extended/imports.lua +++ b/[core]/es_extended/imports.lua @@ -44,7 +44,7 @@ if not IsDuplicityVersion() then -- Only register this event for the client end end -if not lib?.require then +if not lib or not lib.require then local cachedModules = {} ---@type table local loadingModules = {} ---@type table From a90b570aff26466b86bd9c210559d60c2099de1c Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Thu, 2 Jan 2025 12:27:55 +0100 Subject: [PATCH 02/28] fix(es_extended/server/functions): fix ESX.GetItems returning nil --- [core]/es_extended/server/functions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua index a7566ffbc..124170650 100644 --- a/[core]/es_extended/server/functions.lua +++ b/[core]/es_extended/server/functions.lua @@ -563,7 +563,7 @@ end ---@return table function ESX.GetItems() - return Core.Items + return ESX.Items end ---@return table From cd29078548d2b4201285fd7e8c9aae07be36d887 Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:30:29 +0100 Subject: [PATCH 03/28] feat(es_extended/shared/modules/table): add ESX.Table.Wipe --- [core]/es_extended/shared/modules/table.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/[core]/es_extended/shared/modules/table.lua b/[core]/es_extended/shared/modules/table.lua index aacb25840..ab4b147d8 100644 --- a/[core]/es_extended/shared/modules/table.lua +++ b/[core]/es_extended/shared/modules/table.lua @@ -224,10 +224,18 @@ function ESX.Table.Sort(t, order) end end -function ESX.Table.ToArray(table) +---@param t table +---@return Array +function ESX.Table.ToArray(t) local array = {} - for _, v in pairs(table) do + for _, v in pairs(t) do array[#array + 1] = v end return array end + +---@param t table +---@return table +function ESX.Table.Wipe(t) + return table.wipe(t) +end \ No newline at end of file From 0fb7853d244e3b0734862351e9eae170c8ccd689 Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:33:11 +0100 Subject: [PATCH 04/28] feat(es_extended/imports): use ox_lib require --- [core]/es_extended/imports.lua | 201 ++++++++++++++++++++++++++------- 1 file changed, 161 insertions(+), 40 deletions(-) diff --git a/[core]/es_extended/imports.lua b/[core]/es_extended/imports.lua index 6d6a862e1..719d06237 100644 --- a/[core]/es_extended/imports.lua +++ b/[core]/es_extended/imports.lua @@ -1,5 +1,5 @@ ESX = exports["es_extended"]:getSharedObject() -_resourceName = GetCurrentResourceName() +ESX.currentResourceName = GetCurrentResourceName() OnPlayerData = function (key, val, last) end @@ -44,67 +44,188 @@ if not IsDuplicityVersion() then -- Only register this event for the client end end -if not lib?.require then - local cachedModules = {} ---@type table - local loadingModules = {} ---@type table - - ---@param modulePath string +if GetResourceState("ox_lib") == "missing" then + ---@Credits: https://github.com/overextended/ox_lib/blob/master/imports/require/shared.lua - Licensed under the GNU Lesser General Public License v3.0 + local loaded = {} + local _require = require + + package = { + path = './?.lua;./?/init.lua', + preload = {}, + loaded = setmetatable({}, { + __index = loaded, + __newindex = function() end, + __metatable = false, + }) + } + + ---@param modName string + ---@return string ---@return string - local function getResourceNameFromModulePath(modulePath) - local externalResourceName = modulePath:match("^@(.-)%.") - if externalResourceName then - return externalResourceName + local function getModuleInfo(modName) + local resource = modName:match('^@(.-)/.+') --[[@as string?]] + + if resource then + return resource, modName:sub(#resource + 3) end - return _resourceName + local idx = 4 -- call stack depth (kept slightly lower than expected depth "just in case") + + while true do + local dbgInfo = debug.getinfo(idx, 'S') + local src = dbgInfo and dbgInfo.source + + if not src then + return ESX.currentResourceName, modName + end + + resource = src:match('^@@([^/]+)/.+') + + if resource and not src:find('^@@es_extended/imports') then + return resource, modName + end + + idx = idx + 1 + end end - ---@param modulePath string - ---@return string, number - local function getModuleFilePath(modulePath) - if modulePath:sub(1, 1) == "@" then - modulePath = modulePath:sub(modulePath:find("%.") + 1) + local tempData = {} + + ---@param name string + ---@param path string + ---@return string? filename + ---@return string? errmsg + ---@diagnostic disable-next-line: duplicate-set-field + function package.searchpath(name, path) + local resource, modName = getModuleInfo(name:gsub('%.', '/')) + local tried = {} + + for template in path:gmatch('[^;]+') do + local fileName = template:gsub('^%./', ''):gsub('?', modName:gsub('%.', '/') or modName) + local file = LoadResourceFile(resource, fileName) + + if file then + tempData[1] = file + tempData[2] = resource + return fileName + end + + tried[#tried + 1] = ("no file '@%s/%s'"):format(resource, fileName) end - return modulePath:gsub("%.", "/") + return nil, table.concat(tried, "\n\t") end - ---@param modulePath string - ---@return any - function require(modulePath) - assert(type(modulePath) == "string", "Module path must be a string") + ---Attempts to load a module at the given path relative to the resource root directory.\ + ---Returns a function to load the module chunk, or a string containing all tested paths. + ---@param modName string + ---@param env? table + local function loadModule(modName, env) + local fileName, err = package.searchpath(modName, package.path) - if loadingModules[modulePath] then - error(("Circular dependency detected for module '%s'."):format(modulePath)) + if fileName then + local file = tempData[1] + local resource = tempData[2] + + ESX.Table.Wipe(tempData) + return assert(load(file, ('@@%s/%s'):format(resource, fileName), 't', env or _ENV)) end - if cachedModules[modulePath] then - return cachedModules[modulePath] + return nil, err or 'unknown error' + end + + ---@alias PackageSearcher + ---| fun(modName: string): function loader + ---| fun(modName: string): nil, string errmsg + + ---@type PackageSearcher[] + package.searchers = { + function(modName) + local ok, result = pcall(_require, modName) + + if ok then return result end + + return ok, result + end, + function(modName) + if package.preload[modName] ~= nil then + return package.preload[modName] + end + + return nil, ("no field package.preload['%s']"):format(modName) + end, + function(modName) return loadModule(modName) end, + } + + ---@param filePath string + ---@param env? table + ---@return unknown + ---Loads and runs a Lua file at the given path. Unlike require, the chunk is not cached for future use. + function ESX.load(filePath, env) + if type(filePath) ~= 'string' then + error(("file path must be a string (received '%s')"):format(filePath), 2) end - loadingModules[modulePath] = true + local result, err = loadModule(filePath, env) + + if result then return result() end + + error(("file '%s' not found\n\t%s"):format(filePath, err)) + end + + ---@param filePath string + ---@return table + ---Loads and decodes a json file at the given path. + function ESX.loadJson(filePath) + if type(filePath) ~= 'string' then + error(("file path must be a string (received '%s')"):format(filePath), 2) + end + + local resourceSrc, modPath = getModuleInfo(filePath:gsub('%.', '/')) + local resourceFile = LoadResourceFile(resourceSrc, ('%s.json'):format(modPath)) + + if resourceFile then + return json.decode(resourceFile) + end - local resourceName = getResourceNameFromModulePath(modulePath) - local moduleFilePath = getModuleFilePath(modulePath) - local moduleFileContent = LoadResourceFile(resourceName, moduleFilePath .. ".lua") + error(("json file '%s' not found\n\tno file '@%s/%s.json'"):format(filePath, resourceSrc, modPath)) + end - if not moduleFileContent then - loadingModules[modulePath] = nil - error(("Module '%s' not found in resource '%s'."):format(moduleFilePath, resourceName)) + ---Loads the given module, returns any value returned by the seacher (`true` when `nil`).\ + ---Passing `@resourceName.modName` loads a module from a remote resource. + ---@param modName string + ---@return unknown + function ESX.require(modName) + if type(modName) ~= 'string' then + error(("module name must be a string (received '%s')"):format(modName), 3) end - local chunk, err = load(moduleFileContent, ("@%s/%s"):format(resourceName, moduleFilePath), "t") + local module = loaded[modName] - if not chunk then - loadingModules[modulePath] = nil - error(("Failed to load module '%s': %s"):format(moduleFilePath, err)) + if module == '__loading' then + error(("^1circular-dependency occurred when loading module '%s'^0"):format(modName), 2) end - local result = chunk() + if module ~= nil then return module end + + loaded[modName] = '__loading' - cachedModules[modulePath] = result ~= nil and result or true - loadingModules[modulePath] = nil + local err = {} - return result + for i = 1, #package.searchers do + local result, errMsg = package.searchers[i](modName) + if result then + if type(result) == 'function' then result = result() end + loaded[modName] = result or result == nil + + return loaded[modName] + end + + err[#err + 1] = errMsg + end + + error(("%s"):format(table.concat(err, "\n\t"))) end + + require = ESX.require end From eb96467ce150b7c939639db52a9827d2ff5efe67 Mon Sep 17 00:00:00 2001 From: Kasey FItton Date: Sat, 4 Jan 2025 02:28:40 +0000 Subject: [PATCH 05/28] chore: update docs link --- [core]/cron/README.md | 2 +- [core]/es_extended/README.md | 26 ++++++++++---------- [core]/es_extended/shared/main.lua | 6 ++--- [core]/esx_chat_theme/README.md | 2 +- [core]/esx_context/README.md | 2 +- [core]/esx_identity/README.md | 2 +- [core]/esx_loadingscreen/README.md | 2 +- [core]/esx_menu_default/README.md | 2 +- [core]/esx_multicharacter/readme.md | 2 +- [core]/esx_notify/readme.md | 2 +- [core]/esx_textui/readme.md | 2 +- [core]/skinchanger/README.md | 2 +- readme.md | 38 ++++++++++++++--------------- 13 files changed, 45 insertions(+), 45 deletions(-) diff --git a/[core]/cron/README.md b/[core]/cron/README.md index 8ecd4386c..df2e5eeb9 100644 --- a/[core]/cron/README.md +++ b/[core]/cron/README.md @@ -1,4 +1,4 @@ -

[ESX] Cron

Discord - Website - Documentation +

[ESX] Cron

Discord - Website - Documentation A simple, but vital, resource that allows resources to Run tasks at specific intervals. diff --git a/[core]/es_extended/README.md b/[core]/es_extended/README.md index f02b5f71e..32ae43b86 100644 --- a/[core]/es_extended/README.md +++ b/[core]/es_extended/README.md @@ -1,13 +1,13 @@ -

es_extended

Discord - Documentation - -## Legal - -es_extended - -Copyright (C) 2015-2024 Jérémie N'gadi - -This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. - -This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. - -You should have received a copy Of the GNU General Public License along with this program. If Not, see . +

es_extended

Discord - Documentation + +## Legal + +es_extended + +Copyright (C) 2015-2024 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see . diff --git a/[core]/es_extended/shared/main.lua b/[core]/es_extended/shared/main.lua index 00f775b46..5d659daaa 100644 --- a/[core]/es_extended/shared/main.lua +++ b/[core]/es_extended/shared/main.lua @@ -9,8 +9,8 @@ AddEventHandler("esx:getSharedObject", function(cb) cb(ESX) end local invokingResource = GetInvokingResource() - print(("^3[WARNING]^0 Resource ^5%s^0 used the ^5getSharedObject^0 event. This is not the recommended way to import ESX. Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent to find out why."):format(invokingResource)) + print(("^3[WARNING]^0 Resource ^5%s^0 used the ^5getSharedObject^0 event. This is not the recommended way to import ESX. Visit https://docs.esx-legacy.com/tutorials/tutorials-esx/sharedevent to find out why."):format(invokingResource)) end) --- backwards compatibility (DO NOT TOUCH !) -Config.OxInventory = Config.CustomInventory == "ox" \ No newline at end of file +-- backwards compatibility (DO NOT TOUCH !) +Config.OxInventory = Config.CustomInventory == "ox" diff --git a/[core]/esx_chat_theme/README.md b/[core]/esx_chat_theme/README.md index c6c88f0ef..1d149d4ad 100644 --- a/[core]/esx_chat_theme/README.md +++ b/[core]/esx_chat_theme/README.md @@ -1,4 +1,4 @@ -

[ESX] Chat Theme

Discord - Documentation +

[ESX] Chat Theme

Discord - Documentation A ESX-Based Chat-theme for your server diff --git a/[core]/esx_context/README.md b/[core]/esx_context/README.md index c4e378a94..6b6a53de4 100644 --- a/[core]/esx_context/README.md +++ b/[core]/esx_context/README.md @@ -1,4 +1,4 @@ -

[ESX] Context

Discord - Website - Documentation +

[ESX] Context

Discord - Website - Documentation A elegant, easy to use Context Menu system to make User Interactions clean and hassle free diff --git a/[core]/esx_identity/README.md b/[core]/esx_identity/README.md index 3747c631c..c06370815 100644 --- a/[core]/esx_identity/README.md +++ b/[core]/esx_identity/README.md @@ -1,4 +1,4 @@ -

[ESX] Identity

Discord - Documentation +

[ESX] Identity

Discord - Documentation A Core Resource that Allows the player to Pick their characters, Name, Gender, Height and Date-of-birth. diff --git a/[core]/esx_loadingscreen/README.md b/[core]/esx_loadingscreen/README.md index 1f51ae3e0..366c5adaa 100644 --- a/[core]/esx_loadingscreen/README.md +++ b/[core]/esx_loadingscreen/README.md @@ -1,4 +1,4 @@ -

[ESX] Loading Screen

Discord - Website - Documentation +

[ESX] Loading Screen

Discord - Website - Documentation A simple but beautiful Loading Screen for your server! diff --git a/[core]/esx_menu_default/README.md b/[core]/esx_menu_default/README.md index 05abc0380..29e07d1f5 100644 --- a/[core]/esx_menu_default/README.md +++ b/[core]/esx_menu_default/README.md @@ -1,4 +1,4 @@ -

[ESX] Menu Defualt

Discord - Website - Documentation +

[ESX] Menu Defualt

Discord - Website - Documentation A default List type menu for ESX. diff --git a/[core]/esx_multicharacter/readme.md b/[core]/esx_multicharacter/readme.md index 58b30ff43..2517728e7 100644 --- a/[core]/esx_multicharacter/readme.md +++ b/[core]/esx_multicharacter/readme.md @@ -1,4 +1,4 @@ -

[ESX] Multi-Character

Discord - Website - Documentation +

[ESX] Multi-Character

Discord - Website - Documentation A Simplistic system, that allows Players to have multiple Characters, which can be customised for all player with `Config.Slots` or personally set a players character count using `setslots`, `remslots`, `enablechar` and `disablechar` Commands :) diff --git a/[core]/esx_notify/readme.md b/[core]/esx_notify/readme.md index 666b34988..f6bc4c9d7 100644 --- a/[core]/esx_notify/readme.md +++ b/[core]/esx_notify/readme.md @@ -1,4 +1,4 @@ -

[ESX] Notify

Discord - Website - Documentation +

[ESX] Notify

Discord - Website - Documentation A beautiful and simple NUI notification system for ESX diff --git a/[core]/esx_textui/readme.md b/[core]/esx_textui/readme.md index 32796da39..922e11a86 100644 --- a/[core]/esx_textui/readme.md +++ b/[core]/esx_textui/readme.md @@ -1,4 +1,4 @@ -

[ESX] TextUI

Discord - Website - Documentation +

[ESX] TextUI

Discord - Website - Documentation A beautiful and simple Persistent Notification. diff --git a/[core]/skinchanger/README.md b/[core]/skinchanger/README.md index cd763d5c7..7b1b3dd6f 100644 --- a/[core]/skinchanger/README.md +++ b/[core]/skinchanger/README.md @@ -1,4 +1,4 @@ -

[ESX] SkinChanger

Discord - Website - Documentation +

[ESX] SkinChanger

Discord - Website - Documentation skinchanger is a resource used to both Set and Get Players clothing, accessories and Model - It supports the freemode peds `mp_m_freemode_01` and `mp_f_freemode_01` as well as all Ped Features. diff --git a/readme.md b/readme.md index ef2abad0b..3537e4307 100644 --- a/readme.md +++ b/readme.md @@ -1,19 +1,19 @@ -

ESX Legacy

-

Discord - Website - Documentation - -

Want more resources? You can browse the Cfx.re Releases board for more! -

ESX is the leading framework, trusted by over 12,000 communities to provide the highest quality roleplay servers on FiveM

- -
- -### 💗 Supporters - -Interested in helping us? [Take a look at our patreon](https://www.patreon.com/esx "Take a look at our patreon") - -| We would like to sincerely thank the following donors who helped fund the development of ESX. | -| ------------ | -| Mohamad Buhamad - Michael Hein - RoadToSix - Montree Narathong | -| Saydoon - Muhannad alyamani - iSentrie - Wecity - Samuel Nicol | -| Kyle McShea - Artin - Mathias Christoffersen - Jaylan Yilmaz - Callum | -| CONGRESS KW - Michael Hein - Smery sitbon - daZepelin - CMF Community | ------- +

ESX Legacy

+

Discord - Website - Documentation + +

Want more resources? You can browse the Cfx.re Releases board for more! +

ESX is the leading framework, trusted by over 12,000 communities to provide the highest quality roleplay servers on FiveM

+ +
+ +### 💗 Supporters + +Interested in helping us? [Take a look at our patreon](https://www.patreon.com/esx "Take a look at our patreon") + +| We would like to sincerely thank the following donors who helped fund the development of ESX. | +| ------------ | +| Mohamad Buhamad - Michael Hein - RoadToSix - Montree Narathong | +| Saydoon - Muhannad alyamani - iSentrie - Wecity - Samuel Nicol | +| Kyle McShea - Artin - Mathias Christoffersen - Jaylan Yilmaz - Callum | +| CONGRESS KW - Michael Hein - Smery sitbon - daZepelin - CMF Community | +------ From 1094efb80c45fb8cf36272e5bffa42a3a81b0c9b Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Sat, 4 Jan 2025 13:44:21 +0100 Subject: [PATCH 06/28] feat(es_extended/client/modules/scaleform): add ESX.Scaleform.Utils.RunScaleformMovieMethod util function --- .../es_extended/client/modules/scaleform.lua | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/[core]/es_extended/client/modules/scaleform.lua b/[core]/es_extended/client/modules/scaleform.lua index 66479685c..cdb6c1768 100644 --- a/[core]/es_extended/client/modules/scaleform.lua +++ b/[core]/es_extended/client/modules/scaleform.lua @@ -99,3 +99,40 @@ function ESX.Scaleform.Utils.RequestScaleformMovie(movie) return scaleform end + +--- Executes a method on a scaleform movie with optional arguments and return value. +--- The caller is responsible for disposing of the scaleform using `SetScaleformMovieAsNoLongerNeeded`. +---@param scaleform number|string # Scaleform handle or name to request the scaleform movie +---@param methodName string # The method name to call on the scaleform +---@param returnValue? boolean # Whether to return the value from the method +---@param ... number|string|boolean # Arguments to pass to the method +---@return number, number? # The scaleform handle, and the return value if `returnValue` is true +function ESX.Scaleform.Utils.RunScaleformMovieMethod(scaleform, methodName, returnValue, ...) + scaleform = type(scaleform) == "number" and scaleform or ESX.Scaleform.Utils.RequestScaleformMovie(scaleform) + BeginScaleformMovieMethod(scaleform, methodName) + + local args = { ... } + for i, arg in ipairs(args) do + local typeArg = type(arg) + + if typeArg == "number" then + if math.type(arg) == "float" then + ScaleformMovieMethodAddParamFloat(arg) + else + ScaleformMovieMethodAddParamInt(arg) + end + elseif typeArg == "string" then + ScaleformMovieMethodAddParamTextureNameString(arg) + elseif typeArg == "boolean" then + ScaleformMovieMethodAddParamBool(arg) + end + end + + if returnValue then + return scaleform, EndScaleformMovieMethodReturnValue() + end + + EndScaleformMovieMethod() + + return scaleform +end From 68dae93211855716359040a44b02cd035183968d Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Sat, 4 Jan 2025 13:47:36 +0100 Subject: [PATCH 07/28] refactor(es_extended/client/modules/scaleform): refactor ESX.Scaleform.ShowFreemodeMessage --- [core]/es_extended/client/modules/scaleform.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/[core]/es_extended/client/modules/scaleform.lua b/[core]/es_extended/client/modules/scaleform.lua index cdb6c1768..014c4c3c8 100644 --- a/[core]/es_extended/client/modules/scaleform.lua +++ b/[core]/es_extended/client/modules/scaleform.lua @@ -2,12 +2,7 @@ ESX.Scaleform = {} ESX.Scaleform.Utils = {} function ESX.Scaleform.ShowFreemodeMessage(title, msg, sec) - local scaleform = ESX.Scaleform.Utils.RequestScaleformMovie("MP_BIG_MESSAGE_FREEMODE") - - BeginScaleformMovieMethod(scaleform, "SHOW_SHARD_WASTED_MP_MESSAGE") - ScaleformMovieMethodAddParamTextureNameString(title) - ScaleformMovieMethodAddParamTextureNameString(msg) - EndScaleformMovieMethod() + local scaleform = ESX.Scaleform.Utils.RunScaleformMovieMethod("MP_BIG_MESSAGE_FREEMODE", "SHOW_SHARD_WASTED_MP_MESSAGE", false, title, msg) while sec > 0 do Wait(0) From 03de1afa41e9c26a243e29d9c8c1077264246189 Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Sat, 4 Jan 2025 13:48:01 +0100 Subject: [PATCH 08/28] refactor(es_extended/client/modules/scaleform): refactor ESX.Scaleform.ShowBreakingNews --- .../es_extended/client/modules/scaleform.lua | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/[core]/es_extended/client/modules/scaleform.lua b/[core]/es_extended/client/modules/scaleform.lua index 014c4c3c8..ae504cff5 100644 --- a/[core]/es_extended/client/modules/scaleform.lua +++ b/[core]/es_extended/client/modules/scaleform.lua @@ -15,25 +15,9 @@ function ESX.Scaleform.ShowFreemodeMessage(title, msg, sec) end function ESX.Scaleform.ShowBreakingNews(title, msg, bottom, sec) - local scaleform = ESX.Scaleform.Utils.RequestScaleformMovie("BREAKING_NEWS") - - BeginScaleformMovieMethod(scaleform, "SET_TEXT") - ScaleformMovieMethodAddParamTextureNameString(msg) - ScaleformMovieMethodAddParamTextureNameString(bottom) - EndScaleformMovieMethod() - - BeginScaleformMovieMethod(scaleform, "SET_SCROLL_TEXT") - ScaleformMovieMethodAddParamInt(0) -- top ticker - ScaleformMovieMethodAddParamInt(0) -- Since this is the first string, start at 0 - ScaleformMovieMethodAddParamTextureNameString(title) - - EndScaleformMovieMethod() - - BeginScaleformMovieMethod(scaleform, "DISPLAY_SCROLL_TEXT") - ScaleformMovieMethodAddParamInt(0) -- Top ticker - ScaleformMovieMethodAddParamInt(0) -- Index of string - - EndScaleformMovieMethod() + local scaleform = ESX.Scaleform.Utils.RunScaleformMovieMethod("BREAKING_NEWS", "SET_TEXT", false, msg, bottom) + ESX.Scaleform.Utils.RunScaleformMovieMethod(scaleform, "SET_SCROLL_TEXT", false, 0, 0, title) + ESX.Scaleform.Utils.RunScaleformMovieMethod(scaleform, "DISPLAY_SCROLL_TEXT", false, 0, 0) while sec > 0 do Wait(0) From ceb2fd446f7f5137c0b6f296ac23982bb7d85ad2 Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Sat, 4 Jan 2025 13:48:19 +0100 Subject: [PATCH 09/28] refactor(es_extended/client/modules/scaleform): refactor ESX.Scaleform.ShowPopupWarning --- [core]/es_extended/client/modules/scaleform.lua | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/[core]/es_extended/client/modules/scaleform.lua b/[core]/es_extended/client/modules/scaleform.lua index ae504cff5..438b0b186 100644 --- a/[core]/es_extended/client/modules/scaleform.lua +++ b/[core]/es_extended/client/modules/scaleform.lua @@ -30,17 +30,7 @@ function ESX.Scaleform.ShowBreakingNews(title, msg, bottom, sec) end function ESX.Scaleform.ShowPopupWarning(title, msg, bottom, sec) - local scaleform = ESX.Scaleform.Utils.RequestScaleformMovie("POPUP_WARNING") - - BeginScaleformMovieMethod(scaleform, "SHOW_POPUP_WARNING") - - ScaleformMovieMethodAddParamFloat(500.0) -- black background - ScaleformMovieMethodAddParamTextureNameString(title) - ScaleformMovieMethodAddParamTextureNameString(msg) - ScaleformMovieMethodAddParamTextureNameString(bottom) - ScaleformMovieMethodAddParamBool(true) - - EndScaleformMovieMethod() + local scaleform = ESX.Scaleform.Utils.RunScaleformMovieMethod("POPUP_WARNING", "SHOW_POPUP_WARNING", false, 500.0, title, msg, bottom, true) while sec > 0 do Wait(0) From 8844b57d17bc9134c6a6cd54a0375f1637547829 Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Sat, 4 Jan 2025 13:48:47 +0100 Subject: [PATCH 10/28] refactor(es_extended/client/modules/scaleform): refactor ESX.Scaleform.ShowTrafficMovie --- [core]/es_extended/client/modules/scaleform.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/[core]/es_extended/client/modules/scaleform.lua b/[core]/es_extended/client/modules/scaleform.lua index 438b0b186..1a2f1f786 100644 --- a/[core]/es_extended/client/modules/scaleform.lua +++ b/[core]/es_extended/client/modules/scaleform.lua @@ -43,11 +43,7 @@ function ESX.Scaleform.ShowPopupWarning(title, msg, bottom, sec) end function ESX.Scaleform.ShowTrafficMovie(sec) - local scaleform = ESX.Scaleform.Utils.RequestScaleformMovie("TRAFFIC_CAM") - - BeginScaleformMovieMethod(scaleform, "PLAY_CAM_MOVIE") - - EndScaleformMovieMethod() + local scaleform = ESX.Scaleform.Utils.RunScaleformMovieMethod("TRAFFIC_CAM", "PLAY_CAM_MOVIE", false) while sec > 0 do Wait(0) From 9470bfdfdd8e8ccf9bae231344fabebdb1d93c4d Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Sat, 4 Jan 2025 14:06:19 +0100 Subject: [PATCH 11/28] refactor(es_extended/client/modules/scaleform): shorter function name --- [core]/es_extended/client/modules/scaleform.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/[core]/es_extended/client/modules/scaleform.lua b/[core]/es_extended/client/modules/scaleform.lua index 1a2f1f786..31d0897e9 100644 --- a/[core]/es_extended/client/modules/scaleform.lua +++ b/[core]/es_extended/client/modules/scaleform.lua @@ -2,7 +2,7 @@ ESX.Scaleform = {} ESX.Scaleform.Utils = {} function ESX.Scaleform.ShowFreemodeMessage(title, msg, sec) - local scaleform = ESX.Scaleform.Utils.RunScaleformMovieMethod("MP_BIG_MESSAGE_FREEMODE", "SHOW_SHARD_WASTED_MP_MESSAGE", false, title, msg) + local scaleform = ESX.Scaleform.Utils.RunMethod("MP_BIG_MESSAGE_FREEMODE", "SHOW_SHARD_WASTED_MP_MESSAGE", false, title, msg) while sec > 0 do Wait(0) @@ -15,9 +15,9 @@ function ESX.Scaleform.ShowFreemodeMessage(title, msg, sec) end function ESX.Scaleform.ShowBreakingNews(title, msg, bottom, sec) - local scaleform = ESX.Scaleform.Utils.RunScaleformMovieMethod("BREAKING_NEWS", "SET_TEXT", false, msg, bottom) - ESX.Scaleform.Utils.RunScaleformMovieMethod(scaleform, "SET_SCROLL_TEXT", false, 0, 0, title) - ESX.Scaleform.Utils.RunScaleformMovieMethod(scaleform, "DISPLAY_SCROLL_TEXT", false, 0, 0) + local scaleform = ESX.Scaleform.Utils.RunMethod("BREAKING_NEWS", "SET_TEXT", false, msg, bottom) + ESX.Scaleform.Utils.RunMethod(scaleform, "SET_SCROLL_TEXT", false, 0, 0, title) + ESX.Scaleform.Utils.RunMethod(scaleform, "DISPLAY_SCROLL_TEXT", false, 0, 0) while sec > 0 do Wait(0) @@ -30,7 +30,7 @@ function ESX.Scaleform.ShowBreakingNews(title, msg, bottom, sec) end function ESX.Scaleform.ShowPopupWarning(title, msg, bottom, sec) - local scaleform = ESX.Scaleform.Utils.RunScaleformMovieMethod("POPUP_WARNING", "SHOW_POPUP_WARNING", false, 500.0, title, msg, bottom, true) + local scaleform = ESX.Scaleform.Utils.RunMethod("POPUP_WARNING", "SHOW_POPUP_WARNING", false, 500.0, title, msg, bottom, true) while sec > 0 do Wait(0) @@ -43,7 +43,7 @@ function ESX.Scaleform.ShowPopupWarning(title, msg, bottom, sec) end function ESX.Scaleform.ShowTrafficMovie(sec) - local scaleform = ESX.Scaleform.Utils.RunScaleformMovieMethod("TRAFFIC_CAM", "PLAY_CAM_MOVIE", false) + local scaleform = ESX.Scaleform.Utils.RunMethod("TRAFFIC_CAM", "PLAY_CAM_MOVIE", false) while sec > 0 do Wait(0) @@ -72,7 +72,7 @@ end ---@param returnValue? boolean # Whether to return the value from the method ---@param ... number|string|boolean # Arguments to pass to the method ---@return number, number? # The scaleform handle, and the return value if `returnValue` is true -function ESX.Scaleform.Utils.RunScaleformMovieMethod(scaleform, methodName, returnValue, ...) +function ESX.Scaleform.Utils.RunMethod(scaleform, methodName, returnValue, ...) scaleform = type(scaleform) == "number" and scaleform or ESX.Scaleform.Utils.RequestScaleformMovie(scaleform) BeginScaleformMovieMethod(scaleform, methodName) From a724874d5315c1758705af64a4ed9d1b223ab24e Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Thu, 2 Jan 2025 12:26:22 +0100 Subject: [PATCH 12/28] fix(es_extended/imports): remove lua 5.4 dependency for importing resources --- [core]/es_extended/imports.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/imports.lua b/[core]/es_extended/imports.lua index 6d6a862e1..5e40a2d08 100644 --- a/[core]/es_extended/imports.lua +++ b/[core]/es_extended/imports.lua @@ -44,7 +44,7 @@ if not IsDuplicityVersion() then -- Only register this event for the client end end -if not lib?.require then +if not lib or not lib.require then local cachedModules = {} ---@type table local loadingModules = {} ---@type table From 7cfb37cf56e05614c46aeb5907ca626d261b5ae1 Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Thu, 2 Jan 2025 12:27:55 +0100 Subject: [PATCH 13/28] fix(es_extended/server/functions): fix ESX.GetItems returning nil --- [core]/es_extended/server/functions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua index a7566ffbc..124170650 100644 --- a/[core]/es_extended/server/functions.lua +++ b/[core]/es_extended/server/functions.lua @@ -563,7 +563,7 @@ end ---@return table function ESX.GetItems() - return Core.Items + return ESX.Items end ---@return table From 81b040d949a731adcff67442477641b010479ca7 Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:45:17 +0100 Subject: [PATCH 14/28] Merge pull request #1575 from Kenshiin13/fix-import fix(es_extended/imports): remove lua 5.4 dependency for importing resources From 13b44b5aa02c6caeeeb0678f593753658e8fc58a Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:30:29 +0100 Subject: [PATCH 15/28] feat(es_extended/shared/modules/table): add ESX.Table.Wipe --- [core]/es_extended/shared/modules/table.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/[core]/es_extended/shared/modules/table.lua b/[core]/es_extended/shared/modules/table.lua index aacb25840..ab4b147d8 100644 --- a/[core]/es_extended/shared/modules/table.lua +++ b/[core]/es_extended/shared/modules/table.lua @@ -224,10 +224,18 @@ function ESX.Table.Sort(t, order) end end -function ESX.Table.ToArray(table) +---@param t table +---@return Array +function ESX.Table.ToArray(t) local array = {} - for _, v in pairs(table) do + for _, v in pairs(t) do array[#array + 1] = v end return array end + +---@param t table +---@return table +function ESX.Table.Wipe(t) + return table.wipe(t) +end \ No newline at end of file From 29e82322b2ca6209026c2ed4dbb894b7eab8dff9 Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:33:11 +0100 Subject: [PATCH 16/28] feat(es_extended/imports): use ox_lib require --- [core]/es_extended/imports.lua | 201 ++++++++++++++++++++++++++------- 1 file changed, 161 insertions(+), 40 deletions(-) diff --git a/[core]/es_extended/imports.lua b/[core]/es_extended/imports.lua index 5e40a2d08..719d06237 100644 --- a/[core]/es_extended/imports.lua +++ b/[core]/es_extended/imports.lua @@ -1,5 +1,5 @@ ESX = exports["es_extended"]:getSharedObject() -_resourceName = GetCurrentResourceName() +ESX.currentResourceName = GetCurrentResourceName() OnPlayerData = function (key, val, last) end @@ -44,67 +44,188 @@ if not IsDuplicityVersion() then -- Only register this event for the client end end -if not lib or not lib.require then - local cachedModules = {} ---@type table - local loadingModules = {} ---@type table - - ---@param modulePath string +if GetResourceState("ox_lib") == "missing" then + ---@Credits: https://github.com/overextended/ox_lib/blob/master/imports/require/shared.lua - Licensed under the GNU Lesser General Public License v3.0 + local loaded = {} + local _require = require + + package = { + path = './?.lua;./?/init.lua', + preload = {}, + loaded = setmetatable({}, { + __index = loaded, + __newindex = function() end, + __metatable = false, + }) + } + + ---@param modName string + ---@return string ---@return string - local function getResourceNameFromModulePath(modulePath) - local externalResourceName = modulePath:match("^@(.-)%.") - if externalResourceName then - return externalResourceName + local function getModuleInfo(modName) + local resource = modName:match('^@(.-)/.+') --[[@as string?]] + + if resource then + return resource, modName:sub(#resource + 3) end - return _resourceName + local idx = 4 -- call stack depth (kept slightly lower than expected depth "just in case") + + while true do + local dbgInfo = debug.getinfo(idx, 'S') + local src = dbgInfo and dbgInfo.source + + if not src then + return ESX.currentResourceName, modName + end + + resource = src:match('^@@([^/]+)/.+') + + if resource and not src:find('^@@es_extended/imports') then + return resource, modName + end + + idx = idx + 1 + end end - ---@param modulePath string - ---@return string, number - local function getModuleFilePath(modulePath) - if modulePath:sub(1, 1) == "@" then - modulePath = modulePath:sub(modulePath:find("%.") + 1) + local tempData = {} + + ---@param name string + ---@param path string + ---@return string? filename + ---@return string? errmsg + ---@diagnostic disable-next-line: duplicate-set-field + function package.searchpath(name, path) + local resource, modName = getModuleInfo(name:gsub('%.', '/')) + local tried = {} + + for template in path:gmatch('[^;]+') do + local fileName = template:gsub('^%./', ''):gsub('?', modName:gsub('%.', '/') or modName) + local file = LoadResourceFile(resource, fileName) + + if file then + tempData[1] = file + tempData[2] = resource + return fileName + end + + tried[#tried + 1] = ("no file '@%s/%s'"):format(resource, fileName) end - return modulePath:gsub("%.", "/") + return nil, table.concat(tried, "\n\t") end - ---@param modulePath string - ---@return any - function require(modulePath) - assert(type(modulePath) == "string", "Module path must be a string") + ---Attempts to load a module at the given path relative to the resource root directory.\ + ---Returns a function to load the module chunk, or a string containing all tested paths. + ---@param modName string + ---@param env? table + local function loadModule(modName, env) + local fileName, err = package.searchpath(modName, package.path) - if loadingModules[modulePath] then - error(("Circular dependency detected for module '%s'."):format(modulePath)) + if fileName then + local file = tempData[1] + local resource = tempData[2] + + ESX.Table.Wipe(tempData) + return assert(load(file, ('@@%s/%s'):format(resource, fileName), 't', env or _ENV)) end - if cachedModules[modulePath] then - return cachedModules[modulePath] + return nil, err or 'unknown error' + end + + ---@alias PackageSearcher + ---| fun(modName: string): function loader + ---| fun(modName: string): nil, string errmsg + + ---@type PackageSearcher[] + package.searchers = { + function(modName) + local ok, result = pcall(_require, modName) + + if ok then return result end + + return ok, result + end, + function(modName) + if package.preload[modName] ~= nil then + return package.preload[modName] + end + + return nil, ("no field package.preload['%s']"):format(modName) + end, + function(modName) return loadModule(modName) end, + } + + ---@param filePath string + ---@param env? table + ---@return unknown + ---Loads and runs a Lua file at the given path. Unlike require, the chunk is not cached for future use. + function ESX.load(filePath, env) + if type(filePath) ~= 'string' then + error(("file path must be a string (received '%s')"):format(filePath), 2) end - loadingModules[modulePath] = true + local result, err = loadModule(filePath, env) + + if result then return result() end + + error(("file '%s' not found\n\t%s"):format(filePath, err)) + end + + ---@param filePath string + ---@return table + ---Loads and decodes a json file at the given path. + function ESX.loadJson(filePath) + if type(filePath) ~= 'string' then + error(("file path must be a string (received '%s')"):format(filePath), 2) + end + + local resourceSrc, modPath = getModuleInfo(filePath:gsub('%.', '/')) + local resourceFile = LoadResourceFile(resourceSrc, ('%s.json'):format(modPath)) + + if resourceFile then + return json.decode(resourceFile) + end - local resourceName = getResourceNameFromModulePath(modulePath) - local moduleFilePath = getModuleFilePath(modulePath) - local moduleFileContent = LoadResourceFile(resourceName, moduleFilePath .. ".lua") + error(("json file '%s' not found\n\tno file '@%s/%s.json'"):format(filePath, resourceSrc, modPath)) + end - if not moduleFileContent then - loadingModules[modulePath] = nil - error(("Module '%s' not found in resource '%s'."):format(moduleFilePath, resourceName)) + ---Loads the given module, returns any value returned by the seacher (`true` when `nil`).\ + ---Passing `@resourceName.modName` loads a module from a remote resource. + ---@param modName string + ---@return unknown + function ESX.require(modName) + if type(modName) ~= 'string' then + error(("module name must be a string (received '%s')"):format(modName), 3) end - local chunk, err = load(moduleFileContent, ("@%s/%s"):format(resourceName, moduleFilePath), "t") + local module = loaded[modName] - if not chunk then - loadingModules[modulePath] = nil - error(("Failed to load module '%s': %s"):format(moduleFilePath, err)) + if module == '__loading' then + error(("^1circular-dependency occurred when loading module '%s'^0"):format(modName), 2) end - local result = chunk() + if module ~= nil then return module end + + loaded[modName] = '__loading' - cachedModules[modulePath] = result ~= nil and result or true - loadingModules[modulePath] = nil + local err = {} - return result + for i = 1, #package.searchers do + local result, errMsg = package.searchers[i](modName) + if result then + if type(result) == 'function' then result = result() end + loaded[modName] = result or result == nil + + return loaded[modName] + end + + err[#err + 1] = errMsg + end + + error(("%s"):format(table.concat(err, "\n\t"))) end + + require = ESX.require end From 6e60ef6626623ea1be62e35810fe235aa8893410 Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:39:06 +0100 Subject: [PATCH 17/28] Merge branch 'dev' into ox-lib-require From 65777432b8f70f0a32aebecf9c8a2cc569fc6c7b Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Fri, 3 Jan 2025 11:04:19 +0100 Subject: [PATCH 18/28] Merge pull request #1576 from Kenshiin13/ox-lib-require feat(es_extended/imports): use ox_lib require From 5583578d7c193eeb19e957db31e3894441b6e0e7 Mon Sep 17 00:00:00 2001 From: Kasey FItton Date: Thu, 2 Jan 2025 04:54:22 +0000 Subject: [PATCH 19/28] chore: version bump From 351377db0b6da0dd41d96a6a518ed0b81894ff7c Mon Sep 17 00:00:00 2001 From: Kasey Fitton Date: Thu, 2 Jan 2025 04:55:15 +0000 Subject: [PATCH 20/28] Merge pull request #1573 from esx-framework/dev 1.12.2 Release From 92ad81a9b8ec57f08d31463d91aa981cc2f27641 Mon Sep 17 00:00:00 2001 From: Kasey Fitton Date: Thu, 2 Jan 2025 04:56:21 +0000 Subject: [PATCH 21/28] Merge pull request #1574 from Mycroft-Studios/main chore: version bump From 208a705368aa0a8d39ab7601857f155d62595684 Mon Sep 17 00:00:00 2001 From: Kasey FItton Date: Sat, 4 Jan 2025 02:26:49 +0000 Subject: [PATCH 22/28] Merge branch 'dev' into new-docs-link From 83e3538f43f5b8cea06a50bf311395fd28cbc77d Mon Sep 17 00:00:00 2001 From: Kasey FItton Date: Sat, 4 Jan 2025 02:28:40 +0000 Subject: [PATCH 23/28] chore: update docs link --- [core]/cron/README.md | 2 +- [core]/es_extended/README.md | 26 ++++++++++---------- [core]/es_extended/shared/main.lua | 6 ++--- [core]/esx_chat_theme/README.md | 2 +- [core]/esx_context/README.md | 2 +- [core]/esx_identity/README.md | 2 +- [core]/esx_loadingscreen/README.md | 2 +- [core]/esx_menu_default/README.md | 2 +- [core]/esx_multicharacter/readme.md | 2 +- [core]/esx_notify/readme.md | 2 +- [core]/esx_textui/readme.md | 2 +- [core]/skinchanger/README.md | 2 +- readme.md | 38 ++++++++++++++--------------- 13 files changed, 45 insertions(+), 45 deletions(-) diff --git a/[core]/cron/README.md b/[core]/cron/README.md index 8ecd4386c..df2e5eeb9 100644 --- a/[core]/cron/README.md +++ b/[core]/cron/README.md @@ -1,4 +1,4 @@ -

[ESX] Cron

Discord - Website - Documentation +

[ESX] Cron

Discord - Website - Documentation A simple, but vital, resource that allows resources to Run tasks at specific intervals. diff --git a/[core]/es_extended/README.md b/[core]/es_extended/README.md index f02b5f71e..32ae43b86 100644 --- a/[core]/es_extended/README.md +++ b/[core]/es_extended/README.md @@ -1,13 +1,13 @@ -

es_extended

Discord - Documentation - -## Legal - -es_extended - -Copyright (C) 2015-2024 Jérémie N'gadi - -This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. - -This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. - -You should have received a copy Of the GNU General Public License along with this program. If Not, see . +

es_extended

Discord - Documentation + +## Legal + +es_extended + +Copyright (C) 2015-2024 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see . diff --git a/[core]/es_extended/shared/main.lua b/[core]/es_extended/shared/main.lua index 00f775b46..5d659daaa 100644 --- a/[core]/es_extended/shared/main.lua +++ b/[core]/es_extended/shared/main.lua @@ -9,8 +9,8 @@ AddEventHandler("esx:getSharedObject", function(cb) cb(ESX) end local invokingResource = GetInvokingResource() - print(("^3[WARNING]^0 Resource ^5%s^0 used the ^5getSharedObject^0 event. This is not the recommended way to import ESX. Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent to find out why."):format(invokingResource)) + print(("^3[WARNING]^0 Resource ^5%s^0 used the ^5getSharedObject^0 event. This is not the recommended way to import ESX. Visit https://docs.esx-legacy.com/tutorials/tutorials-esx/sharedevent to find out why."):format(invokingResource)) end) --- backwards compatibility (DO NOT TOUCH !) -Config.OxInventory = Config.CustomInventory == "ox" \ No newline at end of file +-- backwards compatibility (DO NOT TOUCH !) +Config.OxInventory = Config.CustomInventory == "ox" diff --git a/[core]/esx_chat_theme/README.md b/[core]/esx_chat_theme/README.md index c6c88f0ef..1d149d4ad 100644 --- a/[core]/esx_chat_theme/README.md +++ b/[core]/esx_chat_theme/README.md @@ -1,4 +1,4 @@ -

[ESX] Chat Theme

Discord - Documentation +

[ESX] Chat Theme

Discord - Documentation A ESX-Based Chat-theme for your server diff --git a/[core]/esx_context/README.md b/[core]/esx_context/README.md index c4e378a94..6b6a53de4 100644 --- a/[core]/esx_context/README.md +++ b/[core]/esx_context/README.md @@ -1,4 +1,4 @@ -

[ESX] Context

Discord - Website - Documentation +

[ESX] Context

Discord - Website - Documentation A elegant, easy to use Context Menu system to make User Interactions clean and hassle free diff --git a/[core]/esx_identity/README.md b/[core]/esx_identity/README.md index 3747c631c..c06370815 100644 --- a/[core]/esx_identity/README.md +++ b/[core]/esx_identity/README.md @@ -1,4 +1,4 @@ -

[ESX] Identity

Discord - Documentation +

[ESX] Identity

Discord - Documentation A Core Resource that Allows the player to Pick their characters, Name, Gender, Height and Date-of-birth. diff --git a/[core]/esx_loadingscreen/README.md b/[core]/esx_loadingscreen/README.md index 1f51ae3e0..366c5adaa 100644 --- a/[core]/esx_loadingscreen/README.md +++ b/[core]/esx_loadingscreen/README.md @@ -1,4 +1,4 @@ -

[ESX] Loading Screen

Discord - Website - Documentation +

[ESX] Loading Screen

Discord - Website - Documentation A simple but beautiful Loading Screen for your server! diff --git a/[core]/esx_menu_default/README.md b/[core]/esx_menu_default/README.md index 05abc0380..29e07d1f5 100644 --- a/[core]/esx_menu_default/README.md +++ b/[core]/esx_menu_default/README.md @@ -1,4 +1,4 @@ -

[ESX] Menu Defualt

Discord - Website - Documentation +

[ESX] Menu Defualt

Discord - Website - Documentation A default List type menu for ESX. diff --git a/[core]/esx_multicharacter/readme.md b/[core]/esx_multicharacter/readme.md index 58b30ff43..2517728e7 100644 --- a/[core]/esx_multicharacter/readme.md +++ b/[core]/esx_multicharacter/readme.md @@ -1,4 +1,4 @@ -

[ESX] Multi-Character

Discord - Website - Documentation +

[ESX] Multi-Character

Discord - Website - Documentation A Simplistic system, that allows Players to have multiple Characters, which can be customised for all player with `Config.Slots` or personally set a players character count using `setslots`, `remslots`, `enablechar` and `disablechar` Commands :) diff --git a/[core]/esx_notify/readme.md b/[core]/esx_notify/readme.md index 666b34988..f6bc4c9d7 100644 --- a/[core]/esx_notify/readme.md +++ b/[core]/esx_notify/readme.md @@ -1,4 +1,4 @@ -

[ESX] Notify

Discord - Website - Documentation +

[ESX] Notify

Discord - Website - Documentation A beautiful and simple NUI notification system for ESX diff --git a/[core]/esx_textui/readme.md b/[core]/esx_textui/readme.md index 32796da39..922e11a86 100644 --- a/[core]/esx_textui/readme.md +++ b/[core]/esx_textui/readme.md @@ -1,4 +1,4 @@ -

[ESX] TextUI

Discord - Website - Documentation +

[ESX] TextUI

Discord - Website - Documentation A beautiful and simple Persistent Notification. diff --git a/[core]/skinchanger/README.md b/[core]/skinchanger/README.md index cd763d5c7..7b1b3dd6f 100644 --- a/[core]/skinchanger/README.md +++ b/[core]/skinchanger/README.md @@ -1,4 +1,4 @@ -

[ESX] SkinChanger

Discord - Website - Documentation +

[ESX] SkinChanger

Discord - Website - Documentation skinchanger is a resource used to both Set and Get Players clothing, accessories and Model - It supports the freemode peds `mp_m_freemode_01` and `mp_f_freemode_01` as well as all Ped Features. diff --git a/readme.md b/readme.md index ef2abad0b..3537e4307 100644 --- a/readme.md +++ b/readme.md @@ -1,19 +1,19 @@ -

ESX Legacy

-

Discord - Website - Documentation - -

Want more resources? You can browse the Cfx.re Releases board for more! -

ESX is the leading framework, trusted by over 12,000 communities to provide the highest quality roleplay servers on FiveM

- -
- -### 💗 Supporters - -Interested in helping us? [Take a look at our patreon](https://www.patreon.com/esx "Take a look at our patreon") - -| We would like to sincerely thank the following donors who helped fund the development of ESX. | -| ------------ | -| Mohamad Buhamad - Michael Hein - RoadToSix - Montree Narathong | -| Saydoon - Muhannad alyamani - iSentrie - Wecity - Samuel Nicol | -| Kyle McShea - Artin - Mathias Christoffersen - Jaylan Yilmaz - Callum | -| CONGRESS KW - Michael Hein - Smery sitbon - daZepelin - CMF Community | ------- +

ESX Legacy

+

Discord - Website - Documentation + +

Want more resources? You can browse the Cfx.re Releases board for more! +

ESX is the leading framework, trusted by over 12,000 communities to provide the highest quality roleplay servers on FiveM

+ +
+ +### 💗 Supporters + +Interested in helping us? [Take a look at our patreon](https://www.patreon.com/esx "Take a look at our patreon") + +| We would like to sincerely thank the following donors who helped fund the development of ESX. | +| ------------ | +| Mohamad Buhamad - Michael Hein - RoadToSix - Montree Narathong | +| Saydoon - Muhannad alyamani - iSentrie - Wecity - Samuel Nicol | +| Kyle McShea - Artin - Mathias Christoffersen - Jaylan Yilmaz - Callum | +| CONGRESS KW - Michael Hein - Smery sitbon - daZepelin - CMF Community | +------ From 0690f106df493c5882a4042c0536298f7faac444 Mon Sep 17 00:00:00 2001 From: Kasey Fitton Date: Sat, 4 Jan 2025 13:06:23 +0000 Subject: [PATCH 24/28] Merge pull request #1580 from Mycroft-Studios/new-docs-link chore: update docs link From bbcb3f2f2636b5c5ec956b41f9119110698a33ae Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:41:38 +0100 Subject: [PATCH 25/28] Revert "Dev" --- [core]/cron/README.md | 2 +- [core]/es_extended/README.md | 26 +-- .../es_extended/client/modules/scaleform.lua | 84 ++++---- [core]/es_extended/imports.lua | 201 ++++-------------- [core]/es_extended/server/functions.lua | 2 +- [core]/es_extended/shared/main.lua | 6 +- [core]/es_extended/shared/modules/table.lua | 12 +- [core]/esx_chat_theme/README.md | 2 +- [core]/esx_context/README.md | 2 +- [core]/esx_identity/README.md | 2 +- [core]/esx_loadingscreen/README.md | 2 +- [core]/esx_menu_default/README.md | 2 +- [core]/esx_multicharacter/readme.md | 2 +- [core]/esx_notify/readme.md | 2 +- [core]/esx_textui/readme.md | 2 +- [core]/skinchanger/README.md | 2 +- readme.md | 38 ++-- 17 files changed, 129 insertions(+), 260 deletions(-) diff --git a/[core]/cron/README.md b/[core]/cron/README.md index df2e5eeb9..8ecd4386c 100644 --- a/[core]/cron/README.md +++ b/[core]/cron/README.md @@ -1,4 +1,4 @@ -

[ESX] Cron

Discord - Website - Documentation +

[ESX] Cron

Discord - Website - Documentation A simple, but vital, resource that allows resources to Run tasks at specific intervals. diff --git a/[core]/es_extended/README.md b/[core]/es_extended/README.md index 32ae43b86..f02b5f71e 100644 --- a/[core]/es_extended/README.md +++ b/[core]/es_extended/README.md @@ -1,13 +1,13 @@ -

es_extended

Discord - Documentation - -## Legal - -es_extended - -Copyright (C) 2015-2024 Jérémie N'gadi - -This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. - -This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. - -You should have received a copy Of the GNU General Public License along with this program. If Not, see . +

es_extended

Discord - Documentation + +## Legal + +es_extended + +Copyright (C) 2015-2024 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see . diff --git a/[core]/es_extended/client/modules/scaleform.lua b/[core]/es_extended/client/modules/scaleform.lua index 31d0897e9..66479685c 100644 --- a/[core]/es_extended/client/modules/scaleform.lua +++ b/[core]/es_extended/client/modules/scaleform.lua @@ -2,7 +2,12 @@ ESX.Scaleform = {} ESX.Scaleform.Utils = {} function ESX.Scaleform.ShowFreemodeMessage(title, msg, sec) - local scaleform = ESX.Scaleform.Utils.RunMethod("MP_BIG_MESSAGE_FREEMODE", "SHOW_SHARD_WASTED_MP_MESSAGE", false, title, msg) + local scaleform = ESX.Scaleform.Utils.RequestScaleformMovie("MP_BIG_MESSAGE_FREEMODE") + + BeginScaleformMovieMethod(scaleform, "SHOW_SHARD_WASTED_MP_MESSAGE") + ScaleformMovieMethodAddParamTextureNameString(title) + ScaleformMovieMethodAddParamTextureNameString(msg) + EndScaleformMovieMethod() while sec > 0 do Wait(0) @@ -15,9 +20,25 @@ function ESX.Scaleform.ShowFreemodeMessage(title, msg, sec) end function ESX.Scaleform.ShowBreakingNews(title, msg, bottom, sec) - local scaleform = ESX.Scaleform.Utils.RunMethod("BREAKING_NEWS", "SET_TEXT", false, msg, bottom) - ESX.Scaleform.Utils.RunMethod(scaleform, "SET_SCROLL_TEXT", false, 0, 0, title) - ESX.Scaleform.Utils.RunMethod(scaleform, "DISPLAY_SCROLL_TEXT", false, 0, 0) + local scaleform = ESX.Scaleform.Utils.RequestScaleformMovie("BREAKING_NEWS") + + BeginScaleformMovieMethod(scaleform, "SET_TEXT") + ScaleformMovieMethodAddParamTextureNameString(msg) + ScaleformMovieMethodAddParamTextureNameString(bottom) + EndScaleformMovieMethod() + + BeginScaleformMovieMethod(scaleform, "SET_SCROLL_TEXT") + ScaleformMovieMethodAddParamInt(0) -- top ticker + ScaleformMovieMethodAddParamInt(0) -- Since this is the first string, start at 0 + ScaleformMovieMethodAddParamTextureNameString(title) + + EndScaleformMovieMethod() + + BeginScaleformMovieMethod(scaleform, "DISPLAY_SCROLL_TEXT") + ScaleformMovieMethodAddParamInt(0) -- Top ticker + ScaleformMovieMethodAddParamInt(0) -- Index of string + + EndScaleformMovieMethod() while sec > 0 do Wait(0) @@ -30,7 +51,17 @@ function ESX.Scaleform.ShowBreakingNews(title, msg, bottom, sec) end function ESX.Scaleform.ShowPopupWarning(title, msg, bottom, sec) - local scaleform = ESX.Scaleform.Utils.RunMethod("POPUP_WARNING", "SHOW_POPUP_WARNING", false, 500.0, title, msg, bottom, true) + local scaleform = ESX.Scaleform.Utils.RequestScaleformMovie("POPUP_WARNING") + + BeginScaleformMovieMethod(scaleform, "SHOW_POPUP_WARNING") + + ScaleformMovieMethodAddParamFloat(500.0) -- black background + ScaleformMovieMethodAddParamTextureNameString(title) + ScaleformMovieMethodAddParamTextureNameString(msg) + ScaleformMovieMethodAddParamTextureNameString(bottom) + ScaleformMovieMethodAddParamBool(true) + + EndScaleformMovieMethod() while sec > 0 do Wait(0) @@ -43,7 +74,11 @@ function ESX.Scaleform.ShowPopupWarning(title, msg, bottom, sec) end function ESX.Scaleform.ShowTrafficMovie(sec) - local scaleform = ESX.Scaleform.Utils.RunMethod("TRAFFIC_CAM", "PLAY_CAM_MOVIE", false) + local scaleform = ESX.Scaleform.Utils.RequestScaleformMovie("TRAFFIC_CAM") + + BeginScaleformMovieMethod(scaleform, "PLAY_CAM_MOVIE") + + EndScaleformMovieMethod() while sec > 0 do Wait(0) @@ -64,40 +99,3 @@ function ESX.Scaleform.Utils.RequestScaleformMovie(movie) return scaleform end - ---- Executes a method on a scaleform movie with optional arguments and return value. ---- The caller is responsible for disposing of the scaleform using `SetScaleformMovieAsNoLongerNeeded`. ----@param scaleform number|string # Scaleform handle or name to request the scaleform movie ----@param methodName string # The method name to call on the scaleform ----@param returnValue? boolean # Whether to return the value from the method ----@param ... number|string|boolean # Arguments to pass to the method ----@return number, number? # The scaleform handle, and the return value if `returnValue` is true -function ESX.Scaleform.Utils.RunMethod(scaleform, methodName, returnValue, ...) - scaleform = type(scaleform) == "number" and scaleform or ESX.Scaleform.Utils.RequestScaleformMovie(scaleform) - BeginScaleformMovieMethod(scaleform, methodName) - - local args = { ... } - for i, arg in ipairs(args) do - local typeArg = type(arg) - - if typeArg == "number" then - if math.type(arg) == "float" then - ScaleformMovieMethodAddParamFloat(arg) - else - ScaleformMovieMethodAddParamInt(arg) - end - elseif typeArg == "string" then - ScaleformMovieMethodAddParamTextureNameString(arg) - elseif typeArg == "boolean" then - ScaleformMovieMethodAddParamBool(arg) - end - end - - if returnValue then - return scaleform, EndScaleformMovieMethodReturnValue() - end - - EndScaleformMovieMethod() - - return scaleform -end diff --git a/[core]/es_extended/imports.lua b/[core]/es_extended/imports.lua index 719d06237..6d6a862e1 100644 --- a/[core]/es_extended/imports.lua +++ b/[core]/es_extended/imports.lua @@ -1,5 +1,5 @@ ESX = exports["es_extended"]:getSharedObject() -ESX.currentResourceName = GetCurrentResourceName() +_resourceName = GetCurrentResourceName() OnPlayerData = function (key, val, last) end @@ -44,188 +44,67 @@ if not IsDuplicityVersion() then -- Only register this event for the client end end -if GetResourceState("ox_lib") == "missing" then - ---@Credits: https://github.com/overextended/ox_lib/blob/master/imports/require/shared.lua - Licensed under the GNU Lesser General Public License v3.0 - local loaded = {} - local _require = require - - package = { - path = './?.lua;./?/init.lua', - preload = {}, - loaded = setmetatable({}, { - __index = loaded, - __newindex = function() end, - __metatable = false, - }) - } - - ---@param modName string - ---@return string - ---@return string - local function getModuleInfo(modName) - local resource = modName:match('^@(.-)/.+') --[[@as string?]] +if not lib?.require then + local cachedModules = {} ---@type table + local loadingModules = {} ---@type table - if resource then - return resource, modName:sub(#resource + 3) + ---@param modulePath string + ---@return string + local function getResourceNameFromModulePath(modulePath) + local externalResourceName = modulePath:match("^@(.-)%.") + if externalResourceName then + return externalResourceName end - local idx = 4 -- call stack depth (kept slightly lower than expected depth "just in case") - - while true do - local dbgInfo = debug.getinfo(idx, 'S') - local src = dbgInfo and dbgInfo.source - - if not src then - return ESX.currentResourceName, modName - end - - resource = src:match('^@@([^/]+)/.+') - - if resource and not src:find('^@@es_extended/imports') then - return resource, modName - end - - idx = idx + 1 - end + return _resourceName end - local tempData = {} - - ---@param name string - ---@param path string - ---@return string? filename - ---@return string? errmsg - ---@diagnostic disable-next-line: duplicate-set-field - function package.searchpath(name, path) - local resource, modName = getModuleInfo(name:gsub('%.', '/')) - local tried = {} - - for template in path:gmatch('[^;]+') do - local fileName = template:gsub('^%./', ''):gsub('?', modName:gsub('%.', '/') or modName) - local file = LoadResourceFile(resource, fileName) - - if file then - tempData[1] = file - tempData[2] = resource - return fileName - end - - tried[#tried + 1] = ("no file '@%s/%s'"):format(resource, fileName) + ---@param modulePath string + ---@return string, number + local function getModuleFilePath(modulePath) + if modulePath:sub(1, 1) == "@" then + modulePath = modulePath:sub(modulePath:find("%.") + 1) end - return nil, table.concat(tried, "\n\t") + return modulePath:gsub("%.", "/") end - ---Attempts to load a module at the given path relative to the resource root directory.\ - ---Returns a function to load the module chunk, or a string containing all tested paths. - ---@param modName string - ---@param env? table - local function loadModule(modName, env) - local fileName, err = package.searchpath(modName, package.path) + ---@param modulePath string + ---@return any + function require(modulePath) + assert(type(modulePath) == "string", "Module path must be a string") - if fileName then - local file = tempData[1] - local resource = tempData[2] - - ESX.Table.Wipe(tempData) - return assert(load(file, ('@@%s/%s'):format(resource, fileName), 't', env or _ENV)) + if loadingModules[modulePath] then + error(("Circular dependency detected for module '%s'."):format(modulePath)) end - return nil, err or 'unknown error' - end - - ---@alias PackageSearcher - ---| fun(modName: string): function loader - ---| fun(modName: string): nil, string errmsg - - ---@type PackageSearcher[] - package.searchers = { - function(modName) - local ok, result = pcall(_require, modName) - - if ok then return result end - - return ok, result - end, - function(modName) - if package.preload[modName] ~= nil then - return package.preload[modName] - end - - return nil, ("no field package.preload['%s']"):format(modName) - end, - function(modName) return loadModule(modName) end, - } - - ---@param filePath string - ---@param env? table - ---@return unknown - ---Loads and runs a Lua file at the given path. Unlike require, the chunk is not cached for future use. - function ESX.load(filePath, env) - if type(filePath) ~= 'string' then - error(("file path must be a string (received '%s')"):format(filePath), 2) + if cachedModules[modulePath] then + return cachedModules[modulePath] end - local result, err = loadModule(filePath, env) - - if result then return result() end - - error(("file '%s' not found\n\t%s"):format(filePath, err)) - end - - ---@param filePath string - ---@return table - ---Loads and decodes a json file at the given path. - function ESX.loadJson(filePath) - if type(filePath) ~= 'string' then - error(("file path must be a string (received '%s')"):format(filePath), 2) - end - - local resourceSrc, modPath = getModuleInfo(filePath:gsub('%.', '/')) - local resourceFile = LoadResourceFile(resourceSrc, ('%s.json'):format(modPath)) - - if resourceFile then - return json.decode(resourceFile) - end + loadingModules[modulePath] = true - error(("json file '%s' not found\n\tno file '@%s/%s.json'"):format(filePath, resourceSrc, modPath)) - end + local resourceName = getResourceNameFromModulePath(modulePath) + local moduleFilePath = getModuleFilePath(modulePath) + local moduleFileContent = LoadResourceFile(resourceName, moduleFilePath .. ".lua") - ---Loads the given module, returns any value returned by the seacher (`true` when `nil`).\ - ---Passing `@resourceName.modName` loads a module from a remote resource. - ---@param modName string - ---@return unknown - function ESX.require(modName) - if type(modName) ~= 'string' then - error(("module name must be a string (received '%s')"):format(modName), 3) + if not moduleFileContent then + loadingModules[modulePath] = nil + error(("Module '%s' not found in resource '%s'."):format(moduleFilePath, resourceName)) end - local module = loaded[modName] + local chunk, err = load(moduleFileContent, ("@%s/%s"):format(resourceName, moduleFilePath), "t") - if module == '__loading' then - error(("^1circular-dependency occurred when loading module '%s'^0"):format(modName), 2) + if not chunk then + loadingModules[modulePath] = nil + error(("Failed to load module '%s': %s"):format(moduleFilePath, err)) end - if module ~= nil then return module end - - loaded[modName] = '__loading' + local result = chunk() - local err = {} + cachedModules[modulePath] = result ~= nil and result or true + loadingModules[modulePath] = nil - for i = 1, #package.searchers do - local result, errMsg = package.searchers[i](modName) - if result then - if type(result) == 'function' then result = result() end - loaded[modName] = result or result == nil - - return loaded[modName] - end - - err[#err + 1] = errMsg - end - - error(("%s"):format(table.concat(err, "\n\t"))) + return result end - - require = ESX.require end diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua index 124170650..a7566ffbc 100644 --- a/[core]/es_extended/server/functions.lua +++ b/[core]/es_extended/server/functions.lua @@ -563,7 +563,7 @@ end ---@return table function ESX.GetItems() - return ESX.Items + return Core.Items end ---@return table diff --git a/[core]/es_extended/shared/main.lua b/[core]/es_extended/shared/main.lua index 5d659daaa..00f775b46 100644 --- a/[core]/es_extended/shared/main.lua +++ b/[core]/es_extended/shared/main.lua @@ -9,8 +9,8 @@ AddEventHandler("esx:getSharedObject", function(cb) cb(ESX) end local invokingResource = GetInvokingResource() - print(("^3[WARNING]^0 Resource ^5%s^0 used the ^5getSharedObject^0 event. This is not the recommended way to import ESX. Visit https://docs.esx-legacy.com/tutorials/tutorials-esx/sharedevent to find out why."):format(invokingResource)) + print(("^3[WARNING]^0 Resource ^5%s^0 used the ^5getSharedObject^0 event. This is not the recommended way to import ESX. Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent to find out why."):format(invokingResource)) end) --- backwards compatibility (DO NOT TOUCH !) -Config.OxInventory = Config.CustomInventory == "ox" +-- backwards compatibility (DO NOT TOUCH !) +Config.OxInventory = Config.CustomInventory == "ox" \ No newline at end of file diff --git a/[core]/es_extended/shared/modules/table.lua b/[core]/es_extended/shared/modules/table.lua index ab4b147d8..aacb25840 100644 --- a/[core]/es_extended/shared/modules/table.lua +++ b/[core]/es_extended/shared/modules/table.lua @@ -224,18 +224,10 @@ function ESX.Table.Sort(t, order) end end ----@param t table ----@return Array -function ESX.Table.ToArray(t) +function ESX.Table.ToArray(table) local array = {} - for _, v in pairs(t) do + for _, v in pairs(table) do array[#array + 1] = v end return array end - ----@param t table ----@return table -function ESX.Table.Wipe(t) - return table.wipe(t) -end \ No newline at end of file diff --git a/[core]/esx_chat_theme/README.md b/[core]/esx_chat_theme/README.md index 1d149d4ad..c6c88f0ef 100644 --- a/[core]/esx_chat_theme/README.md +++ b/[core]/esx_chat_theme/README.md @@ -1,4 +1,4 @@ -

[ESX] Chat Theme

Discord - Documentation +

[ESX] Chat Theme

Discord - Documentation A ESX-Based Chat-theme for your server diff --git a/[core]/esx_context/README.md b/[core]/esx_context/README.md index 6b6a53de4..c4e378a94 100644 --- a/[core]/esx_context/README.md +++ b/[core]/esx_context/README.md @@ -1,4 +1,4 @@ -

[ESX] Context

Discord - Website - Documentation +

[ESX] Context

Discord - Website - Documentation A elegant, easy to use Context Menu system to make User Interactions clean and hassle free diff --git a/[core]/esx_identity/README.md b/[core]/esx_identity/README.md index c06370815..3747c631c 100644 --- a/[core]/esx_identity/README.md +++ b/[core]/esx_identity/README.md @@ -1,4 +1,4 @@ -

[ESX] Identity

Discord - Documentation +

[ESX] Identity

Discord - Documentation A Core Resource that Allows the player to Pick their characters, Name, Gender, Height and Date-of-birth. diff --git a/[core]/esx_loadingscreen/README.md b/[core]/esx_loadingscreen/README.md index 366c5adaa..1f51ae3e0 100644 --- a/[core]/esx_loadingscreen/README.md +++ b/[core]/esx_loadingscreen/README.md @@ -1,4 +1,4 @@ -

[ESX] Loading Screen

Discord - Website - Documentation +

[ESX] Loading Screen

Discord - Website - Documentation A simple but beautiful Loading Screen for your server! diff --git a/[core]/esx_menu_default/README.md b/[core]/esx_menu_default/README.md index 29e07d1f5..05abc0380 100644 --- a/[core]/esx_menu_default/README.md +++ b/[core]/esx_menu_default/README.md @@ -1,4 +1,4 @@ -

[ESX] Menu Defualt

Discord - Website - Documentation +

[ESX] Menu Defualt

Discord - Website - Documentation A default List type menu for ESX. diff --git a/[core]/esx_multicharacter/readme.md b/[core]/esx_multicharacter/readme.md index 2517728e7..58b30ff43 100644 --- a/[core]/esx_multicharacter/readme.md +++ b/[core]/esx_multicharacter/readme.md @@ -1,4 +1,4 @@ -

[ESX] Multi-Character

Discord - Website - Documentation +

[ESX] Multi-Character

Discord - Website - Documentation A Simplistic system, that allows Players to have multiple Characters, which can be customised for all player with `Config.Slots` or personally set a players character count using `setslots`, `remslots`, `enablechar` and `disablechar` Commands :) diff --git a/[core]/esx_notify/readme.md b/[core]/esx_notify/readme.md index f6bc4c9d7..666b34988 100644 --- a/[core]/esx_notify/readme.md +++ b/[core]/esx_notify/readme.md @@ -1,4 +1,4 @@ -

[ESX] Notify

Discord - Website - Documentation +

[ESX] Notify

Discord - Website - Documentation A beautiful and simple NUI notification system for ESX diff --git a/[core]/esx_textui/readme.md b/[core]/esx_textui/readme.md index 922e11a86..32796da39 100644 --- a/[core]/esx_textui/readme.md +++ b/[core]/esx_textui/readme.md @@ -1,4 +1,4 @@ -

[ESX] TextUI

Discord - Website - Documentation +

[ESX] TextUI

Discord - Website - Documentation A beautiful and simple Persistent Notification. diff --git a/[core]/skinchanger/README.md b/[core]/skinchanger/README.md index 7b1b3dd6f..cd763d5c7 100644 --- a/[core]/skinchanger/README.md +++ b/[core]/skinchanger/README.md @@ -1,4 +1,4 @@ -

[ESX] SkinChanger

Discord - Website - Documentation +

[ESX] SkinChanger

Discord - Website - Documentation skinchanger is a resource used to both Set and Get Players clothing, accessories and Model - It supports the freemode peds `mp_m_freemode_01` and `mp_f_freemode_01` as well as all Ped Features. diff --git a/readme.md b/readme.md index 3537e4307..ef2abad0b 100644 --- a/readme.md +++ b/readme.md @@ -1,19 +1,19 @@ -

ESX Legacy

-

Discord - Website - Documentation - -

Want more resources? You can browse the Cfx.re Releases board for more! -

ESX is the leading framework, trusted by over 12,000 communities to provide the highest quality roleplay servers on FiveM

- -
- -### 💗 Supporters - -Interested in helping us? [Take a look at our patreon](https://www.patreon.com/esx "Take a look at our patreon") - -| We would like to sincerely thank the following donors who helped fund the development of ESX. | -| ------------ | -| Mohamad Buhamad - Michael Hein - RoadToSix - Montree Narathong | -| Saydoon - Muhannad alyamani - iSentrie - Wecity - Samuel Nicol | -| Kyle McShea - Artin - Mathias Christoffersen - Jaylan Yilmaz - Callum | -| CONGRESS KW - Michael Hein - Smery sitbon - daZepelin - CMF Community | ------- +

ESX Legacy

+

Discord - Website - Documentation + +

Want more resources? You can browse the Cfx.re Releases board for more! +

ESX is the leading framework, trusted by over 12,000 communities to provide the highest quality roleplay servers on FiveM

+ +
+ +### 💗 Supporters + +Interested in helping us? [Take a look at our patreon](https://www.patreon.com/esx "Take a look at our patreon") + +| We would like to sincerely thank the following donors who helped fund the development of ESX. | +| ------------ | +| Mohamad Buhamad - Michael Hein - RoadToSix - Montree Narathong | +| Saydoon - Muhannad alyamani - iSentrie - Wecity - Samuel Nicol | +| Kyle McShea - Artin - Mathias Christoffersen - Jaylan Yilmaz - Callum | +| CONGRESS KW - Michael Hein - Smery sitbon - daZepelin - CMF Community | +------ From 642b1e60ce4d05b81a2db57b3688c75dc3c2c46c Mon Sep 17 00:00:00 2001 From: Manifest Bumper <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:45:23 +0000 Subject: [PATCH 26/28] chore: bump manifest version to 1.12.3 --- [core]/cron/fxmanifest.lua | 2 +- [core]/es_extended/fxmanifest.lua | 2 +- [core]/esx_chat_theme/fxmanifest.lua | 2 +- [core]/esx_context/fxmanifest.lua | 2 +- [core]/esx_identity/fxmanifest.lua | 2 +- [core]/esx_loadingscreen/fxmanifest.lua | 2 +- [core]/esx_menu_default/fxmanifest.lua | 2 +- [core]/esx_menu_dialog/fxmanifest.lua | 2 +- [core]/esx_menu_list/fxmanifest.lua | 2 +- [core]/esx_multicharacter/fxmanifest.lua | 2 +- [core]/esx_notify/fxmanifest.lua | 2 +- [core]/esx_progressbar/fxmanifest.lua | 2 +- [core]/esx_skin/fxmanifest.lua | 2 +- [core]/esx_textui/fxmanifest.lua | 2 +- [core]/skinchanger/fxmanifest.lua | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/[core]/cron/fxmanifest.lua b/[core]/cron/fxmanifest.lua index 200cf33ff..db502695f 100644 --- a/[core]/cron/fxmanifest.lua +++ b/[core]/cron/fxmanifest.lua @@ -4,6 +4,6 @@ game 'gta5' author 'ESX-Framework' description 'Allows resources to Run tasks at specific intervals.' lua54 'yes' -version '1.12.2' +version '1.12.3' server_script 'server/main.lua' diff --git a/[core]/es_extended/fxmanifest.lua b/[core]/es_extended/fxmanifest.lua index c43e95745..a579d4eed 100644 --- a/[core]/es_extended/fxmanifest.lua +++ b/[core]/es_extended/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'cerulean' game 'gta5' description 'The Core resource that provides the functionalities for all other resources.' lua54 'yes' -version '1.12.2' +version '1.12.3' shared_scripts { 'locale.lua', diff --git a/[core]/esx_chat_theme/fxmanifest.lua b/[core]/esx_chat_theme/fxmanifest.lua index e29afa251..704c76b3b 100644 --- a/[core]/esx_chat_theme/fxmanifest.lua +++ b/[core]/esx_chat_theme/fxmanifest.lua @@ -1,4 +1,4 @@ -version '1.12.2' +version '1.12.3' author 'ESX-Framework' description 'A ESX Stylised theme for the chat resource.' diff --git a/[core]/esx_context/fxmanifest.lua b/[core]/esx_context/fxmanifest.lua index 0db66d928..4be9c6188 100644 --- a/[core]/esx_context/fxmanifest.lua +++ b/[core]/esx_context/fxmanifest.lua @@ -4,7 +4,7 @@ game 'gta5' author 'ESX-Framework & Brayden' description 'A simplistic context menu for ESX.' lua54 'yes' -version '1.12.2' +version '1.12.3' ui_page 'index.html' diff --git a/[core]/esx_identity/fxmanifest.lua b/[core]/esx_identity/fxmanifest.lua index 027d11686..1ff5e2dec 100644 --- a/[core]/esx_identity/fxmanifest.lua +++ b/[core]/esx_identity/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' description 'Allows the player to Pick their characters: Name, Gender, Height and Date-of-birth.' lua54 'yes' -version '1.12.2' +version '1.12.3' shared_scripts { '@es_extended/imports.lua', diff --git a/[core]/esx_loadingscreen/fxmanifest.lua b/[core]/esx_loadingscreen/fxmanifest.lua index 35acfdb98..9c5eba200 100644 --- a/[core]/esx_loadingscreen/fxmanifest.lua +++ b/[core]/esx_loadingscreen/fxmanifest.lua @@ -3,7 +3,7 @@ game 'common' fx_version 'cerulean' author 'ESX-Framework' description 'Allows resources to Run tasks at specific intervals.' -version '1.12.2' +version '1.12.3' lua54 'yes' loadscreen 'index.html' diff --git a/[core]/esx_menu_default/fxmanifest.lua b/[core]/esx_menu_default/fxmanifest.lua index 851fbcd67..fc1719983 100644 --- a/[core]/esx_menu_default/fxmanifest.lua +++ b/[core]/esx_menu_default/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' description 'A basic menu system for ESX Legacy.' lua54 'yes' -version '1.12.2' +version '1.12.3' client_scripts { '@es_extended/imports.lua', 'client/main.lua' } diff --git a/[core]/esx_menu_dialog/fxmanifest.lua b/[core]/esx_menu_dialog/fxmanifest.lua index a932977af..093505750 100644 --- a/[core]/esx_menu_dialog/fxmanifest.lua +++ b/[core]/esx_menu_dialog/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' description 'A basic input dialog for ESX Legacy.' lua54 'yes' -version '1.12.2' +version '1.12.3' client_scripts { '@es_extended/imports.lua', diff --git a/[core]/esx_menu_list/fxmanifest.lua b/[core]/esx_menu_list/fxmanifest.lua index 606c36ad9..f0f4b534d 100644 --- a/[core]/esx_menu_list/fxmanifest.lua +++ b/[core]/esx_menu_list/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' description 'A basic table-based menu system for ESX Legacy.' lua54 'yes' -version '1.12.2' +version '1.12.3' client_scripts { diff --git a/[core]/esx_multicharacter/fxmanifest.lua b/[core]/esx_multicharacter/fxmanifest.lua index 81c76c372..670945b92 100644 --- a/[core]/esx_multicharacter/fxmanifest.lua +++ b/[core]/esx_multicharacter/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'cerulean' game 'gta5' author 'ESX-Framework - Linden - KASH' description 'Allows players to have multiple characters on the same account.' -version '1.12.2' +version '1.12.3' lua54 'yes' dependencies { 'es_extended', 'esx_context', 'esx_identity', 'esx_skin' } diff --git a/[core]/esx_notify/fxmanifest.lua b/[core]/esx_notify/fxmanifest.lua index d019b983c..dd5546813 100644 --- a/[core]/esx_notify/fxmanifest.lua +++ b/[core]/esx_notify/fxmanifest.lua @@ -2,7 +2,7 @@ fx_version 'adamant' lua54 'yes' game 'gta5' -version '1.12.2' +version '1.12.3' author 'ESX-Framework' description 'A beautiful and simple NUI notification system for ESX' diff --git a/[core]/esx_progressbar/fxmanifest.lua b/[core]/esx_progressbar/fxmanifest.lua index 54caeda1d..2180b57fd 100644 --- a/[core]/esx_progressbar/fxmanifest.lua +++ b/[core]/esx_progressbar/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' author 'ESX-Framework' description 'A beautiful and simple NUI progress bar for ESX' -version '1.12.2' +version '1.12.3' lua54 'yes' client_scripts { 'Progress.lua' } diff --git a/[core]/esx_skin/fxmanifest.lua b/[core]/esx_skin/fxmanifest.lua index 0485a1719..25569210b 100644 --- a/[core]/esx_skin/fxmanifest.lua +++ b/[core]/esx_skin/fxmanifest.lua @@ -2,7 +2,7 @@ fx_version 'adamant' game 'gta5' description 'Allows players to customise their character\'s appearance' -version '1.12.2' +version '1.12.3' lua54 'yes' shared_scripts { diff --git a/[core]/esx_textui/fxmanifest.lua b/[core]/esx_textui/fxmanifest.lua index 4dc027b82..0fdd56050 100644 --- a/[core]/esx_textui/fxmanifest.lua +++ b/[core]/esx_textui/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' author 'ESX-Framework' description 'A beautiful and simple Persistent Notification system for ESX.' -version '1.12.2' +version '1.12.3' lua54 'yes' client_scripts { 'TextUI.lua' } diff --git a/[core]/skinchanger/fxmanifest.lua b/[core]/skinchanger/fxmanifest.lua index 43cefff94..288bd7513 100644 --- a/[core]/skinchanger/fxmanifest.lua +++ b/[core]/skinchanger/fxmanifest.lua @@ -2,7 +2,7 @@ fx_version 'adamant' game 'gta5' description 'Saves/loads character appearances for ESX Legacy.' -version '1.12.2' +version '1.12.3' lua54 'yes' client_scripts { From 0426e760859f0d73213b499801165e6ad392ca38 Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Sun, 12 Jan 2025 14:51:20 +0100 Subject: [PATCH 27/28] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 6 ++---- .github/ISSUE_TEMPLATE/feature_request.md | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index db7c127df..c31700d93 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,10 +2,8 @@ name: Bug report about: Create a report to help us improve title: "[Bug] - esx_script - Issue" -labels: bug -assignees: - - TheFantomas - - Gellipapa +labels: bug, enhancement +assignees: Kenshiin13, Arctos2win --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bc4eaabaf..bca7278bb 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -3,9 +3,7 @@ name: Feature Request about: Help us improve esx with your ideas title: "[Feature Request] - esx_script - Add better configuration" labels: enhancement -assignees: - - TheFantomas - - Gellipapa +assignees: Kenshiin13, Arctos2win --- From 11d3c72b2b883f624077cadcba684048ed1c54c1 Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Sun, 12 Jan 2025 14:53:05 +0100 Subject: [PATCH 28/28] fix(esx_core): remove enhancement from bug report --- .github/ISSUE_TEMPLATE/bug_report.md | 4 ++-- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c31700d93..584089651 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,8 +2,8 @@ name: Bug report about: Create a report to help us improve title: "[Bug] - esx_script - Issue" -labels: bug, enhancement -assignees: Kenshiin13, Arctos2win +labels: bug +assignees: Arctos2win, Kenshiin13 --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bca7278bb..305b3f1b6 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -3,7 +3,7 @@ name: Feature Request about: Help us improve esx with your ideas title: "[Feature Request] - esx_script - Add better configuration" labels: enhancement -assignees: Kenshiin13, Arctos2win +assignees: Arctos2win, Kenshiin13 ---