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.
"""
game: Game
player: Player
settings: Settings
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.pad = self.newpad(self.rows, self.cols)
def update(self, game: Game) -> None:
self.game = game
self.player = game.player
self.settings = game.settings
def update_pad(self) -> None:
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():
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,
italic=True, reverse=True)
@ -91,8 +91,10 @@ class StatsDisplay(Display):
for entity in self.player.map.find_entities(FriendlyEntity):
if entity.y == self.player.y + dy \
and entity.x == self.player.x + dx:
msg = _("Use {key} then move to talk to the entity") \
.format(key=self.settings.KEY_CHAT.upper())
msg = _("Move to the friendly entity to talk to it") \
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,
italic=True, reverse=True)

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: squirrelbattle 3.14.1\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -49,36 +49,40 @@ msgstr "BESTAND"
msgid "STALL"
msgstr "STAND"
#: squirrelbattle/display/statsdisplay.py:44
#: squirrelbattle/display/statsdisplay.py:46
msgid "Inventory:"
msgstr "Bestand:"
#: squirrelbattle/display/statsdisplay.py:61
#: squirrelbattle/display/statsdisplay.py:63
msgid "Equipped main:"
msgstr ""
#: squirrelbattle/display/statsdisplay.py:65
#: squirrelbattle/display/statsdisplay.py:67
msgid "Equipped secondary:"
msgstr ""
#: squirrelbattle/display/statsdisplay.py:70
#: squirrelbattle/display/statsdisplay.py:72
msgid "Equipped chestplate:"
msgstr ""
#: squirrelbattle/display/statsdisplay.py:74
#: squirrelbattle/display/statsdisplay.py:76
msgid "Equipped helmet:"
msgstr ""
#: squirrelbattle/display/statsdisplay.py:81
#: squirrelbattle/display/statsdisplay.py:83
msgid "YOU ARE DEAD"
msgstr "SIE WURDEN GESTORBEN"
#: squirrelbattle/display/statsdisplay.py:85
#: squirrelbattle/display/statsdisplay.py:87
#, python-brace-format
msgid "Use {key} to use the ladder"
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
msgid "Use {key} then move to talk to the entity"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: squirrelbattle 3.14.1\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -49,36 +49,40 @@ msgstr "INVENTORIO"
msgid "STALL"
msgstr "PUESTO"
#: squirrelbattle/display/statsdisplay.py:44
#: squirrelbattle/display/statsdisplay.py:46
msgid "Inventory:"
msgstr "Inventorio :"
#: squirrelbattle/display/statsdisplay.py:61
#: squirrelbattle/display/statsdisplay.py:63
msgid "Equipped main:"
msgstr ""
#: squirrelbattle/display/statsdisplay.py:65
#: squirrelbattle/display/statsdisplay.py:67
msgid "Equipped secondary:"
msgstr ""
#: squirrelbattle/display/statsdisplay.py:70
#: squirrelbattle/display/statsdisplay.py:72
msgid "Equipped chestplate:"
msgstr ""
#: squirrelbattle/display/statsdisplay.py:74
#: squirrelbattle/display/statsdisplay.py:76
msgid "Equipped helmet:"
msgstr ""
#: squirrelbattle/display/statsdisplay.py:81
#: squirrelbattle/display/statsdisplay.py:83
msgid "YOU ARE DEAD"
msgstr "ERES MUERTO"
#: squirrelbattle/display/statsdisplay.py:85
#: squirrelbattle/display/statsdisplay.py:87
#, python-brace-format
msgid "Use {key} to use the ladder"
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
msgid "Use {key} then move to talk to the entity"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: squirrelbattle 3.14.1\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -43,39 +43,43 @@ msgstr "INVENTAIRE"
msgid "STALL"
msgstr "STAND"
#: squirrelbattle/display/statsdisplay.py:44
#: squirrelbattle/display/statsdisplay.py:46
msgid "Inventory:"
msgstr "Inventaire :"
#: squirrelbattle/display/statsdisplay.py:61
#: squirrelbattle/display/statsdisplay.py:63
msgid "Equipped main:"
msgstr "Équipement principal :"
#: squirrelbattle/display/statsdisplay.py:65
#: squirrelbattle/display/statsdisplay.py:67
msgid "Equipped secondary:"
msgstr "Équipement secondaire :"
#: squirrelbattle/display/statsdisplay.py:70
#: squirrelbattle/display/statsdisplay.py:72
msgid "Equipped chestplate:"
msgstr "Plastron équipé :"
#: squirrelbattle/display/statsdisplay.py:74
#: squirrelbattle/display/statsdisplay.py:76
msgid "Equipped helmet:"
msgstr "Casque équipé :"
#: squirrelbattle/display/statsdisplay.py:81
#: squirrelbattle/display/statsdisplay.py:83
msgid "YOU ARE DEAD"
msgstr "VOUS ÊTES MORT"
#: squirrelbattle/display/statsdisplay.py:85
#: squirrelbattle/display/statsdisplay.py:87
#, python-brace-format
msgid "Use {key} to use the ladder"
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
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
#: squirrelbattle/entities/friendly.py:33