Separate crosshair for pistol+shotgun and hipfire + unit tests#1804
Separate crosshair for pistol+shotgun and hipfire + unit tests#1804nullsystem wants to merge 2 commits intoNeotokyoRebuild:masterfrom
Conversation
e8e3957 to
3bcd481
Compare
3bcd481 to
8b11208
Compare
7ccea53 to
760b839
Compare
760b839 to
c38b083
Compare
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.
|
@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
|
@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? 🥺 |
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
196821d to
3ba19ce
Compare
3ba19ce to
c1ddc69
Compare
|
@sunzenshen @AdamTadeusz Updated to include grenade (hipfire) crosshair: c1ddc69 |
|
Not 100% sure if this is related or not but even before c1ddc69 if I move to a build that doesn't have the changes from this PR, I get an exception at void NeoSettings_Crosshair(NeoSettings *ns)
{
static constexpr int IVIEW_ROWS = 5;
NeoSettings::Crosshair *pCrosshair = &ns->crosshair;
g_uiCtx.dPanel.y += g_uiCtx.dPanel.tall;
g_uiCtx.dPanel.tall = g_uiCtx.layout.iRowTall * IVIEW_ROWS;
const bool bTextured = CROSSHAIR_FILES[pCrosshair->info.iStyle][0];
NeoUI::BeginSection(NeoUI::SECTIONFLAG_EXCLUDECONTROLLER);client.dll!NeoSettings_Crosshair(NeoSettings * ns) Line 1258 Not sure if this could potentially affect backwards compatibility with moving back to older builds. |
|
@sunzenshen So at the moment the tournment build in release/v28 does already deal with this issue at commit: a64044a but the master branch isn't fixed like that as this is the PR that'll deal with it but with a different way of fixing it. I think v28.4 should be able to deal with this issue. |
Description
Removed hipfire convar and now part of crosshair bit-flag in serialization. Separate crosshair for secondary/pistols, shotguns and throwables/grenades, the others (SMGs, rifles, and machine guns) only for default crosshair. 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