citizenfx / fivem

The source code for the Cfx.re modification frameworks, such as FiveM, RedM and LibertyM, as well as FXServer.
https://cfx.re/
3.58k stars 2.12k forks source link

menu mouse natives in b2802 #1811

Open freedy69 opened 1 year ago

freedy69 commented 1 year ago

Hi, it seems like 0x359AF31A4B52F5ED (PauseMenuGetMouseHoverIndex or _PauseMenuGetIndexOfMouseHoveredSlot) and 0x13C4B962653A5280 (PauseMenuGetMouseHoverUniqueId or _PauseMenuGetUniqueIdOfMouseHoveredSlot) are "broken" in b2802 - they return -1 no matter what, i don't know if this is a GTA issue or FiveM issue but I checked last builds and everything was fine so i thought it was worthy to report.

gottfriedleibniz commented 1 year ago

2802 stopped handling handle_mouse_left_right, handle_scroll_click, hover_pause_menu_item, hair_colour_select, and click_pause_menu_item as scaleform callbacks (while adding refresh_prompts). Those removals effectively turn 0xDE03620F8703A9DF, 0x359AF31A4B52F5ED, 0x13C4B962653A5280, and 0xC8E1071177A23BE5 into no-ops.

A workaround would not be too difficult to hack together (in theory). Good luck.

freedy69 commented 1 year ago

Ah yeah I see now, it's also broken in normal GTA. I'd make a fix for this but sadly know nothing about FiveM code. Side note though, I think 0xc8e1071177a23be5 has been broken before this update since I couldn't ever get it to return anything except: false, -1, -1

gottfriedleibniz commented 10 months ago

Is this still an issue on your end? I.e., were you using those natives for anything important that now prevents you from updating to 2802?

Regarding 0xc8e1071177a23be5, have you tested it with the gallery or award menus (or anything else grid-like)? Looking at the scaleforms, the use-case seems quite specific.

freedy69 commented 10 months ago

On 3095 it still is broken, and i havent tested 0xc8e1071177a23be5 on awards/gallery on an old game build yet but i will be sure to do it.

At the time i needed PAUSE_MENU_GET_MOUSE_HOVER_UNIQUE_ID to check for if mouse was pressed above a menu item (for the < > items) though i havent messed with the pause menu in a while.

Also small issues that have arisen with this is that when you are over the map legend with mouse in the map menu map is still controled and also scroll bars and setting preference mouse navigation doesnt work in the pause menu

gottfriedleibniz commented 10 months ago

If there is a legitimate use-case, it should be possible to hook the callback function (0x14015FE08/2802) to add this functionality back. I have verified that hover_pause_menu_item is still being triggered - it just is not being handled anymore. 'refresh_prompts' looks to have been introduced to simplify things.

A feature request of this nature will have an incredibly low priority however.

freedy69 commented 10 months ago

yeah that's alright. just gonna hope rockstar fixes it someday :D