(C#) MenuAPI - MAPI v1.3


#21

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?


#22

v1.1

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

#23

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


#24

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.


#25

It only holds a value and the callback edits it however you prefer.
this is an example of how I use it


and this is Guad’s example https://github.com/Guad/NativeUI/issues/77


#26

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!


#27

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.


#28

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


#29

I have mine in-game and working?


#30

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.


#31

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


#32

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


#33

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…


#34

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:


#35

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.


#36

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.


#37

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


#38

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.)


#39

The Problem was Net Framework 4.6.1 i need 4.5.2


#40

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: