Sort inplace and skip unused variable

(cherry picked from commit e84d5cbdf0)
This commit is contained in:
Gouvernathor 2023-11-17 04:05:49 +01:00 committed by LoafyLemon
parent d38d442688
commit c3c0969be8
1 changed files with 1 additions and 4 deletions

View File

@ -9,7 +9,7 @@ init python:
item = sorted(item, key=lambda x: natsort_key(x.name))
if sortby == "z-A":
item = sorted(item, key=lambda x: natsort_key(x.name), reverse=True)
item.sort(key=lambda x: natsort_key(x.name), reverse=True)
return item
@ -25,7 +25,6 @@ label brewing_menu(xx=150, yy=90):
current_sorting = "A-z"
menu_items = brewing_sortfilter(inventory.get_instances_of_type("potion"), current_sorting, current_filter)
menu_items_length = len(menu_items)
current_item = next(iter(menu_items), None)
show screen brewing(xx, yy)
@ -42,7 +41,6 @@ label brewing_menu(xx=150, yy=90):
$ current_filter = "Unlocked"
$ menu_items = brewing_sortfilter(inventory.get_instances_of_type("potion"), current_sorting, current_filter)
$ menu_items_length = len(menu_items)
$ current_item = next(iter(menu_items), None)
elif __choice == "sort":
if current_sorting == "A-z":
@ -51,7 +49,6 @@ label brewing_menu(xx=150, yy=90):
$ current_sorting = "A-z"
$ menu_items = brewing_sortfilter(inventory.get_instances_of_type("potion"), current_sorting, current_filter)
$ menu_items_length = len(menu_items)
#$ current_item = next(iter(menu_items), None)
elif __choice[0] == "make":
if __choice[1].has_ingredients():