(C#) MenuAPI - MAPI v3.0.3 [RedM & FiveM]

That’s kind of the intend for the wrapper yeah.

I never figured out how to use those/what those actually did. What’s the purpose of those things?

v1.1

  • Add an option to hide the arrows in a list item when it’s not selected

It’s just an item which looks like a listitem but has callbacks for when arrows are pressed and calls the callback eg parse the item as int and add 1 or whatever.
Remember that the original nativeui port had a bug which didnt allow to the callback to be called. It was fixed here https://github.com/citizenfx/NativeUI/commit/c3b1f03a5f7c7372e2d286ce8d3d3d7d0ea4c18c

I use them in my scripts like the handling editor to avoid building big lists everytime

So, it’d “ask” for a value to put it as next each time it needed to change?
hmm, that’s an interesting way of designing such thing. I’ll take a look, but I’m not sure if/how I’ll add this. Maybe it might be easier to implement that as one of the wrapper features. Not sure.

Nope, never used the item because I couldn’t figure out what it was used for/how to use it so I never even bothered looking into it.

It only holds a value and the callback edits it however you prefer.
this is an example of how I use it
https://github.com/neos7/fivem-vstancer/blob/master/Vstancer.Client/Vstancer.cs#L87
and this is Guad’s example https://github.com/Guad/NativeUI/issues/77

Exception loading assembly MenuAPI.net: System.IO.FileNotFoundException: Unable to find the specified file.

Why?`

I try this already

client_scripts {
‘MenuAPI.net.dll’,
‘RoleplayClient.net.dll’
}

all files exist in my folder!

1 Like

MenuAPI.net.dll isn’t a direct client script

load it in the

files {
 "MenuAPI.net.dll"
}

and add MenuAPI.net.dll as a reference in your project.

Huh?
No, load it as a client script. Afaik loading it in files is not enough and it won’t work (properly).

I have mine in-game and working?

Really? That’s odd. I always assumed you needed to run it as a client script since things like NativeUI needed that. It wouldn’t ever work (>1 year ago) if it was just put in the files section. Guess til something.

idk that is just how I loaded it and it works fine.

I’ll give it a try now lol, made me curious.

I can see what you are saying though about it needing the client api to render the menus. I will change it over to client_script as I thought all script that were gonna be used as a shared or an API needed to be loaded through files {} :man_shrugging: Learn something new everyday…

using it as files {} with reference won’t allow it to be used as shared menus handler as I wrote above, I think it has to be a script itself and interact with the other scripts using exports.

correct me if i am wrong :upside_down_face:

From what I can see so far it works fine in files. But I’m not sure what the preferred option would be in this case, maybe an element can provide more info on this topic.

I would say your way is probably better because it does hold client API method calls. I just didn’t think about it as I was going off of how I loaded my shared classes.

i think that using it as files won’t allow it to be used to do what i wrote here

Don’t worry, I’ll still keep it like it is now. I’m just honestly confused about the fact that it actually works in it’s current state being loaded in the files section :wink:

Interesting, I just use shared resources by adding them to both client and server sections. (Client first, as doing server first will prevent it from also loading on the client.)

The Problem was Net Framework 4.6.1 i need 4.5.2

well doesn’t the files {} just load files into the game to be used kinda like NUI? So wouldn’t that mean loading it in the files kinda just makes the file available and then when you reference it it loads it into the proper client script…??? I worded that very poorly. I know :smile: