Skip to content

Conversation

@ConnorMolz
Copy link
Contributor

@ConnorMolz ConnorMolz commented Dec 8, 2025

Pull Request Template

Description

I created a new overlay for the hybrid system energy state. Currently its only working for the iRacing GTP class cars, but its should be possible to convert it also to other sims

Related Issue


Type of Change

  • New feature

Checklist

  • My code follows the project's coding style.
  • I have tested my changes thoroughly.
  • My changes introduce no new warnings.

Additional Notes

In testing

Copy link
Owner

@RiddleTime RiddleTime left a comment

Choose a reason for hiding this comment

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

Added a couple of remarks.

Additionally, can this HUD Scale?

Test it out by adding a constructor to the HybridInfoConfiguration, it will reveal a new hud option that allows you to Scale a HUD.

 public HybridInfoConfiguration() => GenericConfiguration.AllowRescale = true;

@RiddleTime RiddleTime added the enhancement New feature or request label Dec 8, 2025
@RiddleTime
Copy link
Owner

Feel free to ask for a second review

@RiddleTime
Copy link
Owner

If you'd like to understand more about the font rendering and how to optimize it: https://github.com/RiddleTime/Race-Element/tree/dev/Race%20Element.HUD.Common/Overlays/Driving/Speedometer

@ConnorMolz
Copy link
Contributor Author

So I updated the code so far

The constructor is now only including the _font because its readonly and need to be there.

I add the comment of the GetEnergyLevel() suggestion (#284 (comment))

I try to test it today. If not today then on Thursday.

@ConnorMolz ConnorMolz marked this pull request as ready for review December 9, 2025 21:14
Copilot AI review requested due to automatic review settings December 9, 2025 21:14
@ConnorMolz
Copy link
Contributor Author

I tested everything and it worked properly.

Also implemented you suggestion with GetEnergyLevel()

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 pull request adds a new Hybrid Info overlay feature specifically designed for iRacing GTP class cars to display the current hybrid energy status. The implementation provides a customizable visual bar with color-coded energy level thresholds and text display.

Key Changes

  • New HUD overlay system for displaying hybrid/electric energy state in real-time
  • Configurable color thresholds for high/medium/low energy levels
  • Visual bar indicator with rounded corners and customizable dimensions

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
Race Element.HUD.Common/Overlays/Driving/HybridInfo/HybridInfoOverlay.cs Main overlay implementation with rendering logic for energy bar and text display
Race Element.HUD.Common/Overlays/Driving/HybridInfo/HybridInfoConfiguration.cs Configuration class defining customizable parameters for bar appearance and color thresholds
Race_Element/Controls/Info/ReleaseNotes.cs Updated release notes mentioning hybrid car data connector support

Note: I was unable to create specific inline code comments as the actual PR diff was not accessible in the review context. However, based on examining the repository files, I identified several areas that would benefit from attention:

  1. Grammar: The overlay description contains "A overlay" which should be "An overlay"
  2. Code Duplication: Lines 154-155 in HybridInfoOverlay.cs contain duplicate _energyStringWidth calculation
  3. Architectural Concern: The BeforeStop method sets Width/Height/RefreshRateHz properties, which conventionally belong in the constructor or BeforeStart method based on similar overlays in the codebase
  4. Maintainability: HybridInfoConfiguration.cs imports RaceElement.HUD.Common.Overlays.Driving.LapDeltaBar but doesn't use it, and contains tooltips that mention "Delta Bar" (likely copy-pasted from LapDeltaBar)
  5. Unused Code: The Generic property in HybridInfoConfiguration appears to be unused

The implementation otherwise follows established patterns from similar overlays like LapDeltaBar and should function correctly for its intended purpose.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RiddleTime
Copy link
Owner

RiddleTime commented Dec 9, 2025

I tested everything and it worked properly.

Also implemented you suggestion with GetEnergyLevel()

I don't have got an activate iRacing subscription, would you have got an example(picture or video) that I can use to post on social media and in the app's discord?

@ConnorMolz
Copy link
Contributor Author

Fix the mistake where I put the constructor content in the wrong method

I can send you a Screenshot on Thursday.

@ConnorMolz
Copy link
Contributor Author

Also can you remove my old Discord Account from the Discord Server?
I lost access mid year, I had a new one I named it the same on the Server.

@RiddleTime
Copy link
Owner

Fix the mistake where I put the constructor content in the wrong method

I can send you a Screenshot on Thursday.

No rush, think I've added you now on discord.

@ConnorMolz
Copy link
Contributor Author

Fix the mistake where I put the constructor content in the wrong method
I can send you a Screenshot on Thursday.

No rush, think I've added you now on discord.

Yeah, thank you :)

Copy link
Owner

@RiddleTime RiddleTime left a comment

Choose a reason for hiding this comment

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

  • Please have a look at your code and look for unused variables or class properties, (see the Configuration class for an example)
  • Test the HUD so it can Scale, users will complaign if it can't, in an earlier review I've left a tip on how to enable the scaling option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants