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:
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;
|
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: ");
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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:
|
||||||
|
|
||||||
|
|
|
@ -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 "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue