[FREE] Lobby style menu framework

already put but i think clientside to serverside does not go back to client cause i put notification and its not working also

Update:
Added support for the Players columns.

  • You can now switch between using the buttons column, or the players columns, using [Q] (can be changed in the Key Bindings Settings)
  • “event” and “buttonParams” params added to Player row creation.
    TriggerEvent('lobbymenu:AddPlayer', _id, _name, _crew, _status, _icon, _rank, _isOnline, _rowColor, _statusColor, _buttonEvent, _buttonParams)
    
  • Added setMenuColumnFocus(columnID) export function. columnID can be 0 (left-side buttons) or 3 (players column)
  • Modified “SetHeaderDetails” event, to include the columnID that the menu should focus on opening (0 = default, 3 = players column)
    TriggerEvent('lobbymenu:SetHeaderDetails', _id, _showPlayerCard, _showHeaderStrip, _headerColor, _stripColor, _menuFocus)
    

1 Like

Where do you find the images? (on the right side)

That’s just a textureDictionary / textureName combination, in the lobbymenu:SetDetailsTitle · CritteRo/fivem-lobby-pausemenu Wiki · GitHub event.

You can use existing textures in-game (for the FIB image: txd: ‘v_73_fib01_txd’ txn: ‘xj_v_fibscreen’), streamed .ytd files or runtime textures created from CreateRuntimeTextureFromImage - Natives @ Cfx.re Docs or CreateRuntimeTextureFromDuiHandle - Natives @ Cfx.re Docs

If you want to find images from GTA, you will need to search for textures using OpenIV

Hello, great release!

I just found one thing I need help with, I need to change the color of the left bar in players column
image

I saw you in some posts being able to change it, but I can’t figure out how.

Thanks for any response!

Now that you mention it…I think it doesn’t work at the moment. I will have to take a look at the scaleform and find what value keeps track of that color.

I think this line keeps track of that. I will check whenever I have time and include it in the framework.

Fix:

  • Left color bar, on the right side of the player, is now correctly showing the row color by default (scaleform value incorrectly used isOnline value.)
  • Modified “lobbymenu:AddPlayer” event to allow the use of “color left bar” or “white left bar”. The new use is:
TriggerEvent('lobbymenu:AddPlayer', any _id, string _name, string _crew, string _status, int _icon, string/int_rank, bool _isOnline, int _rowColor, int _statusColor, string _buttonEvent, any _buttonParams, bool _showColorOnLeftBar)


Future plans:

  • Implement support for list buttons
  • Implement support for different lobby menu styles, like the Friends or Invite Players menu. (long term)
  • Write new menu handlers, to support menu update more cleanly (possibly the same way R* does it), and to add support for exports instead of events and functions instead of events for button handling. (long term)

Note:

This update should not break existing menus, feel free to update your resource. Do let me know if you face any issues.

2 Likes

Small update:

TriggerEvent('lobbymenu:AddButton', _menuID, "_IsNotSelectable", _text, _rightText, false, 0, "this event will not run")

Great work on the framework lad. I noticed there wasn’t support for list buttons atm but figured I would drop this here in case you haven’t found some of this out yet;

Heyo, thanks for the comments!

We did find the list buttons a while back, but the issue is that GetPauseMenuSelection - Natives @ Cfx.re Docs doesn’t return a value that can show us what item are you selecting.

I will have to do a bit of research, and gather that data through scaleform functions instead (the same way I did it on the phone framework)

atm, I just modified it to trigger an event when a player’s current button is the specific type & they press either left or right. That way then I can use it to set the data in an event handler for a specific menu ID & button type. Probably not the greatest solution, but works for now until a better option is found.

hey! first of all congratulations for your work i like the menu very much.
I found a bug, when I reset the player list to add new players, if there are less players than before the reset, it won’t remove previous ones, it will only replace them

just add before calling SET_DATA_SLOT or UPDATE_SLOT

BeginScaleformMovieMethodOnFrontend("SET_DATA_SLOT_EMPTY");
ScaleformMovieMethodAddParamInt(3);
EndScaleformMovieMethod();

there you go :slight_smile:

1 Like

also, impossible to set ap value on lobbymenu:SetDetailsCashRPandAP AP wont get displayed

Not sure what is wrong with the AP value?

TriggerEvent('lobbymenu:SetDetailsCashRPandAP', "menu_id", 'cash value', 'rp value', 'ap value')

Small Update:

  • Better handling of Players, Buttons and Detail rows on UpdateMenu event. Now all three data types should reset and be set the correct values, without having any left-over data. (thanks @AyyyZeN !)
  • Added SetTooltipOnly() export, that will OVERWRITE the existing tooltip that you set on the menu. It’s very basic atm, but this will make way for a switch to a more dynamic approach to this menu.

All changes are available on github.

1 Like

Huh, I never see APs having tried all the combinations, changing the order etc. maybe something i activated is preventing it

Cool release, However I think this one has a issue, Basically you can’t trigger to open another menu by using a button, It just returns that there is no menu with that id , But when i trigger the menu by some other script or command it shows up, Don’t know if I am doing something wrong or is it this menu’s limitation

Would you have a idea, how I could define an event which always gets triggered, when I switch to another button?

Probably something like “lobbymenu:ButtonSelectionChanged(menuID, oldButtonID, newButtonID)”, but that’s not really something that I would make, because it requires a loop, and I would try to avoid that.

GG ez. lol

Look this:

RegisterCommand('lobbymenu:menuMoveUp', function()
    local last, current = GetPauseMenuSelection()
    print('UP',current)
end)

RegisterCommand('lobbymenu:menuMoveDown', function()
    local last, current = GetPauseMenuSelection()
    print('Down',current)
end)

RegisterKeyMapping('lobbymenu:menuMoveUp', 'Menü nach oben bewegen (Nicht ändern!)', 'keyboard', 'UP')
RegisterKeyMapping('lobbymenu:menuMoveDown', 'Menü nach runter bewegen (Nicht ändern!)', 'keyboard', 'DOWN')

Srry for the german description, but I think it abviously what it should do.
(and some code it missing, but this shows just the theorie behind it) :slight_smile: