alexguirre / RAGENativeUI

MIT License
115 stars 38 forks source link

Camera rotation on Menu open #109

Closed manusoftar closed 3 years ago

manusoftar commented 3 years ago

I'm using 3 displays, one is the Laptop's screen and the others are two led screens, I'm running the game on the third screen which is a 32" tv.

I found out that whenever I open a menu if AllowCameraMovement is set to true then the camera automatically rotates, this happens each time I press the key to open the menu.

I made a simple plugin with a dummy menu to test it and the issue happens so it's pretty easy to replicate, now if you have AllowCameraMovement set to false the rotation doesn't happen but you can't move the camera with the mouse while you have the menu opened.

I can provide two video links where this also happened to me with some LSPDFR's plugins menues.

alexguirre commented 3 years ago

Yes, please provide the video links.

I think it may be caused by the "mouse edge" feature, where if you move the cursor to the edges on the screen the camera rotates, like the vanilla game does with some menus. Seems like your cursor is stuck in one of the edges and starts rotating the camera. Try menu.MouseEdgeEnabled = false; to disable it and check if the issue stops.

manusoftar commented 3 years ago

Im not so sure as I tried that, I enabled "mouse edge" but disabled AllowCameraMovement and it worked properly...

I recorded two short videos displaying the behaviour, I originaly thought it was a bug on Bejoljo's plugins but then I tried writing a simple plugin using only RageNativeUI and the same happened so it is a bug of the NativeUI, somehow the LSPDFR menues don't have this behaviour, I guess the may have used the original NativeUI which RageNativeUI is based on perhaps...

https://youtu.be/E-5qcBU8wGY https://youtu.be/3sZtyyDbF_E

Just to make things more clear, this is my display config imagen

So display 1 is the laptop's screen, display 3 is a 32" Led TV, I have my GTA V configured to play on display 3, if I put it on display 1 it works fine, but on any of the other screens it becomes buggy...

Display 2 is a 21" Led monitor

alexguirre commented 3 years ago

Thanks, that's different from what I was thinking about, so probably it's not caused by "mouse edge". I will try to reproduce the issue and find the cause.

alexguirre commented 3 years ago

I think I found the cause, it is due to UIMenu.ResetCursorOnOpen. It places the cursor in the middle of the primary screen, ignoring which screen the game uses. https://github.com/alexguirre/RAGENativeUI/blob/97ef84e0a6a35ef4dc2af549493ca2d0ce262bfd/Source/UIMenu.cs#L1681-L1682

In my case it happened a bit differently, the camera kept rotating instead of immediately stopping like in your videos, but I think it is the same issue. Can you try menu.ResetCursorOnOpen = false; and see if the rotation stops?

manusoftar commented 3 years ago

Sure, tomorrow I will test it and let you know, but it sounds like the culprit because when I make the game work on display 1 it works just fine. Also if I disable the allowCameraMovement it works just fine.

El mar., 9 de febrero de 2021 10:15 p. m., alexguirre < notifications@github.com> escribió:

I think I found the cause, it is due to UIMenu.ResetCursorOnOpen. It places the cursor in the middle of the primary screen, ignoring which screen the game uses.

https://github.com/alexguirre/RAGENativeUI/blob/97ef84e0a6a35ef4dc2af549493ca2d0ce262bfd/Source/UIMenu.cs#L1681-L1682

In my case it happened a bit differently, the camera kept rotating instead of immediately stopping like in your videos, but I think it is the same issue. Can you try menu.ResetCursorOnOpen = false; and see if the rotation stops?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexguirre/RAGENativeUI/issues/109#issuecomment-776358832, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPOOA3MBJOIEEW4HZO6ZVTS6HMZHANCNFSM4XHDQIHA .

manusoftar commented 3 years ago

Hi, I couldn't test it yesterday due to the annoying update of the game that made it incompatible with RagePluginHook, now I finally was able to downgrade my game to the previous version and could test it, it worked like a charm. Is there a way to fix that thing of centering on the primary display?? I mean, is there a way to detect which screen is the game running at so you can center the mouse on that screen?? if not then I will have to ask the guys behind Bejoljo's mods to add that line to all their menus as those mods are not open source...

Thanks.

El mié, 10 feb 2021 a las 1:28, manusoftar (manusoftar@gmail.com) escribió:

Sure, tomorrow I will test it and let you know, but it sounds like the culprit because when I make the game work on display 1 it works just fine. Also if I disable the allowCameraMovement it works just fine.

El mar., 9 de febrero de 2021 10:15 p. m., alexguirre < notifications@github.com> escribió:

I think I found the cause, it is due to UIMenu.ResetCursorOnOpen. It places the cursor in the middle of the primary screen, ignoring which screen the game uses.

https://github.com/alexguirre/RAGENativeUI/blob/97ef84e0a6a35ef4dc2af549493ca2d0ce262bfd/Source/UIMenu.cs#L1681-L1682

