From: Jeremy Stanley Date: Tue, 27 May 2014 23:01:24 +0000 (+0000) Subject: Convert menu data file to YAML X-Git-Tag: 0.0.1~239 X-Git-Url: https://mudpy.org/gitweb?a=commitdiff_plain;h=bf97afa561464e1609dc01571ddc4f19a0c22273;p=mudpy.git Convert menu data file to YAML --- diff --git a/etc/mudpy.conf b/etc/mudpy.conf index d6f07f3..86e656f 100644 --- a/etc/mudpy.conf +++ b/etc/mudpy.conf @@ -3,7 +3,7 @@ # terms provided in the LICENSE file distributed with this software. [__control__] -default_files = { "account": "account.mpy", "actor": "actor.mpy", "area": "area.mpy", "command": "command.yaml", "internal": "internal.mpy", "menu": "menu.mpy", "other": "other.mpy", "prop": "prop.mpy" } +default_files = { "account": "account.mpy", "actor": "actor.mpy", "area": "area.mpy", "command": "command.yaml", "internal": "internal.mpy", "menu": "menu.yaml", "other": "other.mpy", "prop": "prop.mpy" } include_dirs = "sample" include_files = "archetype.yaml" private_files = "account.mpy" diff --git a/share/menu.mpy b/share/menu.mpy deleted file mode 100644 index ce664cf..0000000 --- a/share/menu.mpy +++ /dev/null @@ -1,123 +0,0 @@ -# Copyright (c) 2004-2010 Jeremy Stanley . Permission -# to use, copy, modify, and distribute this software is granted under -# terms provided in the LICENSE file distributed with this software. - -[__control__] -read_only = yes - -[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 gender. In the world of Example, all avatars are either male or female. -prompt = Pick a 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 in the world of Example. 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.getlist("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 example for now -choice_p = permanently remove your account -demand_a = user.account.getlist("avatars") -demand_c = len(user.account.getlist("avatars")) < universe.categories["internal"]["limits"].getint("max_avatars") -demand_d = user.account.getlist("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 of Example. 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: - diff --git a/share/menu.yaml b/share/menu.yaml new file mode 100644 index 0000000..c022ee4 --- /dev/null +++ b/share/menu.yaml @@ -0,0 +1,122 @@ +# Copyright (c) 2004-2014 Jeremy Stanley . Permission +# to use, copy, modify, and distribute this software is granted under +# terms provided in the LICENSE file distributed with this software. + +__control__: + read_only: yes + +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 gender. In the world of Example, all avatars are either male or female. + prompt: "Pick a 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 in the world of Example. 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.getlist("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 example for now + choice_p: permanently remove your account + demand_a: user.account.getlist("avatars") + demand_c: len(user.account.getlist("avatars")) < universe.categories["internal"]["limits"].getint("max_avatars") + demand_d: user.account.getlist("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 of Example. 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:"