1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 07:09:42 +00:00

Show number of pathgrid node in a tooltip

To allow users faster understand what node it is.
This commit is contained in:
elsid 2021-06-28 00:18:41 +02:00
parent 1f658209f8
commit 8d2cdedc87
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
9 changed files with 15 additions and 9 deletions

View file

@ -23,7 +23,7 @@ CSVRender::CellArrow *CSVRender::CellArrowTag::getCellArrow() const
return mArrow; return mArrow;
} }
QString CSVRender::CellArrowTag::getToolTip (bool hideBasics) const QString CSVRender::CellArrowTag::getToolTip(bool hideBasics, const WorldspaceHitResult& /*hit*/) const
{ {
QString text ("Direction: "); QString text ("Direction: ");

View file

@ -27,7 +27,7 @@ namespace CSVRender
CellArrow *getCellArrow() const; CellArrow *getCellArrow() const;
QString getToolTip (bool hideBasics) const override; QString getToolTip(bool hideBasics, const WorldspaceHitResult& hit) const override;
}; };

View file

@ -61,7 +61,7 @@ CSVRender::ObjectTag::ObjectTag (Object* object)
: TagBase (Mask_Reference), mObject (object) : TagBase (Mask_Reference), mObject (object)
{} {}
QString CSVRender::ObjectTag::getToolTip (bool hideBasics) const QString CSVRender::ObjectTag::getToolTip(bool /*hideBasics*/, const WorldspaceHitResult& /*hit*/) const
{ {
return QString::fromUtf8 (mObject->getReferenceableId().c_str()); return QString::fromUtf8 (mObject->getReferenceableId().c_str());
} }

View file

@ -54,7 +54,7 @@ namespace CSVRender
Object* mObject; Object* mObject;
QString getToolTip (bool hideBasics) const override; QString getToolTip (bool hideBasics, const WorldspaceHitResult& hit) const override;
}; };
class ObjectMarkerTag : public ObjectTag class ObjectMarkerTag : public ObjectTag

View file

@ -16,6 +16,7 @@
#include "../../model/world/commandmacro.hpp" #include "../../model/world/commandmacro.hpp"
#include "../../model/world/data.hpp" #include "../../model/world/data.hpp"
#include "../../model/world/idtree.hpp" #include "../../model/world/idtree.hpp"
#include "worldspacewidget.hpp"
namespace CSVRender namespace CSVRender
{ {
@ -40,10 +41,13 @@ namespace CSVRender
return mPathgrid; return mPathgrid;
} }
QString PathgridTag::getToolTip(bool hideBasics) const QString PathgridTag::getToolTip(bool /*hideBasics*/, const WorldspaceHitResult& hit) const
{ {
QString text("Pathgrid: "); QString text("Pathgrid: ");
text += mPathgrid->getId().c_str(); text += mPathgrid->getId().c_str();
text += " (";
text += QString::number(SceneUtil::getPathgridNode(static_cast<unsigned short>(hit.index0)));
text += ")";
return text; return text;
} }

View file

@ -40,7 +40,7 @@ namespace CSVRender
Pathgrid* getPathgrid () const; Pathgrid* getPathgrid () const;
QString getToolTip (bool hideBasics) const override; QString getToolTip (bool hideBasics, const WorldspaceHitResult& hit) const override;
private: private:

View file

@ -8,7 +8,7 @@ CSVRender::Mask CSVRender::TagBase::getMask() const
return mMask; return mMask;
} }
QString CSVRender::TagBase::getToolTip (bool hideBasics) const QString CSVRender::TagBase::getToolTip (bool hideBasics, const WorldspaceHitResult& /*hit*/) const
{ {
return ""; return "";
} }

View file

@ -9,6 +9,8 @@
namespace CSVRender namespace CSVRender
{ {
struct WorldspaceHitResult;
class TagBase : public osg::Referenced class TagBase : public osg::Referenced
{ {
Mask mMask; Mask mMask;
@ -19,7 +21,7 @@ namespace CSVRender
Mask getMask() const; Mask getMask() const;
virtual QString getToolTip (bool hideBasics) const; virtual QString getToolTip (bool hideBasics, const WorldspaceHitResult& hit) const;
}; };
} }

View file

@ -592,7 +592,7 @@ void CSVRender::WorldspaceWidget::showToolTip()
if (hit.tag) if (hit.tag)
{ {
bool hideBasics = CSMPrefs::get()["Tooltips"]["scene-hide-basic"].isTrue(); bool hideBasics = CSMPrefs::get()["Tooltips"]["scene-hide-basic"].isTrue();
QToolTip::showText (pos, hit.tag->getToolTip (hideBasics), this); QToolTip::showText(pos, hit.tag->getToolTip(hideBasics, hit), this);
} }
} }
} }