Skip to content

Commit

Permalink
Icons for AddTargetEntity ( OX / QB ) (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSiiN authored Jul 28, 2023
1 parent cf37d86 commit 9f808b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions shared/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ Config.FurnitureTypes = {
["storage"] = function(entity, property_id, shell, furniture, count)
local stash = string.format("property_%s", property_id) -- if you changed this you will fuck things up

Framework[Config.Target].AddTargetEntity(entity, "Storage", function()
Framework[Config.Target].AddTargetEntity(entity, "Storage", "fas fa-box-open", function()
local stashConfig = Config.Shells[shell].stash
Framework[Config.Inventory].OpenInventory(stash, stashConfig)
end)
Expand All @@ -554,7 +554,7 @@ Config.FurnitureTypes = {
end,

["clothing"] = function(entity, property_id, shell, furniture, count)
Framework[Config.Target].AddTargetEntity(entity, "Clothing", function()
Framework[Config.Target].AddTargetEntity(entity, "Clothing", "fas fa-shirt", function()
local heading = GetEntityHeading(cache.ped)
SetEntityHeading(cache.ped, heading - 180.0)
TriggerEvent("qb-clothing:client:openOutfitMenu")
Expand Down Expand Up @@ -1497,4 +1497,4 @@ Config.Furnitures = {
}
}

}
}
6 changes: 4 additions & 2 deletions shared/framework.lua
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,12 @@ Framework.qb = {
exports['qb-radialmenu']:RemoveOption(id)
end,

AddTargetEntity = function (entity, label, action)
AddTargetEntity = function (entity, label, icon, action)
exports["qb-target"]:AddTargetEntity(entity, {
options = {
{
label = label,
icon = icon,
action = action,
},
},
Expand Down Expand Up @@ -411,11 +412,12 @@ Framework.ox = {
lib.removeRadialItem(id)
end,

AddTargetEntity = function (entity, label, action)
AddTargetEntity = function (entity, label, icon, action)
exports.ox_target:addLocalEntity(entity, {
{
name = label,
label = label,
icon = icon,
onSelect = action,
},
})
Expand Down

0 comments on commit 9f808b6

Please sign in to comment.