Giter Site home page Giter Site logo

thymona / menuv Goto Github PK

View Code? Open in Web Editor NEW
109.0 7.0 131.0 5.66 MB

FiveM menu library for creating menu's with NUI

Home Page: https://menuv.fivem.io/api/

License: GNU General Public License v3.0

TypeScript 19.16% Vue 3.51% Lua 59.13% CSS 12.44% HTML 1.05% JavaScript 4.71%
fivem menu library nui standalone standalone-library fivem-script lua

menuv's Introduction

MenuV | Standalone Menu for FiveM | NUI Menu

N|CoreV

Issues License Forks Stars Discord


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 and TypeScript with NodeJS. If you want to use the master files, you need to build the hole project by doing:

npm install

After you have downloaded/loaded all dependencies, you can build MenuV files by executing the following command:

npm run build

After the command is executed you will see a build folder containing all the resource files. Copy those files to a resource folder called menuv or create a symbolic link like that:

Windows

mklink /J "repositoryPath\build" "fxResourcesPath\menuv"

Linux

ln -s "repositoryPath\build" "fxResourcesPath\menuv"

You can also check this tutorial on how to make a link: https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

When your downloading a release, you don't have to follow this step, because all release version are build version.

How to use?

โš ๏ธ example.lua can't be added in the menuv fxmanifest, you must make an seperate resource like: menuv_example

  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

menuv's People

Contributors

eschiclers avatar iwanheda avatar korioz avatar mcfloy avatar murilobalbino avatar nirosten avatar nylanderrdk avatar polairr avatar thymona avatar vladimirue4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

menuv's Issues

Timesync

Is it possible to disable timesync because if u use scripts whit irl time, it begins tp blinks all the time

conflict because of Config

because of Config , you cant use Config on your script anymore or it will not work
(possibly change the Config to something like menuv_config so it will not conflict with other scripts?)

attempt to index a nil value global ('MenuV')

Hey! Love your work ThymonA.
I encountered this error when trying to use menuV:
"attempt to index a nil value global ('MenuV')" within example.lua.

Do you have any clue on how I can fix this?
I installed vmenu by adding a fxmanifest.lua to it and letting it get built by yarn.

How to add a "If player is in zone feature"

Hi Tigo,

Im wondering if it was possible to create a say "locked" state on the menu buttons. What im wanting to do is restrict the certain button to only work when a player is in "xyz zone" and when they aren't in the given area the button displays locked and can't be pressed/triggered. This meaning if say the player isn't at the top of mount chiliad the button is greyed out with a lock on the side of it. (image attached below of button)
locked

Any help would be greatly appreciated by anyone.

<menu>:Close not working

Hello! To start off I would like to say that the resource is really awesome, but quite recently I came over a problem with the menu:Close() function.

When I trigger it (see code below) it returns this error:

error

It's fired when you select the button as seen here:

menu_button_unemployed:On('select', function(menu)
	if job ~= "unemployed" then
		menu:Close()
		TriggerServerEvent('jobs:newjob', GetPlayerServerId(PlayerId()), 'unemployed')
		exports.mythic_notify:DoHudText('success', 'You are now unemployed!')
	else
		exports.mythic_notify:DoHudText('error', 'You are already unemployed!')
	end
end)

Any clues on what going on? I have the newest release (v1.4).
I've also tried to reinstall MenuV just to be sure.

Thanks in advance.

Example Menu not working

Attempted to use the example menu just to get a feel for the menu itself and instantly ran into this ( Built the newest version )

Screenshot

Just wanted to let you know.

Editing Sub Title

I want to change the subtitle for storemenu2 to contain the text used in qb-input.
I use storemenu2.subtitle = storename and it works the first time I open the menu. It shows correctly.
Then when I try to open the menu for a second time, storemenu2.subtitle still shows the correct title string, but the menu itself shows the default subtitle.
Any way around this?

local storemenu2 = MenuV:CreateMenu(false, Lang:t('menu.edit_title'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'edit2')

`edit_store_menu:On('select', function(_) -- Open Menu To Edit Existing Store
local dialog = exports['qb-input']:ShowInput({
header = "Store Editing",
submitText = "Confirm",
inputs = {
{
text = "Store Name You Want To Edit", -- text you want to be displayed as a place holder
name = "namestore", -- name of the input should be unique otherwise it might override
type = "text", -- type of the input
isRequired = true, -- Optional [accepted values: true | false] but will submit the form if no value is inputted
-- default = "CID-1234", -- Default text option, this is optional
}
},
})

if dialog ~= nil then
    local storename = nil
    for k,v in pairs(dialog) do
        if k == "namestore" then
            storename = v
        end
    end

    QBCore.Functions.TriggerCallback('core_stores:server:checkStoreName', function(cb)

        if cb then
            MenuV:OpenMenu(storemenu2)
            storemenu2.subtitle = storename
            oldStoreName = storename
        end
    
    end, storename)
end

end)
`

Idea

I know this isn't a issue but I honestly didn't know where to post for request / ideas

I checked through the Documentation and I didn't see anything about allowing for controller inputs. is this something that can be done or is it something that needs to be added to the API?

Cant close the menu

Hi Tigo i just create a simple menu with a bunch of buttons just for testing, one of those buttons are the "close" one.
So i do

 MechMenu1 = MenuV:CreateMenu("MECHANIC MENU","", 'size-150')
		 MenuV:OpenMenu(MechMenu1, function()
		 end)

then
local buybutton = MechMenu1:AddButton({icon ="๐Ÿง‘โ€๐Ÿ”ง ",label = "Close Menu" , value = 1,description = 'Close the Menu' })
and in the On Event

buybutton:On("select",function()
			-- MenuV:CloseMenu(MechMenu1)
			 MechMenu1:Close()
			 print("CALLED MENU CLOSE")

		 end)

but it never close itself, i dont know but maybe im doing something wrong, i get the "CALLED MENU CLOSE" in the console

A way to add Values?

Hi,
do you know how to add new Values while in a string?

I have:
for i, v in ipairs(Config.Fonts) do fontslider:AddValue(Config.Fonts[i].value, Config.Fonts[i].label) end

I have no errors, but the values don't added.

The Config:

`Config = {}

Config.Fonts = {
[1] = {value = {graffiti1}, label = 'Next Custom'},
[2] = {value = {graffiti2}, label = 'Dripping Marker'},
[3] = {value = {graffiti3}, label = 'Docallisme'},
[4] = {value = {graffiti4}, label = 'Fat Wandals'},
[5] = {value = {graffiti5}, label = 'Sister Spray'},
[6] = {value = {graffiti6}, label = 'Pricedown'},
[7] = {value = {graffiti7}, label = 'Chalet'}
}`

Anticheat / Antiexploit feature

I would like if the menu closes after certain time? Because people might keep the menu for example garage. If they keep the garage menu open and basically teleport back to the garage by pressing enter?

List of valid keys? and other questions/issues

I am trying to see if i can use this menu system to replace a very outdated, sluggish and horrible looking menu system on my server, but no matter what i change the key to in the example, it opens using F1.. tried removing the example.lua file from the menuv folder, and moving it to a separate folder, so i can begin testing stuff, and it still opens on f1, despite me changing it to other valid keys(del/delete, F2, F3, N and other random keys) is it possible to get a list of valid keys, and some kind of reason as to why it failsafe's back to F1? when i tried with del it said "[IO] Invalid key name DEL" and so far only the del key has made it state this, no matter what other keys i try..

it looks awesome, it seems simple enough to use, hence the reason i would like to switch to it instead of whatever thingy we are using now..

EDIT
of course just as i say this, i try with other weird key names, and now it states other keys as invalid(ins for instance) but it still only works on F1, regardless of whether it says invalid key or not..

Additional information:
Version of menuv: Latest(1.4)
Fivem Server Version: 3184.
Fivem Client Version: 3348
Tried keys(still opens on F1 regardless):
-Delete
-Insert
-F2
-F3
-End
-N
-G
-X
-E

Not yet tried:
-binding it to a chat command(opening the menu using a chat command, only tried using keybind for simplicity)
-binding it to a location(walking into a location opens it up using a trigger)

EDIT 2
i can now force the menu open on the key i want, using a small section in the code, copied from another script(IsControlJustReleased) so now i can force it to show on the key i want(still opens on F1 as well) but now another issue has come to my attention. i cannot close the menu again.. using a simple if statement to see if the menu is open(using a Boolean that follows it's state) i can select to either open or close the menu on the key i want. problem is the menu stays open..
tried using the debug code to print when something happened, and it does print the "menu closed" text i asked it to print, but the menu is still showing.

i can also not interact with the menu at all.. it shows and that's it.. mouse cursor is not showing up and stays showing.. gonna try(for fun and to see if that changes anything) to download an older version, and see if i can get that one working.. who knows, it might just work :)

EDIT 3
just noticed the "Close All" button, and it works to shut it down.. still odd that it otherwise refuses to work..

Problem when refreshing a menu while deleting its items.

Hi,

I've noticed a bug when I clear the items of a menu and re-add the buttons. If I do that 2 or 3 times It seems like the labels buttons "switch places". For a bit of context, I'm using this code in an admin menu to create a button for each connected player. So I make it refresh each time I come back to the menu named subMenu.

The piece of my code with the bug:

`
local subMenu = MenuV:CreateMenu("test", "", "topleft", 255, 0, 0, 'size-125', 'default', 'menuv', 'stl_test', 'native')

subMenu:On("open", function (subMenu)
	subMenu:ClearItems()

	ESX.TriggerServerCallback('stl:test:getAllPlayers', function(players)
		for k, player in pairs(players) do
			local item = subMenu:AddButton({ label = player.name .. " [ID: " .. k .. "]", value = targetMenu})

			item:On("select", function(item)
				print(item.Label)
			end)
		end	
	end)
end)

`
So, every other time when I select a button the label print belongs to another button.

Problem with a lot of items on the menu.

Im making admin menu with menuv, but with players menu i have a problem when i have a lot of items i can scroll.
image

I add the items manually. When the menu have more than 30/40 items i can't scroll to down.

Script dependencies

Hey,
does menuv have a dependency?

I want to use the libary for my scripts and want to make sure menuv is installed

( @ThymonA )

assertion failed!

Hi thymon! your awesome!, i have the title error in almost every resource, i just add the code to open the menu and that shows up, tested de menuv_example and the menu open

MenuV:Refresh() dont work as intended

MenuV:Refresh() dont work as intended

function is called correctly and currentMenu is not empty.
its not on lua side of script (as far as i tested)
(using latest version 1.4.1)

have to use Close() and Open() instead, at least for now

Adding a global close all menu key like ESC

If your opening multiple submenus and you want to close the menu, the previous menu than reopening.
So instead of going always one menu up, it would be nice to have a key that allows a player to close all menus at ones.

Enter Event doesn't return first value

Hey when i use the event enter, it doesn't return the first value (https://streamable.com/mp4k89)
Here is my code :

for categories, vehicles in pairs(SpaceVehShop.Categories) do
    local CategMenu = MenuV:CreateMenu(categories, 'Catรฉgorie : ' .. categories, 'topleft', 255, 0, 0, 'size-125', 'default', 'menuv', 'space_vehshop_categorie_' .. categories, 'native')
    local categBtn = VehShopMenu:AddButton({icon = '', label = categories, description = "Catรฉgorie : " .. categories, value = CategMenu})
        for k,v in pairs(vehicles) do
            local vehiclesBtn = CategMenu:AddButton({icon = '', label = k, description = k, value = v.model, enter = function(value)
            print(value.Value)
            end})
        end
end

a way to check if a menu is open?

i made a simple vehicle control menu using MenuV, and it looks so good and uses so little resources compared to my other two menu's that did the same. my only issue is people want to use the same key to get the menu to show, to close it again. so i need a way to get a bool if the menu is showing and then do stuff accordingly. so the same button can close the menu as is showing it(using an if statement not the MenuV way, as i need it to only show in vehicles)

tl;dr a way to return a bool if a menu with a certain name is showing

Doubt how to insert information to the menu

I have a question and it is that I am creating a menu for the police and how to insert the information when they press, for example, the idcard button

the function is this:
function OpenIdentityCardMenu(player)
ESX.TriggerServerCallback('esx_tr_policejob:getOtherPlayerData', function(data)
local elements = {}
local nameLabel = _U('name', data.name)
local jobLabel, sexLabel, dobLabel, heightLabel, idLabel

if data.job.grade_label and  data.job.grade_label ~= '' then
	jobLabel = _U('job', data.job.label .. ' - ' .. data.job.grade_label)
else
	jobLabel = _U('job', data.job.label)
end

if Config.Policia.EnableESXIdentity then
	nameLabel = _U('name', data.firstname .. ' ' .. data.lastname)

	if data.sex then
		if string.lower(data.sex) == 'm' then
			sexLabel = _U('sex', _U('male'))
		else
			sexLabel = _U('sex', _U('female'))
		end
	else
		sexLabel = _U('sex', _U('unknown'))
	end

	if data.dob then
		dobLabel = _U('dob', data.dob)
	else
		dobLabel = _U('dob', _U('unknown'))
	end

	if data.height then
		heightLabel = _U('height', data.height)
	else
		heightLabel = _U('height', _U('unknown'))
	end

	if data.name then
		idLabel = _U('id', data.name)
	else
		idLabel = _U('id', _U('unknown'))
	end
end

local elements = {
	{label = nameLabel},
	{label = jobLabel}
}

if Config.Policia.EnableESXIdentity then
	table.insert(elements, {label = sexLabel})
	table.insert(elements, {label = dobLabel})
	table.insert(elements, {label = heightLabel})
	table.insert(elements, {label = idLabel})
end

if data.drunk then
	table.insert(elements, {label = _U('bac', data.drunk)})
end

if data.licenses then
	table.insert(elements, {label = _U('license_label')})

	for i=1, #data.licenses, 1 do
		table.insert(elements, {label = data.licenses[i].label})
	end
end

ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', {
	title    = _U('citizen_interaction'),
	align    = 'right',
	elements = elements
}, nil, function(data, menu)
	menu.close()
end)

end, GetPlayerServerId(player))
end

