Coder Social home page Coder Social logo

progressbar's Introduction

This is QBCore Progressbar edited by me and inspired by NoPixel 4.0.

Screenshot 2024-01-06 175641 Screenshot 2024-01-06 174953

Progressbar

Dependency for creating progressbars in QB-Core.

Usage

QB-Core Functions

Client

  • QBCore.Functions.Progressbar(name: string, label: string, duration: number, useWhileDead: boolean, canCancel: boolean, disableControls: table, animation: table, prop: table, propTwo: table, onFinish: function, onCancel: function)

    Create a new progressbar from the built in qb-core functions.
    Example:

    QBCore.Functions.Progressbar("random_task", "Doing something", 5000, false, true, {
       disableMovement = false,
       disableCarMovement = false,
       disableMouse = false,
       disableCombat = true,
    }, {
       animDict = "mp_suicide",
       anim = "pill",
       flags = 49,
    }, {}, {}, function()
       -- Done
    end, function()
       -- Cancel
    end)

Exports

Client

  • Progress(data: string, handler: function)

    Creates a new progress bar directly from the export, always use the built in qb-core function if possible.
    Example:

    exports['progressbar']:Progress({
       name = "random_task",
       duration = 5000,
       label = "Doing something",
       useWhileDead = false,
       canCancel = true,
       controlDisables = {
           disableMovement = false,
           disableCarMovement = false,
           disableMouse = false,
           disableCombat = true,
       },
       animation = {
           animDict = "mp_suicide",
           anim = "pill",
           flags = 49,
       },
       prop = {},
       propTwo = {}
    }, function(cancelled)
       if not cancelled then
           -- finished
       else
           -- cancelled
       end
    end)

    Props Example:

    exports['progressbar']:Progress({
       name = "random_task",
       duration = 5000,
       label = "Doing something",
       useWhileDead = false,
       canCancel = true,
       controlDisables = {
           disableMovement = false,
           disableCarMovement = false,
           disableMouse = false,
           disableCombat = true,
       },
       animation = {
           animDict = "missheistdockssetup1clipboard@base",
           anim = "pill",
           flags = 49,
       },
       prop = {
         model = 'prop_notepad_01',
         bone = 18905,
         coords = vec3(0.1, 0.02, 0.05),
         rotation = vec3(10.0, 0.0, 0.0),
       },
       propTwo = {
         model = 'prop_pencil_01',
         bone = 58866,
         coords = vec3(0.11, -0.02, 0.001),
         rotation = vec3(-120.0, 0.0, 0.0),
       }
    }, function(cancelled)
       if not cancelled then
           -- finished
       else
           -- cancelled
       end
    end)
    • isDoingSomething()

      Returns a boolean (true/false) depending on if a progressbar is present.
      Example:

      local busy = exports["progressbar"]:isDoingSomething()
    • ProgressWithStartEvent(data: table, start: function, finish: function)

      Works like a normal progressbar, the data parameter should be the same as the data passed into the Progress export above.
      The start function gets triggered upon the start of the progressbar.
      The finish handler is the same as the handler parameter in the Progress export above.

    • ProgressWithTickEvent(data: table, tick: function, finish: function)

      Works like a normal progressbar, the data parameter should be the same as the data passed into the Progress export above.
      The tick function gets triggered every frame while the progressbar is active.
      The finish handler is the same as the handler parameter in the Progress export above.

    • ProgressWithTickEvent(data: table, start: function, tick: function, finish: function)

      Works like a normal progressbar, the data parameter should be the same as the data passed into the Progress export above.
      The start function gets triggered upon the start of the progressbar.
      The tick function gets triggered every frame while the progressbar is active.
      The finish handler is the same as the handler parameter in the Progress export above.

progressbar's People

Contributors

rohkane avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.