Separate crosshair for pistol+shotgun and hipfire + unit tests#1804
Separate crosshair for pistol+shotgun and hipfire + unit tests#1804nullsystem wants to merge 5 commits intoNeotokyoRebuild:masterfrom
Conversation
e8e3957 to
3bcd481
Compare
3bcd481 to
8b11208
Compare
7ccea53 to
760b839
Compare
Removed hipfire convar and now part of crosshair bit-flag in serialization. Separate crosshair for secondary/pistols and shotguns, the others (SMGs, rifles, and machine guns) only for default crosshair. Grenades, knife, and snipers never gets the normal crosshair. NeoUI added in ringbox-flags, similar to ringbox-bool but for flags rather than bools. Added in unit testing, for crosshair and just-serialization functionalities. DONE checklists: * Compress non-default by default crosshair * Run-length encode multiple empty ;;;;... * Maybe more general enum for weapon types * Check longest possible serialization string * Unit test serialization cross versions + compression, and some functions * Upgrade crosshair on startup if needed * fixes NeotokyoRebuild#661
760b839 to
c38b083
Compare
Fixup bound logic issue and extern arrays.
f0be621 to
f8c2bf1
Compare
|
@sunzenshen Updated for code review changes: f8c2bf1 |
sunzenshen
left a comment
There was a problem hiding this comment.
Optional nits: I'm not sure if the Valve utilities are that much better or even up to date but might as well point them out to decide if we want to keep using them.
Use C++ style var copy, use V_* for atoi atof
|
@sunzenshen 2nd code review changes: 5536977 |
|
@sunzenshen More sanity checking in place: 2c554ea |
sunzenshen
left a comment
There was a problem hiding this comment.
The crosshairs in game look good to me, though there is a bit of a UI quirk with 1080p resolution, where if I scroll down with mousewheel on one tab, if I go to a tab that is currently set to a default to others single line config, it looks initially like the page is empty, though that can be rectified by scrolling up with the mousewheel. Maybe the scroll of the page should be reset to the start when a tab is clicked?
crosshair-scroll-transitions-to-next-tab.mp4
root setting UI reset Y-pos on crosshair-type tab change, use V_strcpy_safe over V_memcpy for copying to mutable string
|
@sunzenshen 3rd code review changes: 196821d |
sunzenshen
left a comment
There was a problem hiding this comment.
Also tested the tab switching and the page start reset looks good.
|
I would argue that, since the zr68l is a dmr with the same scope with backup iron sights that the mx has, that it should also get a hip fire crosshair. Also no grenade crosshair? 🥺 |
Description
Removed hipfire convar and now part of crosshair bit-flag in serialization. Separate crosshair for secondary/pistols and shotguns, the others (SMGs, rifles, and machine guns) only for default crosshair. Grenades, knife, and snipers never gets the normal crosshair.
NeoUI added in ringbox-flags, similar to ringbox-bool but for flags rather than bools.
Serialization to/from string now saving bytes by omiting values same as their default counterpart and doing run-length encoding on empty segments.
Add further sanity checking, import limits to the defined bounds, validator also checks the bounds and utilized when
cl_neo_crosshairset directly.Added in unit testing, for crosshair and just-serialization functionalities.
DONE:
;;Toolchain
Linked Issues