Add race playback controls with UI buttons#74
Conversation
Introduced RaceControlsComponent to provide playback controls (play/pause, rewind, forward, speed adjustment) with new button images and integrated it into the F1RaceReplayWindow. Updated event handling and drawing logic to support the new controls and improved UI responsiveness to window resizing.
Implemented visual flash feedback for race control buttons when triggered by keyboard shortcuts in both qualifying and race replay windows. Updated RaceControlsComponent to support flash animations and refactored drawing logic to show flash and hover effects. Integrated on_update calls to animate flashes and ensured all relevant keyboard events trigger the appropriate button flash.
Screen.Recording.2025-12-18.at.4.40.18.PM.mp4Hi @IAmTomShaw, Please let me know if any other enhancements are needed or I missed something. I have attached the video for demo purpose 😄 |
|
Great work! Are you able to change the << and >> button icons to reflect "previous frame" and "next frame" icons? I think the ones you've used give the impression that the video will be fast forwarded or rewinded. For the playback speed toggle, can you change the "2x-" and "2x+" to just "-" and "+"? I think it looks cleaner :) |
Sure, for speed since it was doubling and halving at each step, thats why I thought user should know the change is +/- 2x. |
|
@IAmTomShaw , the icons for going back and ahead, will the one's that are like a rounded arrow in a direction work? Like we see in video player online to seek 10 seconds ahead and behind? |
|
Okay, let's keep the arrow icons the same and we'll see if any feedback from the community suggests if they need changing. As soon as the + and - are changed I'll be able to merge :) |
Replaces the existing speed+.png and speed-.png images with updated versions and removes the obsolete speed.png file from the controls image set.
|
@IAmTomShaw, I have made the changes, have a look and can be merged. Regarding DRS zones, please if you can have a look there as well and get it merged, it will be great 😄 . |
Prevents interaction with race controls and most keyboard shortcuts when the lap is complete, except for restart and comparison toggle. Also auto-pauses playback at the end of the lap to avoid errors.
Updated the rewind and forward controls in RaceControlsComponent to cast frame_index to int, ensuring frame navigation uses integer indices and preventing potential float-related issues.
|
@IAmTomShaw , should work now, also updated the code to disable the race controls when finished the lap and they will work only when restarted. Issue is that in qualifying, the self.frame_index is int but in race replay it is float, so I coded based on race_replay but it failed due to type mismatch in both scenarios |
|
Merged :) |
|
Thanks and have a nice day 😄 |
Add race playback controls with UI buttons


Introduced RaceControlsComponent to provide playback controls (play/pause, rewind, forward, speed adjustment) with new button images and integrated it into the F1RaceReplayWindow.
Buttons: Play/Pause, Rewind, Forward, and speed control buttons (2x+ and 2x-)
I have also separated the tooltip from RaceProgressBar to make sure the tooltips are coming over all the other components instead of getting covered by other components.