Sort inplace and skip unused variable
(cherry picked from commit e84d5cbdf0
)
This commit is contained in:
parent
d38d442688
commit
c3c0969be8
@ -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():
|
||||
|
Loading…
Reference in New Issue
Block a user