[Release][Dev] NativeUILua

I do not understand how to connect ColorsPanel to ListItem

function AddMenuApp(menu)
    local submenu = _menuPool:AddSubMenu(menu, "Внешность")
    
        local hair = {
        "Под ноль", 
        "2",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8",
        "9",
        "10",
        "11",
        "12",
        "13",
        "14",
        "15",
        "16",
        "17",
        "18",
        "19",
        "20",
        "21",
        "22",
        "23",
        "24",
        "25",
        "26",
        "27",
        "28",
        "29",
        "30",
        "31",
        "32",
        "33",
        "34",
        "35",
        "36",
        "37",
        "38",
        "39",
    }
    local hairs = NativeUI.CreateListItem("Волосы", hair, 1, "Выберите волосы")
    
    local colors = NativeUI.CreateColourPanel("Цвет", 1)
    
    hairs.OnListChanged = function(ParentItem, SelectedList, NewIndex)
        colors:Index(NewIndex, nil)
    end
    submenu:AddPanel(colors)
    
    submenu:AddItem(hairs)
    
end
1 Like

Is there a way to get the values of mom and dad from the heritage window? Or is that not yet included?

its just to show the textures, you have to manually setup the values for each face

What if I made a function within to return the mum and dad values?

Nvm I think I got an idea

How do you know what names go with what numbers? Also how can I update the window images. I am currently using this

local heritageWindow = NativeUI.CreateHeritageWindow(0, 0)
heritageWindow:Index(data.skin.face.mom, data.skin.face.dad)

Fixed: I just wasn’t setting it correctly

1 Like

I can’t figure out what table contents the color panel is requesting. Can you give me an example table for the color panel?

Fix: Its just a table with rgba values.

1 Like

Trying to click on a color within the panel results in this error message. Here are some of my table contents and the line the creates the panel.

local hairColor = NativeUI.CreateColourPanel("Hair Color", hairColors)
local hairColors = {
    {22, 19, 19, 255}, -- 0
    {30, 28, 25, 255}, -- 1
    {76, 56, 45, 255}, -- 2
    {69, 34, 24, 255}, -- 3
    {123, 59, 31, 255}, -- 4
    {149, 68, 35, 255}, -- 5
    {165, 87, 50, 255}, -- 6
}

use at least 9, i know for now that any less and it doesnt work

Any idea why the weapon wheel won’t open when NativeUI is open? I have tried it on “MenuExample” and it still occurs. For some reason the radio can be opened with NativeUI opened however.

So I have a question regarding CreateGridPanel, is there a callback for when you change the value of it?
Like OnListChanged = function(sender, item, index).

Would like to retrieve the value when the Grid dot is changed and what value it is on.

Also is there a possibility to get a grid just for horizontal? Like in GTAV:O when you change the eyes there is a grid panel only for horizontal values.

Doesn’t look like it according to https://github.com/FrazzIe/NativeUILua/blob/master/NativeUI/UIMenu.lua#L53

OnIndexChange = function(menu, newindex) end,
		OnListChange = function(menu, list, newindex) end,
		OnSliderChange = function(menu, slider, newindex) end,
		OnProgressChange = function(menu, progress, newindex) end,
		OnCheckboxChange = function(menu, item, checked) end,
		OnListSelect = function(menu, list, index) end,
		OnSliderSelect = function(menu, slider, index) end,
		OnProgressSelect = function(menu, progress, index) end,
		OnItemSelect = function(menu, item, index) end,
		OnMenuChanged = function(menu, newmenu, forward) end,
		OnMenuClosed = function(menu) end,
1 Like

How to change The color of banner

1 Like

You need to modify the commonmenu.ytd, and import a new interaction_bgd.dds in.
And you can stream it directly on your fivem server like me

or you can just use these functions:

UIMenu:SetBannerRectangle(Rectangle, IncludeChildren)
UIMenu:SetBannerSprite(Sprite, IncludeChildren)

2 Likes

How to edit background and description color?

I need help with the CreateColourPanel function
I don’t understand how to add color to the panel

Hello, nice work !!

I have a question, is it possible to do a check before opening a SubMenu ? (I want to create a Vehicle SubMenu opening only if the player is in a vehicle)

I’ve already done the check part but, it opens the submenu in each case (I tried to use the UIMenu:GoBack(), but not working)

When I try to load this in my server with EUP UI and stream it will just have an error

That’s a resource.lua problem. Make sure the listings in resource.lua actually lead to your NativeUI folder. Case sensitive I believe.