mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
update character creator
This commit is contained in:
parent
3b84ec1b42
commit
421ae46bcd
2 changed files with 28 additions and 7 deletions
|
|
@ -100,15 +100,19 @@ character creator menu, as well as supporting exiting/resuming the process. In
|
||||||
addition, unlike the core command, it's designed for the character name to be
|
addition, unlike the core command, it's designed for the character name to be
|
||||||
chosen later on via the menu, so it won't parse any arguments passed to it.
|
chosen later on via the menu, so it won't parse any arguments passed to it.
|
||||||
|
|
||||||
### Changes to `Account.at_look`
|
### Changes to `Account`
|
||||||
|
|
||||||
The contrib version works mostly the same as core evennia, but adds an
|
The contrib version works mostly the same as core evennia, but modifies `ooc_appearance_template`
|
||||||
additional check to recognize an in-progress character. If you've modified your
|
to match the contrib's command syntax, and the `at_look` method to recognize an in-progress
|
||||||
own `at_look` hook, it's an easy addition to make: just add this section to the
|
character.
|
||||||
|
|
||||||
|
If you've modified your own `at_look` hook, it's an easy change to add: just add this section to the
|
||||||
playable character list loop.
|
playable character list loop.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
# the beginning of the loop starts here
|
||||||
for char in characters:
|
for char in characters:
|
||||||
|
# ...
|
||||||
# contrib code starts here
|
# contrib code starts here
|
||||||
if char.db.chargen_step:
|
if char.db.chargen_step:
|
||||||
# currently in-progress character; don't display placeholder names
|
# currently in-progress character; don't display placeholder names
|
||||||
|
|
|
||||||
|
|
@ -98,10 +98,27 @@ class ContribCmdCharCreate(MuxAccountCommand):
|
||||||
|
|
||||||
class ContribChargenAccount(DefaultAccount):
|
class ContribChargenAccount(DefaultAccount):
|
||||||
"""
|
"""
|
||||||
A modified Account class that makes minor changes to the OOC look
|
A modified Account class that changes the OOC look output to better match the contrib and
|
||||||
output to incorporate in-progress characters.
|
incorporate in-progress characters.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
ooc_appearance_template = """
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
{header}
|
||||||
|
|
||||||
|
{sessions}
|
||||||
|
|
||||||
|
|whelp|n - more commands
|
||||||
|
|wcharcreate|n - create new character
|
||||||
|
|wchardelete <name>|n - delete a character
|
||||||
|
|wic <name>|n - enter the game as character (|wooc|n to get back here)
|
||||||
|
|wic|n - enter the game as latest character controlled.
|
||||||
|
|
||||||
|
{characters}
|
||||||
|
{footer}
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
""".strip()
|
||||||
|
|
||||||
def at_look(self, target=None, session=None, **kwargs):
|
def at_look(self, target=None, session=None, **kwargs):
|
||||||
"""
|
"""
|
||||||
Called when this object executes a look. It allows to customize
|
Called when this object executes a look. It allows to customize
|
||||||
|
|
@ -156,7 +173,7 @@ class ContribChargenAccount(DefaultAccount):
|
||||||
txt_sessions = "|wConnected session(s):|n\n" + "\n".join(sess_strings)
|
txt_sessions = "|wConnected session(s):|n\n" + "\n".join(sess_strings)
|
||||||
|
|
||||||
if not characters:
|
if not characters:
|
||||||
txt_characters = "You don't have a character yet. Use |wcharcreate|n."
|
txt_characters = "You don't have a character yet."
|
||||||
else:
|
else:
|
||||||
max_chars = (
|
max_chars = (
|
||||||
"unlimited"
|
"unlimited"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue