| 2076 | } |
| 2077 | |
| 2078 | void WorldEditor::on3DMouseUp( const Gui3DMouseEvent &event ) |
| 2079 | { |
| 2080 | //If we have an active tool and it's intercepted our input, bail out |
| 2081 | if (mActiveEditorTool != nullptr && mActiveEditorTool->onMouseUp(event)) |
| 2082 | return; |
| 2083 | |
| 2084 | const bool wasUsingAxisGizmo = mUsingAxisGizmo; |
| 2085 | |
| 2086 | mMouseDown = false; |
| 2087 | mStuckToGround = false; |
| 2088 | mSoftSnapIsStuck = false; |
| 2089 | mSoftSnapActivated = false; |
| 2090 | mUsingAxisGizmo = false; |
| 2091 | mGizmo->on3DMouseUp(event); |
| 2092 | |
| 2093 | // Restore grid snap if we temporarily toggled it. |
| 2094 | |
| 2095 | if( mDragGridSnapToggle ) |
| 2096 | { |
| 2097 | mDragGridSnapToggle = false; |
| 2098 | const bool snapToGrid = !mGridSnap; |
| 2099 | mGridSnap = snapToGrid; |
| 2100 | mGizmo->getProfile()->snapToGrid = snapToGrid; |
| 2101 | } |
| 2102 | |
| 2103 | // check if selecting objects.... |
| 2104 | if ( mDragSelect ) |
| 2105 | { |
| 2106 | mDragSelect = false; |
| 2107 | mPossibleHitObject = NULL; |
| 2108 | |
| 2109 | const bool addToSelection = ( event.modifier & ( SI_RANGESELECT | SI_MULTISELECT ) ); |
| 2110 | |
| 2111 | // add all the objects from the drag selection into the normal selection |
| 2112 | if( !addToSelection ) |
| 2113 | clearSelection(); |
| 2114 | |
| 2115 | if ( mDragSelected->size() > 1 ) |
| 2116 | { |
| 2117 | for ( U32 i = 0; i < mDragSelected->size(); i++ ) |
| 2118 | mSelected->addObject( ( *mDragSelected )[i] ); |
| 2119 | |
| 2120 | Con::executef( this, "onMultiSelect", mDragSelected->getIdString(), addToSelection ? "1" : "0" ); |
| 2121 | mDragSelected->clear(); |
| 2122 | |
| 2123 | SimObject *obj = NULL; |
| 2124 | if ( mRedirectID ) |
| 2125 | obj = Sim::findObject( mRedirectID ); |
| 2126 | Con::executef( obj ? obj : this, "onClick", ( *mSelected )[ 0 ]->getIdString() ); |
| 2127 | } |
| 2128 | else if ( mDragSelected->size() == 1 ) |
| 2129 | { |
| 2130 | mSelected->addObject( ( *mDragSelected )[0] ); |
| 2131 | Con::executef( this, "onSelect", ( *mDragSelected )[ 0 ]->getIdString() ); |
| 2132 | mDragSelected->clear(); |
| 2133 | |
| 2134 | SimObject *obj = NULL; |
| 2135 | if ( mRedirectID ) |
nothing calls this directly
no test coverage detected