TomGrobbe / MenuAPI

FiveM C# Menu API. Designed specifically as a replacement of NativeUI for vMenu. Full safezone scaling supported, both left and right aligned menus supported.
https://docs.vespura.com/mapi
62 stars 45 forks source link

Any idea? #28

Closed Artzalez closed 4 years ago

Artzalez commented 4 years ago

I have updated to the latest version and this keeps happening to me, any idea why it is? when you open any menu then you can reopen it by hitting the L key

image

Thanks for this project <3.

Artzalez commented 4 years ago

PD: Is RedM Release

TomGrobbe commented 4 years ago

Does this also happen with v3.1.1?

Artzalez commented 4 years ago

yes, it also happened to me in 3.1.1 and that's why I downloaded 3.1.3 today to try but it remains the same

TomGrobbe commented 4 years ago

Alright, it seems to crash here: image Which makes me think that your MenuController.MainMenu is null? Did you make a menu and add it using MenuController.AddMenu() or MenuController.AddSubMenu()?

Artzalez commented 4 years ago

image using AddMenu

TomGrobbe commented 4 years ago

@DevBiiTz and did you make sure that that code is actually executed (for example adding a Debug.WriteLine($"{MenuController.MainMenu.MenuTitle}"); right after MenuController.AddMenu(menuStables);) ?

Artzalez commented 4 years ago

I will try to see

Artzalez commented 4 years ago

image

Artzalez commented 4 years ago

That error happens from time to time to one in 6 users who connect

Artzalez commented 4 years ago

also sometimes while you play and you have been doing nothing for a long time this comes out as it just came out right now

image

Artzalez commented 4 years ago

also sometimes while you play and you have been doing nothing for a long time this comes out as it just came out right now

image

This error repeat every tick and you need reconnect to fix

TomGrobbe commented 4 years ago

also sometimes while you play and you have been doing nothing for a long time this comes out as it just came out right now image

This error repeat every tick and you need reconnect to fix

That's probably a RDR issue that I can't solve, because this crashes:

Call(SET_STREAMED_TEXTURE_DICT_AS_NO_LONGER_NEEDED, asset);

I'll add a null check for that, as well as the other thing, hopefully that helps but I don't think it will.


image That error happens from time to time to one in 6 users who connect

I've also added null checks for this, which should print an error in the console if the MainMenu is in fact null. So it shouldn't crash, but the menu won't open if you press the button.


Here's a direct download link to the version with these changes mentioned above:

https://cdn.discordapp.com/attachments/651445289781297183/712992320965836840/MenuAPI-dev-1.1.81-RedM.zip

Let me know if this helps. Unfortunately RedM does not work for me at all (it crashes either right before or right as I'm about to spawn in on any server) so I won't be able to test anything.

Artzalez commented 4 years ago

Sorry my bad english. image I just checked one thing that when you dump and open the menu with the L key it doesn't make it run, it's like the menu actually hides when closed and then lets you open it again by pressing the L key

Example: [1] - When i open menu in the shop pressin Enter key [2] - Once the menu has been opened, I close it using the backspace, I leave the store area and press the L key and the menu is displayed without running the debug.writeline

Artzalez commented 4 years ago

also sometimes while you play and you have been doing nothing for a long time this comes out as it just came out right now image

This error repeat every tick and you need reconnect to fix

That's probably a RDR issue that I can't solve, because this crashes:

Call(SET_STREAMED_TEXTURE_DICT_AS_NO_LONGER_NEEDED, asset);

I'll add a null check for that, as well as the other thing, hopefully that helps but I don't think it will.

image That error happens from time to time to one in 6 users who connect

I've also added null checks for this, which should print an error in the console if the MainMenu is in fact null. So it shouldn't crash, but the menu won't open if you press the button.

Here's a direct download link to the version with these changes mentioned above:

https://cdn.discordapp.com/attachments/651445289781297183/712992320965836840/MenuAPI-dev-1.1.81-RedM.zip

Let me know if this helps. Unfortunately RedM does not work for me at all (it crashes either right before or right as I'm about to spawn in on any server) so I won't be able to test anything.

Thanks, i got try

TomGrobbe commented 4 years ago

[2] - Once the menu has been opened, I close it using the backspace, I leave the store area and press the L key and the menu is displayed without running the debug.writeline

Well, that sounds like it's fine because you should only create and add the menu once. Don't create a new menu every single time or re-add the same menu multiple times.

Artzalez commented 4 years ago

The natives' bugs seem fixed,

A friend entered the server after me and hit the L key without first going to the store and this came out image

TomGrobbe commented 4 years ago

The natives' bugs seem fixed,

A friend entered the server after me and hit the L key without first going to the store and this came out

Yes, that's because you haven't added a menu yet. You have to make sure there is a MainMenu set before someone can press the button to toggle the menu.

Artzalez commented 4 years ago

The natives' bugs seem fixed, A friend entered the server after me and hit the L key without first going to the store and this came out

Yes, that's because you haven't added a menu yet. You have to make sure there is a MainMenu set before someone can press the button to toggle the menu.

Thank you very much for your help 😃

I understand, these menus are for a store that are in a location and I would like to disable the menu key, is there any right way or do I have to do it under an edited version ?

TomGrobbe commented 4 years ago

Yes, you can set it to -1 or something like that using:

MenuController.MenuToggleKey = (Control)-1;
TomGrobbe commented 4 years ago

And don't forget to disable the controller keybind as well:

MenuController.EnableMenuToggleKeyOnController = false;