From dc611d41c2a9b3a9f59dba601296a4f08f2f8d51 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sat, 16 Mar 2024 10:56:34 -0400 Subject: Add tooltips for map art display. --- mapman/src/painter.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mapman/src') diff --git a/mapman/src/painter.cpp b/mapman/src/painter.cpp index 5b3ad3b..3dafee6 100644 --- a/mapman/src/painter.cpp +++ b/mapman/src/painter.cpp @@ -105,6 +105,11 @@ void map_painter::set_map_id(int pos, bool populated, int id, bool user_input) QPixmapCache::insert(QString("map_%1").arg(id), pm); } auto p = s->addPixmap(pm); + auto m = l->get_map(id); + p->setToolTip(QString("%1\nId #%2%3") + .arg(m.custom_name.empty() ? QString("Map") : QString::fromStdString(m.custom_name)) + .arg(m.id) + .arg(m.locked ? "\nLocked" : "")); int x = pos / hc; int y = pos % hc; p->setPos(y * 128, x * 128); -- cgit v1.2.3