-
-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(esx/managementoutfits): Boss Managed Outfits support via Command (…
…#341) * feat(esx/managementoutfits): Initial implementation * Add missing translations for bossmanagedoutfits command * Add grade check for command
- Loading branch information
1 parent
b84fe2b
commit 22062a1
Showing
22 changed files
with
134 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
if not Config.BossManagedOutfits then return end | ||
|
||
if Framework.ESX() then return end | ||
|
||
function Management.RemoveItems() | ||
if GetResourceState(Management.ResourceName) ~= "started" then return end | ||
|
||
if Management.ItemIDs.Boss then | ||
exports[Management.ResourceName]:RemoveBossMenuItem(Management.ItemIDs.Boss) | ||
end | ||
if Management.ItemIDs.Gang then | ||
exports[Management.ResourceName]:RemoveGangMenuItem(Management.ItemIDs.Gang) | ||
end | ||
end | ||
|
||
function Management.AddBackMenuItem(managementMenu, args) | ||
local bossMenuEvent = "qb-bossmenu:client:OpenMenu" | ||
if args.type == "Gang" then | ||
bossMenuEvent = "qb-gangmenu:client:OpenMenu" | ||
end | ||
|
||
managementMenu.options[#managementMenu.options+1] = { | ||
title = _L("menu.returnTitle"), | ||
icon = "fa-solid fa-angle-left", | ||
event = bossMenuEvent | ||
} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
if not Config.BossManagedOutfits then return end | ||
|
||
if not Framework.ESX() then return end | ||
|
||
function Management.RemoveItems() | ||
-- Do nothing | ||
end | ||
|
||
function Management.AddItems() | ||
-- Do nothing | ||
end | ||
|
||
function Management.AddBackMenuItem() | ||
-- Do nothing | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
if Config.BossManagedOutfits then | ||
function isBoss(grades, grade) | ||
local highestGrade = grades[1].grade | ||
for i = 2, #grades do | ||
if grades[i].grade > highestGrade then | ||
highestGrade = grades[i].grade | ||
end | ||
end | ||
return highestGrade == grade | ||
end | ||
lib.addCommand("bossmanagedoutfits", { help = _L("commands.bossmanagedoutfits.title"), }, function(source) | ||
local job = Framework.GetJob(source) | ||
local grades = Database.JobGrades.GetByJobName(job.name) | ||
if not grades then | ||
return | ||
end | ||
|
||
if not isBoss(grades, job.grade.level) then | ||
return | ||
end | ||
|
||
TriggerClientEvent("illenium-appearance:client:OutfitManagementMenu", source, { | ||
type = "Job" | ||
}) | ||
end) | ||
end |