Qt prompt responses in message window

When Qt issues a prompt string in the message window, update it
with the player's response once that has been obtained.
This commit is contained in:
PatR
2020-08-31 00:30:36 -07:00
parent 1f953fa959
commit 2a762ab641
4 changed files with 36 additions and 3 deletions

View File

@@ -62,7 +62,10 @@ void NetHackQtMessageWindow::Scroll(int dx UNUSED, int dy UNUSED)
void NetHackQtMessageWindow::Clear()
{
if ( map )
if (list)
NetHackQtMessageWindow::unhighlight_mesgs();
if (map)
map->clearMessages();
}
@@ -146,6 +149,16 @@ void NetHackQtMessageWindow::PutStr(int attr, const QString& text)
map->putMessage(attr, text2);
}
// append the user's answer to a prompt message
void NetHackQtMessageWindow::AddToStr(const char *answer)
{
if (list) {
QListWidgetItem *item = list->currentItem();
if (item)
item->setText(item->text() + QString(" %1").arg(answer));
}
}
// are there any highlighted messages?
bool NetHackQtMessageWindow::hilit_mesgs()
{