-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Progressbar Support #26
base: master
Are you sure you want to change the base?
Conversation
Added default QB progressbar and an_progBar as options for a progressbar.
Added progressbar options in config.lua file.
This has been configured for Picking Up, taking otu, and dropping off the package between the van and npc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea but pointed out some changes for us to consider. Also I wonder if there's a way we can make some sort of callback function to handle this usage of progress bar. If not I'm okay with adding this block of code into the function
@@ -159,6 +173,31 @@ function pickupMail() | |||
return | |||
end | |||
|
|||
if (USE_PROGRESS_BAR) then | |||
if (PROGRESS_BAR == 'qb') then | |||
QBCore.Functions.Progressbar("grab_mail", "Grabbing Package from Mailbox", Config.PROGRESS_BAR_DURATION, false, false, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use FRAMEWORK
here
if (Config.FRAMEWORK == 'qb') then | ||
FRAMEWORK = Config.GET_CORE | ||
elseif (Config.FRAMEWORK == 'esx') then | ||
FRAMEWORK = exports["es_extended"]:getSharedObject() | ||
elseif (Config.FRAMEWORK == 'esx-old') then | ||
TriggerEvent('esx:getSharedObject', function(obj) FRAMEWORK = obj end) | ||
else | ||
-- put in custom logic to grab framework and delete print code underneath | ||
print('^6[^3dream-postal^6]^0 Unsupported Framework detected!') | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already grab framework in client_util so this code is not needed. With that being said is client_util loaded in first? If not then we must change order in fxmanifest.lua
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this added lines
@@ -44,6 +44,11 @@ Config.PAY_MULTIPLIER = 1.5 | |||
-- Whether or not to show the white arrow marker above the drop off ped & blue postal boxes. | |||
Config.SHOW_WHITE_ARROW_MARKER = true | |||
|
|||
-- Whether or not to show progressbar and what kind/duration. | |||
Config.USE_PROGRESS_BAR = true -- use progress bar or not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking we initialize this to false
Added progressbar support for the default qb-progressbar as well as an_progBar noted in the issue.