mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Align character generation tutorial more closely with the code.
This commit is contained in:
parent
ff159e3942
commit
b6d7c2500a
1 changed files with 20 additions and 12 deletions
|
|
@ -354,7 +354,12 @@ def start_chargen(caller, session=None):
|
|||
# this generates all random components of the character
|
||||
tmp_character = TemporaryCharacterSheet()
|
||||
|
||||
EvMenu(caller, menutree, session=session, tmp_character=tmp_character)
|
||||
EvMenu(
|
||||
caller,
|
||||
menutree,
|
||||
session=session,
|
||||
startnode_input=("sgsg", {"tmp_character": tmp_character}),
|
||||
)
|
||||
|
||||
```
|
||||
|
||||
|
|
@ -637,24 +642,27 @@ This is what is called an _end node_, because it returns `None` instead of optio
|
|||
|
||||
```python
|
||||
def start_chargen(caller, session=None):
|
||||
"""
|
||||
This is a start point for spinning up the chargen from a command later.
|
||||
"""
|
||||
This is a start point for spinning up the chargen from a command later.
|
||||
|
||||
"""
|
||||
menutree = { # <----- can now add this!
|
||||
"node_chargen": node_chargen,
|
||||
"node_change_name": node_change_name,
|
||||
"node_swap_abilities": node_swap_abilities,
|
||||
"node_apply_character": node_apply_character
|
||||
"node_chargen": node_chargen,
|
||||
"node_change_name": node_change_name,
|
||||
"node_swap_abilities": node_swap_abilities,
|
||||
"node_apply_character": node_apply_character,
|
||||
}
|
||||
|
||||
|
||||
# this generates all random components of the character
|
||||
tmp_character = TemporaryCharacterSheet()
|
||||
|
||||
EvMenu(caller, menutree, session=session,
|
||||
startnode="node_chargen", # <-----
|
||||
tmp_character=tmp_character)
|
||||
|
||||
EvMenu(
|
||||
caller,
|
||||
menutree,
|
||||
startnode="node_chargen", # <-----
|
||||
session=session,
|
||||
startnode_input=("sgsg", {"tmp_character": tmp_character}),
|
||||
)
|
||||
```
|
||||
|
||||
Now that we have all the nodes, we add them to the `menutree` we left empty before. We only add the nodes, _not_ the goto-helpers! The keys we set in the `menutree` dictionary are the names we should use to point to nodes from inside the menu (and we did).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue