mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
Fix if oneliners
This commit is contained in:
parent
c8c7501d97
commit
ec2ff2a9b0
4 changed files with 22 additions and 11 deletions
|
@ -20,7 +20,8 @@ CSVRender::BrushDraw::BrushDraw(osg::ref_ptr<osg::Group> parentNode, bool textur
|
|||
mGeometry = new osg::Geometry();
|
||||
mBrushDrawNode->addChild(mGeometry);
|
||||
mParentNode->addChild(mBrushDrawNode);
|
||||
if (mTextureMode) mLandSizeFactor = ESM::Land::REAL_SIZE / ESM::Land::LAND_TEXTURE_SIZE;
|
||||
if (mTextureMode)
|
||||
mLandSizeFactor = ESM::Land::REAL_SIZE / ESM::Land::LAND_TEXTURE_SIZE;
|
||||
else mLandSizeFactor = ESM::Land::REAL_SIZE / ESM::Land::LAND_SIZE;
|
||||
}
|
||||
|
||||
|
@ -254,7 +255,8 @@ void CSVRender::BrushDraw::buildCustomGeometry(const float& radius, const osg::V
|
|||
|
||||
void CSVRender::BrushDraw::update(osg::Vec3d point, int brushSize, CSVWidget::BrushShape toolShape)
|
||||
{
|
||||
if (mBrushDrawNode->containsNode(mGeometry)) mBrushDrawNode->removeChild(mGeometry);
|
||||
if (mBrushDrawNode->containsNode(mGeometry))
|
||||
mBrushDrawNode->removeChild(mGeometry);
|
||||
mBrushDrawNode->setNodeMask (SceneUtil::Mask_GUI);
|
||||
float radius = (mLandSizeFactor * brushSize) / 2;
|
||||
osg::Vec3d snapToGridPoint = point;
|
||||
|
@ -301,5 +303,6 @@ void CSVRender::BrushDraw::update(osg::Vec3d point, int brushSize, CSVWidget::Br
|
|||
|
||||
void CSVRender::BrushDraw::hide()
|
||||
{
|
||||
if (mBrushDrawNode->containsNode(mGeometry)) mBrushDrawNode->removeChild(mGeometry);
|
||||
if (mBrushDrawNode->containsNode(mGeometry))
|
||||
mBrushDrawNode->removeChild(mGeometry);
|
||||
}
|
||||
|
|
|
@ -1398,8 +1398,10 @@ void CSVRender::TerrainShapeMode::dragMoveEvent (QDragMoveEvent *event)
|
|||
void CSVRender::TerrainShapeMode::mouseMoveEvent (QMouseEvent *event)
|
||||
{
|
||||
WorldspaceHitResult hit = getWorldspaceWidget().mousePick(event->pos(), getInteractionMask());
|
||||
if (hit.hit && mBrushDraw && !(mShapeEditTool == ShapeEditTool_Drag && mIsEditing)) mBrushDraw->update(hit.worldPos, mBrushSize, mBrushShape);
|
||||
if (!hit.hit && mBrushDraw && !(mShapeEditTool == ShapeEditTool_Drag && mIsEditing)) mBrushDraw->hide();
|
||||
if (hit.hit && mBrushDraw && !(mShapeEditTool == ShapeEditTool_Drag && mIsEditing))
|
||||
mBrushDraw->update(hit.worldPos, mBrushSize, mBrushShape);
|
||||
if (!hit.hit && mBrushDraw && !(mShapeEditTool == ShapeEditTool_Drag && mIsEditing))
|
||||
mBrushDraw->hide();
|
||||
}
|
||||
|
||||
void CSVRender::TerrainShapeMode::setBrushSize(int brushSize)
|
||||
|
|
|
@ -724,8 +724,10 @@ void CSVRender::TerrainTextureMode::dragMoveEvent (QDragMoveEvent *event)
|
|||
void CSVRender::TerrainTextureMode::mouseMoveEvent (QMouseEvent *event)
|
||||
{
|
||||
WorldspaceHitResult hit = getWorldspaceWidget().mousePick(event->pos(), getInteractionMask());
|
||||
if (hit.hit && mBrushDraw) mBrushDraw->update(hit.worldPos, mBrushSize, mBrushShape);
|
||||
if (!hit.hit && mBrushDraw) mBrushDraw->hide();
|
||||
if (hit.hit && mBrushDraw)
|
||||
mBrushDraw->update(hit.worldPos, mBrushSize, mBrushShape);
|
||||
if (!hit.hit && mBrushDraw)
|
||||
mBrushDraw->hide();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -204,10 +204,14 @@ void CSVWidget::TextureBrushWindow::setBrushSize(int brushSize)
|
|||
|
||||
void CSVWidget::TextureBrushWindow::setBrushShape()
|
||||
{
|
||||
if(mButtonPoint->isChecked()) mBrushShape = CSVWidget::BrushShape_Point;
|
||||
if(mButtonSquare->isChecked()) mBrushShape = CSVWidget::BrushShape_Square;
|
||||
if(mButtonCircle->isChecked()) mBrushShape = CSVWidget::BrushShape_Circle;
|
||||
if(mButtonCustom->isChecked()) mBrushShape = CSVWidget::BrushShape_Custom;
|
||||
if (mButtonPoint->isChecked())
|
||||
mBrushShape = CSVWidget::BrushShape_Point;
|
||||
if (mButtonSquare->isChecked())
|
||||
mBrushShape = CSVWidget::BrushShape_Square;
|
||||
if (mButtonCircle->isChecked())
|
||||
mBrushShape = CSVWidget::BrushShape_Circle;
|
||||
if (mButtonCustom->isChecked())
|
||||
mBrushShape = CSVWidget::BrushShape_Custom;
|
||||
emit passBrushShape(mBrushShape);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue