-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate reload ammo selection menu to inventory_selector #70359
Conversation
e90232b
to
2e00b40
Compare
2e00b40
to
aa54f1b
Compare
… the only choice if there is only one
aa54f1b
to
2bfa948
Compare
3ea474d
to
024d6fc
Compare
024d6fc
to
e441c35
Compare
This change seems to break how speedloader works. |
I dunno, maybe? It should only affect ammo selection and not actual reloading, though. |
There are cases that this reconstruction affects. Kel-Tec shotguns have more than one magazine, and the sub-mags are gunmods, now you can only reload this kind of sub-mags after the main magazine is fully reloaded. Same for cases like compound crossbow with rail-mounted crossbow attached, M1897 Trench Gun with modified masterkey shotgun attached, etc. |
Migrate reload ammo selection menu to inventory_selector
* Merge pull request #70359 from mqrause/reload_inv_selector Migrate reload ammo selection menu to inventory_selector * DEBUG_ONLY flag for more consistency in "seeing this is a bug" (#71065) * DEBUG_ONLY flag * apparently a fake item being wood triggers the density tests --------- Co-authored-by: mqrause <[email protected]> Co-authored-by: NetSysFire <[email protected]>
Summary
Infrastructure "Migrate reload ammo selection menu to inventory_selector"
Purpose of change
Necessary for #69316, also more standardized UI.
Describe the solution
A reconstruction of the old UI within the inventory_selector framework. Changing amount to reload was changed from left/right arrow to the
INCREASE_COUNT
/DECREASE_COUNT
keybinds, which are+
/-
by default.Character::select_ammo
was made virtual and avatar/npc logic split up accordingly. Avatar now uses the new menu, npc should behave like before.Reloading attached gunmods required a slightly unoptimal solution, but that should only turn into a problem when the gunmod could be reloaded with the same ammo as the gun itself, because every ammo item can show up in the menu only once currently, preventing you from reloading the gunmod if you could also reload the gun. But I don't think we have a case like that.
Describe alternatives you've considered
Testing
Reloaded a revolver, a magazine and a gun that takes a magazine. Reload an M4 with attached grenade launcher with ammo, magazine and grenades. There are surely some cases I didn't test, but hopefully nothing gamebreaking.
Additional context
Sidenote: #58473 should be very easy to fix with the added helpers from this.
Loading magazine into gun
Loading ammo into magazine with amount on highlighted ammo reduced
Loading M4 with grenade launcher