You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the EvMenu class takes a slew of input kwargs to manipulate its function:
nodetext_formatter
options_formatter,
node_formatter
input_parser
The suggestion is to (again) move these back as methods in the EvMenu object and instead of supplying them as functions, simply make a child class from EvMenu and replace the methods as needed.
Reasons for adding feature:
Pros:
Class inheritance is how Evennia works elsewhere. EvMenu is the only major system plugging in functions in the __init__ call like this. It makes for an inconsistent API that would be resolved by moving the methods into the EvMenu object.
It's a lot harder to read the code when the formatters/parsers are elsewhere; the formatters also defaults to long names (dedent_strip_nodetext_formatter etc) that are hard to read.
Inheriting from the EvMenu class is more powerful and flexible. A node formatter cannot be inherited while as a method you could use super() to use part of the parent's functionality.
Inheriting also makes it clear to devs that you could tweak other parts of EvMenu to your needs.
Cons:
This is a backwards incompatible change. Existing EvMenu customizations need to be updated to use child classes of EvMenu instead.
Extra information, such as Evennia revision/repo/branch, operating system and ideas for how to solve / implement:
This is something that will go into the development branch for Evennia 0.7.
The text was updated successfully, but these errors were encountered:
The EvEditor does also have functions along these lines, in the form of the save/load/code/quitfuncs. But those tend to be considerably less complex than the formatting functions of the EvMenu.
Description of requested feature:
Currently the EvMenu class takes a slew of input kwargs to manipulate its function:
nodetext_formatter
options_formatter
,node_formatter
input_parser
The suggestion is to (again) move these back as methods in the
EvMenu
object and instead of supplying them as functions, simply make a child class from EvMenu and replace the methods as needed.Reasons for adding feature:
Pros:
__init__
call like this. It makes for an inconsistent API that would be resolved by moving the methods into the EvMenu object.dedent_strip_nodetext_formatter
etc) that are hard to read.Cons:
Extra information, such as Evennia revision/repo/branch, operating system and ideas for how to solve / implement:
This is something that will go into the development branch for Evennia 0.7.
The text was updated successfully, but these errors were encountered: