Decorate Inventory sorting functions
Moderator: GZDoom Developers
-
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
Decorate Inventory sorting functions
I would like to see a feature that allows one to specify in which order ZDoom will display inventory items on the bar when given to the player. Currently, it seems that they are sorted in the order which the player obtains them, but I would like to know if it's possible to make them sort in a predetermined order, similar to Weapon.SelectionOrder and associated properties.
-
-
- Posts: 26540
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Decorate Inventory sorting functions
Yes, that would be nice. I'd use it to specify special items (like puzzle items and so on that are single use and in one location only) to be at one end of the inventory and useful, frequent-use items to be at the other.
-
- Posts: 1484
- Joined: Fri Dec 14, 2007 6:29 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
Re: Decorate Inventory sorting functions
Not sure how this relates to what you are asking, but from my own findings in making an inventory system for doom items. it seems that if I use give all and then receive these inventory items in the new system. They will appear in the order of how they were defined in decorate
-
-
- Posts: 17920
- Joined: Fri Jul 06, 2007 3:22 pm
Re: Decorate Inventory sorting functions
When you use the give all cheat, the engine just goes through the entire list of actor and goes "is this an inventory item y/n if yes add it". That master list of actors is filled in the order the actors are defined, so there's nothing mindboggling to the fact that items are added in the order they are defined. And they're sorted by the order in which they are added, so, again, what happens is a logical extension of how things work.
But you're not really supposed to use give all when playing.
But you're not really supposed to use give all when playing.
-
- Posts: 772
- Joined: Mon May 17, 2010 9:45 am
Re: Decorate Inventory sorting functions
I can see this not only being useful on a modder's perspective, but for a player's as well. I have found times in Heretic and Strife when I want a certain item and have to scroll through a bunch of junk to get to it. Inventory.SelectionOrder seems like an appropriate name for the function. Lower numbers would place the item higher in the list. If 2 actors have the same number, the original behavior takes place.
-
- Posts: 1160
- Joined: Sun Mar 16, 2008 11:17 pm
- Location: California
Re: Decorate Inventory sorting functions
Oh God he's channeling SamuraiClinton!wildweasel wrote:I would like to see a feature...