[Release][Dev] NativeUILua

how do you install this into your fivem server folder… does it go in gta5-fivem folder with all the other .dll or in your server resources folder?

How to shift menus to the other side using the offset?

hey thankyou so much for this very usefull thing … by the way i got any issue on menu open, the problem was found when opening menu and reopen menu and select submenu it will show on my screen “TIME RESOURCE WARNING!” it happen if i open menu and next maybe about 10 x time reopen menu and submenu , so i check value result using print table value inside function MenuPool:Add(Menu) after MenuPool:AddSubMenu > self:Add(SubMenu) table.insert(self.Menus, Menu) , problem is : it always insert more and more more new inserted table to self.Menus once so many current menu inserted. and next a problem will happen on my desktop show me " time resource warning" this table always inserted on everytime current menu visible or open, so i try to clear with table.remove but when i open submenu it disappeared submenu…Preformatted text

function MenuPool:AddSubMenu(Menu, Text, Description, KeepPosition, KeepBanner,badge,cb)

if Menu() == "UIMenu" then
	if SubMenu then SubMenu:Clear()	end
	if SubMenu then SubMenu:RefreshIndex()	end
    local Item = UIMenuItem.New(tostring(Text), Description or "")
    Menu:AddItem(Item)
    local SubMenu
    if KeepPosition then
        SubMenu = UIMenu.New(Menu.Title:Text(), Text, Menu.Position.X, Menu.Position.Y) --return createdmetatable
    else
        SubMenu = UIMenu.New(Menu.Title:Text(), Text)
    end
    if KeepBanner then
        if Menu.Logo ~= nil then
            SubMenu.Logo = Menu.Logo
        else
            SubMenu.Logo = nil
            SubMenu.Banner = Menu.Banner
        end
    end
    self:Add(SubMenu,Text)
    Menu:BindMenuToItem(SubMenu, Item)
	if cb then cb(Item,Menu(),SubMenu) end
	
    return SubMenu,Item,Menu(),SubMenu
end

end

function MenuPool:Add(Menu,Text)
if Menu() == “UIMenu” then

		for _, v in pairs(self.Menus) do 
			if v.UItype == 'subUI' then 
				--Wait(1) trace('[MenuPool:Add] '..tostring(_)..' '..tostring(v))  
				--table.remove(self.Menus,_) 
				 
			end			 
		end
		if ctb(self.Menus) >= 50 then
			--Wait(0)  trace('[MenuPool:Add] self menus clear ')
		 	---self.Menus = {} 
		end
		table.insert(self.Menus, Menu) 
		--trace('self.Menus '..ctb(self.Menus))
end

end

if u have a time
please come to my server to check the problem … my server ip yktnid.com < use look up domain ip

I’m having an issue where for some reason, when using ListItem, elements are “skipped”. It happens infrequently, and it’s impossible to predict when it will happen.

The following code triggers it, but rather rarely:

_menuPool = NativeUI.CreatePool()
settingsMenu = NativeUI.CreateMenu("Settings", "~b~Settings")
_menuPool:Add(settingsMenu)

pldTheme = "Modern"
pldThemes = {"1", "2", "3", "4"}

function CreateSettings(menu)
	local submenu = _menuPool:AddSubMenu(menu, "Player Location Display")
	local pldListItem = NativeUI.CreateListItem("Select PLD", pldThemes, 1, "Select a theme")

	local pldItem = submenu:AddItem(pldListItem)
	submenu.OnListChange = function(sender, item, index)
		if item == pldListItem then
			pldTheme = item:IndexToItem(index)
		end
    	end
end

CreateSettings(settingsMenu)

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		_menuPool:ProcessMenus()
	end
end)

RegisterCommand('settings', function(source, args, user)
	settingsMenu:Visible(not settingsMenu:Visible()) 
end, false)

If anyone has some helpful advice, I’d like to hear it. This has been driving me insane for the past few days.

I had the same issue too. I think It’s performance related, but I never got it fixed. Keep in mind that this resource is outdated, RageUI being the updated version of this (but with no documentation afaik)

Please Help!

Hello, I looked around for this for a bit but couldn’t find it…

Is there any way to remove a button or submenu?
If not then is there a way to set it as disabled, or to just refresh the whole menu in general?

ie.

if not bool then

removeSubMenu

end

yesssss

Hi, how to remove the name of the menu, or nickname in vMenu?

@Frazzle Please help if you can … script myFarmingFiveM use NativUI for this crafting menu, the window with the necessary ingredients for crafting is too small for a complete list of necessary items. There are 98 characters, that I managed to count.

Where can I increase that number? Thanks

Does this work as a client-side menu?

How can i change the color of the header/banner to red for example?

Is it possible that the menu would close automatically after enter is pressed?

you have to change the commonmenu.ytd or use this functions :
UIMenu:SetBannerRectangle(Rectangle, IncludeChildren)
UIMenu:SetBannerSprite(Sprite, IncludeChildren)

But where can i put the code and what is Rectangle and IncludeChildren? or what is the Sprite gonna be for red?

I am having an issue with the List Item.
So lets say I put four options in a table and put the table as the items.
The button will skip one and just keep bugging out and skipping random ones,
also if I only put two it will stay on one and only after multiple presses change to the other.

Any idea why this is happening?

how change position?

Does anyone know a fix, because I have seen menus out there using nativeui and some of them have the same issue and some do not

ill just give you an example code here:

NativeUI.CreateMenu(“Menu Name”, “Description”, X, Y)

Nevermind I guess, already got it figured out