The Witcher 3

File information

Last updated

Original upload

Created by

Pierre

Uploaded by

pbnx

Virus scan

Safe to use

About this mod

A mod sorting the inventory tabs content by "usage". Inventory opens on the most useful tab (potion or quest when exploring, depending on merchant kind when dealing with NPC). Updated for game 1.12

Permissions and credits
This simple mod aims to ease the use of the inventory menu.

Items inside tabs are sorted by "usage". The usefulness being a subjective notion, I made it quite simple to tweak should you favor different kinds of items than I do.
Starting from version 1.2.0, the inventory menu should open on the most useful tab. Again this is rather subjective, but I think it will fit most players.

I think there is still room for improvement, and any contribution is appreciated (whether this is an advice, request or actual development).
Studying: looking for a way to configure SIT from ingame menu to change sort order, comparison algorithms without editing scripts.

About Blood and Wine extension
Please pay attention that Blood and Wine will probably bring changes to the inventory management system.
At the current time, I cannot guarantee that this mod will be compliant with Blood and Wine. Also, I will probably not be able to update it before mid-June.
I strongly advise mod user to disable SIT when installing Blood and Wine for the time being.


Default tab when opening the menu (versions 1.2.x and greater):

If you have at least one new (starred) item which is an unread document (letter, parchment, book ...) in your quest tab, when you open the inventory menu, you will be directed on the quest tab directly.
Otherwise, it will be the usable (a.k.a potion, oil ...) tab that will be displayed when opening the menu.

New: When dealing with a merchant, the default tab to open is the one matching the merchant kind (blacksmith/armorer = weapon, innkeeper = usable, herbalist/alchemist = alchemy, general = other, bookseller = book).


Default order inside tabs (all versions):

Sorting is made by creating temporary categories inside the tab. Each category can be reordered by modifying an enumeration in the script file (*Sorter.ws). Swap indexes to affect the way subcategories are ordered in the tab.

Default order is based on my own experience of the game (how often I have to open the inventory to access stuff):

  • usable: steel oils > silver oils > potions > decoctions > bombs > other items > quest items (single use during playtime like pop mold...)
  • quest/book: unread documents > already read documents > other items
  • ingredients: alcohols (used during meditation) > alchemy ingredients > common mutagens > monster mutagens > crafting ingredients > other items
  • others: currencies > other items > junk items
  • New: weapons: runes > glyphs > weapon tools > armor tools > steel swords > silver swords > crossbows > bolts > armors (body) > gloves > pants > boots > trophies > horse stuff > others

Inside each category, items are always ultimately sorted by their localized name in natural order. The following categories try to apply specific comparisons before relying on localized name:

  • all categories but food in usable tab: by quality (superior > enhanced > normal)
  • New: food (ediables and drink): best food first (duration, vitality regen)
  • all categories in quest/book tabs: newly acquired first
  • alcohols used when meditating (alchemy tab): first alcohol displayed is the first one that will be consumed when entering meditation
  • common mutagens (alchemy tab): greater > normal > lesser
  • upgrades (weapon tab): by quality (greater > normal > lesser)
  • repair kits (weapon tab): by quality first (master > journeyman > amateur)
  • items spanning on 2 cells (weapon tab): by quality first (witcher > relic > magic > master > normal)

When dealing with a merchant, items that can be sold are offered first in the tab (restores the vanilla behavior).
New: When dealing with a merchant on the weapon and usable tabs, the game should prioritize items cluttering the inventory first: items spanning on 2 cells, of low quality, having a low unit price.

Limitations regarding item ordering:
  • Calling either the "quick sort items" or the "sort items" game feature will bypass this mod (whatever the version).
  • Will not work when playing with a gamepad (behind the curtain, the game engine always call the quick sort function before displaying the tab, since the quick sort overrides this mod sort output, there is nothing we can do only by scripting).


Compatibility:

Game version 1.10 or greater  only (versions for 1.08 are available on github, look for release 1.0.1, might be bugged though).
modBetterIconsAllInclusive: declare modSortInventoryTabs with a lower (numeric) priority than modBetterIconsAllInclusive in your mods.settings file
FriendlyHUD (main file): declare modSortInventoryTabs with a lower (numeric) priority than FriendlyHUD in your mods.settings file. Pick the alternate file instead of the main one, all conflicts between FriendlyHUD (main file) and SIT should be fixed in that version. If you prefer to do it yourself, install both mods, start ScriptMerger and select common files (should be inventoryMenus.ws).
  • Fix the header conflict (resolve as you want, it does not matter. This conflict is due to my file being encoded in UTF-8 to allow git process srcipt files as text)
  • In the PopulateDataForTab function, remove FriendlyHUD code
  • Select the logic you want for the default tab when menu opens (FriendlyHUD: potion tab, SIT: quest or potion tab)
  • If you kept the FriendlyHUD default tab logic, keep the remove item new flag as well, otherwise I would advise to remove it


Source code repository:

https://github.com/pbarnoux/modSortedInventoryTabs


Credits:

wghost81 for his FriendlyHUD mod pointing where the tab population takes place in legacy code.
ScriptMerger is a great front-end made by AnotherSymbiote.
The icons shown in this mod screenshot come from Better Icons, by Philozoraptor and Marnah93.