Prints now run based on debug level, file struct standard
This commit is contained in:
1 parent
b53299e05e
commit
4070458c54
23 files changed
+176
-136
No files matched your search
+3
-3
@@ -4,7 +4,7 @@ lua54 'yes'
|
||||
use_experimental_fxv2_oal 'yes'
|
||||
author 'The Order of the Sacred Framework'
|
||||
description 'A bridge made for the community to use as a base for their own projects. This bridge will allow a single format to work with nearly all commonly used systems while still offering expandability.'
|
||||
version '0.2.5'
|
||||
version '0.2.6'
|
||||
|
||||
shared_scripts {
|
||||
'@ox_lib/init.lua',
|
||||
@@ -23,12 +23,12 @@ server_scripts {
|
||||
'modules/inventory/**/server.lua',
|
||||
'modules/doorlock/**/server.lua',
|
||||
'modules/phone/**/server.lua',
|
||||
'modules/notify/server.lua',
|
||||
'modules/managment/**/server.lua',
|
||||
'modules/dispatch/**/server.lua',
|
||||
'modules/clothing/**/server.lua',
|
||||
'modules/weather/**/server.lua',
|
||||
'modules/vehicleKey/**/server.lua',
|
||||
'modules/notify/**/server.lua',
|
||||
'init.lua',
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ client_scripts {
|
||||
'modules/inventory/**/client.lua',
|
||||
'modules/doorlock/**/client.lua',
|
||||
'modules/phone/**/client.lua',
|
||||
'modules/notify/client.lua',
|
||||
'modules/weather/**/client.lua',
|
||||
'modules/vehicleKey/**/client.lua',
|
||||
'modules/fuel/**/client.lua',
|
||||
@@ -49,6 +48,7 @@ client_scripts {
|
||||
'modules/clothing/**/client.lua',
|
||||
'modules/input/*.lua',
|
||||
'modules/menu/*.lua',
|
||||
'modules/notify/**/client.lua',
|
||||
'init.lua',
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,15 @@ Bridge = {}
|
||||
|
||||
function Bridge.RegisterModule(moduleName, moduleTable)
|
||||
if not moduleTable then
|
||||
print("No moduleTable provided for module and no defaultsTable found: ", moduleName)
|
||||
if BridgeSharedConfig.DebugLevel ~= 0 then
|
||||
print("^6 No moduleTable provided for module: ", moduleName, "^0")
|
||||
end
|
||||
return
|
||||
end
|
||||
if Bridge[moduleName] then
|
||||
print("Module already registered:", moduleName)
|
||||
if BridgeSharedConfig.DebugLevel ~= 0 then
|
||||
print("^6Module already registered:", moduleName, "^0")
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
@@ -18,7 +22,9 @@ function Bridge.RegisterModule(moduleName, moduleTable)
|
||||
for functionName, func in pairs(moduleTable) do
|
||||
wrappedModule[functionName] = func
|
||||
end
|
||||
print("Registering module:", moduleName)
|
||||
if BridgeSharedConfig.DebugLevel ~= 0 then
|
||||
print("^2 Registering module:", moduleName, "^0")
|
||||
end
|
||||
Bridge[moduleName] = wrappedModule
|
||||
--trigger update object event
|
||||
TriggerEvent("Bridge:Refresh", moduleName, wrappedModule)
|
||||
|
||||
+3
-1
@@ -11,7 +11,9 @@ function Require(modulePath, resourceName)
|
||||
|
||||
local id = resourceName .. ":" .. modulePath
|
||||
if loadedModules[id] then
|
||||
print("Returning cached module [" .. id .. "]")
|
||||
if BridgeSharedConfig.DebugLevel ~= 0 then
|
||||
print("Returning cached module [" .. id .. "]")
|
||||
end
|
||||
return loadedModules[id]
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
if GetResourceState('esx_skin') ~= 'started' then return end
|
||||
|
||||
Clothing = {}
|
||||
Clothing = Clothing or {}
|
||||
|
||||
StoredOldClothing = {}
|
||||
|
||||
|
||||
@@ -3,4 +3,22 @@ if GetResourceState('esx_skin') ~= 'started' then return end
|
||||
RegisterNetEvent("esx_skin:save", function(skin)
|
||||
local src = source
|
||||
TriggerClientEvent('community_bridge:client:updateStoredClothing', src, skin)
|
||||
end)
|
||||
end)
|
||||
|
||||
Clothing = Clothing or {}
|
||||
|
||||
Clothing.SetAppearance = function(src, data)
|
||||
--wip
|
||||
end
|
||||
|
||||
Clothing.GetAppearance = function(src)
|
||||
--wip
|
||||
end
|
||||
|
||||
Clothing.RestoreAppearance = function(src)
|
||||
--wip
|
||||
end
|
||||
|
||||
Clothing.ReloadSkin = function(src)
|
||||
--wip
|
||||
end
|
||||
@@ -1,6 +1,6 @@
|
||||
if GetResourceState('fivem-appearance') ~= 'started' then return end
|
||||
|
||||
Clothing = {}
|
||||
Clothing = Clothing or {}
|
||||
|
||||
StoredOldClothing = {}
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
if GetResourceState('fivem-appearance') ~= 'started' then return end
|
||||
|
||||
Clothing = Clothing or {}
|
||||
|
||||
Clothing.SetAppearance = function(src, data)
|
||||
--wip
|
||||
end
|
||||
|
||||
Clothing.GetAppearance = function(src)
|
||||
--wip
|
||||
end
|
||||
|
||||
Clothing.RestoreAppearance = function(src)
|
||||
--wip
|
||||
end
|
||||
|
||||
Clothing.ReloadSkin = function(src)
|
||||
--wip
|
||||
end
|
||||
@@ -1,6 +1,6 @@
|
||||
if GetResourceState('illenium-appearance') ~= 'started' then return end
|
||||
|
||||
Clothing = {}
|
||||
Clothing = Clothing or {}
|
||||
|
||||
StoredOldClothing = {}
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
if GetResourceState('illenium-appearance') ~= 'started' then return end
|
||||
|
||||
Clothing = Clothing or {}
|
||||
|
||||
Clothing.SetAppearance = function(src, data)
|
||||
--wip
|
||||
end
|
||||
|
||||
Clothing.GetAppearance = function(src)
|
||||
--wip
|
||||
end
|
||||
|
||||
Clothing.RestoreAppearance = function(src)
|
||||
--wip
|
||||
end
|
||||
|
||||
Clothing.ReloadSkin = function(src)
|
||||
--wip
|
||||
end
|
||||
@@ -1,6 +1,6 @@
|
||||
if GetResourceState('qb-clothing') ~= 'started' then return end
|
||||
|
||||
Clothing = {}
|
||||
Clothing = Clothing or {}
|
||||
|
||||
StoredOldClothing = {}
|
||||
|
||||
|
||||
@@ -5,4 +5,22 @@ RegisterNetEvent('qb-clothing:saveSkin', function(model, skin)
|
||||
if model ~= nil and skin ~= nil then
|
||||
TriggerClientEvent('community_bridge:client:updateStoredClothing', src, skin)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
Clothing = Clothing or {}
|
||||
|
||||
Clothing.SetAppearance = function(src, data)
|
||||
--wip
|
||||
end
|
||||
|
||||
Clothing.GetAppearance = function(src)
|
||||
--wip
|
||||
end
|
||||
|
||||
Clothing.RestoreAppearance = function(src)
|
||||
--wip
|
||||
end
|
||||
|
||||
Clothing.ReloadSkin = function(src)
|
||||
--wip
|
||||
end
|
||||
@@ -1,43 +0,0 @@
|
||||
if GetResourceState('ox_lib') ~= 'started' then return end
|
||||
|
||||
Notify = Notify or {}
|
||||
|
||||
local isNotifySystem = (not BridgeClientConfig.NotifySystem) or BridgeClientConfig.NotifySystem == 'auto' or BridgeClientConfig.NotifySystem == 'ox'
|
||||
local isHelpTextSystem = (not BridgeClientConfig.HelpTextSystem) or BridgeClientConfig.HelpTextSystem == 'auto' or BridgeClientConfig.HelpTextSystem == 'ox'
|
||||
|
||||
|
||||
|
||||
-- █▄ █ ▄▀▄ ▀█▀ █ █▀ ▀▄▀ ▄▀▀ ▀▄▀ ▄▀▀ ▀█▀ ██▀ █▄ ▄█
|
||||
-- █ ▀█ ▀▄▀ █ █ █▀ █ ▄█▀ █ ▄█▀ █ █▄▄ █ ▀ █
|
||||
if isHelpTextSystem and not isNotifySystem then goto HELP_TEXT_SYSTEM end
|
||||
Notify.SendNotify = function(message, type, time)
|
||||
return exports.ox_lib:notify({ description = message, type = type, position = 'center-left' })
|
||||
end
|
||||
|
||||
|
||||
-- █▄█ ██▀ █ █▀▄ ▀█▀ ██▀ ▀▄▀ ▀█▀ ▄▀▀ ▀▄▀ ▄▀▀ ▀█▀ ██▀ █▄ ▄█
|
||||
-- █ █ █▄▄ █▄▄ █▀ █ █▄▄ █ █ █ ▄█▀ █ ▄█▀ █ █▄▄ █ ▀ █
|
||||
if not isHelpTextSystem then return end
|
||||
::HELP_TEXT_SYSTEM::
|
||||
Notify.ShowHelpText = function(message, _position)
|
||||
if _position == nil then _position = 'left-center' end
|
||||
return exports.ox_lib:showTextUI(message, { position = _position })
|
||||
end
|
||||
|
||||
Notify.HideHelpText = function()
|
||||
return exports.ox_lib:hideTextUI()
|
||||
end
|
||||
|
||||
-- .--------.
|
||||
-- | taktak |
|
||||
-- |/-------'
|
||||
-- .-. ,-.
|
||||
-- ;oo oo;
|
||||
-- / \| |/ \
|
||||
-- |. `. .' .|
|
||||
-- `;.;' `;.;'
|
||||
-- .-^-. .-^-.
|
||||
-- | | | | | |
|
||||
|
||||
|
||||
|
||||
@@ -1,19 +1,75 @@
|
||||
Notify = Notify or {}
|
||||
local notifyType = BridgeClientConfig.NotifySystem
|
||||
local helptextType = BridgeClientConfig.ShowHelpText
|
||||
|
||||
Notify.SendNotify = function(message, type, time)
|
||||
Utility.NotifyText(message)
|
||||
Notify.SendNotify = function(message, _type, time)
|
||||
time = time or 3000
|
||||
if notifyType == 'qb' then
|
||||
return Framework.Notify(message, nil, time)
|
||||
elseif notifyType == 'mythic' then
|
||||
return exports['mythic_notify']:SendAlert('inform', message, time)
|
||||
elseif notifyType == 'pNotify' then
|
||||
return exports['pNotify']:SendNotification({ text = message, type = _type, timeout = time, layout = 'centerRight' })
|
||||
elseif notifyType == 'esx' then
|
||||
return Framework.Notify(message, _type, time)
|
||||
elseif notifyType == 'ox' then
|
||||
return exports.ox_lib:notify({ description = message, type = _type, position = 'center-left' })
|
||||
elseif notifyType == 'okok' then
|
||||
return exports['okokNotify']:Alert('Notification', message, time, _type, false)
|
||||
elseif notifyType == 't-notify' then
|
||||
return exports['t-notify']:Alert({ style = 'info', message = message, duration = time, })
|
||||
elseif notifyType == 'wasabi' then
|
||||
return exports.wasabi_notify:notify(_type, message, time, _type)
|
||||
elseif notifyType == 'custom' then
|
||||
return Prints.Error("You have not set up a custom notify in community_bridge")
|
||||
else
|
||||
return Prints.Error("You have not configured a notify in community_bridge")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Notify.ShowHelpText = function(message, _position)
|
||||
Utility.HelpText(message, 7000)
|
||||
if helptextType == 'ox' then
|
||||
if _position == nil then _position = 'left-center' end
|
||||
return exports.ox_lib:showTextUI(message, { position = _position })
|
||||
elseif helptextType == 'jg' then
|
||||
return exports['jg-textui']:DrawText(message)
|
||||
elseif helptextType == 'qb' then
|
||||
if _position == nil then _position = 'left' end
|
||||
return Framework.ShowHelpText(message, _position)
|
||||
elseif helptextType == 'okok' then
|
||||
if _position == nil then _position = 'left' end
|
||||
return exports['okokTextUI']:Open(message, 'darkblue', _position, false)
|
||||
elseif helptextType == 'cd' then
|
||||
return TriggerEvent('cd_drawtextui:ShowUI', 'show', message)
|
||||
elseif helptextType == 'lab' then
|
||||
return exports['lab-HintUI']:Show(message, "Hint Text")
|
||||
elseif helptextType == 'custom' then
|
||||
return Prints.Error("You have not set up a custom ShowHelpText in community_bridge")
|
||||
else
|
||||
return Prints.Error("You have not configured a ShowHelpText in community_bridge")
|
||||
end
|
||||
end
|
||||
|
||||
Notify.HideHelpText = function()
|
||||
|
||||
Notify.HideHelpText = function()
|
||||
if helptextType == 'ox' then
|
||||
return exports.ox_lib:hideTextUI()
|
||||
elseif helptextType == 'jg' then
|
||||
return exports['jg-textui']:HideText()
|
||||
elseif helptextType == 'qb' then
|
||||
return Framework.HideHelpText()
|
||||
elseif helptextType == 'okok' then
|
||||
return exports['okokTextUI']:Close()
|
||||
elseif helptextType == 'cd' then
|
||||
return TriggerEvent('cd_drawtextui:HideUI')
|
||||
elseif helptextType == 'lab' then
|
||||
return exports['lab-HintUI']:Hide()
|
||||
elseif helptextType == 'custom' then
|
||||
return Prints.Error("You have not set up a custom HideHelpText in community_bridge")
|
||||
else
|
||||
return Prints.Error("You have not configured a HideHelpText in community_bridge")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
RegisterNetEvent('community_bridge:Client:Notify', function(message, _type, time)
|
||||
Notify.SendNotify(message, _type, time)
|
||||
end)
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
if GetResourceState('esx') ~= 'started' then return end
|
||||
if BridgeClientConfig.NotifySystem and (BridgeClientConfig.NotifySystem ~= 'auto' and BridgeClientConfig.NotifySystem ~= 'esx') then return end
|
||||
|
||||
Notify = Notify or {}
|
||||
|
||||
Notify.SendNotify = function(message, type, time)
|
||||
return ESX.ShowNotification(message, type, time)
|
||||
end
|
||||
@@ -1,8 +0,0 @@
|
||||
if GetResourceState('qb-core') ~= 'started' then return end
|
||||
if BridgeClientConfig.NotifySystem and (BridgeClientConfig.NotifySystem ~= 'auto' and BridgeClientConfig.NotifySystem ~= 'qb') then return end
|
||||
Notify = Notify or {}
|
||||
|
||||
|
||||
Notify.SendNotify = function(message, type, time)
|
||||
return TriggerEvent('QBCore:Notify', message, 'primary', time)
|
||||
end
|
||||
@@ -1,11 +0,0 @@
|
||||
if GetResourceState('jg-textui') ~= 'started' then return end
|
||||
if BridgeClientConfig.HelpTextSystem and (BridgeClientConfig.HelpTextSystem ~= 'auto' and BridgeClientConfig.HelpTextSystem ~= 'jg') then return end
|
||||
Notify = Notify or {}
|
||||
|
||||
Notify.ShowHelpText = function(message, _position)
|
||||
return exports['jg-textui']:DrawText(message)
|
||||
end
|
||||
|
||||
Notify.HideHelpText = function()
|
||||
return exports['jg-textui']:HideText()
|
||||
end
|
||||
@@ -1,12 +0,0 @@
|
||||
if GetResourceState('lab-HintUI') ~= 'started' then return end
|
||||
if BridgeClientConfig.HelpTextSystem and (BridgeClientConfig.HelpTextSystem ~= 'auto' and BridgeClientConfig.HelpTextSystem ~= 'lab') then return end
|
||||
|
||||
Notify = Notify or {}
|
||||
|
||||
Notify.ShowHelpText = function(message, _position)
|
||||
return exports['lab-HintUI']:Show(message, "Hint Text")
|
||||
end
|
||||
|
||||
Notify.HideHelpText = function()
|
||||
return exports['lab-HintUI']:Hide()
|
||||
end
|
||||
@@ -1,8 +0,0 @@
|
||||
if GetResourceState('mythic_notify') ~= 'started' then return end
|
||||
if BridgeClientConfig.NotifySystem and (BridgeClientConfig.NotifySystem ~= 'auto' and BridgeClientConfig.NotifySystem ~= 'mythic') then return end
|
||||
|
||||
Notify = Notify or {}
|
||||
|
||||
Notify.SendNotify = function(message, type, time)
|
||||
return exports['mythic_notify']:SendAlert('inform', message, time)
|
||||
end
|
||||
@@ -1,9 +0,0 @@
|
||||
if GetResourceState('pNotify') ~= 'started' then return end
|
||||
if BridgeClientConfig.NotifySystem and (BridgeClientConfig.NotifySystem ~= 'auto' and BridgeClientConfig.NotifySystem ~= 'pNotify') then return end
|
||||
|
||||
Notify = Notify or {}
|
||||
|
||||
|
||||
Notify.SendNotify = function(message, type, time)
|
||||
return exports['pNotify']:SendNotification({ text = message, type = type, timeout = time, layout = 'centerRight' })
|
||||
end
|
||||
@@ -1,8 +0,0 @@
|
||||
if GetResourceState('t-notify') ~= 'started' then return end
|
||||
if BridgeClientConfig.NotifySystem and (BridgeClientConfig.NotifySystem ~= 'auto' and BridgeClientConfig.NotifySystem ~= 't-notify') then return end
|
||||
|
||||
Notify = Notify or {}
|
||||
Notify.SendNotify = function(message, type, time)
|
||||
return exports['t-SendNotify']:Alert({ style = 'info', message = message, duration = time })
|
||||
end
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
if GetResourceState('wasabi_notify') ~= 'started' then return end
|
||||
if BridgeClientConfig.NotifySystem and (BridgeClientConfig.NotifySystem ~= 'auto' and BridgeClientConfig.NotifySystem ~= 'wasabi') then return end
|
||||
|
||||
Notify = Notify or {}
|
||||
Notify.SendNotify = function(message, type, time)
|
||||
return exports.wasabi_notify:notify(type, message, time, type)
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
VehicleKey = {}
|
||||
|
||||
VehicleKey.GiveKeys = function(vehicle, plate)
|
||||
|
||||
end
|
||||
|
||||
VehicleKey.RemoveKeys = function(vehicle, plate)
|
||||
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
VehicleKey = {}
|
||||
|
||||
VehicleKey.GiveKeys = function(src, vehicle, plate)
|
||||
--wip
|
||||
end
|
||||
|
||||
VehicleKey.RemoveKeys = function(src, vehicle, plate)
|
||||
-- wip
|
||||
end
|
||||
Reference in new issue
Block a user