mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-16 20:57:23 +08:00
Opt: Use index() to retrieve plate_weight
This commit is contained in:
@@ -221,7 +221,7 @@ class RewardGuild(UI):
|
|||||||
choices = dict()
|
choices = dict()
|
||||||
|
|
||||||
for i, option in enumerate(options):
|
for i, option in enumerate(options):
|
||||||
# Options sorted sequentially
|
# Options already sorted sequentially
|
||||||
# Button indexes are in sync
|
# Button indexes are in sync
|
||||||
btn_key = f'GUILD_EXCHANGE_{i + 1}'
|
btn_key = f'GUILD_EXCHANGE_{i + 1}'
|
||||||
btn = globals()[btn_key]
|
btn = globals()[btn_key]
|
||||||
@@ -237,11 +237,12 @@ class RewardGuild(UI):
|
|||||||
if grade in GRADES:
|
if grade in GRADES:
|
||||||
item_weight = item_priority.index(grade)
|
item_weight = item_priority.index(grade)
|
||||||
item_cost = ITEM_TO_COST.get(grade)
|
item_cost = ITEM_TO_COST.get(grade)
|
||||||
|
|
||||||
plate_priority = grade_to_plate_priorities.get(grade)
|
plate_priority = grade_to_plate_priorities.get(grade)
|
||||||
for j, plate in enumerate(plate_priority):
|
plate_name = option[5:-2]
|
||||||
if plate in option:
|
if plate_name in plate_priority:
|
||||||
plate_weight = j
|
plate_weight = plate_priority.index(plate_name)
|
||||||
break
|
|
||||||
# Did weight update? If so, then valid
|
# Did weight update? If so, then valid
|
||||||
# Otherwise, configure to skip by set absurd cost
|
# Otherwise, configure to skip by set absurd cost
|
||||||
if plate_weight == len(DEFAULT_PLATE_PRIORITY):
|
if plate_weight == len(DEFAULT_PLATE_PRIORITY):
|
||||||
|
|||||||
Reference in New Issue
Block a user