Skip to content

Conversation

@nullsystem
Copy link
Collaborator

@nullsystem nullsystem commented Jun 9, 2025

Description

  • Since the change to string-based serialization is applied, it's now more straightforward to implement networked crosshair
  • The networking is similar to how it's done for neo_name and neo_clantag as it's just strings passed around
  • cl_neo_crosshair_network 0 = disable viewing other players crosshair, 1 = show other players crosshair
  • "Other players crosshair" meaning when you're spectating the other person in 1st person while they ADS
  • NeoUI settings - Slight alterations, added set to default button but also crosshair no longer part of the full-on reset button, so like the volume setting won't reset on full-on settings reset
  • NeoUI settings - Added toggle for viewing networked crosshair
  • NeoUI settings - Export/Import(/Default) buttons no longer restricted to only custom
  • Improved default crosshair
  • Tested with 2 computers that it's generally working

Toolchain

  • Linux GCC Distro Native Gentoo/GCC 14.2.1

Linked Issues

@nullsystem nullsystem force-pushed the GH-1187_NetworkedCrosshair branch from 103157d to a775fdf Compare June 14, 2025 11:37
@nullsystem nullsystem changed the title [WIP] Networked crosshair Networked crosshair Jun 14, 2025
@nullsystem nullsystem marked this pull request as ready for review June 14, 2025 11:37
@nullsystem nullsystem force-pushed the GH-1187_NetworkedCrosshair branch from a775fdf to 8085d6d Compare June 14, 2025 11:40
@nullsystem nullsystem requested a review from a team June 14, 2025 11:40
@nullsystem nullsystem force-pushed the GH-1187_NetworkedCrosshair branch from 8085d6d to e98a36f Compare June 14, 2025 11:57
@AdamTadeusz
Copy link
Contributor

maybe instead of doing all those InstallChangeCallback s, pass the function as a parameter in the convar definition

Copy link
Collaborator

@Rainyan Rainyan left a comment

Choose a reason for hiding this comment

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

Tested on LAN, seems to work well. But left some language nits that we might wanna fix before merging.

@nullsystem nullsystem force-pushed the GH-1187_NetworkedCrosshair branch from e98a36f to 6df1f62 Compare July 13, 2025 19:21
@nullsystem nullsystem requested a review from Rainyan July 13, 2025 19:24
Rainyan
Rainyan previously approved these changes Jul 13, 2025
@Rainyan Rainyan requested a review from a team July 13, 2025 19:37
@AdamTadeusz
Copy link
Contributor

AdamTadeusz commented Jul 23, 2025

image

Perhaps it would be better to give ConVars a max length value, or use the fmin and fmax as string length min and max

I think it should be easy to clamp len here to m_fMaxVal

@AdamTadeusz
Copy link
Contributor

image image

Seems to work well enough

@nullsystem
Copy link
Collaborator Author

@AdamTadeusz This prevents any convar that EX: uses float 0.0 to 1.0 (min + max) from being able to use properly, cause now it's only stored as "0" or "1" but "0".5 doesn't work at all

@AdamTadeusz
Copy link
Contributor

I assumed ChangeStringValue was only used for chars, but that's an easy fix

@AdamTadeusz
Copy link
Contributor

AdamTadeusz commented Jul 23, 2025

could also add FCVAR_NEVER_AS_STRING to every single float and int convar just in case (this is a joke)

@nullsystem
Copy link
Collaborator Author

Can't really be sure non-open part of SDK will always utilize FCVAR_NEVER_AS_STRING for int/float only convars or gets affected negatively by this change. I'd rather not alter tier1 library like this.

* Since the change to string-based serialization is applied, it's now
  more straightforward to implement networked crosshair
* The networking is similar to how it's done for `neo_name` and
  `neo_clantag` as it's just strings passed around
* `cl_neo_crosshair_network` 0 = disable viewing other players
  crosshair, 1 = show other players crosshair
* "Other players crosshair" meaning when you're spectating the other
  person in 1st person while they ADS
* NeoUI settings - Slight alterations, added set to default button but
  also crosshair no longer part of the full-on reset button, so like the
  volume setting won't reset on full-on settings reset
* NeoUI settings - Added toggle for viewing networked crosshair
* NeoUI settings - Export/Import(/Default) buttons no longer restricted
  to only custom
* Improved default crosshair

* fixes NeotokyoRebuild#1187
@nullsystem nullsystem merged commit 9ba9570 into NeotokyoRebuild:master Jul 23, 2025
7 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.

[FEATURE] Networked crosshair

3 participants