@@ -1380,28 +1380,35 @@ screen boop_capture_overlay(label_boop):
13801380
13811381 python :
13821382 # Define variables locally for clarity and safety
1383- interaction_manager = store.EP_interaction_manager
1384- nose_zone_key = store.mas_interactions.ZONE_EXTRA_NOSE
1385- current_zoom = store.mas_sprites.zoom_level
1386- nose_cz = interaction_manager.cz_manager.get(
1387- nose_zone_key,
1388- current_zoom
1389- )
1390-
1383+ # Use try/except for compatibility with older MAS versions
13911384 nose_zone = None
1392- if nose_cz and not nose_cz.disabled:
1393- corners = nose_cz.corners
1394- if corners:
1395- min_x = min (x for x, y in corners) # NOQA
1396- min_y = min (y for x, y in corners) # NOQA
1397- max_x = max (x for x, y in corners) # NOQA
1398- max_y = max (y for x, y in corners) # NOQA
1399- nose_zone = {
1400- ' x' : min_x,
1401- ' y' : min_y,
1402- ' w' : max_x - min_x,
1403- ' h' : max_y - min_y
1404- }
1385+ try :
1386+ interaction_manager = store.EP_interaction_manager
1387+ # Check if zones are enabled (disabled on older MAS versions)
1388+ if interaction_manager._zones_enabled and interaction_manager.cz_manager:
1389+ nose_zone_key = store.mas_interactions.ZONE_EXTRA_NOSE
1390+ current_zoom = store.mas_sprites.zoom_level
1391+ nose_cz = interaction_manager.cz_manager.get(
1392+ nose_zone_key,
1393+ current_zoom
1394+ )
1395+
1396+ if nose_cz and not nose_cz.disabled:
1397+ corners = nose_cz.corners
1398+ if corners:
1399+ min_x = min (x for x, y in corners) # NOQA
1400+ min_y = min (y for x, y in corners) # NOQA
1401+ max_x = max (x for x, y in corners) # NOQA
1402+ max_y = max (y for x, y in corners) # NOQA
1403+ nose_zone = {
1404+ ' x' : min_x,
1405+ ' y' : min_y,
1406+ ' w' : max_x - min_x,
1407+ ' h' : max_y - min_y
1408+ }
1409+ except (AttributeError , TypeError ):
1410+ # Older MAS version - zones not available
1411+ pass
14051412
14061413 # Render invisible imagebutton only over the nose
14071414 if nose_zone:
0 commit comments