mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 19:29:56 +00:00
FIX: tooltips lose some of the relevant information if not stored as a QString
This commit is contained in:
parent
763e88817a
commit
bc3c3bbc9c
2 changed files with 20 additions and 19 deletions
|
@ -60,24 +60,6 @@
|
||||||
#include "pagedworldspacewidget.hpp"
|
#include "pagedworldspacewidget.hpp"
|
||||||
#include "worldspacewidget.hpp"
|
#include "worldspacewidget.hpp"
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
constexpr std::string_view sInstanceModeTooltip = R"(
|
|
||||||
Instance editing
|
|
||||||
<ul><li>Use {scene-select-primary} and {scene-select-secondary} to select and unselect instances</li>
|
|
||||||
<li>Use {scene-edit-primary} to manipulate instances</li>
|
|
||||||
<li>Use {scene-select-tertiary} to select a reference object and then {scene-edit-secondary} to snap
|
|
||||||
selection relative to the reference object</li>
|
|
||||||
<li>Use {scene-submode-move}, {scene-submode-rotate}, {scene-submode-scale} to change to move, rotate, and
|
|
||||||
scale modes respectively</li>
|
|
||||||
<li>Use {scene-axis-x}, {scene-axis-y}, and {scene-axis-z} to lock changes to X, Y, and Z axes
|
|
||||||
respectively</li>
|
|
||||||
<li>Use {scene-delete} to delete currently selected objects</li>
|
|
||||||
<li>Use {scene-duplicate} to duplicate instances</li>
|
|
||||||
<li>Use {scene-instance-drop} to drop instances</li></ul>
|
|
||||||
)";
|
|
||||||
}
|
|
||||||
|
|
||||||
int CSVRender::InstanceMode::getSubModeFromId(const std::string& id) const
|
int CSVRender::InstanceMode::getSubModeFromId(const std::string& id) const
|
||||||
{
|
{
|
||||||
return id == "move" ? 0 : (id == "rotate" ? 1 : 2);
|
return id == "move" ? 0 : (id == "rotate" ? 1 : 2);
|
||||||
|
@ -312,10 +294,28 @@ void CSVRender::InstanceMode::setDragAxis(const char axis)
|
||||||
mDragAxis = newDragAxis;
|
mDragAxis = newDragAxis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString CSVRender::InstanceMode::getTooltip()
|
||||||
|
{
|
||||||
|
return QString(
|
||||||
|
"Instance editing"
|
||||||
|
"<ul><li>Use {scene-select-primary} and {scene-select-secondary} to select and unselect instances</li>"
|
||||||
|
"<li>Use {scene-edit-primary} to manipulate instances</li>"
|
||||||
|
"<li>Use {scene-select-tertiary} to select a reference object and then {scene-edit-secondary} to snap "
|
||||||
|
"selection relative to the reference object</li>"
|
||||||
|
"<li>Use {scene-submode-move}, {scene-submode-rotate}, {scene-submode-scale} to change to move, "
|
||||||
|
"rotate, and "
|
||||||
|
"scale modes respectively</li>"
|
||||||
|
"<li>Use {scene-axis-x}, {scene-axis-y}, and {scene-axis-z} to lock changes to X, Y, and Z axes "
|
||||||
|
"respectively</li>"
|
||||||
|
"<li>Use {scene-delete} to delete currently selected objects</li>"
|
||||||
|
"<li>Use {scene-duplicate} to duplicate instances</li>"
|
||||||
|
"<li>Use {scene-instance-drop} to drop instances</li></ul>");
|
||||||
|
}
|
||||||
|
|
||||||
CSVRender::InstanceMode::InstanceMode(
|
CSVRender::InstanceMode::InstanceMode(
|
||||||
WorldspaceWidget* worldspaceWidget, osg::ref_ptr<osg::Group> parentNode, QWidget* parent)
|
WorldspaceWidget* worldspaceWidget, osg::ref_ptr<osg::Group> parentNode, QWidget* parent)
|
||||||
: EditMode(worldspaceWidget, Misc::ScalableIcon::load(":scenetoolbar/editing-instance"),
|
: EditMode(worldspaceWidget, Misc::ScalableIcon::load(":scenetoolbar/editing-instance"),
|
||||||
Mask_Reference | Mask_Terrain, sInstanceModeTooltip.data(), parent)
|
Mask_Reference | Mask_Terrain, getTooltip(), parent)
|
||||||
, mSubMode(nullptr)
|
, mSubMode(nullptr)
|
||||||
, mSubModeId("move")
|
, mSubModeId("move")
|
||||||
, mSelectionMode(nullptr)
|
, mSelectionMode(nullptr)
|
||||||
|
|
|
@ -53,6 +53,7 @@ namespace CSVRender
|
||||||
std::vector<osg::Vec3> mObjectsAtDragStart;
|
std::vector<osg::Vec3> mObjectsAtDragStart;
|
||||||
CSMWorld::IdTable* mSelectionGroups;
|
CSMWorld::IdTable* mSelectionGroups;
|
||||||
|
|
||||||
|
QString getTooltip();
|
||||||
int getSubModeFromId(const std::string& id) const;
|
int getSubModeFromId(const std::string& id) const;
|
||||||
|
|
||||||
osg::Vec3 quatToEuler(const osg::Quat& quat) const;
|
osg::Vec3 quatToEuler(const osg::Quat& quat) const;
|
||||||
|
|
Loading…
Reference in a new issue