1 """Utility functions for menu operation."""
3 # Copyright (c) 2019 mudpy authors. Permission to use, copy,
4 # modify, and distribute this software is granted under terms
5 # provided in the LICENSE file distributed with this software.
8 def activate_avatar_action(user):
9 """Activate the selected avatar in the activate_avatar state."""
10 return user.activate_avatar_by_index(int(user.choice) - 1)
13 def activate_avatar_action_a(user):
14 """Abort selection by doing nothing."""
18 def activate_avatar_create(user):
19 """List available avatars as choices for the activate_avatar state."""
21 [(str(x + 1), y) for x, y in enumerate(user.list_avatar_names())])