CommonClient: Move command marker to last_autofillable_command (#4907)

* handle autocomplete command when press question

* fix test

* add docstring to get_input_text_from_response

* fix line lenght
This commit is contained in:
Jérémie Bolduc
2025-10-04 23:39:30 -04:00
committed by GitHub
parent a2460b7fe7
commit f07fea2771
3 changed files with 17 additions and 8 deletions

View File

@@ -838,15 +838,15 @@ class GameManager(ThemedApp):
self.log_panels: typing.Dict[str, Widget] = {}
# keep track of last used command to autofill on click
self.last_autofillable_command = "hint"
autofillable_commands = ("hint_location", "hint", "getitem")
self.last_autofillable_command = "!hint"
autofillable_commands = ("!hint_location", "!hint", "!getitem")
original_say = ctx.on_user_say
def intercept_say(text):
text = original_say(text)
if text:
for command in autofillable_commands:
if text.startswith("!" + command):
if text.startswith(command):
self.last_autofillable_command = command
break
return text