Byte-Labs-Studio / bl_ui

FiveM resource which include a variety of UI components.
MIT License
111 stars 28 forks source link

feat(digitdazzle): Allow setting code through export #8

Closed Moozdzn closed 1 month ago

Moozdzn commented 1 month ago
local success = exports.bl_ui:DigitDazzle(3, {
    code = {5671, 1234, 4321},
    duration = 60000,
})

Code array length matching iterations is assumed Tried making the types generic as they can also be used on wordwizz

Frowmza commented 1 month ago

If neither length nor code is provided, an error will occur. Maybe we could handle this by generating a random code with a default length, like 4, if these values are missing.

Moozdzn commented 1 month ago

Yes, the resource assumes the scripts consuming the exports pass the required parameters, in the release version nui will throw an error if length is not provided. I can assert the digit dazzle parameters in this pr but the same should be done to all mini games if not already

Frowmza commented 1 month ago

true, bet ill merge this for now, i will assert other values later