How can I insert the values to the menu

Menus deleted on resource restart

Hi,

When I reload an other resource than my script and menuv. The submenus loads on it seems to be deleted, actually the buttons won't appear. Here is my code to load my menu and submenus :

function Initialize(group)
	local playerPed = PlayerPedId()
	
	local menu = MenuV:CreateMenu("Administration", '', 'topleft', 255, 0, 0, 'size-125', 'default', 'menuv', 'stl_adminmenu_mainmenu', 'native')
	local target

	for _, subMenuType in pairs(Functions) do
		local subMenu = MenuV:CreateMenu(subMenuType.name, "", "topleft", 255, 0, 0, 'size-125', 'default', 'menuv', 'stl_adminmenu_' .. subMenuType.name, 'native')

		menu:AddButton({ label = subMenuType.name, value = subMenu })

		if subMenuType.name == "Liste des joueurs" then
			local targetMenu = MenuV:CreateMenu("Actions", "", "topleft", 255, 0, 0, 'size-125', 'default', 'menuv', 'stl_adminmenu_targetmenu', 'native')

			for _, action in pairs(subMenuType.content) do
				if action.permission[group] then
					if action.type == "checkbox" then
						targetMenu:AddCheckbox({ label = action.name, value = "n", change = function(item)
							action.trigger(playerPed, target, item.Value)
						end })
					else
						targetMenu:AddButton({ label = action.name, select = function() 
							action.trigger(playerPed, target)
						end })	
					end
				end
			end
			
			subMenu:On("open", function (menu)
				ESX.TriggerServerCallback('stl:adminmenu:getAllPlayers', function(players)
					menu:ClearItems()
					
					for k, player in pairs(players) do
						menu:AddButton({ label = ('%s [ID: %s]'):format(player.name, k), value = targetMenu, select = function()
							target = player
						end })
					end
				end)
			end)
		else
			for _, action in pairs(subMenuType.content) do
				if action.permission[group] then
					if action.type == "checkbox" then
						subMenu:AddCheckbox({ label = action.name, value = "n", change = function(item)
							action.trigger(playerPed, target, item.Value)
						end })
					else
						subMenu:AddButton({ label = action.name, select = function() 
							action.trigger(playerPed, target)
						end })	
					end
				end
			end
		end
	end

	menu:OpenWith('keyboard', Config.openControl)
