Skip to content

Commit d312a6f

Browse files
committed
make look around error message clearer. also fix lack of newlines in error messages. (closes #28)
1 parent 18552f6 commit d312a6f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/fantasy_forge/l10n/en/main.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ look-at-message = You look at { INTER($object) }.
1111
entity-not-seen = There is no { $entity }.
1212
look-around-begin = You take a look around the { $area_name }. It is { $area_description }. You see:
1313
look-around-single = * { INTER($object) }
14+
incomplete-look = This is not a valid command. try "look around" instead.
1415
pick-up-item-menu = Please select your option:
1516
pick-up-item-message = You picked up { INTER($item) } and put it in your inventory.
1617
entity-does-not-exist = { $entity } does not exist.

src/fantasy_forge/shell.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ def completenames(self, text, *ignored):
7777
def default(self, line: str):
7878
if len(line) < 3:
7979
"""Display an error message, because the command was invalid."""
80-
self.stdout.write(self.messages.l10n.format_value("shell-invalid-command"))
80+
self.stdout.write(
81+
self.messages.l10n.format_value("shell-invalid-command") + "\n"
82+
)
8183

8284
else:
8385
"""Check for potential typos and recommend closest command"""
@@ -88,6 +90,7 @@ def default(self, line: str):
8890
self.messages.l10n.format_value(
8991
"shell-invalid-command-suggest", {"closest_cmd": closest_cmd}
9092
)
93+
+ "\n"
9194
)
9295

9396
def do_EOF(self, arg: str) -> bool:
@@ -138,7 +141,7 @@ def do_look(self, arg: str):
138141
self.player.look_around()
139142
logger.debug("%s looks around" % self.player.name)
140143
else:
141-
self.default(arg)
144+
self.stdout.write(self.messages.l10n.format_value("incomplete-look") + "\n")
142145

143146
def complete_look(
144147
self,

0 commit comments

Comments
 (0)