Copy/paste bugfixes
This commit is contained in:
parent
0b1f419142
commit
bb921dc613
|
@ -55,6 +55,7 @@ void CPasteNodesCommand::redo()
|
|||
CMemoryInStream In(rkNode.InstanceData.data(), rkNode.InstanceData.size(), IOUtil::eBigEndian);
|
||||
CScriptObject *pInstance = CScriptLoader::LoadInstance(In, pArea, mpLayer, pArea->Version(), true);
|
||||
pArea->AddInstanceToArea(pInstance);
|
||||
mpLayer->AddInstance(pInstance);
|
||||
|
||||
pInstance->SetPosition(rkNode.Position + mPastePoint);
|
||||
pInstance->SetRotation(rkNode.Rotation.ToEuler());
|
||||
|
@ -107,7 +108,9 @@ void CPasteNodesCommand::redo()
|
|||
CScriptObject *pReceiver = pLink->Receiver();
|
||||
if (pSender) pSender->RemoveLink(eOutgoing, pLink);
|
||||
if (pReceiver) pReceiver->RemoveLink(eIncoming, pLink);
|
||||
|
||||
delete pLink;
|
||||
iLink--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,6 +227,9 @@ void CWorldEditor::SetArea(CWorld *pWorld, CGameArea *pArea)
|
|||
Log::Write("Loaded level: World " + mpWorld->Source() + " / Area " + mpArea->Source() + " (" + TO_TSTRING(LevelName) + ")");
|
||||
}
|
||||
|
||||
// Update paste action
|
||||
OnClipboardDataModified();
|
||||
|
||||
// Emit signals
|
||||
emit LayersModified();
|
||||
}
|
||||
|
@ -650,8 +653,9 @@ void CWorldEditor::GizmoModeChanged(CGizmo::EGizmoMode mode)
|
|||
// ************ PRIVATE SLOTS ************
|
||||
void CWorldEditor::OnClipboardDataModified()
|
||||
{
|
||||
const QMimeData *pkMimeData = qApp->clipboard()->mimeData();
|
||||
bool ValidMimeData = (qobject_cast<const CNodeCopyMimeData*>(pkMimeData) != nullptr);
|
||||
const QMimeData *pkClipboardMimeData = qApp->clipboard()->mimeData();
|
||||
const CNodeCopyMimeData *pkMimeData = qobject_cast<const CNodeCopyMimeData*>(pkClipboardMimeData);
|
||||
bool ValidMimeData = (pkMimeData && pkMimeData->Game() == CurrentGame());
|
||||
ui->ActionPaste->setEnabled(ValidMimeData);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue