From 4b8a42f341a290b24ead46dbee7f03be812f0083 Mon Sep 17 00:00:00 2001 From: parax0 Date: Mon, 7 Mar 2016 21:13:44 -0700 Subject: [PATCH] Draw the edit link line when picking from the modify tab --- src/Editor/WorldEditor/CWorldEditor.cpp | 4 +++- src/Editor/WorldEditor/WModifyTab.cpp | 2 ++ src/Editor/WorldEditor/WModifyTab.h | 3 +++ src/Editor/WorldEditor/WModifyTab.ui | 6 ++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Editor/WorldEditor/CWorldEditor.cpp b/src/Editor/WorldEditor/CWorldEditor.cpp index 556acf7d..26543c08 100644 --- a/src/Editor/WorldEditor/CWorldEditor.cpp +++ b/src/Editor/WorldEditor/CWorldEditor.cpp @@ -511,6 +511,8 @@ void CWorldEditor::UpdateNewLinkLine() } else if (mIsMakingLink && mpNewLinkSender) pSender = mpNewLinkSender; + else if (ui->ModifyTabContents->IsPicking() && ui->ModifyTabContents->EditNode()->NodeType() == eScriptNode) + pSender = static_cast(ui->ModifyTabContents->EditNode())->Object(); // No sender and no receiver = no line if (!pSender && !pReceiver) @@ -526,7 +528,7 @@ void CWorldEditor::UpdateNewLinkLine() // Compensate for missing sender or missing receiver else { - if (ui->MainViewport->underMouse() && !ui->MainViewport->IsMouseInputActive() && (mIsMakingLink || mpLinkDialog->IsPicking())) + if (ui->MainViewport->underMouse() && !ui->MainViewport->IsMouseInputActive() && (mIsMakingLink || mpLinkDialog->IsPicking() || ui->ModifyTabContents->IsPicking())) { CSceneNode *pHoverNode = ui->MainViewport->HoverNode(); CScriptObject *pInst = (pSender ? pSender : pReceiver); diff --git a/src/Editor/WorldEditor/WModifyTab.cpp b/src/Editor/WorldEditor/WModifyTab.cpp index 3c94278d..b9f79d41 100644 --- a/src/Editor/WorldEditor/WModifyTab.cpp +++ b/src/Editor/WorldEditor/WModifyTab.cpp @@ -136,11 +136,13 @@ void WModifyTab::OnLinksSelectionModified() { u32 NumSelectedRows = ui->InLinksTableView->selectionModel()->selectedRows().size(); ui->EditIncomingConnectionButton->setEnabled(NumSelectedRows == 1); + ui->DeleteIncomingConnectionButton->setEnabled(NumSelectedRows > 0); } else { u32 NumSelectedRows = ui->OutLinksTableView->selectionModel()->selectedRows().size(); ui->EditOutgoingConnectionButton->setEnabled(NumSelectedRows == 1); + ui->DeleteOutgoingConnectionButton->setEnabled(NumSelectedRows > 0); } } diff --git a/src/Editor/WorldEditor/WModifyTab.h b/src/Editor/WorldEditor/WModifyTab.h index d60ee8fd..cd6964f9 100644 --- a/src/Editor/WorldEditor/WModifyTab.h +++ b/src/Editor/WorldEditor/WModifyTab.h @@ -50,6 +50,9 @@ public slots: void OnDeleteLinksClicked(); void OnEditLinkClicked(); + inline bool IsPicking() const { return mIsPicking; } + inline CSceneNode* EditNode() const { return mpSelectedNode; } + private: Ui::WModifyTab *ui; diff --git a/src/Editor/WorldEditor/WModifyTab.ui b/src/Editor/WorldEditor/WModifyTab.ui index f6cad0d9..2a38a69a 100644 --- a/src/Editor/WorldEditor/WModifyTab.ui +++ b/src/Editor/WorldEditor/WModifyTab.ui @@ -218,6 +218,9 @@ + + false + Qt::StrongFocus @@ -335,6 +338,9 @@ + + false + Qt::StrongFocus