Added shortcut for toggling relative snap.

This commit is contained in:
leo 2014-06-18 01:14:45 +00:00
parent 64fab2886e
commit c48adc095b
5 changed files with 21 additions and 2 deletions

View file

@ -14,10 +14,9 @@ lcGroup::~lcGroup()
void lcGroup::FileLoad(lcFile* File)
{
lcuint8 Version;
lcint32 GroupIndex;
Version = File->ReadU8();
File->ReadU8();
File->ReadBuffer(m_strName, 65);
File->ReadVector3();
File->ReadS32(&GroupIndex, 1);

View file

@ -277,6 +277,13 @@ lcCommand gCommands[LC_NUM_COMMANDS] =
"Allows movement and rotation in all directions",
""
},
// LC_EDIT_SNAP_RELATIVE
{
"Edit.SnapRelative",
"Relative Snap",
"Enable relative movement and rotation",
""
},
// LC_EDIT_SNAP_X
{
"Edit.Snap.SnapX",

View file

@ -44,6 +44,7 @@ enum LC_COMMANDS
LC_EDIT_LOCK_Z,
LC_EDIT_LOCK_TOGGLE,
LC_EDIT_LOCK_NONE,
LC_EDIT_SNAP_RELATIVE,
LC_EDIT_SNAP_X,
LC_EDIT_SNAP_Y,
LC_EDIT_SNAP_Z,

View file

@ -5424,6 +5424,15 @@ void Project::HandleCommand(LC_COMMANDS id)
gMainWindow->SetAddKeys(!gMainWindow->GetAddKeys());
break;
case LC_EDIT_SNAP_RELATIVE:
if (m_nSnap & LC_DRAW_GLOBAL_SNAP)
m_nSnap &= ~LC_DRAW_GLOBAL_SNAP;
else
m_nSnap |= LC_DRAW_GLOBAL_SNAP;
gMainWindow->UpdateLockSnap(m_nSnap);
gMainWindow->UpdateAllViews();
break;
case LC_EDIT_SNAP_X:
if (m_nSnap & LC_DRAW_SNAP_X)
m_nSnap &= ~LC_DRAW_SNAP_X;

View file

@ -150,6 +150,7 @@ void lcQMainWindow::createActions()
actions[LC_EDIT_LOCK_X]->setCheckable(true);
actions[LC_EDIT_LOCK_Y]->setCheckable(true);
actions[LC_EDIT_LOCK_Z]->setCheckable(true);
actions[LC_EDIT_SNAP_RELATIVE]->setCheckable(true);
actions[LC_EDIT_SNAP_X]->setCheckable(true);
actions[LC_EDIT_SNAP_Y]->setCheckable(true);
actions[LC_EDIT_SNAP_Z]->setCheckable(true);
@ -387,6 +388,7 @@ void lcQMainWindow::createToolBars()
standardToolBar->addAction(actions[LC_EDIT_COPY]);
standardToolBar->addAction(actions[LC_EDIT_PASTE]);
standardToolBar->addSeparator();
// standardToolBar->addAction(actions[LC_EDIT_SNAP_RELATIVE]);
standardToolBar->addAction(actions[LC_EDIT_LOCK_TOGGLE]);
standardToolBar->addAction(actions[LC_EDIT_SNAP_TOGGLE]);
standardToolBar->addAction(actions[LC_EDIT_SNAP_ANGLE]);
@ -1150,6 +1152,7 @@ void lcQMainWindow::setAddKeys(bool addKeys)
void lcQMainWindow::updateLockSnap(lcuint32 snap)
{
actions[LC_EDIT_SNAP_RELATIVE]->setChecked((snap & LC_DRAW_GLOBAL_SNAP) == 0);
actions[LC_EDIT_SNAP_X]->setChecked((snap & LC_DRAW_SNAP_X) != 0);
actions[LC_EDIT_SNAP_Y]->setChecked((snap & LC_DRAW_SNAP_Y) != 0);
actions[LC_EDIT_SNAP_Z]->setChecked((snap & LC_DRAW_SNAP_Z) != 0);