In my case it happened a bit differently, the camera kept rotating instead of immediately stopping like in your videos, but I think it is the same issue. Can you try menu.ResetCursorOnOpen = false; and see if the rotation stops?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexguirre/RAGENativeUI/issues/109#issuecomment-776358832, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPOOA3MBJOIEEW4HZO6ZVTS6HMZHANCNFSM4XHDQIHA .

manusoftar commented 3 years ago

Hi @alexguirre I saw you commited some changes to fix this issue, I cloned your repo but im having issues to compile it. I'm using Visual Studio 2019 on Windows 10 x64, it says it cannot find the Microsoft.Windows.Sdk.IL 3.0.0 library, the solution is configured to use .NET framework 4.7.2, perhaps that is wrong.

Could you please give me a hand so I can compile it myself until you make a new release??

Thanks.

alexguirre commented 3 years ago

Hi, seems like it was referencing an old Microsoft.NET.Sdk.IL version that NuGet could no longer find. It should be solved now. Anyways, I got the CI working again so you can download the RAGENativeUI-Release artifact from here, it will have the compiled .dll with the changes: https://github.com/alexguirre/RAGENativeUI/actions/runs/559266983

manusoftar commented 3 years ago

Hey, I tried the compiled dll from your repo and it makes my game crash all the time. I have LSPDFR 0.48 installed with all the Bejoljo's mods, as soon as I try to go on duty it crashes. I can load the game and drive to the police station though, but as soon as I go on duty it crashes to desktop, I tried getting the older version of the RAGENativeUI and it worked just fine (but with the rotating camera bug).

I took the debug dll but I guess it should work as well as the release one.

At this point I'm not sure if these crashes are caused by a new bug on your dll or if Bejoljo's mods are just not compatible with this new version of your dll.

I would appreciate any help you can provide, also I guess I will give it a try to the release dll to see if there is any difference there.

El jue, 11 feb 2021 a las 19:25, alexguirre (notifications@github.com) escribió:

Hi, seems like it was referencing an old Microsoft.NET.Sdk.IL version that NuGet could no longer find. It should be solved now. Anyways, I got the CI working again so you can download the RAGENativeUI-Release artifact from here, it will have the compiled .dll with the changes: https://github.com/alexguirre/RAGENativeUI/actions/runs/559266983

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexguirre/RAGENativeUI/issues/109#issuecomment-777833168, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPOOA2CDQWJD2HLKTKS36TS6RKL3ANCNFSM4XHDQIHA .

alexguirre commented 3 years ago

For the debug dll, did you also copy RAGENativeUI.IL.dll to your game directory? In the release build it is merged with RAGENativeUI.dll so it's only a single dll to install.

If it still doesn't work, does the RagePluginHook.log mention some exception or reason before crashing? Maybe some plugin checking for a very specific RNUI version (the new builds are 1.7.1 while the release is 1.7.0)?

To be honest, I didn't test it after updating Microsoft.NET.Sdk.IL because of the game update, but figured it should still work if it built successfully.

manusoftar commented 3 years ago

The guys of RAGEPluginHook just released a new version to give support to the latest GTA V version!!

It would be great if you could test your new dll, if possible install LSPDFR 0.48 and, at least, on of Bejoljo's mods to try to replicate the crashes I'm experiencing.

I should say I'm still unable to properly compile the solution, it does generate a dll but it also brings several warnings so I don't fully trust that dll I'm generating.

Thanks for your time, and if I can help in any way let me know.

El vie, 12 feb 2021 a las 6:26, alexguirre (notifications@github.com) escribió:

For the debug dll, did you also copy RAGENativeUI.IL.dll to your game directory? In the release build it is merged with RAGENativeUI.dll so it's only a single dll to install.

If it still doesn't work, does the RagePluginHook.log mention some exception or reason before crashing? Maybe some plugin checking for a very specific RNUI version (the new builds are 1.7.1 while the release is 1.7.0)?

To be honest, I didn't test it after updating Microsoft.NET.Sdk.IL because of the game update, but figured it should still work if it built successfully.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexguirre/RAGENativeUI/issues/109#issuecomment-778080863, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPOOAZMXCPUV6XS5SA6INLS6TX3RANCNFSM4XHDQIHA .

alexguirre commented 3 years ago

I tried the release dll with LSPDFR and UltimateBackup and it didn't crash, so not sure why you are experiencing crashes. Maybe try only with LSPDFR and UltimateBackup?

As for the warnings, those are normal.

manusoftar commented 3 years ago

Yes you are right, now I tried with the release dll (I tried the debug one, but I tried it alone, I didn't know I needed to put the other files for that version) and now I'm running the latest game version with the latest RAGEPluginHook from today and everything is working like a charm!! I would say you can close the issue and mark the bug as solved.

Thanks for your time!

El vie, 12 feb 2021 a las 17:06, alexguirre (notifications@github.com) escribió:

I tried the release dll with LSPDFR and UltimateBackup and it didn't crash, so not sure why you are experiencing crashes. Maybe try only with LSPDFR and UltimateBackup?

As for the warnings, those are normal.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexguirre/RAGENativeUI/issues/109#issuecomment-778424724, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPOOA65NBEHPGIFNEE7YYLS6WC3PANCNFSM4XHDQIHA .