Change hint whenever the T key is pressed or not

This commit is contained in:
Yohann D'ANELLO 2021-01-08 15:07:35 +01:00
parent 28a6532a21
commit 1270640619
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
4 changed files with 47 additions and 33 deletions

View File

@ -15,16 +15,16 @@ class StatsDisplay(Display):
""" """
A class to handle the display of the stats of the player. A class to handle the display of the stats of the player.
""" """
game: Game
player: Player player: Player
settings: Settings
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.pad = self.newpad(self.rows, self.cols) self.pad = self.newpad(self.rows, self.cols)
def update(self, game: Game) -> None: def update(self, game: Game) -> None:
self.game = game
self.player = game.player self.player = game.player
self.settings = game.settings
def update_pad(self) -> None: def update_pad(self) -> None:
string2 = f"{_(self.player.name).capitalize()} " \ string2 = f"{_(self.player.name).capitalize()} " \
@ -83,7 +83,7 @@ class StatsDisplay(Display):
if self.player.map.tiles[self.player.y][self.player.x].is_ladder(): if self.player.map.tiles[self.player.y][self.player.x].is_ladder():
msg = _("Use {key} to use the ladder") \ msg = _("Use {key} to use the ladder") \
.format(key=self.settings.KEY_LADDER.upper()) .format(key=self.game.settings.KEY_LADDER.upper())
self.addstr(self.pad, self.height - 2, 0, msg, self.addstr(self.pad, self.height - 2, 0, msg,
italic=True, reverse=True) italic=True, reverse=True)
@ -91,8 +91,10 @@ class StatsDisplay(Display):
for entity in self.player.map.find_entities(FriendlyEntity): for entity in self.player.map.find_entities(FriendlyEntity):
if entity.y == self.player.y + dy \ if entity.y == self.player.y + dy \
and entity.x == self.player.x + dx: and entity.x == self.player.x + dx:
msg = _("Use {key} then move to talk to the entity") \ msg = _("Move to the friendly entity to talk to it") \
.format(key=self.settings.KEY_CHAT.upper()) if self.game.waiting_for_friendly_key else \
_("Use {key} then move to talk to the entity") \
.format(key=self.game.settings.KEY_CHAT.upper())
self.addstr(self.pad, self.height - 1, 0, msg, self.addstr(self.pad, self.height - 1, 0, msg,
italic=True, reverse=True) italic=True, reverse=True)

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: squirrelbattle 3.14.1\n" "Project-Id-Version: squirrelbattle 3.14.1\n"
"Report-Msgid-Bugs-To: squirrel-battle@crans.org\n" "Report-Msgid-Bugs-To: squirrel-battle@crans.org\n"
"POT-Creation-Date: 2021-01-08 14:59+0100\n" "POT-Creation-Date: 2021-01-08 15:04+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -49,36 +49,40 @@ msgstr "BESTAND"
msgid "STALL" msgid "STALL"
msgstr "STAND" msgstr "STAND"
#: squirrelbattle/display/statsdisplay.py:44 #: squirrelbattle/display/statsdisplay.py:46
msgid "Inventory:" msgid "Inventory:"
msgstr "Bestand:" msgstr "Bestand:"
#: squirrelbattle/display/statsdisplay.py:61 #: squirrelbattle/display/statsdisplay.py:63
msgid "Equipped main:" msgid "Equipped main:"
msgstr "" msgstr ""
#: squirrelbattle/display/statsdisplay.py:65 #: squirrelbattle/display/statsdisplay.py:67
msgid "Equipped secondary:" msgid "Equipped secondary:"
msgstr "" msgstr ""
#: squirrelbattle/display/statsdisplay.py:70 #: squirrelbattle/display/statsdisplay.py:72
msgid "Equipped chestplate:" msgid "Equipped chestplate:"
msgstr "" msgstr ""
#: squirrelbattle/display/statsdisplay.py:74 #: squirrelbattle/display/statsdisplay.py:76
msgid "Equipped helmet:" msgid "Equipped helmet:"
msgstr "" msgstr ""
#: squirrelbattle/display/statsdisplay.py:81 #: squirrelbattle/display/statsdisplay.py:83
msgid "YOU ARE DEAD" msgid "YOU ARE DEAD"
msgstr "SIE WURDEN GESTORBEN" msgstr "SIE WURDEN GESTORBEN"
#: squirrelbattle/display/statsdisplay.py:85 #: squirrelbattle/display/statsdisplay.py:87
#, python-brace-format #, python-brace-format
msgid "Use {key} to use the ladder" msgid "Use {key} to use the ladder"
msgstr "" msgstr ""
#: squirrelbattle/display/statsdisplay.py:94 #: squirrelbattle/display/statsdisplay.py:96
msgid "Move to the friendly entity to talk to it"
msgstr ""
#: squirrelbattle/display/statsdisplay.py:98
#, python-brace-format #, python-brace-format
msgid "Use {key} then move to talk to the entity" msgid "Use {key} then move to talk to the entity"
msgstr "" msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: squirrelbattle 3.14.1\n" "Project-Id-Version: squirrelbattle 3.14.1\n"
"Report-Msgid-Bugs-To: squirrel-battle@crans.org\n" "Report-Msgid-Bugs-To: squirrel-battle@crans.org\n"
"POT-Creation-Date: 2021-01-08 14:59+0100\n" "POT-Creation-Date: 2021-01-08 15:04+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -49,36 +49,40 @@ msgstr "INVENTORIO"
msgid "STALL" msgid "STALL"
msgstr "PUESTO" msgstr "PUESTO"
#: squirrelbattle/display/statsdisplay.py:44 #: squirrelbattle/display/statsdisplay.py:46
msgid "Inventory:" msgid "Inventory:"
msgstr "Inventorio :" msgstr "Inventorio :"
#: squirrelbattle/display/statsdisplay.py:61 #: squirrelbattle/display/statsdisplay.py:63
msgid "Equipped main:" msgid "Equipped main:"
msgstr "" msgstr ""
#: squirrelbattle/display/statsdisplay.py:65 #: squirrelbattle/display/statsdisplay.py:67
msgid "Equipped secondary:" msgid "Equipped secondary:"
msgstr "" msgstr ""
#: squirrelbattle/display/statsdisplay.py:70 #: squirrelbattle/display/statsdisplay.py:72
msgid "Equipped chestplate:" msgid "Equipped chestplate:"
msgstr "" msgstr ""
#: squirrelbattle/display/statsdisplay.py:74 #: squirrelbattle/display/statsdisplay.py:76
msgid "Equipped helmet:" msgid "Equipped helmet:"
msgstr "" msgstr ""
#: squirrelbattle/display/statsdisplay.py:81 #: squirrelbattle/display/statsdisplay.py:83
msgid "YOU ARE DEAD" msgid "YOU ARE DEAD"
msgstr "ERES MUERTO" msgstr "ERES MUERTO"
#: squirrelbattle/display/statsdisplay.py:85 #: squirrelbattle/display/statsdisplay.py:87
#, python-brace-format #, python-brace-format
msgid "Use {key} to use the ladder" msgid "Use {key} to use the ladder"
msgstr "" msgstr ""
#: squirrelbattle/display/statsdisplay.py:94 #: squirrelbattle/display/statsdisplay.py:96
msgid "Move to the friendly entity to talk to it"
msgstr ""
#: squirrelbattle/display/statsdisplay.py:98
#, python-brace-format #, python-brace-format
msgid "Use {key} then move to talk to the entity" msgid "Use {key} then move to talk to the entity"
msgstr "" msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: squirrelbattle 3.14.1\n" "Project-Id-Version: squirrelbattle 3.14.1\n"
"Report-Msgid-Bugs-To: squirrel-battle@crans.org\n" "Report-Msgid-Bugs-To: squirrel-battle@crans.org\n"
"POT-Creation-Date: 2021-01-08 14:59+0100\n" "POT-Creation-Date: 2021-01-08 15:04+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -43,39 +43,43 @@ msgstr "INVENTAIRE"
msgid "STALL" msgid "STALL"
msgstr "STAND" msgstr "STAND"
#: squirrelbattle/display/statsdisplay.py:44 #: squirrelbattle/display/statsdisplay.py:46
msgid "Inventory:" msgid "Inventory:"
msgstr "Inventaire :" msgstr "Inventaire :"
#: squirrelbattle/display/statsdisplay.py:61 #: squirrelbattle/display/statsdisplay.py:63
msgid "Equipped main:" msgid "Equipped main:"
msgstr "Équipement principal :" msgstr "Équipement principal :"
#: squirrelbattle/display/statsdisplay.py:65 #: squirrelbattle/display/statsdisplay.py:67
msgid "Equipped secondary:" msgid "Equipped secondary:"
msgstr "Équipement secondaire :" msgstr "Équipement secondaire :"
#: squirrelbattle/display/statsdisplay.py:70 #: squirrelbattle/display/statsdisplay.py:72
msgid "Equipped chestplate:" msgid "Equipped chestplate:"
msgstr "Plastron équipé :" msgstr "Plastron équipé :"
#: squirrelbattle/display/statsdisplay.py:74 #: squirrelbattle/display/statsdisplay.py:76
msgid "Equipped helmet:" msgid "Equipped helmet:"
msgstr "Casque équipé :" msgstr "Casque équipé :"
#: squirrelbattle/display/statsdisplay.py:81 #: squirrelbattle/display/statsdisplay.py:83
msgid "YOU ARE DEAD" msgid "YOU ARE DEAD"
msgstr "VOUS ÊTES MORT" msgstr "VOUS ÊTES MORT"
#: squirrelbattle/display/statsdisplay.py:85 #: squirrelbattle/display/statsdisplay.py:87
#, python-brace-format #, python-brace-format
msgid "Use {key} to use the ladder" msgid "Use {key} to use the ladder"
msgstr "Appuyez sur {key} pour utiliser l'échelle" msgstr "Appuyez sur {key} pour utiliser l'échelle"
#: squirrelbattle/display/statsdisplay.py:94 #: squirrelbattle/display/statsdisplay.py:96
msgid "Move to the friendly entity to talk to it"
msgstr "Avancez vers l'entité pour lui parler"
#: squirrelbattle/display/statsdisplay.py:98
#, python-brace-format #, python-brace-format
msgid "Use {key} then move to talk to the entity" msgid "Use {key} then move to talk to the entity"
msgstr "Appuyez sur {key} puis déplacez-vous pour parler à l'entité" msgstr "Appuyez sur {key} puis déplacez-vous pour parler"
#. TODO #. TODO
#: squirrelbattle/entities/friendly.py:33 #: squirrelbattle/entities/friendly.py:33