Help command: don't use EvMore if help text is shown in popup
This commit is contained in:
parent
91fd754e98
commit
ba42c68c5c
1 changed files with 21 additions and 13 deletions
|
|
@ -42,19 +42,33 @@ class CmdHelp(Command):
|
||||||
# the current cmdset with the call to self.func().
|
# the current cmdset with the call to self.func().
|
||||||
return_cmdset = True
|
return_cmdset = True
|
||||||
|
|
||||||
|
# Help messages are wrapped in an EvMore call (unless using the webclient
|
||||||
# Help messages are wrapped in an EvMore call. If you want to
|
# with separate help popups) If you want to avoid this, simply set the
|
||||||
# avoid this, simply set the 'help_more' flag to False.
|
# 'help_more' flag to False.
|
||||||
help_more = True
|
help_more = True
|
||||||
|
|
||||||
|
|
||||||
def msg_help(self, text):
|
def msg_help(self, text):
|
||||||
"""
|
"""
|
||||||
messages text to the caller, adding an extra oob argument to indicate
|
messages text to the caller, adding an extra oob argument to indicate
|
||||||
that this is a help command result and could be rendered in a separate
|
that this is a help command result and could be rendered in a separate
|
||||||
help window
|
help window
|
||||||
"""
|
"""
|
||||||
self.msg((text, {"window": "help"}));
|
if type(self).help_more:
|
||||||
|
usemore = True
|
||||||
|
|
||||||
|
if self.session.protocol_key in ("websocket", "ajax/comet"):
|
||||||
|
try:
|
||||||
|
options = self.caller.player.db._saved_webclient_options
|
||||||
|
if options["helppopup"]:
|
||||||
|
usemore = False
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if usemore:
|
||||||
|
evmore.msg(self.caller, text)
|
||||||
|
return
|
||||||
|
|
||||||
|
self.msg((text, {"window": "help"}))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def format_help_entry(title, help_text, aliases=None, suggested=None):
|
def format_help_entry(title, help_text, aliases=None, suggested=None):
|
||||||
|
|
@ -209,9 +223,6 @@ class CmdHelp(Command):
|
||||||
match[0].__doc__,
|
match[0].__doc__,
|
||||||
aliases=match[0].aliases,
|
aliases=match[0].aliases,
|
||||||
suggested=suggestions)
|
suggested=suggestions)
|
||||||
if type(self).help_more:
|
|
||||||
evmore.msg(caller, formatted)
|
|
||||||
else:
|
|
||||||
self.msg_help(formatted)
|
self.msg_help(formatted)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -222,9 +233,6 @@ class CmdHelp(Command):
|
||||||
match[0].entrytext,
|
match[0].entrytext,
|
||||||
aliases=match[0].aliases.all(),
|
aliases=match[0].aliases.all(),
|
||||||
suggested=suggestions)
|
suggested=suggestions)
|
||||||
if type(self).help_more:
|
|
||||||
evmore.msg(caller, formatted)
|
|
||||||
else:
|
|
||||||
self.msg_help(formatted)
|
self.msg_help(formatted)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue