put unit test inside debug level 1

This commit is contained in:
gononono64 committed 2025-02-23 10:37:12 -06:00
1 parent b75ab8479b
commit bb7549b988
1 file changed
+10 -10
+10 -10
View File
@@ -89,6 +89,15 @@ function Dialogue.OpenDialogue( name, dialogue, characterOptions, dialogueOption
promises[name] = wrappedFunction promises[name] = wrappedFunction
end end
RegisterNuiCallback("dialogue:SelectOption", function(data)
local promis = promises[data.name]
if not promis then return end
promis(data.id)
end)
-- Debug command
if BridgeSharedConfig.DebugLevel >= 1 then
RegisterCommand("dialogue", function() RegisterCommand("dialogue", function()
local pos = GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0, 2.0, 0) local pos = GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0, 2.0, 0)
local timeout = 500 local timeout = 500
@@ -145,13 +154,4 @@ RegisterCommand("dialogue", function()
end end
end) end)
end) end)
end
RegisterNuiCallback("dialogue:SelectOption", function(data)
local promis = promises[data.name]
if not promis then return end
promis(data.id)
end)
-- { label: 'Hello there! this is some long text that i am Dialogueing', id: '1' },
-- { label: 'Trade with me', id: '2' },
-- { label: 'Goodbye', id: '3' }