Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

reevesplayer
Copy link

Added progressbar support for the default qb-progressbar as well as an_progBar noted in the issue.

Added default QB progressbar and an_progBar as options for a progressbar.
Added progressbar options in config.lua file.
@reevesplayer
Copy link
Author

This has been configured for Picking Up, taking otu, and dropping off the package between the van and npc.

Copy link
Owner

@kylemcshea kylemcshea left a 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, {
Copy link
Owner

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

Comment on lines +1 to +10
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
Copy link
Owner

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

Comment on lines +732 to +733


Copy link
Owner

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants