Custom F1 panel
The F1 panel is the f1menu/ folder next to client_packages/ (the same place as
loadingscreen/). Edit its index.html, style.css and app.js, and link any other files with
relative paths. Without an f1menu/ folder, F1 does nothing.
It is delivered like the loading screen: the launcher downloads it with the other server files (encrypted), and connected players get a changed version on their next reconnect.
When F1 works
- Only after a successful connect, once the loading screen is gone and the player is in the world.
- Never while GTA loads, while connecting or downloading, or while reconnecting. A dropped connection closes it.
- While it is open it owns the mouse and keyboard: the game and the gamemode's key binds get nothing. Esc or F1 closes it.
The panel is the topmost layer, over the gamemode UI, with the cursor drawn on top. The page is transparent wherever you do not paint. It is isolated: the gamemode cannot see or control it, and it cannot talk to the gamemode.
A native <select> dropdown does not open in an in-game browser. Draw your own list.
API
The client pushes its state into the page:
window.addEventListener('syncf1:state', function (e) { render(e.detail); });
if (window.__syncf1) render(window.__syncf1); // state that arrived before your listener
e.detail
| Field | Meaning |
|---|---|
open | true while the panel is open (animate your entrance on it) |
connected | The link to the server is up |
server | "host:port" |
playerName | The player's name from the launcher |
voice.inputDevices / voice.outputDevices | Microphone / speaker names |
voice.inputDevice / voice.outputDevice | The chosen device ("" = system default) |
voice.inputVolume / voice.outputVolume | 0..1 — microphone level / other players' voice level |
voice.noiseSuppression | true / false |
voice.micTest | Whether "hear yourself" is running |
Commands the page sends
The page talks back with console.log lines:
| Line | Effect |
|---|---|
SYNCF1|ready | Send me the state now |
SYNCF1|close | Close the panel |
SYNCF1|reconnect | Drop the connection and reconnect |
SYNCF1|quit | Leave the server and close the game |
SYNCF1|refreshDevices | List the audio devices again |
SYNCF1|monitor|1 | Hold the microphone open for a level meter (|0 stops). The level arrives ~20×/s as syncf1:level events, e.detail = 0..1 |
SYNCF1|micTest|1 | Hear yourself (|0 stops). Nothing is sent to other players meanwhile |
SYNCF1|testOutput | Play a short chime on the chosen output device |
SYNCF1|set|inputDevice|<name> | Choose the microphone ("" = default) |
SYNCF1|set|outputDevice|<name> | Choose the output device |
SYNCF1|set|inputVolume|0.8 | Microphone level |
SYNCF1|set|outputVolume|0.8 | Voice output level |
SYNCF1|set|noiseSuppression|1 | Noise suppression on/off |
The client switches monitor and micTest off whenever the panel closes.
Every set applies to voice chat immediately and is saved in client_settings.json next to the
player's client. Saved settings apply at every start, even if F1 is never opened. The volumes are
the player's own levels: they multiply whatever the gamemode sets and never replace it.