Skip to content

Improve crosshair health display - #980

Merged
qreeves merged 1 commit into
redeclipse:masterfrom
Calinou:improve-crosshair-health-display
Oct 7, 2026
Merged

qreeves merged 1 commit into
redeclipse:masterfrom
Calinou:improve-crosshair-health-display

Conversation

@Calinou

@Calinou Calinou commented Dec 26, 2019 •

Copy link
Copy Markdown
Member

The new implementation has numerous upsides compared to the previous implementation:

  • It indicates the player's health more accurately using a color gradient well-known among FPS players. Health above 100
    is indicated by tinting the crosshair green.
  • It's always visible, even in screenshots. Due to lack of animation, it also avoids hiding the health status on every loop of the animation (since the crosshair became white).

The variable was renamed from crosshairflash to crosshairhealth to reflect the change.

@Calinou Calinou added branch: master difficulty: easy A small change, good for a first contribution status: enhancement A new feature or an improvement to something that works labels Dec 26, 2019

@qreeves qreeves left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes requested, but I think a larger discussion needs to be done about whether the crosshair should be changing colours like this.

Comment thread src/game/hud.cpp Resolved
The new implementation has numerous upsides compared to the
previous implementation:

- It indicates the player's health more accurately using a
  color gradient well-known among FPS players. Health above 100
  is indicated by tinting the crosshair green.
- It's always visible, even in screenshots. Due to lack of animation,
  it also avoids hiding the health status on every
  loop of the animation (since the crosshair became white).

The variable was renamed from `crosshairflash` to `crosshairhealth`
to reflect the change.
@Calinou
Calinou force-pushed the improve-crosshair-health-display branch from b5a21ed to 27a2df8 Compare December 29, 2019 16:32

@q009 q009 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is fine, given it's gated behind a variable. So, it's up to each user's decision whether they wish to use this mechanism or not.

@qreeves
qreeves self-requested a review June 11, 2022 05:52

@qreeves qreeves left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've looked at this more closely, and my issue with it is that it replaces the flash with the colour completely. I, personally, don't like the crosshair changing colour, which is why this was implemented as a flash instead that only alerts to low health.

Also the variable being used was only renamed in the usage.cfg and not in the source code. I suggest it be a bitwise variable: &1 = flash, &2 = colour. This way you can combine the two effects if you want as well.

qreeves added a commit that referenced this pull request Oct 7, 2026
@qreeves
qreeves merged commit 97d9ccd into redeclipse:master Oct 7, 2026
@qreeves

qreeves commented Oct 7, 2026

Copy link
Copy Markdown
Member

Thanks for this, and sorry for the long wait! This is now merged into master (98ed3dd), reworked along the lines of the earlier review:

  • crosshairflash is bitwise. &1 is the existing red flash when below spawn health, &2 is your health colour gradient, and both can be combined. The default stays 1, so crosshairs only change for players who opt in.
  • The gradient ends at the crosshair's usual colour. It goes red below 20% of spawn health, red to yellow up to 60%, then to the usual colour (weapon colour or tone) at spawn health instead of white. Above spawn health it fades towards green up to the mode's maximum health, rather than a fixed double. The thresholds are named constants.
  • The help text uses the real variable name (it had been renamed to crosshairhealth only in usage.cfg).
  • A Health indicator option in the crosshair settings: None, Flash, Colour, or Flash and colour.

@Calinou
Calinou deleted the improve-crosshair-health-display branch October 7, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

difficulty: easy A small change, good for a first contribution status: enhancement A new feature or an improvement to something that works

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants