diff --git a/apps/opencs/view/render/instancemode.cpp b/apps/opencs/view/render/instancemode.cpp
index 615ca42aa1..7a59222eff 100644
--- a/apps/opencs/view/render/instancemode.cpp
+++ b/apps/opencs/view/render/instancemode.cpp
@@ -60,6 +60,24 @@
#include "pagedworldspacewidget.hpp"
#include "worldspacewidget.hpp"
+namespace
+{
+ constexpr std::string_view sInstanceModeTooltip = R"(
+ Instance editing
+
- Use {scene-select-primary} and {scene-select-secondary} to select and unselect instances
+ - Use {scene-edit-primary} to manipulate instances
+ - Use {scene-select-tertiary} to select a reference object and then {scene-edit-secondary} to snap
+ selection relative to the reference object
+ - Use {scene-submode-move}, {scene-submode-rotate}, {scene-submode-scale} to change to move, rotate, and
+ scale modes respectively
+ - Use {scene-axis-x}, {scene-axis-y}, and {scene-axis-z} to lock changes to X, Y, and Z axes
+ respectively
+ - Use {scene-delete} to delete currently selected objects
+ - Use {scene-duplicate} to duplicate instances
+ - Use {scene-instance-drop} to drop instances
+)";
+}
+
int CSVRender::InstanceMode::getSubModeFromId(const std::string& id) const
{
return id == "move" ? 0 : (id == "rotate" ? 1 : 2);
@@ -297,7 +315,7 @@ void CSVRender::InstanceMode::setDragAxis(const char axis)
CSVRender::InstanceMode::InstanceMode(
WorldspaceWidget* worldspaceWidget, osg::ref_ptr parentNode, QWidget* parent)
: EditMode(worldspaceWidget, Misc::ScalableIcon::load(":scenetoolbar/editing-instance"),
- Mask_Reference | Mask_Terrain, getTooltip(), parent)
+ Mask_Reference | Mask_Terrain, sInstanceModeTooltip.data(), parent)
, mSubMode(nullptr)
, mSubModeId("move")
, mSelectionMode(nullptr)
@@ -345,23 +363,6 @@ CSVRender::InstanceMode::InstanceMode(
qOverload<>(&CSMPrefs::Shortcut::activated), this, [this, axis] { this->setDragAxis(axis); });
}
-QString CSVRender::InstanceMode::getTooltip()
-{
- return QString(
- "Instance editing"
- "- Use {scene-select-primary} and {scene-select-secondary} to select and unselect instances
"
- "- Use {scene-edit-primary} to manipulate instances
"
- "- Use {scene-select-tertiary} to select a reference object and then {scene-edit-secondary} to snap "
- "selection relative to the reference object
"
- "- Use {scene-submode-move}, {scene-submode-rotate}, {scene-submode-scale} to change to move, rotate, and "
- "scale modes respectively
"
- "- Use {scene-axis-x}, {scene-axis-y}, and {scene-axis-z} to lock changes to X, Y, and Z axes "
- "respectively
"
- "- Use {scene-delete} to delete currently selected objects
"
- "- Use {scene-duplicate} to duplicate instances
"
- "- Use {scene-instance-drop} to drop instances
");
-}
-
void CSVRender::InstanceMode::activate(CSVWidget::SceneToolbar* toolbar)
{
if (!mSubMode)
diff --git a/apps/opencs/view/render/instancemode.hpp b/apps/opencs/view/render/instancemode.hpp
index ae7be10322..193423efd5 100644
--- a/apps/opencs/view/render/instancemode.hpp
+++ b/apps/opencs/view/render/instancemode.hpp
@@ -74,8 +74,6 @@ namespace CSVRender
InstanceMode(
WorldspaceWidget* worldspaceWidget, osg::ref_ptr parentNode, QWidget* parent = nullptr);
- QString getTooltip();
-
void activate(CSVWidget::SceneToolbar* toolbar) override;
void deactivate(CSVWidget::SceneToolbar* toolbar) override;