Skip to content

Fix BeamFrequencySelector drift on changes#2792

Merged
daid merged 3 commits intodaid:masterfrom
oznogon:update-beam-freq-selector
Mar 15, 2026
Merged

Fix BeamFrequencySelector drift on changes#2792
daid merged 3 commits intodaid:masterfrom
oznogon:update-beam-freq-selector

Conversation

@oznogon
Copy link
Copy Markdown
Contributor

@oznogon oznogon commented Mar 14, 2026

Fix client/server drift in BeamFrequencySelector.

  • When the beam frequency changes elsewhere, for instance on another crew screen or via Lua, update the selector.

    Before:

    Screencast_20260314_213430.webm
    • Move setSelectionIndex from init to onUpdate.
  • When the server's beam/shield frequency setting is changed mid-game, update the control on connected clients.

    Before:

    Screencast_20260314_213601.webm
    • Move the gameGlobalInfo->use_beam_shield_frequencies check from init to onUpdate.
  • When the beam frequency is decreased via keybind, send the frequency change command to the server.

    Before:

    Screencast_20260314_113357.webm
    • Invoke the selector callback, which runs the command, when using the frequency decrease bind.
    • Fix a typo in the bind's variable name.

oznogon added 3 commits March 14, 2026 11:12
Update the selected index on BeamFrequencySelector when the beam
frequency changes elsewhere, for instance on another crew screen or
via Lua.
When pressing the beam frequency decrease keybind, the selector
callback isn't run, so the frequency command isn't actually sent to
the server despite the selector's value changing. This leads to
perceived drift between the client and server. This doesn't affect
mouse selection or changing of the selector, only changes via
keybind.

Run the callback when the keybind is pressed.
@daid daid merged commit 3fe12ac into daid:master Mar 15, 2026
5 checks passed
@oznogon oznogon deleted the update-beam-freq-selector branch March 15, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants