REQUEST Inventory Sorting

Discussion in 'Mods' started by Buzz_Inn, Apr 2, 2016.

  1. Buzz_Inn

    Buzz_Inn Seal Broken

    There is a mod for Minecraft called 'Inventory Tweaks' I love to use when I'm playing the game. No matter how messed up my inventory gets a key press will sort it all out. Very useful when trying to recover your stuff after a monster kills you. What makes it so great is you can customize it most anyway you like.

    I would like to see something similar for Stardew Valley. I know there is a sort button on the inventory screen but it would be better if the sort order could be customized.
     
    • OrSpeeder

      OrSpeeder Phantasmal Quasar

      Humm... I can check to see if it is possible to do easily :)
       
      • Buzz_Inn

        Buzz_Inn Seal Broken

        Cool. :cookie:
         
        • Advize

          Advize Cosmic Narwhal

          The game has a built in inventory sorter, shouldn't be too hard to see how it handles this and make your custom inventory sorter.
           
          • OrSpeeder

            OrSpeeder Phantasmal Quasar

            I checked it at night... it CAN be done, but ins't easy, if I make this, I will end making a full inventory mod, not just changing the in-game sorter, because THAT one, can't be changed.

            The in-game sorter is very hard-coded (it checks if you clicked with the mouse in a certain place, you can't intercept that easily), and it is a bad sorter too, what it do is call C# "Sort()" function, that I believe just sort by sprite numbers :/
             
            • Advize

              Advize Cosmic Narwhal

              I imagined one would look at the code and see how it works, then create their own sorting algorithm based on either priority of item types or specific items themselves (possibly allowing the saving of presets and attempting to conform to them), and draw their own extra sort button when the inventory menu was up.
               
                Jinxiewinxie likes this.
              • OrSpeeder

                OrSpeeder Phantasmal Quasar

                It works by having the sort button there, and the INVENTORY detect a click on it (not the button!), and when you click the button, it runs this function that is literally 2 lines:

                Code:
                public static void organizeItemsInList(List<Item> items)
                {
                    items.Sort();
                    items.Reverse();
                }
                
                 

                Share This Page