from naja.constants import (
INFO_SIZE, ACT, KEYS, EXAMINE, PALETTE,
ACTION_TEXT_OFFSET, INFO_LEFT_PADDING,
- INFO_RIGHT_PADDING, BIT_SIZE)
+ INFO_RIGHT_PADDING, BIT_SIZE, BITS)
from naja.events import finish_event
from naja.resources import resources
from naja.resources.mutators import EIGHT_BIT, blender
[(x_offset, y_offset), (right, y_offset),
(right, bottom), (x_offset, bottom)], 4)
- if action.required_bits in BIT_MAP:
- img_name = BIT_MAP[action.required_bits].replace(
+ required_keys = action.required_bits & frozenset([
+ BITS.RED, BITS.GREEN, BITS.BLUE])
+ if required_keys in BIT_MAP:
+ img_name = BIT_MAP[required_keys].replace(
'.png', '_small.png')
img = resources.get_image(img_name,
transforms=(EIGHT_BIT,))
self.surface.blit(img, (TILE_SIZE[0] - 20, 0))
def _prepare_lock(self, action, y_offset):
- if action.required_bits not in BIT_MAP:
+ required_keys = action.required_bits & frozenset([
+ BITS.RED, BITS.GREEN, BITS.BLUE])
+ if required_keys not in BIT_MAP:
return 4
- img_name = BIT_MAP[action.required_bits]
+ img_name = BIT_MAP[required_keys]
if self.board_pos != self.state.player.position:
x_offset = 0