Hey, thanks for both your excellent backpack mods: more filters/more columns. They're both great!
Neither one's settings menus are working for me - I can change values in them but nothing changes in the backpack screen - so I took a quick look at the settings code. I think you need to inherit from ScriptingSystem to be able to get changes from ModSettings - ScriptingSystem creates and manages a singleton that Mod Settings can get hold of. Here's the outline of how I'm doing that from my mods, if it's of help: https://gist.github.com/v1ld/2f8bd3f71517e0322d7b92596ca8ac05
There seems to be a conflict with the Stash and Backpack Search mod as its search widget goes away when your mods are active.
> There seems to be a conflict with the Stash and Backpack Search mod as its search widget goes away when your mods are active.
This is from the unconditional move of the Sorting filter dropdown using a margin. I changed the code to read like so and disabled that button move and the search filter shows up again: // Shift sorting button/dropdown down in the backpack menu. There's too many // filters now, which would cause them to extend underneath the sorting button @wrapMethod(BackpackMainGameController) protected cb func OnInitialize() -> Bool { let result = wrappedMethod();
let moreWeaponFiltersConfig = MoreWeaponFiltersConfig.Get(GetGameInstance()); if moreWeaponFiltersConfig.moveSortButtonDown { // For some reason `SetTranslation` doesn't seem to do anything here, but a margin worked instead inkWidgetRef.SetMargin(this.m_sortingButton, 0.0, 82.0, 0.0, 0.0); inkWidgetRef.SetPadding(this.m_sortingDropdown, 0.0, 82.0, 0.0, 0.0); }
return result; }
The Get() here is from a tweak to how the config is being read and loaded that I'll upload for your check in a little bit.
The GetGameInstance() call here requires Codeware. But OnInitialize() is running so early I can't see another way to get the GameInstance. this.m_player is yet to be initialized at this point, for example.
The first image shows the problem when the sorting dropdown is moved down - no search input lower left. The second shows it with the button in the default position when the search can be seen.
One solution may be to merge your two excellent mods into one mod that assumes wider layouts and doesn't need to move the sorting widget at all.
Here are the scripts tweaked to use a more dynamically changeable mod settings config: Google Drive zip file.
Changes are: - The config.reds was tweaked to inherit from ScriptableSystem and use that to get hold of the singleton it will create and manage. Mod Settings will use that singleton too, so you can get any settings changes dynamically instead of reloading the game. Added some descriptions to the options since it wasn't clear to me which options applied to weapons selection and which to the backpack screen. - Minor change to MoreWeaponFilters.red for the moving of the sort button to respect the settings as in the code above. - Minor change to ButtonLayoutChanges.reds to fetch the singleton instance of the config, code below. Note that this will require Codeware as the global GetGameInstance() function is unreliable without it. We need the global func since most of the other ways of getting the game instance are still uninitialized in OnInitialize(). @wrapMethod(InventoryItemModeLogicController) protected cb func OnInitialize() -> Bool { this.moreWeaponFiltersConfig = MoreWeaponFiltersConfig.Get(GetGameInstance()); return wrappedMethod(); }
Hi Sobakasu. Do you have a screenshot of how the filters/menu would look like when we change the options in the Mod Settings menu? Because I tried changing it to inline, above, and turned on/off the options. They all just look the same like the default one when I first installed.
Hi Sobakasu. Would you mind adding support for Stash and Backpack Search? They seem to conflict. Backpack search is hidden behind backpack items. Thanks a bunch.
This is nice and works as intended. Unfortunately, it conflicts with Survival System, which is essential for my playthrough, so I can't use it. Even so, I'm still endorsing this mod because sorting through a plethora of weapons via vanilla sorting options sucks, and this makes it much more convenient. Nice work!
Yeah, I installed this and another mod simultaneously, and it was the other mod was causing me issues. You're right. the biomod feature of Survival System will cover the backpack inventory, but they work fine together.
Thanks! I took a quick look, and it's a simple change to move the biomonitor button down so that it's not overlapping with the filter buttons. You just need to change 2 numbers in the r6/scripts/Survival System/core/Widgets.reds file:
There any reason why the sorting buttons all have the same icon? Can't figure out wtf is causing it either, i've tried disabling loot icons expanded or whatever it's called as I assumed it was messing with the icons but nah
such a good QoL addition, thank you! as for the formatting of the categories in the equipping screen, can i suggest double stacking the ones this mod adds on top? the sorting tab being shoved under looks kinda silly for me but nothing i can't live with in the end. thanks again!
Thanks, and yw! Yeah that's what I originally wanted to do, but I wasn't sure how to exactly. I took another look though and I think I figured out a way to make it work. I don't have time to properly implement it right now, but when I do I'll give it a shot.
The newest version of this mod adds options to configure the layout of the filter buttons/sort dropdown (either in-game if Mod Settings is installed, or by editing them in the MoreWeaponFiltersConfig.reds file). Also I just released another mod More Weapon Columns, and with the extra column(s) from that you can just set the filter buttons to all be on one line without having to move the sort button down.
very helpful indeed, any chance you might add filters for combat types as well; Tech, Power, Smart, etc.
also, would it be possible to add some kind of favorite feature, so we can mark(maybe with a small star icon somewhere on the item) weapons and armor as favorites making it easier to find them and keep track. maybe also add a favorite filter to go along with that?
maybe something like this mod does, but tied into your filter system. https://www.nexusmods.com/cyberpunk2077/mods/3290
any chance you might add filters for combat types as well; Tech, Power, Smart, etc.
Ideally I'd want this to be a second tier of filters so e.g. you could select "Handgun" and "Tech"/other combinations. But that seems like it might be a bit involved to implement, and I'm not entirely sure how to do that. With what you were thinking, would it be fine if it were just additional filters for combat types that are separate from the weapon types? In that case, if you selected a combat type filter, you'd see all weapons of that combat type, regardless of weapon type. If so that's something that should be easy to implement, and I could add an alternate version that adds those filters.
also, would it be possible to add some kind of favorite feature
I'm not sure what version it was added in (maybe 2.1?) but this seems to be in the base game. I'm playing in 2.13 and I have an option to favorite weapons by holding `v`. A filter for it probably isn't necessary either, since favorites appear on top with default sorting.
27 comments
Neither one's settings menus are working for me - I can change values in them but nothing changes in the backpack screen - so I took a quick look at the settings code. I think you need to inherit from ScriptingSystem to be able to get changes from ModSettings - ScriptingSystem creates and manages a singleton that Mod Settings can get hold of. Here's the outline of how I'm doing that from my mods, if it's of help: https://gist.github.com/v1ld/2f8bd3f71517e0322d7b92596ca8ac05
There seems to be a conflict with the Stash and Backpack Search mod as its search widget goes away when your mods are active.
Once again, thanks for the excellent mods!
This is from the unconditional move of the Sorting filter dropdown using a margin. I changed the code to read like so and disabled that button move and the search filter shows up again:
// Shift sorting button/dropdown down in the backpack menu. There's too many
// filters now, which would cause them to extend underneath the sorting button
@wrapMethod(BackpackMainGameController)
protected cb func OnInitialize() -> Bool {
let result = wrappedMethod();
let moreWeaponFiltersConfig = MoreWeaponFiltersConfig.Get(GetGameInstance());
if moreWeaponFiltersConfig.moveSortButtonDown {
// For some reason `SetTranslation` doesn't seem to do anything here, but a margin worked instead
inkWidgetRef.SetMargin(this.m_sortingButton, 0.0, 82.0, 0.0, 0.0);
inkWidgetRef.SetPadding(this.m_sortingDropdown, 0.0, 82.0, 0.0, 0.0);
}
return result;
}
The Get() here is from a tweak to how the config is being read and loaded that I'll upload for your check in a little bit.
The GetGameInstance() call here requires Codeware. But OnInitialize() is running so early I can't see another way to get the GameInstance. this.m_player is yet to be initialized at this point, for example.
The first image shows the problem when the sorting dropdown is moved down - no search input lower left. The second shows it with the button in the default position when the search can be seen.
One solution may be to merge your two excellent mods into one mod that assumes wider layouts and doesn't need to move the sorting widget at all.
Changes are:
- The config.reds was tweaked to inherit from ScriptableSystem and use that to get hold of the singleton it will create and manage. Mod Settings will use that singleton too, so you can get any settings changes dynamically instead of reloading the game. Added some descriptions to the options since it wasn't clear to me which options applied to weapons selection and which to the backpack screen.
- Minor change to MoreWeaponFilters.red for the moving of the sort button to respect the settings as in the code above.
- Minor change to ButtonLayoutChanges.reds to fetch the singleton instance of the config, code below. Note that this will require Codeware as the global GetGameInstance() function is unreliable without it. We need the global func since most of the other ways of getting the game instance are still uninitialized in OnInitialize().
@wrapMethod(InventoryItemModeLogicController)
protected cb func OnInitialize() -> Bool {
this.moreWeaponFiltersConfig = MoreWeaponFiltersConfig.Get(GetGameInstance());
return wrappedMethod();
}
Once again thanks for these very useful mods!
Line 111, change:
this.SetMargin(new inkMargin(2562.0, 404.0, 0.0, 0.0));
tothis.SetMargin(new inkMargin(2562.0, 495.0, 0.0, 0.0));
And line 223, change:
this.SetMargin(new inkMargin(890.0, 580.0, 0.0, 0.0));
tothis.SetMargin(new inkMargin(890.0, 671.0, 0.0, 0.0));
The first change moves the biomonitor button down next to the sorting button, and the second moves the pop-up down to match.
also, would it be possible to add some kind of favorite feature, so we can mark(maybe with a small star icon somewhere on the item) weapons and armor as favorites making it easier to find them and keep track. maybe also add a favorite filter to go along with that?
maybe something like this mod does, but tied into your filter system.
https://www.nexusmods.com/cyberpunk2077/mods/3290
good idea
Ideally I'd want this to be a second tier of filters so e.g. you could select "Handgun" and "Tech"/other combinations. But that seems like it might be a bit involved to implement, and I'm not entirely sure how to do that. With what you were thinking, would it be fine if it were just additional filters for combat types that are separate from the weapon types? In that case, if you selected a combat type filter, you'd see all weapons of that combat type, regardless of weapon type. If so that's something that should be easy to implement, and I could add an alternate version that adds those filters.
I'm not sure what version it was added in (maybe 2.1?) but this seems to be in the base game. I'm playing in 2.13 and I have an option to favorite weapons by holding `v`. A filter for it probably isn't necessary either, since favorites appear on top with default sorting.