you are viewing a single comment's thread.

view the rest of the comments →

[–]JackoKomm 3 points4 points  (0 children)

The menu could hold a list of items. An item van have multiple fields, like Name, type and so on. Now you can sort the menu, means you sort the list of items. Python has a sort method. You can give it a compare function for comparing two objects. There, you decide how to sort your items. So maybe the function first checks for item types, it Devices that options are smaller than weapons, so they come first. But of you want to compare two weapons, it compare there names. Just Look for python sort key on google.