"""List available avatars for possible deletion."""
return dict(
[(str(x + 1), y) for x, y in enumerate(user.list_avatar_names())])
+
+
+def main_utility_action_c(user):
+ """Create a new avatar."""
+ return user.new_avatar()
+
+
+def main_utility_demand_a(user):
+ """Only include avatar activation if the account has avatars."""
+ return user.account.get("avatars")
+
+
+def main_utility_demand_c(user):
+ """Only include avatar creation if avatar count is below the limit."""
+ return (len(user.account.get("avatars")) <
+ mudpy.misc.universe.contents["mudpy.limit"].get("avatars"))
+
+
+def main_utility_demand_d(user):
+ """Only include avatar deletion if the account has avatars."""
+ return user.account.get("avatars")
menu.telopt_negotiation.prompt:
-menu.main_utility.action_c: user.new_avatar()
+menu.main_utility.action_c: mudpy.menu.main_utility_action_c(user)
menu.main_utility.branch_a: activate_avatar
menu.main_utility.branch_c: choose_gender
menu.main_utility.branch_d: delete_avatar
menu.main_utility.choice_d: delete an unwanted avatar
menu.main_utility.choice_l: leave for now
menu.main_utility.choice_p: permanently remove your account
-menu.main_utility.demand_a: user.account.get("avatars")
-menu.main_utility.demand_c: len(user.account.get("avatars")) <
- universe.contents["mudpy.limit"].get("avatars")
-menu.main_utility.demand_d: user.account.get("avatars")
+menu.main_utility.demand_a: mudpy.menu.main_utility_demand_a(user)
+menu.main_utility.demand_c: mudpy.menu.main_utility_demand_c(user)
+menu.main_utility.demand_d: mudpy.menu.main_utility_demand_d(user)
menu.main_utility.description: $(red)$(inc:banner.txt)$(nrm)$(eol)$(eol)From
here you can awaken, create and delete avatars. An avatar is your persona
in the World. You can also leave or permanently delete your account.