[Release][Dev] NativeUILua


#129

Am not understanding sorry


#130

can you send a screenshot of the f8 ?


#131

Sure @Karl https://gyazo.com/fd217c776d9d04ac284d14aa6d6ec026


#132

Thank you for this release :+1:

Just wondering if it’s possible to load images in the menu?
(For example, if I was to have a vehicle spawner with an image of the said vehicle.)


#133

How Would i add multiple items that trigger events inside that??

function AddMenuVehicle(menu)
    local submenu = _menuPool:AddSubMenu(menu, "Vehicle")
    for i = 1, 1 do
    	local Item = NativeUI.CreateItem("Lock Vehicle", "")
		Item.Activated = function(ParentMenu, SelectedItem)
    		--Do stuff
    		TriggerEvent('lock')
    	end
        submenu:AddItem(Item)
    end
end

#134

Could you update the provided example on how to use the new panels and what not, this would really help a lot of people out as it’s not documented very well.


#135

Still an Error for me when I click on one of the arrows of the panel :

[   4915250] Error resuming coroutine: client/ExternalScripts/NativeUI.lua:1269: attempt to index a number value (field '?')
[   4915250] stack traceback:
[   4915250] 	client/ExternalScripts/NativeUI.lua:1269: in method 'FindPanelItem'
[   4915266] 	client/ExternalScripts/NativeUI.lua:2126: in method 'UpdateParent'
[   4915266] 	client/ExternalScripts/NativeUI.lua:2153: in method 'UpdateSelection'
[   4915281] 	client/ExternalScripts/NativeUI.lua:2109: in method 'CurrentSelection'
[   4915281] 	client/ExternalScripts/NativeUI.lua:2226: in method 'Functions'
[   4915297] 	client/ExternalScripts/NativeUI.lua:2244: in method 'Draw'
[   4915297] 	client/ExternalScripts/NativeUI.lua:3263: in method 'Draw'
[   4915313] 	client/ExternalScripts/NativeUI.lua:3757: in method 'Draw'
[   4915313] 	client/ExternalScripts/NativeUI.lua:3735: in method 'ProcessMenus'
[   4915328] 	client/Characters/Skin.lua:130: in function <client/Characters/Skin.lua:128>
local function AddAppearanceMenu()
		local menu = _menuPool:AddSubMenu(mainMenu, "Apparence")
		local hairColorSelection = 1
		local HairsMenu = NativeUI.CreateListItem("Cheveux", Hairs, SkinObject.GetHairs() + 1, "Choisissez Votre Coupe de Cheveux")
		menu:AddItem(HairsMenu)
		local ColorPanel = NativeUI.CreateColourPanel("Couleur", HairsColor)
		HairsMenu:AddPanel(ColorPanel)
		if SkinObject.GetSex() == 0 then
			--local BeardMenu = NativeUI.CreateListItem("Barbe")
		end
		menu.OnListChange = function(sender, item, index)
			if item == HairsMenu then
				SkinObject.SetHairs(index - 1)
			end
		end
	end

	AddHeritageMenu()
	AddAppearanceMenu()
	_menuPool:RefreshIndex()

	mainMenu:Visible(true)

	Citizen.CreateThread(function()
		while _menuPool:IsAnyMenuOpen() do
			_menuPool:ProcessMenus()
			Citizen.Wait(1)
		end
	end)