end

Menu Banner Issue

My Menu Banner's are now working, are there any fixes?

I went into the ytd's and put in more banners and also in the folder as a PNG and it is still not working,

How to check the value of a btn ?

Hey i want to know when a player select a specific button

I try this

    local btn_cars = menuCateg:AddButton({icon = '', label = label, select = function(btn)
                        print(btn) -- print the UUID
                    end})

But the callback return the UUID, not the value of the btn.

How to create textbox

How could I create a textbox, lets say I wanted to make a ban menu.
I needed a confirm button
A slider for time
and text for reason.

How would I make a textbox

Can't close menu

im writing simple menu using MenuV, and i have some issues when closing menu.

Code:

local button2 = menu:AddButton({ icon = '๐Ÿ’€', label = 'Arenka 2' })
button2:On('select', function(item)
    teleportToCoords(GetPlayerPed(-1), 1934.6615, 4715.15771, 41.09946, 288.548676)
    menu:Close()
end)

I wanted menu to close after selecting button but instead it's still visible but buttons dont work anymore.

Menu freeze when they are too much buttons in a menu

Hello, when there are too much buttons in a menu, sometimes, for some reasons, the menu freeze itself and we need to restart the script in order to unfreeze the controls on the menu. In my case, it happens on the players list.

local function setupMenu(group)
    local menu = MenuV:CreateMenu(Config.translations["menuTitle"], Config.translations["menuSubtitle"], 'topleft', 255, 0, 0, 'size-125', 'default', 'menuv', 's1n_adminmenu_main', 'native')
	local target

	for _, subMenuType in ipairs(Sections) do
        if subMenuType.disable then goto continue end

		local subMenu = MenuV:CreateMenu(subMenuType.name, "", "topleft", 255, 0, 0, 'size-125', 'default', 'menuv', 'stl_adminmenu_' .. subMenuType.name, 'native')

		menu:AddButton({ label = subMenuType.name, value = subMenu })

		if subMenuType.name == Config.translations["sectionManagePlayers"] then
			local targetMenu = MenuV:CreateMenu(Config.translations["menuActionsTitle"], Config.translations["menuActionsSubtitle"], "topleft", 255, 0, 0, 'size-125', 'default', 'menuv', 's1n_adminmenu_target', 'native')

			for _, action in ipairs(subMenuType.functions) do
				if not isNotBlacklist(action.blacklistID, group) and not action.disable then
					if action.type == "checkbox" then
						targetMenu:AddCheckbox({ label = action.name, value = "n", change = function(item)
							ESX.TriggerServerCallback("s1n_adminmenu:logDiscord", function()
								action.trigger(PlayerPedId(), target, item.Value)
							end, action.name, target, item.Value)
						end })
					elseif action.type == "slider" then
						targetMenu:AddSlider({ label = action.name, values = action.values, select = function(_, value)
							ESX.TriggerServerCallback("s1n_adminmenu:logDiscord", function()
								action.trigger(PlayerPedId(), target, value)
							end, action.name, target, value)
						end })
					else
						targetMenu:AddButton({ label = action.name, select = function() 
							ESX.TriggerServerCallback("s1n_adminmenu:logDiscord", function()
								action.trigger(PlayerPedId(), target)
							end, action.name, target)
						end })	
					end
				end
			end
			
			subMenu:On("open", function (menu)
				ESX.TriggerServerCallback("s1n_adminmenu:getAllPlayers", function(players)
					menu:ClearItems()
					
					for k, player in pairs(players) do
						menu:AddButton({ label = ('%s [ID: %s]'):format(player.name, k), value = targetMenu, select = function()
							target = player
						end })
					end
				end)
			end)
		else
			for _, action in ipairs(subMenuType.functions) do
				if not isNotBlacklist(action.blacklistID, group) and not action.disable then
					if action.type == "checkbox" then
						subMenu:AddCheckbox({ label = action.name, value = "n", change = function(item)
							ESX.TriggerServerCallback("s1n_adminmenu:logDiscord", function()
								action.trigger(PlayerPedId(), item.Value, PlayerId())
							end, action.name, false, item.Value)
						end })
					elseif action.type == "slider" then
						subMenu:AddSlider({ label = action.name, values = action.values, select = function(_, value)
							ESX.TriggerServerCallback("s1n_adminmenu:logDiscord", function()
								action.trigger(PlayerPedId(), value, PlayerId())
							end, action.name, false, value)
						end })
					else
						subMenu:AddButton({ label = action.name, select = function() 
							ESX.TriggerServerCallback("s1n_adminmenu:logDiscord", function()
								action.trigger(PlayerPedId(), PlayerId())
							end, action.name)
						end })	
					end
				end
			end
		end

        ::continue::
	end

	menu:OpenWith('keyboard', Config.keyOpenMenu)
