1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 06:53:53 +00:00

Fix pathgrid selection mode not being removed from toolbar.

This commit is contained in:
Aesylwinn 2016-07-25 20:49:28 -04:00
parent 051aec2729
commit 8c5fddf150
2 changed files with 16 additions and 4 deletions

View file

@ -35,10 +35,10 @@ namespace CSVRender
{
return QString(
"Pathgrid editing"
"<ul><li>Primary edit: Add node to scene</li>"
"<li>Secondary edit: Connect selected nodes to node</li>"
"<li>Primary drag: Move selected nodes</li>"
"<li>Secondary drag: Connect one node to another</li>"
"<ul><li>Press {scene-edit-primary} to add a node to the cursor location</li>"
"<li>Press {scene-edit-secondary} to connect the selected nodes to the node beneath the cursor</li>"
"<li>Press {scene-edit-primary} and drag to move selected nodes</li>"
"<li>Press {scene-edit-secondary} and drag to connect one node to another</li>"
"</ul><p>Note: Only a single cell's pathgrid may be edited at a time");
}
@ -53,6 +53,16 @@ namespace CSVRender
toolbar->addTool(mSelectionMode);
}
void PathgridMode::deactivate(CSVWidget::SceneToolbar* toolbar)
{
if (mSelectionMode)
{
toolbar->removeTool (mSelectionMode);
delete mSelectionMode;
mSelectionMode = 0;
}
}
void PathgridMode::primaryEditPressed(const WorldspaceHitResult& hitResult)
{
if (CSMPrefs::get()["3D Scene Input"]["context-select"].isTrue() &&

View file

@ -19,6 +19,8 @@ namespace CSVRender
virtual void activate(CSVWidget::SceneToolbar* toolbar);
virtual void deactivate(CSVWidget::SceneToolbar* toolbar);
virtual void primaryEditPressed(const WorldspaceHitResult& hit);
virtual void secondaryEditPressed(const WorldspaceHitResult& hit);