A way to customize info displayed in the top right corner of the pause menu map

, , ,

player_info

I want to be able to put my own, custom data in there.

For example: If I use a custom framework for player/character switching and money management, I want to be able to put character name where ‘Player_Name’ is on the screenshot and cash/account balance in their respective places.

old post content

Is there a server config, resource or native API calls that allow creation of such resource? Would this require modification of FiveM’s source?

Is this currently possible?

If yes, I’d love for someone to give me some sort of short explanation on how to do it.

Since I’ve not found anything about this anywhere on the cookbook or native docs, I’m pretty sure it does not exist and I’d like to request implementation of such API or configuration.

2 Likes

I’ve done some more digging into it and found out that you can change the main header with

AddTextEntry('FE_THDR_GTAO', 'Your text here')

I strongly suspect that the player name would be set in a similar way. I tried searching here:

but didn’t find the correct key.

Is there a way to inspect these xml files like you can inspect html with web developer tools? Maybe that part isn’t actually in pausemenu, but has a different .xml somewhere else?

Anyone able to help?

This should be a GFx function call somewhere, though I’m not sure if this movie instance is typically exposed to scripts by R*.

1 Like

You mean it’s built with scaleform and can be modified with a process similar to one described here? Or a .gfx file has to be exported, edited and streamed back?

Edit:
So far I’ve tried using grep on fivem codebase to “follow the data”. When not using steam, what you type in “Player name” in fivem’s connection settings is displayed in that top corner of the map.

So I started with the string ‘Player name’. Went like this:

'Player name' --> #Settings_Nickname --> ext/cfx-ui/src/app/settings.service.ts --> gameService.nickname

I was hoping I could find all the code where that piece of data is used calling some sort of native or something, but I’ve found nothing of the sort.

I’m really out of ideas now. :sob:

99% of the UI features in gta are scaleform, including the pause menu, though its usage is different to typical scaleforms, I know vespura/tomgrobbe did some work on frontend menus, and I’m sure some others have, I do remember doing some weird hack that let me actually change such, maybe I could find it in 5he morning or so, as I’m on phone currently

[Release]Custom Pause Menu Header

1 Like

Thanks a lot for this.
It’s a bit overkill for what I wanted to do, but it definitely pointed me in the right direction.

These need to be called every frame (that the pause menu is open).

Setting the data:

Citizen.CreateThread(function()
    while true do
        BeginScaleformMovieMethodOnFrontendHeader('SET_HEADING_DETAILS')
        ScaleformMovieMethodAddParamTextureNameString('first line')   -- Player_Name on screenshot
        ScaleformMovieMethodAddParamTextureNameString('second line')  -- TUESDAY 12:40 on screenshot
        ScaleformMovieMethodAddParamTextureNameString('third line')   -- BANK $0 CASH $0 on screenshot
        ScaleformMovieMethodAddParamBool(false)                 -- true for singleplayer, false for multiplayer
        EndScaleformMovieMethod()
        Citizen.Wait(0)
    end
end

Hiding this part of the menu entirely:

Citizen.CreateThread(function()
    while true do
        BeginScaleformMovieMethodOnFrontendHeader('SHOW_HEADING_DETAILS')
        ScaleformMovieMethodAddParamBool(false) -- true shows, false hides
        EndScaleformMovieMethod()
        Citizen.Wait(0)
    end
end

every frame is expensive . :joy:
BeginScaleformMovieMethodOnFrontendHeader
good.
I think maybe

Scaleforms.CallScaleformMovie("pause_menu_header",function(run,send,stop,handle)
    run("SET_HEADING_DETAILS_ADDITION")
    send(slot-1, str)
    stop()
    end)

can be used BeginScaleformMovieMethodOnFrontendHeader instead.

(Tested)
It worked.

Check out this post.

I’ve tested it and anything higher than 10ms wait time already results in a very visible and unpleasant flicker.

2 Likes

I’m not entirely satisfied with the result.

When setting the text manually, custom values are visible before the character portrait texture is loaded and then the awkwardly ‘jump’ to correct position after the portrait finishes loading.

I think it might be possible to delay setting this data with one of these functions, but I have no idea how exactly.

Anyone who is more familiar with this scaleform able to help?

Probably you are stuck on the same point I’m in.

The closest is bulding a new menu from scratch. But again, that’s a function which it haven’t been defined in vespura’s site ( BUILD_MENU ).

Another posible solution would be to unbind ESC from pausemenu and create a new menu with, for example, NUI or with HTML.

where do you put that can you please send your main.lua or however ya got it to work?

I ended up using some of negbook’s code to make this example.

It’s still incomplete though, I need to find a way to change player name displayed in the map legend (the description of the “arrow” that represents the player on the pause map).