Giter VIP home page Giter VIP logo

menuv's Introduction

MenuV | Standalone Menu for FiveM | NUI Menu

N|CoreV

Issues License Forks Stars


MenuV is a library written for FiveM and only uses NUI functionalities. This library allows you to create menus in FiveM. This project is open-source and you must respect the license and the hard work.

Features

  • Support for simple buttons, sliders, checkboxes, lists and confirms
  • Support for emojis on items
  • Support for custom colors (RGB)
  • Support for all screen resolutions.
  • Item descriptions
  • Rebindable keys
  • Event-based callbacks
  • Uses 2 msec while menu open and idle.
  • Documentation on menuv.fivem.io/api/
  • Themes: default or native

Compile files

MenuV uses VueJS 2.6.11 or newer and TypeScript 3.8.3 or newer with NodeJS Package Manager. You need to have NPM a.k.a NodeJS Package Manager installed on your system in order to compile MenuV files.

First download all dependencies by doing

npm install

After you have downloaded/loaded all dependencies, you can compile MenuV files by doeing.

npx webpack

After the command is executed you will see a dist folder containing all the NUI files needed for MenuV.

When downloading a release, this step is not necessary. Files are already compiled.

How to use?

  1. Add start menuv to your server.cfg before the resources that's uses menuv

  2. To use MenuV you must add @menuv/menuv.lua in your fxmanifest.lua file.

    client_scripts {
       '@menuv/menuv.lua',
       'example.lua'
    }

Create a menu

Create a menu by calling the MenuV:CreateMenu function.

MenuV:CreateMenu(title: string, subtitle: string, position: string, red: number, green: number, blue: number, texture: string, disctionary: string, namespace: string, theme: string)

Example:

local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'default', 'menuv', 'example_namespace', 'native')

Create menu items

Create a item by calling AddButton, AddConfirm, AddRange, AddCheckbox or AddSlider in the created menu

/** CREATE A BUTTON */
menu:AddButton({ icon: string, label: string, description: string, value: any, disabled: boolean });

/** CREATE A CONFIRM */
menu:AddConfirm({ icon: string, label: string, description: string, value: boolean, disabled: boolean });

/** CREATE A RANGE */
menu:AddRange({ icon: string, label: string, description: string, value: number, min: number, max: number, disabled: boolean });

/** CREATE A CHECKBOX */
menu:AddCheckbox({ icon: string, label: string, description: string, value: boolean, disabled: boolean });

/** CREATE A SLIDER */
menu:AddSlider({ icon: string, label: string, description: string, value: number, values: [] { label: string, value: any, description: string }, disabled: boolean });

To see example in practice, see example.lua

Events

In MenuV you can register event-based callbacks on menu and/or items.

/** REGISTER A EVENT ON MENU */
menu:On(event: string, callback: function);

/** REGISTER A EVENT ON ANY ITEM */
item:On(event: string, callback: function);

Documentation

Read MenuV documentation

License

Project is written by ThymonA and published under GNU General Public License v3.0 Read License

Screenshot

How is this menu made? see example.lua

Default Native
MenuV Default MenuV Native
Default Theme Native Theme

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.