From ab9022044408be24aa28da3c55f281a3bef9f721 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Sun, 12 Nov 2017 00:52:06 +0000 Subject: [PATCH] Use new style for menu definitions Convert menus to the new data model. --- share/menu.yaml | 217 ++++++++++++++++++++++++++------------------------------ 1 file changed, 102 insertions(+), 115 deletions(-) diff --git a/share/menu.yaml b/share/menu.yaml index 347f8d0..60a838b 100644 --- a/share/menu.yaml +++ b/share/menu.yaml @@ -6,118 +6,105 @@ _desc: This is the standard library of menu definitions. _lock: true -menu:activate_avatar: - action: user.activate_avatar_by_index(int(choice)-1) - action_a: pass - branch_a: main_utility - choice_a: abort selection - create: dict([(str(x+1),y) for x,y in enumerate(user.list_avatar_names())]) - default: "1" - description: This is the list of avatars available for you to awaken. - prompt: Whom would you like to awaken? - -menu:active: - -menu:checking_new_account_name: - action_d: user.account.destroy() - action_g: user.account.destroy() - branch_d: disconnecting - branch_g: entering_account_name - branch_n: entering_new_password - choice_d: disconnect now - choice_g: go back - choice_n: new account - default: d - description: There is no existing account for "$(account)" (note that an account name is not the same as a character name). Would you like to create a new account by this name, go back and enter a different name or disconnect now? - prompt: "Enter your choice:" - -menu:checking_password: - echo: off - error_incorrect: Incorrect password, please try again... - prompt: "Password:" - -menu:choose_gender: - action: user.avatar.set("gender", user.menu_choices[choice]) - branch: choose_name - choice_f: female - choice_m: male - description: First, your new avatar needs a birth gender. Avatars are one of male or female at birth. - prompt: "Pick a birth gender for your new avatar:" - -menu:choose_name: - action: user.avatar.set("name", user.menu_choices[choice]) - branch: main_utility - branch_g: choose_name - choice_g: generate more names - create_1: random_name() - create_2: random_name() - create_3: random_name() - create_4: random_name() - create_5: random_name() - create_6: random_name() - create_7: random_name() - default: g - description: Your new avatar needs a name. This will be the name with which $(tpsp) grew up, and will initially be the name by which $(tpsp) is known to others. There are ways for your new avatar to make a name for $(tpop)self over time, so $(tpsp) won't be stuck going by such an unremarkable name forever. - prompt: "Choose a name for $(tpop):" - -menu:delete_account: - action_y: user.destroy() - branch_n: main_utility - branch_y: disconnecting - choice_n: no, don't delete my account - choice_y: yes, permanently delete my account - default: n - description: By deleting your account, all your avatars will also be permanently deleted. - prompt: Are you certain you wish to permanently delete your account? - -menu:delete_avatar: - action: user.delete_avatar(user.account.get("avatars")[int(choice)-1]) - action_a: pass - branch: main_utility - branch_a: main_utility - choice_a: abort selection - create: dict([(str(x+1),y) for x,y in enumerate(user.list_avatar_names())]) - default: a - description: This is the list of avatars available for you to delete. - prompt: Whom would you like to delete? - -menu:disconnecting: - prompt: $(red)Disconnecting...$(nrm)$(eol) - -menu:disconnecting_duplicates: - prompt: $(red)Closing your previous connection...$(nrm)$(eol) - -menu:entering_account_name: - description: $(inc:login.txt) - error_bad_name: Your account name needs to contain only digits (0-9) and letters (a-z). - prompt: "Identify yourself:" - -menu:entering_new_password: - echo: off - error_weak: That is a weak password... Try something at least 7 characters long with a combination of mixed-case letters, numbers and punctuation/spaces. - prompt: 'Enter a new password for "$(account)":' - error_differs: The two passwords did not match. Try again... - -menu:initial: - -menu:main_utility: - action_c: user.new_avatar() - branch_a: activate_avatar - branch_c: choose_gender - branch_d: delete_avatar - branch_l: disconnecting - branch_p: delete_account - choice_a: awaken an existing avatar - choice_c: create a new avatar - choice_d: delete an unwanted avatar - choice_l: leave for now - choice_p: permanently remove your account - demand_a: user.account.get("avatars") - demand_c: len(user.account.get("avatars")) < universe.contents["mudpy.limit"].get("avatars") - demand_d: user.account.get("avatars") - 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. - prompt: What would you like to do? - -menu:verifying_new_password: - echo: off - prompt: "Enter the same new password again:" +menu.activate_avatar.action: user.activate_avatar_by_index(int(choice)-1) +menu.activate_avatar.action_a: pass +menu.activate_avatar.branch_a: main_utility +menu.activate_avatar.choice_a: abort selection +menu.activate_avatar.create: dict([(str(x+1),y) for x,y in enumerate(user.list_avatar_names())]) +menu.activate_avatar.default: "1" +menu.activate_avatar.description: This is the list of avatars available for you to awaken. +menu.activate_avatar.prompt: Whom would you like to awaken? + +menu.active.prompt: + +menu.checking_new_account_name.action_d: user.account.destroy() +menu.checking_new_account_name.action_g: user.account.destroy() +menu.checking_new_account_name.branch_d: disconnecting +menu.checking_new_account_name.branch_g: entering_account_name +menu.checking_new_account_name.branch_n: entering_new_password +menu.checking_new_account_name.choice_d: disconnect now +menu.checking_new_account_name.choice_g: go back +menu.checking_new_account_name.choice_n: new account +menu.checking_new_account_name.default: d +menu.checking_new_account_name.description: There is no existing account for "$(account)" (note that an account name is not the same as a character name). Would you like to create a new account by this name, go back and enter a different name or disconnect now? +menu.checking_new_account_name.prompt: "Enter your choice:" + +menu.checking_password.echo: off +menu.checking_password.error_incorrect: Incorrect password, please try again... +menu.checking_password.prompt: "Password:" + +menu.choose_gender.action: user.avatar.set("gender", user.menu_choices[choice]) +menu.choose_gender.branch: choose_name +menu.choose_gender.choice_f: female +menu.choose_gender.choice_m: male +menu.choose_gender.description: First, your new avatar needs a birth gender. Avatars are one of male or female at birth. +menu.choose_gender.prompt: "Pick a birth gender for your new avatar:" + +menu.choose_name.action: user.avatar.set("name", user.menu_choices[choice]) +menu.choose_name.branch: main_utility +menu.choose_name.branch_g: choose_name +menu.choose_name.choice_g: generate more names +menu.choose_name.create_1: random_name() +menu.choose_name.create_2: random_name() +menu.choose_name.create_3: random_name() +menu.choose_name.create_4: random_name() +menu.choose_name.create_5: random_name() +menu.choose_name.create_6: random_name() +menu.choose_name.create_7: random_name() +menu.choose_name.default: g +menu.choose_name.description: Your new avatar needs a name. This will be the name with which $(tpsp) grew up, and will initially be the name by which $(tpsp) is known to others. There are ways for your new avatar to make a name for $(tpop)self over time, so $(tpsp) won't be stuck going by such an unremarkable name forever. +menu.choose_name.prompt: "Choose a name for $(tpop):" + +menu.delete_account.action_y: user.destroy() +menu.delete_account.branch_n: main_utility +menu.delete_account.branch_y: disconnecting +menu.delete_account.choice_n: no, don't delete my account +menu.delete_account.choice_y: yes, permanently delete my account +menu.delete_account.default: n +menu.delete_account.description: By deleting your account, all your avatars will also be permanently deleted. +menu.delete_account.prompt: Are you certain you wish to permanently delete your account? + +menu.delete_avatar.action: user.delete_avatar(user.account.get("avatars")[int(choice)-1]) +menu.delete_avatar.action_a: pass +menu.delete_avatar.branch: main_utility +menu.delete_avatar.branch_a: main_utility +menu.delete_avatar.choice_a: abort selection +menu.delete_avatar.create: dict([(str(x+1),y) for x,y in enumerate(user.list_avatar_names())]) +menu.delete_avatar.default: a +menu.delete_avatar.description: This is the list of avatars available for you to delete. +menu.delete_avatar.prompt: Whom would you like to delete? + +menu.disconnecting.prompt: $(red)Disconnecting...$(nrm)$(eol) + +menu.disconnecting_duplicates.prompt: $(red)Closing your previous connection...$(nrm)$(eol) + +menu.entering_account_name.description: $(inc:login.txt) +menu.entering_account_name.error_bad_name: Your account name needs to contain only digits (0-9) and letters (a-z). +menu.entering_account_name.prompt: "Identify yourself:" + +menu.entering_new_password.echo: off +menu.entering_new_password.error_weak: That is a weak password... Try something at least 7 characters long with a combination of mixed-case letters, numbers and punctuation/spaces. +menu.entering_new_password.prompt: 'Enter a new password for "$(account)":' +menu.entering_new_password.error_differs: The two passwords did not match. Try again... + +menu.active.initial: + +menu.main_utility.action_c: user.new_avatar() +menu.main_utility.branch_a: activate_avatar +menu.main_utility.branch_c: choose_gender +menu.main_utility.branch_d: delete_avatar +menu.main_utility.branch_l: disconnecting +menu.main_utility.branch_p: delete_account +menu.main_utility.choice_a: awaken an existing avatar +menu.main_utility.choice_c: create a new 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.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. +menu.main_utility.prompt: What would you like to do? + +menu.verifying_new_password.echo: off +menu.verifying_new_password.prompt: "Enter the same new password again:" -- 2.11.0