mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-19 15:39:49 +00:00
Show number of pathgrid node in a tooltip
To allow users faster understand what node it is.
This commit is contained in:
parent
1f658209f8
commit
8d2cdedc87
9 changed files with 15 additions and 9 deletions
|
@ -23,7 +23,7 @@ CSVRender::CellArrow *CSVRender::CellArrowTag::getCellArrow() const
|
|||
return mArrow;
|
||||
}
|
||||
|
||||
QString CSVRender::CellArrowTag::getToolTip (bool hideBasics) const
|
||||
QString CSVRender::CellArrowTag::getToolTip(bool hideBasics, const WorldspaceHitResult& /*hit*/) const
|
||||
{
|
||||
QString text ("Direction: ");
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace CSVRender
|
|||
|
||||
CellArrow *getCellArrow() const;
|
||||
|
||||
QString getToolTip (bool hideBasics) const override;
|
||||
QString getToolTip(bool hideBasics, const WorldspaceHitResult& hit) const override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ CSVRender::ObjectTag::ObjectTag (Object* 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());
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace CSVRender
|
|||
|
||||
Object* mObject;
|
||||
|
||||
QString getToolTip (bool hideBasics) const override;
|
||||
QString getToolTip (bool hideBasics, const WorldspaceHitResult& hit) const override;
|
||||
};
|
||||
|
||||
class ObjectMarkerTag : public ObjectTag
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "../../model/world/commandmacro.hpp"
|
||||
#include "../../model/world/data.hpp"
|
||||
#include "../../model/world/idtree.hpp"
|
||||
#include "worldspacewidget.hpp"
|
||||
|
||||
namespace CSVRender
|
||||
{
|
||||
|
@ -40,10 +41,13 @@ namespace CSVRender
|
|||
return mPathgrid;
|
||||
}
|
||||
|
||||
QString PathgridTag::getToolTip(bool hideBasics) const
|
||||
QString PathgridTag::getToolTip(bool /*hideBasics*/, const WorldspaceHitResult& hit) const
|
||||
{
|
||||
QString text("Pathgrid: ");
|
||||
text += mPathgrid->getId().c_str();
|
||||
text += " (";
|
||||
text += QString::number(SceneUtil::getPathgridNode(static_cast<unsigned short>(hit.index0)));
|
||||
text += ")";
|
||||
|
||||
return text;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace CSVRender
|
|||
|
||||
Pathgrid* getPathgrid () const;
|
||||
|
||||
QString getToolTip (bool hideBasics) const override;
|
||||
QString getToolTip (bool hideBasics, const WorldspaceHitResult& hit) const override;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ CSVRender::Mask CSVRender::TagBase::getMask() const
|
|||
return mMask;
|
||||
}
|
||||
|
||||
QString CSVRender::TagBase::getToolTip (bool hideBasics) const
|
||||
QString CSVRender::TagBase::getToolTip (bool hideBasics, const WorldspaceHitResult& /*hit*/) const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
namespace CSVRender
|
||||
{
|
||||
struct WorldspaceHitResult;
|
||||
|
||||
class TagBase : public osg::Referenced
|
||||
{
|
||||
Mask mMask;
|
||||
|
@ -19,7 +21,7 @@ namespace CSVRender
|
|||
|
||||
Mask getMask() const;
|
||||
|
||||
virtual QString getToolTip (bool hideBasics) const;
|
||||
virtual QString getToolTip (bool hideBasics, const WorldspaceHitResult& hit) const;
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -592,7 +592,7 @@ void CSVRender::WorldspaceWidget::showToolTip()
|
|||
if (hit.tag)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue