2025-06-07 22:50:13 -04:00
|
|
|
---@diagnostic disable: duplicate-set-field
|
2025-05-31 18:55:17 -05:00
|
|
|
local resourceName = "ox_lib"
|
|
|
|
|
local configValue = BridgeClientConfig.InputSystem
|
|
|
|
|
if (configValue == "auto" and GetResourceState(resourceName) == "missing") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
|
|
|
|
|
|
|
|
|
Input = {}
|
2025-07-08 11:49:16 -04:00
|
|
|
|
2025-05-31 18:55:17 -05:00
|
|
|
function Input.Open(title, data, isQBFormat, submitText)
|
|
|
|
|
local inputs = data.inputs
|
|
|
|
|
if isQBFormat then
|
2025-07-29 05:22:55 -05:00
|
|
|
local convertedData = {}
|
|
|
|
|
local returnData = lib.inputDialog(title, QBToOxInput(inputs))
|
|
|
|
|
for i, v in pairs(inputs) do
|
|
|
|
|
for k, j in pairs(returnData or {}) do
|
|
|
|
|
if k == v.name then
|
|
|
|
|
convertedData[v.name] = j
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
return convertedData
|
2025-05-31 18:55:17 -05:00
|
|
|
else
|
|
|
|
|
return lib.inputDialog(title, data)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2025-07-08 11:49:16 -04:00
|
|
|
function Input.GetResourceName()
|
|
|
|
|
return resourceName
|
|
|
|
|
end
|
2025-05-31 18:55:17 -05:00
|
|
|
|
2025-07-08 11:49:16 -04:00
|
|
|
return Input
|