end

Changing the banner

I have added my own banner which i made with the psd file in Photoshop, but when i add a Menu with that texture (my banner) then i cant see it in game there is just no banner, i restarted everything (server and client). I also tried to replace the default_native, example and default banners but then it just shows the banner i replaced, not my own

[Feature/Update] Update 1.5

Checklist:

Features:

  • Add a function to remove a certain menu item.
  • Add a function to hide a menu item instead of disabling.
  • Able to change the font size in MenuV
  • Able to add custom css rules to specific menus.
  • Able to use .png/.jpg files instead of adding them to the texture dictionary.
  • Add options like NativeUI has see video
  • Add controller support to MenuV
  • Option to store additional values into menus and buttons.
  • Add something right of the button/item
  • Option to change sliders increase/decrease amount
  • User input inside a menu, like a textbox, numberbox etc.

Extra's:

  • Update menuv documentation
  • While the key is pressed, continue instead of pressing every single time the arrow keys.
  • Able to hide certain parts of the menu, like the header, subtitle etc.
  • Cancel thread execution while the user is switching (performance improvement).

Bugs/Issues:

  • Sometimes the menu isn't showing up, seems like a developer issue rather than this resource still needs to investigate this.

Cannot Append or Replace Values of a Slider Item

Hello. I'm trying to modify the values list of a slider item when another slider is changed (To change the wheel options when you change the wheel category). I've tried a couple of different methods, but nothing seems to work. Any time I try to modify the Values property, it changes the list to just have "OPTION" and you can't move it anymore. There are no errors or anything of that sort. Here's my current code:

