Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Example of use of the list_node menu node decorator
- from evennia.utils.evmenu import list_node
- # as part of a menu node list - decorate a node with the options.
- # any extra options added in the node will also be added to resulsing
- # node. Example:
- @list_node(all_typeclasses_list, callable_when_selecting_option)
- def typeclass_node(caller, raw_input, **kwargs):
- text = "Set the prototype's Typeclass."
- return text, {}
- # ... will produce this menu node in-game:
- __________________________________________________________________________________________________________
- Set the prototype's Typeclass.
- __________________________________________________________________________________________________________
- 1: evennia.objects.objects.DefaultCharacter 8: evennia.scripts.scripts.ScriptBase
- 2: evennia.objects.objects.DefaultExit 9: evennia.scripts.scripts.Store
- 3: evennia.objects.objects.DefaultObject 10: evennia.utils.gametime.TimeScript
- 4: evennia.objects.objects.DefaultRoom current: (2/4)
- 5: evennia.scripts.models.ScriptDB previous page
- 6: evennia.scripts.scripts.DefaultScript next page
- 7: evennia.scripts.scripts.DoNothing
- # The listing is multi-page and you can flip between the pages before selecting and handle
- # the choice using the callable you give to the @decorator.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement