Skip to content

Comments

Test - Disable Game Speed Slider#53

Merged
Metadorius merged 10 commits intomainfrom
feature/disable-gamespeed-slider-patch
Oct 7, 2025
Merged

Test - Disable Game Speed Slider#53
Metadorius merged 10 commits intomainfrom
feature/disable-gamespeed-slider-patch

Conversation

@CnCRAZER
Copy link
Contributor

@CnCRAZER CnCRAZER commented Sep 5, 2025

This pull request introduces a new feature for controlling the visibility and functionality of the Game Speed (FPS) slider via a configuration option.(For skirmish and/or multiplayer games).

Map authors for custom maps, such as survival or mission style multiplayer maps, may intend to lock game speed at a certain value. Also, the ability for host to lock the gamespeed is useful to stop trolls from constantly spamming game speed changes when they are losing.

Observers in skirmish are not affected by this. If the checkbox or spawn option is forced they are always able to change gamespeed.

Checkbox example for GameLobbyBase.ini:

[chkGameSpeedSlider]
SpawnIniOption=DisableGameSpeed
DefaultValue=False
ToolTip=Disable game speed adjustment in game.
Text=Lock Game Speed

Forced spawn ini options for GameOptions.ini:

[ForcedSpawnIniOptions]
DisableGameSpeed=True

@github-actions
Copy link

github-actions bot commented Sep 5, 2025

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@CnCRAZER CnCRAZER requested review from Belonit and Copilot September 5, 2025 20:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new configuration option to disable the game speed slider in skirmish and multiplayer games, allowing map authors and hosts to lock the game speed at a specific value. The feature is primarily intended for custom maps and to prevent trolling behavior.

  • Adds a DisableGameSpeed configuration flag that can be set via spawn options or lobby checkboxes
  • Implements UI hiding and network event blocking for the game speed slider when disabled
  • Preserves game speed control for skirmish observers regardless of the configuration

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Spawner/Spawner.Config.h Adds DisableGameSpeed boolean field declaration and initialization
src/Spawner/Spawner.Config.cpp Adds INI file loading for the DisableGameSpeed configuration option
src/Misc/GameSpeedSlider.h Defines new GameSpeedSlider class with static methods for checking enabled/disabled state
src/Misc/GameSpeedSlider.cpp Implements game speed slider control logic with hooks for UI hiding and network event filtering
Spawner.vcxproj Adds new GameSpeedSlider source and header files to the project

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@CnCRAZER
Copy link
Contributor Author

CnCRAZER commented Sep 5, 2025

Ok, it seems that the visual ui aspect of the slider being hidden works 100%.

However, if someone has unpatched files they can still change the speed. My network event patch only stops the display of who's doing it instead.

Remove networking patches
Removes the redundant `IsDisabled` method and inverts the logic
where it was used. This simplifies the code and makes it easier to
understand the enabled/disabled state of the game speed slider.
@Metadorius
Copy link
Member

Redone and simplified the code a lot, @Belonit already made a hook for that, so I just reused it, works fine.

@Metadorius Metadorius merged commit 8fcb43e into main Oct 7, 2025
5 checks passed
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