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.
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?
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:
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
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
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?
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).