@@ -453,8 +453,26 @@ def load_boff_stations(self, environment: str):
453453 self .widgets .build ['space' ]['boff_labels' ][boff_id ].setCurrentText (boff_text )
454454 for ability , slot in zip (boff_data , self .widgets .build ['space' ]['boffs' ][boff_id ]):
455455 if ability is not None and ability != '' :
456- tooltip = self .cache .boff_abilities ['all' ][ability ['item' ]]
457- slot .set_item_full (image (self , ability ['item' ]), None , tooltip )
456+ tooltip = self .cache .boff_abilities ['all' ].get (ability ['item' ], None )
457+ if tooltip is None :
458+ new_name = self .cache .item_aliases ['boff_abilities' ].get (
459+ ability ['item' ], None )
460+ if new_name is None :
461+ slot .clear ()
462+ else :
463+ tooltip = self .cache .boff_abilities ['all' ].get (new_name , None )
464+ if tooltip is None :
465+ slot .clear ()
466+ else :
467+ slot .set_item_full (image (self , new_name ), None , tooltip )
468+ for id , old_ability in enumerate (boff_data ):
469+ if not isinstance (old_ability , dict ):
470+ continue
471+ if ability ['item' ] == old_ability ['item' ]:
472+ self .build ['space' ]['boffs' ][boff_id ][id ]['item' ] = new_name
473+ break
474+ else :
475+ slot .set_item_full (image (self , ability ['item' ]), None , tooltip )
458476 else :
459477 slot .clear ()
460478 elif environment == 'ground' :
@@ -465,8 +483,27 @@ def load_boff_stations(self, environment: str):
465483 self .build ['ground' ]['boff_specs' ][boff_id ])
466484 for ability , slot in zip (boff_data , self .widgets .build ['ground' ]['boffs' ][boff_id ]):
467485 if ability is not None and ability != '' :
468- tooltip = self .cache .boff_abilities ['all' ][ability ['item' ]]
469- slot .set_item_full (image (self , ability ['item' ]), None , tooltip )
486+ tooltip = self .cache .boff_abilities ['all' ].get (ability ['item' ], None )
487+ if tooltip is None :
488+ new_name = self .cache .item_aliases ['boff_abilities' ].get (
489+ ability ['item' ], None )
490+ if new_name is None :
491+ slot .clear ()
492+ else :
493+ tooltip = self .cache .boff_abilities ['all' ].get (new_name , None )
494+ if tooltip is None :
495+ slot .clear ()
496+ else :
497+ slot .set_item_full (image (self , new_name ), None , tooltip )
498+ for id , old_ability in enumerate (boff_data ):
499+ if not isinstance (old_ability , dict ):
500+ continue
501+ if ability ['item' ] == old_ability ['item' ]:
502+ self .build ['ground' ]['boffs' ][boff_id ][id ]['item' ] = (
503+ new_name )
504+ break
505+ else :
506+ slot .set_item_full (image (self , ability ['item' ]), None , tooltip )
470507 else :
471508 slot .clear ()
472509
0 commit comments