local wheelTypeSlider = vehModMenu:AddSlider({icon = '๐Ÿš˜', label = "Modify Wheel Category", values = GenerateSliderValues(116, 7)})
local wheelSlider = vehModMenu:AddSlider({icon = '๐Ÿš˜', label = "Modify Wheel", values = GenerateSliderValues(23, GetNumVehicleMods(myVeh, 23))})

-- SLIDER CHANGED EVENT
wheelTypeSlider:On('change', function(item, newValue, oldValue)
    SetVehicleWheelType(myVeh, newValue)
    SetVehicleMod(myVeh, 23, 0, false)
    Wait(10)
    wheelSlider.Values = GenerateSliderValues(23, GetNumVehicleMods(myVeh, 23))
end)

wheelSlider:On('change', function(item, newValue, oldValue)
    ApplyModification(myVeh, 23, newValue, 450)
end)

GenerateSliderValues is a function I created to return a table with the slider options for a certain mod, so I know it's working. The sliders both work fine until I change the wheelType slider, which is when the wheelSlider just shows "OPTION" and is no longer useable. I also tried value (No capital V) and got a similar issue. The rest of the properties (Such as value, label, etc.) work find, it's just the values property that bugs it out. I assume I'm doing something wrong.

Is there any way I can achieve what I want to do? Thanks in advance.

NOTE: I saw (And used) AddValues(), but it doesn't do what I need exactly. Unless I can clear the values and then re-add them like that (I'd need to know how to clear), it won't work. I need to fully replace the values list.

MenuV:CloseMenu() not closing the menu

After firing the CloseMenu method, the menu is still present on the HUD.

confirmButton:On('confirm', function(item)
	print("yes")
	MenuV:CloseMenu(confirmationMenu)
end)

confirmButton:On('deny', function(item)
	print("no")
	MenuV:CloseMenu(confirmationMenu)
end)

Menus don't open + IsLoaded export invalid

Using the 'MenuV:OpenMenu' function, it appears that this doesn't open the menu that I have created using the example code found in 'example.lua'. I done some debugging inside the 'menuv.lua' script and found, on line 166, that when the function tries to open the menu, there is an infinite wait loop waiting until 'MenuV.Loaded' is equal to true. But there doesn't seem to be any way of this bool switching to true, ending the loop.

I get an error in my resource when using MenuV that states: 'No such export IsLoaded in resource menuv'
This may be the cause of the problem with 'MenuV.Loaded' not being set to true, however, I am not entirely sure.

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.