Cleanup and placeable_object replacement

Added cleaned up and improved functionality for placeable object.
Example is in unit tests.

Cleanup whitespace and removed accessibility as not used/not documented and doesnt appear to be useful with our current work flow
This commit is contained in:
gononono64 committed 2025-06-04 15:29:21 -05:00
1 parent b5dd8c018c
commit 3fa933fab1
24 files changed
+698 -903

No files matched your search

+14 -1
View File
@@ -58,7 +58,7 @@ Target.AddGlobalVehicle = function(options)
ox_target:addGlobalVehicle(options)
end
---This will remove target options from all vehicles.
---This will remove target options from all vehicles.
---@param options table
Target.RemoveGlobalVehicle = function(options)
local assembledLables = {}
@@ -96,6 +96,18 @@ Target.RemoveModel = function(model)
ox_target:removeModel(model)
end
-- Target.DisableTargeting = function(bool)
-- ox_target:disableTargeting(bool)
-- end
-- Target.Refresh = function()
-- ox_target:disableTargeting(true)
-- Wait(10)
-- ox_target:disableTargeting(false)
-- end
---This will add a box zone to the target system. This is useful for when you want to add target options to a specific area.
---@param name string
---@param coords table
@@ -104,6 +116,7 @@ end
---@param options table
Target.AddBoxZone = function(name, coords, size, heading, options, debug)
options = Target.FixOptions(options or {})
if not next(options) then return end
local target = ox_target:addBoxZone({
coords = coords,
size = size,
+12
View File
@@ -110,6 +110,17 @@ Target.RemoveModel = function(model)
qb_target:RemoveTargetModel(model)
end
-- Target.DisableTargeting = function(bool)
-- qb_target:AllowTargeting(bool)
-- end
-- Target.Refresh = function()
-- qb_target:AllowTargeting(false)
-- Wait(10)
-- qb_target:AllowTargeting(true)
-- end
---This will add a box zone to the target system. This is useful for when you want to add target options to a specific area.
---@param name string
---@param coords table
@@ -118,6 +129,7 @@ end
---@param options table
Target.AddBoxZone = function(name, coords, size, heading, options, debug)
options = Target.FixOptions(options)
if not next(options) then return end
qb_target:AddBoxZone(name, coords, size.x, size.y, {
name = name,
debugPoly = debug or targetDebug,
@@ -127,6 +127,17 @@ Target.RemoveZone = function(name)
end
end
-- Target.DisableTargeting = function(bool)
-- sleepless_interact:disableInteract(bool)
-- end
-- Target.Refresh = function()
-- sleepless_interact:disableInteract(false)
-- Wait(10)
-- sleepless_interact:disableInteract(true)
-- end
AddEventHandler('onResourceStop', function(resource)
if resource == GetCurrentResourceName() then
for _, target in pairs(targetZones) do