- Joined
- Feb 1, 2017
- Messages
- 2
- Reaction score
- 0
- First Language
- english
- Primarily Uses
I copied this line from the Window_Armor to Window_Items
#alphabetize snippet.
@data.sort! {|x,y| x.name <=> y.name if x != nil and y != nil }
because I want my items to alphabetize when I open up the backpack. All items alphabetize, except the item owned with the highest database number (in my game it's 0052 in the database, and it will not alphabetize and shows up always at the end of the list.)
If I give the hero an item 0053 (in the database), then item 0052 successfully alphabetizes in the visible menu, but now 0053 shows up at the end of the list.
Is there a way to alphabetize ALL the items, or do I honestly have to give my hero a blank item to always have in their inventory so the real items will sort?
Surely there is some simple way to improve this code?
#alphabetize snippet.
@data.sort! {|x,y| x.name <=> y.name if x != nil and y != nil }
because I want my items to alphabetize when I open up the backpack. All items alphabetize, except the item owned with the highest database number (in my game it's 0052 in the database, and it will not alphabetize and shows up always at the end of the list.)
If I give the hero an item 0053 (in the database), then item 0052 successfully alphabetizes in the visible menu, but now 0053 shows up at the end of the list.
Is there a way to alphabetize ALL the items, or do I honestly have to give my hero a blank item to always have in their inventory so the real items will sort?
Surely there is some simple way to improve this code?

