experimental but good
Early on I gave the name management to banking, I know I know it was dumb. BUT we can either deprecate them and move this to it or keep boss menu as its own module and deprecate the banking in time to a name that makes sense. Open to suggestions here
This commit is contained in:
1 parent
003153be63
commit
755fe9ba10
10 files changed
+132
No files matched your search
@@ -33,6 +33,7 @@ server_scripts {
|
||||
'modules/notify/**/server.lua',
|
||||
'modules/housing/**/server.lua',
|
||||
'modules/skills/**/server.lua',
|
||||
'modules/bossmenu/**/server.lua',
|
||||
"lib/**/server.lua",
|
||||
'init.lua',
|
||||
}
|
||||
@@ -59,6 +60,7 @@ client_scripts {
|
||||
'modules/shops/**/client.lua',
|
||||
'modules/housing/**/client.lua',
|
||||
'modules/skills/**/client.lua',
|
||||
'modules/bossmenu/**/client.lua',
|
||||
'init.lua',
|
||||
-- 'unit_tests/input_test.lua',
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ end
|
||||
|
||||
--Bridge
|
||||
Bridge.RegisterModule("Framework", Framework)
|
||||
Bridge.RegisterModule("BossMenu", BossMenu)
|
||||
Bridge.RegisterModule("Inventory", Inventory)
|
||||
Bridge.RegisterModule("Notify", Notify)
|
||||
Bridge.RegisterModule("HelpText", HelpText)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
BossMenu = BossMenu or {}
|
||||
|
||||
---This will get the name of the module being used.
|
||||
---@return string
|
||||
BossMenu.GetResourceName = function()
|
||||
return "default"
|
||||
end
|
||||
|
||||
RegisterNetEvent('community_bridge:client:OpenBossMenu', function(jobName, jobType)
|
||||
-- these systems seem to do the verification for isboss themselves, so we don't need to check if the player is a boss.
|
||||
-- also this source check is to ensure that the event is only triggered by the server.
|
||||
if source ~= 65535 then return end
|
||||
if BossMenu.GetResourceName() == "esx_society" then
|
||||
local ESX = exports["es_extended"]:getSharedObject() -- better solution needed but fuck it for now.
|
||||
TriggerEvent('esx_society:openBossMenu', jobName, function(menu)
|
||||
ESX.CloseContext()
|
||||
end, {wash = false})
|
||||
elseif BossMenu.GetResourceName() == "qbx_management" then
|
||||
exports.qbx_management:OpenBossMenu(jobType)
|
||||
end
|
||||
end)
|
||||
|
||||
return BossMenu
|
||||
@@ -0,0 +1,14 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
BossMenu = BossMenu or {}
|
||||
|
||||
---This will get the name of the module being used.
|
||||
---@return string
|
||||
BossMenu.GetResourceName = function()
|
||||
return "default"
|
||||
end
|
||||
|
||||
BossMenu.OpenBossMenu = function(src, jobName, jobType)
|
||||
print("You are using the community_bridge module for boss menus. Please ensure you have the correct dependencies installed.")
|
||||
end
|
||||
|
||||
return BossMenu
|
||||
@@ -0,0 +1,12 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
if GetResourceState('esx_society') ~= 'started' then return end
|
||||
|
||||
BossMenu = BossMenu or {}
|
||||
|
||||
---This will get the name of the module being used.
|
||||
---@return string
|
||||
BossMenu.GetResourceName = function()
|
||||
return "esx_society"
|
||||
end
|
||||
|
||||
return BossMenu
|
||||
@@ -0,0 +1,21 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
if GetResourceState('esx_society') ~= 'started' then return end
|
||||
|
||||
BossMenu = BossMenu or {}
|
||||
|
||||
---This will get the name of the module being used.
|
||||
---@return string
|
||||
BossMenu.GetResourceName = function()
|
||||
return "esx_society"
|
||||
end
|
||||
|
||||
local registeredSocieties = {}
|
||||
BossMenu.OpenBossMenu = function(src, jobName, jobType)
|
||||
if not registeredSocieties[jobName] then
|
||||
exports["esx_society"]:registerSociety(jobName, jobName, 'society_' .. jobName, 'society_' .. jobName, 'society_' .. jobName, {type = 'private'})
|
||||
registeredSocieties[jobName] = true
|
||||
end
|
||||
TriggerClientEvent("community_bridge:client:OpenBossMenu", src, jobName, jobType)
|
||||
end
|
||||
|
||||
return BossMenu
|
||||
@@ -0,0 +1,13 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
if GetResourceState('qb-management') ~= 'started' then return end
|
||||
if GetResourceState('qbx_management') == 'started' then return end
|
||||
|
||||
BossMenu = BossMenu or {}
|
||||
|
||||
---This will get the name of the module being used.
|
||||
---@return string
|
||||
BossMenu.GetResourceName = function()
|
||||
return "qb-management"
|
||||
end
|
||||
|
||||
return BossMenu
|
||||
@@ -0,0 +1,17 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
if GetResourceState('qb-management') ~= 'started' then return end
|
||||
if GetResourceState('qbx_management') == 'started' then return end
|
||||
|
||||
BossMenu = BossMenu or {}
|
||||
|
||||
---This will get the name of the module being used.
|
||||
---@return string
|
||||
BossMenu.GetResourceName = function()
|
||||
return "qb-management"
|
||||
end
|
||||
|
||||
BossMenu.OpenBossMenu = function(src, jobName, jobType)
|
||||
TriggerClientEvent("qb-bossmenu:client:OpenMenu", src)
|
||||
end
|
||||
|
||||
return BossMenu
|
||||
@@ -0,0 +1,12 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
if GetResourceState('qbx_management') ~= 'started' then return end
|
||||
|
||||
BossMenu = BossMenu or {}
|
||||
|
||||
---This will get the name of the module being used.
|
||||
---@return string
|
||||
BossMenu.GetResourceName = function()
|
||||
return "qbx_management"
|
||||
end
|
||||
|
||||
return BossMenu
|
||||
@@ -0,0 +1,16 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
if GetResourceState('qbx_management') ~= 'started' then return end
|
||||
|
||||
BossMenu = BossMenu or {}
|
||||
|
||||
---This will get the name of the module being used.
|
||||
---@return string
|
||||
BossMenu.GetResourceName = function()
|
||||
return "qbx_management"
|
||||
end
|
||||
|
||||
BossMenu.OpenBossMenu = function(src, jobName, jobType)
|
||||
TriggerClientEvent("community_bridge:client:OpenBossMenu", src, jobName, jobType)
|
||||
end
|
||||
|
||||
return BossMenu
|
||||
Reference in new issue
Block a user